:root {
  --bg: #090a0d;
  --panel: #1d1d22;
  --panel-strong: #15161a;
  --ink: #f7f7f5;
  --muted: #8f8f98;
  --line: #2a2b31;
  --green: #58c88f;
  --green-soft: rgba(88, 200, 143, 0.16);
  --cash-green: #22c55e;
  --blue: #4f91d8;
  --blue-soft: rgba(79, 145, 216, 0.15);
  --amber: #d5a44c;
  --amber-soft: rgba(213, 164, 76, 0.15);
  --red: #ef5b63;
  --red-soft: rgba(239, 91, 99, 0.16);
  --chart-zero: rgba(247, 247, 245, 0.42);
  --duration-exit: 150ms;
  --duration-enter: 210ms;
  --duration-move: 400ms;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  --sidebar: #08090b;
  --nav-active: #28282f;
  --toast-bg: #f4f4f1;
  --toast-text: #090a0d;
}

:root[data-theme="light"] {
  --bg: #f6f7f5;
  --panel: #ffffff;
  --panel-strong: #f0f2ef;
  --ink: #111615;
  --muted: #69706d;
  --line: #d9dedb;
  --green: #199966;
  --green-soft: #e7f6ef;
  --cash-green: #158a54;
  --blue: #256cbd;
  --blue-soft: #e8f1fb;
  --amber: #b87913;
  --amber-soft: #fff3d8;
  --red: #c74242;
  --red-soft: #fdeaea;
  --chart-zero: rgba(17, 22, 21, 0.36);
  --shadow: 0 18px 45px rgba(20, 32, 31, 0.08);
  --sidebar: #101113;
  --nav-active: #292a31;
  --toast-bg: #111615;
  --toast-text: #ffffff;
}

:root[data-theme="dark"] {
  --bg: #090a0d;
  --panel: #1d1d22;
  --panel-strong: #15161a;
  --ink: #f7f7f5;
  --muted: #8f8f98;
  --line: #2a2b31;
  --green: #58c88f;
  --green-soft: rgba(88, 200, 143, 0.16);
  --cash-green: #22c55e;
  --blue: #4f91d8;
  --blue-soft: rgba(79, 145, 216, 0.15);
  --amber: #d5a44c;
  --amber-soft: rgba(213, 164, 76, 0.15);
  --red: #ef5b63;
  --red-soft: rgba(239, 91, 99, 0.16);
  --chart-zero: rgba(247, 247, 245, 0.42);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  --sidebar: #08090b;
  --nav-active: #28282f;
  --toast-bg: #f4f4f1;
  --toast-text: #090a0d;
}

@keyframes fade {
  from { filter: blur(3px); opacity: 0; }
  to { filter: blur(0); opacity: 1; }
}

@keyframes slide {
  from { translate: var(--slide-offset); }
  to { translate: 0; }
}

@keyframes slide-y {
  from { transform: translateY(var(--slide-y-offset, 10px)); }
  to { transform: translateY(0); }
}

@keyframes circular-theme-collapse {
  from {
    clip-path: circle(var(--theme-radius, 150vmax) at var(--theme-x, 50vw) var(--theme-y, 50vh));
  }
  to {
    clip-path: circle(0 at var(--theme-x, 50vw) var(--theme-y, 50vh));
  }
}

html.theme-collapse-transition::view-transition-old(root) {
  animation: circular-theme-collapse 760ms cubic-bezier(0.2, 0, 0, 1) both;
  mix-blend-mode: normal;
  z-index: 2;
}

html.theme-collapse-transition::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
  z-index: 1;
}

html.theme-collapse-transition::view-transition-group(root) {
  animation: none;
  isolation: isolate;
}

html.is-theme-transitioning,
html.is-theme-transitioning body,
html.is-theme-transitioning main,
html.is-theme-transitioning .app-shell,
html.is-theme-transitioning .sidebar,
html.is-theme-transitioning .topbar,
html.is-theme-transitioning .panel,
html.is-theme-transitioning .kpi-card,
html.is-theme-transitioning .metric-card,
html.is-theme-transitioning .report-card,
html.is-theme-transitioning .button,
html.is-theme-transitioning .chip,
html.is-theme-transitioning input,
html.is-theme-transitioning select,
html.is-theme-transitioning textarea {
  transition-property: background-color, color, border-color, box-shadow, outline-color;
  transition-duration: 240ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

@media (prefers-reduced-motion: reduce) {
  html.is-theme-transitioning,
  html.is-theme-transitioning body,
  html.is-theme-transitioning * {
    transition-duration: 0.01ms !important;
  }
}

::view-transition-old(.fade-out) {
  animation: var(--duration-exit) ease-in fade reverse;
}

::view-transition-new(.fade-in) {
  animation: var(--duration-enter) ease-out var(--duration-exit) both fade;
}

::view-transition-old(.slide-down) {
  animation:
    var(--duration-exit) ease-out both fade reverse,
    var(--duration-exit) ease-out both slide-y reverse;
}

::view-transition-new(.slide-up) {
  animation:
    var(--duration-enter) ease-in var(--duration-exit) both fade,
    var(--duration-move) ease-in both slide-y;
}

::view-transition-old(.nav-forward) {
  --slide-offset: -60px;
  animation:
    var(--duration-exit) ease-in both fade reverse,
    var(--duration-move) ease-in-out both slide reverse;
}

::view-transition-new(.nav-forward) {
  --slide-offset: 60px;
  animation:
    var(--duration-enter) ease-out var(--duration-exit) both fade,
    var(--duration-move) ease-in-out both slide;
}

::view-transition-old(.nav-back) {
  --slide-offset: 60px;
  animation:
    var(--duration-exit) ease-in both fade reverse,
    var(--duration-move) ease-in-out both slide reverse;
}

::view-transition-new(.nav-back) {
  --slide-offset: -60px;
  animation:
    var(--duration-enter) ease-out var(--duration-exit) both fade,
    var(--duration-move) ease-in-out both slide;
}

::view-transition-group(.morph) {
  animation-duration: var(--duration-move);
}

::view-transition-image-pair(.morph) {
  animation-name: via-blur;
}

@keyframes via-blur {
  30% { filter: blur(3px); }
}

::view-transition-group(.text-morph) {
  animation-duration: var(--duration-move);
}

::view-transition-old(.text-morph) {
  display: none;
}

::view-transition-new(.text-morph) {
  animation: none;
  object-fit: none;
  object-position: left top;
}

::view-transition-old(.scale-out) {
  animation: var(--duration-exit) ease-in scale-down;
}

::view-transition-new(.scale-in) {
  animation: var(--duration-enter) ease-out var(--duration-exit) both scale-up;
}

@keyframes scale-down {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(0.85); opacity: 0; }
}

@keyframes scale-up {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

::view-transition-group(persistent-nav) {
  animation: none;
  z-index: 100;
}

::view-transition-old(persistent-nav) {
  display: none;
}

::view-transition-new(persistent-nav) {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(*),
  ::view-transition-new(*),
  ::view-transition-group(*) {
    animation-duration: 0s !important;
    animation-delay: 0s !important;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Poppins, Lato, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 600;
}

body.auth-pending .app-shell,
body.auth-pending .auth-screen,
body.auth-pending .landing-screen,
body.is-public .app-shell,
body.is-public .auth-screen,
body.is-auth-locked .app-shell,
body.is-auth-locked .landing-screen,
body.is-authenticated .auth-screen,
body.is-authenticated .landing-screen {
  display: none;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 10%, rgba(88, 200, 143, 0.16), transparent 30%),
    linear-gradient(135deg, var(--bg), var(--panel-strong));
}

.auth-card {
  width: min(100%, 430px);
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  box-shadow: var(--shadow);
}

.auth-back {
  min-height: 40px;
  width: max-content;
  margin: -8px 0 0 -6px;
  padding: 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  transition-property: color, scale;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.auth-back:hover {
  color: var(--ink);
}

.auth-back:active {
  scale: 0.96;
}

.auth-back:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 6px;
}

.auth-brand {
  margin-bottom: 0;
}

.auth-card h1 {
  margin: 4px 0 8px;
  font-size: 34px;
  line-height: 1;
}

.auth-card label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.auth-status {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
}

.auth-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 274px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 22px;
  background: var(--sidebar);
  color: #f5faf9;
  border-right: 1px solid #202126;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  margin-bottom: 8px;
}

button.brand {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}

button.brand:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

button.brand > .brand-mark {
  display: grid;
  margin-top: 0;
  color: inherit;
  font-size: inherit;
}

button.brand > .brand-copy {
  display: block;
  margin-top: 0;
  color: inherit;
  font-size: inherit;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #f5f0e4;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand strong {
  font-size: 19px;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.brand span,
.sidebar-card small {
  display: block;
  color: #98aaa7;
  font-size: 12px;
  margin-top: 3px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  border: 0;
  border-radius: 8px;
  min-height: 54px;
  padding: 0 16px;
  background: transparent;
  color: #f4f4f4;
  text-align: left;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.nav-item::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 16px;
  vertical-align: -3px;
  border-radius: 4px;
  background: var(--green);
  box-shadow: inset 0 -7px 0 rgba(0, 0, 0, 0.24);
}

.nav-item:hover,
.nav-item.active {
  background: var(--nav-active);
  color: #ffffff;
}

.sidebar-card {
  margin-top: auto;
  padding: 18px;
  border: 1px solid #24262b;
  border-radius: 16px;
  background: #101115;
}

.sidebar-card strong {
  display: block;
  margin: 8px 0;
  font-size: 22px;
}

.main {
  min-width: 0;
  padding: 24px;
}

.topbar,
.section-toolbar,
.panel-head,
.modal-head,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 22px;
}

.topbar h1,
.section-toolbar h2,
.panel h2,
.panel h3,
.modal h3,
.modal h2 {
  margin: 0;
  letter-spacing: 0;
  color: var(--ink);
}

.topbar h1 {
  font-size: 30px;
}

.inline-status {
  min-height: 22px;
  margin: -8px 0 16px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.auto-value-select-modal {
  width: min(760px, calc(100vw - 28px));
  max-height: min(820px, calc(100vh - 28px));
}

.auto-value-select-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0;
}

.auto-value-select-toolbar > div {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.auto-value-select-grid {
  display: grid;
  gap: 10px;
  max-height: min(52vh, 520px);
  overflow: auto;
  padding: 2px 4px 2px 2px;
}

.auto-value-option {
  display: grid;
  grid-template-columns: 22px 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 84px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-strong);
  cursor: pointer;
}

.auto-value-option:has(input:checked) {
  border-color: color-mix(in srgb, var(--green) 58%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 18%, transparent);
}

.auto-value-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.auto-value-option__image {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  background: var(--panel);
  color: var(--blue);
  font-weight: 950;
}

.auto-value-option__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auto-value-option__body {
  min-width: 0;
}

.auto-value-option__body strong,
.auto-value-option__body small {
  display: block;
}

.auto-value-option__body strong {
  overflow-wrap: anywhere;
}

.auto-value-option__body small {
  margin-top: 4px;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-actions select {
  width: auto;
  min-width: 190px;
  min-height: 42px;
}

.topbar input {
  width: min(340px, 35vw);
}

.theme-toggle {
  width: 86px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px 4px 5px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 850;
}

.theme-toggle span {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f8d66d, #fff4b8);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}

.theme-toggle[data-theme="dark"] span {
  background: linear-gradient(135deg, #243447, #0f1416);
  box-shadow: inset -6px 0 0 #dbe7ff;
}

.theme-toggle strong {
  font-size: 12px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: var(--panel);
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.button,
.text-button,
.icon-button {
  border: 0;
  border-radius: 8px;
  min-height: 40px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  font-weight: 800;
}

.button.primary {
  background: var(--ink);
  color: var(--bg);
}

.button.secondary {
  background: var(--green);
  color: #ffffff;
}

.button.ghost {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}

.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--blue);
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--ink);
  font-weight: 900;
  line-height: 1;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.kpi-card,
.panel,
.metric-card,
.report-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.kpi-card {
  padding: 15px;
}

.kpi-card strong {
  display: block;
  margin: 8px 0 4px;
  font-size: clamp(18px, 2vw, 27px);
}

.kpi-card span {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 14px;
}

.action-panel {
  margin-bottom: 14px;
}

.onboarding-checklist {
  margin-bottom: 14px;
}

.onboarding-checklist__head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.onboarding-checklist__head h2 {
  margin: 3px 0;
  text-wrap: balance;
}

.onboarding-checklist__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 10px;
}

.onboarding-step {
  min-height: 112px;
  padding: 13px;
  border: 0;
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform 160ms cubic-bezier(0.2, 0, 0, 1), opacity 160ms cubic-bezier(0.2, 0, 0, 1), box-shadow 160ms cubic-bezier(0.2, 0, 0, 1);
}

.onboarding-step:active {
  transform: scale(0.96);
}

.onboarding-step:hover {
  box-shadow: inset 0 0 0 1px rgba(141, 124, 255, 0.55), 0 12px 28px rgba(0, 0, 0, 0.16);
}

.onboarding-step span {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  margin-bottom: 10px;
  border-radius: 50%;
  background: rgba(141, 124, 255, 0.16);
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.onboarding-step strong,
.onboarding-step small {
  display: block;
}

.onboarding-step small {
  margin-top: 6px;
  color: var(--muted);
}

.onboarding-step.is-done {
  opacity: 0.68;
}

.onboarding-step.is-done span {
  background: rgba(63, 211, 146, 0.18);
  color: var(--green);
}

.action-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.action-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 12px;
  background: var(--panel-strong);
}

.action-item strong,
.action-item span {
  display: block;
}

.action-item strong {
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 15px;
}

.action-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.action-item.tone-green { border-left-color: var(--green); }
.action-item.tone-amber { border-left-color: var(--amber); }
.action-item.tone-red { border-left-color: var(--red); }
.action-item.is-clear { border-left-color: var(--green); }

.panel {
  min-width: 0;
  padding: 16px;
}

.chart-panel,
.wide-panel {
  grid-column: span 2;
}

.chart-wrap {
  height: 300px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-strong);
  padding: 10px;
}

.chart-legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--panel);
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.legend-item i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.chart-wrap canvas {
  width: 100%;
  height: 100%;
}

.performance-insights,
.performance-chart-grid,
.expense-summary {
  display: grid;
  gap: 12px;
}

.performance-insights {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-top: 14px;
}

.mini-insight,
.mini-chart-card,
.expense-total {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-strong);
}

.mini-insight {
  padding: 13px;
}

.mini-insight strong {
  display: block;
  margin: 6px 0 3px;
  font-size: 21px;
}

.mini-insight span,
.expense-total span {
  color: var(--muted);
  font-size: 12px;
}

.performance-chart-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.chart-controls {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.chart-mode-switch,
.chart-range-switch {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chart-range-switch .chip {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.mini-chart-card {
  padding: 14px;
}

.mini-chart-card h3 {
  margin: 0;
  font-size: 16px;
}

.mini-chart-card canvas {
  width: 100%;
  height: 220px;
}

.cash-flow {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.flow-row {
  display: grid;
  gap: 6px;
}

.flow-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

.bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-strong);
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.card-strip,
.inventory-grid,
.finance-grid,
.reports-grid,
.market-layout {
  display: grid;
  gap: 12px;
}

.card-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
}

.inventory-grid {
  grid-template-columns: 1fr;
  overflow-x: auto;
  padding-bottom: 4px;
}

.card-tile {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.card-art {
  position: relative;
  min-height: 126px;
  display: flex;
  align-items: flex-end;
  padding: 12px;
  color: #ffffff;
  background:
    linear-gradient(145deg, rgba(20, 32, 31, 0.25), rgba(20, 32, 31, 0.8)),
    linear-gradient(135deg, #196b68, #2f78c4 48%, #d4982b);
}

.card-art strong {
  position: relative;
  z-index: 1;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.card-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-art.has-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 32, 31, 0.12), rgba(20, 32, 31, 0.82));
}

.card-art.image-missing::before {
  content: "No image";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 800;
}

.card-body {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.card-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 800;
  line-height: 1;
  text-align: center;
  text-decoration: none;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tag.green {
  background: color-mix(in srgb, var(--cash-green) 18%, transparent);
  color: var(--cash-green);
}

.tag.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.tag.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.tag.red {
  background: var(--red-soft);
  color: var(--red);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 9px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td {
  font-size: 14px;
  color: var(--ink);
}

td strong,
.detail-modal strong,
.modal-card strong {
  color: var(--ink);
}

.table-card-cell {
  display: grid;
  grid-template-columns: 52px minmax(150px, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 230px;
}

.table-card-image {
  width: 52px;
  height: 72px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-strong);
  color: var(--blue);
  font-weight: 950;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.1);
}

.table-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  outline: 1px solid var(--image-outline, rgba(255,255,255,.1));
  outline-offset: -1px;
}

.table-card-image.image-missing::after {
  content: "No image";
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.table-card-copy {
  min-width: 0;
}

.table-card-copy strong,
.table-card-copy span {
  display: block;
}

.table-card-copy strong {
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.table-card-copy span {
  margin-top: 5px;
}

.money-pos {
  color: var(--cash-green);
  font-weight: 800;
}

.money-neg {
  color: var(--red);
  font-weight: 800;
}

.split-tables {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.split-tables h3 {
  margin: 8px 0 0;
}

.section-toolbar {
  margin-bottom: 14px;
}

.finance-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.operating-expense-panel {
  margin: 14px 0;
}

.expense-summary {
  grid-template-columns: minmax(210px, .35fr) 1fr minmax(180px, .3fr);
  align-items: stretch;
  margin: 12px 0 14px;
}

.expense-total {
  padding: 15px;
}

.expense-total strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 28px;
}

.expense-breakdown {
  display: grid;
  gap: 10px;
}

.expense-bar-row {
  display: grid;
  gap: 6px;
}

.expense-bar-row > div:first-child,
.expense-source {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.expense-source {
  flex-direction: column;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-strong);
}

.metric-card,
.report-card {
  padding: 16px;
}

.metric-card strong,
.report-card strong {
  display: block;
  margin: 8px 0;
  font-size: 25px;
  color: var(--ink);
}

.metric-card p,
.report-card p {
  margin: 0;
  color: var(--muted);
}

.reports-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.market-layout {
  grid-template-columns: minmax(280px, 0.45fr) minmax(0, 1fr);
}

.workflow-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.workflow-list div {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: center;
  color: var(--muted);
}

.workflow-list strong {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
}

.settings-panel {
  display: grid;
  max-width: 620px;
  gap: 14px;
}

.settings-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.account-settings-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-strong);
}

.account-settings-card h3 {
  margin: 4px 0;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.1fr);
  gap: 16px;
  align-items: start;
  max-width: 1040px;
}

.profile-hero-card,
.profile-card {
  display: grid;
  gap: 16px;
}

.profile-hero-card {
  justify-items: center;
  align-content: center;
  gap: 24px;
  min-height: clamp(620px, 68vh, 760px);
  padding: clamp(44px, 6vw, 72px) clamp(24px, 5vw, 64px);
  text-align: center;
}

.profile-hero-actions {
  justify-content: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}

.profile-hero-actions .button {
  min-width: 0;
}

.profile-hero-card h3,
.profile-card h3 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.profile-hero-card > div:not(.profile-hero-actions) {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.profile-hero-card .eyebrow {
  display: none;
}

.profile-hero-card #profileDisplayName {
  margin-top: 0;
  font-size: clamp(42px, 5vw, 64px);
  line-height: 0.98;
  text-wrap: balance;
}

.profile-hero-card #profileDisplayEmail {
  margin: 0;
  max-width: 100%;
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.profile-avatar--large {
  width: clamp(156px, 15vw, 210px);
  min-width: clamp(156px, 15vw, 210px);
  height: clamp(156px, 15vw, 210px);
  min-height: clamp(156px, 15vw, 210px);
  font-size: 72px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 26px 70px rgba(165, 15, 85, 0.34);
}

.profile-avatar--large span {
  font-size: 72px;
}

.profile-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.team-card {
  align-content: start;
}

.team-invite-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 0.45fr) auto;
  gap: 10px;
  align-items: end;
}

