:root {
    --bg: #101214;
    --panel: #171a1f;
    --panel-2: #20242b;
    --panel-3: #2a3038;
    --text: #edf2f7;
    --muted: #9aa7b4;
    --line: #303843;
    --green: #43d675;
    --blue: #6ca8ff;
    --orange: #ffb454;
    --red: #ff6b6b;
    --purple: #bd8cff;
    --cyan: #4fd8d8;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: "Nunito Sans", Inter, system-ui, sans-serif;
    letter-spacing: 0;
    font-size: 14px;
}

body.light {
    --bg: #f4fbf6;
    --panel: #fbfffd;
    --panel-2: #e8f7ed;
    --panel-3: #d2efdc;
    --text: #10231b;
    --muted: #64756c;
    --line: #d4eadc;
}

button,
input,
select,
textarea { font: inherit; }

button { cursor: pointer; }

.material-symbols-outlined {
    font-size: 18px;
    line-height: 1;
    vertical-align: middle;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid var(--line);
    background: #12151a;
    padding: 16px;
}

body.light .sidebar { background: #e4f8ea; }

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 6px 20px;
    border-bottom: 1px solid var(--line);
}

.brand-mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--green), var(--blue));
    color: #07100b;
    font-weight: 800;
}

.brand strong { display: block; font-weight: 700; }
.brand span,
.muted { color: var(--muted); font-size: 12px; }

.side-nav {
    display: grid;
    gap: 6px;
    padding: 18px 0;
}

.nav-item {
    width: 100%;
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    padding: 9px 10px;
    text-align: left;
    font-weight: 700;
}

.nav-item:hover,
.nav-item.active {
    background: color-mix(in srgb, var(--green) 18%, var(--panel-2));
    color: var(--text);
}

.nav-item b {
    min-width: 24px;
    border-radius: 999px;
    background: var(--panel-3);
    color: var(--text);
    padding: 2px 7px;
    font: 600 11px JetBrains Mono, monospace;
    text-align: center;
}

.status-stack {
    margin-top: 10px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.status-stack p,
.eyebrow {
    margin: 0 0 10px;
    color: var(--muted);
    font: 600 11px JetBrains Mono, monospace;
    text-transform: uppercase;
}

.legend-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
    border: 0;
    background: transparent;
    color: #cdd6df;
    font-size: 13px;
    text-align: left;
    border-radius: 7px;
    padding: 0 6px;
}

body.light .legend-item { color: #354255; }
.legend-item:hover,
.legend-item.active { background: var(--panel-2); color: var(--text); }

.dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--status-color);
}

.workspace {
    min-width: 0;
    padding: 18px;
}

.topbar {
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.topbar h1,
.time-hero h2,
.topics-hero h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search {
    width: min(420px, 38vw);
    height: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--muted);
    padding: 0 12px;
}

.search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
}

.running-timers-strip {
    margin: -6px 0 14px;
}

.running-timers-strip[hidden] {
    display: none;
}

.running-timers-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0 4px;
}

.running-timers-label,
.running-timer-card {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    border-radius: 8px;
}

.running-timers-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.running-timers-label .material-symbols-outlined {
    font-size: 17px;
}

.running-timer-card {
    max-width: min(360px, 50vw);
    border: 1px solid color-mix(in srgb, var(--status-color) 42%, var(--line));
    background: color-mix(in srgb, var(--status-color) 14%, var(--panel));
    color: var(--text);
    padding: 7px 10px;
    cursor: pointer;
    text-align: left;
}

.running-timer-card:hover {
    background: color-mix(in srgb, var(--status-color) 22%, var(--panel));
}

.running-timer-text {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.running-timer-text strong,
.running-timer-text span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.running-timer-text strong {
    font-size: 13px;
}

.running-timer-text span {
    color: var(--muted);
    font-size: 12px;
}

.running-clock {
    font: 800 13px JetBrains Mono, monospace;
    color: var(--text);
}

.focus-pulse {
    animation: focusPulse 1.8s ease;
}

@keyframes focusPulse {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--blue) 0%, transparent); }
    20% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 35%, transparent); }
}

.avatar {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: var(--blue);
    color: #07101d;
    font-weight: 800;
    font-size: 12px;
}

.page { display: none; }
.page.active { display: block; }

.toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    margin-bottom: 14px;
}

.metric-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.metric,
.panel,
.detail-panel,
.time-hero,
.topics-hero {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.metric { padding: 12px; }
.metric span { display: block; color: var(--muted); font-size: 12px; }
.metric strong { display: block; margin-top: 4px; font: 700 24px JetBrains Mono, monospace; }

.filters {
    display: flex;
    gap: 8px;
    align-items: end;
}

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
}

select,
input[type="date"],
input[type="number"],
input[type="search"],
input[type="text"],
textarea {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #0d1014;
    color: var(--text);
    padding: 8px 10px;
    outline: none;
}

.status-select {
    border-color: color-mix(in srgb, var(--status-color) 45%, var(--line));
    box-shadow: inset 4px 0 0 var(--status-color);
}

body.light select,
body.light input[type="date"],
body.light input[type="number"],
body.light input[type="search"],
body.light input[type="text"],
body.light textarea,
body.light .search {
    background: #ffffff;
    color: var(--text);
}

textarea { resize: vertical; }

.board-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.72fr) minmax(520px, 1.28fr);
    gap: 14px;
    align-items: start;
    min-height: calc(100vh - 150px);
}

.board-layout.no-detail {
    grid-template-columns: 1fr;
}

.status-board,
.detail-panel { min-width: 0; }

.status-group {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    overflow: hidden;
}

.status-head {
    min-height: 42px;
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--line);
    padding: 0 12px;
}

.status-head::before {
    content: "";
    width: 8px;
    height: 26px;
    border-radius: 6px;
    background: var(--status-color);
}

.status-head h2 {
    margin: 0;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.status-head span {
    color: var(--muted);
    font: 600 11px JetBrains Mono, monospace;
}

.business-list { display: grid; }

.business-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 138px;
    gap: 10px;
    align-items: center;
    min-height: 52px;
    border: 0;
    border-bottom: 1px solid rgba(48, 56, 67, 0.75);
    background: transparent;
    color: var(--text);
    text-align: left;
    padding: 10px 12px;
}

