:root {
  color-scheme: light;
  --color-primary: #6C4DFF;
  --color-primary-dark: #4B0FD6;
  --color-secondary: #16D9C5;
  --color-text: #101A40;
  --color-background: #FFFFFF;
  --color-surface: #F3F0FF;
  --bg: var(--color-background);
  --surface: var(--color-background);
  --subtle: #faf9ff;
  --text: var(--color-text);
  --muted: #555c78;
  --line: #e7e2f5;
  --accent: var(--color-primary-dark);
  --lavender: var(--color-surface);
  --blue: #e8efff;
  --blue-text: #3155ac;
  --mint: color-mix(in srgb, var(--color-secondary) 15%, white);
  --mint-text: #075e56;
  --danger: #aa344e;
  --shadow: 0 4px 16px #101a400a;
  font-family: "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;
  font-size: 100%;
}
:root[data-theme=dark] {
  color-scheme: dark;
  --bg: #111730;
  --surface: #1b2240;
  --subtle: #222a49;
  --text: #f6f2ff;
  --muted: #c2bad4;
  --line: #343e65;
  --accent: #c1b0ff;
  --lavender: #36275f;
  --blue: #26365f;
  --blue-text: #b5c9ff;
  --mint: #153d42;
  --mint-text: #9aeee1;
  --danger: #ff9bb1;
  --shadow: 0 4px 13px #0a071424;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--accent); text-underline-offset: .22em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 3px; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
small { font-size: .825rem; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.skip:focus { position: fixed; z-index: 5; top: 12px; left: 12px; padding: 10px; background: var(--surface); }
.shell { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); padding: 27px 17px 19px; }
.brand { display: block; width: min(100%, 204px); margin: 0 0 34px; padding: 5px 3px; border-radius: 8px; background: var(--color-background); }
.brand img { display: block; width: 100%; height: auto; border-radius: 4px; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; min-height: 49px; padding: 9px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: .94rem; font-weight: 600; }
.sidebar nav a:hover { background: var(--subtle); color: var(--text); }
.sidebar nav a[aria-current] { background: var(--lavender); color: var(--accent); }
.profile { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding: 17px 7px 3px; margin-top: auto; min-width: 0; }
.profile div { min-width: 0; }
.profile strong, .profile small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile strong { font-size: .9rem; }
.profile small { color: var(--muted); }
.avatar { display: grid; place-items: center; flex: 0 0 38px; height: 38px; border-radius: 50%; background: var(--lavender); color: var(--accent); font-weight: 700; }
.icon { width: 19px; height: 19px; display: block; flex: none; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--surface); border-bottom: 1px solid var(--line); padding: 13px clamp(20px, 3.1vw, 52px); min-height: 72px; }
.topbar > span { font-weight: 680; }
main { width: min(100%, 1510px); margin: auto; padding: 30px clamp(20px, 3.1vw, 52px) 48px; }
main:focus, #dialog-title:focus { outline: none; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 9px 15px; min-height: 42px; line-height: 1.3; font-weight: 680; font-size: .9rem; background: transparent; text-align: center; transition: background-color .18s, color .18s, border-color .18s; }
.primary { background: var(--color-primary); color: var(--color-background); }
.primary:hover { background: var(--color-primary-dark); }
.secondary { border-color: var(--line); background: var(--surface); }
.secondary:hover, .text-button:hover, .icon-button:hover { background: var(--subtle); }
.soft { background: var(--lavender); color: var(--accent); }
.soft:hover { border-color: var(--accent); }
.danger-outline { border-color: var(--line); color: var(--danger); }
.danger-outline:hover { border-color: var(--danger); }
.text-button { color: var(--accent); }
.hero { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; min-height: 255px; border-radius: 21px; background: radial-gradient(ellipse at 85% 85%, #6c4dff45 0%, transparent 56%), linear-gradient(115deg, var(--color-text), #211453 68%, #26166a); color: var(--color-background); }
.hero-content { z-index: 1; padding: clamp(26px, 4vw, 53px); max-width: 69%; }
.hero h1, .page-heading h1 { font-weight: 750; font-size: clamp(2rem, 3vw, 3.15rem); line-height: 1.12; letter-spacing: -.055em; overflow-wrap: anywhere; }
.hero p { margin: 12px 0 21px; max-width: 440px; color: var(--color-surface); font-size: 1rem; }
.hero-button { background: var(--color-background); color: var(--color-primary-dark); }
.hero-button:hover { background: var(--color-surface); }
.hero-art { position: absolute; display: grid; place-items: center; width: 32%; height: 100%; top: 0; right: 2%; pointer-events: none; }
.hero-art img { display: block; width: min(84%, 218px); height: auto; filter: drop-shadow(0 0 20px #a08aff56); }
.section { margin-top: 25px; }
.section-head, .panel-head, .results-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.section-head { margin-bottom: 13px; }
.panel-head { margin-bottom: 10px; }
.panel-head a { font-size: .9rem; font-weight: 650; }
h2 { font-size: 1.18rem; font-weight: 740; letter-spacing: -.025em; line-height: 1.35; }
.demo-label { font-size: .8rem; font-weight: 650; color: var(--muted); border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 10px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.metric, .panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; padding: 20px; box-shadow: var(--shadow); }
.metric-head { display: flex; gap: 9px; align-items: center; color: var(--muted); font-size: .875rem; font-weight: 650; line-height: 1.25; }
.tile { display: inline-grid; place-items: center; flex: none; width: 39px; height: 39px; border-radius: 11px; color: var(--accent); background: var(--lavender); }
.tile.blue, .category-0, .category-5 { background: var(--blue); color: var(--blue-text); }
.tile.mint, .category-4, .category-6 { background: var(--mint); color: var(--mint-text); }
.metric > strong { display: block; margin: 9px 0 1px; font-size: clamp(1.3rem, 2vw, 1.85rem); font-weight: 760; letter-spacing: -.05em; overflow-wrap: anywhere; }
.metric small { display: block; color: var(--muted); line-height: 1.35; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 15px; }
.purchase-list > li + li, .activity > li + li { border-top: 1px solid var(--line); }
.purchase-row { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 12px 4px; text-align: left; background: transparent; border: 0; border-radius: 8px; }
.purchase-row:hover { background: var(--subtle); }
.row-name { min-width: 0; overflow-wrap: anywhere; }
.row-name strong { display: block; font-size: .94rem; }
.row-name small, .activity small { display: block; color: var(--muted); }
.row-price { font-size: .95rem; font-weight: 700; white-space: nowrap; }
.badge, .example { display: inline-block; border-radius: 999px; font-weight: 650; white-space: nowrap; }
.badge { padding: 4px 9px; font-size: .78rem; color: var(--accent); background: var(--lavender); }
.badge.status-1, .badge.status-2 { color: var(--blue-text); background: var(--blue); }
.badge.status-3, .badge.status-4 { color: var(--mint-text); background: var(--mint); }
.example { color: var(--muted); font-size: .76rem; font-weight: 550; margin-left: 4px; }
.meter { display: flex; gap: 3px; height: 13px; overflow: hidden; border-radius: 20px; margin: 17px 0 12px; }
.meter > div { flex-basis: 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; }
.meter .violet, .dot.violet, .category-track i { background: var(--color-primary); }
.meter .blue, .dot.blue { background: #6385de; }
.meter .mint, .dot.mint { background: var(--color-secondary); }
.legend { display: grid; gap: 8px; }
.legend li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; color: var(--muted); font-size: .9rem; }
.legend strong { color: var(--text); }
.activity li { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 9px 3px; }
.activity strong { overflow-wrap: anywhere; font-size: .94rem; }
.page-heading { margin: 10px 0 27px; }
.page-heading p, .muted { color: var(--muted); margin-top: 8px; }
.metric-note { color: var(--muted); font-size: .9rem; margin-top: 12px; }
.insights-grid, .settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.category-list { display: grid; gap: 10px; margin-top: 12px; }
.category-list li > div:first-child { display: flex; align-items: center; justify-content: space-between; font-size: .9rem; }
.category-track { height: 6px; border-radius: 10px; background: var(--lavender); overflow: hidden; margin-top: 4px; }
.category-track i { display: block; height: 100%; }
.settings-form, .settings-actions { margin-top: 16px; }
.settings-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.filters { display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0,1fr)); gap: 9px; }
.filters label { min-width: 0; }
.search { display: flex; align-items: center; position: relative; }
.search .icon { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 39px; }
input, select, textarea { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; min-height: 43px; background: var(--subtle); font-size: 1rem; }
select { appearance: none; padding-right: 29px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238273a1' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
textarea { resize: vertical; }
.results-head { margin: 17px 0 4px; min-height: 29px; font-size: .9rem; color: var(--muted); }
.empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 25px 10px; }
.empty p { color: var(--muted); }
.notice:empty { display: none; }
.notice { margin: 16px 24px 0; color: var(--danger); }
.toast { visibility: hidden; opacity: 0; position: fixed; z-index: 2; bottom: 20px; right: 20px; padding: 12px 17px; background: var(--text); color: var(--surface); border-radius: 10px; max-width: calc(100% - 40px); transition: opacity .2s; }
.toast.visible { visibility: visible; opacity: 1; }
dialog { width: min(660px, calc(100% - 28px)); max-height: calc(100dvh - 34px); padding: 0; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 25px 100px #160a4660; }
dialog::backdrop { background: #1b103c91; }
.dialog-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; gap: 14px; align-items: start; padding: 20px 23px 15px; border-bottom: 1px solid var(--line); background: var(--surface); }
.dialog-head h2 { font-size: 1.5rem; overflow-wrap: anywhere; }
.dialog-head p { color: var(--muted); font-size: .9rem; margin-top: 4px; overflow-wrap: anywhere; }
.icon-button { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 9px; background: transparent; }
.dialog-body { padding: 19px 23px 23px; }
.field { display: grid; gap: 5px; align-content: start; margin-bottom: 12px; }
.field > span { font-size: .9rem; font-weight: 650; }
.field > span > span { color: var(--accent); }
.form-grid, .compare { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 12px; }
.form-actions, .detail-top, .detail-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.form-actions { justify-content: flex-end; margin-top: 15px; }
.detail-tools { margin: 14px 0; }
.form-error { color: var(--danger); font-weight: 650; grid-column: 1 / -1; }
.status-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 5px 10px; background: var(--subtle); padding: 10px; border-radius: 9px; }
.status-form .field { margin: 0; }
.detail-section { margin-top: 17px; padding-top: 15px; border-top: 1px solid var(--line); }
.detail-section h3 { font-size: 1.05rem; }
.details { margin: 7px 0 0; display: grid; gap: 8px; }
.details div { display: grid; gap: 1px; }
.details dt { color: var(--muted); font-size: .865rem; font-weight: 650; }
.details dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.compare > div { background: var(--subtle); padding: 12px; border-radius: 9px; margin-block: 8px; }
@media (max-width: 1120px) {
  .shell { grid-template-columns: 198px minmax(0,1fr); }
  .metric { padding: 14px; }
  .metric-head { align-items: flex-start; flex-direction: column; }
  .dashboard-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0,1fr); }
}
@media (max-width: 900px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; padding: 11px 20px 0; border-right: 0; }
  .brand { width: 192px; margin: 0 0 8px; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 3px; }
  .sidebar nav a { min-height: 40px; }
  .profile { display: none; }
  .topbar { min-height: 55px; padding-block: 7px; }
  .topbar > span { color: var(--muted); }
  main { padding-top: 19px; }
}
@media (max-width: 760px) {
  .dashboard-grid { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 635px) {
  .sidebar { padding: 10px 13px 5px; }
  .sidebar nav { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); }
  .sidebar nav a { display: grid; text-align: center; justify-items: center; gap: 4px; padding: 6px 2px; line-height: 1.2; font-size: .79rem; }
  .sidebar nav .icon { width: 17px; height: 17px; }
  .topbar, main { padding-inline: 13px; }
  .hero { min-height: 218px; }
  .hero-content { max-width: 100%; padding: 24px 17px; }
  .hero h1 { max-width: 82%; font-size: clamp(1.8rem, 8vw, 2.35rem); }
  .hero p { max-width: 290px; }
  .hero-art { width: 138px; height: 138px; top: auto; bottom: -15px; right: -13px; opacity: .57; mask-image: linear-gradient(115deg, transparent 18%, black 78%); }
  .metrics, .filters { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .insights-grid, .settings-grid { grid-template-columns: minmax(0,1fr); }
  .panel, .metric { padding: 13px; }
  .purchase-row { grid-template-columns: auto minmax(0,1fr) auto; gap: 4px 8px; }
  .purchase-row .tile { grid-row: span 2; }
  .purchase-row .badge { grid-column: 2 / -1; justify-self: start; }
  .purchase-row .example { display: block; margin: 0; }
  .dialog-head, .dialog-body { padding-inline: 14px; }
}
@media (max-width: 420px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-actions .button { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
