﻿:root {
    --bg: #07070c;
    --panel: rgba(12, 16, 28, 0.82);
    --line: rgba(0, 229, 255, 0.28);
    --cyan: #00e5ff;
    --violet: #7c4dff;
    --magenta: #ff2d95;
    --text: #e8f6ff;
    --muted: #8aa0b5;
    --radius: 14px;
    --font: system-ui, "Segoe UI", sans-serif;
    --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
    --space: clamp(0.9rem, 2vw, 1.5rem);
    --touch: 44px;
}

* { box-sizing: border-box; }
html { min-height: 100%; overflow-x: hidden; }
body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--font);
    color: var(--text);
    overflow-x: hidden;
    background:
        radial-gradient(900px 480px at 8% -8%, rgba(0, 229, 255, 0.1), transparent 52%),
        radial-gradient(700px 420px at 108% 0%, rgba(124, 77, 255, 0.16), transparent 48%),
        linear-gradient(rgba(0, 229, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.04) 1px, transparent 1px),
        var(--bg);
    background-size: auto, auto, 48px 48px, 48px 48px, auto;
}

a { color: var(--cyan); text-decoration: none; }
h1, h2, h3 { margin: 0 0 0.35rem; letter-spacing: 0.02em; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.45rem, 3vw, 2rem); }
h2 { font-size: clamp(1.2rem, 2.4vw, 1.6rem); }
p { margin: 0 0 0.5rem; }
img, svg { max-width: 100%; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 0.82rem; color: var(--cyan); overflow-wrap: anywhere; }
.eyebrow {
    margin: 0 0 0.2rem;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--cyan);
}
.hint { font-size: 0.8rem; color: var(--muted); }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.scanlines {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: 0.1;
    background: repeating-linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.04),
        rgba(255, 255, 255, 0.04) 1px,
        transparent 1px,
        transparent 4px
    );
}
.app-shell,
.auth-wrap { position: relative; z-index: 1; }

dialog.confirm {
    width: min(420px, calc(100% - 2rem));
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
}
dialog.confirm::backdrop { background: rgba(7, 7, 12, 0.78); }
dialog.busy-overlay {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
}
dialog.busy-overlay::backdrop {
    background: rgba(7, 7, 12, 0.82);
}
.busy-overlay-box {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    text-align: center;
    pointer-events: none;
}
.busy-overlay-loader {
    width: 42px;
    height: 42px;
    border-width: 3px;
}
.busy-overlay-text {
    margin: 0;
    max-width: 28rem;
    color: var(--cyan);
    font-family: var(--mono);
    font-size: 0.95rem;
    line-height: 1.4;
}
.check-wait { display: flex; align-items: center; gap: 0.8rem; }
.check-wait[hidden], .check-result[hidden], #check-close[hidden] { display: none; }
.check-result { margin: 0.2rem 0 0; }
.check-result.tone-cyan { color: var(--cyan); }
.check-result.tone-magenta { color: var(--magenta); }
.loader {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    border: 2px solid var(--line);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.claudio-busy {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: 0.35rem;
    vertical-align: middle;
    color: var(--cyan);
    font-family: var(--mono);
    font-size: 0.72rem;
}
.claudio-busy[hidden] { display: none !important; }
.claudio-busy .loader {
    width: 12px;
    height: 12px;
    border-width: 1.5px;
}
.claudio-busy-label {
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.project-head-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
}
.project-card[data-ai-busy="1"],
.task-row[data-ai-busy="1"],
.kanban-card[data-ai-busy="1"] {
    box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.18), 0 0 28px rgba(0, 229, 255, 0.08);
}
.task-toolbar .claudio-busy { margin: 0; }

.task-page {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
.task-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    gap: 0.85rem;
    align-items: stretch;
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
.task-pane {
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: auto;
}
.task-side {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: auto;
    overscroll-behavior: contain;
}
.task-pane-live {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    flex: 0 0 auto;
    min-height: 0;
}
.task-pane-live:not(:has(#claudio-panel:not([hidden]))) .task-live-empty {
    display: block;
}
.task-live-empty { margin: 0; }
.task-live-hint { display: none; margin: 0 0 0.55rem; }
.task-live-hint-link {
    color: var(--cyan);
    cursor: pointer;
    text-decoration: underline;
}
.chat {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 0;
    min-width: 0;
    max-width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    padding-bottom: 0;
}
.chat-thread {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-width: 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0.15rem 0.1rem 0.75rem 0;
    scroll-behavior: smooth;
}
.chat-empty { margin: 0; }
.chat-composer-dock {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
    margin: 0 -1.15rem -1.1rem;
    padding: 0.7rem 1.15rem 0.75rem;
    border-top: 1px solid var(--line);
    background: rgba(7, 7, 12, 0.94);
    backdrop-filter: blur(10px);
}
.task-side > .task-pane {
    height: auto;
}
.task-files-panel {
    min-width: 0;
    min-height: 0;
    flex: 1 1 auto;
    overflow: auto;
}
.task-toolbar {
    position: relative;
    z-index: 40;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem 1rem;
    align-items: start;
    margin-bottom: 0;
    flex: 0 0 auto;
}
.task-toolbar .status.task-ajax-flash,
.task-toolbar > .status {
    grid-column: 1 / -1;
    margin: 0;
}
.task-toolbar-main { min-width: 0; }
.task-title {
    margin: 0.15rem 0 0.4rem;
    font-size: clamp(1.05rem, 2.2vw, 1.35rem);
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.task-summary-long {
    margin: 0 0 0.55rem;
    max-width: 52rem;
    white-space: pre-wrap;
    line-height: 1.4;
    font-size: 0.92rem;
}
.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}
.task-commit {
    font-size: 0.78rem;
}
.task-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}
.task-actions-primary { display: contents; }
.task-actions-primary form { display: contents; }
.task-actions .btn { min-height: var(--touch); }
.task-actions-more { position: relative; z-index: 1; }
.task-actions-more[open] { z-index: 50; }
.task-actions-more > summary,
.composer-more > summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
}
.task-actions-more > summary::-webkit-details-marker,
.composer-more > summary::-webkit-details-marker { display: none; }
.task-actions-more > summary::after {
    content: "\25BE";
    margin-left: 0.4rem;
    color: var(--cyan);
    font-size: 0.8rem;
}
.task-actions-more[open] > summary::after { content: "\25B4"; }
.task-actions-more[open] > summary,
.composer-more[open] > summary {
    border-color: var(--cyan);
    background: rgba(0, 229, 255, 0.08);
}
.task-actions-more-list,
.composer-more-list {
    position: absolute;
    z-index: 50;
    display: grid;
    gap: 0.45rem;
    min-width: 13rem;
    padding: 0.6rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(7, 7, 12, 0.98);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}
