:root {
    color-scheme: light;
    --bg: #f3f5f1;
    --rail: #131916;
    --rail-raised: #1d2520;
    --rail-border: #303b34;
    --rail-text: #f1f4f1;
    --rail-muted: #a7b2ab;
    --surface: #ffffff;
    --surface-2: #f8faf7;
    --surface-3: #edf1ee;
    --text: #18211b;
    --text-soft: #334039;
    --muted: #637068;
    --subtle: #849089;
    --border: #d8e0db;
    --border-strong: #b5c1ba;
    --accent: #e45d4c;
    --accent-hover: #bd4335;
    --accent-soft: #fff0ed;
    --green: #52745d;
    --green-soft: #e8f0ea;
    --blue: #476f89;
    --blue-soft: #e8f0f5;
    --amber: #a66a28;
    --danger: #a83d3d;
    --danger-soft: #faecec;
    --shadow: 0 22px 60px rgba(20, 29, 24, 0.15);
    --radius: 8px;
    --font-body: "DM Sans", Aptos, "Segoe UI", sans-serif;
    --font-display: "Fraunces", Georgia, serif;
    --font-utility: "IBM Plex Mono", Consolas, monospace;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0f1311;
    --rail: #090c0a;
    --rail-raised: #151b17;
    --rail-border: #28312b;
    --rail-text: #f0f3f0;
    --rail-muted: #98a49d;
    --surface: #171c19;
    --surface-2: #121714;
    --surface-3: #202722;
    --text: #eef2ef;
    --text-soft: #d1d8d3;
    --muted: #a2ada6;
    --subtle: #78847d;
    --border: #2d3731;
    --border-strong: #46534c;
    --accent: #f07867;
    --accent-hover: #ff8b7b;
    --accent-soft: #38201d;
    --green: #79a788;
    --green-soft: #1c2d22;
    --blue: #78a6c1;
    --blue-soft: #192932;
    --amber: #d5a05f;
    --danger: #ef8181;
    --danger-soft: #341d1d;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.46);
}

@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]):not([data-theme="dark"]) {
        color-scheme: dark;
        --bg: #0f1311;
        --rail: #090c0a;
        --rail-raised: #151b17;
        --rail-border: #28312b;
        --rail-text: #f0f3f0;
        --rail-muted: #98a49d;
        --surface: #171c19;
        --surface-2: #121714;
        --surface-3: #202722;
        --text: #eef2ef;
        --text-soft: #d1d8d3;
        --muted: #a2ada6;
        --subtle: #78847d;
        --border: #2d3731;
        --border-strong: #46534c;
        --accent: #f07867;
        --accent-hover: #ff8b7b;
        --accent-soft: #38201d;
        --green: #79a788;
        --green-soft: #1c2d22;
        --blue: #78a6c1;
        --blue-soft: #192932;
        --amber: #d5a05f;
        --danger: #ef8181;
        --danger-soft: #341d1d;
        --shadow: 0 24px 70px rgba(0, 0, 0, 0.46);
    }
}

* {
    box-sizing: border-box;
    letter-spacing: 0;
}

html {
    min-width: 320px;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
}

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

button,
label[for],
.switch-control,
.task-option {
    cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
label:has(input:focus-visible) {
    outline: 3px solid color-mix(in srgb, var(--blue) 30%, transparent);
    outline-offset: 2px;
}

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2 {
    font-family: var(--font-display);
    font-weight: 600;
}

h1 {
    margin-bottom: 0;
    font-size: 25px;
    line-height: 1.1;
}

h2 {
    margin-bottom: 0;
    font-size: 27px;
    line-height: 1.15;
}

h3 {
    margin-bottom: 0;
}

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

.app-rail {
    position: sticky;
    z-index: 10;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 22px 16px 16px;
    overflow: hidden;
    border-right: 1px solid var(--rail-border);
    color: var(--rail-text);
    background: var(--rail);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    color: inherit;
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
}

.brand-name > span {
    color: var(--accent);
}

.brand-mark {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--accent) 72%, #fff);
    border-radius: 7px;
    color: #171b18;
    background: var(--accent);
}

.brand-mark svg {
    width: 19px;
    height: 19px;
}

.rail-nav {
    display: grid;
    gap: 5px;
    margin-top: 34px;
}

.rail-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    min-height: 42px;
    padding: 0 11px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--rail-muted);
    background: transparent;
    text-align: left;
}

.rail-link:hover,
.rail-link.is-active {
    border-color: var(--rail-border);
    color: var(--rail-text);
    background: var(--rail-raised);
}