.team-list {
  display: grid;
  gap: 8px;
}

.team-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px;
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: inset 0 0 0 1px var(--line);
}

.team-row strong,
.team-row span {
  display: block;
}

.team-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.team-row__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.team-row__actions select {
  min-width: 150px;
}

.team-row--invite {
  background: rgba(141, 124, 255, 0.12);
}

.team-role-pill {
  display: inline-grid;
  min-height: 40px;
  place-items: center;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 850;
  box-shadow: inset 0 0 0 1px var(--line);
}

@media (max-width: 760px) {
  .team-invite-form,
  .team-row {
    grid-template-columns: 1fr;
  }

  .team-row__actions {
    align-items: stretch;
    flex-direction: column;
  }
}

.is-plan-disabled,
.is-role-disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

button.is-plan-disabled,
button.is-role-disabled,
.listing-folder-button.is-plan-disabled,
.listing-folder-button.is-role-disabled {
  filter: grayscale(0.35);
}

.form-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 920px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .profile-photo-editor {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .profile-photo-controls {
    width: 100%;
  }
}

.backup-manager {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-strong);
}

.backup-list {
  display: grid;
  gap: 8px;
}

.backup-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.backup-row strong,
.backup-row span {
  display: block;
}

.backup-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.backup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.danger-button {
  color: var(--red);
}

.muted {
  color: var(--muted);
}

.modal {
  width: min(920px, calc(100vw - 30px));
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
}

.modal:not([open]) {
  display: none;
}

.modal[open] {
  position: fixed;
  top: 22px;
  left: 50%;
  z-index: 50;
  transform: translateX(-50%);
  display: block;
  max-height: calc(100dvh - 44px);
}

.modal::backdrop {
  background: rgba(11, 18, 17, 0.55);
}

.modal-card {
  max-height: calc(100dvh - 44px);
  overflow-y: auto;
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 20px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.24);
}

.modal-card input,
.modal-card select,
.modal-card textarea {
  background: var(--panel-strong);
  color: var(--ink);
}

.onboarding-modal {
  width: min(760px, calc(100vw - 30px));
}

.onboarding-card {
  padding: 22px;
}

.onboarding-card .modal-head {
  align-items: start;
}

.onboarding-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.onboarding-option {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 154px;
  padding: 14px;
  border: 0;
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform 160ms cubic-bezier(0.2, 0, 0, 1), box-shadow 160ms cubic-bezier(0.2, 0, 0, 1);
}

.onboarding-option:active {
  transform: scale(0.96);
}

.onboarding-option:hover {
  box-shadow: inset 0 0 0 1px rgba(141, 124, 255, 0.6), 0 14px 34px rgba(0, 0, 0, 0.18);
}

.onboarding-option span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.onboarding-option strong {
  font-size: 17px;
  line-height: 1.15;
  text-wrap: balance;
}

.onboarding-option small {
  color: var(--muted);
  line-height: 1.35;
}

.csv-import-modal {
  width: min(760px, calc(100vw - 30px));
}

.csv-import-card {
  padding: 22px;
}

.csv-import-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 12px;
}

.csv-import-stat {
  min-width: 0;
  padding: 14px;
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: inset 0 0 0 1px var(--line);
}

.csv-import-stat strong,
.csv-import-stat span {
  display: block;
}

