/* === Theory Ventures palette === */
:root {
  --dos-bg: #111315;
  --dos-fg: #F8F4F1;
  --dos-highlight: #85CAF8;
  --dos-red: #EB5622;
  --dos-yellow: #EB5622;
  --dos-green: #0AB580;
  --dos-cyan: #85CAF8;
  --dos-magenta: #A7C2D5;
  --dos-gray: #1B2B3A;
  --dos-light-gray: #A7C2D5;

  --block-size: 14px;
  --block-gap: 2px;
  --panel-border: #A7C2D5;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--dos-bg);
  color: var(--dos-fg);
  font-family: "DM Sans", system-ui, sans-serif;
  font-weight: 300;
  font-size: 13px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  user-select: none;
}

/* === Top bar === */
.top-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 12px 6px;
  background: var(--dos-bg);
  border-bottom: 2px solid var(--dos-light-gray);
  flex-shrink: 0;
  gap: 4px;
}

.top-title {
  font-family: "Press Start 2P", "Courier New", monospace;
  font-size: 16px;
  color: var(--dos-fg);
  letter-spacing: 2px;
  text-shadow: 2px 2px 0 #EB5622;
}

.top-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--dos-light-gray);
}

.dos-btn-inline {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 12px;
  color: var(--dos-yellow);
  background: none;
  border: 1px solid transparent;
  padding: 0 4px;
  cursor: pointer;
  text-decoration: underline;
}

.dos-btn-inline:hover {
  color: var(--dos-fg);
  border-color: var(--dos-light-gray);
}

.dos-btn-inline:active {
  color: var(--dos-highlight);
}

.dos-btn-inline:disabled {
  color: var(--dos-gray);
  cursor: default;
  text-decoration: none;
  border-color: transparent;
}

.refresh-status {
  font-size: 11px;
  color: var(--dos-yellow);
  margin-left: 4px;
}

.top-right {
  color: var(--dos-light-gray);
  font-size: 12px;
}

/* === Projects scrollable area === */
.projects-container {
  flex: 1;
  overflow-y: auto;
  padding: 6px 12px;
}

/* === Project section === */
.project-section {
  margin-bottom: 10px;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 4px 8px;
  margin-bottom: 4px;
  background: rgba(255, 255, 255, 0.06);
}

a.project-name {
  font-family: "Spectral", Georgia, serif;
  font-weight: 300;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  color: var(--dos-fg);
  text-decoration: none;
}

a.project-name:hover {
  text-decoration: underline;
  color: var(--dos-yellow);
}

.project-meta {
  font-size: 11px;
  color: var(--dos-light-gray);
}

/* === DOS-style completion bar in project header === */
.project-completion {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.dos-bar {
  width: 120px;
  height: 12px;
  background: var(--dos-bg);
  border: 2px solid var(--dos-light-gray);
  /* Inset shadow for that classic 3D sunken look */
  box-shadow:
    inset 1px 1px 0 var(--dos-gray),
    inset -1px -1px 0 var(--dos-fg);
  position: relative;
  overflow: hidden;
}

.dos-bar-fill {
  height: 100%;
  background: repeating-linear-gradient(
    90deg,
    var(--dos-red) 0px,
    var(--dos-red) 4px,
    var(--dos-bg) 4px,
    var(--dos-bg) 6px
  );
  transition: width 0.4s ease;
}

.dos-bar-label {
  font-size: 11px;
  color: var(--dos-yellow);
  font-weight: bold;
  min-width: 32px;
  text-align: right;
}

/* === Milestone row === */
.milestone-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 3px;
  min-height: 18px;
}

.milestone-label {
  flex-shrink: 0;
  width: 340px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  padding-right: 6px;
  overflow: hidden;
}

a.ms-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--dos-light-gray);
  text-decoration: none;
}

a.ms-name:hover {
  text-decoration: underline;
  color: var(--dos-fg);
}

.ms-progress {
  flex-shrink: 0;
  color: var(--dos-yellow);
  font-size: 10px;
  margin-left: 4px;
}

.milestone-blocks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--block-gap);
  align-items: center;
  flex: 1;
  min-width: 0;
}

.ms-deadline {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--dos-light-gray);
  min-width: 48px;
  text-align: right;
  font-weight: bold;
}

.ms-deadline.overdue {
  color: var(--dos-red);
}

.ms-deadline.complete {
  color: var(--dos-green);
  font-size: 14px;
}

/* === Block states (ticket statuses) === */
.block {
  width: var(--block-size);
  height: var(--block-size);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background-color 0.15s ease;
  cursor: pointer;
}

.block.done {
  background: var(--dos-fg);
}

.block.in_progress {
  background: #FDBEB9;
}

.block.in_review {
  background: var(--dos-green);
}

