/* Final semantic palette. Page structure and responsive geometry stay in the
   existing feature styles; this file deliberately loads after those styles. */
:root {
  --bg-app: #FAFAFA;
  --bg-card: #FFFFFF;
  --border-color: #E5E7EB;
  --text-main: #111827;
  --text-muted: #6B7280;
  --accent-pink: #EC4899;
  --surface-raised: #F3F4F6;
  --surface-muted: #F9FAFB;
  --accent-readable: #BE185D;
  --accent-soft: #FDF2F8;
  --accent-border: #FBCFE8;
  --control-border: #D1D5DB;
  --text-secondary: #374151;
  --narrative-text: #7C425C;
  --card-shadow: 0 2px 10px rgba(17, 24, 39, .045);
  --card-hover-shadow: 0 7px 20px rgba(17, 24, 39, .085);
}
html[data-theme="dark"], .dark {
  --bg-app: #0C0B14;
  --bg-card: #18181C;
  --border-color: rgba(255, 255, 255, .08);
  --text-main: #F3F4F6;
  --text-muted: #9CA3AF;
  --surface-raised: #232329;
  --surface-muted: #121218;
  --accent-readable: #F9A8D4;
  --accent-soft: #30212C;
  --accent-border: #5F354B;
  --control-border: #484852;
  --text-secondary: #D1D5DB;
  --narrative-text: #D8B4C5;
  --card-shadow: 0 2px 12px rgba(0, 0, 0, .16);
  --card-hover-shadow: 0 8px 24px rgba(0, 0, 0, .24);
}
:root, html[data-theme="dark"], .dark {
  --bg-panel: var(--bg-card);
  --glass-card: var(--bg-card);
  --glass-solid: var(--bg-card);
  --glass-raised: var(--surface-raised);
  --border-subtle: var(--border-color);
  --border-glow: var(--accent-border);
  --brand-start: #BE185D;
  --brand-middle: #BE185D;
  --brand-end: #BE185D;
  --brand-primary: #BE185D;
  --brand-gradient: var(--brand-primary);
  --brand-hover: #9D174D;
  --text-sub: var(--text-muted);
  --text-placeholder: var(--text-muted);
  --text-narrative: var(--narrative-text);
  --focus-ring: var(--accent-pink);
  --shadow-brand: 0 2px 5px rgba(92, 45, 62, .1);
  --shadow-glow: var(--card-shadow);
  --shadow-surface: var(--card-hover-shadow);
  --glass-blur: 0px;
  --tavern-bg: var(--bg-app);
  --tavern-surface: var(--bg-card);
  --tavern-solid: var(--bg-card);
  --tavern-raised: var(--surface-raised);
  --tavern-border: var(--border-color);
  --tavern-primary: var(--accent-readable);
  --tavern-accent: var(--accent-pink);
  --tavern-secondary: var(--text-muted);
  --tavern-gradient: var(--brand-primary);
  --paper: var(--bg-app);
  --sidebar: var(--bg-card);
  --white: var(--bg-card);
  --surface: var(--bg-card);
  --panel: var(--bg-card);
  --ink: var(--text-main);
  --muted: var(--text-muted);
  --line: var(--border-color);
  --border: var(--border-color);
  --accent: var(--accent-readable);
  --accent-dark: var(--accent-readable);
  --wash: var(--accent-soft);
  --shadow: var(--card-hover-shadow);
  --theme-surface: var(--bg-card);
  --theme-muted-surface: var(--surface-muted);
  --theme-raised: var(--surface-raised);
  --theme-control-border: var(--control-border);
  --theme-border-strong: var(--control-border);
  --theme-text-secondary: var(--text-secondary);
  --theme-text-soft: var(--text-muted);
  --theme-accent: var(--accent-readable);
  --theme-accent-strong: var(--accent-readable);
  --theme-accent-bg: var(--accent-soft);
  --theme-accent-soft: var(--accent-soft);
  --theme-accent-border: var(--accent-border);
  --theme-accent-border-strong: var(--accent-border);
  --theme-narrative-bg: var(--surface-muted);
  --theme-narrative-border: var(--border-color);
  --theme-cover-bg: var(--surface-raised);
  --theme-on-brand: #FFFFFF;
  --theme-selection-text: var(--text-main);
  --theme-selection-bg: var(--accent-soft);
}
body { background-color: var(--bg-app); color: var(--text-main); }
::selection { background: var(--accent-border); color: var(--text-main); }
:is(:root, html[data-theme="dark"], .dark) :is(input, textarea, select):focus {
  border-color: var(--accent-pink); box-shadow: 0 0 0 3px rgba(236, 72, 153, .12);
}
:is(:root, html[data-theme="dark"], .dark) :is(button, a):focus-visible {
  outline-color: var(--accent-pink);
}
:is(:root, html[data-theme="dark"], .dark) .feed-card {
  background: var(--bg-card);
  border-color: var(--border-color);
  box-shadow: var(--card-shadow);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
:is(:root, html[data-theme="dark"], .dark) .feed-card-cover {
  aspect-ratio: 3 / 4;
  height: auto;
  align-self: flex-start;
  background: var(--surface-raised);
}
:is(:root, html[data-theme="dark"], .dark) .feed-card h3 { color: var(--text-main); }
:is(:root, html[data-theme="dark"], .dark) .feed-card-tags span {
  background: var(--accent-soft); color: var(--accent-readable); border-color: var(--accent-border);
}
:is(:root, html[data-theme="dark"], .dark) .feed-card-author { color: var(--text-muted); }
:is(:root, html[data-theme="dark"], .dark) .feed-card-details {
  background: var(--accent-soft); color: var(--accent-readable); border-color: var(--accent-border);
}
@media (hover: hover) and (pointer: fine) {
  :is(:root, html[data-theme="dark"], .dark) .feed-card:hover {
    transform: translateY(-2px); box-shadow: var(--card-hover-shadow); border-color: var(--accent-border);
  }
}
.tag-group-filter{display:inline-flex;align-items:center;gap:8px;min-width:0;max-width:100%;color:var(--text-muted);font-size:13px}.tag-group-filter select{width:auto;min-width:0;max-width:180px;padding:7px 10px;background:var(--bg-card);color:var(--text-main);border:1px solid var(--border-color);border-radius:9px}.pe-picker-toolbar{flex-wrap:wrap}.pe-picker-toolbar>.pe-search{min-width:0}.tag-group-filter select:focus-visible{outline:2px solid var(--accent-pink);outline-offset:2px}
@media (prefers-reduced-motion: reduce) {
  :is(:root, html[data-theme="dark"], .dark) .feed-card { transition: none; }
  :is(:root, html[data-theme="dark"], .dark) .feed-card:hover { transform: none; }
}
