/* Sunny Go 16-Bit Bright Grand Line Command Deck Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800&family=Press+Start+2P&display=swap');

:root,
[data-theme="bright"] {
  --bg-page: #e8f6ff;
  --bg-surface: #ffffff;
  --bg-inset: #f0f9ff;
  --bg-elevated: #dbeafe;
  --bg-header: #074885;
  --header-text: #ffffff;
  --header-muted: #e0f2fe;
  --header-title: #fef08a;
  --text-main: #092242;
  --text-muted: #1d4e7a;
  --border-main: #0264b5;
  --border-strong: #074885;
  --accent-bg: #facc15;
  --accent-bg-hover: #fde047;
  --accent-text: #092242;
  --accent-label: #074885;
  --focus-ring: #ea580c;
  --shadow-pixel: 0 4px 0 #7cc4fa;

  --badge-work-bg: #dbeafe;
  --badge-work-text: #074885;
  --badge-work-border: #0284c7;

  --badge-riset-bg: #f3e8ff;
  --badge-riset-text: #581c87;
  --badge-riset-border: #9333ea;

  --badge-warn-bg: #fef08a;
  --badge-warn-text: #713f12;
  --badge-warn-border: #ca8a04;

  --badge-ok-bg: #d1fae5;
  --badge-ok-text: #065f46;
  --badge-ok-border: #059669;

  --badge-err-bg: #ffe4e6;
  --badge-err-text: #9f1239;
  --badge-err-border: #e11d48;

  --badge-idle-bg: #e0f2fe;
  --badge-idle-text: #0c4a6e;
  --badge-idle-border: #0284c7;
}

[data-theme="night"] {
  --bg-page: #08234a;
  --bg-surface: #0e3266;
  --bg-inset: #071e3f;
  --bg-elevated: #154385;
  --bg-header: #061c3d;
  --header-text: #ffffff;
  --header-muted: #bae6fd;
  --header-title: #fef08a;
  --text-main: #ffffff;
  --text-muted: #bae6fd;
  --border-main: #38bdf8;
  --border-strong: #7dd3fc;
  --accent-bg: #facc15;
  --accent-bg-hover: #fde047;
  --accent-text: #08234a;
  --accent-label: #fef08a;
  --focus-ring: #fde047;
  --shadow-pixel: 0 4px 0 #041229;

  --badge-work-bg: #0369a1;
  --badge-work-text: #ffffff;
  --badge-work-border: #7dd3fc;

  --badge-riset-bg: #6b21a8;
  --badge-riset-text: #ffffff;
  --badge-riset-border: #e879f9;

  --badge-warn-bg: #a16207;
  --badge-warn-text: #fef9c3;
  --badge-warn-border: #fde047;

  --badge-ok-bg: #047857;
  --badge-ok-text: #ffffff;
  --badge-ok-border: #6ee7b7;

  --badge-err-bg: #be123c;
  --badge-err-text: #ffffff;
  --badge-err-border: #fda4af;

  --badge-idle-bg: #1e40af;
  --badge-idle-text: #e0f2fe;
  --badge-idle-border: #60a5fa;
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.45;
  overflow-x: hidden;
}

/* R-39: Pointer affordances on all enabled interactive controls */
a[href],
button:not(:disabled),
summary,
select:not(:disabled),
label[for],
input[type="checkbox"]:not(:disabled),
input[type="radio"]:not(:disabled),
[role="button"]:not([aria-disabled="true"]),
[role="tab"]:not([aria-disabled="true"]) {
  cursor: pointer;
}

button:disabled,
select:disabled,
input:disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.6;
}

/* R-32: High-contrast visible focus indicator */
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.font-pixel {
  font-family: 'Press Start 2P', ui-monospace, monospace;
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.font-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent-bg);
  color: var(--accent-text);
  font-weight: 800;
  border-radius: 8px;
  text-decoration: none;
}

.skip-link:focus {
  left: 12px;
}

.shell-container {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding-left: 12px;
  padding-right: 12px;
}

@media (min-width: 640px) {
  .shell-container {
    padding-left: 18px;
    padding-right: 18px;
  }
}

/* Vivid Royal Ocean Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: var(--bg-header);
  color: var(--header-text);
  border-bottom: 3px solid #facc15;
  padding: 6px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-emblem {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background-color: #0369a1;
  border: 2px solid #facc15;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-title {
  margin: 0;
  font-size: clamp(0.66rem, 1.6vw, 0.82rem);
  color: var(--header-title);
}

.brand-status-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 2px;
  font-size: 0.74rem;
  color: var(--header-muted);
  font-weight: 600;
}

.state-dot {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background-color: #34d399;
  border: 1px solid #064e3b;
  flex-shrink: 0;
}

.state-dot[data-mcp="syncing"] { background-color: #fde047; }
.state-dot[data-mcp="error"] { background-color: #fb7185; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Header buttons stay crisp white-on-cobalt for vivid contrast */
.site-header .btn:not(.btn-primary) {
  background-color: #0b5ba8;
  color: #ffffff;
  border-color: #7dd3fc;
}