.csv-import-stat strong {
  margin-bottom: 4px;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.csv-import-stat span,
.csv-import-note {
  color: var(--muted);
  font-size: 12px;
}

.csv-import-preview {
  max-height: 280px;
  overflow: auto;
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: inset 0 0 0 1px var(--line);
}

.csv-import-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(110px, 0.8fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 14px;
}

.csv-import-row + .csv-import-row {
  box-shadow: inset 0 1px 0 var(--line);
}

.csv-import-row strong,
.csv-import-row small {
  display: block;
  min-width: 0;
}

.csv-import-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.csv-import-row small {
  margin-top: 3px;
  color: var(--muted);
}

.csv-import-row__value {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.csv-import-note {
  margin: 12px 0 0;
  text-wrap: pretty;
}

@media (max-width: 760px) {
  .onboarding-options {
    grid-template-columns: 1fr;
  }

  .onboarding-option {
    min-height: 118px;
  }

  .onboarding-checklist__head {
    display: grid;
  }

  .csv-import-stats {
    grid-template-columns: 1fr;
  }

  .csv-import-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .csv-import-row__set {
    grid-column: 1 / -1;
  }
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  margin: 18px 0;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.full-field {
  grid-column: 1 / -1;
}

.selected-stock {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 800;
}

.purchase-mode-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.purchase-mode-switch label {
  display: block;
}

.purchase-mode-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.purchase-mode-switch span {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-weight: 900;
}

.purchase-mode-switch input:checked + span {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

#purchaseModal {
  width: min(1280px, calc(100vw - 32px));
}

.psa-cert-entry {
  display: grid;
  gap: 22px;
  margin-top: 18px;
  padding: clamp(18px, 3vw, 34px);
  border: 1px solid rgba(18, 24, 27, 0.08);
  border-radius: 28px;
  background: #fbfbfa;
  color: #202124;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.16);
}

:root[data-theme="dark"] .psa-cert-entry {
  background: #f7f7f4;
  color: #202124;
}

.psa-entry-hero {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 0.78fr);
  gap: clamp(22px, 4vw, 54px);
  align-items: center;
}

.psa-entry-copy {
  display: grid;
  gap: 18px;
  align-content: center;
}

.psa-entry-copy .eyebrow,
.psa-manual-card .eyebrow {
  color: #6f747a;
}

.psa-entry-copy h3 {
  margin: 0;
  max-width: 720px;
  color: #202124;
  font-size: clamp(38px, 5vw, 68px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.psa-entry-copy p {
  max-width: 720px;
  margin: 0;
  color: #666b70;
  font-size: clamp(17px, 2vw, 24px);
  line-height: 1.35;
}

.psa-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
}

.psa-search-row input {
  min-height: 64px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: #f0f0f0;
  color: #202124;
  font-size: 19px;
  box-shadow: none;
}

.psa-search-row .button {
  min-height: 58px;
  border-radius: 999px;
  padding: 0 24px;
}

.psa-preview-card {
  position: relative;
  display: grid;
  gap: 14px;
}

.psa-preview-stage {
  position: relative;
  min-height: 360px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(145deg, #f4f4f3, #ffffff);
  border: 1px solid rgba(18, 24, 27, 0.08);
}

.psa-preview-stage img {
  width: 100%;
  height: 100%;
  max-height: 520px;
  object-fit: contain;
  display: block;
}

.psa-preview-placeholder {
  max-width: 300px;
  padding: 18px;
  color: #777d83;
  text-align: center;
  font-weight: 800;
}

.psa-preview-card.is-loading .psa-preview-placeholder::before {
  content: "";
  display: block;
  width: 30px;
  height: 30px;
  margin: 0 auto 12px;
  border-radius: 999px;
  border: 3px solid #d7d9dc;
  border-top-color: #2e70ff;
  animation: spin 0.9s linear infinite;
}

.psa-preview-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.psa-preview-actions .button,
.psa-preview-actions label {
  min-height: 40px;
  border-radius: 999px;
  background: #ffffff;
  color: #202124;
}

.psa-preview-actions label {
  position: relative;
  overflow: hidden;
}

.psa-preview-actions input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.psa-manual-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.psa-manual-card {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 320px;
  padding: 22px;
  border: 1px solid #e3e5e8;
  border-radius: 20px;
  background: #ffffff;
  color: #202124;
}

.psa-manual-card h4 {
  margin: 0 0 6px;
  color: #202124;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.psa-manual-card label {
  color: #63676c;
}

.psa-manual-card input,
.psa-manual-card select,
.psa-manual-card textarea {
  background: #f7f7f7;
  border-color: #e2e4e7;
  color: #202124;
}

.psa-manual-card .selected-stock {
  background: #edf4ff;
  border-color: #d6e6ff;
  color: #235aa6;
}

@media (max-width: 1100px) {
  .psa-entry-hero,
  .psa-manual-grid {
    grid-template-columns: 1fr;
  }

  .psa-search-row {
    grid-template-columns: 1fr;
  }

  .psa-search-row .button {
    justify-content: center;
  }
}

@media (max-width: 720px) {
  #purchaseModal {
    width: min(100%, calc(100vw - 16px));
  }

  .psa-cert-entry {
    padding: 18px;
    border-radius: 22px;
  }

  .psa-entry-copy h3 {
    font-size: 36px;
  }

  .psa-preview-stage {
    min-height: 280px;
  }

  .psa-manual-card {
    min-height: 0;
    padding: 18px;
  }
}

/* Dirty-cache recovery: preserve local work and make sync decisions explicit. */
.data-recovery-banner {
  margin: 0 var(--main-pad) 8px;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border-radius: 22px;
  background: color-mix(in srgb, var(--panel) 92%, var(--blue) 8%);
  box-shadow: var(--shadow-border);
}

.data-recovery-banner[hidden] {
  display: none;
}

.data-recovery-banner__body {
  min-width: 0;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.data-recovery-banner__indicator {
  width: 12px;
  height: 12px;
  margin-top: 7px;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--blue) 16%, transparent);
  transition-property: transform, background-color, box-shadow;
  transition-duration: 180ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.data-recovery-banner[data-state="offline"] {
  background: color-mix(in srgb, var(--panel) 91%, #d6922e 9%);
}

.data-recovery-banner[data-state="offline"] .data-recovery-banner__indicator {
  background: #d6922e;
  box-shadow: 0 0 0 5px color-mix(in srgb, #d6922e 18%, transparent);
}

.data-recovery-banner[data-state="conflict"] {
  background: color-mix(in srgb, var(--panel) 90%, var(--red) 10%);
}

.data-recovery-banner[data-state="conflict"] .data-recovery-banner__indicator {
  background: var(--red);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--red) 18%, transparent);
}

.data-recovery-banner__copy {
  min-width: 0;
}

.data-recovery-banner__copy .eyebrow {
  margin: 0 0 4px;
}

.data-recovery-banner__copy h2 {
  margin: 0;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.12;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.data-recovery-banner__copy p:not(.eyebrow) {
  max-width: 760px;
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.45;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

.data-recovery-banner__copy small {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.data-recovery-banner__actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}

.data-recovery-banner__actions .button {
  width: auto;
  min-width: 0;
  min-height: 44px;
  white-space: normal;
  text-wrap: pretty;
}

.data-recovery-banner__actions .button:active:not(:disabled) {
  transform: scale(0.96);
}

.data-recovery-banner__actions .button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

@media (max-width: 980px) {
  .data-recovery-banner {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .data-recovery-banner__actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .data-recovery-banner {
    margin-inline: 16px;
    padding: 16px;
    border-radius: 20px;
  }

  .data-recovery-banner__actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .data-recovery-banner__actions .button {
    width: 100%;
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.psa-lookup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: end;
}

.image-drop-zone {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 12px;
  background: var(--panel-strong);
}

.image-drop-zone span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.is-dragging-image .image-drop-zone {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.sale-preview {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--muted);
  font-weight: 800;
}

.detail-modal {
  display: grid;
  gap: 16px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.45fr) minmax(0, 1fr);
  gap: 16px;
}

.detail-image {
  min-height: 280px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-strong);
}

.detail-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-fallback {
  height: 100%;
  min-height: 280px;
  display: grid;
  place-items: center;
  padding: 20px;
  text-align: center;
  color: var(--muted);
}

.detail-section {
  margin-top: 14px;
}

.detail-section h3 {
  margin: 0 0 8px;
  color: var(--ink);
}

.finance-ledger-panel {
  margin-top: 14px;
}

.import-button {
  position: relative;
  overflow: hidden;
}

.import-button input,
.listing-folder-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.listing-folder-button {
  position: relative;
  overflow: hidden;
}

.listing-import-panel {
  margin-bottom: 16px;
}

.listing-connections-panel {
  margin-bottom: 16px;
}

.marketplace-connections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.marketplace-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.marketplace-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.marketplace-card-head img {
  width: auto;
  max-width: 108px;
  height: 38px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}

.marketplace-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.listing-workflow {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.listing-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}

.listing-card-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  min-height: 210px;
  background: var(--line);
}

.listing-card-images img,
.listing-card-images span {
  width: 100%;
  height: 100%;
  min-height: 210px;
  display: grid;
  place-items: center;
  object-fit: cover;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.listing-card-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.listing-card-body h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.15;
}

.listing-card-body p {
  max-height: 4.2em;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.listing-warning {
  padding: 9px 10px;
  border: 1px solid rgba(239, 91, 99, 0.28);
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
}

.listing-meta {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}

.listing-meta strong {
  color: var(--ink);
}

.listing-review-modal {
  width: min(1120px, calc(100vw - 30px));
}

.listing-review-layout {
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr);
  gap: 18px;
  margin-top: 18px;
}

.listing-review-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
}

.listing-review-images img {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  object-fit: cover;
}

.listing-review-fields {
  margin: 0;
}

.market-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--toast-bg);
  color: var(--toast-text);
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow: var(--shadow);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.empty-state {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .kpi-grid,
  .finance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .split-tables,
  .market-layout,
  .performance-chart-grid,
  .expense-summary {
    grid-template-columns: 1fr;
  }

  .chart-panel,
  .wide-panel {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .main {
    padding: 16px;
  }

  .topbar,
  .section-toolbar,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions,
  .topbar input {
    width: 100%;
  }

  .button {
    width: 100%;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-grid,
  .finance-grid,
  .form-grid,
  .card-strip,
  .detail-grid,
  .listing-workflow,
  .marketplace-connections,
  .listing-review-layout,
  .listing-review-images,
  .purchase-mode-switch,
  .psa-lookup {
    grid-template-columns: 1fr;
  }
}

/* Z Cards 2026 refinement: Apple-like polish + PSA-style collection list */
.brand { cursor: pointer; border-radius: 14px; padding: 6px; transition: background .18s ease, transform .18s ease; }
.brand:hover { background: rgba(255,255,255,.06); transform: translateY(-1px); }
.save-status { font-size: 12px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 8px 11px; white-space: nowrap; }
.collection-list { width: 100%; min-width: 1040px; display: grid; gap: 0; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: var(--panel); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.collection-controls { display: grid; gap: 12px; margin: 0 0 14px; }
.collection-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); border-radius: 999px; min-height: 34px; padding: 0 12px; background: var(--panel); color: var(--muted); font-size: 13px; font-weight: 850; }
.chip.active, .chip:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.collection-filter-grid { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)); gap: 10px; align-items: end; }
.collection-filter-grid label { font-size: 12px; font-weight: 800; color: var(--muted); }
.collection-filter-grid input, .collection-filter-grid select { margin-top: 6px; background: var(--panel); }
.collection-head, .collection-row { display: grid; grid-template-columns: minmax(430px, 2.6fr) .75fr .8fr .8fr .85fr auto; gap: 20px; align-items: center; padding: 16px 20px; }
.collection-head { color: var(--muted); font-size: 12px; font-weight: 800; background: var(--panel-strong); border-bottom: 1px solid var(--line); }
.collection-row { min-height: 150px; border-bottom: 1px solid var(--line); }
.collection-row:last-child { border-bottom: 0; }
.collection-row:hover { background: var(--panel-strong); }
.collection-main { display: grid; grid-template-columns: 100px 1fr; gap: 20px; align-items: center; min-width: 0; }
.collection-main strong { display: block; font-size: 17px; line-height: 1.22; }
.collection-main small, .collection-row small { display: block; color: var(--muted); margin-top: 5px; }
.collection-image { width: 92px; height: 126px; display: grid; place-items: center; border-radius: 14px; background: var(--panel-strong); border: 1px solid var(--line); overflow: hidden; color: var(--blue); font-weight: 900; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.collection-image img { width: 100%; height: 100%; object-fit: cover; }
.collection-image.image-missing::after { content: "No image"; font-size: 12px; color: var(--muted); }
.table-actions, .card-actions.compact { display: flex; gap: 6px; flex-wrap: wrap; }
.mini-button.danger { color: var(--red); background: var(--red-soft); }
.logo-button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 1px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-weight: 900; text-decoration: none; color: var(--ink); }
.logo-button:hover, .button:hover, .mini-button:hover { transform: translateY(-1px); }
.logo-image-button { min-width: 88px; height: 46px; padding: 5px 12px; overflow: hidden; }
.logo-image-button img { display: block; width: auto; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 7px; }
.ebay-logo { background: #fff; }
.ebay-sold-logo { color: #0064d2; }
.psa-logo { background: #fff; min-width: 88px; }
.vinted-logo { background: #fff; min-width: 94px; }
.psa-status-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.source-badge { width: fit-content; display: inline-flex; align-items: center; min-height: 24px; border-radius: 999px; padding: 4px 9px; font-size: 11px; font-weight: 900; letter-spacing: .01em; border: 1px solid var(--line); background: var(--panel); color: var(--muted); }
.source-badge.official { color: #155b3f; background: #e8f7ef; border-color: rgba(21,91,63,.16); }
.source-badge.public { color: #0b5f7d; background: #e7f5fb; border-color: rgba(11,95,125,.16); }
.source-badge.stub { color: #8a5a00; background: #fff4d8; border-color: rgba(138,90,0,.18); }
.source-badge.fallback { color: #7a2d2d; background: #fdecec; border-color: rgba(122,45,45,.16); }
.source-warning { margin-top: 8px; border-radius: 12px; padding: 8px 10px; background: #fff4d8; color: #7a4d00; font-size: 12px; font-weight: 800; }
.detail-modal .metric-card,
.detail-modal .table-wrap,
.detail-modal .detail-section {
  color: var(--ink);
}
:root[data-theme="dark"] .source-badge.official { color: #9df0bd; background: #143524; border-color: rgba(157,240,189,.2); }
:root[data-theme="dark"] .source-badge.public { color: #9edcf4; background: #123040; border-color: rgba(158,220,244,.2); }
:root[data-theme="dark"] .source-badge.stub { color: #ffd987; background: #3b2c12; border-color: rgba(255,217,135,.22); }
:root[data-theme="dark"] .source-badge.fallback { color: #ffb4b4; background: #3b1d20; border-color: rgba(255,180,180,.22); }

.source-badge.grading {
  color: #5b38d8;
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.28);
}

:root[data-theme="dark"] .source-badge.grading {
  color: #d5c8ff;
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.34);
}
:root[data-theme="dark"] .source-warning { background: #3b2c12; color: #ffd987; }
.modal-card { border-radius: 24px; }
.kpi-card, .panel, .metric-card, .report-card { border-radius: 22px; }
.button, .text-button, .icon-button, input, select, textarea, .nav-item, .sidebar-card { border-radius: 14px; }
@media (max-width: 980px) {
  .collection-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inventory-grid { overflow-x: visible; }
  .collection-list { min-width: 0; }
  .collection-head { display: none; }
  .collection-row { grid-template-columns: 1fr; gap: 10px; padding: 16px; }
  .collection-main { grid-template-columns: 82px 1fr; }
  .collection-image { width: 74px; height: 102px; }
  .topbar-actions { justify-content: flex-start; }
  .save-status { order: 3; }
}

@media (max-width: 560px) {
  .collection-filter-grid { grid-template-columns: 1fr; }
}

/* Card Ladder inspired presentation layer */
.main {
  padding: 0;
  background: var(--bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 74px;
  margin: 0;
  padding: 14px 26px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(18px);
}

.topbar h1 {
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}

.topbar .eyebrow,
.section-toolbar .eyebrow,
.panel-head .eyebrow {
  color: color-mix(in srgb, var(--muted) 75%, transparent);
  font-weight: 950;
  letter-spacing: .12em;
}

.topbar input {
  width: min(560px, 38vw);
  min-height: 46px;
  border-radius: 8px;
  background: var(--panel);
  border-color: #26272d;
  font-size: 15px;
  font-weight: 850;
}

.view.active {
  padding: 34px min(4vw, 48px) 52px;
}

.section-toolbar {
  margin-bottom: 18px;
}

.section-toolbar h2,
.panel-head h2,
.panel h2 {
  font-size: clamp(23px, 2.2vw, 32px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.panel-head p,
.panel > p,
.metric-card p,
.report-card p,
.kpi-card span {
  color: var(--muted);
  font-weight: 650;
}

.dashboard-grid {
  gap: 20px;
}

.kpi-grid {
  gap: 22px;
  margin: 24px 0 28px;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.kpi-card {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.kpi-card .eyebrow {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-transform: none;
}

.kpi-card strong {
  margin: 7px 0 2px;
  color: var(--green);
  font-size: clamp(28px, 3.1vw, 42px);
  line-height: .95;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.chart-wrap {
  height: 360px;
  margin-top: 16px;
  border-radius: 8px;
  border-color: #25262c;
  background: #202126;
  padding: 18px;
  box-shadow: none;
}

:root[data-theme="light"] .chart-wrap {
  background: #ffffff;
  border-color: var(--line);
}

.chart-legend {
  justify-content: center;
  margin: 16px 0 4px;
}

.legend-item {
  min-height: 28px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
}

.legend-item i {
  width: 7px;
  height: 7px;
}

.mini-insight,
.mini-chart-card,
.expense-total,
.expense-source,
.metric-card,
.report-card,
.table-wrap,
.collection-list,
.modal-card {
  border-radius: 8px;
  border-color: #292b31;
  background: var(--panel);
  box-shadow: none;
}

.mini-insight strong,
.metric-card strong,
.report-card strong,
.expense-total strong {
  color: var(--green);
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: .98;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.performance-chart-grid {
  gap: 18px;
}

.mini-chart-card canvas {
  min-height: 190px;
}

input,
select,
textarea,
.button,
.text-button,
.icon-button,
.chip,
.mini-button {
  border-radius: 8px;
}

input,
select,
textarea {
  min-height: 44px;
  background: var(--panel);
  border-color: #2b2d33;
  font-weight: 800;
}

input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 72%, transparent);
}

.button {
  min-height: 42px;
  padding: 0 15px;
  font-weight: 900;
}

.button.primary {
  background: #f4f4f1;
  color: #090a0d;
}

.button.secondary {
  background: var(--green);
  color: #090a0d;
}

.button.ghost,
.chip {
  background: var(--panel);
  color: var(--ink);
  border-color: #2a2b31;
}

.button.ghost.active {
  background: var(--green);
  color: #090a0d;
  border-color: var(--green);
}

.chip.active,
.chip:hover {
  background: #2b2c32;
  color: #ffffff;
  border-color: #363840;
}

:root[data-theme="light"] .chip.active,
:root[data-theme="light"] .chip:hover {
  background: #111615;
  color: #ffffff;
  border-color: #111615;
}

.table-wrap {
  overflow: hidden;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .04em;
}

td {
  font-weight: 700;
}

.collection-list {
  min-width: 1080px;
  border-radius: 8px;
  backdrop-filter: none;
}

.collection-head {
  background: #15161a;
  color: #8f8f98;
  font-weight: 950;
}

:root[data-theme="light"] .collection-head {
  background: var(--panel-strong);
}

.collection-row {
  min-height: 126px;
}

.collection-row:hover {
  background: color-mix(in srgb, var(--panel-strong) 78%, var(--green) 4%);
}

.collection-main strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.collection-image {
  border-radius: 8px;
  background: #141519;
  box-shadow: none;
}

:root[data-theme="light"] .collection-image {
  background: var(--panel-strong);
}

.modal[open] {
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100dvh - 36px);
}

#cardDetailModal {
  width: min(1180px, calc(100vw - 32px));
}

.modal-card {
  max-height: calc(100dvh - 36px);
  width: 100%;
  padding: 24px;
}

.detail-modal {
  overflow-x: hidden;
}

.detail-grid {
  grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
}

.detail-grid > * {
  min-width: 0;
}

.detail-modal .finance-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.detail-edit-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel-strong);
}

.detail-edit-panel[hidden] {
  display: none;
}

.detail-image-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.detail-file-button {
  position: relative;
  overflow: hidden;
}

.detail-file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.compact-detail-form {
  margin-bottom: 8px;
}

.detail-image-help {
  margin: 0;
}

.modal-head h2,
.modal-head h3,
.detail-modal h2,
.detail-modal h3 {
  font-weight: 900;
  letter-spacing: -0.025em;
}

.icon-button {
  background: var(--panel-strong);
  color: var(--ink);
}

.theme-toggle {
  border-radius: 999px;
  background: var(--panel);
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .view.active {
    padding: 28px 20px 44px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chart-wrap {
    height: 320px;
  }

  .collection-list {
    min-width: 0;
  }
}

@media (max-width: 720px) {
  .topbar {
    min-height: auto;
    padding: 18px;
  }

  .topbar h1 {
    font-size: 31px;
  }

  .topbar input {
    width: 100%;
  }

  .view.active {
    padding: 22px 16px 38px;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .chart-wrap {
    height: 290px;
    padding: 12px;
  }
}

/* Unified premium interface, aligned with the PSA certificate entry flow. */
:root,
:root[data-theme="light"] {
  --bg: #f5f6f4;
  --panel: #ffffff;
  --panel-strong: #f0f1ef;
  --ink: #202124;
  --muted: #69706d;
  --line: #dfe4e1;
  --green: #159262;
  --green-soft: #e4f6ee;
  --cash-green: #158a54;
  --blue: #2e70ff;
  --blue-soft: #edf4ff;
  --amber: #b87913;
  --amber-soft: #fff3d8;
  --red: #c74242;
  --red-soft: #fdeaea;
  --shadow: 0 28px 70px rgba(31, 41, 37, 0.09);
  --sidebar: #ffffff;
  --nav-active: #edf4ff;
}

:root[data-theme="dark"] {
  --bg: #0f1113;
  --panel: #1b1d21;
  --panel-strong: #24272c;
  --ink: #f7f7f4;
  --muted: #a6aba8;
  --line: #30343a;
  --green: #5bd191;
  --green-soft: rgba(91, 209, 145, 0.14);
  --cash-green: #22c55e;
  --blue: #7fb2ff;
  --blue-soft: rgba(127, 178, 255, 0.14);
  --amber: #e2b560;
  --amber-soft: rgba(226, 181, 96, 0.16);
  --red: #ff7178;
  --red-soft: rgba(255, 113, 120, 0.14);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
  --sidebar: #15171a;
  --nav-active: #242b29;
}

body {
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--blue-soft) 52%, transparent), transparent 34rem),
    var(--bg);
  color: var(--ink);
}

.app-shell {
  grid-template-columns: 292px 1fr;
}

.sidebar {
  padding: 24px;
  background: color-mix(in srgb, var(--sidebar) 94%, var(--panel-strong));
  color: var(--ink);
  border-right: 1px solid var(--line);
  box-shadow: 18px 0 60px rgba(20, 28, 25, 0.05);
}

.brand-mark {
  border-radius: 20px;
  border-color: var(--line);
  background: #f5f0e4;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
}

.brand strong,
.brand span,
.sidebar-card small {
  color: var(--ink);
}

.brand span,
.sidebar-card small {
  color: var(--muted);
}

.nav {
  gap: 10px;
}

.nav-item {
  min-height: 50px;
  border-radius: 16px;
  padding: 0 16px;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
  background: transparent;
}

.nav-item::before {
  width: 10px;
  height: 10px;
  margin-right: 14px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: none;
  opacity: 0.55;
}

.nav-item:hover,
.nav-item.active {
  background: var(--nav-active);
  color: var(--ink);
}

:root[data-theme="light"] .nav-item.active,
:root[data-theme="light"] .nav-item:hover {
  color: #1f513f;
}

.sidebar-card {
  border-radius: 24px;
  border-color: var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.main {
  padding: clamp(18px, 3vw, 36px);
}

.topbar {
  min-height: 72px;
  padding: 0 0 18px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
}

.topbar h1,
.section-toolbar h2,
.panel h2,
.panel h3 {
  color: var(--ink);
  font-weight: 900;
  letter-spacing: -0.035em;
}

.topbar h1 {
  font-size: clamp(34px, 4vw, 58px);
  line-height: 0.98;
}

.topbar-actions {
  gap: 12px;
}

input,
select,
textarea {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 18px;
  background: color-mix(in srgb, var(--panel) 82%, var(--panel-strong));
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

textarea {
  min-height: 112px;
  border-radius: 22px;
  padding: 14px 18px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid color-mix(in srgb, var(--blue) 22%, transparent);
  border-color: color-mix(in srgb, var(--blue) 56%, var(--line));
}

.button,
.text-button,
.icon-button,
.mini-button,
.chip,
.purchase-mode-switch span {
  border-radius: 999px;
}

.button {
  min-height: 48px;
  padding: 0 20px;
  font-weight: 900;
}

.button.primary {
  background: var(--ink);
  color: var(--bg);
}

.button.secondary {
  background: var(--green);
  color: #ffffff;
  box-shadow: 0 14px 30px color-mix(in srgb, var(--green) 24%, transparent);
}

.button.ghost,
.mini-button,
.chip,
.icon-button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}

.icon-button {
  width: 48px;
  height: 48px;
}

.theme-toggle {
  min-height: 48px;
  width: auto;
  padding: 5px 14px 5px 6px;
  border-radius: 999px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.kpi-grid {
  gap: 18px;
  margin-bottom: 22px;
}

.kpi-card,
.panel,
.metric-card,
.report-card,
.mini-insight,
.mini-chart-card,
.expense-total,
.expense-source,
.table-wrap,
.collection-list,
.card-tile {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: color-mix(in srgb, var(--panel) 96%, var(--panel-strong));
  box-shadow: var(--shadow);
}

.kpi-card,
.panel,
.metric-card,
.report-card,
.mini-insight,
.mini-chart-card,
.expense-total {
  padding: clamp(18px, 2vw, 26px);
}

.kpi-card strong,
.metric-card strong,
.report-card strong,
.expense-total strong,
.mini-insight strong {
  color: var(--green);
  font-weight: 900;
  letter-spacing: -0.035em;
}

.dashboard-grid,
.performance-chart-grid,
.card-strip,
.finance-grid,
.reports-grid,
.market-layout {
  gap: 20px;
}

.chart-wrap {
  height: 340px;
  border-radius: 24px;
  background: color-mix(in srgb, var(--panel) 88%, var(--panel-strong));
  padding: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.legend-item {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
}

.collection-list {
  overflow: hidden;
}

.collection-head {
  background: color-mix(in srgb, var(--panel-strong) 72%, var(--panel));
  color: var(--muted);
}

.collection-row {
  min-height: 140px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
}

.collection-row:hover {
  background: color-mix(in srgb, var(--green-soft) 48%, var(--panel));
}

.collection-image,
.card-art {
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel-strong) 88%, var(--panel));
}

.tag {
  min-height: 28px;
  padding: 0 11px;
  border-radius: 999px;
}

.table-wrap {
  padding: 6px;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 14px 12px;
}

tr:last-child td {
  border-bottom: 0;
}

.modal[open] {
  top: 50%;
  left: 50%;
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  transform: translate(-50%, -50%);
}

.modal::backdrop {
  background: rgba(11, 18, 17, 0.48);
  backdrop-filter: blur(14px);
}

.modal-card {
  max-height: calc(100dvh - 32px);
  padding: clamp(22px, 3vw, 36px);
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 30px;
  background: color-mix(in srgb, var(--panel) 98%, var(--panel-strong));
  color: var(--ink);
  box-shadow: 0 36px 100px rgba(0, 0, 0, 0.28);
}

.modal-head {
  align-items: flex-start;
  margin-bottom: 18px;
}

.modal-head h2,
.modal-head h3,
.detail-modal h2,
.detail-modal h3 {
  color: var(--ink);
  font-size: clamp(28px, 3vw, 46px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.045em;
}

.modal-actions {
  position: sticky;
  bottom: -36px;
  margin: 24px -36px -36px;
  padding: 18px 36px 24px;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--panel) 98%, var(--panel-strong)) 28%);
}

.form-grid {
  gap: 18px;
  margin: 20px 0;
}

label {
  gap: 9px;
  color: var(--muted);
  font-weight: 850;
}

.selected-stock,
.sale-preview {
  border-radius: 22px;
  padding: 16px 18px;
  background: var(--blue-soft);
  border-color: color-mix(in srgb, var(--blue) 24%, var(--line));
  color: color-mix(in srgb, var(--blue) 74%, var(--ink));
}

.purchase-mode-switch {
  gap: 12px;
  margin: 20px 0 8px;
}

.purchase-mode-switch span {
  min-height: 58px;
  background: var(--panel);
  color: var(--muted);
}

.purchase-mode-switch input:checked + span {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.psa-cert-entry {
  border-radius: 30px;
  box-shadow: var(--shadow);
}

:root[data-theme="dark"] .psa-cert-entry {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
}

:root[data-theme="dark"] .psa-entry-copy h3,
:root[data-theme="dark"] .psa-manual-card h4 {
  color: var(--ink);
}

:root[data-theme="dark"] .psa-entry-copy p,
:root[data-theme="dark"] .psa-entry-copy .eyebrow,
:root[data-theme="dark"] .psa-manual-card .eyebrow,
:root[data-theme="dark"] .psa-manual-card label {
  color: var(--muted);
}

:root[data-theme="dark"] .psa-preview-stage,
:root[data-theme="dark"] .psa-manual-card,
:root[data-theme="dark"] .psa-search-row input,
:root[data-theme="dark"] .psa-manual-card input,
:root[data-theme="dark"] .psa-manual-card select,
:root[data-theme="dark"] .psa-manual-card textarea,
:root[data-theme="dark"] .psa-preview-actions .button,
:root[data-theme="dark"] .psa-preview-actions label {
  background: var(--panel-strong);
  color: var(--ink);
  border-color: var(--line);
}

:root[data-theme="dark"] .psa-preview-placeholder {
  color: var(--muted);
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .main {
    padding: 22px;
  }
}

@media (max-width: 720px) {
  .main {
    padding: 16px;
  }

  .topbar {
    align-items: stretch;
    padding: 0 0 16px;
  }

  .topbar-actions,
  .modal-actions,
  .purchase-mode-switch {
    align-items: stretch;
  }

  .modal[open] {
    width: min(100%, calc(100vw - 12px));
    max-height: calc(100dvh - 12px);
  }

  .modal-card {
    max-height: calc(100dvh - 12px);
    border-radius: 24px;
    padding: 18px;
  }

  .modal-actions {
    bottom: -18px;
    margin: 20px -18px -18px;
    padding: 16px 18px 18px;
  }
}

/* Header personalization and PSA-like typography pass. */
:root {
  --header-accent: #2e70ff;
  --header-intensity: 62%;
  --header-soft-intensity: 34%;
  --header-shadow-intensity: 28%;
  --header-image-overlay: 45%;
  --header-image-soft-overlay: 32%;
  --header-bg-image: none;
  --main-pad: clamp(18px, 3vw, 36px);
}

.main {
  padding: var(--main-pad);
}

body,
button,
input,
select,
textarea {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

h1,
h2,
h3,
h4,
.topbar h1,
.section-toolbar h2,
.panel h2,
.panel h3,
.modal-head h2,
.modal-head h3,
.detail-modal h2,
.detail-modal h3,
.psa-entry-copy h3 {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.topbar {
  min-height: 108px;
  margin: calc(-1 * var(--main-pad)) calc(-1 * var(--main-pad)) 26px;
  padding: 28px 40px;
  border-bottom: 1px solid color-mix(in srgb, var(--header-accent) var(--header-intensity), var(--line));
  background:
    linear-gradient(0deg, color-mix(in srgb, var(--header-accent) var(--header-intensity), var(--panel)), color-mix(in srgb, var(--header-accent) var(--header-intensity), var(--panel))),
    var(--header-bg-image),
    var(--panel);
  background-position: center;
  background-size: cover;
  box-shadow: 0 24px 70px color-mix(in srgb, var(--header-accent) var(--header-shadow-intensity), transparent);
}

[data-header-style="gradient"] .topbar {
  background:
    linear-gradient(110deg, color-mix(in srgb, var(--header-accent) var(--header-intensity), var(--panel)) 0%, color-mix(in srgb, var(--panel) 78%, transparent) 56%, color-mix(in srgb, var(--header-accent) var(--header-soft-intensity), var(--panel)) 100%),
    var(--header-bg-image),
    var(--panel);
}

[data-header-image] .topbar {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--panel) var(--header-image-overlay), transparent), color-mix(in srgb, var(--panel) var(--header-image-soft-overlay), transparent)),
    linear-gradient(0deg, color-mix(in srgb, var(--header-accent) var(--header-shadow-intensity), transparent), color-mix(in srgb, var(--header-accent) var(--header-shadow-intensity), transparent)),
    var(--header-bg-image);
  background-position: center;
  background-size: cover;
}

[data-header-image][data-header-style="gradient"] .topbar {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--panel) var(--header-image-overlay), transparent), color-mix(in srgb, var(--panel) var(--header-image-soft-overlay), transparent)),
    linear-gradient(110deg, color-mix(in srgb, var(--header-accent) 36%, transparent), transparent),
    var(--header-bg-image);
}

:root[data-theme="dark"] .topbar {
  background:
    linear-gradient(0deg, color-mix(in srgb, var(--header-accent) var(--header-intensity), var(--panel)), color-mix(in srgb, var(--header-accent) var(--header-intensity), var(--panel))),
    var(--header-bg-image),
    var(--panel);
}

:root[data-theme="dark"][data-header-style="gradient"] .topbar {
  background:
    linear-gradient(110deg, color-mix(in srgb, var(--header-accent) var(--header-intensity), var(--panel)) 0%, color-mix(in srgb, var(--panel) 76%, transparent) 58%, color-mix(in srgb, var(--header-accent) var(--header-soft-intensity), var(--panel)) 100%),
    var(--header-bg-image),
    var(--panel);
}

.topbar .eyebrow,
.section-toolbar .eyebrow,
.panel-head .eyebrow,
.psa-entry-copy .eyebrow {
  letter-spacing: 0.08em;
}

.topbar h1 {
  color: color-mix(in srgb, var(--ink) 90%, var(--header-accent));
  font-size: 52px;
  line-height: 1;
  text-transform: uppercase;
}

.topbar input {
  min-height: 52px;
  border-radius: 999px;
  border-color: color-mix(in srgb, var(--header-accent) 32%, var(--line));
  background: color-mix(in srgb, var(--panel) 88%, transparent);
}

.theme-toggle,
.save-status,
.topbar .button {
  box-shadow: 0 12px 28px color-mix(in srgb, var(--header-accent) 12%, transparent);
}

.settings-theme-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid color-mix(in srgb, var(--header-accent) 24%, var(--line));
  border-radius: 24px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--header-accent) 12%, var(--panel)), var(--panel));
}

.settings-theme-card h3 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.appearance-controls {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}

.appearance-controls label {
  width: auto;
}

.appearance-controls input[type="color"] {
  width: 92px;
  height: 52px;
  padding: 5px;
  border-radius: 999px;
  cursor: pointer;
}

.range-control {
  min-width: 220px;
}

.range-control span {
  color: var(--header-accent);
  font-weight: 950;
}

.range-control input[type="range"] {
  height: 52px;
  padding: 0;
  accent-color: var(--header-accent);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.import-button {
  position: relative;
  overflow: hidden;
}

.import-button input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

@media (max-width: 1100px) {
  :root {
    --main-pad: 22px;
  }
}

@media (max-width: 720px) {
  :root {
    --main-pad: 16px;
  }

  .topbar {
    min-height: auto;
    margin: calc(-1 * var(--main-pad)) calc(-1 * var(--main-pad)) 20px;
    padding: 20px;
  }

  .topbar h1 {
    font-size: 34px;
  }

  .appearance-controls,
  .appearance-controls .button {
    width: 100%;
  }
}

/* Illustrated day/night switch. */
.theme-toggle {
  position: relative;
  width: 104px;
  min-width: 104px;
  height: 54px;
  min-height: 54px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #f5d969;
  box-shadow: 0 14px 28px rgba(212, 172, 46, 0.22);
}

.theme-toggle .theme-scene {
  position: absolute;
  inset: 4px;
  overflow: hidden;
  border-radius: 999px;
  background:
    radial-gradient(circle at 30px 16px, #fff 0 7px, rgba(255, 255, 255, 0.55) 8px, transparent 18px),
    linear-gradient(160deg, #ffe884 0%, #f3cc44 100%);
}

.theme-toggle .theme-scene::before {
  content: "";
  position: absolute;
  top: 3px;
  right: 4px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #f6f4ee;
  box-shadow: 0 7px 14px rgba(93, 72, 12, 0.16);
  transition: transform 0.28s ease;
}

.theme-toggle .theme-scene::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 12px;
  bottom: 5px;
  height: 24px;
  background:
    linear-gradient(135deg, transparent 0 16%, #e6a62c 17% 38%, transparent 39%),
    linear-gradient(145deg, transparent 0 34%, #d79322 35% 58%, transparent 59%);
  opacity: 0.9;
}

.theme-toggle[data-theme="dark"] {
  background: #153b4f;
  box-shadow: 0 14px 28px rgba(12, 44, 61, 0.28);
}

.theme-toggle[data-theme="dark"] .theme-scene {
  background:
    radial-gradient(circle at 68px 13px, #f3f1e8 0 11px, transparent 12px),
    radial-gradient(circle at 58px 9px, #153b4f 0 11px, transparent 12px),
    radial-gradient(circle at 48px 13px, #ffffff 0 1.5px, transparent 2px),
    radial-gradient(circle at 62px 24px, #ffffff 0 1.2px, transparent 2px),
    radial-gradient(circle at 78px 25px, #ffffff 0 1px, transparent 2px),
    linear-gradient(160deg, #102e43 0%, #1d4c63 100%);
}

.theme-toggle[data-theme="dark"] .theme-scene::before {
  transform: translateX(-52px);
  background: #f2f2ee;
}

.theme-toggle[data-theme="dark"] .theme-scene::after {
  background:
    linear-gradient(135deg, transparent 0 16%, #2f6071 17% 40%, transparent 41%),
    linear-gradient(145deg, transparent 0 34%, #21495b 35% 58%, transparent 59%);
}

/* Minimal sun/moon theme toggle. */
.theme-toggle {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  border: none;
  border-radius: 999px;
  padding: 0;
  background: #f1f5f9;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: visible;
  box-shadow: none;
  transition: background 0.2s ease, transform 0.15s ease;
}

.theme-toggle:hover {
  background: #e2e8f0;
  transform: scale(1.05);
}

.theme-toggle.is-dark {
  background: #1e293b;
  color: #f8fafc;
}

.theme-icon {
  font-size: 20px;
  line-height: 1;
}

/* Final override: compact search pill button. */
.search-shell {
  width: auto !important;
  height: 40px !important;
  min-height: 40px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px;
  overflow: visible !important;
  box-shadow: none !important;
}

.search-shell.is-open {
  width: min(420px, 34vw) !important;
}

.search-pill {
  height: 40px;
  padding: 0 18px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.12s ease;
}

.search-pill:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.search-pill:active {
  transform: translateY(0);
}

.search-pill:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.32);
}

.search-pill__icon {
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 50%;
  position: relative;
  box-sizing: border-box;
  flex: 0 0 auto;
}

.search-pill__icon::after {
  content: "";
  width: 7px;
  height: 2px;
  background: currentColor;
  position: absolute;
  right: -6px;
  bottom: -3px;
  transform: rotate(45deg);
  border-radius: 999px;
}

.search-shell input {
  flex: 1 1 auto;
  width: 0 !important;
  min-width: 0 !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0;
  pointer-events: none;
  background: transparent !important;
  color: var(--ink);
  transition: opacity 0.18s ease, width 0.18s ease, padding 0.18s ease;
}

.search-shell.is-open input {
  width: 100% !important;
  min-width: 160px !important;
  padding: 0 4px !important;
  opacity: 1;
  pointer-events: auto;
}

:root[data-theme="dark"] .search-pill {
  border-color: rgba(255, 255, 255, 0.16);
  background: #1e293b;
  color: #f8fafc;
}

:root[data-theme="dark"] .search-pill:hover {
  background: #263449;
  border-color: rgba(255, 255, 255, 0.28);
}

@media (max-width: 720px) {
  .search-shell.is-open {
    width: 100% !important;
  }
}

/* Compact top navigation layout inspired by the reference dashboard. */
:root {
  --shell-pad: clamp(16px, 2.2vw, 28px);
}

body {
  background:
    radial-gradient(circle at top right, rgba(122, 83, 255, 0.32), transparent 28rem),
    radial-gradient(circle at top left, rgba(205, 235, 102, 0.22), transparent 22rem),
    var(--bg);
}

.app-shell {
  display: block;
  min-height: 100vh;
  padding: var(--shell-pad);
}

.sidebar {
  position: sticky;
  top: var(--shell-pad);
  z-index: 80;
  height: auto;
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(170px, 0.9fr) minmax(420px, auto) minmax(260px, 0.9fr);
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 24px 24px 0 0;
  background: #050506;
  color: #ffffff;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.26);
}

.brand {
  min-height: 48px;
  margin: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 35%, #fff 0 2px, transparent 3px),
    linear-gradient(135deg, #d6f06b, #7b45ff 72%);
}

.brand-mark img {
  opacity: 0;
}

.brand strong {
  color: #ffffff;
  font-size: 17px;
  text-transform: none;
}

.brand span {
  display: none;
}

.nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.nav-item {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.09);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.nav-item::before {
  display: none;
}

.nav-item:hover,
.nav-item.active,
:root[data-theme="light"] .nav-item.active,
:root[data-theme="light"] .nav-item:hover {
  background: #ffffff;
  color: #09090a;
}

.sidebar-card {
  display: none;
}

.main {
  position: relative;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-top: 0;
  border-radius: 0 0 24px 24px;
  background: var(--bg);
  min-height: calc(100vh - 116px);
}

.topbar {
  position: fixed;
  top: calc(var(--shell-pad) + 14px);
  right: calc(var(--shell-pad) + 18px);
  z-index: 90;
  width: auto;
  min-height: 48px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.topbar > div:first-child {
  display: none;
}

.topbar-actions {
  gap: 10px;
}

.save-status {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.72);
}

.search-shell {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  transition: width 0.24s ease, background 0.24s ease;
}

.search-shell.is-open {
  width: min(360px, 34vw);
  background: #ffffff;
}

.search-toggle {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #ffffff;
  font-size: 26px;
  font-weight: 700;
}

.search-shell.is-open .search-toggle {
  color: #161719;
}

.search-shell input {
  min-width: 0;
  height: 48px;
  min-height: 48px;
  border: 0;
  padding: 0 16px 0 0;
  background: transparent;
  color: #161719;
  opacity: 0;
  pointer-events: none;
}

.search-shell.is-open input {
  opacity: 1;
  pointer-events: auto;
}

.topbar .button {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
}

.theme-toggle {
  width: 72px;
  min-width: 72px;
  height: 48px;
  min-height: 48px;
}

.view.active {
  padding: clamp(28px, 4vw, 54px);
}

@media (max-width: 1180px) {
  .sidebar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .nav {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .topbar {
    position: sticky;
    top: 0;
    right: auto;
    padding: 14px;
    background: #050506;
  }

  .topbar-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 8px;
  }

  .sidebar,
  .main {
    border-radius: 18px;
  }

  .main {
    margin-top: 8px;
    border-top: 1px solid var(--line);
  }

  .topbar {
    border-radius: 18px;
    margin-bottom: 8px;
  }

  .save-status {
    display: none;
  }

  .search-shell.is-open {
    width: 100%;
  }
}

/* Full-screen business workspace refresh. */
:root {
  --shell-pad: 0px;
  --main-pad: clamp(20px, 2.5vw, 34px);
}

body {
  min-height: 100vh;
  background: var(--bg);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  padding: 0;
  background: var(--bg);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 100vh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 22px;
  padding: 24px 18px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: var(--sidebar);
  box-shadow: none;
}

.brand {
  min-height: 58px;
  padding: 0 4px;
  border-radius: 8px;
}

.brand:hover {
  background: color-mix(in srgb, #ffffff 6%, transparent);
}

.brand-mark {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #f5f0e4;
}

.brand-mark img {
  opacity: 1;
}

.brand strong {
  font-size: 17px;
  text-transform: uppercase;
}

.brand span {
  display: block;
}

.nav {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 0;
}

.nav-item {
  min-height: 44px;
  padding: 0 13px;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.nav-item::before {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 12px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: none;
  opacity: 0.55;
}

.nav-item:hover,
.nav-item.active,
:root[data-theme="light"] .nav-item.active,
:root[data-theme="light"] .nav-item:hover {
  background: var(--nav-active);
  color: #ffffff;
}

:root[data-theme="light"] .sidebar {
  background: #ffffff;
  color: var(--ink);
}

:root[data-theme="light"] .brand:hover {
  background: rgba(17, 22, 21, 0.05);
}

:root[data-theme="light"] .brand strong {
  color: var(--ink);
}

:root[data-theme="light"] .brand span,
:root[data-theme="light"] .sidebar-card small {
  color: var(--muted);
}

:root[data-theme="light"] .nav-item {
  color: #606966;
}

:root[data-theme="light"] .nav-item.active,
:root[data-theme="light"] .nav-item:hover {
  background: #111615;
  color: #ffffff;
}

:root[data-theme="light"] .sidebar-card {
  background: #f7f8f6;
  border-color: var(--line);
}

.sidebar-card {
  display: block;
  border-radius: 8px;
}

.main {
  min-height: 100vh;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--bg);
}

.topbar {
  position: sticky;
  top: 0;
  right: auto;
  z-index: 15;
  width: 100%;
  min-height: 78px;
  display: flex;
  margin: 0;
  padding: 14px var(--main-pad);
  border: 0;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  box-shadow: none;
  backdrop-filter: blur(18px);
}

:root[data-theme="dark"] .topbar,
:root[data-theme="dark"][data-header-style="gradient"] .topbar {
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}

.topbar > div:first-child {
  display: block;
}

.topbar h1 {
  color: var(--ink);
  font-size: clamp(26px, 2.5vw, 36px);
  line-height: 1.05;
  text-transform: none;
}

.topbar-actions {
  gap: 9px;
}

.topbar .button,
.save-status,
.search-shell,
.theme-toggle {
  box-shadow: none;
}

.save-status {
  min-height: 40px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
}

.search-shell {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.search-shell.is-open {
  width: min(360px, 32vw);
  background: var(--panel);
}

.search-toggle {
  flex-basis: 42px;
  width: 42px;
  height: 42px;
  color: var(--ink);
  font-size: 23px;
}

.search-shell.is-open .search-toggle,
.search-shell input {
  color: var(--ink);
}

.search-shell input {
  height: 42px;
  min-height: 42px;
}

.topbar input {
  min-height: 42px;
  border-radius: 0;
  border-color: transparent;
  background: transparent;
}

.topbar .button {
  min-height: 42px;
  border-radius: 8px;
}

.theme-toggle {
  width: 78px;
  min-width: 78px;
  height: 42px;
  min-height: 42px;
  border: 1px solid var(--line);
  background: #f4c752;
}

.theme-toggle .theme-scene {
  inset: 3px;
}

.theme-toggle .theme-scene::before {
  top: 2px;
  right: 3px;
  width: 32px;
  height: 32px;
}

.theme-toggle[data-theme="dark"] .theme-scene::before {
  transform: translateX(-36px);
}

.view.active {
  padding: var(--main-pad);
}

.kpi-grid {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.55fr);
  gap: 14px;
}

.kpi-card,
.panel,
.metric-card,
.report-card,
.mini-insight,
.mini-chart-card,
.expense-total,
.card-tile,
.modal-card,
.collection-list,
.collection-image,
.psa-cert-entry,
.psa-manual-card,
.psa-preview-stage {
  border-radius: 8px;
}

.panel,
.kpi-card,
.metric-card,
.report-card {
  box-shadow: none;
}

.settings-panel {
  max-width: 760px;
}

.settings-theme-card {
  border-radius: 8px;
  background: var(--panel-strong);
}

.settings-theme-card h3 {
  font-size: 22px;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    height: auto;
    display: grid;
    grid-template-columns: minmax(180px, auto) 1fr;
    gap: 12px;
    padding: 12px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav {
    display: flex;
    overflow-x: auto;
    align-items: center;
  }

  .sidebar-card {
    display: none;
  }

  .topbar {
    top: 73px;
  }

  .kpi-grid,
  .dashboard-grid,
  .finance-grid,
  .split-tables,
  .market-layout,
  .performance-chart-grid,
  .expense-summary {
    grid-template-columns: 1fr;
  }

  .chart-panel,
  .wide-panel {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .sidebar {
    position: static;
    grid-template-columns: 1fr;
  }

  .main {
    margin-top: 0;
    border-top: 0;
  }

  .topbar {
    position: static;
    min-height: auto;
    padding: 16px;
  }

  .topbar,
  .section-toolbar,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .topbar .button {
    width: auto;
  }

  .search-shell.is-open {
    width: 100%;
  }

  .view.active {
    padding: 16px;
  }
}

/* Loud-inspired premium analytics skin. */
:root[data-theme="dark"] {
  --bg: #030303;
  --panel: #191a1e;
  --panel-strong: #111216;
  --ink: #f7f4ff;
  --muted: #9a9aa6;
  --line: rgba(255, 255, 255, 0.08);
  --green: #c8ff3d;
  --green-soft: rgba(200, 255, 61, 0.14);
  --cash-green: #22c55e;
  --blue: #8b5cf6;
  --blue-soft: rgba(139, 92, 246, 0.18);
  --amber: #b68cff;
  --amber-soft: rgba(182, 140, 255, 0.16);
  --sidebar: #030303;
  --nav-active: #f7f4ff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

:root[data-theme="light"] {
  --bg: #f4f2f8;
  --panel: #ffffff;
  --panel-strong: #edeaf4;
  --ink: #141218;
  --muted: #6f6a78;
  --line: rgba(20, 18, 24, 0.1);
  --green: #7446f4;
  --green-soft: rgba(116, 70, 244, 0.12);
  --cash-green: #158a54;
  --blue: #6435df;
  --blue-soft: rgba(100, 53, 223, 0.12);
  --amber: #7a43ff;
  --amber-soft: rgba(122, 67, 255, 0.13);
  --sidebar: #f4f2f8;
  --nav-active: #141218;
  --shadow: 0 20px 50px rgba(44, 33, 78, 0.09);
}

body {
  background:
    radial-gradient(circle at 7% 3%, rgba(116, 70, 244, 0.32), transparent 52px),
    radial-gradient(circle at 76% 12%, rgba(200, 255, 61, 0.08), transparent 240px),
    var(--bg);
}

.app-shell {
  display: block;
  min-height: 100vh;
  background: transparent;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: auto;
  min-height: 74px;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 12px clamp(14px, 2.4vw, 32px);
  border: 0;
  border-radius: 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  box-shadow: none;
  backdrop-filter: blur(18px);
}

.brand {
  min-height: 50px;
  gap: 11px;
  padding: 0;
}

.brand:hover {
  background: transparent;
  transform: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 35%, #f4efff 0 3px, transparent 4px),
    linear-gradient(135deg, #f7f4ff 0%, #8b5cf6 42%, #3c1c95 100%);
  box-shadow: 0 12px 30px rgba(139, 92, 246, 0.28);
}

.brand-mark img {
  opacity: 0;
}

.brand strong {
  color: var(--ink);
  font-size: 17px;
  letter-spacing: 0;
  text-transform: none;
}

.brand span {
  display: none;
}

.nav {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.nav-item {
  min-height: 44px;
  flex: 0 0 auto;
  padding: 0 20px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 78%, transparent);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: none;
}

.nav-item::before {
  display: none;
}

.nav-item:hover,
.nav-item.active,
:root[data-theme="light"] .nav-item.active,
:root[data-theme="light"] .nav-item:hover {
  background: var(--nav-active);
  color: var(--bg);
  border-color: var(--nav-active);
}

.sidebar-card {
  display: none;
}

.main {
  min-height: calc(100vh - 74px);
  background: transparent;
}

.topbar {
  position: static;
  min-height: 152px;
  padding: 32px clamp(16px, 2.8vw, 44px) 22px;
  border: 0;
  background: transparent;
  backdrop-filter: none;
}

:root[data-theme="dark"] .topbar,
:root[data-theme="dark"][data-header-style="gradient"] .topbar {
  background: transparent;
}

.topbar h1 {
  max-width: 680px;
  color: var(--ink);
  font-size: clamp(40px, 5.2vw, 70px);
  font-weight: 500;
  line-height: 0.98;
}

.topbar .eyebrow {
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.topbar-actions {
  align-self: flex-start;
  gap: 10px;
}

.save-status,
.search-shell,
.theme-toggle,
.topbar .button {
  min-height: 54px;
  border-radius: 999px;
}

.save-status {
  border: 0;
  padding: 0 18px;
  background: var(--panel);
  color: var(--muted);
}

.search-shell {
  width: 62px;
  height: 62px;
  border: 0;
  background: var(--panel);
}

.search-shell.is-open {
  width: min(360px, 28vw);
  background: var(--panel);
}

.search-toggle {
  flex-basis: 62px;
  width: 62px;
  height: 62px;
  font-size: 28px;
}

.search-shell input {
  height: 62px;
  min-height: 62px;
}

.theme-toggle {
  position: relative;
  width: 62px;
  min-width: 62px;
  height: 62px;
  min-height: 62px;
  border: 3px solid #222225;
  border-radius: 20px;
  padding: 0;
  overflow: hidden;
  background: #f6f4fb;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.theme-toggle .theme-scene {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: inherit;
  background: transparent;
}

.theme-toggle .theme-scene::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #1b1b1f;
  transform: translate(-50%, -50%);
}

.theme-toggle .theme-scene::after {
  content: "";
  position: absolute;
  top: 39%;
  left: 58%;
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #f6f4fb;
  transform: translate(-50%, -50%);
}

.theme-toggle[data-theme="dark"] {
  background: #f6f4fb;
}

.theme-toggle[data-theme="dark"] .theme-scene {
  background: transparent;
}

.theme-toggle[data-theme="dark"] .theme-scene::before {
  transform: translate(-50%, -50%);
  background: #1b1b1f;
}

.theme-toggle[data-theme="dark"] .theme-scene::after {
  background: #f6f4fb;
}

.topbar .button {
  border: 0;
  padding: 0 22px;
}

.button.primary {
  background: #f7f4ff;
  color: #050505;
}

.button.secondary {
  background: #a37cff;
  color: #ffffff;
}

.view.active {
  padding: 0 clamp(16px, 2.8vw, 44px) clamp(30px, 4vw, 58px);
}

.kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.kpi-card,
.panel,
.metric-card,
.report-card,
.mini-insight,
.mini-chart-card,
.expense-total,
.card-tile,
.modal-card,
.collection-list,
.psa-cert-entry,
.psa-manual-card,
.psa-preview-stage {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  box-shadow: none;
}

.kpi-card {
  min-height: 136px;
  padding: 22px 24px;
}

.kpi-card strong {
  margin: 12px 0 4px;
  color: var(--green);
  font-size: clamp(32px, 4vw, 46px);
  line-height: 0.95;
}

.kpi-card span,
.metric-card p,
.report-card p {
  color: var(--muted);
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
  gap: 12px;
}

.panel {
  padding: 22px;
}

.chart-panel {
  grid-column: span 1;
}

.wide-panel {
  grid-column: span 2;
}

.panel-head {
  align-items: flex-start;
}

.panel h2,
.section-toolbar h2 {
  font-size: clamp(22px, 2.2vw, 32px);
  line-height: 1.02;
}

.chart-controls {
  justify-items: end;
}

.chip {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel-strong) 88%, transparent);
  color: var(--muted);
}

.chip.active,
.chip:hover,
:root[data-theme="light"] .chip.active,
:root[data-theme="light"] .chip:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.chart-wrap {
  height: 332px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(139, 92, 246, 0.11), transparent 55%),
    var(--panel-strong);
}

.mini-chart-card,
.mini-insight,
.expense-total {
  background: var(--panel-strong);
}

.bar {
  background: var(--panel-strong);
}

.bar span {
  background: linear-gradient(90deg, #8b5cf6, #c8ff3d);
}

table {
  min-width: 680px;
}

th {
  color: var(--muted);
  letter-spacing: 0.03em;
}

td {
  color: var(--ink);
}

input,
select,
textarea {
  border-color: var(--line);
  background: var(--panel-strong);
}

.modal-card {
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.44);
}

.dashboard-grid > *,
.split-tables > * {
  min-width: 0;
}

.table-wrap {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
}

@media (max-width: 1480px) {
  .sidebar {
    grid-template-columns: 1fr auto;
    gap: 10px;
  }

  .nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav-tools {
    grid-column: 2;
    grid-row: 1;
  }
}

@media (max-width: 1180px) {
  .sidebar {
    grid-template-columns: 1fr auto;
    gap: 10px;
  }

  .brand {
    justify-content: flex-start;
  }

  .nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .nav-tools {
    grid-column: 2;
    grid-row: 1;
  }

  .topbar {
    min-height: auto;
  }

  .topbar h1 {
    font-size: clamp(36px, 8vw, 58px);
  }

  .kpi-grid,
  .dashboard-grid,
  .performance-chart-grid,
  .split-tables,
  .finance-grid,
  .market-layout,
  .expense-summary {
    grid-template-columns: 1fr;
  }

  .wide-panel,
  .chart-panel {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .sidebar {
    min-height: auto;
    padding: 14px 16px;
  }

  .nav-item {
    min-height: 42px;
    padding: 0 16px;
  }

  .topbar {
    padding: 26px 16px 18px;
  }

  .topbar h1 {
    font-size: 38px;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
  }

  .save-status {
    display: none;
  }

  .search-shell.is-open {
    grid-column: 1 / -1;
    width: 100%;
  }

  .topbar .button {
    min-width: 0;
    width: 100%;
    padding: 0 10px;
    font-size: 14px;
    white-space: nowrap;
  }
}

/* Readability pass: calmer dashboard values and guided purchase fields. */
:root[data-theme="dark"] .kpi-card strong,
:root[data-theme="dark"] .metric-card strong,
:root[data-theme="dark"] .report-card strong {
  color: #f6f2ff;
}

:root[data-theme="light"] .kpi-card strong,
:root[data-theme="light"] .metric-card strong,
:root[data-theme="light"] .report-card strong {
  color: #4f2bd6;
}

.kpi-card {
  position: relative;
  overflow: hidden;
}

.kpi-card::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 0;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.85), rgba(200, 255, 61, 0.38));
  opacity: 0.72;
}

:root[data-theme="dark"] .psa-cert-entry {
  background: #16171b;
  color: #f6f2ff;
}

:root[data-theme="dark"] .psa-manual-grid {
  gap: 18px;
}

:root[data-theme="dark"] .psa-manual-card {
  border-color: rgba(255, 255, 255, 0.1);
  background: #101115;
  color: #f6f2ff;
}

:root[data-theme="dark"] .psa-manual-card:nth-child(2) {
  border-color: rgba(151, 117, 255, 0.72);
  background:
    linear-gradient(180deg, rgba(139, 92, 246, 0.16), transparent 34%),
    #111217;
  box-shadow:
    0 0 0 1px rgba(151, 117, 255, 0.18),
    0 24px 70px rgba(70, 43, 160, 0.16);
}

:root[data-theme="dark"] .psa-manual-card .eyebrow {
  color: #a9a4b8;
}

:root[data-theme="dark"] .psa-manual-card:nth-child(2) .eyebrow {
  color: #c7b8ff;
}

:root[data-theme="dark"] .psa-manual-card h4 {
  color: #ffffff;
  letter-spacing: 0;
}

:root[data-theme="dark"] .psa-manual-card label {
  gap: 9px;
  color: #c9c4d4;
  font-size: 14px;
}

:root[data-theme="dark"] .psa-manual-card:nth-child(2) label {
  color: #eee9ff;
}

:root[data-theme="dark"] .psa-manual-card input,
:root[data-theme="dark"] .psa-manual-card select,
:root[data-theme="dark"] .psa-manual-card textarea {
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: #17181d;
  color: #f8f5ff;
  font-size: 15px;
  font-weight: 800;
}

:root[data-theme="dark"] .psa-manual-card input::placeholder,
:root[data-theme="dark"] .psa-manual-card textarea::placeholder {
  color: #777380;
}

:root[data-theme="dark"] .psa-manual-card:nth-child(2) input,
:root[data-theme="dark"] .psa-manual-card:nth-child(2) select,
:root[data-theme="dark"] .psa-manual-card:nth-child(2) textarea {
  min-height: 52px;
  border-color: rgba(151, 117, 255, 0.42);
  background: #0c0d12;
}

:root[data-theme="dark"] .psa-manual-card input:focus,
:root[data-theme="dark"] .psa-manual-card select:focus,
:root[data-theme="dark"] .psa-manual-card textarea:focus {
  outline: 0;
  border-color: #9c7cff;
  box-shadow: 0 0 0 4px rgba(156, 124, 255, 0.18);
}

:root[data-theme="dark"] .psa-manual-card:nth-child(2) input:focus,
:root[data-theme="dark"] .psa-manual-card:nth-child(2) select:focus,
:root[data-theme="dark"] .psa-manual-card:nth-child(2) textarea:focus {
  box-shadow:
    0 0 0 4px rgba(156, 124, 255, 0.22),
    0 12px 30px rgba(84, 54, 190, 0.22);
}

:root[data-theme="dark"] .psa-manual-card .selected-stock {
  border-color: rgba(178, 202, 255, 0.28);
  background: #151d2b;
  color: #c7d8ff;
}

:root[data-theme="light"] .psa-manual-card:nth-child(2) {
  border-color: rgba(100, 53, 223, 0.32);
  background:
    linear-gradient(180deg, rgba(100, 53, 223, 0.08), transparent 38%),
    #ffffff;
  box-shadow: 0 20px 46px rgba(72, 44, 150, 0.1);
}

:root[data-theme="light"] .psa-manual-card:nth-child(2) input,
:root[data-theme="light"] .psa-manual-card:nth-child(2) select,
:root[data-theme="light"] .psa-manual-card:nth-child(2) textarea {
  border-color: rgba(100, 53, 223, 0.24);
  background: #faf9ff;
}

/* Collection value bar alignment. */
.collection-head,
.collection-row {
  grid-template-columns: minmax(400px, 2fr) minmax(96px, 0.52fr) minmax(104px, 0.56fr) minmax(104px, 0.56fr) minmax(108px, 0.58fr) minmax(224px, 0.9fr);
  gap: 16px;
}

.collection-head span:first-child {
  justify-self: start;
  text-align: left;
}

.collection-head span:not(:first-child) {
  justify-self: center;
  text-align: center;
}

.collection-row > div:not(.collection-main) {
  justify-self: center;
  text-align: center;
}

.collection-row > .collection-main {
  justify-self: stretch;
}

.collection-row > div:not(.collection-main) strong,
.collection-row > div:not(.collection-main) small {
  text-align: center;
}

.collection-row .card-actions.compact {
  justify-content: center;
  justify-self: center;
  flex-wrap: nowrap;
}

.collection-row .card-actions.compact .mini-button {
  min-height: 34px;
  padding: 0 9px;
  white-space: nowrap;
}

/* Final override: circular illustrated sun/moon theme toggle. */
.theme-toggle {
  width: 48px !important;
  min-width: 48px !important;
  height: 48px !important;
  min-height: 48px !important;
  border: 1px solid #c8ced8 !important;
  border-radius: 999px !important;
  padding: 0 !important;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.95), transparent 24px),
    #f8fafc !important;
  color: #1d2d44 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
  overflow: hidden !important;
  box-shadow:
    inset 0 -1px 0 rgba(15, 23, 42, 0.06),
    0 8px 20px rgba(15, 23, 42, 0.14) !important;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
}

.theme-toggle:hover {
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 1), transparent 24px),
    #ffffff !important;
  transform: scale(1.05);
}

.theme-toggle.is-dark {
  border-color: #334155 !important;
  background:
    radial-gradient(circle at 40% 18%, rgba(255, 255, 255, 0.08), transparent 22px),
    linear-gradient(145deg, #111827, #0f172a) !important;
  color: #ffd233 !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 10px 24px rgba(2, 6, 23, 0.36) !important;
}

.theme-toggle.is-dark:hover {
  background:
    radial-gradient(circle at 40% 18%, rgba(255, 255, 255, 0.1), transparent 22px),
    linear-gradient(145deg, #172033, #0f172a) !important;
}

.theme-icon {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.28);
  transform: translateX(-1px) rotate(-18deg);
}

.theme-icon::before {
  content: "";
  position: absolute;
  inset: -1px -5px 4px 8px;
  border-radius: 999px;
  background: #f8fafc;
}

.theme-toggle:hover .theme-icon::before {
  background: #ffffff;
}

.theme-toggle.is-dark .theme-icon {
  width: 21px;
  height: 21px;
  background: #ffd233;
  box-shadow:
    0 -15px 0 -7px #ffd233,
    0 15px 0 -7px #ffd233,
    15px 0 0 -7px #ffd233,
    -15px 0 0 -7px #ffd233,
    11px 11px 0 -7px #ffd233,
    -11px -11px 0 -7px #ffd233,
    11px -11px 0 -7px #ffd233,
    -11px 11px 0 -7px #ffd233,
    0 2px 8px rgba(255, 210, 51, 0.28);
  transform: none;
}

.theme-toggle.is-dark .theme-icon::before {
  display: none;
}

.profile-control {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.profile-avatar {
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.38), transparent 24px),
    linear-gradient(145deg, #d51b72, #a50f55);
  color: #ffffff;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 12px 26px rgba(165, 15, 85, 0.28);
  cursor: pointer;
  transition:
    transform 160ms cubic-bezier(0.2, 0, 0, 1),
    box-shadow 160ms cubic-bezier(0.2, 0, 0, 1),
    filter 160ms cubic-bezier(0.2, 0, 0, 1);
}

.profile-avatar:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.16),
    0 16px 34px rgba(165, 15, 85, 0.34);
}

.profile-avatar:active {
  transform: scale(0.96);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  outline: 1px solid var(--image-outline);
  outline-offset: -1px;
}

.profile-avatar span {
  font-size: 23px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
}

.profile-hero-card .profile-avatar.profile-avatar--large {
  width: clamp(220px, 32vw, 320px);
  min-width: clamp(220px, 32vw, 320px);
  height: clamp(220px, 32vw, 320px);
  min-height: clamp(220px, 32vw, 320px);
  border-radius: 999px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 0 0 10px color-mix(in srgb, var(--panel-strong) 72%, transparent),
    0 34px 92px rgba(165, 15, 85, 0.38);
}

.profile-hero-card .profile-avatar.profile-avatar--large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-hero-card .profile-avatar.profile-avatar--large span {
  font-size: clamp(84px, 10vw, 132px);
}

.profile-photo-modal[open] {
  width: min(980px, calc(100vw - 32px));
}

.profile-photo-card {
  overflow: visible;
}

.profile-photo-card .modal-head {
  margin-bottom: 22px;
}

.profile-photo-card .modal-head h2 {
  max-width: 680px;
  font-size: 42px;
  line-height: 1.03;
}

.profile-photo-editor {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(280px, 1fr);
  gap: 32px;
  align-items: stretch;
}

.profile-photo-preview {
  display: grid;
  place-items: center;
  min-width: 0;
}

.profile-photo-preview canvas {
  width: min(380px, 100%);
  height: auto;
  aspect-ratio: 1;
  display: block;
  border-radius: 999px;
  background: #111111;
  cursor: grab;
  touch-action: none;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 18px 46px rgba(0, 0, 0, 0.28);
}

.profile-photo-preview canvas:active {
  cursor: grabbing;
}

.profile-photo-controls {
  display: grid;
  align-content: center;
  gap: 18px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.profile-photo-file {
  margin: 0;
  color: var(--ink);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.profile-photo-controls input[type="range"] {
  width: 100%;
  min-height: 36px;
  accent-color: var(--green);
}

@media (max-width: 760px) {
  .profile-photo-modal[open] {
    width: min(560px, calc(100vw - 20px));
  }

  .profile-photo-card .modal-head h2 {
    font-size: 34px;
  }

  .profile-photo-editor {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .profile-photo-preview canvas {
    width: min(320px, 100%);
  }
}

.account-settings-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Vault-style card value editor. */
#cardValueModal[open] {
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  max-width: 100vw !important;
  height: 100dvh !important;
  max-height: none !important;
  display: block;
  overflow-x: hidden;
  overflow-y: auto;
  transform: none !important;
  background: #ffffff;
}

#cardValueModal::backdrop {
  background: #ffffff;
  backdrop-filter: none;
}

.card-value-modal {
  width: min(1540px, calc(100% - 48px));
  min-height: 100dvh;
  max-height: none;
  display: grid;
  grid-template-columns: minmax(0, 0.48fr) minmax(0, 0.52fr);
  gap: clamp(46px, 4.6vw, 76px);
  align-content: center;
  align-items: start;
  position: relative;
  overflow: visible;
  margin: 0 auto;
  padding: clamp(58px, 7dvh, 104px) 0;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  color: #202124;
  box-shadow: none;
  box-sizing: border-box;
}

:root:has(#cardValueModal[open]),
body:has(#cardValueModal[open]) {
  overflow-x: hidden;
}

.card-value-close {
  position: absolute;
  top: clamp(18px, 2vw, 30px);
  right: clamp(18px, 2vw, 30px);
  z-index: 2;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #111111;
  color: #ffffff;
}

.card-value-image-pane {
  min-height: clamp(560px, calc(100dvh - 190px), 860px);
  display: grid;
  place-items: center;
  position: relative;
  padding: clamp(34px, 5vw, 74px);
  border-radius: 18px;
  background: #f8f8f8;
}

.card-value-image-stage {
  width: 100%;
  height: 100%;
  min-height: clamp(460px, calc(100dvh - 300px), 700px);
  display: grid;
  place-items: center;
}

.card-value-image-stage img {
  width: 100%;
  height: 100%;
  max-height: clamp(480px, calc(100dvh - 240px), 760px);
  object-fit: contain;
  display: block;
}

.card-value-image-fallback {
  width: min(420px, 72%);
  aspect-ratio: 0.72;
  display: grid;
  place-items: center;
  color: #202124;
  background: #ffffff;
  border: 1px solid #ececec;
  border-radius: 18px;
  font-size: clamp(90px, 11vw, 168px);
  font-weight: 950;
  line-height: 1;
}

.card-value-image-actions {
  position: absolute;
  left: 50%;
  bottom: clamp(28px, 3.4vw, 58px);
  display: flex;
  gap: 14px;
  transform: translateX(-50%);
}

.card-value-image-actions span {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 1px solid #dedede;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #383838;
  font-size: 26px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.card-value-detail-pane {
  display: grid;
  align-content: start;
  gap: clamp(28px, 3.2vw, 46px);
  min-width: 0;
  padding-right: 0;
}

.card-value-kicker {
  margin: 0;
  color: #6b6c70;
  font-size: clamp(22px, 2.1vw, 32px);
  line-height: 1.08;
  font-weight: 900;
  text-transform: uppercase;
}

.card-value-detail-pane h2 {
  margin: 0;
  color: #202124;
  font-size: clamp(64px, 6.1vw, 112px);
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.card-value-estimates {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(22px, 4vw, 70px);
  align-items: start;
}

.card-value-estimates div {
  min-width: 0;
}

.card-value-estimates span,
.card-value-fact span {
  display: block;
  color: #6b6c70;
  font-size: clamp(15px, 1.25vw, 20px);
  font-weight: 900;
  line-height: 1.15;
  text-transform: uppercase;
}

.card-value-estimates strong {
  display: block;
  margin-top: 12px;
  color: #202124;
  font-size: clamp(34px, 3vw, 48px);
  line-height: 1;
  font-weight: 950;
}

.card-value-estimates small {
  display: block;
  margin-top: 10px;
  color: #525357;
  font-size: clamp(13px, 1.1vw, 17px);
  line-height: 1.3;
  font-weight: 850;
}

.card-value-estimates a {
  color: #202124;
}

.card-value-save {
  min-height: 76px;
  width: 100%;
  border: 0;
  border-radius: 999px;
  background: #111111;
  color: #ffffff;
  font-size: clamp(20px, 1.55vw, 28px);
  font-weight: 950;
  letter-spacing: 0;
}

.card-value-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.card-value-fact {
  min-height: 122px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  margin: 0;
  padding: 20px;
  border: 0;
  border-radius: 20px;
  background: #f8f8f8;
  color: #202124;
  text-align: center;
}

.card-value-fact strong {
  color: #202124;
  font-size: clamp(19px, 1.55vw, 26px);
  line-height: 1.05;
  font-weight: 950;
}

.card-value-modal input,
.card-value-modal select {
  min-height: 42px;
  width: 100%;
  padding: 0 8px;
  border: 0;
  border-bottom: 2px solid #202124;
  border-radius: 0;
  background: transparent;
  color: #202124;
  font-size: clamp(20px, 1.55vw, 27px);
  font-weight: 950;
  text-align: center;
  box-shadow: none;
}

.card-value-modal select {
  appearance: auto;
}

:root[data-theme="dark"] .card-value-modal {
  background: #ffffff;
  color: #202124;
}

@media (max-width: 1180px) {
  .card-value-modal {
    width: min(860px, calc(100vw - 36px));
    grid-template-columns: 1fr;
    align-content: start;
    gap: 34px;
    padding: 32px 0 46px;
  }

  .card-value-image-pane {
    min-height: min(560px, calc(100dvh - 220px));
  }

  .card-value-image-stage {
    min-height: 430px;
  }

  .card-value-detail-pane {
    align-content: start;
    padding-right: 0;
  }
}

@media (max-width: 720px) {
  #cardValueModal[open] {
    width: 100% !important;
  }

  .card-value-modal {
    width: min(100%, calc(100% - 24px));
    padding: 18px 0 30px;
  }

  .card-value-image-pane {
    min-height: 360px;
    padding: 20px;
  }

  .card-value-image-stage {
    min-height: 300px;
  }

  .card-value-detail-pane h2 {
    font-size: clamp(42px, 14vw, 68px);
  }

  .card-value-estimates,
  .card-value-facts {
    grid-template-columns: 1fr;
  }

  .card-value-save {
    min-height: 66px;
  }

  .card-value-fact {
    min-height: 104px;
  }
}

/* Interface polish pass: typography, surfaces, hit areas, and tactile states. */
:root {
  --shadow-border:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 12px 34px rgba(0, 0, 0, 0.18);
  --shadow-border-hover:
    0 0 0 1px rgba(255, 255, 255, 0.13),
    0 18px 44px rgba(0, 0, 0, 0.24);
  --image-outline: rgba(255, 255, 255, 0.1);
}

:root[data-theme="light"] {
  --shadow-border:
    0 0 0 1px rgba(0, 0, 0, 0.06),
    0 1px 2px -1px rgba(0, 0, 0, 0.06),
    0 12px 28px rgba(0, 0, 0, 0.05);
  --shadow-border-hover:
    0 0 0 1px rgba(0, 0, 0, 0.08),
    0 2px 4px -1px rgba(0, 0, 0, 0.08),
    0 16px 34px rgba(0, 0, 0, 0.07);
  --image-outline: rgba(0, 0, 0, 0.1);
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
.card-value-detail-pane h2,
.collection-main strong {
  text-wrap: balance;
}

p,
small,
.muted,
.action-item span,
.backup-row span,
.mini-insight span,
.report-card p {
  text-wrap: pretty;
}

.kpi-card strong,
.metric-card strong,
.report-card strong,
.mini-insight strong,
.expense-total strong,
td,
.flow-meta span,
.save-status,
.sidebar-card strong,
.card-value-estimates strong,
.card-value-fact strong {
  font-variant-numeric: tabular-nums;
}

.panel,
.kpi-card,
.metric-card,
.report-card,
.mini-insight,
.mini-chart-card,
.expense-total,
.card-tile,
.collection-list,
.backup-manager,
.backup-row,
.action-item,
.modal-card {
  border-color: transparent;
  box-shadow: var(--shadow-border);
  transition-property: box-shadow, transform, background-color;
  transition-duration: 180ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.panel:hover,
.kpi-card:hover,
.metric-card:hover,
.report-card:hover,
.mini-insight:hover,
.mini-chart-card:hover,
.expense-total:hover,
.card-tile:hover,
.backup-row:hover,
.action-item:hover {
  box-shadow: var(--shadow-border-hover);
}

.backup-manager,
.action-panel {
  border-radius: 24px;
}

.backup-row,
.action-item,
.mini-insight,
.mini-chart-card,
.expense-total {
  border-radius: 16px;
}

.card-body,
.backup-manager,
.action-panel {
  padding: 16px;
}

.button,
.text-button,
.icon-button,
.mini-button,
.chip,
.nav-item,
.logo-button,
.search-pill,
.theme-toggle,
.profile-avatar {
  min-height: 40px;
  transition-property: transform, background-color, color, box-shadow, opacity;
  transition-duration: 160ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.button:active,
.text-button:active,
.icon-button:active,
.mini-button:active,
.chip:active,
.nav-item:active,
.logo-button:active,
.search-pill:active,
.theme-toggle:active,
.profile-avatar:active {
  transform: scale(0.96);
}

.icon-button,
.theme-toggle,
.search-pill,
.profile-avatar {
  min-width: 40px;
}

.mini-button {
  min-height: 40px;
  padding-inline: 12px;
}

.button.ghost,
.mini-button,
.chip,
.logo-button {
  box-shadow: var(--shadow-border);
}

.button.ghost:hover,
.mini-button:hover,
.chip:hover,
.logo-button:hover {
  box-shadow: var(--shadow-border-hover);
}

.brand-mark img,
.collection-image img,
.card-art img,
.detail-image img,
.psa-preview-stage img,
.card-value-image-stage img,
.logo-image-button img {
  outline: 1px solid var(--image-outline);
  outline-offset: -1px;
}

.collection-image,
.card-art,
.detail-image,
.psa-preview-stage,
.card-value-image-pane {
  box-shadow: var(--shadow-border);
}

.toast {
  transition-property: opacity, transform;
  transition-duration: 180ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.collection-showcase {
  display: grid;
  grid-template-columns: minmax(340px, 0.58fr) minmax(0, 1.42fr);
  gap: 14px;
  min-height: 258px;
  margin-bottom: 14px;
  padding: 16px;
  border-radius: 28px;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at 14% 8%, color-mix(in srgb, var(--green) 24%, transparent), transparent 30%),
    radial-gradient(circle at 88% 18%, color-mix(in srgb, var(--blue) 28%, transparent), transparent 34%),
    linear-gradient(135deg, color-mix(in srgb, var(--panel) 82%, #000 18%), var(--panel-strong));
  box-shadow: var(--shadow-border);
}

.collection-showcase::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 56%, color-mix(in srgb, var(--bg) 22%, transparent));
}

.showcase-feature {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: space-between;
  gap: 18px;
  min-width: 0;
  padding: 8px;
}

.showcase-copy {
  display: grid;
  gap: 10px;
}

.showcase-copy h2 {
  max-width: 520px;
  margin: 0;
  font-size: clamp(30px, 4vw, 56px);
  line-height: 0.96;
  letter-spacing: 0;
  text-wrap: balance;
}

.showcase-copy p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  text-wrap: pretty;
}

.showcase-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.showcase-metrics span {
  min-width: 0;
  padding: 14px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 72%, transparent);
  box-shadow: var(--shadow-border);
}

.showcase-metrics strong,
.showcase-metrics small {
  display: block;
}

.showcase-metrics strong {
  font-size: clamp(22px, 2vw, 32px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.showcase-metrics small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.showcase-rail {
  min-width: 0;
  overflow: hidden;
  padding: 2px 0;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.showcase-track {
  width: max-content;
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.showcase-track.is-animated {
  animation: showcase-scroll max(24s, calc(var(--showcase-count) * 3.4s)) linear infinite;
}

.showcase-rail:hover .showcase-track {
  animation-play-state: paused;
}

.showcase-card {
  width: 176px;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 10px;
  padding: 10px;
  border-radius: 22px;
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  box-shadow: var(--shadow-border);
}

.showcase-card-image {
  height: 208px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--blue) 22%, transparent), transparent),
    var(--panel-strong);
  color: var(--blue);
  font-size: 54px;
  font-weight: 950;
}

.showcase-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  outline: 1px solid var(--image-outline);
  outline-offset: -1px;
}

.showcase-card strong,
.showcase-card span {
  display: block;
}

.showcase-card strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.showcase-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.showcase-empty {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 30px;
  text-align: center;
}

.showcase-empty strong {
  font-size: 28px;
}

@keyframes showcase-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-50% - 6px)); }
}

.finance-pulse {
  display: grid;
  gap: 14px;
  align-content: start;
}

.cash-flow {
  gap: 12px;
  margin-top: 0;
}

.cash-hero-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 90% 0%, color-mix(in srgb, var(--green) 24%, transparent), transparent 38%),
    var(--panel-strong);
  box-shadow: var(--shadow-border);
}

.cash-hero-card strong {
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.cash-hero-card small {
  color: var(--muted);
  line-height: 1.35;
  text-wrap: pretty;
}

.cash-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.cash-stat-grid article {
  min-width: 0;
  padding: 11px;
  border-radius: 16px;
  background: var(--panel-strong);
  box-shadow: var(--shadow-border);
}

.cash-stat-grid span,
.cash-stat-grid strong {
  display: block;
}

.cash-stat-grid span {
  color: var(--muted);
  font-size: 11px;
}

.cash-stat-grid strong {
  margin-top: 6px;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.cash-flow-list {
  display: grid;
  gap: 10px;
}

@media (max-width: 1180px) {
  .collection-showcase {
    grid-template-columns: 1fr;
  }

  .showcase-card {
    width: 158px;
  }

  .showcase-card-image {
    height: 188px;
  }
}

@media (max-width: 720px) {
  .collection-showcase {
    padding: 12px;
    border-radius: 22px;
  }

  .showcase-feature {
    padding: 4px;
  }

  .showcase-metrics {
    grid-template-columns: 1fr;
  }

  .showcase-card {
    width: 138px;
  }

  .showcase-card-image {
    height: 166px;
  }

  .cash-stat-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .showcase-track {
    animation: none;
  }
}

/* Module icons: clearer symbols for the main business areas. */
.nav-item {
  position: relative;
  padding-left: 56px;
}

.nav-item::before {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 28px;
  height: 28px;
  margin: 0;
  border-radius: 10px;
  transform: translateY(-50%);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--green) 80%, #ffffff 12%), color-mix(in srgb, var(--blue) 72%, #000 12%));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 8px 18px color-mix(in srgb, var(--green) 26%, transparent);
}

.nav-item::after {
  content: "";
  position: absolute;
  left: 23px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  color: #ffffff;
  opacity: 0.96;
  pointer-events: none;
}

.nav-item[data-view="inventory"]::after {
  width: 13px;
  height: 17px;
  border: 2px solid currentColor;
  border-radius: 3px;
  background: transparent;
  box-shadow:
    4px -3px 0 -1px currentColor,
    -4px 3px 0 -1px color-mix(in srgb, currentColor 78%, transparent);
}

.nav-item[data-view="finance"]::after {
  content: "€";
  left: 21px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
}

.nav-item[data-view="listings"]::after {
  left: 24px;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 4px 4px 4px 1px;
  transform: translateY(-50%) rotate(-10deg);
}

.nav-item[data-view="listings"]::before {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--amber) 86%, #ffffff 8%), color-mix(in srgb, var(--red) 72%, #000 12%));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 8px 18px color-mix(in srgb, var(--amber) 28%, transparent);
}

.nav-item[data-view="market"]::after {
  left: 22px;
  width: 18px;
  height: 16px;
  border-radius: 2px;
  background:
    linear-gradient(currentColor, currentColor) 0 9px / 3px 7px no-repeat,
    linear-gradient(currentColor, currentColor) 7px 5px / 3px 11px no-repeat,
    linear-gradient(currentColor, currentColor) 14px 0 / 3px 16px no-repeat;
}

.nav-item[data-view="market"]::before {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--blue) 80%, #ffffff 10%), color-mix(in srgb, var(--green) 72%, #000 12%));
}

.nav-item[data-view="finance"]::before {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--green) 86%, #ffffff 10%), color-mix(in srgb, var(--cash-green) 68%, #000 12%));
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.chart-panel .chart-wrap {
  contain: paint;
  position: relative;
}

.chart-wrap canvas:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
}

.chart-tooltip {
  position: absolute;
  z-index: 5;
  width: min(260px, calc(100% - 24px));
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, var(--ink));
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-strong) 92%, transparent);
  color: var(--ink);
  box-shadow: var(--shadow-border-hover);
  pointer-events: none;
}

.chart-tooltip[hidden] {
  display: none;
}

.chart-tooltip > strong {
  font-size: 12px;
  line-height: 1.1;
  color: var(--muted);
  text-transform: uppercase;
}

.chart-tooltip__row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}

.chart-tooltip__row i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.chart-tooltip__row span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-tooltip__row strong {
  font-variant-numeric: tabular-nums;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.chart-panel.is-chart-transitioning .chart-wrap {
  view-transition-name: performance-chart;
}

.chart-panel.is-chart-transitioning #performanceLegend {
  view-transition-name: performance-chart-legend;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-old(performance-chart),
::view-transition-new(performance-chart),
::view-transition-old(performance-chart-legend),
::view-transition-new(performance-chart-legend) {
  mix-blend-mode: normal;
}

::view-transition-old(performance-chart),
::view-transition-old(performance-chart-legend) {
  animation: var(--duration-exit) ease-in fade reverse;
}

::view-transition-new(performance-chart),
::view-transition-new(performance-chart-legend) {
  animation: var(--duration-enter) ease-out var(--duration-exit) both fade;
}

/* Complete navigation icon set: visible on both dark and light themes. */
.nav-item[data-view] {
  --nav-icon-a: var(--blue);
  --nav-icon-b: var(--green);
  position: relative;
  padding-left: 56px;
}

.nav-item[data-view]::before {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 28px;
  height: 28px;
  margin: 0;
  border-radius: 10px;
  transform: translateY(-50%);
  background:
    radial-gradient(circle at 32% 22%, rgba(255, 255, 255, 0.34), transparent 36%),
    linear-gradient(145deg, color-mix(in srgb, var(--nav-icon-a) 88%, #ffffff 8%), color-mix(in srgb, var(--nav-icon-b) 74%, #000 12%));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 8px 18px color-mix(in srgb, var(--nav-icon-a) 26%, transparent);
}

.nav-item[data-view]::after {
  content: "";
  position: absolute;
  left: 23px;
  top: 50%;
  width: 14px;
  height: 14px;
  color: #ffffff;
  opacity: 0.98;
  pointer-events: none;
  transform: translateY(-50%);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.22));
}

.nav-item[data-view="dashboard"] {
  --nav-icon-a: #8b5cf6;
  --nav-icon-b: #4f91d8;
}

.nav-item[data-view="dashboard"]::after {
  width: 5px;
  height: 5px;
  border-radius: 2px;
  background: currentColor;
  box-shadow:
    9px 0 0 currentColor,
    0 9px 0 currentColor,
    9px 9px 0 currentColor;
}

.nav-item[data-view="sales"] {
  --nav-icon-a: var(--cash-green);
  --nav-icon-b: var(--green);
}

.nav-item[data-view="sales"]::after {
  left: 22px;
  width: 17px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 4px;
  background:
    linear-gradient(currentColor, currentColor) 4px 4px / 9px 2px no-repeat,
    linear-gradient(currentColor, currentColor) 4px 8px / 6px 2px no-repeat;
}

.nav-item[data-view="purchases"] {
  --nav-icon-a: var(--amber);
  --nav-icon-b: var(--red);
}

.nav-item[data-view="purchases"]::after {
  left: 22px;
  width: 17px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 4px 4px 5px 5px;
  background: transparent;
}

.nav-item[data-view="purchases"]::after {
  box-shadow: inset 0 5px 0 -3px currentColor;
}

.nav-item[data-view="inventory"] {
  --nav-icon-a: #8b5cf6;
  --nav-icon-b: #4f91d8;
}

.nav-item[data-view="inventory"]::after {
  left: 22px;
  width: 13px;
  height: 17px;
  border: 2px solid currentColor;
  border-radius: 3px;
  background: transparent;
  box-shadow:
    5px -3px 0 -1px currentColor,
    -4px 3px 0 -1px rgba(255, 255, 255, 0.7);
}

.nav-item[data-view="grading"] {
  --nav-icon-a: #6d5dfc;
  --nav-icon-b: #d5a44c;
}

.nav-item[data-view="grading"]::after {
  left: 22px;
  width: 17px;
  height: 17px;
  border: 2px solid currentColor;
  border-radius: 999px;
  background:
    linear-gradient(135deg, transparent 47%, currentColor 48% 60%, transparent 61%) center / 10px 10px no-repeat;
}

.nav-item[data-view="finance"] {
  --nav-icon-a: var(--green);
  --nav-icon-b: var(--cash-green);
}

.nav-item[data-view="finance"]::after {
  content: "€";
  left: 21px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 999px;
  background: transparent;
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
}

.nav-item[data-view="market"] {
  --nav-icon-a: var(--blue);
  --nav-icon-b: var(--green);
}

.nav-item[data-view="market"]::after {
  left: 22px;
  width: 18px;
  height: 16px;
  border-radius: 2px;
  background:
    linear-gradient(currentColor, currentColor) 0 9px / 3px 7px no-repeat,
    linear-gradient(currentColor, currentColor) 7px 5px / 3px 11px no-repeat,
    linear-gradient(currentColor, currentColor) 14px 0 / 3px 16px no-repeat;
}

.nav-item[data-view="listings"] {
  --nav-icon-a: var(--amber);
  --nav-icon-b: var(--red);
}

.nav-item[data-view="listings"]::after {
  left: 24px;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 4px 4px 4px 1px;
  background: transparent;
  transform: translateY(-50%) rotate(-10deg);
}

.nav-item[data-view="reports"] {
  --nav-icon-a: #7c89ff;
  --nav-icon-b: var(--blue);
}

.nav-item[data-view="reports"]::after {
  left: 23px;
  width: 14px;
  height: 17px;
  border: 2px solid currentColor;
  border-radius: 3px;
  background:
    linear-gradient(currentColor, currentColor) 3px 5px / 8px 2px no-repeat,
    linear-gradient(currentColor, currentColor) 3px 10px / 6px 2px no-repeat;
}

.nav-item[data-view="audit"] {
  --nav-icon-a: #58c88f;
  --nav-icon-b: #4f91d8;
}

.nav-item[data-view="audit"]::after {
  left: 22px;
  width: 17px;
  height: 17px;
  border: 2px solid currentColor;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, currentColor 0 2px, transparent 2.5px),
    linear-gradient(currentColor, currentColor) center 3px / 2px 6px no-repeat;
}

.nav-item[data-view="settings"] {
  --nav-icon-a: #9ca3af;
  --nav-icon-b: #6d5dfc;
}

.nav-item[data-view="settings"]::after {
  left: 22px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, transparent 0 4px, currentColor 4.5px 7px, transparent 7.5px),
    conic-gradient(from 0deg, currentColor 0 10%, transparent 10% 20%, currentColor 20% 30%, transparent 30% 40%, currentColor 40% 50%, transparent 50% 60%, currentColor 60% 70%, transparent 70% 80%, currentColor 80% 90%, transparent 90% 100%);
}

:root[data-theme="light"] .nav-item[data-view]::before {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.46),
    0 8px 18px color-mix(in srgb, var(--nav-icon-a) 18%, transparent);
}