.task-actions-more-list { top: calc(100% + 0.35rem); right: 0; }
.task-actions-more-list form { display: block; margin: 0; }
.task-actions-more-list .btn { width: 100%; }

.task-pane-radio,
.project-pane-radio {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
    white-space: nowrap;
}
.task-pane-tabs {
    display: none;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem;
    flex: 0 0 auto;
    flex-shrink: 0;
    position: relative;
    z-index: 3;
    padding: 0.35rem 0 calc(0.35rem + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(7, 7, 12, 0.96);
    backdrop-filter: blur(10px);
}
.task-pane-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--touch);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--muted);
    background: rgba(0, 0, 0, 0.28);
    cursor: pointer;
    font-size: 0.88rem;
    user-select: none;
}
#task-pane-chat:checked ~ .task-pane-tabs label[for="task-pane-chat"],
#task-pane-files:checked ~ .task-pane-tabs label[for="task-pane-files"],
#task-pane-live:checked ~ .task-pane-tabs label[for="task-pane-live"] {
    color: var(--text);
    border-color: var(--cyan);
    box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.2);
    background: rgba(0, 229, 255, 0.08);
}

.composer-bar {
    position: relative;
    display: flex;
    gap: 0.45rem;
    align-items: stretch;
}
.composer-bar form { margin: 0; }
.composer-bar .btn { min-height: var(--touch); }
.composer-send { flex: 1 1 auto; }
.composer-more > summary { min-width: var(--touch); padding-inline: 0.7rem; font-size: 1.1rem; line-height: 1; }
.composer-more-list {
    bottom: calc(100% + 0.45rem);
    left: 0;
    right: 0;
    min-width: 0;
}
.composer-more-list .btn { width: 100%; justify-content: flex-start; }
.composer-more-field { display: grid; gap: 0.25rem; font-size: 0.8rem; color: var(--muted); }
.composer-more-field select { width: 100%; min-height: var(--touch); }
.composer-more-list .hint { margin: 0; }
.dictate-btn { position: relative; }
.dictate-btn.is-live {
    color: var(--cyan);
    border-color: var(--cyan);
}
.dictate-btn.is-live::after {
    content: "";
    position: absolute;
    inset: -4px;
    border: 1px solid var(--cyan);
    pointer-events: none;
    animation: pulse 1.2s infinite;
}
.message {
    border-top: 1px solid var(--line);
    padding-top: 0.75rem;
    min-width: 0;
    max-width: 100%;
}
.chat-thread > .message:first-child { border-top: 0; padding-top: 0; }
.message.is-claudio { padding-left: 0.7rem; border-left: 2px solid var(--violet); }
.message.is-system {
    padding-top: 0.45rem;
    border-left-color: var(--muted);
}
.message.is-system .message-body { color: var(--muted); font-size: 0.9rem; }
.message.is-plan { border-left-color: var(--cyan); }
.message.is-approval { border-left-color: var(--magenta); }
.message.is-result { border-left-color: var(--violet); }
.message-head { display: flex; flex-wrap: wrap; gap: 0.35rem 0.7rem; align-items: center; margin-bottom: 0.35rem; }
.message-head .icon-btn { margin-left: auto; }
.message-head time { color: var(--muted); font-size: 0.75rem; }
.message-body {
    margin: 0;
    line-height: 1.45;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.message .card-actions { margin-top: 0.55rem; padding-top: 0; }
.message .composer { margin-top: 0.45rem; }
.file-list { list-style: none; padding: 0; margin: 0.4rem 0 0; display: grid; gap: 0.35rem; }
.file-list li {
    display: flex;
    justify-content: space-between;
    gap: 0.45rem 0.75rem;
    align-items: baseline;
    flex-wrap: wrap;
    min-width: 0;
}
.file-list .mono,
.file-list .file-link {
    flex: 1 1 10rem;
    min-width: 0;
}
.file-link {
    background: none;
    border: 0;
    padding: 0;
    color: var(--cyan);
    font: inherit;
    cursor: pointer;
    text-align: left;
}
.claudio-panel {
    margin-bottom: 0;
    flex: 0 0 auto;
}
.claudio-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    align-items: flex-start;
    margin-bottom: 0.6rem;
}
.claudio-panel-copy { min-width: 0; flex: 1 1 auto; }
.claudio-panel-head .claudio-actions {
    margin: 0;
    padding: 0;
    align-items: center;
}
.claudio-panel-head .live-dot {
    min-height: var(--touch);
}
.live-dot.is-hot::before {
    animation: live-pulse 1.4s ease-out infinite;
}
.claudio-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}
.activity-list {
    list-style: none;
    padding: 0;
    margin: 0.35rem 0 0;
    display: grid;
    gap: 0.3rem;
    max-height: 10rem;
    overflow: auto;
}
.activity-list li { font-size: 0.86rem; color: var(--muted); }
.pulse-dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: var(--muted);
    box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.4);
    display: inline-block;
    flex: 0 0 auto;
    margin: 0;
}
.pulse-dot.is-hot {
    background: var(--cyan);
    animation: live-pulse 1.4s ease-out infinite;
}
@keyframes live-pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.45); }
    70% { box-shadow: 0 0 0 10px rgba(0, 229, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0); }
}
.diff-view {
    max-height: 50vh;
    overflow: auto;
    white-space: pre-wrap;
    font-family: var(--mono);
    font-size: 0.78rem;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.75rem;
}
pre.hint {
    margin: 0.35rem 0 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-family: var(--mono);
    font-size: 0.78rem;
}
textarea {
    width: 100%;
    min-height: 5.5rem;
    border: 1px solid var(--line);
    background: rgba(7, 7, 12, 0.78);
    color: var(--text);
    padding: 0.65rem 0.75rem;
    font: inherit;
    font-size: 1rem;
    resize: vertical;
}
.message-shots,
.composer-shots {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}
.message-shot {
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: transparent;
    cursor: zoom-in;
    line-height: 0;
}
.message-shot img,
.composer-shot img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    display: block;
}
.message-shot img { border-radius: 7px; }
.composer-shot {
    position: relative;
    line-height: 0;
}
.composer-shot img {
    border: 1px solid var(--line);
    border-radius: 8px;
}
.composer-shot button {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 1.35rem;
    height: 1.35rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    cursor: pointer;
    line-height: 1.35rem;
    font-size: 0.95rem;
}
.shot-lightbox {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1.25rem 1.25rem;
    background: rgba(0, 0, 0, 0.72);
}
.shot-lightbox[hidden] { display: none; }
.shot-lightbox img {
    max-width: min(96vw, 1400px);
    max-height: calc(100vh - 5.5rem);
    object-fit: contain;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}
