/* Appearance only: layout and content storage are independent of these tokens. */
:root { --page: #f7f5f0; color-scheme: light; }
body { background: var(--page); }
.brand { font-size: 21px; gap: 8px; padding-inline: 0; align-items: center; }
.appearance-settings { margin-bottom: 24px; }
.appearance-control { display: grid; gap: 8px; max-width: 28rem; min-width: 0; }
.appearance-control select { width: 100%; max-width: 100%; font-size: 16px; min-height: 48px; appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 19px) 50%, calc(100% - 13px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
[data-theme-status]:empty { display: none; }
.schedule-group-label { margin: 20px 0 10px; font-size: 12px; color: var(--muted); }
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #141414;
  --paper: #232323;
  --surface: #232323;
  --ink: #f5f3ee;
  --muted: #bdb9b1;
  --line: #50504c;
  --accent: #e58200;
  --accent-light: #3c2c19;
  --green: #afcfb4;
  color: var(--ink);
  background: var(--page);
}
:root[data-theme="dark"] :is(h1,h2,h3,.brand,.card-title,.idea-card .card-title,.day .card-title,.field,[name="title"],.capture input,summary,.calendar-drag-ghost) { color: var(--ink); }
:root[data-theme="dark"] :is(.muted,.helper,.brand small,.nav-item,.owner small,.workspace-label,.save-group,.eyebrow,.page-heading p,.search,.toolbar select,.results,.count,.column h2,.card-meta,.topic,.format,.demo,.next,.next>span,.date,.mini-select,.column-empty,.page-footer,.page-footer span,.empty p,.idea-notes,.tags,.idea-bottom>span,.day h3,.day h3 span,.day-empty,.day-add,.batch-intro,.batch-intro>span,.batch-number,.settings-card p,.close,summary>span,.caption-meta,.editor-footer>span,.history-row small,.history-row p,.card-step.is-complete span,.lineage-badge,.result-metrics dt) { color: var(--muted); }
:root[data-theme="dark"] :is(.sidebar,.column,.day,.batch-section,.empty,.capture,.next-action-panel,.next-steps-panel) { background: #1c1c1c; border-color: var(--line); }
:root[data-theme="dark"] :is(dialog,.editor-top,.editor-footer,.login-panel,.result-card,.calendar-drag-ghost,.skip) { background: var(--paper); border-color: var(--line); }
:root[data-theme="dark"] :is(.search,.nav-item.active,.nav-item small,.count,.format,.tags>span,.avatar,.local-badge,.close) { background: #333330; border-color: var(--line); }
:root[data-theme="dark"] :is(.nav-item.active,.avatar,.brand-icon) { color: var(--ink); }
:root[data-theme="dark"] :is(button,.button,input,textarea,select,.results-toolbar select,.field input,.field textarea,.field select) { background-color: var(--paper); color: var(--ink); border-color: #77766e; }
:root[data-theme="dark"] :is(input,textarea)::placeholder { color: #b1ada5; opacity: 1; }
:root[data-theme="dark"] :is(input,textarea,select) { accent-color: var(--accent); }
:root[data-theme="dark"] input:-webkit-autofill { -webkit-text-fill-color: var(--ink); box-shadow: 0 0 0 100px var(--paper) inset; }
:root[data-theme="dark"] :is(button,.button):hover { background-color: #383834; border-color: #a29b8c; }
:root[data-theme="dark"] :is(button.primary,.button.primary) { background: var(--accent); color: #141414; border-color: var(--accent); }
:root[data-theme="dark"] :is(button.primary,.button.primary):hover { background: #f29b2c; border-color: #f29b2c; }
:root[data-theme="dark"] :is(.card-title,.text-button,.nav-item,.day-add,.capture input) { background: transparent; }
:root[data-theme="dark"] :is(.card-title:hover,.text-button,.asset-links a,.date.overdue,.day.today h3 span) { color: #ffb45c; }
:root[data-theme="dark"] :is(.post-card,.card-footer,.owner,.page-footer,.idea-bottom,.history-row,details,.brand-icon,.demo,#week-balance) { border-color: var(--line); }
:root[data-theme="dark"] :is(.day.today,.calendar-drop-target,.funnel-tag) { background: #382a19; border-color: var(--accent); color: #ffd19a; }
:root[data-theme="dark"] :is(.save-alert,#offline,.public-demo-banner,.demo-note) { background: #3a2a1c; color: #ffdcad; border-color: #a5733c; }
:root[data-theme="dark"] :is(.error,.field-error,#login-state) { color: #ffb4a8 !important; }
:root[data-theme="dark"] .refresh-spinner { border-color: #66645e; border-top-color: var(--accent); }
:root[data-theme="dark"] dialog::backdrop { background: #000b; }
:root[data-theme="dark"] #toast { background: #3b3b37; color: var(--ink); border: 1px solid #77766e; }
:root[data-theme="dark"] :focus-visible { outline-color: #ffb45c; }
:root[data-theme="dark"] button:disabled { opacity: .6; }
:root[data-theme="dark"] ::selection { background: #e58200; color: #141414; }

:root[data-theme="dark"] #balance-mode { background-color: var(--paper); color: var(--ink); border-color: #77766e; }

/* Titles remain text links; keep the existing hover text and focus-visible ring. */
:root[data-theme] button.card-title:hover { background: transparent; }

/* Publication is explicit status, never inferred from preparation checkboxes. */
:root { --published-surface: #edf6ee; --published-border: #67866e; --published-label: #245a35; --published-badge: #d8ecdd; }
:root[data-theme="dark"] { --published-surface: #1d3025; --published-border: #6a9476; --published-label: #c4efd0; --published-badge: #294b35; }
:root :is(.post-card,.result-card).is-published { background: var(--published-surface); border-color: var(--published-border); }
:root .published-badge { display: inline-block; border-radius: 6px; background: var(--published-badge); color: var(--published-label); padding: 4px 8px; font-size: 12px; font-weight: 700; line-height: 1.5; }
.publication-prompt { margin-block: 12px; min-width: 0; }
.publication-prompt p { font-size: 12px; line-height: 1.5; margin: 0 0 8px; }
.publication-prompt button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; min-height: 44px; }

/* Phone navigation uses the selected tab fill, without button outlines. */
@media (max-width: 760px),
  (max-width: 1100px) and (hover: none) and (pointer: coarse) {
  :root[data-theme="dark"] .sidebar .nav-item,
  :root[data-theme="dark"] .sidebar .nav-item:hover {
    border-color: transparent;
    box-shadow: none;
  }
}
