/* ============================================================
   OPUS ONE — APP SHELL & SCREEN LAYOUTS
   ============================================================ */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100%;
  transition: grid-template-columns var(--dur-slow) var(--ease);
}
.app.collapsed { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }

/* ---------- Sidebar ---------- */
.sidebar {
  display: flex; flex-direction: column;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  height: 100%; overflow: hidden;
}
.sb-head { display: flex; align-items: center; gap: var(--s2); height: var(--topbar-h); padding: 0 var(--s4); flex: none; }
.sb-logo { display: flex; align-items: center; gap: 9px; min-width: 0; }
.sb-logo img { width: 26px; height: 26px; flex: none; object-fit: contain; }
.sb-logo .wordmark { font-size: var(--fs-lg); font-weight: var(--fw-bold); letter-spacing: -0.02em; white-space: nowrap; }
.app.collapsed .sb-logo .wordmark { display: none; }
.sb-collapse { margin-left: auto; }
.app.collapsed .sb-head { padding: 0; justify-content: center; }
.app.collapsed .sb-collapse { display: none; }

.sb-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: var(--s2) var(--s3) var(--s4); }
.sb-group { margin-top: var(--s4); }
.sb-group:first-child { margin-top: var(--s1); }
.sb-group-label { padding: var(--s2) var(--s2) 6px; font-size: var(--fs-micro); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); white-space: nowrap; }
.app.collapsed .sb-group-label { opacity: 0; height: 12px; padding: 0; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  height: 34px; padding: 0 10px; border-radius: var(--r-md);
  color: var(--text-secondary); font-size: var(--fs-sm); font-weight: var(--fw-medium);
  position: relative; white-space: nowrap; margin-bottom: 1px;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.nav-item svg { width: 17px; height: 17px; flex: none; color: var(--text-muted); transition: color var(--dur-fast) var(--ease); }
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item:hover svg { color: var(--text); }
.nav-item .nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-item .nav-trail { margin-left: auto; }
.nav-item.active { background: var(--accent-soft); color: var(--text); font-weight: var(--fw-semibold); }
.nav-item.active svg { color: var(--text); }
.nav-item.active::before { content: ""; position: absolute; left: -3px; top: 7px; bottom: 7px; width: 3px; border-radius: 999px; background: var(--accent); }
.app.collapsed .nav-item { justify-content: center; padding: 0; }
.app.collapsed .nav-item .nav-label, .app.collapsed .nav-item .nav-trail { display: none; }
.app.collapsed .nav-item.active::before { left: 0; }

.sb-foot { flex: none; border-top: 1px solid var(--border); padding: var(--s2) var(--s3); }
.sb-user { display: flex; align-items: center; gap: var(--s2); padding: 6px; border-radius: var(--r-md); transition: background var(--dur-fast); }
.sb-user:hover { background: var(--bg-hover); }
.sb-user .u-meta { min-width: 0; flex: 1; }
.sb-user .u-name { font-size: var(--fs-sm); font-weight: var(--fw-semibold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user .u-role { font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app.collapsed .sb-user .u-meta, .app.collapsed .sb-user .u-trail { display: none; }
.app.collapsed .sb-user { justify-content: center; }

/* ---------- Main column ---------- */
.main { display: flex; flex-direction: column; min-width: 0; height: 100%; overflow: hidden; }

.topbar {
  display: flex; align-items: center; gap: var(--s3);
  height: var(--topbar-h); flex: none; padding: 0 var(--s5);
  background: var(--topbar-bg);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  position: relative; z-index: 40;
}
.topbar .tb-left { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.topbar .tb-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.breadcrumb { display: flex; align-items: center; gap: 7px; font-size: var(--fs-sm); color: var(--text-muted); min-width: 0; }
.breadcrumb .crumb { white-space: nowrap; }
.breadcrumb .crumb.current { color: var(--text); font-weight: var(--fw-semibold); }
.breadcrumb svg { width: 14px; height: 14px; opacity: 0.6; flex: none; }

.online-pill { display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 10px; border-radius: var(--r-full); background: var(--bg-sunken); border: 1px solid var(--border); font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-secondary); }
.online-pill .live { position: relative; width: 7px; height: 7px; }
.online-pill .live .core { position: absolute; inset: 0; border-radius: 50%; background: var(--c-green); }
.online-pill .live .pulse { position: absolute; inset: 0; border-radius: 50%; background: var(--c-green); animation: pulse 2s var(--ease-out) infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: 0.7; } 70%, 100% { transform: scale(2.6); opacity: 0; } }

.icon-btn-badge { position: relative; }
.icon-btn-badge .dot-badge { position: absolute; top: 5px; right: 5px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 999px; background: var(--c-red); color: #fff; font-size: 9px; font-weight: var(--fw-bold); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--topbar-bg); }

/* content scroll area */
.content { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; }
.page { padding: var(--s6) var(--s8); max-width: 1480px; margin: 0 auto; }
.page.flush { padding: 0; max-width: none; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); }
.page-title-row { display: flex; align-items: center; gap: var(--s3); }
.page-sub { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 3px; }

/* toolbar (filters row) */
.toolbar { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s4); }
.toolbar .spacer { flex: 1; }

/* grids */
.grid-kpi { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s4); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.grid-dash { display: grid; grid-template-columns: 1.6fr 1fr; gap: var(--s4); align-items: start; }
@media (max-width: 1200px) { .grid-kpi { grid-template-columns: repeat(2, 1fr); } .grid-dash { grid-template-columns: 1fr; } }

/* ---------- Tasks: List grouped ---------- */
.tasklist { display: flex; flex-direction: column; gap: var(--s4); }
.tgroup { }
.tgroup-head {
  display: flex; align-items: center; gap: var(--s2);
  padding: 7px 10px; border-radius: var(--r-md);
  cursor: pointer; user-select: none;
  transition: background var(--dur-fast);
}
.tgroup-head:hover { background: var(--bg-hover); }
.tgroup-head .chev { width: 15px; height: 15px; color: var(--text-muted); transition: transform var(--dur) var(--ease); }
.tgroup-head.collapsed .chev { transform: rotate(-90deg); }
.tgroup-head .g-name { font-size: var(--fs-sm); font-weight: var(--fw-semibold); white-space: nowrap; }
.tgroup-head .g-count { color: var(--text-faint); font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.tgroup-head .g-add { margin-left: auto; opacity: 0; }
.tgroup-head:hover .g-add { opacity: 1; }

.tgroup-body { margin-top: 2px; border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--bg-elevated); }
.tgroup-body.collapsed { display: none; }

.trow {
  position: relative;
  display: flex; align-items: center; gap: var(--s3);
  padding: 0 var(--s4); height: 44px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer; transition: background var(--dur-fast);
}
.trow:last-child { border-bottom: none; }
.trow:hover { background: var(--bg-hover); }
.trow.airy { height: 56px; }
.trow .t-check { opacity: 0; transition: opacity var(--dur-fast); }
.trow:hover .t-check, .trow .t-check:checked { opacity: 1; }
.trow .t-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.trow .t-title .tt-text { font-size: var(--fs-sm); color: var(--text); font-weight: var(--fw-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .t-id { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-faint); }
.trow .t-meta { display: flex; align-items: center; gap: var(--s3); flex: none; }
.trow .t-deadline { font-size: var(--fs-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 4px; min-width: 74px; justify-content: flex-end; }
.trow .t-deadline.overdue { color: var(--c-red-fg); font-weight: var(--fw-bold); }
.trow .t-deadline.today { color: var(--c-blue-fg); font-weight: var(--fw-bold); }
.trow .t-deadline svg { width: 13px; height: 13px; }
.trow .row-hover-actions {
  position: absolute; right: var(--s4); top: 50%; transform: translateY(-50%);
  display: flex; gap: 1px; align-items: center; padding-left: var(--s4);
  opacity: 0; pointer-events: none; transition: opacity var(--dur-fast);
  background: linear-gradient(90deg, transparent, var(--bg-hover) 22%);
}
.trow:hover .row-hover-actions { opacity: 1; pointer-events: auto; }
.trow.airy .t-sub { font-size: var(--fs-xs); color: var(--text-muted); }

/* airy variant adds 2-line layout */
.trow.airy .t-title { flex-direction: column; align-items: flex-start; gap: 2px; }
.trow.airy .t-title .tt-row { display: flex; align-items: center; gap: 8px; }

/* ---------- Tasks: Kanban ---------- */
.kanban { display: flex; gap: var(--s3); padding: var(--s5) var(--s8) var(--s8); overflow-x: auto; height: 100%; align-items: flex-start; }
.kcol { flex: none; width: 296px; display: flex; flex-direction: column; max-height: 100%; }
.kcol-head { display: flex; align-items: center; gap: var(--s2); padding: 6px 4px var(--s2); position: sticky; top: 0; }
.kcol-head .k-name { font-size: var(--fs-sm); font-weight: var(--fw-semibold); display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.kcol-head .k-count { color: var(--text-faint); font-weight: var(--fw-medium); }
.kcol-head .k-add { margin-left: auto; }
.kcol-body { display: flex; flex-direction: column; gap: var(--s2); padding: 3px; border-radius: var(--r-lg); min-height: 60px; overflow-y: auto; transition: background var(--dur-fast); }
.kcol-body.drop-target { background: var(--accent-soft); outline: 1.5px dashed var(--accent); outline-offset: -2px; }

.kcard {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 11px 12px;
  box-shadow: var(--shadow-xs); cursor: grab;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), opacity var(--dur-fast);
  display: flex; flex-direction: column; gap: var(--s2);
}
.kcard:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.kcard:active { cursor: grabbing; }
.kcard.dragging { opacity: 0.4; }
.kcard.ghost { border-style: dashed; opacity: 0.5; }
.kcard .kc-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.kcard .kc-id { font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--text-faint); }
.kcard .kc-title { font-size: var(--fs-sm); font-weight: var(--fw-medium); line-height: var(--lh-snug); color: var(--text); }
.kcard .kc-mission { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-xs); color: var(--text-muted); }
.kcard .kc-mission .m-dot { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.kcard .kc-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-top: 1px; }
.kcard .kc-foot-left { display: flex; align-items: center; gap: 6px; }

/* ---------- Drawer internals (task detail) ---------- */
.dw-head { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--border); flex: none; }
.dw-head .dw-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.dw-scroll { flex: 1; overflow-y: auto; }
.dw-section { padding: var(--s5); border-bottom: 1px solid var(--border); }
.dw-title-wrap { padding: var(--s5) var(--s5) var(--s4); }
.dw-id { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-faint); }
.dw-title {
  font-size: var(--fs-2xl); font-weight: var(--fw-bold); letter-spacing: -0.018em; line-height: var(--lh-tight);
  width: 100%; background: transparent; border: 1px solid transparent; border-radius: var(--r-md);
  padding: 4px 6px; margin: 2px -6px 0; resize: none; overflow: hidden;
}
.dw-title:hover { background: var(--bg-hover); }
.dw-title:focus { outline: none; background: var(--bg-elevated); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }

/* property grid (2-col inline editable) */
.propgrid { display: grid; grid-template-columns: 132px 1fr; row-gap: 2px; align-items: center; }
.prop-key { font-size: var(--fs-sm); color: var(--text-muted); display: inline-flex; align-items: center; gap: 8px; height: 34px; }
.prop-key svg { width: 15px; height: 15px; color: var(--text-faint); }
.prop-val { min-width: 0; }
.prop-edit {
  display: inline-flex; align-items: center; gap: 7px; min-height: 28px; width: 100%;
  padding: 4px 8px; margin-left: -8px; border-radius: var(--r-sm);
  font-size: var(--fs-sm); color: var(--text); cursor: pointer;
  border: 1px solid transparent; transition: background var(--dur-fast);
}
.prop-edit:hover { background: var(--bg-hover); }
.prop-edit.placeholder { color: var(--text-faint); }

/* markdown description */
.md { font-size: var(--fs-sm); line-height: 1.6; color: var(--text-secondary); overflow-wrap: break-word; }
.md p { margin: 0 0 10px; }
.md p:last-child { margin-bottom: 0; }
.md strong { color: var(--text); font-weight: var(--fw-semibold); }
.md h4 { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text); margin: 14px 0 6px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 20px; }
.md li { margin-bottom: 4px; padding-left: 2px; }
.md li::marker { color: var(--text-faint); }
.md code { font-family: var(--font-mono); font-size: 0.92em; background: var(--bg-sunken); padding: 1px 5px; border-radius: var(--r-xs); border: 1px solid var(--border); }
.md a { color: var(--c-blue-fg); text-decoration: underline; text-underline-offset: 2px; }