.block.todo {
  background: var(--dos-highlight);
}

.block.backlog {
  background: var(--dos-magenta);
}

.block.canceled {
  background: var(--dos-red);
}

.block:hover {
  outline: 2px solid var(--dos-yellow);
  outline-offset: -1px;
}

/* === Recently-changed marching ants border === */
@keyframes march {
  to {
    background-position: 6px 0, -6px 100%, 0 -6px, 100% 6px;
  }
}

.block.recent {
  border: none;
  position: relative;
}

.block.recent::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, #000 50%, transparent 0) 0 0 / 6px 2px,
    linear-gradient(90deg, #000 50%, transparent 0) 0 100% / 6px 2px,
    linear-gradient(0deg, #000 50%, transparent 0) 0 0 / 2px 6px,
    linear-gradient(0deg, #000 50%, transparent 0) 100% 0 / 2px 6px;
  background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
  animation: march 0.4s linear infinite;
}

/* === Bottom panels === */
.bottom-panels {
  display: flex;
  gap: 16px;
  padding: 8px 12px;
  border-top: 2px solid var(--dos-light-gray);
  flex-shrink: 0;
}

.panel {
  flex: 1;
  border: 2px solid var(--panel-border);
  position: relative;
  padding: 12px 10px 8px;
}

.panel-title {
  position: absolute;
  top: -9px;
  left: 10px;
  background: var(--dos-bg);
  padding: 0 6px;
  font-weight: bold;
  font-size: 12px;
}

.panel-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Status panel */
.status-line {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.status-line.small {
  font-size: 11px;
  color: var(--dos-light-gray);
  justify-content: center;
}

.progress-bar {
  height: 10px;
  background: var(--dos-gray);
  border: 1px solid var(--panel-border);
  margin: 4px 0;
}

.progress-fill {
  height: 100%;
  background: var(--dos-yellow);
  width: 0%;
  transition: width 0.5s ease;
}

/* Legend panel */
.legend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 20px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.block-sm {
  width: 10px;
  height: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

/* Reuse block state colors for legend */
.block-sm.done { background: var(--dos-fg); }
.block-sm.in_progress { background: #FDBEB9; }
.block-sm.in_review { background: var(--dos-green); }
.block-sm.todo { background: var(--dos-highlight); }
.block-sm.backlog { background: var(--dos-magenta); }
.block-sm.canceled { background: var(--dos-red); }
.block-sm.recent-legend {
  border: none;
  position: relative;
}

.block-sm.recent-legend::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, #000 50%, transparent 0) 0 0 / 6px 2px,
    linear-gradient(90deg, #000 50%, transparent 0) 0 100% / 6px 2px,
    linear-gradient(0deg, #000 50%, transparent 0) 0 0 / 2px 6px,
    linear-gradient(0deg, #000 50%, transparent 0) 100% 0 / 2px 6px;
  background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
  animation: march 0.4s linear infinite;
}

/* === Bottom bar === */
.bottom-bar {
  display: flex;
  justify-content: space-between;
  padding: 4px 12px;
  background: var(--dos-red);
  color: var(--dos-fg);
  font-weight: bold;
  font-size: 12px;
  flex-shrink: 0;
}

/* === Tooltip === */
.tooltip {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  background: var(--dos-bg);
  border: 1px solid var(--dos-light-gray);
  border-radius: 4px;
  padding: 6px 10px;
  max-width: 340px;
  font-size: 12px;
  line-height: 1.4;
  opacity: 0;
  transition: opacity 0.1s ease;
}

.tooltip.visible {
  opacity: 1;
}

.tooltip-id {
  color: var(--dos-yellow);
  font-weight: bold;
  margin-bottom: 2px;
}

.tooltip-title {
  color: var(--dos-fg);
  margin-bottom: 4px;
}

.tooltip-meta {
  color: var(--dos-light-gray);
  font-size: 11px;
}

/* === Scrollbar styling === */
.projects-container::-webkit-scrollbar {
  width: 8px;
}

.projects-container::-webkit-scrollbar-track {
  background: var(--dos-bg);
}

.projects-container::-webkit-scrollbar-thumb {
  background: var(--dos-gray);
  border: 1px solid var(--dos-light-gray);
}


/* ===== Tab navigation in the top bar ===== */

.top-nav {
  display: flex;
  gap: 14px;
  margin-top: 2px;
}

.top-nav-link {
  font-family: "DM Sans", system-ui, sans-serif;
  font-weight: 400;
  font-size: 12px;
  color: var(--dos-light-gray);
  text-decoration: none;
  padding: 2px 6px;
  border-bottom: 2px solid transparent;
  letter-spacing: 0.4px;
}

.top-nav-link:hover {
  color: var(--dos-fg);
}

.top-nav-link.active {
  color: var(--dos-fg);
  border-bottom-color: var(--dos-red);
}

.filter-note {
  color: var(--dos-light-gray);
  font-style: italic;
}


/* ===== Shipped tab ===== */

/* The shipped tab reuses .projects-container, .project-section,
   .project-header, .milestone-row, .milestone-blocks, .block from the
   main board so the visual treatment matches. Only the additions
   below are shipped-tab-specific: the compact generate bar and the
   pasteable output card. */

.generate-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-bottom: 1px solid var(--dos-gray);
  background: var(--dos-bg);
  flex-shrink: 0;
}

.generate-bar-meta {
  font-size: 11px;
  color: var(--dos-light-gray);
}

.generate-bar-meta code {
  font-family: "SF Mono", monospace;
  font-size: 11px;
  color: var(--dos-fg);
}

/* ---- Workspace panel (toggled by the top "Generate weekly update" button) ----

   Layout chain that makes overflow-y on the output body actually work:

     .workspace-panel  flex-column, max-height + overflow:hidden
       └─ .workspace-panes  flex:1 + min-height:0 (grid)
           └─ .workspace-pane  min-height:0 + overflow:hidden
               └─ .workspace-output-body  flex:1 + overflow-y:auto

   Every level in the chain has min-height:0 so the flex/grid sizing
   actually constrains to the panel's max-height instead of letting
   each child grow to its content's intrinsic size and overflow into
   the project list below. */

.workspace-panel {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  /* Cap so long output / many notes don't push the project blocks
     below the fold. The output body scrolls inside its own pane. */
  max-height: 60vh;
  padding: 10px 14px 8px;
  background: var(--dos-bg);
  border-bottom: 1px solid var(--dos-gray);
  overflow: hidden;
}

.workspace-panes {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 10px;
}

.workspace-pane {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--panel-border);
  background: var(--dos-bg);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

/* Right side of the workspace is itself a column of two output panes —
   "Pasteable bullets" and "Auditor lane" — each with its own header
   and copy button. The container itself doesn't have a border (each
   inner pane brings its own). */
.workspace-pane-outputs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: none;
  background: transparent;
  overflow: visible;
}

.workspace-pane-outputs > .workspace-pane {
  flex: 1 1 0;
  min-height: 0;
}

.workspace-pane-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
  background: var(--dos-gray);
  border-bottom: 1px solid var(--panel-border);
  font-size: 11px;
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--dos-light-gray);
  flex-shrink: 0;
}

.workspace-pane-title {
  font-family: "Press Start 2P", "Courier New", monospace;
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--dos-fg);
}

.workspace-pane-meta {
  font-size: 11px;
  color: var(--dos-light-gray);
  margin-right: auto;
  font-style: italic;
}

.engineer-notes {
  flex: 1;
  min-height: 0;
  font-family: "SF Mono", "DM Sans", monospace;
  font-size: 12px;
  line-height: 1.5;
  background: var(--dos-bg);
  color: var(--dos-fg);
  border: none;
  outline: none;
  padding: 10px 12px;
  resize: none;
}

.engineer-notes::placeholder {
  color: var(--dos-light-gray);
  opacity: 0.7;
  font-style: italic;
}

.workspace-pane-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: var(--dos-gray);
  border-top: 1px solid var(--panel-border);
  flex-shrink: 0;
}

.workspace-output-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: var(--dos-bg);
  color: var(--dos-fg);
}