.site-header .btn:not(.btn-primary):hover:not(:disabled) {
  background-color: #0284c7;
  border-color: #fef08a;
}

/* Touch-safe >=44px Buttons (R-03) */
.btn {
  min-height: 44px;
  min-width: 44px;
  padding: 6px 11px;
  border-radius: 10px;
  border: 2px solid var(--border-main);
  background-color: var(--bg-surface);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.1s ease, background-color 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
}

.btn:hover:not(:disabled) {
  background-color: var(--bg-elevated);
  border-color: var(--border-strong);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-primary {
  background-color: var(--accent-bg);
  color: var(--accent-text);
  border-color: #ca8a04;
  font-weight: 800;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--accent-bg-hover);
  border-color: #a16207;
}

.btn-approve {
  background-color: #059669;
  color: #ffffff;
  border-color: #047857;
  font-weight: 800;
}

.btn-approve:hover:not(:disabled) {
  background-color: #047857;
}

.btn-reject {
  background-color: #e11d48;
  color: #ffffff;
  border-color: #be123c;
  font-weight: 800;
}

.btn-reject:hover:not(:disabled) {
  background-color: #be123c;
}

.btn-compact {
  min-height: 44px;
  padding: 5px 10px;
  font-size: 0.75rem;
}

/* Navigation Tabs + Compact Voyage Status Ribbon */
.site-nav {
  background-color: var(--bg-surface);
  border-bottom: 2px solid var(--border-main);
}

.nav-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 4px 0;
}

.nav-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  flex: 1 1 420px;
}

.tab-btn {
  min-height: 44px;
  padding: 6px 8px;
  border: 2px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: clamp(0.74rem, 1.8vw, 0.85rem);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tab-btn:hover {
  background-color: var(--bg-elevated);
  color: var(--text-main);
}

.tab-btn[aria-selected="true"] {
  background-color: var(--accent-bg);
  color: var(--accent-text);
  border-color: #ca8a04;
}

/* Compact Tactical Voyage Ribbon (replaces generic 4-stat AI template row!) */
.voyage-ribbon {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.voyage-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 8px;
  background-color: var(--bg-inset);
  border: 1.5px solid var(--border-main);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-main);
}

.voyage-alert-btn {
  min-height: 44px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 2px solid var(--badge-warn-border);
  background-color: var(--badge-warn-bg);
  color: var(--badge-warn-text);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Main Workspace */
.main-content {
  flex: 1;
  padding-top: 10px;
  padding-bottom: 24px;
}

.tab-panel[hidden] {
  display: none !important;
}

/* Asymmetric Split: 7.4-col Diorama + 4.6-col Command Console */
.deck-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

@media (min-width: 980px) {
  .deck-workspace {
    grid-template-columns: minmax(0, 7.3fr) minmax(0, 4.7fr);
  }
  .deck-workspace.is-cinema {
    grid-template-columns: minmax(0, 1fr);
  }
}

.diorama-card,
.console-card,
.section-card {
  background-color: var(--bg-surface);
  border: 2px solid var(--border-main);
  border-radius: 14px;
  box-shadow: var(--shadow-pixel);
  overflow: hidden;
}

.diorama-topbar {
  background-color: #074885;
  color: #ffffff;
  border-bottom: 2px solid #facc15;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.diorama-caption {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffffff;
}

.diorama-clock-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sea-king-radar {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background-color: #0c2e59;
  color: #e0f2fe;
  border: 1.5px solid #38bdf8;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.sea-king-radar.is-active {
  background-color: #065f46;
  color: #ffffff;
  border-color: #6ee7b7;
}

.sea-king-radar::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #38bdf8;
}

.sea-king-radar.is-active::before {
  background-color: #fde047;
}

.logpose-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.logpose-needle {
  transform-origin: 9px 9px;
  animation: logposeSway 3.6s ease-in-out infinite;
}

@keyframes logposeSway {
  0%, 100% { transform: rotate(-16deg); }
  50% { transform: rotate(22deg); }
}

.pixel-clock {
  font-size: 0.72rem;
  color: #fef08a;
}

.bgm-btn.is-playing {
  background-color: var(--accent-bg);
  color: var(--accent-text);
  border-color: #ca8a04;
}