.business-card:last-child { border-bottom: 0; }
.business-card:hover,
.business-card.active {
    background: #1f2b38;
}
body.light .business-card:hover,
body.light .business-card.active { background: #dbeafe; }

.business-list:has(.business-card.active) .business-card:not(.active) {
    opacity: 0.42;
}

.business-list:has(.business-card.active) .business-card:not(.active):hover {
    opacity: 0.9;
}

.business-main {
    display: flex;
    gap: 0;
    align-items: center;
    min-width: 0;
}

.business-main > div {
    min-width: 0;
}

.business-main h3 {
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.business-main p,
.cell-label {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.business-main p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.business-card .tier-pill,
.business-card .status-pill {
    display: none;
}

.mini-count {
    color: var(--muted);
    font: 700 11px JetBrains Mono, monospace;
    white-space: nowrap;
}

.mini-progress {
    min-width: 128px;
}

.tier-pill,
.status-pill,
.progress-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 3px 9px;
    font: 700 11px JetBrains Mono, monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tier-pill.core { background: rgba(108, 168, 255, 0.18); color: #a9caff; }
.tier-pill.premium { background: rgba(189, 140, 255, 0.18); color: #d7bdff; }
.status-pill { background: color-mix(in srgb, var(--status-color) 16%, transparent); color: var(--status-color); }
.assignee-select { width: 100%; }

.progress-bar {
    height: 7px;
    border-radius: 999px;
    overflow: hidden;
    background: #0d1014;
    margin-top: 6px;
}

.progress-bar span {
    display: block;
    height: 100%;
    width: var(--progress);
    background: var(--green);
}

.empty-state {
    padding: 18px;
    color: var(--muted);
    text-align: center;
}

.detail-panel {
    position: sticky;
    top: 18px;
    align-self: start;
    padding: 14px;
    height: calc(100vh - 36px);
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.detail-title {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
}

.detail-title h2 { margin: 0; font-size: 18px; }
.detail-title p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }

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

.business-name-editor {
    min-height: 34px;
    width: min(460px, 42vw);
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel-2);
    color: var(--text);
    padding: 0 10px;
    font-size: 18px;
    font-weight: 800;
}

.subtle-flag {
    min-height: 24px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: color-mix(in srgb, var(--muted) 32%, transparent);
    padding: 0 8px;
    font-size: 10px;
    font-weight: 700;
}

.subtle-flag.active {
    border-color: rgba(255, 180, 84, 0.45);
    background: rgba(255, 180, 84, 0.16);
    color: var(--orange);
}

.detail-actions {
    display: flex;
    align-items: end;
    gap: 8px;
}

.danger-btn {
    min-height: 38px;
    border: 1px solid rgba(255, 107, 107, 0.45);
    border-radius: 7px;
    background: rgba(255, 107, 107, 0.09);
    color: var(--red);
    padding: 0 10px;
    font-weight: 700;
}

.business-delete-btn {
    width: 30px;
    min-height: 30px;
    padding: 0;
    font-size: 0;
}

.business-delete-btn .material-symbols-outlined {
    font-size: 16px;
}

.due-date-input {
    min-height: 32px;
    width: 122px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel-2);
    color: var(--text);
    padding: 4px 7px;
    font-size: 12px;
    color-scheme: dark;
}

body.light .due-date-input {
    background: #ffffff;
    color: #17202a;
    color-scheme: light;
}

.due-date-input::-webkit-calendar-picker-indicator {
    opacity: 1;
    cursor: pointer;
}

.due-date-chip,
.undo-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 22px;
    border-radius: 999px;
    background: var(--panel-2);
    color: var(--muted);
    padding: 2px 7px;
    font-size: 11px;
    margin-top: 5px;
}

.undo-chip button {
    border: 0;
    background: transparent;
    color: var(--green);
    font-weight: 700;
    padding: 0;
}

.checklist {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.task-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 86px auto auto auto 126px;
    gap: 6px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #11161c;
    padding: 6px;
    min-width: 0;
}

.standalone-section {
    margin-top: 16px;
}

.standalone-section.first {
    margin-top: 14px;
}

.standalone-board-group {
    border-color: rgba(96, 165, 250, 0.5);
}

.standalone-board-list {
    display: grid;
    gap: 8px;
    padding: 10px;
}

.standalone-task {
    display: block;
    overflow: hidden;
}

.standalone-task-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.standalone-task-head .task-name {
    flex: 1 1 150px;
}

.standalone-task-head .compact-status {
    flex: 1 1 130px;
    width: 130px;
}

.standalone-task-head .tag-select {
    flex: 0 1 86px;
    width: 86px;
}

.standalone-task-head .due-date-input {
    flex: 0 1 122px;
}

.standalone-task-head .icon-btn {
    flex: 0 0 28px;
}

.standalone-task .task-tools {
    display: block;
    margin-top: 6px;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--status-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--status-color) 18%, transparent);
}

body.light .task-row.has-comment,
.task-row.has-comment {
    border-color: rgba(96, 165, 250, 0.55);
    box-shadow: inset 3px 0 0 var(--blue);
}

.task-row.done .task-name {
    color: var(--muted);
    text-decoration: line-through;
}

.task-name {
    min-width: 0;
    font-size: 12px;
}

.task-tools {
    grid-column: 2 / -1;
    display: grid;
    gap: 6px;
}

.task-note {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.comment-input {
    min-height: 32px;
    font-size: 12px;
}

.comment-editor {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    margin-top: 6px;
}

.comment-chip-wrap {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    max-width: min(100%, 420px);
}

.comment-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    border: 1px solid rgba(96, 165, 250, 0.36);
    border-radius: 999px;
    background: rgba(96, 165, 250, 0.12);
    color: var(--text);
    padding: 3px 7px;
    font-size: 11px;
    margin-top: 4px;
}

.comment-chip span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inline-delete {
    width: 22px;
    min-height: 22px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(255, 107, 107, 0.35);
    border-radius: 999px;
    background: transparent;
    color: var(--red);
    padding: 0;
    margin-top: 4px;
}

.inline-delete .material-symbols-outlined { font-size: 14px; }

.tag-select {
    min-height: 30px;
    padding: 4px 7px;
    font-size: 12px;
}

.attachment-strip {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.attachment-strip img {
    width: 22px;
    height: 16px;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 5px;
}

.icon-btn,
.primary-btn,
.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel-2);
    color: var(--text);
    padding: 0 10px;
}