.shot-lightbox-close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
}
body.shot-open { overflow: hidden; }
.composer { display: grid; gap: 0.55rem; min-width: 0; }
.composer textarea { max-width: 100%; }
.composer .btn { justify-self: start; min-height: var(--touch); }
.chat > .hint { margin: 0; }
.composer-inline { display: flex; gap: 0.5rem; margin: 0.9rem 0; }
.composer-inline input { flex: 1; min-width: 0; }

.hud-box {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.1rem 1.15rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 0 28px rgba(0, 229, 255, 0.06);
}
.hud-box::before,
.hud-box::after {
    content: "";
    position: absolute;
    width: 12px;
    height: 12px;
    border-color: var(--cyan);
    border-style: solid;
    pointer-events: none;
}
.hud-box::before { top: 6px; left: 6px; border-width: 1px 0 0 1px; }
.hud-box::after { right: 6px; bottom: 6px; border-width: 0 1px 1px 0; }

body:has(.app-shell) {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
}
.app-shell {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    width: 100%;
    min-width: 0;
}
.app-main {
    min-width: 0;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    overflow: auto;
    overscroll-behavior: contain;
}
.app-shell:has(.task-page) > .app-main,
.app-shell:has(.project-page) > .app-main {
    overflow: hidden;
}
.app-content {
    padding: 0 var(--space) calc(2rem + env(safe-area-inset-bottom));
}
.app-content:has(.task-page) {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding-bottom: 0.5rem;
    overflow: hidden;
}
@media (max-width: 960px) {
    .app-content:has(.task-page),
    .app-content:has(.project-page) {
        padding-left: 0.65rem;
        padding-right: 0.65rem;
        padding-bottom: 0;
    }
    .app-shell:has(.task-page) .topbar {
        padding-bottom: 0.45rem;
    }
}

.app-shell:has(.task-page) .topbar > div:first-child {
    display: none;
}
.app-shell:has(.task-page) .topbar {
    padding-top: calc(0.55rem + env(safe-area-inset-top));
    padding-bottom: 0.45rem;
}