/* sub-task checklist */
.checklist { display: flex; flex-direction: column; gap: 1px; }
.chk-item { display: flex; align-items: center; gap: var(--s2); padding: 7px 8px; border-radius: var(--r-sm); transition: background var(--dur-fast); }
.chk-item:hover { background: var(--bg-hover); }
.chk-item .drag-h { color: var(--text-faint); cursor: grab; opacity: 0; width: 14px; height: 14px; }
.chk-item:hover .drag-h { opacity: 1; }
.chk-item .chk-text { flex: 1; font-size: var(--fs-sm); }
.chk-item.done .chk-text { color: var(--text-faint); text-decoration: line-through; }

/* comments */
.comment { display: flex; gap: var(--s3); padding: var(--s3) 0; }
.comment .c-body { flex: 1; min-width: 0; }
.comment .c-head { display: flex; align-items: center; gap: var(--s2); margin-bottom: 3px; }
.comment .c-name { font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.comment .c-time { font-size: var(--fs-xs); color: var(--text-faint); }
.comment .c-text { font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.55; }
.comment-box { display: flex; gap: var(--s2); align-items: flex-start; padding-top: var(--s3); border-top: 1px solid var(--border); }

/* link row */
.linkrow { display: flex; align-items: center; gap: var(--s3); padding: 9px 10px; border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: 6px; }
.linkrow .lr-type { font-size: var(--fs-xs); font-weight: var(--fw-medium); }
.linkrow .lr-title { flex: 1; font-size: var(--fs-sm); color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Donut chart ---------- */
.donut-wrap { display: flex; align-items: center; gap: var(--s5); }
.donut { position: relative; flex: none; }
.donut .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut .center .d-val { font-size: var(--fs-2xl); font-weight: var(--fw-bold); line-height: 1; font-variant-numeric: tabular-nums; }
.donut .center .d-lab { font-size: var(--fs-xs); color: var(--text-muted); }
.donut-legend { display: flex; flex-direction: column; gap: 9px; flex: 1; }
.dleg-item { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-sm); }
.dleg-item .lg-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.dleg-item .lg-name { color: var(--text-secondary); }
.dleg-item .lg-val { margin-left: auto; font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }

/* widget card */
.widget { display: flex; flex-direction: column; }
.widget-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--border); }
.widget-head .w-title { font-size: var(--fs-sm); font-weight: var(--fw-semibold); display: inline-flex; align-items: center; gap: var(--s2); }
.widget-body { padding: var(--s3) var(--s4); }
.widget-foot { padding: 10px var(--s5); border-top: 1px solid var(--border); }