.rail-link.is-active::before {
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: -16px;
    width: 3px;
    content: "";
    background: var(--accent);
}

.rail-link svg {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
}

.nav-count {
    min-width: 20px;
    height: 20px;
    margin-left: auto;
    padding: 0 6px;
    border-radius: 10px;
    color: var(--rail-text);
    background: #334038;
    font-family: var(--font-utility);
    font-size: 9px;
    line-height: 20px;
    text-align: center;
}

.rail-spacer {
    flex: 1;
    min-height: 20px;
}

.rail-footer {
    margin-top: 11px;
}

.network-status > span:first-child {
    flex: 0 0 7px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #7fbd8d;
    box-shadow: 0 0 0 4px rgba(127, 189, 141, 0.1);
}

.app-main {
    min-width: 0;
}

.command-header {
    position: sticky;
    z-index: 8;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 78px;
    padding: 14px clamp(20px, 3vw, 44px);
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    backdrop-filter: blur(16px);
}

.utility-label {
    margin: 0 0 5px;
    color: var(--green);
    font-family: var(--font-utility);
    font-size: 9px;
    line-height: 1.4;
    text-transform: uppercase;
}

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

.network-status {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 9px;
    color: var(--muted);
    font-family: var(--font-utility);
    font-size: 9px;
}

.network-status.is-offline > span:first-child {
    background: var(--danger);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 15%, transparent);
}

.theme-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface-3);
}

.theme-options button.is-active {
    color: var(--text);
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(17, 24, 20, 0.14);
}

.icon-button,
.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    border-radius: 6px;
    font-weight: 700;
}

.icon-button {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--border);
    color: var(--muted);
    background: var(--surface);
}

.icon-button:hover {
    border-color: var(--border-strong);
    color: var(--text);
    background: var(--surface-3);
}

.icon-button svg,
.primary-button svg,
.secondary-button svg {
    width: 17px;
    height: 17px;
}

.primary-button,
.secondary-button {
    padding: 0 15px;
}

.primary-button {
    border: 1px solid color-mix(in srgb, var(--accent) 72%, #000);
    color: #fff;
    background: var(--accent);
}

.primary-button:hover:not(:disabled) {
    background: var(--accent-hover);
}

.primary-button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.secondary-button {
    border: 1px solid var(--border);
    color: var(--text);
    background: var(--surface);
}

.secondary-button:hover {
    border-color: var(--border-strong);
    background: var(--surface-3);
}

.workspace {
    width: 100%;
    max-width: 1700px;
    margin: 0 auto;
    padding: 22px clamp(20px, 3vw, 44px) 42px;
}

.coach-view {
    display: grid;
    grid-template-columns: minmax(560px, 1.06fr) minmax(430px, 0.94fr);
    align-items: start;
    gap: 18px;
}

.composer-panel,
.result-panel {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.composer-panel {
    padding: 0 24px;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 90px;
    border-bottom: 1px solid var(--border);
}

.panel-heading h2 {
    font-size: 25px;
}

.privacy-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--green);
    background: var(--green-soft);
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.privacy-chip svg {
    width: 13px;
    height: 13px;
}

.input-mode-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    margin: 22px 0 12px;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface-3);
}

.mode-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 36px;
    border: 0;
    border-radius: 5px;
    color: var(--muted);
    background: transparent;
    font-size: 12px;
    font-weight: 700;
}

.mode-tab:hover,
.mode-tab.is-active {
    color: var(--text);
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(17, 24, 20, 0.12);
}

.mode-tab svg {
    width: 16px;
    height: 16px;
}

.paste-pane {
    position: relative;
}

textarea,
input[type="text"],
input[type="search"],
.goal-field input,
select {
    border: 1px solid var(--border);
    color: var(--text);
    background: var(--surface-2);
}

textarea:hover,
input:hover,
select:hover {
    border-color: var(--border-strong);
}

textarea:focus,
input:focus,
select:focus {
    border-color: var(--blue);
    background: var(--surface);
}

textarea {
    display: block;
    width: 100%;
    min-height: 248px;
    padding: 17px 17px 42px;
    resize: vertical;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.65;
}

textarea::placeholder,
input::placeholder {
    color: var(--subtle);
}

.input-footer {
    position: absolute;
    right: 13px;
    bottom: 11px;
    left: 13px;
    display: flex;
    justify-content: space-between;
    color: var(--subtle);
    font-family: var(--font-utility);
    font-size: 9px;
    pointer-events: none;
}

.upload-pane {
    min-height: 248px;
}

.drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 248px;
    padding: 30px;
    border: 1px dashed var(--border-strong);
    border-radius: 6px;
    color: var(--muted);
    background: var(--surface-2);
    text-align: center;
}

.drop-zone:hover,
.drop-zone.is-dragging {
    border-color: var(--accent);
    color: var(--text);
    background: var(--accent-soft);
}

.drop-zone strong {
    margin: 13px 0 5px;
    color: var(--text);
    font-size: 14px;
}

.drop-zone > span:last-child {
    font-size: 11px;
}

.upload-icon {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--green);
    background: var(--surface);
}

.upload-icon svg {
    width: 20px;
    height: 20px;
}

.upload-preview {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) 40px;
    align-items: center;
    gap: 12px;
    min-height: 72px;
    margin-top: 10px;
    padding: 7px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-2);
}

.upload-preview img {
    display: block;
    width: 58px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
}

.upload-preview strong,
.upload-preview span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-preview strong {
    font-size: 12px;
}

.upload-preview span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
}

.task-section,
.field-group {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.task-section {
    margin-top: 25px;
    padding-top: 23px;
    border-top: 1px solid var(--border);
}

.task-section legend {
    display: flex;
    align-items: flex-end;
    gap: 9px;
    margin-bottom: 11px;
    padding: 0;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}

.task-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
}

.task-option {
    min-width: 0;
}

.task-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.task-option > span {
    display: grid;
    grid-template-rows: 22px auto auto;
    min-height: 94px;
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--muted);
    background: var(--surface-2);
}

.task-option > span:hover {
    border-color: var(--border-strong);
}

.task-option input:checked + span {
    border-color: var(--green);
    color: var(--green);
    background: var(--green-soft);
    box-shadow: inset 0 0 0 1px var(--green);
}

.task-option svg {
    width: 18px;
    height: 18px;
}

.task-option strong {
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 11px;
    line-height: 1.25;
}

.task-option small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 9px;
    line-height: 1.3;
}

.preference-grid {
    display: grid;
    grid-template-columns: minmax(300px, 1fr) minmax(210px, 0.8fr);
    gap: 16px;
    margin-top: 21px;
}

.field-group > label,
.field-group > legend {
    display: flex;
    justify-content: space-between;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.field-group > label span {
    color: var(--subtle);
    font-weight: 500;
}

.segmented-control {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    min-height: 40px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-2);
}

.segmented-control label {
    min-width: 0;
}

.segmented-control input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segmented-control span {
    display: grid;
    min-width: 0;
    height: 38px;
    place-items: center;
    border-right: 1px solid var(--border);
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.segmented-control label:last-child span {
    border-right: 0;
}

.segmented-control input:checked + span {
    color: #fff;
    background: var(--green);
}

.goal-field input,
.search-field input {
    width: 100%;
    height: 40px;
    padding: 0 11px;
    border-radius: 6px;
    font-size: 11px;
}

.composer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 88px;
    margin-top: 24px;
    border-top: 1px solid var(--border);
}

.switch-control {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
}

.switch-control > input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch-control > span:last-child strong,
.switch-control > span:first-child strong {
    display: block;
    color: var(--text);
    font-size: 11px;
}

.switch-control small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 9px;
}

.switch-track {
    position: relative;
    flex: 0 0 36px;
    width: 36px;
    height: 20px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: var(--surface-3);
    transition: background 160ms ease;
}

.switch-track > span {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(10, 15, 12, 0.3);
    transition: transform 160ms ease;
}

.switch-control > input:checked + .switch-track,
.preference-row > input:checked + .switch-track {
    border-color: var(--accent);
    background: var(--accent);
}

.switch-control > input:checked + .switch-track > span,
.preference-row > input:checked + .switch-track > span {
    transform: translateX(16px);
}

.submit-area {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.form-message {
    max-width: 250px;
    margin: 0;
    color: var(--danger);
    font-size: 10px;
    line-height: 1.35;
    text-align: right;
}

.result-panel {
    position: sticky;
    top: 100px;
    min-height: 690px;
    max-height: calc(100vh - 122px);
    overflow-y: auto;
    background: var(--surface-2);
    scrollbar-color: var(--border-strong) transparent;
}

.empty-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 688px;
    padding: 40px;
    color: var(--muted);
    text-align: center;
}

.conversation-pulse {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 84px;
    height: 62px;
    margin-bottom: 18px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
}

.conversation-pulse span {
    width: 3px;
    border-radius: 2px;
    background: var(--green);
}