.sidebar {
    position: sticky;
    top: 0;
    align-self: stretch;
    height: 100%;
    max-height: 100dvh;
    overflow: auto;
    display: flex;
    flex-direction: column;
    padding: 1.3rem 1rem;
    border-right: 1px solid var(--line);
    background: rgba(7, 7, 12, 0.86);
}
.brand {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    color: var(--text);
    margin-bottom: 1.6rem;
}
.brand strong, .brand em { display: block; line-height: 1.1; }
.brand em {
    font-style: normal;
    color: var(--cyan);
    letter-spacing: 0.22em;
    font-size: 0.72rem;
}
.brand-mark {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    border: 1px solid var(--cyan);
    box-shadow: 0 0 12px var(--cyan);
    background: rgba(0, 229, 255, 0.25);
}
.brand-inline {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    font-family: var(--mono);
    letter-spacing: 0.14em;
    font-size: 0.78rem;
}
.side-nav { display: flex; flex-direction: column; gap: 0.35rem; }
.side-nav a {
    color: var(--muted);
    min-height: var(--touch);
    display: flex;
    align-items: center;
    padding: 0.4rem 0.7rem;
    border: 1px solid transparent;
}
.side-nav a:hover,
.side-nav a.is-active {
    color: var(--text);
    border-color: var(--line);
    background: rgba(0, 229, 255, 0.08);
}
.side-foot {
    margin-top: auto;
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--muted);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem 1rem;
    padding: calc(0.9rem + env(safe-area-inset-top)) var(--space) 0.8rem;
}
.topbar-right {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 0.7rem 1rem;
    min-width: 0;
}
.live-dot {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--cyan);
    white-space: nowrap;
    flex: 0 0 auto;
}
.live-dot::before {
    content: "";
    display: block;
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 8px var(--cyan);
}
.user-chip {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    flex: 0 1 auto;
}
.user-chip > span:last-child {
    min-width: 0;
    overflow: hidden;
}
.user-chip strong,
.user-chip small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-chip small { color: var(--muted); font-size: 0.72rem; }
.topbar-right form { flex: 0 0 auto; }
.person { display: flex; align-items: center; gap: 0.8rem; min-width: 0; }
.person p { margin: 0.1rem 0 0; }
.avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid var(--violet);
    color: var(--violet);
    font-family: var(--mono);
    font-size: 0.72rem;
}
.avatar-lg { width: 64px; height: 64px; font-size: 1rem; }
.config-tabs {
    display: flex;
    gap: 0.2rem;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    margin: 0 0 1.15rem;
    border-bottom: 1px solid var(--line);
}
.config-tabs::-webkit-scrollbar { display: none; }
.config-tabs a,
.config-tabs button {
    flex: 0 0 auto;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    min-height: var(--touch);
    padding: 0.35rem 0.95rem;
    margin-bottom: -1px;
    color: var(--muted);
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    font: inherit;
    cursor: pointer;
    text-decoration: none;
}
.config-tabs a.is-active,
.config-tabs button.is-active { color: var(--cyan); border-bottom-color: var(--cyan); }
.config-tabs button.tab-danger { color: var(--magenta); margin-left: auto; }
.config-tabs button.tab-danger.is-active { color: var(--magenta); border-bottom-color: var(--magenta); }
.tab-panel { display: grid; gap: 0.75rem; }
.tab-panel .eyebrow { margin-top: 0.4rem; }
.danger-zone {
    padding: 0.85rem 1rem;
    border: 1px solid rgba(255, 45, 149, 0.45);
    background: rgba(255, 45, 149, 0.06);
}
.danger-zone .eyebrow { margin-top: 0; }
.eyebrow.tone-magenta { color: var(--magenta); }
dialog.config-dialog {
    width: min(560px, calc(100% - 2rem));
    max-height: min(90dvh, 720px);
}
dialog.ask-dialog {
    width: calc(100vw - 2rem);
    height: calc(100dvh - 2rem);
    max-width: none;
    max-height: none;
}
dialog.file-view-dialog[open] {
    display: flex;
    flex-direction: column;
}
dialog.file-view-dialog .ask-shell {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
}
.file-view {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.45);
}
.file-view-code {
    margin: 0;
    padding: 0.65rem 0;
    min-width: min-content;
    font-family: var(--mono);
    font-size: 0.84rem;
    line-height: 1.5;
    tab-size: 4;
}
.file-line {
    display: flex;
    gap: 0.75rem;
    padding: 0 0.85rem;
    white-space: pre;
}
.file-gutter {
    flex: 0 0 2.8rem;
    text-align: right;
    color: var(--muted);
    user-select: none;
}
.file-line.is-changed { background: rgba(0, 229, 255, 0.14); }
.file-line.is-removed { background: rgba(255, 45, 149, 0.14); }
.file-line.is-removed code { text-decoration: line-through; }
dialog.ask-dialog .ask-shell,
dialog.ask-code-dialog .ask-code-full {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    height: 100%;
    max-height: none;
    overflow: hidden;
    box-sizing: border-box;
}
.ask-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.8rem;
}
.ask-head-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; }
.ask-ide {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.45);
    overflow: hidden;
}
textarea.ask-editor,
.ask-ide-highlight {
    position: absolute;
    inset: 0;
    box-sizing: border-box;
    margin: 0;
    padding: 0.75rem 0.85rem;
    border: 0;
    background: transparent;
    font-family: var(--mono);
    font-size: 0.84rem;
    line-height: 1.5;
    tab-size: 4;
    white-space: pre;
    overflow: auto;
    scrollbar-gutter: stable;
    letter-spacing: 0;
}
.ask-ide-highlight { scrollbar-width: none; }
.ask-ide-highlight::-webkit-scrollbar { width: 0; height: 0; }
textarea.ask-editor {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    resize: none;
    color: transparent;
    caret-color: var(--text);
    z-index: 1;
}
textarea.ask-editor::placeholder { color: var(--muted); }
textarea.ask-editor::selection { background: rgba(0, 229, 255, 0.28); color: transparent; }
.ask-ide-highlight {
    margin: 0;
    pointer-events: none;
    color: var(--text);
    z-index: 0;
}
.ask-tok-comment { color: var(--muted); font-style: italic; }
.ask-tok-keyword { color: var(--violet); }
.ask-tok-string { color: var(--cyan); }
.ask-tok-tag { color: var(--cyan); }
.ask-tok-attr { color: #c4b5fd; }
.ask-tok-num { color: var(--magenta); }
.ask-tok-punct { color: #9fb4c8; }
.ask-head h2 { margin: 0.15rem 0; }
.ask-head .muted { margin: 0.25rem 0 0; }
.ask-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.85rem;
    min-height: 0;
    flex: 1;
}
.ask-chat,
.ask-code {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    gap: 0.55rem;
}
.ask-chat .chat-thread {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
}
.ask-chat .message-body { white-space: pre-wrap; }
.ask-chat .message .eyebrow { display: flex; align-items: center; gap: 0.55rem; }
.ask-msg-cost { letter-spacing: 0; text-transform: none; }
.ask-files {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.45rem;
}
.ask-files:empty { display: none; }
.ask-files .file-link {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.3rem 0.55rem;
}
.ask-files .file-link.is-active {
    border-color: var(--cyan);
    color: var(--text);
}
.ask-code .diff-view,
dialog.ask-code-dialog .diff-view {
    flex: 1 1 auto;
    margin: 0;
    max-height: 48dvh;
}
dialog.ask-code-dialog {
    width: min(720px, calc(100% - 2rem));
    max-height: min(90dvh, 800px);
}
dialog.config-dialog .hud-box {
    max-height: min(90dvh, 720px);
    overflow: auto;
}
.profile { display: grid; gap: 1.1rem; }
.profile h2 { margin: 0.15rem 0; }
[hidden] { display: none !important; }
.name-line { display: flex; align-items: center; gap: 0.15rem; }
.name-line h2 { margin: 0.15rem 0; }
.name-line [data-open] { margin-left: auto; }
.icon-btn {
    display: grid;
    place-items: center;
    width: var(--touch);
    height: var(--touch);
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--cyan);
    cursor: pointer;
}
.icon-btn svg { width: 18px; height: 18px; fill: currentColor; }
.profile-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.profile-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--line);
}
.profile-bar .card-actions { margin: 0; padding: 0; }
.text-link { color: var(--cyan); font-size: 0.85rem; white-space: nowrap; }

