:root {
    --bg-base: #f4f0e7;
    --bg-elevated: #fffdf8;
    --bg-subtle: #f8f4ec;
    --bg-muted: #eee7da;
    --bg-glass: var(--bg-elevated);
    --bg-glass-hover: var(--bg-subtle);
    --bg-glass-border: #ddd5c8;
    --bg-glass-border-strong: #c9beae;
    --text-primary: #25231f;
    --text-secondary: #5f5a51;
    --text-tertiary: #7a7369;
    --text-accent: #6f3e24;
    --accent-primary: #8a4f2d;
    --accent-deep: #6f3e24;
    --accent-ice: #8a4f2d;
    --accent-ice-light: #aa704d;
    --accent-purple: #8a4f2d;
    --accent-purple-light: #aa704d;
    --accent-soft: #f1e2d4;
    --success: #2f6a4f;
    --warning: #8a5b1f;
    --danger: #993c37;
    --border: #ddd5c8;
    --border-strong: #c9beae;
    --focus: #8a4f2d;
    --shadow-card: 0 12px 34px rgba(57, 45, 31, 0.07);
    --shadow-glow: none;
    --shadow-inner-glow: none;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --font-thin: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-body: var(--font-thin);
    --font-display: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
    --font-mono: "SFMono-Regular", Consolas, monospace;
    --transition-fast: 160ms ease-out;
    --transition-smooth: 240ms ease-out;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
    min-height: 100vh;
    background: var(--bg-base);
    background-image: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
body::before, .data-stream { display: none; }
button, input, select, textarea { font: inherit; }
button, select, label { touch-action: manipulation; }
button { cursor: pointer; }
.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 100;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--text-primary);
    color: var(--bg-elevated);
    text-decoration: none;
    transform: translateY(-160%);
    transition: transform var(--transition-fast);
}
.skip-link:focus { transform: translateY(0); }
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--focus) 28%, transparent);
    outline-offset: 2px;
}

.app-container {
    width: min(1180px, calc(100% - 40px));
    max-width: none;
    margin: 0 auto;
    padding: 20px 0 48px;
    gap: 18px;
}
.nav-bar {
    position: sticky;
    top: 12px;
    z-index: 20;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    padding: 14px 18px;
    background: color-mix(in srgb, var(--bg-elevated) 96%, transparent);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 6px 20px rgba(57, 45, 31, 0.06);
}
.nav-logo {
    gap: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 650;
    letter-spacing: 0.02em;
}
.nav-logo small { color: var(--text-tertiary); font-size: 0.78rem; font-weight: 500; }
.nav-logo .logo-dot {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: var(--text-primary);
    box-shadow: none;
    animation: none;
}
.nav-logo .logo-dot::after {
    content: "N";
    color: var(--bg-elevated);
    font-family: Georgia, serif;
    font-size: 0.86rem;
}
.nav-tabs {
    justify-self: center;
    display: grid;
    grid-template-columns: repeat(4, auto);
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-subtle);
}
.nav-tab {
    min-height: 40px;
    padding: 8px 14px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.86rem;
    font-weight: 520;
    letter-spacing: 0;
    transition: color var(--transition-fast), background var(--transition-fast);
}
.nav-tab:hover:not(.active), .nav-tab:hover { color: var(--text-primary); background: var(--bg-muted); }
.nav-tab.active {
    color: var(--accent-deep);
    background: var(--bg-elevated);
    border: 0;
    box-shadow: 0 1px 4px rgba(57, 45, 31, 0.08);
    font-weight: 650;
}
.live-clock {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
}
.live-clock .clock-sep { color: var(--border-strong); animation: none; }
.live-clock .clock-dot-indicator {
    width: 7px;
    height: 7px;
    background: var(--success);
    box-shadow: none;
    animation: none;
}