.icon-btn {
    width: 28px;
    min-height: 28px;
    padding: 0;
}

.photo-btn {
    min-height: 24px;
    padding: 0 6px;
    font-size: 11px;
}

.photo-btn .material-symbols-outlined {
    font-size: 14px;
}

.export-btn {
    min-height: 28px;
    padding: 0 8px;
    font-size: 12px;
}

.export-btn .material-symbols-outlined {
    font-size: 16px;
}

.delete-comment-btn {
    color: var(--red);
}

.business-dialog {
    width: min(420px, calc(100vw - 40px));
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    color: var(--text);
    padding: 18px;
    margin: auto;
    overflow-x: hidden;
    overflow-y: auto;
}

.business-dialog::backdrop {
    background: rgba(0, 0, 0, 0.6);
}

.business-dialog form {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.business-dialog label,
.business-dialog input,
.business-dialog select,
.business-dialog textarea {
    width: 100%;
    min-width: 0;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.icon-btn.running {
    border-color: var(--green);
    color: var(--green);
    box-shadow: 0 0 0 3px rgba(67, 214, 117, 0.11);
}

.primary-btn {
    border-color: transparent;
    background: var(--green);
    color: #07100b;
    font-weight: 800;
}

.secondary-btn:hover,
.icon-btn:hover { background: var(--panel-3); }

.active-timer {
    margin-top: 12px;
    border: 1px solid rgba(67, 214, 117, 0.35);
    border-radius: 8px;
    background: rgba(67, 214, 117, 0.08);
    padding: 10px;
    color: #bcffd1;
}

body.light .active-timer {
    border-color: #22c55e;
    background: #dcfce7;
    color: #14532d;
}

.time-hero,
.topics-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px;
    margin-bottom: 14px;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.compact-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.compact-filter select {
    min-height: 34px;
    min-width: 124px;
    font-size: 13px;
}

.time-hero strong {
    font: 800 32px JetBrains Mono, monospace;
    color: var(--green);
}

.week-summary {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.week-nav {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.time-grid {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 14px;
}

.panel { padding: 14px; }
.panel-head { margin-bottom: 12px; }
.panel-head h3 { margin: 0 0 2px; font-size: 16px; }

.manual-form {
    display: grid;
    gap: 10px;
}

.time-log-list,
.topics-list {
    display: grid;
    gap: 9px;
}

.workflow-list {
    display: grid;
    gap: 8px;
}

.workflow-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) repeat(2, auto) minmax(130px, 0.7fr) minmax(180px, 1fr);
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--panel) 86%, var(--green) 8%);
    padding: 10px 12px;
}

.workflow-row.citation-row {
    grid-template-columns: minmax(220px, 1.4fr) repeat(2, auto) minmax(130px, 0.7fr) minmax(180px, 1fr) 34px;
}

.workflow-row.seo-row {
    grid-template-columns: minmax(220px, 1.2fr) 128px 92px minmax(170px, 0.85fr) auto minmax(160px, 1fr) minmax(160px, 1fr) 34px;
}

body.light .workflow-row {
    background: #f7fffa;
}