.btn, .chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    appearance: none;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text);
    min-height: var(--touch);
    padding: 0.45rem 0.85rem;
    font: inherit;
    cursor: pointer;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary {
    border-color: var(--cyan);
    color: #03161a;
    background: var(--cyan);
    box-shadow: 0 0 16px rgba(0, 229, 255, 0.28);
}
.btn-ghost { color: var(--muted); }
.btn-danger { color: var(--magenta); border-color: rgba(255, 45, 149, 0.7); }
.btn-block { width: 100%; }
.card-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: auto; padding-top: 0.9rem; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.auth-body {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
}
.auth-wrap { width: min(440px, 100%); }
.login-card h1 { margin-top: 0.7rem; }
.login-form { display: grid; gap: 0.85rem; margin: 1.1rem 0 0.7rem; }
fieldset.login-form { border: 0; padding: 0; margin: 0; }
fieldset.login-form legend { margin-bottom: 0.2rem; }
.login-form label { display: grid; gap: 0.35rem; font-size: 0.85rem; color: var(--muted); }
.login-form label.check { display: flex; align-items: center; gap: 0.5rem; }
.login-form label.check input { width: 1.1rem; min-height: 0; accent-color: var(--cyan); }
.model-checks {
    margin: 0;
    border: 1px solid var(--line);
    padding: 0.75rem 0.9rem 0.85rem;
    display: grid;
    gap: 0.45rem;
}
.model-checks legend { padding: 0 0.35rem; font-size: 0.85rem; color: var(--muted); }
.model-checks label.check { align-items: flex-start; }
.model-checks label.check span { line-height: 1.35; }
input[type="email"],
input[type="password"],
input[type="text"],
input[type="tel"],
select {
    width: 100%;
    min-height: var(--touch);
    border: 1px solid var(--line);
    background: rgba(7, 7, 12, 0.78);
    color: var(--text);
    padding: 0.65rem 0.75rem;
    font: inherit;
    font-size: 1rem;
}

