/* A shared, browser-local appearance for Life Atelier and Story of Your Life. */
html[data-theme="dark"] {
  --paper:#171b1d;
  --ink:#f3eee6;
  --muted:#b8b5ae;
  --line:#475053;
  --accent:#e4a185;
  color-scheme:dark;
}
html[data-theme="dark"] body {background:var(--paper);color:var(--ink)}
html[data-theme="dark"] header {background:#1d2224;border-color:var(--line)}
html[data-theme="dark"] .brand small {color:var(--muted)}
html[data-theme="dark"] button:not(.mood-cell):not(.mood-neighbor):not(.mood-word-chip):not([data-mood-quadrant]),
html[data-theme="dark"] select,
html[data-theme="dark"] input:not([type="range"]),
html[data-theme="dark"] textarea,
html[data-theme="dark"] .control,
html[data-theme="dark"] .description-editor {
  color:var(--ink);border-color:var(--line);background-color:#252c2e;
}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder {color:#aaa9a3;opacity:1}
html[data-theme="dark"] button:not(.mood-cell):not(.mood-neighbor):not(.mood-word-chip):not([data-mood-quadrant]):hover {background-color:#353e40}
html[data-theme="dark"] button.primary,
html[data-theme="dark"] .kind-choices [aria-pressed="true"],
html[data-theme="dark"] .mood-switch [aria-pressed="true"],
html[data-theme="dark"] .header-actions button[aria-pressed="true"],
html[data-theme="dark"] .auth-switch button[aria-pressed="true"] {background-color:#e7b391;border-color:#e7b391;color:#1c2224}
html[data-theme="dark"] button:focus-visible,
html[data-theme="dark"] input:focus-visible,
html[data-theme="dark"] textarea:focus-visible,
html[data-theme="dark"] select:focus-visible,
html[data-theme="dark"] a:focus-visible {outline:2px solid:#f1bd91;outline-offset:3px}
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .auth-card,
html[data-theme="dark"] .guide-card,
html[data-theme="dark"] .guide-extra,
html[data-theme="dark"] .guide-editor-prompt,
html[data-theme="dark"] .settings-io,
html[data-theme="dark"] .drive-card,
html[data-theme="dark"] .reset-card,
html[data-theme="dark"] .account-card,
html[data-theme="dark"] .timeline-picker,
html[data-theme="dark"] .density-overview,
html[data-theme="dark"] .density-detail,
html[data-theme="dark"] .feeling-graphs,
html[data-theme="dark"] .media-preview-panel,
html[data-theme="dark"] .drag-ghost,
html[data-theme="dark"] .date-readout {background:#202628;color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] .account-delete,
html[data-theme="dark"] .timeline-delete-options {background:#392727;border-color:#814b47}
html[data-theme="dark"] .event-browser-toolbar select,
html[data-theme="dark"] .timeline-density-controls>#merge,
html[data-theme="dark"] .timeline-wrap>#merge {background:#252c2e;color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] .media-preview-panel blockquote {background:#292f31;color:var(--ink)}
html[data-theme="dark"] .description-editor strong[data-hashtag] {color:#f6ce9c}
html[data-theme="dark"] button.density-media-icon.feeling-hidden {color:#ef7881!important}
html[data-theme="dark"] button.density-media-icon.feeling-visible {color:#ef7881!important}
html[data-theme="dark"] .density-events button[data-density-event]:hover,
html[data-theme="dark"] .event-list-open:hover,
html[data-theme="dark"] .guide-existing button:hover,
html[data-theme="dark"] .guide-feeling-list button:hover {background:#30383a}
html[data-theme="dark"] .collapsed-strip {background:#343b3e}
html[data-theme="dark"] .media-web-frame {background:#252c2e;border-color:var(--line)}
html[data-theme="dark"] .audio-waveform {background:#3e3030}
html[data-theme="dark"] .mood-cell:not(.then-mark):not(.now-mark) {color:#1e2729}
html[data-theme="dark"] .mood-cell.then-mark,
html[data-theme="dark"] .mood-cell.now-mark {background:#ede9df!important;color:#1d2224}
html[data-theme="dark"] .soyl-mood .mood-instrument,
html[data-theme="dark"] .soyl-mood .mood-vocabulary {background:#202628;border-color:var(--line)}
html[data-theme="dark"] .soyl-mood .mood-words {border-color:var(--line)}
html[data-theme="dark"] .soyl-mood .mood-words button:not([aria-pressed="true"]) {background:#2b3335;border-color:var(--line);color:var(--ink)}
html[data-theme="dark"] .soyl-mood .mood-words button[aria-pressed="true"] {background:#e7b391;border-color:#e7b391;color:#1c2224}
html[data-theme="dark"] .soyl-mood .mood-neighbor.center {background:#ede9df;color:#202628}
html[data-theme="dark"] .soyl-mood .mood-neighbor[data-quadrant] {color:#202628}
html[data-theme="dark"] .soyl-mood .mood-neighbor:disabled:not(.center) {background:transparent;color:var(--muted)}
html[data-theme="dark"] .soyl-mood .mood-quadrants button {color:#202628}
html[data-theme="dark"] .soyl-mood .mood-quadrants [aria-pressed=true] {box-shadow:0 0 0 2px #202628,0 0 0 3px #e7b391}
html[data-theme="dark"] .atelier-home {background:radial-gradient(ellipse at 8% 14%,#523b37 0,transparent 38%),radial-gradient(ellipse at 92% 14%,#304b49 0,transparent 35%),radial-gradient(ellipse at 76% 90%,#443b50 0,transparent 39%),linear-gradient(130deg,#252627,#1d2325 58%,#24272a)}
html[data-theme="dark"] .atelier-home h1 {color:var(--ink);text-shadow:0 1px #0008}
html[data-theme="dark"] .atelier-home .atelier-eyebrow {color:#e2a686}
html[data-theme="dark"] .atelier-home .atelier-intro {color:var(--muted)}
html[data-theme="dark"] .atelier-app-card#open-story.atelier-story-hero,
html[data-theme="dark"] .atelier-app-card#open-story.atelier-story-hero:hover {background:radial-gradient(ellipse at 76% 48%,#5e483b 0,transparent 58%),linear-gradient(130deg,#343235,#2c3334);border-color:#966f60;box-shadow:0 24px 60px #0005,0 3px 7px #0003;color:var(--ink)}
html[data-theme="dark"] .atelier-story-hero .atelier-hero-copy>span:not(.atelier-app-mark,.atelier-eyebrow,.atelier-app-action) {color:#d1cbc2}
html[data-theme="dark"] .atelier-story-hero .atelier-hero-copy .atelier-app-action {background:#b79aaa;color:#201b22}
html[data-theme="dark"] .atelier-tool-card {border-color:#5b5553;box-shadow:0 9px 25px #0003}
html[data-theme="dark"] .atelier-tool-writing {background:linear-gradient(145deg,#423733,#302e2d)}
html[data-theme="dark"] .atelier-tool-memory {background:linear-gradient(145deg,#304449,#2c3435)}
html[data-theme="dark"] .atelier-tool-play {background:linear-gradient(145deg,#443849,#342f36)}
html[data-theme="dark"] .atelier-tool-card h3 {color:var(--ink)}
html[data-theme="dark"] .atelier-tool-card p {color:#cfcbc3}
html[data-theme="dark"] .atelier-tool-status {color:#e6d3b9;background:#343234;border-color:#796b5e}
html[data-theme="dark"] .atelier-app-card .atelier-app-action {color:#f2b494}
html[data-theme="dark"] .atelier-account-panel .account-card {background:#292f31}
html[data-theme="dark"] .atelier-account-panel .account-delete {background:#392727}
html[data-theme="dark"] .appearance-settings {margin:18px 0;padding:16px;border:1px solid var(--line);border-radius:9px;background:#292f31}
html[data-theme="dark"] .appearance-settings h3 {color:var(--ink)}
html:not([data-theme="dark"]) .appearance-settings {margin:18px 0;padding:16px;border:1px solid var(--line);border-radius:9px;background:#fafaf7}
html .appearance-settings select {display:block;width:100%;margin-top:6px;padding:10px 12px;border:1px solid var(--line);border-radius:6px;font:inherit}
html:not([data-theme="dark"]) .appearance-settings select {background:#fff;color:var(--ink)}
html[data-theme="dark"] #timeline text,
html[data-theme="dark"] #density-overview-svg text {fill:#d8d6d0}
html[data-theme="dark"] #timeline pattern[id^="future-"] path {stroke:#8b9492;stroke-opacity:.16}
html[data-theme="dark"] #timeline .media-density-count,
html[data-theme="dark"] #density-overview-svg .media-density-count {fill:#fff}

html[data-theme="dark"] .toast {background:#353b3d;color:var(--ink);border:1px solid var(--line);box-shadow:0 5px 22px #0006}
html[data-theme="dark"] .toast button {color:var(--ink)}
html[data-theme="dark"] .soyl-mood .mood-scale span:before {background:#202628}
html[data-theme="dark"] .soyl-mood .mood-scale span {color:#d9d1c4}
html[data-theme="dark"] .soyl-mood .mood-word-chip.dial-match:not([aria-pressed=true]),
html[data-theme="dark"] .soyl-mood .mood-word-chip[aria-pressed=true] {background:#f1eee7;color:#202628}
html[data-theme="dark"] button.primary,
html[data-theme="dark"] .kind-choices button[aria-pressed="true"],
html[data-theme="dark"] .mood-switch button[aria-pressed="true"],
html[data-theme="dark"] .header-actions button[aria-pressed="true"],
html[data-theme="dark"] .feelings-toggle[aria-pressed="true"],
html[data-theme="dark"] .auth-switch button[aria-pressed="true"] {background:#e7b391!important;border-color:#e7b391!important;color:#1c2224!important}
html[data-theme="dark"] .density-events .feeling-line-toggle[aria-pressed="true"] {background:#e7b391;border-color:#e7b391;color:#1c2224}

/* Story actions retain their meaning without the generic beige accent. */
html[data-theme="dark"] #profile:has(#cancel) button.primary,
html[data-theme="dark"] .guide-actions button[data-guide-add] {
  background:#327054!important;border-color:#327054!important;color:#fff!important;
}
html[data-theme="dark"] #profile:has(#cancel) button.primary:hover,
html[data-theme="dark"] .guide-actions button[data-guide-add]:hover {
  background:#3c8061!important;border-color:#3c8061!important;color:#fff!important;
}
html[data-theme="dark"] .kind-choices button[aria-pressed="true"],
html[data-theme="dark"] .mood-switch button[aria-pressed="true"] {
  background:#f8f7f3!important;border-color:#f8f7f3!important;color:#1c2224!important;
}
html[data-theme="dark"] .kind-choices button[aria-pressed="true"]:hover,
html[data-theme="dark"] .mood-switch button[aria-pressed="true"]:hover {
  background:#f8f7f3!important;
}
html[data-theme="dark"] .search-result:hover,
html[data-theme="dark"] .search-result button:hover {
  background:transparent!important;
}

/* Let title controls blend into the page while keeping their text and focus affordances. */
html[data-theme="dark"] .search-result-open,
html[data-theme="dark"] .search-result-arrow,
html[data-theme="dark"] .density-events button[data-density-event],
html[data-theme="dark"] .event-list-open {background:transparent!important}
html[data-theme="dark"] .search-result-open:hover,
html[data-theme="dark"] .search-result-arrow:hover,
html[data-theme="dark"] .density-events button[data-density-event]:hover,
html[data-theme="dark"] .event-list-open:hover {background:transparent!important}
html[data-theme="dark"] .feelings-toggle,
html[data-theme="dark"] .feelings-toggle[aria-pressed="true"] {color:#ef7881!important}

html[data-theme="dark"] #timeline .event.is-selected .event-title-label text {fill:#f1ac91;font-weight:700}

html[data-theme="dark"] button.feeling-empty-action {background:#f8f7f3!important;border-color:#d2d0c8!important;color:#1c2224!important}
html[data-theme="dark"] button.feeling-empty-action:hover {background:#eceae4!important;border-color:#d2d0c8!important;color:#1c2224!important}

html[data-theme="dark"] .header-identity .atelier-account-trigger,
html[data-theme="dark"] .header-identity .atelier-trash-trigger {color:var(--ink)}
html[data-theme="dark"] .header-identity .atelier-account-trigger:hover,
html[data-theme="dark"] .header-identity .atelier-trash-trigger:hover {background:#353b3d}
