/*
 * Desktop and tablet appearance.
 * Day: Natural Organic's paper, walnut and sage.
 * Night: macOS Vibrancy's three charcoal depths and quiet blue focus.
 * The three-column workspaces and all phone styling stay in styles.css.
 */
@media (min-width: 600px) {
  :root {
    --paper: #faf6f1;
    --surface: #fffdf9;
    --ink: #3f332b;
    --muted: #74685f;
    --line: #e9e0d4;
    --green: #5a6e48;
    --green-soft: #eef2e9;
    --ocean: #5a6e48;
    --ocean-deep: #435936;
    --sky: #edf1e8;
    --orange: #d4a373;
    --orange-soft: #f6e8d9;
    --amber: #9d704a;
    --red: #b15b4b;
    --shadow-sm: 0 1px 2px rgba(67, 55, 43, .07);
    --shadow-panel: 0 5px 22px rgba(73, 58, 43, .045);
    color-scheme: light;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  }
  body {
    color: var(--ink);
    background: var(--paper);
    background-image: none;
  }
  button:focus-visible, input:focus-visible, textarea:focus-visible,
  select:focus-visible, .library-browser :focus-visible, .text-action:focus-visible {
    outline: 2px solid #8b9d77;
    outline-offset: 2px;
  }
  ::selection { color: #314226; background: #dce7cf; }
  * { scrollbar-color: #d8cfc1 transparent; }

  .topbar {
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    background: rgba(250, 246, 241, .94);
    box-shadow: none;
    backdrop-filter: blur(18px);
  }
  .brand strong { color: #44372e; }
  .brand small { color: #83766c; }
  .brand-mark {
    color: #fff;
    border: 1px solid #e6d0b8;
    background: #f8efe3;
    box-shadow: 0 1px 2px rgba(92, 64, 51, .12);
  }
  .mode-switch {
    border: 1px solid #e5ddcf;
    background: #eee7dc;
  }
  .mode-tab { color: #756a60; }
  .mode-tab:hover { color: #405438; }
  .mode-tab.active {
    color: #445b38;
    background: #fffdf9;
    box-shadow: 0 1px 3px rgba(67, 55, 43, .11);
  }
  .appearance-controls {
    padding: 0;
    border: 0;
    background: transparent;
  }
  .appearance-controls .palette-switcher { display: none; }
  :root .appearance-controls .theme-toggle {
    width: 36px;
    height: 36px;
    color: #5c4033;
    border: 1px solid #ddd1c2;
    border-radius: 12px;
    background: #fffdf9;
    box-shadow: 0 1px 3px rgba(67, 55, 43, .07);
  }
  :root .appearance-controls .theme-toggle:hover {
    color: #435936;
    border-color: #b9c6ab;
    background: #f5f8f1;
  }
  .storage-bar {
    color: var(--muted);
    border-color: var(--line);
    background: transparent;
  }
  .storage-bar button {
    color: #4f6142;
    border-color: #ded7cc;
    background: #fffdf9;
  }
  .storage-bar button:hover { border-color: #a9ba9b; background: #f4f7f1; }
  .storage-bar .logout-button { color: #69564a; border-color: #ded7cc; background: #fffdf9; }
  .account-chip, #cloudStatus { color: #83766c; }

  .workspace { background: transparent; }
  .workspace > .panel {
    border: 1px solid #e5ddd1;
    border-radius: 18px;
    box-shadow: var(--shadow-panel);
  }
  .library-panel, .prompt-panel { background: #f8f3ec !important; }
  .analysis-panel, .feedback-panel { background: #f9f5ef !important; }
  .conversation-panel, .editor-panel { background: #fffdf9 !important; }
  .conversation-header, .editor-header {
    border-bottom: 1px solid #e9e0d4;
    background: rgba(255, 253, 249, .94);
  }
  .panel-heading h1, .panel-heading h2, .editor-header h2, .conversation-header strong {
    color: #45362e;
    font-family: Georgia, "Songti SC", "STSong", serif;
    letter-spacing: -.015em;
  }
  .eyebrow { color: #768768; }
  .taxonomy-heading, .library-hint, .sort-note, .assessment-note { color: #81766d; }
  .taxonomy-heading button, .text-action, .play-button { color: #526a45; }
  .icon-button {
    color: #526a45;
    border-color: #d7dfce;
    background: #f1f5ed;
    box-shadow: none;
  }
  .icon-button:hover { border-color: #9fb48f; background: #e8f0e1; }
  .search-box {
    border-color: #e0d8cc;
    background: #fffdf9;
  }
  .search-box:focus-within {
    border-color: #91a883;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(139, 157, 119, .12);
  }
  .search-box input, .library-filter select, .entry-classification-fields select,
  .entry-form input, .entry-form textarea, .entry-form select,
  #topicDialog select, #topicDialog textarea {
    color: var(--ink);
    border-color: #ded6c9;
    background: #fffdf9;
  }
  .library-kind-tabs, .speaking-library-tabs,
  .analysis-tabs, .feedback-tabs, .library-view-tabs {
    border-color: #e4dccf;
    background: #eee9df;
  }
  .library-kind-tabs button, .speaking-library-tabs button,
  .analysis-tabs button, .feedback-tabs button, .library-view-tabs button { color: #746960; }
  .library-kind-tabs button.active, .speaking-library-tabs button.active,
  .analysis-tabs button.active, .feedback-tabs button.active, .library-view-tabs button.active {
    color: #435936;
    border-color: transparent;
    background: #fffdf9;
    box-shadow: 0 1px 3px rgba(67, 55, 43, .1);
  }
  .phrase-card, .writing-entry, .prompt-card,
  .round-library-card.round-recommended {
    color: var(--ink);
    border-color: #e6ded1;
    background: #fffdf9;
    box-shadow: none;
  }
  .phrase-card:hover, .writing-entry:hover, .prompt-card:hover { border-color: #b3c2a5; box-shadow: 0 3px 10px rgba(67, 55, 43, .06); }
  .phrase-card.selected, .writing-entry.selected, .prompt-card.selected {
    border-color: #a8ba98;
    background: #f2f5ed;
  }
  .phrase-card .tag, .writing-entry .tag, .writing-entry .entry-head span,
  .prompt-card > div, .entry-kind { color: #526a45; }
  .entry-kind { background: #e8eee2; }
  [data-kind="vocabulary"] .entry-kind { color: #7e6043; background: #f3e6d7; }
  .phrase-card .entry-note, .writing-entry .entry-note, .detail-row p { color: #74685f; }
  .round-library-card.round-mentioned, .round-library-card.round-added {
    border-color: #d4a373;
    background: #fbf1e6;
    box-shadow: inset 3px 0 0 #d4a373;
  }
  .round-library-state { color: #536747; background: #e8eee2; }
  .round-mentioned .round-library-state, .round-added .round-library-state { color: #644329; background: #f1d8bb; }
  .load-more, .history-load-more, .round-library-empty,
  .library-transfer-tools button {
    color: #526a45;
    border-color: #dcd6c9;
    background: #fffdf9;
  }
  .library-transfer-tools button:first-child { color: #fff; border-color: #5a6e48; background: #5a6e48; }
  .load-more:hover, .library-transfer-tools button:hover:not(:disabled) { border-color: #aebf9f; background: #f1f5ed; }

  .chat-stream { background: #fffdf9; }
  .conversation-history { border-color: #e7ded1; background: #f8f3ec; }
  .conversation-history summary { color: #526a45; }
  .conversation-history summary::before { color: #8b9d77; }
  .conversation-history summary small, .history-record-main small { color: #81766d; }
  .conversation-history-row { border-color: #e7ded1; background: #fffdf9; }
  .conversation-history-row.active { border-color: #a9ba99; box-shadow: inset 3px 0 0 #8b9d77; }
  .history-viewing-banner { color: #435936; border-color: #c5d2b8; background: #eff3e9; }
  .avatar { background: #6c805b; box-shadow: none; }
  .message.user .avatar { color: #5c4033; background: #e9d4bb; box-shadow: none; }
  .bubble { color: var(--ink); border-color: #e7e0d6; background: #fff; box-shadow: 0 2px 8px rgba(67, 55, 43, .045); }
  .message.user .bubble {
    color: #fff;
    border-color: #5a6e48;
    background: #5a6e48;
    box-shadow: 0 3px 10px rgba(63, 83, 49, .12);
  }
  .message time { color: #91867b; }
  .message.user .play-button, .message.user .play-button small,
  .message.user .voice-message-label, .message.user .bubble .text-action { color: #e9f0e4; }
  .live-captions, .practice-status { color: #526a45; border-color: #dfe7d8; background: #f0f4ec; }
  .voice-dock {
    border-color: #e7ded1;
    background: #fffdf9;
    box-shadow: 0 -3px 12px rgba(67, 55, 43, .035);
  }
  .voice-dock-actions { gap: 12px; }
  .voice-dock .voice-tool {
    width: 42px;
    height: 42px;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: 13px;
    color: #6d7566;
    background: transparent;
    box-shadow: none;
  }
  .voice-dock .voice-tool span { display: none !important; }
  .voice-dock .voice-tool svg { width: 21px; height: 21px; }
  .voice-dock #keyboardToggle .voice-icon { display: none; }
  .voice-dock #keyboardToggle.is-text-mode .keyboard-icon { display: none; }
  .voice-dock #keyboardToggle.is-text-mode .voice-icon { display: block; }
  .voice-dock #realtimeToggle.active {
    color: #fff;
    border-color: #5a6e48;
    background: #5a6e48;
    box-shadow: 0 2px 8px rgba(63, 83, 49, .15);
  }
  .voice-dock #holdToTalk.recording {
    color: #fff;
    border-color: #b15b4b;
    background: #b15b4b;
    box-shadow: 0 2px 8px rgba(177, 91, 75, .17);
  }
  .voice-dock-input { border-color: #d7dfce; background: #fff; box-shadow: 0 2px 8px rgba(67, 55, 43, .06); }
  .voice-dock-input input { color: var(--ink); }
  .voice-dock-input button, .text-composer button,
  .primary-button, .dialog-actions button:last-child { color: #fff; border-color: #5a6e48; background: #5a6e48; }
  .outline-button, .end-button, .keyboard-button {
    color: #526a45;
    border-color: #d7dfce;
    background: #fffdf9;
  }
  .outline-button:hover, .end-button:hover, .keyboard-button:hover { color: #435936; border-color: #aebf9f; background: #f3f6ef; }

  .answer-feedback, .ai-suggestion, .empty-feedback {
    color: var(--ink);
    border-color: #e5ddd0;
    background: #fffdf9;
  }
  .real-analysis h3, .feedback-content h3, .answer-feedback h3,
  .answer-feedback h4 { color: #526a45; }
  .ai-sentence { border-color: #e8e0d5; }
  .ai-original, .ai-explanation { color: #74685f; }
  .ai-improved, .correction-card .replacement { color: #435936; border-color: #dfe8d7; background: #eef3e9; }
  .tip, .logic-note { border-left-color: #d4a373; background: #f8efe5; }
  .question-brief { color: var(--ink); border-color: #e2dfd5; background: #f3f3ec; }
  .question-brief span { color: #526a45; }
  .question-brief p { color: #645a50; }
  .writing-surface { border-color: #e3ddd3; background: #fff; box-shadow: 0 4px 16px rgba(67,55,43,.055); }
  #essayEditor { color: #3f332b; caret-color: #5a6e48; }
  .switch-row input:checked + i { background: #5a6e48; }
  .prompt-filters button.active, .writing-library-filters button.active { color: #fff; border-color: #5a6e48; background: #5a6e48; }
  dialog { color: var(--ink); border-color: #e2d8cb; background: #fffdf9; box-shadow: 0 18px 52px rgba(56, 45, 34, .16); }
  dialog::backdrop { background: rgba(38, 32, 28, .34); }
  .dialog-heading { border-color: #e8ded1; background: #f8f3ec; }
  .dialog-actions button, .cloud-dialog button:not(.dialog-heading button) { color: #526a45; border-color: #d8dfd0; background: #fffdf9; }
  .toast { background: #3f4f37; box-shadow: 0 8px 24px rgba(40, 54, 34, .17); }
  .access-gate { background: #faf6f1; background-image: none; }
  .access-card { color: var(--ink); border-color: #e5ddd1; background: #fffdf9; box-shadow: 0 14px 42px rgba(67,55,43,.09); }
  .access-form input { color: var(--ink); border-color: #e0d7ca; background: #fff; }
  .access-form input:focus { border-color: #9cae8b; box-shadow: 0 0 0 3px rgba(139,157,119,.13); }
  .site-compliance { color: #83766c; background: transparent; }
}

@media (min-width: 600px) {
  :root[data-theme="dark"] {
    --paper: #1c1c1e;
    --surface: #2c2c2e;
    --ink: #f5f5f7;
    --muted: #a5a5ad;
    --line: rgba(255,255,255,.09);
    --green: #0a84ff;
    --green-soft: #253a50;
    --ocean: #0a84ff;
    --ocean-deep: #87c2ff;
    --sky: #253a50;
    --orange: #ff9f0a;
    --orange-soft: #493827;
    --amber: #ffb347;
    --red: #ff6961;
    --shadow-sm: none;
    --shadow-panel: none;
    color-scheme: dark;
  }
  :root[data-theme="dark"] body { color: var(--ink); background: #1c1c1e; background-image: none; }
  :root[data-theme="dark"] ::selection { color: #fff; background: #2463a0; }
  :root[data-theme="dark"] * { scrollbar-color: #4a4a4e transparent; }
  :root[data-theme="dark"] button:focus-visible,
  :root[data-theme="dark"] input:focus-visible,
  :root[data-theme="dark"] textarea:focus-visible,
  :root[data-theme="dark"] select:focus-visible { outline-color: #4fa8ff; }
  :root[data-theme="dark"] .topbar {
    color: #f5f5f7;
    border-color: rgba(255,255,255,.08);
    background: rgba(44,44,46,.86);
    box-shadow: none;
    backdrop-filter: blur(20px) saturate(145%);
  }
  :root[data-theme="dark"] .brand strong,
  :root[data-theme="dark"] .panel-heading h1,
  :root[data-theme="dark"] .panel-heading h2,
  :root[data-theme="dark"] .editor-header h2,
  :root[data-theme="dark"] .conversation-header strong { color: #f5f5f7; }
  :root[data-theme="dark"] .brand small,
  :root[data-theme="dark"] .account-chip,
  :root[data-theme="dark"] #cloudStatus { color: #a5a5ad; }
  :root[data-theme="dark"] .brand-mark { border-color: rgba(255,255,255,.13); background: #3a3a3c; box-shadow: none; }
  :root[data-theme="dark"] .mode-switch { border-color: rgba(255,255,255,.09); background: #202022; }
  :root[data-theme="dark"] .mode-tab { color: #a8a8ae; }
  :root[data-theme="dark"] .mode-tab:hover { color: #f5f5f7; }
  :root[data-theme="dark"] .mode-tab.active { color: #f5f5f7; background: #3a3a3c; box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
  :root[data-theme="dark"] .appearance-controls .theme-toggle {
    color: #f5f5f7;
    border-color: rgba(255,255,255,.13);
    background: #3a3a3c;
    box-shadow: none;
  }
  :root[data-theme="dark"] .appearance-controls .theme-toggle:hover { border-color: rgba(10,132,255,.45); background: #444448; }
  :root[data-theme="dark"] .storage-bar { color: #a5a5ad; border-color: rgba(255,255,255,.08); background: transparent; }
  :root[data-theme="dark"] .storage-bar button,
  :root[data-theme="dark"] .storage-bar .logout-button {
    color: #d6d6dc;
    border-color: rgba(255,255,255,.11);
    background: #343437;
  }
  :root[data-theme="dark"] .storage-bar button:hover { border-color: rgba(255,255,255,.2); background: #3a3a3d; }
  :root[data-theme="dark"] .workspace > .panel { border-color: rgba(255,255,255,.08); box-shadow: none; }
  :root[data-theme="dark"] .library-panel,
  :root[data-theme="dark"] .prompt-panel { background: #252527 !important; }
  :root[data-theme="dark"] .analysis-panel,
  :root[data-theme="dark"] .feedback-panel { background: #262628 !important; }
  :root[data-theme="dark"] .conversation-panel,
  :root[data-theme="dark"] .editor-panel { background: #2c2c2e !important; }
  :root[data-theme="dark"] .conversation-header,
  :root[data-theme="dark"] .editor-header { border-color: rgba(255,255,255,.08); background: rgba(44,44,46,.88); }
  :root[data-theme="dark"] .eyebrow,
  :root[data-theme="dark"] .taxonomy-heading button,
  :root[data-theme="dark"] .text-action,
  :root[data-theme="dark"] .play-button { color: #85beff; }
  :root[data-theme="dark"] .taxonomy-heading,
  :root[data-theme="dark"] .library-hint,
  :root[data-theme="dark"] .sort-note,
  :root[data-theme="dark"] .assessment-note { color: #a5a5ad; }
  :root[data-theme="dark"] .icon-button { color: #d6e9ff; border-color: rgba(255,255,255,.13); background: #3a3a3c; }
  :root[data-theme="dark"] .icon-button:hover { border-color: #5a83ad; background: #444b54; }
  :root[data-theme="dark"] .search-box { border-color: rgba(255,255,255,.1); background: #1f1f21; }
  :root[data-theme="dark"] .search-box:focus-within { border-color: #478dc9; background: #23252a; box-shadow: 0 0 0 3px rgba(10,132,255,.12); }
  :root[data-theme="dark"] .search-box input,
  :root[data-theme="dark"] .library-filter select,
  :root[data-theme="dark"] .entry-classification-fields select,
  :root[data-theme="dark"] .entry-form input,
  :root[data-theme="dark"] .entry-form textarea,
  :root[data-theme="dark"] .entry-form select,
  :root[data-theme="dark"] #topicDialog select,
  :root[data-theme="dark"] #topicDialog textarea { color: #f5f5f7; border-color: rgba(255,255,255,.13); background: #1f1f21; }
  :root[data-theme="dark"] .library-kind-tabs,
  :root[data-theme="dark"] .speaking-library-tabs,
  :root[data-theme="dark"] .analysis-tabs,
  :root[data-theme="dark"] .feedback-tabs,
  :root[data-theme="dark"] .library-view-tabs { border-color: rgba(255,255,255,.08); background: #1f1f21; }
  :root[data-theme="dark"] .library-kind-tabs button,
  :root[data-theme="dark"] .speaking-library-tabs button,
  :root[data-theme="dark"] .analysis-tabs button,
  :root[data-theme="dark"] .feedback-tabs button,
  :root[data-theme="dark"] .library-view-tabs button { color: #aaaab2; }
  :root[data-theme="dark"] .library-kind-tabs button.active,
  :root[data-theme="dark"] .speaking-library-tabs button.active,
  :root[data-theme="dark"] .analysis-tabs button.active,
  :root[data-theme="dark"] .feedback-tabs button.active,
  :root[data-theme="dark"] .library-view-tabs button.active { color: #f5f5f7; border-color: transparent; background: #3a3a3c; box-shadow: inset 0 1px 0 rgba(255,255,255,.07); }
  :root[data-theme="dark"] .phrase-card,
  :root[data-theme="dark"] .writing-entry,
  :root[data-theme="dark"] .prompt-card,
  :root[data-theme="dark"] .round-library-card.round-recommended,
  :root[data-theme="dark"] .conversation-history-row { color: #f5f5f7; border-color: rgba(255,255,255,.09); background: #303033; box-shadow: none; }
  :root[data-theme="dark"] .phrase-card:hover,
  :root[data-theme="dark"] .writing-entry:hover,
  :root[data-theme="dark"] .prompt-card:hover { border-color: rgba(10,132,255,.35); box-shadow: none; }
  :root[data-theme="dark"] .phrase-card.selected,
  :root[data-theme="dark"] .writing-entry.selected,
  :root[data-theme="dark"] .prompt-card.selected { border-color: rgba(10,132,255,.42); background: #333d48; }
  :root[data-theme="dark"] .phrase-card .tag,
  :root[data-theme="dark"] .writing-entry .tag,
  :root[data-theme="dark"] .writing-entry .entry-head span,
  :root[data-theme="dark"] .prompt-card > div { color: #a8d2ff; }
  :root[data-theme="dark"] .entry-kind { color: #c5d8ea; background: #3b4653; }
  :root[data-theme="dark"] [data-kind="vocabulary"] .entry-kind { color: #eac891; background: #493b2b; }
  :root[data-theme="dark"] .phrase-card .entry-note,
  :root[data-theme="dark"] .writing-entry .entry-note,
  :root[data-theme="dark"] .detail-row p { color: #b6b6bd; }
  :root[data-theme="dark"] .round-library-card.round-mentioned,
  :root[data-theme="dark"] .round-library-card.round-added { border-color: #8a6338; background: #39332d; box-shadow: inset 3px 0 0 #ff9f0a; }
  :root[data-theme="dark"] .round-library-state { color: #b9dafd; background: #2f455d; }
  :root[data-theme="dark"] .round-mentioned .round-library-state,
  :root[data-theme="dark"] .round-added .round-library-state { color: #ffcf8a; background: #51402d; }
  :root[data-theme="dark"] .load-more,
  :root[data-theme="dark"] .history-load-more,
  :root[data-theme="dark"] .round-library-empty,
  :root[data-theme="dark"] .library-transfer-tools button { color: #c7dfff; border-color: rgba(255,255,255,.11); background: #343437; }
  :root[data-theme="dark"] .library-transfer-tools button:first-child { color: #fff; border-color: #0a84ff; background: #0a84ff; }
  :root[data-theme="dark"] .chat-stream { background: #2c2c2e; }
  :root[data-theme="dark"] .conversation-history { border-color: rgba(255,255,255,.08); background: #29292b; }
  :root[data-theme="dark"] .conversation-history summary { color: #c7dfff; }
  :root[data-theme="dark"] .conversation-history summary::before { color: #0a84ff; }
  :root[data-theme="dark"] .conversation-history summary small,
  :root[data-theme="dark"] .history-record-main small { color: #a5a5ad; }
  :root[data-theme="dark"] .conversation-history-row.active { border-color: #548cc4; box-shadow: inset 3px 0 0 #0a84ff; }
  :root[data-theme="dark"] .history-viewing-banner { color: #c7dfff; border-color: #46607a; background: #2d3c4b; }
  :root[data-theme="dark"] .avatar { color: #f5f5f7; background: #4a4a4d; box-shadow: none; }
  :root[data-theme="dark"] .message.user .avatar { color: #f5f5f7; background: #305b84; }
  :root[data-theme="dark"] .bubble { color: #f5f5f7; border-color: rgba(255,255,255,.1); background: #3a3a3c; box-shadow: none; }
  :root[data-theme="dark"] .message.user .bubble { color: #fff; border-color: #0a84ff; background: #0a84ff; box-shadow: none; }
  :root[data-theme="dark"] .message time { color: #a5a5ad; }
  :root[data-theme="dark"] .message.user .play-button,
  :root[data-theme="dark"] .message.user .play-button small,
  :root[data-theme="dark"] .message.user .voice-message-label,
  :root[data-theme="dark"] .message.user .bubble .text-action { color: #eaf5ff; }
  :root[data-theme="dark"] .live-captions,
  :root[data-theme="dark"] .practice-status { color: #c7dfff; border-color: #3f5165; background: #293949; }
  :root[data-theme="dark"] .voice-dock { border-color: rgba(255,255,255,.08); background: #2c2c2e; box-shadow: none; }
  :root[data-theme="dark"] .voice-dock .voice-tool { color: #c4c4cb; border-color: transparent; background: transparent; box-shadow: none; }
  :root[data-theme="dark"] .voice-dock #realtimeToggle.active { color: #fff; border-color: #0a84ff; background: #0a84ff; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
  :root[data-theme="dark"] .voice-dock #holdToTalk.recording { color: #fff; border-color: #ff453a; background: #ff453a; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
  :root[data-theme="dark"] .voice-dock-input,
  :root[data-theme="dark"] .text-composer input { color: #f5f5f7; border-color: rgba(255,255,255,.12); background: #1f1f21; box-shadow: none; }
  :root[data-theme="dark"] .text-composer button,
  :root[data-theme="dark"] .primary-button,
  :root[data-theme="dark"] .dialog-actions button:last-child { color: #fff; border-color: #0a84ff; background: #0a84ff; }
  :root[data-theme="dark"] .outline-button,
  :root[data-theme="dark"] .end-button,
  :root[data-theme="dark"] .keyboard-button { color: #d1e6ff; border-color: rgba(255,255,255,.12); background: #343437; }
  :root[data-theme="dark"] .outline-button:hover,
  :root[data-theme="dark"] .end-button:hover,
  :root[data-theme="dark"] .keyboard-button:hover { color: #f5f5f7; border-color: rgba(255,255,255,.2); background: #3a3a3c; }
  :root[data-theme="dark"] .answer-feedback,
  :root[data-theme="dark"] .ai-suggestion,
  :root[data-theme="dark"] .empty-feedback { color: #f5f5f7; border-color: rgba(255,255,255,.1); background: #303033; }
  :root[data-theme="dark"] .real-analysis h3,
  :root[data-theme="dark"] .feedback-content h3,
  :root[data-theme="dark"] .answer-feedback h3,
  :root[data-theme="dark"] .answer-feedback h4 { color: #a8d2ff; }
  :root[data-theme="dark"] .ai-sentence { border-color: rgba(255,255,255,.09); }
  :root[data-theme="dark"] .ai-original,
  :root[data-theme="dark"] .ai-explanation { color: #b6b6bd; }
  :root[data-theme="dark"] .ai-improved,
  :root[data-theme="dark"] .correction-card .replacement { color: #d7eaff; border-color: #3d5268; background: #293b4d; }
  :root[data-theme="dark"] .tip,
  :root[data-theme="dark"] .logic-note { border-left-color: #ff9f0a; background: #383128; }
  :root[data-theme="dark"] .question-brief { color: #f5f5f7; border-color: rgba(255,255,255,.09); background: #353538; }
  :root[data-theme="dark"] .question-brief span { color: #a8d2ff; }
  :root[data-theme="dark"] .question-brief p { color: #d0d0d5; }
  :root[data-theme="dark"] .writing-surface { border-color: rgba(255,255,255,.1); background: #252527; box-shadow: none; }
  :root[data-theme="dark"] #essayEditor { color: #f5f5f7; caret-color: #0a84ff; }
  :root[data-theme="dark"] .editor-footer { border-color: rgba(255,255,255,.09); color: #a5a5ad; background: #29292b; }
  :root[data-theme="dark"] .switch-row { color: #c4c4cb; }
  :root[data-theme="dark"] .switch-row i { background: #55555a; }
  :root[data-theme="dark"] .switch-row input:checked + i { background: #0a84ff; }
  :root[data-theme="dark"] .prompt-filters button,
  :root[data-theme="dark"] .writing-library-filters button { color: #c4c4cb; border-color: rgba(255,255,255,.1); background: #343437; }
  :root[data-theme="dark"] .prompt-filters button.active,
  :root[data-theme="dark"] .writing-library-filters button.active { color: #fff; border-color: #0a84ff; background: #0a84ff; }
  :root[data-theme="dark"] dialog { color: #f5f5f7; border-color: rgba(255,255,255,.14); background: #2c2c2e; box-shadow: 0 24px 58px rgba(0,0,0,.4); }
  :root[data-theme="dark"] dialog::backdrop { background: rgba(0,0,0,.55); }
  :root[data-theme="dark"] .dialog-heading { border-color: rgba(255,255,255,.09); background: #343437; }
  :root[data-theme="dark"] .dialog-actions button,
  :root[data-theme="dark"] .cloud-dialog button:not(.dialog-heading button) { color: #d5e9ff; border-color: rgba(255,255,255,.13); background: #3a3a3c; }
  :root[data-theme="dark"] .toast { background: #3a3a3c; box-shadow: 0 12px 32px rgba(0,0,0,.3); }
  :root[data-theme="dark"] .access-gate { background: #1c1c1e; background-image: none; }
  :root[data-theme="dark"] .access-card { color: #f5f5f7; border-color: rgba(255,255,255,.1); background: #2c2c2e; box-shadow: 0 14px 44px rgba(0,0,0,.22); }
  :root[data-theme="dark"] .access-form input { color: #f5f5f7; border-color: rgba(255,255,255,.13); background: #1f1f21; }
  :root[data-theme="dark"] .access-form input:focus { border-color: #0a84ff; box-shadow: 0 0 0 3px rgba(10,132,255,.14); }
  :root[data-theme="dark"] .site-compliance { color: #a5a5ad; background: transparent; }
}

@media (min-width: 600px) and (prefers-reduced-motion: reduce) {
  .voice-dock #holdToTalk.recording,
  .voice-dock #realtimeToggle.connecting { animation: none; }
}