.conversation-pulse span:nth-child(1),
.conversation-pulse span:nth-child(7) { height: 10px; }
.conversation-pulse span:nth-child(2),
.conversation-pulse span:nth-child(6) { height: 20px; }
.conversation-pulse span:nth-child(3),
.conversation-pulse span:nth-child(5) { height: 31px; }
.conversation-pulse span:nth-child(4) { height: 42px; background: var(--accent); }

.empty-result h2 {
    font-size: 24px;
}

.empty-result > p {
    max-width: 300px;
    margin: 10px 0 22px;
    font-size: 12px;
    line-height: 1.55;
}

.result-loading {
    min-height: 688px;
    padding: 28px;
    animation: loading-pulse 1.25s ease-in-out infinite alternate;
}

.loading-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 32px;
}

.loading-header span,
.loading-line,
.loading-signals span,
.loading-card {
    display: block;
    border-radius: 5px;
    background: var(--surface-3);
}

.loading-header span:first-child { width: 44%; height: 30px; }
.loading-header span:last-child { width: 40px; height: 40px; }
.loading-line { width: 72%; height: 11px; margin-bottom: 10px; }
.loading-line.wide { width: 94%; }
.loading-signals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 30px 0; }
.loading-signals span { height: 76px; }
.loading-card { height: 122px; margin-top: 10px; }
.loading-card.short { height: 96px; }

.result-content {
    padding: 26px;
    animation: result-in 240ms ease both;
}

.result-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--border);
}

.result-header h2 {
    max-width: 520px;
    margin-top: 8px;
    font-size: 29px;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: var(--green);
    font-family: var(--font-utility);
    font-size: 9px;
    text-transform: uppercase;
}

.result-summary {
    margin: 22px 0 26px;
    color: var(--text-soft);
    font-size: 14px;
    line-height: 1.72;
}

.result-section + .result-section {
    margin-top: 25px;
}

.result-section-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.result-section-title h3 {
    font-size: 12px;
}

.result-section-title span {
    color: var(--subtle);
    font-family: var(--font-utility);
    font-size: 8px;
    text-transform: uppercase;
}

.signal-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--border);
}

.signal-item {
    position: relative;
    min-width: 0;
    min-height: 76px;
    padding: 13px 11px 12px 14px;
    background: var(--surface);
}

.signal-item::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 3px;
    content: "";
    background: var(--border-strong);
}

.signal-item[data-tone="positive"]::before { background: var(--green); }
.signal-item[data-tone="caution"]::before { background: var(--amber); }
.signal-item[data-tone="negative"]::before { background: var(--danger); }

.signal-item span {
    display: block;
    overflow-wrap: anywhere;
}

.signal-item span:first-child {
    margin-bottom: 6px;
    color: var(--subtle);
    font-family: var(--font-utility);
    font-size: 8px;
    text-transform: uppercase;
}

.signal-item span:last-child {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

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

.suggestion-card {
    position: relative;
    padding: 15px 48px 14px 15px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
}

.suggestion-card:hover {
    border-color: var(--border-strong);
}

.suggestion-label {
    margin: 0 0 7px;
    color: var(--accent);
    font-family: var(--font-utility);
    font-size: 8px;
    text-transform: uppercase;
}

.suggestion-text {
    margin: 0;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.55;
}

.suggestion-why {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.45;
}

.copy-button {
    position: absolute;
    top: 10px;
    right: 9px;
    display: grid;
    width: 32px;
    height: 32px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 5px;
    color: var(--muted);
    background: transparent;
}

.copy-button:hover {
    color: var(--text);
    background: var(--surface-3);
}

.copy-button svg {
    width: 15px;
    height: 15px;
}

.next-move {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 9px;
    margin-top: 24px;
    padding: 17px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--blue);
    border-radius: 6px;
    background: var(--blue-soft);
}

.next-move > span {
    color: var(--blue);
}

.next-move svg {
    width: 17px;
    height: 17px;
}

.next-move strong {
    display: block;
    margin-bottom: 4px;
    font-size: 10px;
}

.next-move p {
    margin: 0;
    color: var(--text-soft);
    font-size: 11px;
    line-height: 1.5;
}

.history-view {
    min-height: calc(100vh - 140px);
}

.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 4px 0 25px;
    border-bottom: 1px solid var(--border);
}

.section-header h2 {
    font-size: 31px;
}

.section-header > div:first-child > p:last-child {
    max-width: 500px;
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.history-actions {
    display: flex;
    gap: 8px;
}

.danger-button {
    color: var(--danger);
}

.history-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 74px;
}

