/* Account themes are visual only. No stored theme from a previous session. */
:root[data-theme] {
  color: var(--ink);
  background: var(--page);
  --green: var(--accent);
  --cream: var(--soft);
}
:root[data-theme="rein"] {
  color-scheme: dark;
  --page: #09121e;
  --ink: #e4edf7;
  --muted: #a1b3ca;
  --line: #28394e;
  --surface: #111f31;
  --soft: #1b3044;
  --accent: #77e3e0;
  --on-accent: #092c34;
  --sidebar: #07111c;
  --sidebar-ink: #b9cadc;
  --sidebar-active: #19394b;
  --focus: #88eae3;
  --hero-bg: radial-gradient(ellipse at 95% 45%, #153a4b 0, transparent 58%), #0d2134;
  --hero-ink: #edf8ff;
  --hero-muted: #adcadb;
  --hero-line: #28475c;
  --stat-bg: #164757;
  --stat-ink: #ecffff;
  --stat-muted: #c0e1e8;
  --notice-bg: #142f3a;
  --notice-ink: #b7e2dd;
  --warning-bg: #352b1d;
  --warning-ink: #f2d39c;
  --danger-bg: #41272d;
  --danger-ink: #ffb2a8;
  --income-ink: #bbf7d0;
}
:root[data-theme="rima"] {
  color-scheme: light;
  --page: #fff8fa;
  --ink: #493346;
  --muted: #7c6477;
  --line: #eadce5;
  --surface: #fffefe;
  --soft: #f7eaf0;
  --accent: #8d4569;
  --on-accent: #fff;
  --sidebar: #4f3047;
  --sidebar-ink: #e8cedd;
  --sidebar-active: #75415e;
  --focus: #a75883;
  --hero-bg: linear-gradient(110deg, #f9eaf0 0%, #f8edf6 55%, #fff0e5 100%);
  --hero-ink: #603750;
  --hero-muted: #7b5a70;
  --hero-line: #e9d2df;
  --stat-bg: #85415f;
  --stat-ink: #fff8fc;
  --stat-muted: #f5dbe8;
  --notice-bg: #f7edf2;
  --notice-ink: #745065;
  --warning-bg: #fff2dc;
  --warning-ink: #805817;
  --danger-bg: #fff0eb;
  --danger-ink: #9b3d2d;
}
:root[data-theme="reiko"] {
  color-scheme: light;
  --page: #f5f3fc;
  --ink: #302847;
  --muted: #706783;
  --line: #e0daed;
  --surface: #fff;
  --soft: #eee8fa;
  --accent: #6440bd;
  --on-accent: #fff;
  --sidebar: #27203f;
  --sidebar-ink: #d4c9ef;
  --sidebar-active: #554083;
  --focus: #7652d0;
  --hero-bg: linear-gradient(120deg, #ece5ff 0%, #e9e2ff 70%, #ddd3fa 100%);
  --hero-ink: #35235e;
  --hero-muted: #65517e;
  --hero-line: #daceef;
  --stat-bg: #5a36a8;
  --stat-ink: #fff;
  --stat-muted: #e4d8ff;
  --notice-bg: #ece8f7;
  --notice-ink: #61517d;
  --warning-bg: #fff2dc;
  --warning-ink: #805817;
  --danger-bg: #fff0eb;
  --danger-ink: #9b3d2d;
}
:root[data-theme="rafael"] {
  color-scheme: light;
  --page: #fffbee;
  --ink: #493a27;
  --muted: #7b6b52;
  --line: #eadfc4;
  --surface: #fffefa;
  --soft: #fff0c8;
  --accent: #8a5c12;
  --on-accent: #fff;
  --sidebar: #443423;
  --sidebar-ink: #eeddbe;
  --sidebar-active: #73572d;
  --focus: #a27312;
  --hero-bg: linear-gradient(120deg, #fff0bb 0%, #fff5d6 65%, #ffe7a7 100%);
  --hero-ink: #644313;
  --hero-muted: #7b5c2e;
  --hero-line: #edda9e;
  --stat-bg: #735317;
  --stat-ink: #fffdf3;
  --stat-muted: #f4e4b8;
  --notice-bg: #fff1d3;
  --notice-ink: #766037;
  --warning-bg: #fff0db;
  --warning-ink: #8a501d;
  --danger-bg: #fff0eb;
  --danger-ink: #9b3d2d;
}

[data-theme] button,
[data-theme] a.button {
  color: var(--on-accent);
}
[data-theme] :is(button, a, input, select, textarea):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
[data-theme] :is(input, select, textarea) {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
[data-theme] input::placeholder,
[data-theme] textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
[data-theme] input[type="checkbox"] {
  accent-color: var(--accent);
}
[data-theme] button.secondary,
[data-theme] dialog .close {
  background: var(--soft);
  color: var(--accent);
}
[data-theme] button.danger {
  background: var(--danger-bg);
  color: var(--danger-ink);
}
[data-theme] button.ghost {
  color: var(--muted);
}
[data-theme] .eyebrow {
  color: var(--accent);
}
[data-theme] .sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  color: #fff;
}
[data-theme] .sidebar :is(nav button, .foot, .brand span) {
  color: var(--sidebar-ink);
}
[data-theme] .sidebar nav button.active {
  background: var(--sidebar-active);
  color: #fff;
  box-shadow: inset 3px 0 var(--hero-line);
}
[data-theme] .topbar .badge,
[data-theme] .checks label,
[data-theme] .pill {
  background: var(--soft);
  color: var(--accent);
}
[data-theme] :is(.card, .stat, dialog) {
  background: var(--surface);
  color: var(--ink);
}
[data-theme] .stat.hero {
  background: var(--stat-bg);
  border-color: var(--stat-bg);
  color: var(--stat-ink);
}
[data-theme] .stat.hero small {
  color: var(--stat-muted);
}
[data-theme] .stat p {
  opacity: 1;
  color: var(--muted);
  line-height: 1.5;
}
[data-theme] .stat.hero p {
  color: var(--stat-muted);
}
[data-theme] .notice {
  background: var(--notice-bg);
  color: var(--notice-ink);
}
[data-theme] .notice.warning {
  background: var(--warning-bg);
  color: var(--warning-ink);
}
[data-theme] .tx {
  color: var(--ink);
  border-color: var(--line);
}
[data-theme] .tx .icon {
  background: var(--soft);
  color: var(--accent);
}
[data-theme] .photo img {
  background: var(--soft);
}
[data-theme] #test-banner {
  color: #503807;
}
[data-theme] #toast {
  background: var(--sidebar);
  color: #fff;
  border: 1px solid var(--line);
}
[data-theme] dialog::backdrop {
  background: #101425b8;
}
[data-theme] .welcome {
  text-transform: uppercase;
}
.personal-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(170px, .8fr);
  align-items: center;
  min-height: 270px;
  margin-bottom: 32px;
  padding: 30px 36px;
  border-radius: 24px;
  border: 1px solid var(--hero-line);
  background: var(--hero-bg);
  color: var(--hero-ink);
  overflow: hidden;
}
.hero-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}
.hero-label {
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1.5px;
  color: var(--hero-muted);
  margin-bottom: 18px;
}
.personal-hero h2 {
  max-width: 410px;
  font-size: clamp(27px, 2.8vw, 38px);
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.15;
  text-wrap: balance;
}
.hero-description {
  max-width: 360px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--hero-muted);
  margin-top: 14px;
}
.hero-note {
  display: inline-block;
  margin-top: 24px;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 1.3px;
  padding: 8px 10px;
  border: 1px solid var(--hero-line);
  border-radius: 7px;
}
.hero-art {
  display: block;
  width: 100%;
  height: auto;
  max-width: 320px;
  justify-self: center;
}
[data-theme="rein"] :is(.hero-label, .hero-note, .eyebrow) {
  font-family: ui-monospace, Consolas, monospace;
}
[data-theme="rein"] .personal-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(#7ce7e808 1px, transparent 1px), linear-gradient(90deg, #7ce7e808 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}
[data-theme="rein"] h1,
[data-theme="reiko"] h1,
[data-theme="rafael"] h1 {
  font-family: inherit;
  font-weight: 700;
  letter-spacing: -1.2px;
}
[data-theme="rima"] .personal-hero h2 {
  font-family: Georgia, serif;
  font-weight: 500;
  font-size: clamp(30px, 3vw, 41px);
}
[data-theme="reiko"] .hero-note {
  background: #dfff83;
  color: #35235e;
  border-color: #cfde90;
  transform: rotate(-2deg);
}
[data-theme="rafael"] .hero-note {
  background: #fff8e2;
  border-radius: 30px;
}

@media (max-width: 1000px) {
  .personal-hero {
    padding: 25px;
    grid-template-columns: minmax(0, 1.2fr) minmax(150px, .8fr);
  }
  .hero-label {
    letter-spacing: 1px;
  }
}
@media (max-width: 680px) {
  .personal-hero {
    grid-template-columns: minmax(0, 1fr) 118px;
    gap: 0;
    min-height: 240px;
    margin-bottom: 26px;
    padding: 23px 18px;
    border-radius: 19px;
  }
  .personal-hero h2,
  [data-theme="rima"] .personal-hero h2 {
    font-size: 26px;
    letter-spacing: -.7px;
  }
  .hero-label {
    font-size: 11px;
    letter-spacing: .8px;
    line-height: 1.7;
    margin-bottom: 12px;
  }
  .hero-description {
    font-size: 14px;
    line-height: 1.65;
  }
  .hero-note {
    font-size: 11px;
    line-height: 1.5;
    letter-spacing: .6px;
    padding: 6px 7px;
    margin-top: 16px;
  }
  .hero-art {
    width: 156px;
    max-width: none;
    margin-left: -5px;
  }
  [data-theme] .sidebar {
    border-right: 0;
    border-top: 1px solid var(--line);
  }
  [data-theme] .sidebar nav button.active {
    box-shadow: inset 0 2px var(--hero-line);
  }
  [data-theme] .topbar {
    gap: 8px;
  }
  [data-theme] .topbar .badge {
    font-size: 11px;
    padding: 6px 8px;
  }
  [data-theme] .pagehead h1 {
    font-size: 26px;
  }
}
@media screen and (max-width: 430px) {
  .personal-hero {
    display: block;
    min-height: 0;
    padding: 20px;
  }
  .personal-hero h2 { overflow-wrap: anywhere; }
  .hero-note { overflow-wrap: anywhere; }
  .hero-art {
    display: block;
    width: min(160px, 100%);
    max-width: 100%;
    height: 120px;
    object-fit: contain;
    margin: 12px auto 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  [data-theme] *,
  [data-theme] *::before,
  [data-theme] *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media print {
  :root[data-theme] {
    color-scheme: light;
    color: #000;
    background: #fff;
  }
  .personal-hero,
  .mobilebrand {
    display: none !important;
  }
  [data-theme] :is(.card, .stat, .stat.hero, .notice, .pill, .tx .icon) {
    background: #fff;
    color: #000;
    border-color: #aaa;
    box-shadow: none;
  }
  [data-theme] :is(h1, h2, h3, p, small, strong, .muted, .empty, .eyebrow, .tx, .stat.hero small, .stat.hero p) {
    color: #000;
  }
}