.bgm-eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.bgm-eq i {
  display: block;
  width: 3px;
  height: 4px;
  border-radius: 1px;
  background-color: currentColor;
}

.bgm-eq i:nth-child(2) { height: 8px; }
.bgm-eq i:nth-child(3) { height: 5px; }

.bgm-btn.is-playing .bgm-eq i:nth-child(1) { animation: eqBounce 0.52s ease-in-out infinite; }
.bgm-btn.is-playing .bgm-eq i:nth-child(2) { animation: eqBounce 0.42s ease-in-out 0.12s infinite; }
.bgm-btn.is-playing .bgm-eq i:nth-child(3) { animation: eqBounce 0.58s ease-in-out 0.22s infinite; }

@keyframes eqBounce {
  0%, 100% { height: 3px; }
  50% { height: 12px; }
}

.deck-shortcut-strip {
  background-color: var(--bg-inset);
  border-top: 1.5px solid var(--border-main);
  padding: 5px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.71rem;
  font-weight: 600;
  color: var(--text-muted);
}

.deck-shortcut-strip kbd {
  display: inline-block;
  padding: 0 4px;
  border-radius: 4px;
  border: 1px solid var(--border-main);
  background-color: var(--bg-surface);
  color: var(--text-main);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 800;
}

@media (prefers-reduced-motion: reduce) {
  .logpose-needle,
  .bgm-btn.is-playing .bgm-eq i {
    animation: none !important;
  }
}

.canvas-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1376 / 768;
  background-color: #0284c7;
  overflow: hidden;
  user-select: none;
}

canvas#sunnyCanvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: manipulation;
  cursor: pointer;
}

canvas#sunnyCanvas.is-panning {
  cursor: grabbing;
}

