:root {
  --ink: #162327;
  --muted: #6f7d80;
  --line: #dfe5e4;
  --soft: #f3f6f5;
  --canvas: #eef2f1;
  --sidebar: #101a1e;
  --sidebar-2: #18262a;
  --teal: #188f78;
  --teal-dark: #11715f;
  --coral: #ed745b;
  --blue: #4679c8;
  --gold: #d69d33;
  --red: #d75050;
  --violet: #7165b5;
  --radius: 8px;
  --shadow: 0 6px 22px rgba(21, 43, 45, .06);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { letter-spacing: 0; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 1040; width: 252px; display: flex; flex-direction: column; background: var(--sidebar); color: #d5dddb; border-right: 1px solid rgba(255,255,255,.05); }
.brand { height: 76px; display: flex; align-items: center; gap: 12px; padding: 0 22px; color: white; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand:hover { color: white; }
.brand-mark { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 6px; background: var(--coral); color: white; font-weight: 800; font-size: 12px; }
.brand-mark.large { width: 44px; height: 44px; font-size: 14px; }
.brand > span:last-child, .login-brand > span:last-child { display: flex; flex-direction: column; line-height: 1.2; }
.brand strong, .login-brand strong { font-size: 15px; }
.brand small, .login-brand small { margin-top: 3px; color: #8fa09f; font-size: 11px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 18px 12px; }
.nav-label { display: block; padding: 14px 12px 7px; color: #627573; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 42px; margin: 2px 0; padding: 9px 12px; color: #aebcba; border-radius: 6px; font-weight: 600; }
.nav-link svg { width: 18px; height: 18px; }
.nav-link:hover { color: white; background: rgba(255,255,255,.05); }
.nav-link.active { color: white; background: var(--sidebar-2); box-shadow: inset 3px 0 var(--coral); }
.sidebar-user { display: flex; align-items: center; gap: 10px; min-height: 74px; padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.07); }
.avatar { width: 34px; height: 34px; display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: #dceae6; color: var(--teal-dark); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.avatar.small { width: 28px; height: 28px; font-size: 9px; }
.avatar.large { width: 48px; height: 48px; font-size: 14px; }
.user-meta { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.user-meta strong { overflow: hidden; color: white; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { color: #718482; font-size: 10px; text-transform: capitalize; }
.main-area { min-height: 100vh; margin-left: 252px; }
.topbar { position: sticky; top: 0; z-index: 1020; height: 76px; display: flex; align-items: center; gap: 16px; padding: 0 30px; background: rgba(255,255,255,.95); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.page-heading { min-width: 0; flex: 1; }
.page-heading h1 { overflow: hidden; margin: 0; font-size: 20px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.content-area { max-width: 1550px; margin: auto; padding: 28px 30px 50px; }
.btn { min-height: 38px; display: inline-flex; align-items: center; gap: 8px; border-radius: 6px; font-size: 13px; font-weight: 700; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { --bs-btn-bg: var(--teal); --bs-btn-border-color: var(--teal); --bs-btn-hover-bg: var(--teal-dark); --bs-btn-hover-border-color: var(--teal-dark); --bs-btn-disabled-bg: var(--teal); --bs-btn-disabled-border-color: var(--teal); }
.btn-dark { --bs-btn-bg: var(--sidebar); --bs-btn-border-color: var(--sidebar); }
.btn-light { --bs-btn-bg: white; --bs-btn-border-color: var(--line); --bs-btn-hover-border-color: #bac6c4; }
.btn.is-loading { opacity: .7; }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; flex: 0 0 auto; padding: 0; color: #425154; background: white; border: 1px solid var(--line); border-radius: 6px; }
.icon-btn:hover { color: var(--teal); border-color: #b8cbc6; }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn.dark { width: 32px; height: 32px; color: #82928f; background: transparent; border-color: rgba(255,255,255,.08); }
.icon-btn.copied, .copy-link.copied { color: white; background: var(--teal); border-color: var(--teal); }
.notification-dot { position: absolute; top: -4px; right: -5px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; color: white; background: var(--coral); border: 2px solid white; border-radius: 10px; font-size: 9px; font-weight: 800; }
.notification-menu { width: min(360px, calc(100vw - 24px)); padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 18px 50px rgba(15,32,35,.16); }
.dropdown-title { display: flex; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--line); }
.dropdown-title span { color: var(--muted); font-size: 11px; }
.notification-item { display: flex; flex-direction: column; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.notification-item:hover { background: var(--soft); }
.notification-item strong { font-size: 12px; }
.notification-item span { margin: 2px 0; color: var(--muted); font-size: 11px; }
.notification-item small { color: #9aa5a4; font-size: 10px; }
.notification-footer { padding: 10px; }
.panel { background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.panel-head h3 { margin: 2px 0 0; font-size: 16px; font-weight: 750; }
.panel-note { color: var(--muted); font-size: 11px; font-weight: 700; }
.eyebrow { display: block; color: var(--teal); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.section-heading { min-height: 64px; display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-top: 18px; padding: 8px 2px 14px; }
.section-heading h2 { margin: 3px 0 0; font-size: 18px; font-weight: 750; }
.text-link { display: inline-flex; align-items: center; gap: 6px; color: var(--teal-dark); font-size: 12px; font-weight: 750; }
.text-link svg { width: 15px; height: 15px; }
.metric-grid { display: grid; gap: 12px; }
.metric-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.metric-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-card { min-height: 112px; display: flex; align-items: center; gap: 14px; padding: 18px; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.metric-card > div { min-width: 0; display: flex; flex-direction: column; }
.metric-card span { color: var(--muted); font-size: 11px; font-weight: 650; }
.metric-card strong { margin: 2px 0; font-size: 24px; line-height: 1.1; }
.metric-card small { overflow: hidden; color: #9aa5a4; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.metric-icon { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 7px; background: #e0f1eb; color: var(--teal); }
.metric-icon svg { width: 19px; height: 19px; }
.metric-icon.coral, .platform-icon.coral { color: #cc573f; background: #ffebe6; }
.metric-icon.green { color: var(--teal); background: #e0f1eb; }
.metric-icon.red { color: var(--red); background: #fbe8e8; }
.metric-icon.gold { color: #a87718; background: #fbf0d9; }
.metric-icon.blue { color: var(--blue); background: #e7eef9; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 16px; margin-top: 16px; }
.pipeline-panel, .impact-panel, .activity-panel, .ranking-panel { padding: 22px; }
.pipeline-bars { display: grid; gap: 14px; }
.pipeline-row { display: grid; grid-template-columns: 185px minmax(80px, 1fr) 24px; align-items: center; gap: 14px; color: var(--muted); font-size: 11px; }
.pipeline-row > span { display: flex; align-items: center; gap: 8px; }
.pipeline-row > strong { color: var(--ink); text-align: right; }
.bar-track { height: 7px; overflow: hidden; background: var(--soft); border-radius: 4px; }
.bar-track i { display: block; height: 100%; background: var(--teal); border-radius: 4px; }
.stage-dot { width: 8px; height: 8px; display: inline-block; flex: 0 0 auto; border-radius: 50%; background: #9faeac; }
.stage-1 { background: var(--blue); } .stage-2 { background: var(--gold); } .stage-3 { background: var(--coral); } .stage-4 { background: var(--violet); } .stage-5 { background: var(--teal); } .stage-6 { background: #7b8987; }
.impact-primary { display: flex; justify-content: space-between; align-items: center; padding: 10px 0 20px; border-bottom: 1px solid var(--line); }
.impact-primary > div { display: flex; flex-direction: column; }
.impact-primary span, .impact-grid span { color: var(--muted); font-size: 11px; }
.impact-primary strong { font-size: 32px; }
.impact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 12px; padding-top: 20px; }
.impact-grid > div { display: flex; flex-direction: column; }
.impact-grid strong { font-size: 16px; }
.activity-panel { margin-top: 16px; }
.timeline { position: relative; display: grid; gap: 16px; }
.timeline-item { display: flex; align-items: flex-start; gap: 10px; }
.timeline-item > div { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.timeline-item strong { font-size: 11px; font-weight: 650; }
.timeline-item span { color: var(--muted); font-size: 10px; }
.timeline-icon { width: 29px; height: 29px; display: grid; place-items: center; color: var(--teal); background: #e5f2ee; border-radius: 50%; }
.timeline-icon svg { width: 13px; }
.timeline-dot { width: 8px; height: 8px; margin: 4px 3px; flex: 0 0 auto; background: var(--teal); border: 2px solid #dceee9; border-radius: 50%; box-shadow: 0 0 0 3px #eef7f4; }
.timeline.compact { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px 28px; }
.filter-strip, .toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.filter-strip { padding: 10px; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.segmented { display: inline-flex; align-items: center; padding: 3px; background: var(--soft); border-radius: 6px; }
.segment { min-height: 32px; display: grid; place-items: center; padding: 6px 12px; color: var(--muted); background: transparent; border: 0; border-radius: 5px; font-size: 11px; font-weight: 700; }
.segment.active { color: var(--ink); background: white; box-shadow: 0 1px 5px rgba(0,0,0,.08); }
.segmented.compact .segment { width: 34px; padding: 0; }
.segment svg { width: 15px; }
.date-pair { display: flex; align-items: center; gap: 7px; }
.date-pair input, .week-picker { height: 34px; padding: 4px 8px; color: var(--muted); background: white; border: 1px solid var(--line); border-radius: 5px; font-size: 11px; }
.date-pair span { color: var(--muted); font-size: 10px; }
.date-pair .icon-btn { width: 34px; height: 34px; }
.search-filters { min-width: 0; display: flex; flex: 1; align-items: center; gap: 8px; }
.search-box { min-width: 220px; max-width: 380px; display: flex; flex: 1; align-items: center; gap: 8px; padding: 0 11px; background: white; border: 1px solid var(--line); border-radius: 6px; }
.search-box:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(24,143,120,.1); }
.search-box svg { width: 16px; color: #879694; }
.search-box input { width: 100%; height: 38px; padding: 0; border: 0; outline: 0; font-size: 12px; }
.search-filters > select { height: 40px; max-width: 190px; padding: 0 30px 0 10px; color: #566466; background: white; border: 1px solid var(--line); border-radius: 6px; font-size: 11px; }
.table-panel { overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 12px 16px; color: #879492; background: #f8faf9; border-bottom: 1px solid var(--line); font-size: 9px; font-weight: 800; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 13px 16px; border-bottom: 1px solid #edf1f0; color: #526063; font-size: 11px; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfcfc; }
.item-title { min-width: 200px; display: flex; flex-direction: column; }
.item-title strong { max-width: 380px; overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.item-title span { color: var(--muted); font-size: 9px; }
.status-badge { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 8px; color: #47605a; background: #ebf0ef; border-radius: 12px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.status-badge.success { color: #16735f; background: #dff2ec; }
.status-badge.warning { color: #8d6415; background: #fcf0d8; }
.status-badge.danger { color: #a13939; background: #fbe4e4; }
.status-badge.info { color: #2f68a7; background: #e5eef9; }
.status-badge.primary { color: #276c7e; background: #e3f0f2; }
.status-badge.violet { color: #625797; background: #ebe8f6; }
.status-badge.muted { color: #6e7b79; background: #edf0ef; }
.priority { display: inline-flex; align-items: center; font-size: 9px; font-weight: 800; text-transform: uppercase; white-space: nowrap; }
.priority::before { width: 6px; height: 6px; margin-right: 5px; content: ''; background: #9eaaa8; border-radius: 50%; }
.priority.urgent { color: var(--red); } .priority.urgent::before { background: var(--red); }
.priority.high { color: #b77722; } .priority.high::before { background: var(--gold); }
.priority.normal { color: var(--blue); } .priority.normal::before { background: var(--blue); }
.priority.low { color: var(--muted); }
.date-cell.overdue, .text-danger { color: var(--red) !important; }
.distribution-count { color: var(--muted); }
.distribution-count strong { color: var(--teal); }
.pagination-row { display: flex; align-items: center; justify-content: space-between; padding: 16px 2px; color: var(--muted); font-size: 11px; }
.page-btn { min-width: 30px; height: 30px; display: inline-grid; place-items: center; margin-left: 4px; background: white; border: 1px solid var(--line); border-radius: 5px; }
.page-btn.active { color: white; background: var(--teal); border-color: var(--teal); }
.empty-state { min-height: 300px; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 30px; text-align: center; }
.empty-state h3, .empty-state h2 { margin: 12px 0 4px; font-size: 18px; }
.empty-state p { max-width: 420px; color: var(--muted); }
.empty-icon { width: 48px; height: 48px; display: grid; place-items: center; color: var(--teal); background: #e5f2ee; border-radius: 50%; }
.empty-icon svg { width: 22px; }
.empty-compact { padding: 24px; color: var(--muted); font-size: 11px; text-align: center; }
.error-state { min-height: calc(100vh - 170px); }
.kanban-board { display: grid; grid-template-columns: repeat(6, minmax(230px, 1fr)); gap: 10px; padding-bottom: 12px; overflow-x: auto; }
.kanban-column { min-height: calc(100vh - 175px); padding: 10px; background: #e6ebea; border-radius: 7px; }
.kanban-head { height: 38px; display: flex; align-items: center; justify-content: space-between; padding: 0 5px 8px; color: #4e5c5d; font-size: 10px; font-weight: 800; }
.kanban-head span { display: flex; align-items: center; gap: 7px; }
.kanban-head strong { min-width: 22px; height: 22px; display: grid; place-items: center; background: white; border-radius: 5px; font-size: 9px; }
.kanban-list { display: grid; align-content: start; gap: 8px; }
.kanban-card { display: block; padding: 13px; background: white; border: 1px solid #dce2e0; border-radius: 7px; box-shadow: 0 2px 8px rgba(24,44,46,.04); }
.kanban-card:hover { border-color: #adc4be; transform: translateY(-1px); }
.kanban-meta, .kanban-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 9px; }
.kanban-card h3 { margin: 10px 0 4px; font-size: 12px; line-height: 1.4; }
.kanban-card p { margin: 0 0 14px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.kanban-foot { padding-top: 10px; border-top: 1px solid #edf1f0; }
.kanban-foot span { display: flex; align-items: center; gap: 3px; }
.kanban-foot svg { width: 11px; height: 11px; }
.kanban-empty { padding: 30px 10px; color: #98a3a2; border: 1px dashed #cbd3d1; border-radius: 6px; font-size: 10px; text-align: center; }
.form-layout { max-width: 1120px; margin: auto; }
.form-panel { margin-bottom: 16px; padding: 24px; }
.form-grid, .distribution-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.field { min-width: 0; }
.field.span-2 { grid-column: span 2; }
.field.span-3 { grid-column: span 3; }
.field label, .media-pills > label { display: block; margin-bottom: 6px; color: #536164; font-size: 10px; font-weight: 750; }
.form-control, .form-select { min-height: 40px; color: var(--ink); border-color: var(--line); border-radius: 6px; font-size: 12px; }
.form-control:focus, .form-select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(24,143,120,.1); }
textarea.form-control { resize: vertical; }
.check-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.check-option input { position: absolute; opacity: 0; }
.check-option span { min-height: 40px; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 8px; color: #667376; background: white; border: 1px solid var(--line); border-radius: 6px; font-size: 10px; font-weight: 700; text-align: center; cursor: pointer; }
.check-option span svg { width: 14px; }
.check-option input:checked + span { color: var(--teal-dark); background: #e8f4f0; border-color: #8bc3b5; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 5px 0; }
.form-actions.inline { margin-top: 18px; padding: 16px 0 0; border-top: 1px solid var(--line); }
.detail-hero { min-height: 112px; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: -28px -30px 22px; padding: 24px 30px; background: white; border-bottom: 1px solid var(--line); }
.detail-hero h2 { max-width: 900px; margin: 8px 0 5px; font-size: 23px; font-weight: 760; }
.detail-hero p { margin: 0; color: var(--muted); font-size: 11px; }
.detail-kicker { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 10px; }
.detail-actions { display: flex; gap: 8px; }
.detail-grid { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 16px; align-items: start; }
.detail-side { display: grid; gap: 14px; }
.side-panel { padding: 18px; box-shadow: none; }
.side-panel .panel-head { margin-bottom: 14px; }
.side-panel .panel-head h3 { margin: 0; font-size: 13px; }
.stack-form { display: grid; gap: 10px; }
.read-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.read-grid .wide { grid-column: span 2; }
.read-grid span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.read-grid strong, .read-grid p { margin: 0; font-size: 12px; white-space: pre-wrap; }
.meta-list { display: grid; gap: 11px; margin: 0; }
.meta-list > div { display: flex; justify-content: space-between; gap: 14px; padding-bottom: 10px; border-bottom: 1px solid #edf1f0; }
.meta-list > div:last-child { border: 0; padding-bottom: 0; }
.meta-list dt { color: var(--muted); font-size: 10px; font-weight: 600; }
.meta-list dd { margin: 0; font-size: 10px; font-weight: 750; text-align: right; }
.mini-checklist { display: grid; gap: 11px; }
.mini-checklist > div { display: flex; align-items: center; gap: 9px; }
.mini-checklist > div > span:nth-child(2) { display: flex; flex-direction: column; }
.mini-checklist strong { font-size: 10px; }
.mini-checklist small { color: var(--muted); font-size: 9px; }
.check-status { width: 23px; height: 23px; display: grid; place-items: center; color: #a5b0ae; background: var(--soft); border-radius: 50%; }
.check-status.done { color: white; background: var(--teal); }
.check-status svg { width: 12px; }
.file-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.file-item, .external-link { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; }
.file-item:hover, .external-link:hover { border-color: #abc3bd; }
.file-item > span:nth-child(2), .external-link > span { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.file-item strong, .external-link strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.file-item small, .external-link small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.file-item > svg, .external-link > svg { width: 14px; color: var(--muted); }
.file-icon { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; color: var(--blue); background: #e9eff8; border-radius: 5px; }
.file-icon svg { width: 15px; }
.upload-row { display: grid; grid-template-columns: 130px minmax(0,1fr) auto; gap: 8px; margin-top: 12px; }
.external-link { margin-top: 10px; }
.comment-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.comments-list { display: grid; gap: 12px; margin-top: 18px; }
.comments-list article { display: flex; align-items: flex-start; gap: 10px; }
.comments-list article > div { flex: 1; padding: 10px 12px; background: var(--soft); border-radius: 6px; }
.comments-list article > div > div { display: flex; justify-content: space-between; gap: 10px; }
.comments-list strong { font-size: 10px; }
.comments-list span { color: var(--muted); font-size: 9px; }
.comments-list p { margin: 5px 0 0; font-size: 11px; white-space: pre-wrap; }
.queue-list { display: grid; gap: 9px; }
.queue-item { display: grid; grid-template-columns: minmax(260px,1.5fr) 130px minmax(180px,.8fr) auto; align-items: center; gap: 20px; min-height: 86px; padding: 15px 18px; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.queue-main { min-width: 0; display: flex; align-items: center; gap: 12px; }
.queue-main > a { min-width: 0; display: flex; flex-direction: column; }
.queue-main > a strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.queue-main > a span { color: var(--muted); font-size: 9px; }
.queue-wait { display: flex; flex-direction: column; }
.queue-wait span, .queue-progress span { color: var(--muted); font-size: 9px; }
.queue-wait strong { font-size: 11px; }
.queue-progress > div:first-child { display: flex; justify-content: space-between; gap: 10px; }
.queue-progress strong { font-size: 10px; }
.progress { height: 5px; margin-top: 6px; background: var(--soft); }
.progress-bar { background: var(--teal); }
.handover-package { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; margin-bottom: 12px; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 8px; }
.handover-package > div { position: relative; min-height: 130px; padding: 18px 48px 18px 18px; background: white; }
.handover-package p { max-height: 70px; margin: 8px 0 0; overflow: auto; color: #4f5d60; font-size: 10px; white-space: pre-wrap; }
.copy-link { position: absolute; top: 14px; right: 14px; display: inline-flex; align-items: center; gap: 4px; padding: 4px 7px; color: var(--muted); background: var(--soft); border: 0; border-radius: 5px; font-size: 9px; }
.copy-link svg { width: 11px; }
.asset-strip { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; padding: 10px 14px; overflow-x: auto; background: white; border: 1px solid var(--line); border-radius: 7px; }
.asset-strip > span { margin-right: 5px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.asset-strip a { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; background: var(--soft); border-radius: 5px; font-size: 9px; white-space: nowrap; }
.asset-strip svg { width: 12px; }
.distribution-stack { display: grid; gap: 12px; }
.distribution-card { overflow: hidden; box-shadow: none; }
.distribution-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: #f8faf9; border-bottom: 1px solid var(--line); }
.distribution-head > div { display: flex; align-items: center; gap: 10px; }
.distribution-head h3 { margin: 0; font-size: 13px; }
.distribution-head small { color: var(--muted); font-size: 9px; }
.platform-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; color: var(--blue); background: #e7eef9; border-radius: 6px; }
.platform-icon svg { width: 16px; }
.distribution-card > form { padding: 18px; }
.link-output { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 9px 10px; background: #f3f7f6; border: 1px solid #dbe8e5; border-radius: 6px; }
.link-output > div { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.link-output span { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.link-output code { overflow: hidden; color: var(--teal-dark); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.toggle-row { min-height: 40px; display: flex !important; align-items: center; gap: 9px; margin: 0 !important; cursor: pointer; }
.toggle-row input { position: absolute; opacity: 0; }
.toggle-row > span { position: relative; width: 35px; height: 20px; flex: 0 0 auto; background: #cfd8d6; border-radius: 12px; transition: .15s; }
.toggle-row > span::after { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; content: ''; background: white; border-radius: 50%; transition: .15s; }
.toggle-row input:checked + span { background: var(--teal); }
.toggle-row input:checked + span::after { transform: translateX(15px); }
.metrics-drawer { border-top: 1px solid var(--line); }
.metrics-drawer summary { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10px 18px; cursor: pointer; list-style: none; }
.metrics-drawer summary span { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.metrics-drawer summary span:first-child { color: var(--ink); font-weight: 750; }
.metrics-drawer summary svg { width: 15px; }
.metrics-form { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; padding: 16px 18px; background: #f8faf9; border-top: 1px solid var(--line); }
.metrics-form .btn { align-self: end; }
.task-list { display: grid; gap: 8px; }
.task-row { display: grid; grid-template-columns: auto minmax(250px,1fr) minmax(430px,.8fr); align-items: center; gap: 14px; min-height: 94px; padding: 15px; box-shadow: none; }
.task-check { color: var(--teal); }
.task-check svg { width: 21px; }
.task-body { min-width: 0; }
.task-body > div { display: flex; align-items: center; gap: 10px; }
.task-body strong { font-size: 12px; }
.task-body p { margin: 3px 0 9px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.task-meta { display: flex; align-items: center; gap: 14px; }
.task-meta span, .task-meta a { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 9px; }
.task-meta svg { width: 11px; }
.task-controls { display: grid; grid-template-columns: 135px minmax(160px,1fr) minmax(130px,.7fr) auto; gap: 7px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-content { border: 0; border-radius: 8px; box-shadow: 0 20px 70px rgba(13,27,30,.22); }
.modal-header, .modal-footer { padding: 18px 22px; border-color: var(--line); }
.modal-body { padding: 22px; }
.modal-title { margin-top: 3px; font-size: 18px; font-weight: 750; }
.toolbar-copy { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.user-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.user-card { padding: 18px; box-shadow: none; }
.user-card-head { display: flex; align-items: center; gap: 11px; }
.user-card-head > div { min-width: 0; flex: 1; }
.user-card-head h3 { margin: 0; font-size: 13px; }
.user-card-head div span { display: block; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.user-role { display: flex; justify-content: space-between; gap: 10px; margin: 16px 0; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.user-role span { display: flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 700; }
.user-role svg { width: 14px; color: var(--teal); }
.user-role small { color: var(--muted); font-size: 9px; }
.user-card details summary { display: flex; align-items: center; justify-content: space-between; color: var(--teal-dark); font-size: 10px; font-weight: 750; cursor: pointer; list-style: none; }
.user-card details summary svg { width: 14px; }
.user-card details[open] summary { margin-bottom: 14px; }
.user-last { margin-top: 14px; color: #9aa5a4; font-size: 9px; }
.tab-strip { display: flex; gap: 22px; margin: -6px 0 18px; border-bottom: 1px solid var(--line); }
.tab { padding: 12px 2px; color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; font-size: 11px; font-weight: 750; }
.tab.active { color: var(--ink); border-color: var(--coral); }
.settings-list { display: grid; gap: 8px; }
.settings-row { display: grid; grid-template-columns: auto minmax(150px,.8fr) minmax(150px,.8fr) minmax(280px,1.2fr) auto auto; align-items: end; gap: 12px; padding: 13px; box-shadow: none; }
.settings-row.service-row { grid-template-columns: auto minmax(180px,.8fr) minmax(260px,1.5fr) auto auto; }
.settings-row .grow { min-width: 0; }
.media-pills > div { display: flex; flex-wrap: wrap; gap: 5px; min-height: 40px; align-items: center; }
.media-pills input { position: absolute; opacity: 0; }
.media-pills span { display: block; padding: 4px 7px; color: var(--muted); background: var(--soft); border: 1px solid transparent; border-radius: 10px; font-size: 8px; cursor: pointer; }
.media-pills input:checked + span { color: var(--teal-dark); background: #e2f1ed; border-color: #abd0c7; }
.settings-page { max-width: 1040px; margin: auto; }
.settings-section { display: grid; grid-template-columns: 260px 1fr; gap: 38px; margin-bottom: 12px; padding: 24px; box-shadow: none; }
.settings-intro { display: flex; align-items: flex-start; gap: 12px; }
.settings-intro h3 { margin: 1px 0 4px; font-size: 14px; }
.settings-intro p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.settings-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.settings-fields .span-2 { grid-column: span 2; }
.setting-note { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.setting-note svg { width: 17px; color: var(--teal); }
.regenerate { color: var(--red); }
.api-doc { padding: 14px; background: var(--sidebar); border-radius: 7px; }
.api-doc > code { display: inline-block; margin-right: 10px; color: #8ce0cb; }
.api-doc > span { color: #81918f; font-size: 9px; }
.api-doc pre { max-height: 230px; margin: 12px 0 0; overflow: auto; color: #dce7e5; font-size: 10px; }
.api-key-reveal { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.api-key-reveal > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.api-key-reveal code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-table .rank-name { min-width: 210px; display: grid; grid-template-columns: 22px 1fr; }
.rank-name > span { grid-row: span 2; width: 19px; height: 19px; display: grid; place-items: center; color: var(--teal); background: #e4f2ee; border-radius: 4px; font-size: 8px; }
.rank-name strong { font-size: 10px; }
.rank-name small { color: var(--muted); font-size: 8px; }
.ranking-list { display: grid; gap: 4px; }
.ranking-row { display: grid; grid-template-columns: 24px minmax(120px,1fr) 80px 100px; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid #edf1f0; }
.ranking-row:last-child { border: 0; }
.rank-number { width: 22px; height: 22px; display: grid; place-items: center; color: var(--teal); background: #e5f2ee; border-radius: 5px; font-size: 9px; font-weight: 800; }
.ranking-row > div { min-width: 0; display: flex; flex-direction: column; }
.ranking-row strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.ranking-row span { color: var(--muted); font-size: 8px; }
.report-toolbar { display: flex; align-items: center; justify-content: center; gap: 15px; margin-bottom: 18px; }
.report-toolbar > div { text-align: center; }
.report-toolbar h2 { margin: 3px 0 0; font-size: 17px; }
.report-toolbar .week-picker { margin-left: 18px; }
.report-cover { min-height: 210px; display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 34px; color: white; background: var(--sidebar); border-radius: 8px; }
.report-cover .eyebrow { color: #72d0b8; }
.report-cover h2 { margin: 10px 0; font-size: 28px; line-height: 1.25; }
.report-cover p { margin: 0; color: #9eb0ad; font-size: 11px; }
.report-revenue { display: flex; flex-direction: column; padding: 24px 30px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 7px; }
.report-revenue span, .report-revenue small { color: #9eb0ad; font-size: 10px; }
.report-revenue strong { margin: 4px 0; color: #81d9c2; font-size: 27px; }
.report-metrics { margin-top: 12px; }
.report-highlights { grid-template-columns: 1fr 1fr; }
.highlight-card { display: flex; align-items: flex-start; gap: 15px; padding: 22px; box-shadow: none; }
.highlight-card h3 { margin: 5px 0; font-size: 15px; }
.highlight-card p { margin: 0; color: var(--muted); font-size: 10px; }
.report-team { margin-top: 16px; padding: 22px; box-shadow: none; }
.team-output { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.team-output > div { display: flex; align-items: center; gap: 9px; padding: 11px; background: var(--soft); border-radius: 6px; }
.team-output > div > span:nth-child(2) { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.team-output strong { font-size: 11px; }
.team-output small { color: var(--muted); font-size: 9px; }
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #e8eeec; }
.login-shell { width: min(960px,100%); min-height: 590px; display: grid; grid-template-columns: 1.05fr .95fr; overflow: hidden; background: white; border: 1px solid #d6dfdd; border-radius: 8px; box-shadow: 0 26px 90px rgba(18,39,42,.16); }
.login-brand-panel { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 40px; overflow: hidden; color: white; background: var(--sidebar); }
.login-brand-panel::after { position: absolute; right: -120px; bottom: 60px; width: 360px; height: 360px; content: ''; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 140px rgba(255,255,255,.018); }
.login-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.login-statement { position: relative; z-index: 1; }
.login-statement .eyebrow { color: #73d2bb; }
.login-statement h1 { margin: 12px 0; font-size: 36px; line-height: 1.22; }
.login-statement p { color: #91a5a1; font-size: 13px; }
.pipeline-dots { position: relative; z-index: 1; display: flex; align-items: center; gap: 5px; }
.pipeline-dots span { width: 26px; height: 4px; background: #344447; border-radius: 2px; }
.pipeline-dots span.active { background: var(--coral); }
.pipeline-dots small { margin-left: 8px; color: #718481; font-size: 9px; text-transform: uppercase; }
.login-form-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 50px; }
.login-form { width: 100%; max-width: 330px; }
.login-form h2 { margin: 7px 0 0; font-size: 22px; }
.login-form .form-floating > .form-control { height: 54px; min-height: 54px; }
.login-form .form-floating > label { color: var(--muted); font-size: 12px; }
.login-foot { margin: 30px 0 0; color: #9aa6a4; font-size: 9px; text-transform: uppercase; }
.sidebar-backdrop { display: none; }
.field-hint { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 52px; }
.input-suffix span { position: absolute; top: 50%; right: 12px; color: var(--muted); font-size: 10px; transform: translateY(-50%); }
.ai-settings-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.danger-toggle { color: var(--red); }
.knowledge-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; padding: 20px; }
.knowledge-head h2 { margin: 3px 0 0; font-size: 19px; }
.knowledge-list { display: grid; gap: 9px; }
.knowledge-entry { overflow: hidden; box-shadow: none; }
.knowledge-entry[data-inactive="true"] { opacity: .68; }
.knowledge-entry > summary { min-height: 62px; display: grid; grid-template-columns: 120px minmax(0,1fr) auto 20px; align-items: center; gap: 14px; padding: 13px 18px; cursor: pointer; list-style: none; }
.knowledge-entry > summary::-webkit-details-marker { display: none; }
.knowledge-entry > summary > svg { width: 16px; color: var(--muted); transition: transform .2s ease; }
.knowledge-entry[open] > summary > svg { transform: rotate(180deg); }
.knowledge-category { color: var(--teal-dark); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.knowledge-title { min-width: 0; display: flex; flex-direction: column; }
.knowledge-title strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-title small { color: var(--muted); font-size: 10px; }
.knowledge-form { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; padding: 20px; background: #f9fbfa; border-top: 1px solid var(--line); }
.knowledge-actions { grid-column: span 3; display: flex; align-items: center; justify-content: flex-end; gap: 18px; }
.creator-ai-band { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; padding: 14px 16px; color: white; background: var(--sidebar); border-radius: var(--radius); }
.creator-ai-band > div { display: flex; align-items: center; gap: 12px; }
.creator-ai-band > div > span:last-child { display: flex; flex-direction: column; }
.creator-ai-band small { color: #91a5a1; font-size: 10px; text-transform: uppercase; }
.creator-ai-band strong { font-size: 15px; }
.creator-ai-band .btn-dark { background: white; color: var(--ink); border-color: white; }
.ai-director-head { min-height: 96px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; padding: 20px; }
.ai-director-title { display: flex; align-items: center; gap: 14px; }
.ai-director-title h2 { margin: 3px 0; font-size: 20px; }
.ai-director-title p { margin: 0; color: var(--muted); font-size: 11px; }
.idea-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.idea-card { min-width: 0; display: flex; flex-direction: column; padding: 20px; }
.idea-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.idea-number { color: #cbd4d2; font-size: 21px; font-weight: 800; }
.idea-meta { min-height: 48px; display: flex; align-items: center; flex-wrap: wrap; gap: 5px 10px; margin: 10px 0; color: var(--muted); font-size: 9px; }
.idea-meta span { display: inline-flex; align-items: center; gap: 4px; }
.idea-meta svg { width: 12px; height: 12px; }
.idea-card h3 { margin: 0 0 12px; font-size: 16px; line-height: 1.35; }
.idea-card blockquote { margin: 0 0 12px; padding-left: 11px; color: #344b50; border-left: 3px solid var(--coral); font-size: 12px; font-weight: 700; line-height: 1.5; }
.idea-card > p { flex: 1; color: var(--muted); font-size: 11px; line-height: 1.65; }
.idea-why { margin: 4px 0 12px; padding: 10px; background: var(--soft); border-radius: 6px; color: #556466; font-size: 10px; line-height: 1.5; }
.idea-why span { display: block; margin-bottom: 3px; color: var(--ink); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.idea-tags { display: flex; flex-wrap: wrap; gap: 5px; min-height: 24px; }
.idea-tags span { padding: 3px 7px; color: #596867; background: #edf1f0; border-radius: 10px; font-size: 8px; font-weight: 700; }
.score-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 5px; margin: 14px 0; }
.score-grid div { display: flex; align-items: center; flex-direction: column; padding: 7px 3px; background: #f8faf9; border: 1px solid #edf1f0; border-radius: 5px; }
.score-grid strong { font-size: 13px; }
.score-grid span { color: var(--muted); font-size: 8px; }
.ai-empty { min-height: 280px; }
.ai-package { margin-bottom: 16px; padding: 24px; }
.ai-package-lead { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; margin-bottom: 22px; }
.ai-package-lead > div { padding: 13px; background: #f7f9f8; border-left: 3px solid var(--teal); }
.ai-package-lead > div:last-child { grid-column: span 2; }
.ai-package-lead span, .thumbnail-package span, .copy-block > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.ai-package-lead strong, .ai-package-lead blockquote, .ai-package-lead p { margin: 0; font-size: 12px; line-height: 1.55; }
.script-sections { display: grid; gap: 1px; margin-bottom: 18px; background: var(--line); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.script-sections article { display: grid; grid-template-columns: 38px minmax(0,1fr); gap: 12px; padding: 16px; background: white; }
.script-index { color: var(--coral); font-size: 11px; font-weight: 800; }
.script-sections h4, .short-grid h4 { margin: 0 0 6px; font-size: 13px; }
.script-sections p, .short-grid p { margin: 0 0 8px; color: #4e5d60; font-size: 11px; line-height: 1.7; white-space: pre-line; }
.script-sections small, .short-grid small { display: flex; align-items: flex-start; gap: 6px; color: var(--blue); font-size: 10px; line-height: 1.5; }
.script-sections small svg, .short-grid small svg { width: 14px; flex: 0 0 auto; }
.package-drawer { border-top: 1px solid var(--line); }
.package-drawer > summary { min-height: 52px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; font-size: 12px; font-weight: 750; }
.package-drawer > summary::-webkit-details-marker { display: none; }
.package-drawer > summary span { display: flex; align-items: center; gap: 8px; }
.package-drawer > summary svg { width: 16px; }
.package-drawer > summary > svg { color: var(--muted); transition: transform .2s; }
.package-drawer[open] > summary > svg { transform: rotate(180deg); }
.package-list { display: grid; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.package-list li { display: flex; align-items: flex-start; gap: 8px; color: #526164; font-size: 11px; }
.package-list svg { width: 13px; color: var(--teal); flex: 0 0 auto; }
.copy-block { position: relative; margin-bottom: 12px; padding: 14px 108px 14px 14px; background: #f7f9f8; border-radius: 6px; }
.copy-block p { margin: 0; color: #47575a; font-size: 11px; line-height: 1.65; }
.copy-block .copy-link { position: absolute; top: 10px; right: 10px; }
.preserve-lines { white-space: pre-line; }
.title-options { display: grid; gap: 6px; margin-bottom: 12px; }
.title-options > div { min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px 6px 12px; border: 1px solid var(--line); border-radius: 6px; font-size: 11px; }
.title-options .icon-btn { width: 30px; height: 30px; }
.chapter-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.chapter-list span { display: flex; gap: 6px; padding: 5px 8px; background: var(--soft); border-radius: 4px; font-size: 9px; }
.short-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-bottom: 16px; }
.short-grid article { padding: 14px; border: 1px solid var(--line); border-radius: 6px; }
.short-grid strong { display: block; margin-bottom: 8px; color: var(--coral); font-size: 11px; }
.short-grid .copy-link { margin-top: 12px; }
.thumbnail-package { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-bottom: 16px; }
.thumbnail-package > div { padding: 14px; background: #f7f9f8; border-radius: 6px; }
.thumbnail-package .wide { grid-column: span 2; }
.thumbnail-package p { margin: 0; color: #4e5c5f; font-size: 11px; line-height: 1.65; }
.thumbnail-package .copy-link { margin-top: 10px; }
.platform-copy { position: relative; margin-bottom: 18px; padding: 16px 125px 16px 16px; background: #f5f8f7; border-left: 3px solid var(--violet); border-radius: 5px; }
.platform-copy strong { display: block; margin-top: 4px; font-size: 13px; }
.platform-copy p { margin: 9px 0 0; color: #506063; font-size: 11px; line-height: 1.65; }
.platform-copy .platform-cta { color: var(--teal-dark); font-weight: 700; }
.platform-copy .copy-link { position: absolute; top: 14px; right: 14px; }

@media (max-width: 1199px) {
  .metric-grid-5 { grid-template-columns: repeat(3,1fr); }
  .user-grid { grid-template-columns: repeat(2,1fr); }
  .settings-row { grid-template-columns: auto 1fr 1fr auto auto; }
  .settings-row .media-pills { grid-column: 2 / 4; }
  .task-row { grid-template-columns: auto 1fr; }
  .task-controls { grid-column: 2; }
  .idea-grid { grid-template-columns: 1fr; }
}

@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 1035; background: rgba(8,18,20,.45); }
  .sidebar-open .sidebar-backdrop { display: block; }
  .main-area { margin-left: 0; }
  .topbar { padding: 0 20px; }
  .content-area { padding: 22px 20px 40px; }
  .detail-hero { margin: -22px -20px 20px; padding: 22px 20px; }
  .metric-grid-4, .metric-grid-5 { grid-template-columns: repeat(2,1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-side { grid-template-columns: repeat(2,1fr); }
  .queue-item { grid-template-columns: minmax(250px,1fr) 110px minmax(160px,.8fr); }
  .queue-item > .btn { grid-column: 1 / -1; justify-content: center; }
  .settings-section { grid-template-columns: 1fr; gap: 20px; }
  .settings-intro { max-width: 420px; }
  .handover-package { grid-template-columns: 1fr; }
  .metrics-form { grid-template-columns: repeat(3,1fr); }
  .knowledge-form { grid-template-columns: 1fr 1fr; }
  .knowledge-form .span-3, .knowledge-actions { grid-column: span 2; }
}

@media (max-width: 767px) {
  .topbar { height: 64px; padding: 0 14px; }
  .page-heading h1 { font-size: 17px; }
  .content-area { padding: 16px 12px 34px; }
  .detail-hero { min-height: 0; align-items: flex-start; flex-direction: column; margin: -16px -12px 16px; padding: 18px 14px; }
  .detail-hero h2 { font-size: 19px; }
  .detail-actions { width: 100%; }
  .detail-actions > * { flex: 1; }
  .detail-actions .btn { width: 100%; justify-content: center; }
  .metric-grid-4, .metric-grid-5 { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric-card { min-height: 92px; padding: 13px; }
  .metric-card strong { font-size: 20px; }
  .metric-icon { width: 33px; height: 33px; }
  .metric-icon svg { width: 16px; }
  .filter-strip, .toolbar { align-items: stretch; flex-direction: column; }
  .segmented { overflow-x: auto; }
  .filter-strip .segmented { width: 100%; }
  .filter-strip .segment { min-width: max-content; flex: 1; }
  .date-pair { justify-content: space-between; }
  .date-pair input { min-width: 0; width: 42%; }
  .search-filters { width: 100%; flex-wrap: wrap; }
  .search-box { min-width: 100%; max-width: none; }
  .search-filters > select { max-width: none; flex: 1; }
  .pipeline-row { grid-template-columns: 140px 1fr 22px; }
  .timeline.compact { grid-template-columns: 1fr; }
  .form-panel, .pipeline-panel, .impact-panel, .activity-panel, .ranking-panel { padding: 16px; }
  .form-grid, .distribution-grid { grid-template-columns: 1fr; gap: 12px; }
  .field.span-2, .field.span-3 { grid-column: span 1; }
  .check-grid { grid-template-columns: repeat(2,1fr); }
  .file-list { grid-template-columns: 1fr; }
  .upload-row { grid-template-columns: 1fr; }
  .detail-side { grid-template-columns: 1fr; }
  .read-grid { grid-template-columns: 1fr; }
  .read-grid .wide { grid-column: span 1; }
  .queue-item { grid-template-columns: 1fr 1fr; gap: 13px; }
  .queue-main { grid-column: 1 / -1; }
  .queue-progress { grid-column: 2; }
  .queue-item > .btn { grid-column: 1 / -1; }
  .metrics-form { grid-template-columns: 1fr 1fr; }
  .metrics-drawer summary { align-items: flex-start; flex-direction: column; gap: 3px; }
  .task-row { grid-template-columns: auto 1fr; }
  .task-controls { grid-column: 1 / -1; grid-template-columns: 1fr auto; }
  .task-controls input { grid-column: 1 / -1; grid-row: 1; }
  .user-grid { grid-template-columns: 1fr; }
  .settings-row, .settings-row.service-row { grid-template-columns: auto 1fr auto; align-items: center; }
  .settings-row > .field, .settings-row > .media-pills { grid-column: 1 / -1; }
  .settings-row > .toggle-row { grid-column: 2; }
  .settings-fields { grid-template-columns: 1fr; }
  .settings-fields .span-2 { grid-column: span 1; }
  .ranking-row { grid-template-columns: 22px minmax(110px,1fr) 70px; }
  .ranking-row > div:last-child { display: none; }
  .report-toolbar { flex-wrap: wrap; }
  .report-toolbar .week-picker { width: 100%; margin: 0; }
  .report-cover { align-items: stretch; flex-direction: column; padding: 24px 20px; }
  .report-cover h2 { font-size: 22px; }
  .report-revenue { padding: 18px; }
  .report-highlights { grid-template-columns: 1fr; }
  .team-output { grid-template-columns: 1fr; }
  .login-body { padding: 0; }
  .login-shell { min-height: 100vh; grid-template-columns: 1fr; border: 0; border-radius: 0; }
  .login-brand-panel { min-height: 250px; padding: 25px; }
  .login-statement h1 { font-size: 26px; }
  .pipeline-dots { display: none; }
  .login-form-panel { padding: 36px 24px; }
  .creator-ai-band, .ai-director-head { align-items: stretch; flex-direction: column; }
  .creator-ai-band .btn, .ai-director-head .btn { width: 100%; justify-content: center; }
  .ai-package { padding: 16px; }
  .ai-package-lead, .short-grid, .thumbnail-package { grid-template-columns: 1fr; }
  .ai-package-lead > div:last-child, .thumbnail-package .wide { grid-column: span 1; }
  .copy-block, .platform-copy { padding: 14px; }
  .copy-block .copy-link, .platform-copy .copy-link { position: static; margin-top: 10px; }
  .knowledge-entry > summary { grid-template-columns: 78px minmax(0,1fr) auto; }
  .knowledge-entry > summary > svg { display: none; }
  .knowledge-form { grid-template-columns: 1fr; }
  .knowledge-form .span-2, .knowledge-form .span-3, .knowledge-actions { grid-column: span 1; }
}

@media (max-width: 430px) {
  .metric-grid-4, .metric-grid-5 { grid-template-columns: 1fr; }
  .metric-card { min-height: 82px; }
  .metric-card small { white-space: normal; }
  .detail-kicker { align-items: flex-start; flex-wrap: wrap; }
  .queue-item { grid-template-columns: 1fr; }
  .queue-wait, .queue-progress { grid-column: 1; }
  .check-grid { grid-template-columns: 1fr 1fr; }
  .metrics-form { grid-template-columns: 1fr; }
  .topbar-actions .icon-btn { width: 34px; height: 34px; }
}