.glass-card {
    padding: clamp(20px, 4vw, 44px);
    overflow: visible;
    background: var(--bg-elevated);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: none;
}
.glass-card::after { display: none; }
.glass-card:hover { border-color: var(--border); box-shadow: var(--shadow-card); }
.step-indicator-wrap {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: -8px 0 40px;
    border-bottom: 1px solid var(--border);
}
.step-dot {
    width: auto;
    height: auto;
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--text-tertiary);
    font-size: 0.88rem;
    transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}
.step-dot::before {
    content: attr(data-step);
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    font-family: var(--font-mono);
    font-size: 0.68rem;
}
.step-dot:hover { color: var(--text-primary); background: var(--bg-subtle); }
.step-dot.active {
    color: var(--accent-deep);
    border-color: transparent;
    border-bottom-color: var(--accent-primary);
    background: transparent;
    box-shadow: none;
    font-weight: 650;
}
.step-dot.active::before { border-color: var(--accent-primary); background: var(--accent-primary); color: #fff; }
.step-dot.done { color: var(--text-secondary); border-color: transparent; background: transparent; }
.step-dot.done::before { content: "✓"; border-color: var(--success); color: var(--success); }
.step-connector { display: none; }

.page-intro { max-width: 720px; margin-bottom: 36px; }
.page-kicker { margin-bottom: 8px; color: var(--accent-deep); font-size: 0.78rem; font-weight: 650; letter-spacing: 0.08em; }
.page-title {
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.65rem);
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.page-description { max-width: 62ch; margin-top: 12px; color: var(--text-secondary); }
.section-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 34px 0 18px;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 1.24rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.section-title:first-of-type { margin-top: 0; }
.section-title .dot { width: 18px; height: 2px; flex: 0 0 auto; border-radius: 0; background: var(--accent-primary); box-shadow: none; }
.section-subtitle { color: var(--text-tertiary); font-family: var(--font-body); font-size: 0.78rem; font-weight: 400; letter-spacing: 0; }
.divider-glow, .divider-dashed { height: 1px; margin: 34px 0; border: 0; background: var(--border); }

.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.form-group { min-width: 0; gap: 7px; }
.form-group label, .form-group > label, .group-label {
    color: var(--text-secondary);
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}
.form-group .hint { color: var(--text-tertiary); font-size: 0.75rem; line-height: 1.45; letter-spacing: 0; }
input, select, textarea {
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background-color: var(--bg-elevated);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    letter-spacing: 0;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent-primary) 52%, var(--border-strong)); }
input:focus, select:focus, textarea:focus {
    border-color: var(--focus);
    background-color: var(--bg-elevated);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 13%, transparent);
}
input.linked { background: var(--bg-subtle); border-color: color-mix(in srgb, var(--accent-primary) 34%, var(--border)); }
select {
    appearance: none;
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235f5a51' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
}
textarea { min-height: 88px; resize: vertical; }
.top-problem-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pain-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.pain-tag {
    position: relative;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 0.86rem;
    letter-spacing: 0;
    transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}
.pain-tag input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
.pain-tag:has(input:focus-visible) {
    outline: 3px solid color-mix(in srgb, var(--focus) 28%, transparent);
    outline-offset: 2px;
}
.pain-tag:hover { border-color: var(--accent-primary); color: var(--text-primary); background: var(--bg-elevated); }
.pain-tag::before { content: ""; width: 16px; height: 16px; border: 1px solid var(--border-strong); border-radius: 4px; }
.pain-tag:has(input:checked) {
    border-color: var(--accent-primary);
    background: var(--accent-soft);
    color: var(--accent-deep);
    box-shadow: none;
    font-weight: 600;
}
.pain-tag:has(input:checked)::before {
    content: "✓";
    display: grid;
    place-items: center;
    border-color: var(--accent-primary);
    background: var(--accent-primary);
    color: #fff;
    font-size: 0.68rem;
}