.plan-list { display: grid; gap: 0.85rem; }
.plan-pending { padding: 1rem 1.1rem 1.15rem; display: grid; gap: 0.75rem; }
.plan-pending-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.8rem; }
.plan-pending-head p { margin: 0.15rem 0 0; }
.plan-excerpt { margin: 0; }
.project-new-task-fab { display: none; }
.claudio-stream {
    max-height: 7rem; overflow: auto; margin: 0.5rem 0; padding: 0.5rem;
    white-space: pre-wrap; font-size: 0.8rem; color: var(--muted);
    border-left: 2px solid var(--violet, #8b5cf6);
}
.plan-banner {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem;
    padding: 0.5rem 0.75rem; margin-bottom: 0.5rem;
    border: 1px solid var(--violet, #8b5cf6); border-radius: 6px;
}
.plan-banner[hidden] { display: none; }
.plan-banner-actions { display: flex; gap: 0.5rem; align-items: center; }
.plan-approval { display: grid; gap: 0.75rem; }
.plan-approval-body { white-space: pre-wrap; }
.approval-replan summary { cursor: pointer; color: var(--muted); }
.approval-accept label { display: block; margin-bottom: 0.35rem; }

.section { margin: 1.4rem 0 0; }
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.6rem 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.8rem;
}
.kpi-grid,
.project-grid {
    display: grid;
    gap: 0.85rem;
}
.kpi-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }
.project-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.projects-tools {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 0.9rem;
}
.projects-tools input[type="search"] {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    min-height: var(--touch);
    border: 1px solid var(--line);
    background: rgba(7, 7, 12, 0.78);
    color: var(--text);
    padding: 0.65rem 0.75rem;
    font: inherit;
    font-size: 1rem;
    appearance: none;
}
.projects-tools input[type="search"]::-webkit-search-cancel-button,
.projects-tools input[type="search"]::-webkit-search-decoration {
    appearance: none;
}
.projects-tools select {
    flex: 0 0 12rem;
    width: 12rem;
}
.projects-tools input[type="search"]:focus-visible,
.projects-tools select:focus-visible {
    outline: none;
    border-color: var(--cyan);
}
.kpi { min-height: 7.2rem; }
.kpi-label { font-size: 0.78rem; color: var(--muted); }
.kpi-value { font-family: var(--mono); font-size: clamp(1.5rem, 3vw, 1.9rem); margin: 0.15rem 0; }
.kpi-hint { font-size: 0.75rem; color: var(--muted); }
.tone-cyan .kpi-value, .status.tone-cyan { color: var(--cyan); }
.tone-violet .kpi-value, .status.tone-violet { color: var(--violet); }
.tone-magenta .kpi-value, .status.tone-magenta { color: var(--magenta); }

.project-card { display: flex; flex-direction: column; min-width: 0; height: 100%; }
.project-head { display: flex; justify-content: space-between; gap: 0.7rem; align-items: flex-start; }
.status {
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}
.edited { font-size: 0.78rem; color: var(--muted); }

.voice-hud {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(180px, 0.85fr);
    gap: 1rem 1.3rem;
    align-items: center;
    background:
        linear-gradient(125deg, rgba(0, 229, 255, 0.08), rgba(124, 77, 255, 0.1)),
        var(--panel);
}
.voice-stage { text-align: center; }
.mic-btn {
    position: relative;
    width: 96px;
    height: 96px;
    border: 0;
    background: transparent;
    color: var(--cyan);
    cursor: pointer;
}
.mic-ring {
    position: absolute;
    inset: 0;
    border: 1px solid var(--cyan);
    border-radius: 50%;
    box-shadow: 0 0 22px rgba(0, 229, 255, 0.4);
}
.mic-btn.is-live .mic-ring { animation: pulse 1.2s infinite; }
.mic-core { position: relative; font-family: var(--mono); letter-spacing: 0.16em; }
.voice-status, .voice-live { min-height: 1.2em; overflow-wrap: anywhere; }
.voice-live { color: var(--cyan); }
.voice-form { grid-column: 1 / -1; display: flex; gap: 0.5rem; }
.voice-form input { flex: 1; min-width: 0; }
.chips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip { min-height: 36px; color: var(--muted); font-size: 0.82rem; }
.chip:hover { color: var(--text); border-color: var(--cyan); }

.team-row { display: flex; flex-wrap: wrap; gap: 0.8rem 1.1rem; list-style: none; padding: 0; margin: 0; }
.task-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.task-row { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; }
.placeholder { margin-bottom: 1rem; }