.history-toolbar > span {
    color: var(--muted);
    font-family: var(--font-utility);
    font-size: 9px;
}

.search-field {
    position: relative;
    display: block;
    width: min(420px, 100%);
}

.search-field svg {
    position: absolute;
    z-index: 1;
    top: 12px;
    left: 12px;
    width: 16px;
    height: 16px;
    color: var(--muted);
}

.search-field input {
    padding-left: 37px;
}

.history-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.history-item {
    position: relative;
    min-width: 0;
    padding: 18px 52px 17px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.history-item:hover {
    border-color: var(--border-strong);
}

.history-item-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    color: var(--subtle);
    font-family: var(--font-utility);
    font-size: 8px;
    text-transform: uppercase;
}

.history-item-meta span {
    padding: 3px 5px;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--green);
    background: var(--green-soft);
}

.history-item h3 {
    margin: 11px 0 7px;
    font-size: 15px;
}

.history-item p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.history-item-actions {
    position: absolute;
    top: 12px;
    right: 10px;
    display: grid;
    gap: 3px;
}

.history-item-actions button {
    display: grid;
    width: 30px;
    height: 30px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 5px;
    color: var(--muted);
    background: transparent;
}

.history-item-actions button:hover {
    color: var(--text);
    background: var(--surface-3);
}

.history-item-actions svg {
    width: 14px;
    height: 14px;
}

.history-empty {
    grid-column: 1 / -1;
    display: grid;
    min-height: 280px;
    padding: 30px;
    place-items: center;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    color: var(--muted);
    text-align: center;
}

.history-empty div {
    max-width: 330px;
}

.history-empty svg {
    width: 26px;
    height: 26px;
    margin-bottom: 10px;
    color: var(--green);
}

.history-empty strong,
.history-empty span {
    display: block;
}

.history-empty span {
    margin-top: 5px;
    font-size: 11px;
    line-height: 1.5;
}

.settings-dialog {
    width: min(760px, calc(100vw - 28px));
    max-height: min(820px, calc(100vh - 28px));
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    color: var(--text);
    background: var(--bg);
    box-shadow: var(--shadow);
}

.settings-dialog::backdrop {
    background: rgba(5, 8, 6, 0.72);
    backdrop-filter: blur(4px);
}

.dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 19px 22px;
    background: var(--surface);
}

.dialog-header {
    border-bottom: 1px solid var(--border);
}

.dialog-header h2 {
    font-size: 25px;
}

.settings-body {
    max-height: 620px;
    padding: 8px 22px 24px;
    overflow-y: auto;
}

.settings-section {
    padding: 22px 0;
    border-bottom: 1px solid var(--border);
}

.settings-section:last-child {
    border-bottom: 0;
}

.settings-section-title {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.settings-section-title > div:first-child {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--green);
    background: var(--surface);
}

.settings-section-title svg {
    width: 16px;
    height: 16px;
}

.settings-section-title h3 {
    font-size: 12px;
}

.settings-section-title p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 10px;
}

.theme-options {
    width: min(380px, 100%);
}

.theme-options button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    border: 0;
    border-radius: 5px;
    color: var(--muted);
    background: transparent;
    font-size: 11px;
    font-weight: 700;
}

.theme-options svg {
    width: 15px;
    height: 15px;
}

.preference-row {
    justify-content: space-between;
    min-height: 60px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
}

.preference-stack {
    display: grid;
    gap: 7px;
}

.select-preference {
    cursor: default;
}

.select-preference select {
    width: min(210px, 46%);
    height: 36px;
    padding: 0 30px 0 10px;
    border-radius: 6px;
    font-size: 11px;
}

.preference-row > span:first-child {
    flex: 1;
}

.preference-row > input {
    order: 2;
}

.preference-row > .switch-track {
    order: 3;
}

.settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 9px;
}

.age-gate {
    position: fixed;
    z-index: 30;
    inset: 0;
    display: grid;
    padding: 20px;
    place-items: center;
    background: rgba(7, 10, 8, 0.88);
    backdrop-filter: blur(8px);
}

.age-panel {
    display: grid;
    grid-template-columns: minmax(280px, 0.86fr) minmax(350px, 1fr);
    width: min(880px, 100%);
    min-height: 540px;
    overflow: hidden;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.age-image {
    position: relative;
    min-height: 540px;
    overflow: hidden;
    background: var(--rail);
}

.age-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 48% 75%;
}

.age-content {
    display: flex;
    flex-direction: column;
    padding: 42px clamp(30px, 5vw, 56px) 32px;
}