.btn {
    min-height: 48px;
    padding: 11px 22px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 650;
    letter-spacing: 0;
    transition: color var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.btn-primary {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(111, 62, 36, 0.14);
}
.btn-primary:hover {
    border-color: var(--accent-deep);
    background: var(--accent-deep);
    box-shadow: 0 6px 18px rgba(111, 62, 36, 0.18);
    transform: none;
}
.btn-outline { border-color: var(--border-strong); background: var(--bg-elevated); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--accent-primary); background: var(--bg-subtle); color: var(--accent-deep); box-shadow: none; }
.btn:disabled, .agent-suggestion:disabled { cursor: not-allowed; opacity: 0.46; box-shadow: none; }

.dashboard-row { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 22px; align-items: stretch; }
.score-ring {
    width: 170px;
    height: 170px;
    margin: auto;
    border: 10px solid var(--bg-muted);
    border-radius: 50%;
    background: var(--bg-elevated);
    box-shadow: inset 0 0 0 1px var(--border);
}
.score-ring .score-num {
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
}
.score-ring .score-label { margin-top: 8px; color: var(--text-tertiary); font-size: 0.76rem; letter-spacing: 0; text-transform: none; }
.metric-grid { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.metric-chip {
    min-height: 84px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-subtle);
    text-align: left;
}
.metric-chip .m-val { color: var(--text-primary); font-size: 1.32rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.metric-chip .m-label { margin-top: 4px; color: var(--text-tertiary); font-size: 0.76rem; letter-spacing: 0; text-transform: none; }
.issue-card {
    margin: 12px 0;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-left-width: 4px;
    border-radius: var(--radius-sm);
    background: var(--bg-subtle);
}
.issue-card.danger { border-left-color: var(--danger); background: var(--bg-subtle); }
.issue-card.warning { border-left-color: var(--warning); background: var(--bg-subtle); }
.issue-card.info { border-left-color: var(--success); background: var(--bg-subtle); }
.issue-card b { font-size: 0.96rem; }
.phase-card {
    margin-bottom: 14px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-subtle);
}
.phase-card:hover { border-color: var(--border-strong); background: var(--bg-subtle); }
.phase-header {
    margin-bottom: 12px;
    color: var(--accent-deep);
    font-family: var(--font-display);
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: 0;
}
.phase-task { position: relative; padding: 7px 0 7px 24px; color: var(--text-secondary); font-size: 0.9rem; line-height: 1.65; letter-spacing: 0; }
.phase-task::before { content: ""; position: absolute; left: 2px; top: 17px; width: 8px; height: 8px; border: 1px solid var(--accent-primary); border-radius: 2px; }
.ref-details { margin-top: 24px; padding: 4px 18px 18px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-subtle); }
.ref-details summary { min-height: 48px; display: flex; align-items: center; padding: 0; color: var(--text-primary); cursor: pointer; font-weight: 650; letter-spacing: 0; }
.ref-details summary:hover { color: var(--accent-deep); }
.ref-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; margin-top: 12px; color: var(--text-secondary); font-size: 0.84rem; }
.ref-grid .item { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.ref-grid .item .value { color: var(--text-primary); font-weight: 650; font-variant-numeric: tabular-nums; }
.ref-note { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); color: var(--text-tertiary); font-size: 0.78rem; letter-spacing: 0; }