.app-shell:has(.project-page) {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
}
.app-shell:has(.project-page) > .app-main {
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
}
.app-content:has(.project-page) {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding-bottom: 0.5rem;
    overflow: hidden;
}
.project-page {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
.project-pane-tabs {
    display: none;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.35rem;
    flex: 0 0 auto;
    position: relative;
    z-index: 3;
    padding: 0.35rem 0 calc(0.35rem + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(7, 7, 12, 0.96);
    backdrop-filter: blur(10px);
}
.project-pane-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--touch);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--muted);
    background: rgba(0, 0, 0, 0.28);
    cursor: pointer;
    font-size: 0.88rem;
    user-select: none;
}
#project-pane-general:checked ~ .project-pane-tabs label[for="project-pane-general"],
#project-pane-kanban:checked ~ .project-pane-tabs label[for="project-pane-kanban"] {
    color: var(--text);
    border-color: var(--cyan);
    box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.2);
    background: rgba(0, 229, 255, 0.08);
}
.project-toolbar {
    display: grid;
    gap: 0.75rem;
    flex: 0 0 auto;
}
.project-toolbar > .status { margin: 0; }
.project-toolbar-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem 1.2rem;
}
.project-toolbar-id { min-width: 0; flex: 1 1 16rem; }
.project-toolbar-id .name-line h2 {
    font-size: clamp(1.15rem, 2.4vw, 1.55rem);
}
.project-toolbar-meta {
    margin: 0.15rem 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    align-items: baseline;
}
.project-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}
.project-toolbar-actions .btn { min-height: var(--touch); }
.project-config-btn .btn-label { display: none; }
.project-toolbar-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem 1.2rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--line);
}
.project-claudio-compact {
    min-width: 0;
    flex: 1 1 16rem;
}
.project-claudio-summary-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.project-claudio-summary-row .muted { margin: 0; }
.project-claudio-details {
    margin-top: 0.35rem;
}
.project-claudio-details > summary {
    list-style: none;
    cursor: pointer;
    min-height: var(--touch);
    display: flex;
    align-items: center;
    color: var(--muted);
    font-size: 0.88rem;
    user-select: none;
}
.project-claudio-details > summary::-webkit-details-marker { display: none; }
.project-claudio-details > summary::after {
    content: "v";
    margin-left: 0.45rem;
    color: var(--cyan);
    font-family: var(--mono);
    font-size: 0.75rem;
}
.project-claudio-details[open] > summary::after { content: "^"; }
.project-claudio-lists {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
    gap: 0.65rem 1rem;
}
.project-new-task {
    flex: 1 1 16rem;
    margin: 0;
    max-width: 28rem;
}
.usage-kpis {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    flex: 0 0 auto;
}
.composer-bar select,
.composer select {
    min-height: var(--touch);
    max-width: min(100%, 28rem);
    flex: 1 1 14rem;
}
.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
.kanban-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    padding: 0.85rem 0.8rem;
}
.kanban-col-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    flex: 0 0 auto;
    margin-bottom: 0.65rem;
}
.kanban-col-head h2 {
    margin: 0;
    font-size: 0.95rem;
}
.kanban-col-list {
    display: grid;
    align-content: start;
    gap: 0.55rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
}
.kanban-empty { margin: 0; }
.kanban-card {
    display: grid;
    gap: 0.35rem;
    padding: 0.75rem 0.8rem;
    color: inherit;
    text-decoration: none;
    min-height: var(--touch);
}
.kanban-card strong {
    overflow-wrap: anywhere;
}
.kanban-card-summary {
    margin: 0.25rem 0 0;
    font-size: 0.82rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.kanban-card-meta {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 0.55rem;
    align-items: center;
    font-size: 0.8rem;
}
.kanban-card:hover {
    border-color: var(--cyan);
}
dialog.config-dialog fieldset.login-form { margin: 0; padding: 0; }

@keyframes pulse { 50% { transform: scale(1.08); opacity: 0.55; } }

@media (min-width: 961px) {
    .task-actions { justify-content: flex-end; }
    .task-pane-live:not(:has(#claudio-panel:not([hidden]))) {
        display: none;
    }
}

@media (max-width: 960px) {
    .project-grid { grid-template-columns: 1fr; }
    .projects-tools select { flex: 0 0 9rem; width: 9rem; }
    .ask-body { grid-template-columns: 1fr; }
    .ask-code { display: none; }
    dialog.ask-dialog {
        width: calc(100% - 1rem);
        max-height: calc(100dvh - 1rem);
    }
    dialog.ask-code-dialog {
        width: 100vw;
        height: 100dvh;
        max-width: 100vw;
        max-height: 100dvh;
        margin: 0;
    }
    dialog.ask-code-dialog .ask-code-full {
        height: 100dvh;
        max-height: 100dvh;
        box-sizing: border-box;
    }
    dialog.ask-code-dialog .diff-view,
    dialog.ask-code-dialog textarea.ask-editor {
        max-height: none;
        min-height: 0;
        flex: 1 1 auto;
    }
    .task-page {
        gap: 0.5rem;
    }
    .task-toolbar {
        grid-template-columns: 1fr;
        padding: 0.75rem 0.85rem;
        border-radius: 12px;
        order: 0;
        flex-shrink: 0;
    }
    .task-title { white-space: nowrap; margin-bottom: 0.3rem; }
    .task-toolbar-main .eyebrow {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .task-summary-long {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-bottom: 0.4rem;
        font-size: 0.85rem;
    }
    .task-meta {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin: 0 -0.85rem;
        padding: 0 0.85rem 0.15rem;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .task-meta::-webkit-scrollbar { display: none; }
    .task-meta > * { flex: 0 0 auto; white-space: nowrap; }
    .task-actions { flex-wrap: nowrap; }
    .task-actions-primary .btn,
    .task-actions-more > summary { flex: 1 1 auto; padding-inline: 0.6rem; font-size: 0.9rem; }
    .task-actions-more-list { min-width: min(16rem, calc(100vw - 2.5rem)); }
    .task-pane-tabs {
        display: grid;
        order: 2;
    }
    .task-workspace {
        display: flex;
        flex-direction: column;
        order: 1;
        gap: 0;
        flex: 1 1 0;
        min-height: 0;
        overflow: hidden;
    }
    .task-side {
        display: none;
        flex: 1 1 0;
        min-height: 0;
        height: auto;
        overflow: hidden;
    }
    .task-workspace .task-pane {
        display: none;
        flex: 1 1 0;
        min-height: 0;
        width: 100%;
        overflow: auto;
    }
    #task-pane-files:checked ~ .task-workspace .task-side,
    #task-pane-live:checked ~ .task-workspace .task-side {
        display: flex;
    }
    #task-pane-files:checked ~ .task-workspace [data-pane="files"],
    #task-pane-live:checked ~ .task-workspace [data-pane="live"] {
        display: flex;
        flex-direction: column;
        flex: 1 1 0;
        min-height: 0;
        height: auto;
        overflow: auto;
    }
    #task-pane-chat:checked ~ .task-workspace [data-pane="chat"] {
        display: grid;
        flex: 1 1 0;
        min-height: 0;
        height: auto;
        overflow: hidden;
    }
    .task-live-hint { display: block; }
    .chat.hud-box {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        padding-top: 0.85rem;
        padding-bottom: 0;
        border-radius: 12px;
    }
    .chat-composer-dock {
        margin-left: -0.75rem;
        margin-right: -0.75rem;
        margin-bottom: 0;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        padding-bottom: 0.65rem;
    }
    .task-files-panel,
    .task-pane-live .claudio-panel,
    .task-pane-live .task-live-empty {
        border-radius: 12px;
    }
    .task-pane-live .task-live-empty {
        padding: 0.85rem 1rem;
        background: var(--panel);
        border: 1px solid var(--line);
    }
    .project-page { gap: 0.5rem; }
    .project-toolbar {
        padding: 0.75rem 0.85rem;
        border-radius: 12px;
        flex-shrink: 0;
    }
    .project-toolbar-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }
    .project-toolbar-actions .btn,
    .project-toolbar-actions .project-config-btn { width: 100%; }
    .project-toolbar-actions .btn-back { display: none; }
    .project-toolbar-actions .project-config-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.4rem;
        height: auto;
        min-height: var(--touch);
        border: 1px solid var(--line);
        color: var(--text);
    }
    .project-config-btn .btn-label { display: inline; }
    .project-new-task { max-width: none; }
    .project-new-task-fab {
        display: none;
        order: 1;
        text-align: center;
        flex-shrink: 0;
    }
    #project-pane-kanban:checked ~ .project-new-task-fab { display: block; }
    .project-pane-tabs {
        display: grid;
        order: 2;
    }
    .project-page > .project-toolbar,
    .project-page > .kanban-board {
        display: none;
        order: 1;
    }
    #project-pane-general:checked ~ .project-toolbar {
        display: grid;
        flex: 1 1 0;
        min-height: 0;
        overflow: auto;
    }
    #project-pane-kanban:checked ~ .kanban-board {
        display: flex;
    }
    .kanban-board {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        flex: 1 1 0;
        min-height: 0;
        gap: 0.75rem;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        padding-bottom: 0.35rem;
    }
    .kanban-board > .kanban-col {
        display: flex;
        flex: 0 0 78vw;
        width: 78vw;
        max-width: 320px;
        min-width: 240px;
        min-height: 0;
        height: auto;
        align-self: stretch;
        scroll-snap-align: start;
        border-radius: 12px;
    }
}