.age-content .brand {
    color: var(--text);
}

.age-copy {
    margin: auto 0 34px;
}

.age-copy h2 {
    margin-bottom: 12px;
    font-size: 40px;
}

.age-copy > p:last-child {
    max-width: 390px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.age-checkbox {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 56px;
    margin-bottom: 12px;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-2);
    font-size: 12px;
    font-weight: 700;
}

.age-checkbox input {
    position: absolute;
    opacity: 0;
}

.age-checkbox > span:first-of-type {
    display: grid;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    place-items: center;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    color: transparent;
    background: var(--surface);
}

.age-checkbox input:checked + span {
    border-color: var(--green);
    color: #fff;
    background: var(--green);
}

.age-checkbox svg {
    width: 15px;
    height: 15px;
}

.age-content > .primary-button {
    width: 100%;
}

.toast {
    position: fixed;
    z-index: 40;
    right: 20px;
    bottom: 20px;
    max-width: min(360px, calc(100vw - 40px));
    padding: 11px 14px;
    transform: translateY(18px);
    border: 1px solid var(--rail-border);
    border-radius: 6px;
    color: var(--rail-text);
    background: var(--rail);
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease;
    font-size: 11px;
}

.toast.is-visible {
    transform: translateY(0);
    opacity: 1;
}