.agent-hero { margin-bottom: 22px; }
.agent-identity { gap: 13px; }
.agent-avatar {
    width: 48px;
    height: 48px;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-deep);
    box-shadow: none;
    font-family: var(--font-display);
    font-size: 1.12rem;
    font-weight: 700;
}
.agent-name { color: var(--text-primary); font-family: var(--font-display); font-size: 1.16rem; font-weight: 700; letter-spacing: 0; }
.agent-role { max-width: 50ch; margin-top: 3px; color: var(--text-tertiary); font-size: 0.8rem; }
.agent-status {
    min-height: 38px;
    padding: 7px 11px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-size: 0.78rem;
}
.agent-status .status-dot { width: 8px; height: 8px; background: var(--warning); box-shadow: none; }
.agent-status.cloud .status-dot { background: var(--success); box-shadow: none; }
.agent-context { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.agent-context-item { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-subtle); }
.agent-context-label { color: var(--text-tertiary); font-size: 0.74rem; letter-spacing: 0; }
.agent-context-value { margin-top: 5px; color: var(--text-primary); font-size: 0.9rem; font-weight: 600; }
.agent-skills {
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
}
.agent-skills summary {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 14px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 650;
    list-style-position: inside;
}
.agent-skills-action { color: var(--text-tertiary); font-size: 0.74rem; font-weight: 500; }
.agent-skill-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 0 14px 14px;
}
.agent-skill-item { padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-subtle); }
.agent-skill-item strong { display: block; color: var(--text-primary); font-size: 0.84rem; }
.agent-skill-item span { display: block; margin-top: 4px; color: var(--text-tertiary); font-size: 0.75rem; line-height: 1.5; }
.agent-suggestions { gap: 9px; margin-bottom: 16px; }
.agent-suggestion {
    min-height: 44px;
    padding: 8px 13px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 0.82rem;
}
.agent-suggestion:hover { border-color: var(--accent-primary); background: var(--accent-soft); color: var(--accent-deep); }
.agent-chat {
    min-height: 300px;
    max-height: 540px;
    padding: 20px;
    gap: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-subtle);
}
.agent-message { max-width: min(82%, 720px); gap: 5px; }
.agent-message-head { padding: 0 3px; color: var(--text-tertiary); font-size: 0.72rem; }
.agent-message-body {
    padding: 13px 15px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.75;
}
.agent-message-body > :first-child { margin-top: 0; }
.agent-message-body > :last-child { margin-bottom: 0; }
.agent-message-body p { margin: 0 0 0.72em; }
.agent-message-body h4 {
    margin: 1.15em 0 0.5em;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 1.03rem;
    line-height: 1.45;
}
.agent-message-body ul, .agent-message-body ol { margin: 0.3em 0 0.9em; padding-left: 1.4em; }
.agent-message-body li { margin: 0.34em 0; padding-left: 0.18em; }
.agent-message-body strong { color: var(--text-primary); font-weight: 700; }
.agent-message-body code {
    padding: 0.08em 0.32em;
    border-radius: 4px;
    background: var(--bg-muted);
    color: var(--accent-deep);
    font-family: var(--font-mono);
    font-size: 0.88em;
}
.agent-message-body hr { height: 1px; margin: 1em 0; border: 0; background: var(--border); }
.chat-table-wrap { max-width: 100%; margin: 0.75em 0 1em; overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
.chat-table-wrap table { width: 100%; border-collapse: collapse; font-size: 0.8rem; white-space: nowrap; }
.chat-table-wrap th, .chat-table-wrap td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.chat-table-wrap th { background: var(--bg-muted); color: var(--text-primary); font-weight: 650; }
.chat-table-wrap tr:last-child td { border-bottom: 0; }
.agent-message.user .agent-message-body {
    border-color: var(--accent-primary);
    border-bottom-right-radius: 3px;
    background: var(--accent-primary);
    color: #fff;
}
.agent-message.assistant .agent-message-body { border-bottom-left-radius: 3px; }
.agent-message.error .agent-message-body { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); background: color-mix(in srgb, var(--danger) 8%, var(--bg-elevated)); color: var(--danger); }
.tool-trace { gap: 6px; }
.tool-chip { padding: 4px 7px; border-radius: 5px; background: var(--accent-soft); color: var(--accent-deep); font-size: 0.68rem; }
.agent-composer { grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; margin-top: 12px; }
.agent-composer textarea { min-height: 60px; max-height: 170px; }
.agent-send { min-width: 116px; min-height: 60px; border-radius: 9px; }
.agent-actions { margin-top: 12px; }
.agent-reset { min-height: 44px; padding: 8px; color: var(--text-tertiary); font-size: 0.78rem; }
.agent-reset:hover { color: var(--accent-deep); }
.agent-privacy { color: var(--text-tertiary); font-size: 0.75rem; }
.typing-dots { min-height: 16px; gap: 5px; }
.typing-dots span { width: 5px; height: 5px; background: var(--accent-primary); animation: typingPulseHuman 1s infinite ease-in-out; }
.typing-dots span:nth-child(2) { animation-delay: 120ms; }
.typing-dots span:nth-child(3) { animation-delay: 240ms; }
@keyframes typingPulseHuman { 0%, 70%, 100% { opacity: .25; transform: none; } 35% { opacity: 1; transform: none; } }