.workflow-main {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.workflow-main strong {
    overflow: hidden;
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workflow-main span {
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workflow-check {
    display: inline-flex;
    grid-auto-flow: column;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel);
    padding: 0 8px;
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
}

.workflow-check input {
    width: 15px;
    height: 15px;
    accent-color: var(--green);
}

.segmented {
    display: inline-flex;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.segmented button {
    min-height: 30px;
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 0 10px;
    font-weight: 800;
}

.segmented button.active {
    background: var(--green);
    color: #062214;
}

.segmented button.active.ghl {
    background: #ef4444;
    color: #fff;
}

.segmented button.active.leadsnap {
    background: #22c55e;
    color: #062214;
}

.due-date-input.date-past {
    border-color: #ef4444;
    background: color-mix(in srgb, #ef4444 18%, var(--panel));
    color: var(--text);
}

.due-date-input.date-soon {
    border-color: #fca5a5;
    background: color-mix(in srgb, #fca5a5 18%, var(--panel));
    color: var(--text);
}

.due-date-input.date-safe {
    border-color: #22c55e;
    background: color-mix(in srgb, #22c55e 16%, var(--panel));
    color: var(--text);
}

.map-pack-input {
    width: 92px;
    min-height: 32px;
    text-align: center;
    font-weight: 800;
}

.map-pack-input.score-good {
    border-color: #22c55e;
    background: color-mix(in srgb, #22c55e 18%, var(--panel));
}

.map-pack-input.score-warn {
    border-color: #facc15;
    background: color-mix(in srgb, #facc15 22%, var(--panel));
}

.map-pack-input.score-bad {
    border-color: #ef4444;
    background: color-mix(in srgb, #ef4444 18%, var(--panel));
}

.metric-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--green) 20%, var(--panel));
    color: var(--text);
    padding: 0 10px;
    font: 800 12px JetBrains Mono, monospace;
}

.mini-link {
    min-height: 30px;
    text-decoration: none;
}

.inline-add-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inline-add-form input {
    width: min(280px, 34vw);
}

.time-entry,
.topic-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #11161c;
    padding: 10px;
}

body.light .task-row,
body.light .time-entry,
body.light .topic-card { background: #f8fafc; }

.time-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 128px 34px 34px;
    gap: 10px;
    align-items: center;
}

.time-duration {
    font: 700 12px JetBrains Mono, monospace;
    text-align: right;
}

.time-edit {
    display: flex;
    align-items: center;
    gap: 5px;
}

.time-edit input {
    width: 72px;
    min-height: 30px;
}

.time-entry h4,
.topic-card h3 {
    margin: 0;
    font-size: 14px;
}

.time-entry p,
.topic-card p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.topic-card .comment-input {
    margin-top: 8px;
    width: 100%;
}

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

.topic-card.resolved { opacity: 0.55; }

.weekly-card {
    grid-template-columns: minmax(0, 1fr) 118px 130px auto auto;
    align-items: center;
}

.future-card {
    grid-template-columns: minmax(0, 1fr) 122px 150px 106px auto auto auto auto;
}

.compact-status {
    min-height: 32px;
    max-width: 150px;
    border-color: var(--status-color);
    font-size: 12px;
    padding: 4px 7px;
}

.add-checklist-task {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
}

.add-checklist-task input {
    flex: 1 1 auto;
    min-width: 0;
}

.weekly-card h3,
.weekly-card p,
.time-entry h4 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-thumb {
    width: 44px;
    height: 32px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--line);
}

.preview-button {
    border: 0;
    background: transparent;
    padding: 0;
}

.image-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.72);
    padding: 24px;
}

.image-modal[hidden] { display: none; }

.image-modal img {
    max-width: min(920px, 92vw);
    max-height: 86vh;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--panel);
}

@media (max-width: 1160px) {
    .app-shell { grid-template-columns: 82px minmax(0, 1fr); }
    .brand div:not(.brand-mark),
    .nav-item b,
    .status-stack { display: none; }
    .sidebar { padding: 14px 10px; }
    .nav-item { grid-template-columns: 1fr; place-items: center; font-size: 0; }
    .nav-item .material-symbols-outlined { font-size: 22px; }
    .board-layout,
    .time-grid { grid-template-columns: 1fr; }
    .workflow-row,
    .workflow-row.seo-row {
        grid-template-columns: minmax(0, 1fr) minmax(120px, auto);
    }
    .detail-panel {
        position: static;
        height: auto;
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 820px) {
    .app-shell { display: block; }
    .sidebar {
        position: static;
        height: auto;
        display: flex;
        gap: 10px;
        align-items: center;
        overflow-x: auto;
    }
    .side-nav {
        display: flex;
        padding: 0;
    }
    .brand { border: 0; padding: 0; }
    .workspace { padding: 12px; }
    .topbar,
    .toolbar,
    .time-hero,
    .topics-hero {
        display: grid;
        grid-template-columns: 1fr;
    }
    .search { width: 100%; }
    .metric-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filters { display: grid; }
    .inline-add-form {
        display: grid;
        grid-template-columns: 1fr auto;
    }
    .inline-add-form input {
        width: 100%;
    }
    .workflow-row,
    .workflow-row.seo-row {
        grid-template-columns: 1fr;
    }
    .business-card {
        grid-template-columns: 1fr;
        align-items: start;
    }
}