.diorama-toolbar {
  background-color: var(--bg-inset);
  border-top: 2px solid var(--border-main);
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.crew-selector-bar {
  background-color: var(--bg-surface);
  border-top: 2px solid var(--border-main);
  padding: 7px 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

@media (min-width: 540px) {
  .crew-selector-bar {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.crew-pill {
  min-height: 44px;
  padding: 5px 8px;
  border-radius: 9px;
  border: 2px solid var(--border-main);
  background-color: var(--bg-inset);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.crew-pill:hover {
  background-color: var(--bg-elevated);
}

.crew-pill[aria-pressed="true"] {
  background-color: var(--accent-bg);
  color: var(--accent-text);
  border-color: #ca8a04;
}

.pill-alert-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background-color: #e11d48;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
}

/* Right Crew Command Console (tuned so Command Input sits cleanly above 800px desktop fold!) */
.console-card {
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.crew-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.crew-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.portrait-frame {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  border: 2px solid var(--border-strong);
  background-color: #074885;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

canvas#portraitCanvas {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.crew-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.crew-name {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 800;
}

.handle-tag {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 6px;
  background-color: var(--bg-inset);
  border: 1.5px solid var(--border-main);
  color: var(--accent-label);
  font-weight: 700;
}

.crew-role {
  margin: 2px 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.status-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 8px;
  border: 2px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-badge[data-status="KERJA"],
.status-badge[data-status="PROSES"],
.status-badge[data-status="SCALE"] {
  background-color: var(--badge-work-bg);
  color: var(--badge-work-text);
  border-color: var(--badge-work-border);
}

.status-badge[data-status="RISET"] {
  background-color: var(--badge-riset-bg);
  color: var(--badge-riset-text);
  border-color: var(--badge-riset-border);
}

.status-badge[data-status="BUTUH_APPROVAL"],
.status-badge[data-status="APPROVAL"],
.status-badge[data-status="TESTING"] {
  background-color: var(--badge-warn-bg);
  color: var(--badge-warn-text);
  border-color: var(--badge-warn-border);
}

.status-badge[data-status="SELESAI"],
.status-badge[data-status="READY"] {
  background-color: var(--badge-ok-bg);
  color: var(--badge-ok-text);
  border-color: var(--badge-ok-border);
}

.status-badge[data-status="KILL?"] {
  background-color: var(--badge-err-bg);
  color: var(--badge-err-text);
  border-color: var(--badge-err-border);
}

.status-badge[data-status="IDLE"] {
  background-color: var(--badge-idle-bg);
  color: var(--badge-idle-text);
  border-color: var(--badge-idle-border);
}

.info-banner {
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  border: 1.5px solid var(--border-main);
  background-color: var(--bg-inset);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.isolation-banner {
  background-color: var(--badge-ok-bg);
  color: var(--badge-ok-text);
  border-color: var(--badge-ok-border);
}

.isolation-code {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1.5px solid currentColor;
  flex-shrink: 0;
}

.approval-card {
  background-color: var(--badge-warn-bg);
  color: var(--badge-warn-text);
  border: 2px solid var(--badge-warn-border);
  border-radius: 11px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.approval-card[hidden] {
  display: none !important;
}

.approval-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.action-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

/* Crew Chat Log (compact so full Command Form + Broadcast checkbox fit cleanly above 800px fold) */
.chat-log {
  background-color: var(--bg-inset);
  border: 2px solid var(--border-main);
  border-radius: 10px;
  padding: 7px 8px;
  height: 86px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.chat-item {
  display: flex;
  flex-direction: column;
}

.chat-item.from-captain {
  align-items: flex-end;
}

.chat-item.from-crew {
  align-items: flex-start;
}

.chat-bubble {
  max-width: 92%;
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 0.78rem;
}

.chat-item.from-captain .chat-bubble {
  background-color: var(--accent-bg);
  color: var(--accent-text);
  font-weight: 700;
  border: 1.5px solid #ca8a04;
}

.chat-item.from-crew .chat-bubble {
  background-color: var(--bg-surface);
  color: var(--text-main);
  border: 1.5px solid var(--border-main);
}

.chat-meta {
  font-size: 0.67rem;
  opacity: 0.85;
  margin-bottom: 2px;
  font-weight: 800;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.field-label {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--text-muted);
}

.text-input,
.select-input {
  min-height: 44px;
  width: 100%;
  padding: 7px 11px;
  border-radius: 10px;
  border: 2px solid var(--border-main);
  background-color: var(--bg-surface);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
}

.text-input::placeholder {
  color: var(--text-muted);
  opacity: 0.75;
}

.command-row {
  display: flex;
  gap: 6px;
}

.checkbox-label {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #0369a1;
}

/* Tab 2 & Tab 3 Sections */
.section-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-card {
  padding: 15px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.section-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.section-desc {
  margin: 3px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.crp-grid,
.prompt-grid,
.pwa-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

@media (min-width: 680px) {
  .crp-grid,
  .prompt-grid,
  .pwa-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.sub-card {
  background-color: var(--bg-inset);
  border: 2px solid var(--border-main);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.progress-track {
  width: 100%;
  height: 10px;
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-main);
  border-radius: 6px;
  overflow: hidden;
}

.progress-fill-fol {
  height: 100%;
  background-color: #c026d3;
}

.progress-fill-view {
  height: 100%;
  background-color: #eab308;
}

.crp-btn-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.crp-btn-row .btn {
  flex: 1 1 auto;
}

.task-create-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

@media (min-width: 760px) {
  .task-create-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) auto;
    align-items: end;
  }
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-row {
  background-color: var(--bg-surface);
  border: 2px solid var(--border-main);
  border-radius: 12px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.config-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

@media (min-width: 760px) {
  .config-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.prompt-pre {
  margin: 0;
  padding: 10px;
  border-radius: 8px;
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-main);
  color: var(--text-main);
  font-size: 0.74rem;
  line-height: 1.55;
  max-height: 170px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.state-feedback {
  background-color: var(--bg-surface);
  border: 2px dashed var(--border-main);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.site-footer {
  border-top: 2px solid var(--border-main);
  background-color: var(--bg-surface);
  padding: 12px 0;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* Deliverable & Anti-Dismon QC Modal Dialog */
.qc-dialog {
  width: min(680px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 3px solid var(--border-strong);
  border-radius: 14px;
  background-color: var(--bg-surface);
  color: var(--text-main);
  box-shadow: 0 18px 48px rgba(7, 40, 88, 0.45);
}

.qc-dialog::backdrop {
  background-color: rgba(7, 36, 82, 0.65);
}

.qc-dialog-inner {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
}

.textarea-input {
  min-height: 92px;
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  border: 2px solid var(--border-main);
  background-color: var(--bg-inset);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.84rem;
  line-height: 1.5;
  resize: vertical;
}

.qc-checklist {
  background-color: var(--bg-inset);
  border: 1.5px solid var(--border-main);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Top-right Non-Occluding Toast */
.toast-banner {
  position: fixed;
  top: 66px;
  right: 16px;
  max-width: calc(100vw - 32px);
  z-index: 60;
  background-color: #074885;
  color: #ffffff;
  border: 2px solid #facc15;
  border-radius: 10px;
  padding: 9px 15px;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(7, 40, 88, 0.35);
  pointer-events: none;
}

.toast-banner[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: no-preference) {
  .toast-enter {
    animation: toastSlideIn 0.2s ease-out forwards;
  }
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