.is-loading .primary-button svg {
    animation: spin 900ms linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes result-in {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes loading-pulse {
    from { opacity: 0.48; }
    to { opacity: 1; }
}

@media (max-width: 1260px) {
    .app-shell {
        grid-template-columns: 82px minmax(0, 1fr);
    }

    .app-rail {
        align-items: center;
        padding-inline: 12px;
    }

    .brand-name,
    .rail-link > span:not(.nav-count) {
        display: none;
    }

    .rail-link {
        justify-content: center;
        width: 46px;
        padding: 0;
    }

    .rail-link.is-active::before {
        left: -13px;
    }

    .nav-count {
        position: absolute;
        top: -2px;
        right: -4px;
        min-width: 17px;
        height: 17px;
        padding: 0 4px;
        line-height: 17px;
    }

    .coach-view {
        grid-template-columns: minmax(500px, 1fr) minmax(390px, 0.9fr);
    }

    .task-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1010px) {
    .coach-view {
        grid-template-columns: 1fr;
    }

    .result-panel {
        position: static;
        min-height: 480px;
        max-height: none;
    }

    .empty-result,
    .result-loading {
        min-height: 478px;
    }
}

@media (max-width: 720px) {
    .app-shell {
        display: block;
        padding-bottom: 66px;
    }

    .app-rail {
        position: fixed;
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        width: 100%;
        height: 62px;
        padding: 6px 12px;
        border-top: 1px solid var(--rail-border);
        border-right: 0;
    }

    .app-rail > .brand,
    .rail-spacer {
        display: none;
    }

    .rail-nav,
    .rail-footer {
        display: contents;
    }

    .rail-link,
    .rail-footer .rail-link {
        display: flex;
        flex-direction: column;
        gap: 2px;
        width: auto;
        min-height: 48px;
        margin: 0;
        padding: 3px 8px;
        font-size: 9px;
    }

    .rail-link > span:not(.nav-count),
    .rail-footer .rail-link > span {
        display: block;
    }

    .rail-link.is-active::before {
        top: auto;
        right: 18px;
        bottom: -6px;
        left: 18px;
        width: auto;
        height: 3px;
    }

    .command-header {
        min-height: 68px;
        padding: 10px 14px;
    }

    h1 {
        font-size: 20px;
    }

    .new-session-button {
        width: 40px;
        padding: 0;
    }

    .new-session-button span {
        display: none;
    }

    .workspace {
        padding: 12px 12px 30px;
    }

    .composer-panel {
        padding: 0 15px;
    }

    .panel-heading {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        gap: 8px;
        min-height: 104px;
    }

    .panel-heading h2 {
        font-size: 22px;
    }

    .privacy-chip {
        white-space: normal;
    }

    textarea,
    .upload-pane,
    .drop-zone {
        min-height: 230px;
    }

    .task-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .preference-grid {
        grid-template-columns: 1fr;
    }

    .composer-footer {
        align-items: stretch;
        flex-direction: column;
        justify-content: center;
        min-height: 138px;
        padding: 18px 0;
    }

    .submit-area {
        align-items: stretch;
        flex-direction: column;
    }

    .form-message {
        max-width: none;
        text-align: left;
    }

    .submit-area .primary-button {
        width: 100%;
    }

    .result-panel,
    .empty-result,
    .result-loading {
        min-height: 420px;
    }

    .result-content,
    .result-loading {
        padding: 20px 15px;
    }

    .result-header h2 {
        font-size: 25px;
    }

    .signal-strip,
    .loading-signals {
        grid-template-columns: 1fr;
    }

    .signal-item {
        min-height: 60px;
    }

    .section-header {
        align-items: stretch;
        flex-direction: column;
    }

    .history-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .history-toolbar {
        align-items: stretch;
        flex-direction: column;
        justify-content: center;
    }

    .search-field {
        width: 100%;
    }

    .history-list {
        grid-template-columns: 1fr;
    }

    .select-preference {
        align-items: stretch;
        flex-direction: column;
    }

    .select-preference select {
        width: 100%;
    }

    .settings-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .dialog-header {
        padding: 16px;
    }

    .settings-body {
        padding-inline: 16px;
    }

    .age-gate {
        padding: 10px;
        overflow-y: auto;
    }

    .age-panel {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .age-image {
        height: 160px;
        min-height: 0;
    }

    .age-image img {
        object-position: 48% 75%;
    }

    .age-content {
        padding: 25px 22px 22px;
    }

    .age-copy {
        margin: 30px 0 24px;
    }

    .age-copy h2 {
        font-size: 32px;
    }

    .toast {
        right: 12px;
        bottom: 76px;
        left: 12px;
        max-width: none;
    }
}

@media (max-width: 430px) {
    .task-option > span {
        min-height: 88px;
        padding: 9px;
    }

    .segmented-control span {
        font-size: 9px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Editable drafts: the generated text is a textarea that looks like text until it is focused. */
.suggestion-card .suggestion-editor {
    display: block;
    width: calc(100% + 12px);
    min-height: 0;
    margin: 0 0 0 -6px;
    padding: 3px 6px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.55;
    resize: none;
    overflow: hidden;
}

.suggestion-card .suggestion-editor:hover {
    border-color: var(--border);
    background: transparent;
}

.suggestion-card .suggestion-editor:focus,
.suggestion-card .suggestion-editor:focus-visible {
    border-color: var(--border-strong);
    background: var(--surface-2);
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.suggestion-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    min-height: 16px;
}

.suggestion-edit-hint {
    color: var(--subtle);
    font-size: 11px;
}

.suggestion-reset {
    padding: 0;
    border: 0;
    background: none;
    color: var(--muted);
    font: inherit;
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
}

.suggestion-reset:hover {
    color: var(--accent);
}

/* Request progress: a status card in the result area plus a thin bar under the sticky header. */
.result-loading {
    animation: none;
}

.loading-skeleton {
    animation: loading-pulse 1.25s ease-in-out infinite alternate;
}

.loading-status {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-2);
}

.loading-spinner {
    flex: none;
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 900ms linear infinite;
}

.loading-copy {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.loading-copy strong {
    color: var(--text);
    font-size: 14px;
}

.loading-copy span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.loading-elapsed {
    flex: none;
    min-width: 34px;
    color: var(--muted);
    font-family: var(--font-utility);
    font-size: 12px;
    text-align: right;
}

.loading-cancel {
    flex: none;
    padding: 7px 12px;
    font-size: 12px;
}

.loading-progress {
    height: 4px;
    margin-bottom: 26px;
    border-radius: 999px;
    background: var(--surface-3);
    overflow: hidden;
}

.loading-progress span,
.request-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    transition: width 300ms ease;
}

.request-progress {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 3px;
    overflow: hidden;
}

.request-progress[hidden] {
    display: none;
}

@media (max-width: 720px) {
    .loading-status {
        flex-wrap: wrap;
    }

    .loading-cancel {
        margin-left: auto;
    }
}

/* Landing page (index.php). Shares the design tokens; nothing here touches the app shell. */
.landing {
    background: var(--bg);
    color: var(--text);
}

.landing-header {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px clamp(20px, 4vw, 48px);
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    backdrop-filter: blur(16px);
}

.landing-header .brand {
    color: var(--text);
}

.landing-header .brand-name {
    color: var(--text);
}

.landing-nav {
    display: flex;
    align-items: center;
    gap: 18px;
}

.landing-nav a {
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.landing-nav a:hover {
    color: var(--accent);
}

.landing-main {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 clamp(20px, 4vw, 48px) 60px;
}

.landing-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: clamp(28px, 5vw, 64px);
    align-items: center;
    padding: clamp(40px, 7vw, 88px) 0 clamp(32px, 5vw, 56px);
}

.landing-eyebrow {
    margin: 0 0 14px;
    color: var(--accent);
    font-family: var(--font-utility);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.landing-hero h1 {
    margin: 0 0 18px;
    font-family: var(--font-display);
    font-size: clamp(36px, 5.2vw, 60px);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.02em;
}

.landing-lede {
    margin: 0 0 26px;
    color: var(--text-soft);
    font-size: clamp(16px, 1.6vw, 19px);
    line-height: 1.6;
    max-width: 34em;
}

.landing-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.landing-actions .primary-button,
.landing-cta .primary-button {
    padding: 14px 22px;
    font-size: 15px;
    text-decoration: none;
}

.landing-note {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.landing-hero-art img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.landing-section {
    padding: clamp(36px, 5vw, 64px) 0;
    border-top: 1px solid var(--border);
}

.landing-section h2 {
    margin: 0 0 10px;
    font-family: var(--font-display);
    font-size: clamp(26px, 3.2vw, 36px);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.landing-section > p {
    margin: 0 0 28px;
    color: var(--text-soft);
    font-size: 16px;
    max-width: 44em;
}

.landing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.landing-card {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.landing-card .step {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin-bottom: 14px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-family: var(--font-utility);
    font-size: 13px;
    font-weight: 600;
}

.landing-card h3 {
    margin: 0 0 8px;
    font-size: 17px;
}

.landing-card p {
    margin: 0;
    color: var(--text-soft);
    font-size: 14px;
    line-height: 1.6;
}

.landing-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.landing-list li {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 12px;
    color: var(--text-soft);
    font-size: 15px;
    line-height: 1.55;
}

.landing-list li::before {
    content: "";
    width: 18px;
    height: 18px;
    margin-top: 3px;
    border-radius: 50%;
    background: var(--green-soft);
    box-shadow: inset 0 0 0 5px var(--green);
}

.landing-faq details {
    padding: 4px 0;
    border-bottom: 1px solid var(--border);
}

.landing-faq summary {
    padding: 14px 0;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.landing-faq summary::-webkit-details-marker {
    display: none;
}

.landing-faq summary::after {
    content: "+";
    float: right;
    color: var(--accent);
    font-family: var(--font-utility);
}

.landing-faq details[open] summary::after {
    content: "\2013";
}

.landing-faq p {
    margin: 0 0 16px;
    color: var(--text-soft);
    font-size: 15px;
    line-height: 1.6;
    max-width: 60em;
}

.landing-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.landing-cta h2 {
    margin: 0 0 6px;
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 600;
}

.landing-cta p {
    margin: 0;
    color: var(--text-soft);
}

.landing-footer {
    padding: 28px clamp(20px, 4vw, 48px);
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 13px;
}

.landing-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 10px;
}

.landing-footer a {
    color: var(--text-soft);
}

@media (max-width: 860px) {
    .landing-hero {
        grid-template-columns: 1fr;
    }

    .landing-hero-art {
        order: -1;
    }

    .landing-nav a:not(.primary-button) {
        display: none;
    }
}

.landing-hero-art img {
    aspect-ratio: 864 / 942;
    object-fit: cover;
    object-position: center;
}

/* Button links on the landing page: beat the generic landing link colours (.landing-nav a etc.). */
.landing a.primary-button,
.landing a.primary-button:hover,
.landing a.primary-button:focus-visible {
    color: #fff;
    text-decoration: none;
}

.landing a.primary-button:hover {
    background: var(--accent-hover);
    border-color: color-mix(in srgb, var(--accent-hover) 72%, #000);
}

.landing-actions a:not(.primary-button) {
    color: var(--text-soft);
    font-weight: 500;
}

.landing-actions a:not(.primary-button):hover {
    color: var(--accent);
}

/* Landing header theme toggle: moon in light mode, sun in dark mode, following the app's preference key. */
.landing .theme-toggle {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-soft);
    cursor: pointer;
}

.landing .theme-toggle:hover {
    border-color: var(--border-strong);
    color: var(--accent);
}

.landing .theme-toggle svg {
    width: 18px;
    height: 18px;
}

.theme-toggle .icon-sun {
    display: none;
}

html[data-theme="dark"] .theme-toggle .icon-sun {
    display: block;
}

html[data-theme="dark"] .theme-toggle .icon-moon {
    display: none;
}

@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]):not([data-theme="dark"]) .theme-toggle .icon-sun {
        display: block;
    }

    html:not([data-theme="light"]):not([data-theme="dark"]) .theme-toggle .icon-moon {
        display: none;
    }
}