.workspace-output-content {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  margin: 0;
  padding: 12px 16px;
  user-select: text;
}

.workspace-output-content.error {
  color: var(--dos-red);
}

.workspace-empty {
  text-align: center;
  color: var(--dos-light-gray);
  padding: 40px 20px;
  font-style: italic;
  font-size: 12px;
  line-height: 1.5;
}

/* Spinner shown inside an output pane while its LLM call is in
   flight. Three pulsing dots — minimal, fits the DOS-bar aesthetic
   without introducing a rotating SVG. */
.workspace-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 32px;
  color: var(--dos-light-gray);
  font-size: 11px;
  font-style: italic;
}

.spinner-dots {
  display: inline-flex;
  gap: 4px;
}

.spinner-dots span {
  width: 6px;
  height: 6px;
  background: var(--dos-highlight);
  border-radius: 0;
  animation: workspace-dot 1.1s ease-in-out infinite;
}

.spinner-dots span:nth-child(2) { animation-delay: 0.15s; }
.spinner-dots span:nth-child(3) { animation-delay: 0.30s; }

@keyframes workspace-dot {
  0%, 80%, 100% { opacity: 0.25; }
  40% { opacity: 1; }
}

.shipped-empty {
  text-align: center;
  color: var(--dos-light-gray);
  padding: 40px;
  font-style: italic;
}