@media (max-width: 860px) {
    .app-shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr);
    }
    .sidebar {
        position: sticky;
        top: 0;
        z-index: 4;
        height: auto;
        max-height: none;
        overflow: hidden;
        min-width: 0;
        max-width: 100%;
        flex-direction: row;
        align-items: center;
        gap: 0.6rem 1rem;
        padding: 0.7rem var(--space);
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
    .brand { margin: 0; }
    .brand em { display: none; }
    .side-nav {
        flex-direction: row;
        flex: 1;
        min-width: 0;
        overflow-x: auto;
    }
    .side-nav a { white-space: nowrap; padding-inline: 0.65rem; }
    .side-foot { display: none; }
    .voice-hud,
    .claudio-grid { grid-template-columns: 1fr; }
    .user-chip small { display: none; }
    input, select, textarea { font-size: 16px; }
    .text-link { display: inline-flex; align-items: center; min-height: var(--touch); }
    dialog.config-dialog,
    dialog.ask-code-dialog { width: calc(100% - 1rem); max-height: calc(100dvh - 1rem); }
    dialog.config-dialog .hud-box { max-height: calc(100dvh - 1rem); }
    .section { margin-top: 1rem; }
    .sidebar { padding: calc(0.45rem + env(safe-area-inset-top)) 0.75rem 0.45rem; gap: 0.4rem 0.75rem; }
    .topbar { padding: 0.55rem 0.75rem 0.4rem; }
    .topbar .eyebrow,
    .topbar .live-dot,
    .user-chip > span:last-child { display: none; }
    .topbar h1 { font-size: 1.25rem; margin: 0; }
    .topbar-right { gap: 0.5rem; }
    .app-shell:has(.task-page) .topbar,
    .app-shell:has(.project-page) .topbar { display: none; }
    .claudio-panel-head { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
    .topbar { align-items: flex-start; }
    .voice-form,
    .composer-inline { flex-direction: column; }
    .profile-head, .profile-bar { flex-direction: column; align-items: flex-start; }
    .task-row { flex-wrap: wrap; justify-content: flex-start; }
    .task-row .person { flex: 1 1 100%; }
    .task-row .btn { margin-left: auto; }
    .section-head > .btn { width: 100%; }
    .chat.hud-box {
        padding: 0.85rem 0.75rem 0;
    }
    .message.is-claudio {
        padding-left: 0.55rem;
        margin-left: 0.1rem;
    }
    .message-head {
        gap: 0.3rem 0.5rem;
    }
    .message-head .status {
        font-size: 0.72rem;
    }
    .composer-bar .dictate-btn { padding-inline: 0.7rem; }
    .composer-bar > .btn,
    .composer-bar > .composer-more > summary { width: auto; }
    .composer textarea {
        min-height: 4.5rem;
        font-size: 16px;
    }
    .project-new-task input,
    .composer-bar select,
    .composer select { font-size: 16px; }
    .approval-actions {
        width: 100%;
    }
    .approval-actions form {
        flex: 1 1 calc(50% - 0.3rem);
    }
    .approval-actions .btn,
    .plan-approval .btn,
    .approval-adjust .btn {
        width: 100%;
        min-height: var(--touch);
    }
    .card-actions .btn { flex: 1 1 auto; }
    .file-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }
}