/* Wide account pages: use the full workspace instead of leaving empty desktop space. */
#profileView .section-toolbar,
#settingsView .section-toolbar {
  max-width: none;
}

.profile-layout {
  width: 100%;
  max-width: none;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.profile-hero-card {
  grid-column: span 3;
}

#profileInfoForm {
  grid-column: span 5;
}

#profilePasswordForm {
  grid-column: span 4;
}

.profile-layout > .profile-card:nth-child(4),
.profile-layout > .profile-card:nth-child(5) {
  grid-column: span 6;
}

.profile-hero-card,
.profile-card {
  min-width: 0;
  height: 100%;
}

.settings-panel {
  width: 100%;
  max-width: none;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.settings-partners-card {
  grid-column: 1 / -1;
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.settings-team-card {
  grid-column: 1 / -1;
  display: grid;
  gap: 20px;
  padding: 24px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--blue) 8%, transparent), transparent 34%),
    var(--panel-strong);
  box-shadow: var(--shadow-border);
}

.settings-team-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.settings-team-head h3 {
  margin: 4px 0 6px;
  font-size: 24px;
  text-wrap: balance;
}

.settings-team-head .muted {
  max-width: 760px;
  margin: 0;
  line-height: 1.55;
  text-wrap: pretty;
}

.settings-team-permissions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.settings-team-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
}