/* rdv item */
.rdv { display: flex; align-items: center; gap: var(--s3); padding: 10px; border-radius: var(--r-md); transition: background var(--dur-fast); }
.rdv:hover { background: var(--bg-hover); }
.rdv .rdv-time { font-variant-numeric: tabular-nums; font-size: var(--fs-sm); font-weight: var(--fw-semibold); width: 48px; flex: none; }
.rdv .rdv-line { width: 3px; align-self: stretch; border-radius: 999px; flex: none; }
.rdv .rdv-body { flex: 1; min-width: 0; }
.rdv .rdv-title { font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.rdv .rdv-meta { font-size: var(--fs-xs); color: var(--text-muted); display: flex; align-items: center; gap: 6px; }

/* command palette */
.cmdk-scrim { position: fixed; inset: 0; z-index: 180; display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh;
  background: rgba(10,10,12,0.4); opacity: 0; transition: opacity var(--dur) var(--ease); backdrop-filter: blur(3px); }
.cmdk-scrim.show { opacity: 1; }
[data-theme="dark"] .cmdk-scrim { background: rgba(0,0,0,0.6); }
.cmdk { width: 600px; max-width: 92vw; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-xl); overflow: hidden;
  transform: translateY(-8px) scale(0.99); opacity: 0; transition: transform var(--dur-slow) var(--ease-out), opacity var(--dur); }
.cmdk-scrim.show .cmdk { transform: none; opacity: 1; }
.cmdk-input { display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s4); height: 52px; border-bottom: 1px solid var(--border); }
.cmdk-input svg { width: 18px; height: 18px; color: var(--text-muted); }
.cmdk-input input { flex: 1; background: transparent; border: none; outline: none; font-size: var(--fs-lg); color: var(--text); }
.cmdk-input input::placeholder { color: var(--text-faint); }
.cmdk-list { max-height: 380px; overflow-y: auto; padding: var(--s2); }
.cmdk-item { display: flex; align-items: center; gap: var(--s3); padding: 9px 10px; border-radius: var(--r-md); cursor: pointer; }
.cmdk-item svg { width: 16px; height: 16px; color: var(--text-muted); }
.cmdk-item.active { background: var(--bg-hover); }
.cmdk-item .ci-title { font-size: var(--fs-sm); font-weight: var(--fw-medium); flex: 1; }
.cmdk-item .ci-meta { font-size: var(--fs-xs); color: var(--text-faint); }

/* notification panel */
.notif-panel { position: absolute; top: calc(var(--topbar-h) - 6px); right: var(--s5); width: 380px; max-height: 70vh; z-index: 120;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-xl); overflow: hidden; display: flex; flex-direction: column;
  animation: menuIn var(--dur-fast) var(--ease-out); }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s4) var(--s4) var(--s3); border-bottom: 1px solid var(--border); }