.footer-bar {
    padding: 8px 4px;
    border: 0;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    letter-spacing: 0;
}
.footer-bar .footer-dot { width: 7px; height: 7px; background: var(--success); animation: none; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }

@media (max-width: 900px) {
    .nav-bar { grid-template-columns: 1fr auto; }
    .nav-tabs { grid-column: 1 / -1; grid-row: 2; width: 100%; grid-template-columns: repeat(4, 1fr); }
    .nav-tab { padding-inline: 8px; }
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
    .app-container { width: min(100% - 20px, 1180px); padding: 10px 0 30px; gap: 10px; }
    .nav-bar { top: 6px; gap: 10px; padding: 11px; border-radius: 12px; }
    .nav-logo { font-size: 0.92rem; }
    .nav-logo .logo-dot { width: 26px; height: 26px; }
    .live-clock { font-size: 0.67rem; }
    .nav-tabs { order: initial; gap: 2px; padding: 3px; }
    .nav-tab { min-height: 44px; padding: 6px 3px; font-size: 0.75rem; }
    .glass-card { padding: 20px 16px 24px; border-radius: 12px; }
    .step-indicator-wrap { margin: -4px 0 28px; }
    .step-dot { min-height: 48px; font-size: 0; gap: 0; }
    .step-dot::before { font-size: 0.68rem; }
    .page-intro { margin-bottom: 28px; }
    .page-description { font-size: 0.92rem; }
    .section-title { margin-top: 28px; font-size: 1.12rem; }
    .form-grid, .top-problem-grid, .agent-context, .ref-grid, .agent-skill-list { grid-template-columns: 1fr; }
    input, select, textarea { font-size: 1rem; }
    .pain-tag { flex: 1 1 calc(50% - 8px); }
    .dashboard-row { grid-template-columns: 1fr; }
    .score-ring { width: 150px; height: 150px; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .agent-message { max-width: 94%; }
    .agent-composer { grid-template-columns: 1fr; }
    .agent-send { width: 100%; min-height: 48px; }
    .agent-actions { align-items: flex-start; flex-direction: column; }
    .footer-bar { padding-inline: 4px; }
}
@media (max-width: 390px) {
    .live-clock { display: none; }
    .nav-bar { grid-template-columns: 1fr; }
    .nav-tabs { grid-column: 1; }
    .pain-tag { flex-basis: 100%; }
    .metric-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg-base: #1d1b18;
        --bg-elevated: #28241f;
        --bg-subtle: #302b25;
        --bg-muted: #3a332b;
        --bg-glass: var(--bg-elevated);
        --text-primary: #f5efe5;
        --text-secondary: #d3cabd;
        --text-tertiary: #aba194;
        --accent-primary: #c78255;
        --accent-deep: #e0a27a;
        --accent-ice: #c78255;
        --accent-soft: #493226;
        --success: #70b08e;
        --warning: #d7a55e;
        --danger: #e17c75;
        --border: #494139;
        --border-strong: #62584d;
        --bg-glass-border: var(--border);
        --bg-glass-border-strong: var(--border-strong);
        --focus: #d69568;
        --shadow-card: 0 16px 36px rgba(0, 0, 0, 0.24);
    }
    select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23d3cabd' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
}