.settings-team-list > .eyebrow {
  grid-column: 1 / -1;
  margin-bottom: -2px;
}

.settings-team-invite {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(260px, 1.15fr) minmax(170px, 0.55fr) auto;
  gap: 14px;
  align-items: end;
  padding: 16px;
  border-radius: 16px;
  background:
    linear-gradient(105deg, color-mix(in srgb, var(--blue) 12%, transparent), transparent 52%),
    color-mix(in srgb, var(--panel) 82%, transparent);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--blue) 18%, var(--line)),
    0 12px 30px rgba(0, 0, 0, 0.08);
}

.settings-team-invite__intro {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

.settings-team-invite__icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  margin: 0;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 23px;
  font-weight: 500;
  line-height: 1;
}

.settings-team-invite__intro strong,
.settings-team-invite__intro > div > span {
  display: block;
}

.settings-team-invite__intro strong {
  color: var(--ink);
  font-size: 14px;
}

.settings-team-invite__intro > div > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  text-wrap: pretty;
}

.settings-team-invite label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.settings-team-invite input,
.settings-team-invite select,
.settings-team-invite__submit {
  height: 44px;
  min-height: 44px;
}

.settings-team-invite input,
.settings-team-invite select {
  padding-block: 0;
}

.settings-team-invite select {
  line-height: 44px;
}