.notif-list { overflow-y: auto; padding: var(--s1); }
.notif { display: flex; gap: var(--s3); padding: 10px; border-radius: var(--r-md); cursor: pointer; transition: background var(--dur-fast); }
.notif:hover { background: var(--bg-hover); }
.notif.unread { background: var(--accent-soft); }
.notif .n-ic { width: 30px; height: 30px; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; flex: none; }
.notif .n-body { flex: 1; min-width: 0; }
.notif .n-text { font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.4; }
.notif .n-text strong { color: var(--text); font-weight: var(--fw-semibold); }
.notif .n-time { font-size: var(--fs-xs); color: var(--text-faint); margin-top: 2px; }

/* dropdown anchor */
.anchor { position: relative; }
.pop { position: absolute; z-index: 130; }
.pop.right { right: 0; }
.pop.below { top: calc(100% + 6px); }

/* DS swatches */
.swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: var(--s3); }
.swatch { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--bg-elevated); }
.swatch .sw-color { height: 56px; }
.swatch .sw-meta { padding: 8px 10px; }
.swatch .sw-name { font-size: var(--fs-xs); font-weight: var(--fw-semibold); }
.swatch .sw-val { font-size: var(--fs-micro); color: var(--text-muted); font-family: var(--font-mono); }

.ds-block { margin-bottom: var(--s10); }
.ds-block-head { margin-bottom: var(--s4); }
.ds-row { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; }
.ds-card { border: 1px solid var(--border); border-radius: var(--r-xl); padding: var(--s5); background: var(--bg-elevated); }
.ds-label { font-size: var(--fs-xs); color: var(--text-faint); font-family: var(--font-mono); margin-top: 8px; }
.spec-row { display: flex; align-items: center; gap: var(--s4); padding: 10px 0; border-bottom: 1px solid var(--border-subtle); }
.spec-row:last-child { border-bottom: none; }

/* fade-in for content swaps */
.fade-in { animation: fadeIn var(--dur-slow) var(--ease-out); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.hoverable { transition: background var(--dur-fast); }
.hoverable:hover { background: var(--bg-hover); }
.alert-cell { transition: background var(--dur-fast); }
.alert-cell:hover { background: var(--bg-hover); }

/* mission cards */
.mcards { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s4); }
@media (max-width: 1100px) { .mcards { grid-template-columns: 1fr; } }
.mcard { position: relative; padding: var(--s5); overflow: hidden; }
.mcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--mc-accent, var(--accent)); }
.mcard-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); margin: var(--s4) 0; }
.mcard-metric { background: var(--bg-sunken); border-radius: var(--r-md); padding: 10px 12px; }
.mcard-metric .mm-val { font-size: var(--fs-lg); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.mcard-metric .mm-lab { font-size: var(--fs-micro); color: var(--text-muted); margin-top: 1px; }

/* mission detail header */
.mhead { display: flex; align-items: flex-start; gap: var(--s4); padding: var(--s6) var(--s8); }
.mhead-main { flex: 1; min-width: 0; }
.mhead-titlerow { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.tab-scroll { display: flex; align-items: center; gap: 2px; padding: 0 var(--s8); border-bottom: 1px solid var(--border); overflow-x: auto; }

/* accordion (phases) */
.acc { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--bg-elevated); }
.acc-item { border-bottom: 1px solid var(--border-subtle); }
.acc-item:last-child { border-bottom: none; }
.acc-head { display: flex; align-items: center; gap: var(--s3); padding: 12px var(--s4); cursor: pointer; transition: background var(--dur-fast); }
.acc-head:hover { background: var(--bg-hover); }
.acc-num { width: 24px; height: 24px; border-radius: var(--r-sm); background: var(--bg-sunken); display: flex; align-items: center; justify-content: center; font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text-muted); flex: none; }
.acc-name { font-size: var(--fs-sm); font-weight: var(--fw-semibold); flex: 1; }
.acc-chev { color: var(--text-faint); transition: transform var(--dur) var(--ease); }
.acc-item.open .acc-chev { transform: rotate(180deg); }
.acc-body { padding: 0 var(--s4) var(--s5) 52px; }
.note-internal { background: var(--bg-sunken); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 14px; margin-top: 12px; }
.note-block { background: var(--c-red-bg); border: 1px solid color-mix(in srgb, var(--c-red) 30%, transparent); border-radius: var(--r-md); padding: 12px 14px; margin-top: 12px; color: var(--c-red-fg); }

/* live highlight flash (real-time feel) */
@keyframes flashRow { 0% { background: var(--accent-soft); } 100% { background: transparent; } }
.flash { animation: flashRow 1.6s var(--ease-out); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