.settings-team-invite__submit {
  min-width: 128px;
}

.settings-team-invites {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.settings-team-invites[hidden] {
  display: none;
}

.settings-team-invites > .eyebrow {
  margin-bottom: -2px;
}

.settings-team-invites .team-invite-created,
.settings-team-invites .team-row {
  border-radius: 16px;
}

.team-member-identity {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.team-member-avatar {
  width: 56px;
  height: 56px;
  min-width: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  object-fit: cover;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 17px;
  font-weight: 900;
  outline: 1px solid rgba(255, 255, 255, 0.1);
}

:root[data-theme="light"] .team-member-avatar {
  outline-color: rgba(0, 0, 0, 0.1);
}

.team-member-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.team-member-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.team-member-heading > strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.2;
}

.team-self-pill {
  display: inline-grid;
  min-height: 22px;
  place-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.team-member-email {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.team-member-workspace {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.team-member-workspace span,
.team-member-workspace strong {
  display: inline;
  margin: 0;
  font-size: inherit;
}

.team-member-workspace span {
  color: var(--muted);
}

.team-member-workspace strong {
  color: var(--ink);
  font-weight: 800;
}

.team-row select,
.team-row button {
  transition-property: transform, background-color, border-color, color, opacity;
  transition-duration: 160ms;
}

.team-row select:active,
.team-row button:active {
  transform: scale(0.96);
}

.settings-partners-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.settings-partners-head h3 {
  margin: 4px 0 6px;
  font-size: 24px;
}

.settings-partners-head .muted {
  max-width: 760px;
  margin: 0;
  line-height: 1.55;
}

.settings-partners-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.partner-plan-limit {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.partner-list {
  display: grid;
  gap: 10px;
}

.partner-row {
  display: grid;
  grid-template-columns: 52px minmax(180px, 1fr) minmax(140px, 0.32fr) 44px;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.partner-row__index {
  align-self: center;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.partner-row label {
  min-width: 0;
}

.partner-share-field {
  position: relative;
}

.partner-share-field input {
  padding-right: 38px;
  font-variant-numeric: tabular-nums;
}

.partner-share-field span {
  position: absolute;
  right: 14px;
  bottom: 13px;
  color: var(--muted);
  font-weight: 900;
  pointer-events: none;
}

.partner-remove-button {
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.partner-share-summary {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) minmax(260px, auto);
  align-items: center;
  gap: 16px;
}

.partner-share-summary > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
}

.partner-share-summary span,
.partner-share-summary p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.partner-share-summary strong {
  color: var(--ink);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.partner-share-summary p {
  margin: 0;
  text-align: right;
}

.partner-share-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.partner-share-track span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 180ms ease, background-color 180ms ease;
}

.settings-partners-card.is-invalid {
  border-color: color-mix(in srgb, var(--red) 58%, var(--line));
}

.settings-partners-card.is-invalid .partner-share-summary strong,
.settings-partners-card.is-invalid .partner-share-summary p {
  color: var(--red);
}

.settings-partners-card.is-invalid .partner-share-track span {
  background: var(--red);
}

.settings-panel > label {
  min-width: 0;
  grid-column: span 4;
}

.settings-theme-card {
  grid-column: span 5;
  height: 100%;
}

.account-settings-card {
  grid-column: span 7;
  min-width: 0;
  height: 100%;
}

.settings-actions,
.backup-manager {
  grid-column: 1 / -1;
}

.settings-actions {
  align-items: center;
}

.settings-actions:last-child {
  justify-content: flex-end;
}

.backup-list {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.backup-row {
  min-width: 0;
}

.profile-layout > .team-card {
  grid-column: 1 / -1;
  height: auto;
}

.team-card {
  grid-template-columns: minmax(280px, 0.45fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.team-card > div:first-child {
  align-self: start;
}

.team-invite-form {
  grid-column: 1;
  grid-template-columns: 1fr;
  align-items: stretch;
}

.team-invite-form .button {
  width: fit-content;
  min-width: 150px;
}

.team-card > .form-status {
  grid-column: 1;
  min-height: 22px;
}

.team-card > .team-list {
  grid-column: 2;
}

.audit-panel {
  display: grid;
  gap: 14px;
}

.audit-list {
  display: grid;
  gap: 10px;
}

.audit-row {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: var(--panel-strong);
  box-shadow: var(--shadow-border);
}

.audit-row::before {
  content: "";
  position: absolute;
  left: 22px;
  top: 38px;
  bottom: -10px;
  width: 1px;
  background: var(--line);
}

.audit-row:last-child::before {
  display: none;
}

.audit-row__marker {
  width: 10px;
  height: 10px;
  margin-top: 7px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 5px var(--green-soft);
}

.audit-row__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.audit-row__head strong {
  color: var(--ink);
  font-size: 15px;
}

.audit-row__head span,
.audit-row p,
.audit-row small {
  color: var(--muted);
}

.audit-row p {
  margin: 5px 0 2px;
}

.audit-row small {
  display: block;
  overflow-wrap: anywhere;
}

.audit-row code {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-top: 9px;
  overflow: hidden;
  padding: 7px 9px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-row {
  grid-template-columns: minmax(0, 1fr) minmax(240px, auto);
  padding: 16px 18px;
}

.team-row__actions {
  align-self: center;
  justify-content: end;
  min-width: 0;
}

.team-row__actions select {
  width: 180px;
  max-width: 100%;
}

.team-row .mini-button {
  min-height: 40px;
}

.team-card .team-permission-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.team-permission-grid article {
  position: relative;
  min-width: 0;
  min-height: 76px;
  padding: 14px 16px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 62%, transparent);
  box-shadow: var(--shadow-border);
}

.team-permission-grid strong,
.team-permission-grid span {
  display: block;
}

.team-permission-grid strong {
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.team-permission-grid span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.team-invite-created {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 96% 0%, color-mix(in srgb, var(--green) 22%, transparent), transparent 36%),
    var(--panel-strong);
  box-shadow: var(--shadow-border);
}

.team-invite-created strong,
.team-invite-created p,
.team-invite-created code {
  display: block;
}

.team-invite-created strong {
  margin-top: 8px;
  font-size: 18px;
}

.team-invite-created p {
  margin: 6px 0 10px;
  color: var(--muted);
}

.team-invite-created code {
  max-width: 100%;
  overflow: hidden;
  padding: 8px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-state-pill {
  width: fit-content;
  display: inline-grid;
  align-self: center;
  place-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.team-state-pill.is-expired {
  background: var(--red-soft);
  color: var(--red);
}

.team-row--expired {
  opacity: 0.68;
}

#teamInvitesList .team-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

#teamMembersList .team-row,
.settings-team-list .team-row {
  grid-template-columns: minmax(0, 1fr) minmax(240px, auto);
}

.settings-team-list .team-row {
  width: 100%;
  min-height: 92px;
  border-radius: 16px;
  background:
    linear-gradient(100deg, color-mix(in srgb, var(--blue) 7%, transparent), transparent 42%),
    color-mix(in srgb, var(--panel) 78%, transparent);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--line) 82%, transparent),
    0 12px 28px rgba(0, 0, 0, 0.08);
}

.settings-team-list .team-row__actions {
  align-self: stretch;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.team-role-pill {
  margin: 0;
  line-height: 1;
}

.team-row .team-role-pill--owner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 104px;
  min-height: 40px;
  margin: 0;
  padding: 0 14px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.team-row .team-role-pill--owner > span {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  display: block;
  margin: 0;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.profile-control {
  position: relative;
  z-index: 20;
}

.profile-control.is-open .profile-avatar {
  outline: 2px solid color-mix(in srgb, var(--green) 70%, #ffffff 12%);
  outline-offset: 3px;
}

.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  z-index: 60;
  width: min(380px, calc(100vw - 28px));
  overflow: hidden;
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel-strong) 94%, #000 6%);
  color: var(--ink);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--line) 78%, transparent),
    0 22px 54px rgba(0, 0, 0, 0.34);
  transform-origin: top right;
  animation: account-menu-in 150ms cubic-bezier(0.2, 0, 0, 1);
}

.account-menu[hidden] {
  display: none;
}

.account-menu__identity {
  display: grid;
  gap: 4px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.account-menu__identity strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu__identity span,
.account-menu__group p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.account-menu__group {
  display: grid;
  gap: 2px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.account-menu__group:last-child {
  border-bottom: 0;
}

.account-menu__group button {
  min-height: 42px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 15px;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  transition-property: background-color, color, scale;
  transition-duration: 140ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.account-menu__group button:hover,
.account-menu__group button.active {
  background: color-mix(in srgb, var(--line) 48%, transparent);
  color: var(--ink);
}

.account-menu__group button:active {
  scale: 0.96;
}

.account-menu__group button span {
  display: grid;
  place-items: center;
  color: inherit;
  font-weight: 800;
}

.account-menu__group [data-theme-choice] span {
  width: 9px;
  height: 9px;
  margin-left: 8px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0;
}

.account-menu__group [data-theme-choice].active span {
  opacity: 1;
}

.profile-section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.profile-section-tabs .chip.active {
  background: var(--ink);
  color: var(--bg);
}

.profile-layout > [data-profile-section] {
  grid-column: 1 / -1;
}

.profile-layout > [data-profile-section="personal"].profile-hero-card {
  grid-column: span 5;
}

.profile-layout > [data-profile-section="personal"]#profileInfoForm {
  grid-column: span 4;
}

.profile-layout > [data-profile-section="personal"]#profilePasswordForm {
  grid-column: span 3;
}

#profileView .profile-layout > .pricing-page-card[data-profile-section="plan"] {
  grid-column: 1 / -1;
}

#profileView .profile-layout > .promo-plan-card[data-profile-section="plan"] {
  grid-column: 1 / -1;
}

.pricing-page-card {
  width: min(100%, 1520px);
  justify-self: center;
  align-content: start;
  padding-inline: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.pricing-page-card > div:first-child {
  width: min(100%, 1440px);
  margin-inline: auto;
}

.beta-plan-notice {
  width: min(100%, 760px);
  min-height: 128px;
  margin-inline: auto;
  padding: clamp(20px, 3vw, 30px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 92% 8%, color-mix(in srgb, var(--green) 24%, transparent), transparent 42%),
    color-mix(in srgb, var(--panel-strong) 94%, var(--bg) 6%);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--green) 32%, transparent),
    0 18px 52px color-mix(in srgb, var(--green) 12%, transparent);
}

.beta-plan-notice__badge {
  min-height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.beta-plan-notice strong {
  display: block;
  color: var(--ink);
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.1;
  text-wrap: balance;
}

.beta-plan-notice p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
  text-wrap: pretty;
}

.promo-plan-card {
  width: min(100%, 1520px);
  justify-self: center;
  min-height: 180px;
  align-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 12%, color-mix(in srgb, var(--green) 22%, transparent), transparent 34%),
    radial-gradient(circle at 10% 90%, color-mix(in srgb, var(--blue) 16%, transparent), transparent 30%),
    var(--panel);
}

.promo-plan-card > div {
  max-width: 780px;
}

.promo-plan-card h3 {
  font-size: clamp(30px, 4vw, 52px);
  line-height: 0.98;
  text-wrap: balance;
}

.promo-plan-card .muted {
  max-width: 680px;
  font-size: clamp(15px, 1.4vw, 19px);
  line-height: 1.45;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 420px));
  justify-content: center;
  gap: clamp(22px, 2.4vw, 38px);
  width: min(100%, 1440px);
  margin-inline: auto;
}

.pricing-card {
  min-width: 0;
  min-height: 590px;
  display: grid;
  align-content: start;
  gap: 18px;
  padding: clamp(20px, 2.5vw, 30px);
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel-strong) 94%, var(--bg) 6%);
  box-shadow: var(--shadow-border);
}

.pricing-card.is-current {
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--green) 55%, transparent),
    0 18px 54px color-mix(in srgb, var(--green) 14%, transparent);
}

.pricing-card__head {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pricing-card__head h4 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.05;
}

.pricing-card__head span {
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.pricing-card__price {
  display: flex;
  align-items: end;
  gap: 4px;
}

.pricing-card__price strong {
  color: var(--ink);
  font-size: clamp(46px, 5vw, 72px);
  line-height: 0.9;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.pricing-card__price span {
  padding-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.pricing-card__trial {
  min-height: 42px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

.pricing-card .button {
  width: 100%;
  justify-content: center;
}

.pricing-page-card > #profileBillingPortalBtn {
  width: min(100%, 420px);
  justify-self: center;
}

.pricing-card__divider {
  height: 1px;
  background: var(--line);
}

.pricing-card__details {
  display: grid;
  gap: 12px;
}

.pricing-card__details > strong {
  color: var(--ink);
}

.pricing-card__details ul {
  display: grid;
  gap: 13px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.pricing-card__details li {
  position: relative;
  padding-left: 34px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.35;
}

.pricing-card__details li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: -1px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
}

.profile-theme-card {
  align-content: start;
}

.theme-choice-list {
  display: grid;
  gap: 10px;
}

.theme-choice {
  min-height: 72px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 0;
  border-radius: 16px;
  background: var(--panel-strong);
  color: var(--ink);
  box-shadow: var(--shadow-border);
  text-align: left;
  cursor: pointer;
  transition-property: background-color, box-shadow, scale;
  transition-duration: 150ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.theme-choice:hover,
.theme-choice.active {
  background: color-mix(in srgb, var(--panel-strong) 76%, var(--green) 10%);
  box-shadow: var(--shadow-border-hover);
}

.theme-choice:active {
  scale: 0.96;
}

.theme-choice > span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--muted);
  opacity: 0.45;
}

.theme-choice.active > span {
  background: var(--green);
  opacity: 1;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--green) 16%, transparent);
}

.theme-choice strong,
.theme-choice small {
  grid-column: 2;
}

.theme-choice strong {
  font-size: 16px;
}

.theme-choice small {
  color: var(--muted);
  line-height: 1.35;
  text-wrap: pretty;
}

@keyframes account-menu-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1180px) {
  .profile-layout,
  .settings-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-hero-card,
  #profileInfoForm,
  #profilePasswordForm,
  .profile-layout > .profile-card:nth-child(4),
  .profile-layout > .profile-card:nth-child(5),
  .settings-panel > label,
  .settings-theme-card,
  .account-settings-card {
    grid-column: span 1;
  }

  #profileInfoForm,
  .profile-layout > .team-card,
  .profile-layout > [data-profile-section="personal"].profile-hero-card,
  .profile-layout > [data-profile-section="personal"]#profileInfoForm,
  .profile-layout > [data-profile-section="personal"]#profilePasswordForm,
  .profile-layout > [data-profile-section="plan"],
  .backup-manager,
  .settings-actions {
    grid-column: 1 / -1;
  }

  .profile-hero-card {
    min-height: 560px;
  }

  .backup-list {
    grid-template-columns: 1fr;
  }

  .pricing-grid {
    grid-template-columns: repeat(2, minmax(280px, 420px));
  }

  .pricing-grid > .pricing-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    width: min(100%, 420px);
    justify-self: center;
  }

  .team-card {
    grid-template-columns: 1fr;
  }

  .team-card .team-permission-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-team-permissions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-team-invite {
    grid-template-columns: minmax(240px, 1fr) minmax(240px, 1fr) minmax(160px, 0.55fr);
  }

  .settings-team-invite__intro {
    grid-column: 1 / -1;
  }

  .team-invite-created {
    grid-template-columns: 1fr;
  }

  .team-invite-form,
  .team-card > .form-status,
  .team-card > .team-list {
    grid-column: 1;
  }
}

@media (max-width: 720px) {
  .beta-plan-notice {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .beta-plan-notice__badge {
    justify-self: start;
  }

  .profile-layout,
  .settings-panel {
    grid-template-columns: 1fr;
  }

  .profile-hero-card,
  #profileInfoForm,
  #profilePasswordForm,
  .profile-layout > .profile-card:nth-child(4),
  .profile-layout > .profile-card:nth-child(5),
  .profile-layout > .team-card,
  .settings-panel > label,
  .settings-theme-card,
  .account-settings-card {
    grid-column: 1 / -1;
  }

  .account-settings-card,
  .backup-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .pricing-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .pricing-card {
    min-height: auto;
  }

  .team-row {
    grid-template-columns: 1fr;
  }

  .team-row__actions {
    justify-content: stretch;
  }

  .settings-team-list .team-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .settings-team-list .team-row__actions {
    padding: 14px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .team-card .team-permission-grid {
    grid-template-columns: 1fr;
  }

  .settings-team-permissions,
  .settings-team-list {
    grid-template-columns: 1fr;
  }

  .settings-team-invite {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .settings-team-invite__intro {
    grid-column: 1;
  }

  .settings-team-invite__submit {
    width: 100%;
  }

  .profile-section-tabs {
    justify-content: flex-start;
  }

  .profile-avatar--large {
    width: 210px;
    min-width: 210px;
    height: 210px;
    min-height: 210px;
  }

  .profile-hero-card .profile-avatar.profile-avatar--large {
    width: clamp(190px, 42vw, 240px);
    min-width: clamp(190px, 42vw, 240px);
    height: clamp(190px, 42vw, 240px);
    min-height: clamp(190px, 42vw, 240px);
  }

  .team-row__actions select,
  .team-row__actions .mini-button,
  .team-role-pill {
    width: 100%;
  }

  .account-settings-card {
    flex-direction: column;
  }

  .settings-partners-head,
  .settings-team-head,
  .partner-share-summary {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .settings-partners-head {
    display: grid;
  }

  .settings-team-head {
    display: grid;
  }

  .settings-partners-actions {
    justify-content: flex-start;
  }

  .partner-row {
    grid-template-columns: 40px minmax(0, 1fr) 44px;
  }

  .partner-row .partner-share-field {
    grid-column: 2 / -1;
  }

  .partner-share-summary p {
    text-align: left;
  }

  .account-settings-actions,
  .backup-actions,
  .settings-actions,
  .settings-actions:last-child {
    justify-content: flex-start;
  }
}

/* Keep recovery status readable after legacy topbar overrides. */
.save-status {
  max-width: min(420px, 42vw);
  min-height: 40px;
  white-space: normal;
  text-align: center;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .save-status {
    max-width: 100%;
  }
}

/* Public landing page adapted from MagicPath component soft-dusk-3332. */
.landing-screen {
  --landing-bg: #f4f1ea;
  --landing-paper: #fffdf8;
  --landing-ink: #111211;
  --landing-muted: #645b50;
  --landing-purple: #9d73ff;
  --landing-purple-strong: #8153ef;
  min-height: 100vh;
  background: var(--landing-bg);
  color: var(--landing-ink);
  font-weight: 500;
}

.landing-screen h1,
.landing-screen h2,
.landing-screen h3,
.landing-screen p {
  margin-top: 0;
}

.landing-screen h1,
.landing-screen h2,
.landing-screen h3 {
  text-wrap: balance;
}

.landing-screen p,
.landing-screen li,
.landing-screen dd {
  text-wrap: pretty;
}

.landing-container {
  width: min(100% - 48px, 1200px);
  margin-inline: auto;
}

.landing-hero {
  position: relative;
  min-height: 760px;
  overflow: hidden;
  background: #070708;
  color: #fff;
}

.landing-hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  outline: 1px solid rgba(255, 255, 255, 0.1);
  outline-offset: -1px;
}

.landing-hero__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(3, 3, 4, 0.98) 0%, rgba(3, 3, 4, 0.82) 34%, rgba(3, 3, 4, 0.14) 69%, rgba(3, 3, 4, 0.04) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.46) 0%, transparent 24%, rgba(0, 0, 0, 0.22) 100%);
}

.landing-hero__inner {
  position: relative;
  min-height: 760px;
  display: flex;
  flex-direction: column;
}

.landing-nav {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.landing-brand {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.landing-brand > span:last-child {
  display: grid;
  gap: 5px;
}

.landing-brand strong {
  font-size: 15px;
  line-height: 1;
  letter-spacing: -0.01em;
}

.landing-brand small {
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.landing-logo {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 13px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), transparent 42%),
    #8055e9;
  color: #fff;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.2),
    0 10px 28px rgba(73, 39, 154, 0.36);
  font-size: 22px;
  font-weight: 900;
}

.landing-logo--large {
  width: 64px;
  height: 64px;
  border-radius: 17px;
  font-size: 30px;
}

.landing-nav__links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.landing-nav__links a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition-property: color;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.landing-nav__links a:hover {
  color: #fff;
}

.landing-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 15px 11px 17px;
  border: 0;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition-property: color, background-color, box-shadow, scale, transform;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.landing-button:hover {
  transform: translateY(-1px);
}

.landing-button:active {
  transform: translateY(0);
  scale: 0.96;
}

.landing-button:focus-visible,
.landing-nav__links a:focus-visible,
.landing-brand:focus-visible,
.landing-product-tab:focus-visible {
  outline: 3px solid rgba(157, 115, 255, 0.68);
  outline-offset: 3px;
}

.landing-button--light {
  background: #fff;
  color: #111211;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.5),
    0 12px 28px rgba(0, 0, 0, 0.2);
}

.landing-button--light:hover {
  background: #efe9ff;
}

.landing-button--primary {
  background: var(--landing-purple);
  color: #fff;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 18px 45px rgba(157, 115, 255, 0.32);
}

.landing-button--primary:hover {
  background: var(--landing-purple-strong);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.16),
    0 20px 50px rgba(157, 115, 255, 0.42);
}

.landing-button--glass {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(14px);
}

.landing-button--glass:hover {
  background: rgba(255, 255, 255, 0.16);
}

.landing-hero__content {
  width: min(100%, 630px);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 84px 0 116px;
}

.landing-kicker {
  width: fit-content;
  max-width: 540px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  color: rgba(255, 255, 255, 0.78);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.14),
    0 16px 44px rgba(0, 0, 0, 0.24);
  font-size: 13px;
  line-height: 1.6;
  backdrop-filter: blur(12px);
}

.landing-kicker span {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 5px;
  background: var(--landing-purple);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.landing-hero h1 {
  max-width: 620px;
  margin-bottom: 0;
  font-size: clamp(48px, 5.3vw, 68px);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 0.99;
}

.landing-hero h1 span {
  display: block;
  margin-top: 13px;
  color: rgba(255, 255, 255, 0.9);
}

.landing-hero__content > p {
  max-width: 560px;
  margin: 28px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.8;
}

.landing-hero__actions,
.landing-commercial__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.landing-metrics {
  padding: 38px 0;
  background: var(--landing-paper);
  box-shadow:
    inset 0 1px rgba(0, 0, 0, 0.08),
    inset 0 -1px rgba(0, 0, 0, 0.08);
}

.landing-metrics__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.landing-metrics article {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 22px;
  border-radius: 12px;
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.06),
    0 1px 2px -1px rgba(0, 0, 0, 0.06),
    0 12px 32px rgba(40, 35, 29, 0.05);
}

.landing-metrics strong {
  font-size: 29px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.035em;
}

.landing-metrics span {
  margin-top: 8px;
  color: #6b6257;
  font-size: 13px;
  line-height: 1.5;
}

.landing-section {
  padding: 96px 0;
}

.landing-section__intro {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
  align-items: end;
  gap: 64px;
}

.landing-eyebrow {
  margin-bottom: 14px;
  color: #6c42df;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.landing-section h2,
.landing-commercial h2 {
  margin-bottom: 0;
  font-size: clamp(38px, 4.1vw, 54px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.landing-section__intro > p,
.landing-workflow__lead,
.landing-commercial__grid > div > p {
  margin-bottom: 0;
  color: var(--landing-muted);
  font-size: 15px;
  line-height: 1.85;
}

.landing-product {
  display: grid;
  grid-template-columns: minmax(260px, 0.36fr) minmax(0, 0.64fr);
  gap: 30px;
  margin-top: 44px;
}

.landing-product__tabs {
  display: grid;
  align-content: start;
  gap: 12px;
}

.landing-product-tab {
  min-height: 106px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  padding: 16px;
  border: 0;
  border-radius: 12px;
  background: #fff;
  color: var(--landing-ink);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.07),
    0 1px 2px -1px rgba(0, 0, 0, 0.06);
  text-align: left;
  transition-property: color, background-color, box-shadow, scale, transform;
  transition-duration: 180ms;
  transition-timing-function: ease-out;
}

.landing-product-tab:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(108, 66, 223, 0.34),
    0 12px 30px rgba(40, 35, 29, 0.08);
}

.landing-product-tab:active {
  transform: translateY(0);
  scale: 0.96;
}

.landing-product-tab.is-active {
  background: #19171f;
  color: #fff;
  box-shadow:
    0 0 0 1px rgba(157, 115, 255, 0.72),
    0 20px 48px rgba(55, 35, 112, 0.18);
}

.landing-product-tab > span:last-child {
  display: grid;
  gap: 7px;
}

.landing-product-tab strong {
  font-size: 13px;
}

.landing-product-tab small {
  color: #665d52;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.55;
}

.landing-product-tab.is-active small {
  color: rgba(255, 255, 255, 0.68);
}

.landing-product-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #eee8ff;
  color: #6c42df;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.landing-product-tab.is-active .landing-product-icon {
  background: rgba(157, 115, 255, 0.17);
  color: #cbb8ff;
  box-shadow: 0 0 0 1px rgba(157, 115, 255, 0.24);
}

.landing-product__stage {
  min-width: 0;
  padding: 30px;
  border-radius: 20px;
  background: #eee8dc;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.07),
    0 28px 80px rgba(40, 35, 29, 0.13);
}

.landing-screen-frame {
  min-width: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #111;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.1),
    0 22px 54px rgba(29, 25, 20, 0.2);
}

.landing-screen-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  outline: 1px solid rgba(255, 255, 255, 0.1);
  outline-offset: -1px;
}

.landing-product__stage > .landing-screen-frame {
  aspect-ratio: 16 / 9.5;
}

.landing-product__copy {
  display: grid;
  grid-template-columns: 0.3fr 0.7fr;
  gap: 24px;
  padding: 28px 6px 4px;
}

.landing-product__copy h3 {
  margin-bottom: 10px;
  font-size: clamp(22px, 2vw, 28px);
  letter-spacing: -0.025em;
  line-height: 1.18;
}

.landing-product__copy > p {
  margin-bottom: 0;
}

.landing-product__copy div p {
  margin-bottom: 0;
  color: var(--landing-muted);
  font-size: 13px;
  line-height: 1.75;
}

.landing-workflow {
  background: var(--landing-paper);
}

.landing-workflow__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  align-items: center;
  gap: 64px;
}

.landing-workflow__lead {
  margin-top: 22px;
}

.landing-steps {
  display: grid;
  gap: 12px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.landing-steps li {
  min-height: 76px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 12px;
  background: #f7f3eb;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.06),
    0 1px 2px -1px rgba(0, 0, 0, 0.05);
}

.landing-steps span {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #e9e0ff;
  color: #6c42df;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.landing-steps strong {
  font-size: 13px;
  line-height: 1.5;
}

.landing-workflow__screens {
  min-width: 0;
  display: grid;
  gap: 16px;
  transform: perspective(1200px) rotateY(-2deg);
}

.landing-screen-frame--wide {
  aspect-ratio: 16 / 8.7;
}

.landing-workflow__screens-row {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.landing-workflow__screens-row .landing-screen-frame {
  aspect-ratio: 16 / 10;
}

.landing-commercial {
  padding: 96px 0;
  background: #101110;
  color: #fff;
}

.landing-commercial__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.8fr);
  align-items: center;
  gap: 72px;
}

.landing-brand--footer {
  margin-bottom: 48px;
}

.landing-brand--footer strong {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}

.landing-brand--footer small {
  color: #b69cff;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.landing-commercial .landing-eyebrow {
  color: #b69cff;
}

.landing-commercial h2 {
  max-width: 720px;
}

.landing-commercial__grid > div > p {
  max-width: 680px;
  margin-top: 22px;
  color: rgba(255, 255, 255, 0.66);
}

.landing-positioning {
  display: grid;
  gap: 12px;
  margin: 0;
}

.landing-positioning div {
  padding: 20px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.landing-positioning dt {
  color: #b69cff;
  font-size: 12px;
  font-weight: 800;
}

.landing-positioning dd {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  line-height: 1.65;
}

@media (max-width: 980px) {
  .landing-nav__links {
    display: none;
  }

  .landing-section__intro,
  .landing-workflow__grid,
  .landing-commercial__grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .landing-product {
    grid-template-columns: 1fr;
  }

  .landing-product__tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .landing-workflow__screens {
    transform: none;
  }

  .landing-positioning {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  html {
    scroll-behavior: auto;
  }

  .landing-container {
    width: min(100% - 32px, 1200px);
  }

  .landing-hero,
  .landing-hero__inner {
    min-height: 720px;
  }

  .landing-hero__scrim {
    background:
      linear-gradient(180deg, rgba(3, 3, 4, 0.92) 0%, rgba(3, 3, 4, 0.76) 58%, rgba(3, 3, 4, 0.9) 100%);
  }

  .landing-nav {
    min-height: 80px;
  }

  .landing-brand small {
    display: none;
  }

  .landing-nav > .landing-button {
    min-height: 42px;
  }

  .landing-hero__content {
    padding: 72px 0 96px;
  }

  .landing-kicker {
    align-items: flex-start;
    flex-direction: column;
  }

  .landing-hero h1 {
    font-size: clamp(43px, 13vw, 58px);
  }

  .landing-hero__content > p {
    font-size: 15px;
    line-height: 1.7;
  }

  .landing-hero__actions,
  .landing-commercial__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .landing-metrics__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .landing-metrics article {
    min-height: 108px;
    padding: 18px;
  }

  .landing-metrics strong {
    font-size: 24px;
  }

  .landing-section,
  .landing-commercial {
    padding: 72px 0;
  }

  .landing-section h2,
  .landing-commercial h2 {
    font-size: clamp(34px, 10vw, 44px);
  }

  .landing-product__tabs {
    display: flex;
    gap: 10px;
    margin-inline: -16px;
    padding: 4px 16px 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .landing-product-tab {
    min-width: min(82vw, 320px);
    scroll-snap-align: start;
  }

  .landing-product__stage {
    padding: 14px;
    border-radius: 16px;
  }

  .landing-screen-frame {
    border-radius: 10px;
  }

  .landing-product__copy {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 22px 4px 8px;
  }

  .landing-product__stage > .landing-screen-frame {
    aspect-ratio: 4 / 3;
  }

  .landing-product__stage > .landing-screen-frame img {
    object-position: left top;
  }

  .landing-workflow__screens-row,
  .landing-positioning {
    grid-template-columns: 1fr;
  }

  .landing-brand--footer {
    margin-bottom: 36px;
  }
}

@media (max-width: 420px) {
  .landing-brand strong {
    font-size: 13px;
  }

  .landing-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .landing-nav > .landing-button {
    padding-inline: 12px 10px;
  }

  .landing-metrics__grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .landing-button,
  .landing-product-tab,
  .landing-nav__links a {
    transition-duration: 0.01ms;
  }
}

/* Private beta authentication flow. */
.auth-screen {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  place-items: center;
  padding: clamp(16px, 4vw, 40px);
  overflow-y: auto;
  background:
    radial-gradient(circle at 12% 8%, rgba(157, 115, 255, 0.2), transparent 34rem),
    radial-gradient(circle at 90% 88%, rgba(88, 200, 143, 0.12), transparent 30rem),
    linear-gradient(145deg, #0b0b10, #15121d 58%, #0d0e12);
}

.auth-screen::before {
  content: "";
  position: fixed;
  z-index: -1;
  width: min(64vw, 640px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(116, 70, 244, 0.1);
  filter: blur(90px);
  pointer-events: none;
}

.auth-card {
  width: min(100%, 480px);
  gap: 16px;
  padding: clamp(22px, 4vw, 32px);
  border: 0;
  border-radius: 28px;
  background: color-mix(in srgb, #191820 94%, transparent);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 2px 4px rgba(0, 0, 0, 0.16),
    0 30px 90px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(22px);
}

.auth-card[aria-busy="true"] {
  cursor: progress;
}

.auth-back {
  min-height: 44px;
  margin: -8px 0 0 -8px;
  padding: 8px;
  border-radius: 9px;
  color: #aaa6b3;
  font-weight: 700;
  transition-property: color, background-color, scale;
}

.auth-back:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.auth-back:focus-visible,
.auth-inline-action:focus-visible,
.auth-card .button:focus-visible {
  outline: 3px solid rgba(157, 115, 255, 0.72);
  outline-offset: 3px;
}

.auth-brand {
  min-height: 48px;
}

.auth-card .auth-brand strong {
  color: #fff;
}

.auth-card .auth-brand span {
  display: block;
  color: #aaa6b3;
}

.auth-heading {
  display: grid;
  gap: 8px;
}

.auth-heading .eyebrow {
  margin: 0;
  color: #bda7ff;
  letter-spacing: 0.08em;
}

.auth-card h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(32px, 8vw, 42px);
  letter-spacing: -0.045em;
  line-height: 1.02;
  text-wrap: balance;
}

.auth-heading .muted {
  margin: 0;
  color: #aaa6b3;
  font-size: 14px;
  line-height: 1.65;
  text-wrap: pretty;
}

.auth-provider {
  display: grid;
  gap: 14px;
}

.auth-google.button {
  width: 100%;
  min-height: 52px;
  justify-content: center;
  gap: 11px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: #202124;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.08),
    0 8px 24px rgba(0, 0, 0, 0.16);
  font-size: 14px;
  font-weight: 800;
  transition-property: background-color, box-shadow, transform, scale;
  transition-duration: 160ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.auth-google.button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #f8f7fb;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.1),
    0 12px 30px rgba(0, 0, 0, 0.2);
}

.auth-google__icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  color: #827e8b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.auth-card label,
.auth-password-field {
  display: grid;
  gap: 8px;
  color: #c2beca;
  font-size: 13px;
  font-weight: 750;
}

.auth-label-row {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-label-row label {
  display: block;
}

.auth-inline-action {
  min-height: 44px;
  padding: 0 6px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #bda7ff;
  font-size: 12px;
  font-weight: 800;
  transition-property: color, background-color, scale;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.auth-inline-action:hover {
  background: rgba(157, 115, 255, 0.1);
  color: #d9ceff;
}

.auth-inline-action:active {
  scale: 0.96;
}

.auth-card input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 14px;
  background: #111116;
  color: #fff;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
  font-size: 15px;
  font-weight: 650;
  transition-property: border-color, background-color, box-shadow;
  transition-duration: 160ms;
  transition-timing-function: ease-out;
}

.auth-card input::placeholder {
  color: #6f6b77;
  opacity: 1;
}

.auth-card input:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.22);
}

.auth-card input:focus,
.auth-card input:focus-visible {
  border-color: #9d73ff;
  outline: 0;
  box-shadow:
    0 0 0 4px rgba(157, 115, 255, 0.18),
    inset 0 1px rgba(255, 255, 255, 0.04);
}

.auth-card input:disabled,
.auth-card button:disabled {
  cursor: wait;
  opacity: 0.64;
}

.auth-field-hint {
  color: #8e8997;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.55;
}

.auth-private-note,
.auth-status {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.55;
  text-wrap: pretty;
}

.auth-private-note {
  color: #c9baff;
  background: rgba(157, 115, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(157, 115, 255, 0.2);
}

.auth-status {
  min-height: 0;
  color: #c9d9ff;
  background: rgba(79, 145, 216, 0.12);
  box-shadow: inset 0 0 0 1px rgba(79, 145, 216, 0.2);
}

.auth-status[data-tone="success"] {
  color: #a8edca;
  background: rgba(88, 200, 143, 0.12);
  box-shadow: inset 0 0 0 1px rgba(88, 200, 143, 0.22);
}

.auth-status--error {
  color: #ffb8bd;
  background: rgba(239, 91, 99, 0.12);
  box-shadow: inset 0 0 0 1px rgba(239, 91, 99, 0.24);
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.auth-actions .button {
  width: 100%;
  min-height: 50px;
  border-radius: 14px;
  font-size: 13px;
  transition-property: background-color, color, box-shadow, transform, scale, opacity;
  transition-duration: 160ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.auth-actions .button.primary {
  background: #7446e6;
  color: #fff;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 12px 30px rgba(105, 61, 213, 0.3);
}

.auth-actions .button.primary:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #6538d5;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.16),
    0 16px 36px rgba(105, 61, 213, 0.38);
}

.auth-actions .button.ghost {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.055);
  color: #d6d2dc;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.auth-actions .button.ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.auth-card .button:active:not(:disabled) {
  transform: translateY(0);
  scale: 0.96;
}

.auth-card .is-loading::after {
  content: "";
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: auth-spin 700ms linear infinite;
}

@keyframes auth-spin {
  to {
    rotate: 1turn;
  }
}

@media (max-width: 520px) {
  .auth-screen {
    place-items: start center;
    padding: 12px;
  }

  .auth-card {
    margin-block: 0;
    gap: 14px;
    padding: 20px;
    border-radius: 22px;
  }

  .auth-brand {
    margin-top: -2px;
  }

  .auth-card h1 {
    font-size: clamp(30px, 10vw, 38px);
  }

  .auth-label-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 0;
  }

  .auth-inline-action {
    margin-left: -6px;
  }
}

@media (max-height: 680px) {
  .auth-screen {
    place-items: start center;
    padding-block: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-back,
  .auth-inline-action,
  .auth-google.button,
  .auth-card input,
  .auth-actions .button {
    transition-duration: 0.01ms;
  }

  .auth-card .is-loading::after {
    animation: none;
  }
}
