:root {

  --paper: #f5efe3;
  --paper-deep: #ece3d3;
  --surface: #fffdf9;
  --surface-2: #f8f3e9;
  --surface-raised: #ffffff;
  --border: #e7dfd0;
  --border-strong: #d2c6b1;
  --text: #2a241d;
  --text-muted: #665c50;

  --text-subtle: #766a5b;

  --green-50:  #eef3ef;
  --green-100: #d7e3da;
  --green-200: #a9c1b1;
  --green-400: #3d6b51;
  --green-500: #1d3b2c;
  --green-600: #16301f;
  --green-700: #102418;

  --copper-50:  #fbf2e9;
  --copper-100: #f4e2cd;
  --copper-200: #e6c49c;
  --copper-400: #c6854a;
  --copper-500: #a8672f;
  --copper-600: #8d5525;

  --accent: var(--green-500);
  --accent-hover: var(--green-600);
  --accent-contrast: #ffffff;

  --accent-text: var(--green-500);
  --accent-soft: var(--green-50);
  --accent-border: var(--green-200);
  --accent-ring: rgba(29, 59, 44, .16);

  --second: var(--copper-400);
  --second-strong: var(--copper-500);
  --second-soft: var(--copper-50);
  --second-border: var(--copper-200);

  --success: #1f7a4d;
  --success-soft: #e6f2ea;
  --success-border: #bcdcc8;
  --success-contrast: #ffffff;
  --warning: #a2620a;
  --warning-soft: #fbf1de;
  --warning-border: #ebcf9e;
  --warning-contrast: #ffffff;
  --danger: #ab2b20;
  --danger-hover: #8e231a;
  --danger-soft: #fbeae8;
  --danger-border: #eeb5af;
  --danger-contrast: #ffffff;

  --logo-warp: #1d3b2c;
  --logo-weft: #c6854a;

  --hero: #1d3b2c;
  --hero-2: #16301f;
  --hero-text: #f4ead9;
  --hero-text-muted: #b9c9bd;

  --overlay: rgba(26, 22, 17, .52);
  --shadow-xs: 0 1px 2px rgba(42, 36, 29, .05);
  --shadow-sm: 0 1px 2px rgba(42, 36, 29, .05), 0 1px 3px rgba(42, 36, 29, .05);
  --shadow-md: 0 4px 14px rgba(42, 36, 29, .07), 0 2px 4px rgba(42, 36, 29, .04);
  --shadow-lg: 0 18px 44px rgba(42, 36, 29, .14), 0 4px 12px rgba(42, 36, 29, .06);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               Helvetica, Arial, sans-serif;
  --font-serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia,
                'Times New Roman', serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  --step--1: 13px;
  --step-0: 15px;
  --step-1: 17px;
  --step-2: 20px;
  --step-3: 25px;
  --step-4: 32px;
  --step-5: 41px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 44px;
  --space-9: 64px;

  --radius-sm: 7px;
  --radius: 11px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-pill: 999px;

  --dur-fast: .13s;
  --dur: .2s;
  --ease: cubic-bezier(.32, .72, .35, 1);

  --sidebar-w: 288px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14120f;
    --paper-deep: #100e0c;
    --surface: #1c1a16;
    --surface-2: #23201b;
    --surface-raised: #24211c;
    --border: #322d26;
    --border-strong: #474036;
    --text: #f1ebe0;
    --text-muted: #b6ab9c;
    --text-subtle: #9c9081;

    --accent: #2f6a4b;
    --accent-hover: #3a7d5a;
    --accent-contrast: #ffffff;
    --accent-text: #57a57c;
    --accent-soft: #1b2b22;
    --accent-border: #2f4b3b;
    --accent-ring: rgba(87, 165, 124, .26);

    --second: #d09659;
    --second-strong: #dca86c;
    --second-soft: #2a2118;
    --second-border: #43331f;

    --success: #4fae7c;
    --success-soft: #17281f;
    --success-border: #2a4534;
    --success-contrast: #08150e;
    --warning: #d99b3f;
    --warning-soft: #2a2013;
    --warning-border: #45341f;
    --warning-contrast: #1a1206;
    --danger: #e2695c;
    --danger-hover: #ea7c70;
    --danger-soft: #2c1a18;
    --danger-border: #4a2723;
    --danger-contrast: #1a0b09;

    --logo-warp: #e8dcc6;
    --logo-weft: #d09659;

    --logo-warp: #e8dcc6;
  --logo-weft: #d09659;

  --hero: #1a2f24;
    --hero-2: #12211a;
    --hero-text: #eee5d6;
    --hero-text-muted: #a9b9ad;

    --overlay: rgba(6, 5, 4, .66);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .34);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, .42);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, .55);
  }
}

:root[data-theme="dark"] {
  --paper: #14120f;
  --paper-deep: #100e0c;
  --surface: #1c1a16;
  --surface-2: #23201b;
  --surface-raised: #24211c;
  --border: #322d26;
  --border-strong: #474036;
  --text: #f1ebe0;
  --text-muted: #b6ab9c;
  --text-subtle: #9c9081;

  --accent: #2f6a4b;
  --accent-hover: #3a7d5a;
  --accent-contrast: #ffffff;
  --accent-text: #57a57c;
  --accent-soft: #1b2b22;
  --accent-border: #2f4b3b;
  --accent-ring: rgba(87, 165, 124, .26);

  --second: #d09659;
  --second-strong: #dca86c;
  --second-soft: #2a2118;
  --second-border: #43331f;

  --success: #4fae7c;
  --success-soft: #17281f;
  --success-border: #2a4534;
  --success-contrast: #08150e;
  --warning: #d99b3f;
  --warning-soft: #2a2013;
  --warning-border: #45341f;
  --warning-contrast: #1a1206;
  --danger: #e2695c;
  --danger-hover: #ea7c70;
  --danger-soft: #2c1a18;
  --danger-border: #4a2723;
  --danger-contrast: #1a0b09;

  --logo-warp: #e8dcc6;
  --logo-weft: #d09659;

  --hero: #1a2f24;
  --hero-2: #12211a;
  --hero-text: #eee5d6;
  --hero-text-muted: #a9b9ad;

  --overlay: rgba(6, 5, 4, .66);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .34);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .42);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, .55);
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/InterVariable-4.1.woff2') format('woff2');
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.55;
  font-feature-settings: 'cv05' 1, 'ss03' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.005em;
  margin: 0;
  color: var(--text);
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); font-family: var(--font-sans); font-weight: 600; }

p { margin: 0 0 var(--space-4); }
p:last-child { margin-bottom: 0; }

a { color: var(--accent-text); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-text); text-decoration-thickness: 2px; }

small { font-size: var(--step--1); }

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--space-6) 0;
}

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

::placeholder { color: var(--text-subtle); opacity: 1; }

::selection { background: var(--accent-soft); color: var(--text); }

[hidden], .is-hidden { display: none !important; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-sm { width: 16px; height: 16px; stroke-width: 1.75; }
.icon-lg { width: 26px; height: 26px; stroke-width: 1.5; }
.icon-xl { width: 40px; height: 40px; stroke-width: 1.25; }

.logo-mark { width: 34px; height: 34px; flex: none; }

.logo-mark .weave-warp { stroke: var(--logo-warp); }
.logo-mark .weave-weft { stroke: var(--logo-weft); }
.logo-mark-lg { width: 46px; height: 46px; }

.wordmark {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: .004em;
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 11px 18px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--surface-raised);
  color: var(--text);
  font: inherit;
  font-weight: 550;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
  box-shadow: var(--shadow-xs);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-secondary {
  background: var(--surface-raised);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); border-color: var(--text-subtle); }

.btn-quiet { background: transparent; color: var(--text-muted); }
.btn-quiet:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--danger-contrast);
}
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); border-color: var(--danger-hover); }

.btn-danger-quiet {
  background: transparent;
  border-color: var(--danger-border);
  color: var(--danger);
}
.btn-danger-quiet:hover:not(:disabled) { background: var(--danger-soft); }

.btn-block { width: 100%; }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: var(--step--1); }
.btn-lg { min-height: 50px; padding: 14px 24px; font-size: var(--step-1); }

.btn-icon {
  padding: 0;
  width: 38px;
  min-height: 38px;
  border-radius: var(--radius);
}

.btn.is-busy { color: transparent; position: relative; pointer-events: none; }
.btn.is-busy::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin .7s linear infinite;
  color: var(--accent-contrast);
}
.btn-secondary.is-busy::after, .btn-quiet.is-busy::after { color: var(--text); }

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

.field { margin-bottom: var(--space-5); }
.field:last-child { margin-bottom: 0; }

.label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--text);
}

.hint {
  margin-top: var(--space-2);
  font-size: var(--step--1);
  color: var(--text-subtle);
  line-height: 1.5;
}

.input-wrap { position: relative; display: flex; align-items: center; }

.input-wrap > .icon:first-child {
  position: absolute;
  left: 13px;
  color: var(--text-subtle);
  pointer-events: none;
}
.input-wrap > .icon:first-child ~ .input { padding-left: 42px; }

.input, .select, .textarea {
  width: 100%;
  padding: 11px 14px;
  min-height: 46px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-raised);
  color: var(--text);
  font: inherit;
  transition: border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-subtle); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
  outline: none;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.55; }

.select {
  appearance: none;
  padding-right: 40px;

  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%237a6e5f' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 8l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
}
:root[data-theme="dark"] .select,
[data-theme="dark"] .select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%239c9081' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 8l5 5 5-5'/%3E%3C/svg%3E");
}

.input-reveal {
  position: absolute;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-subtle);
  cursor: pointer;
}
.input-reveal:hover { color: var(--text); background: var(--surface-2); }

.field.has-error .input { border-color: var(--danger); }
.field-error {
  margin-top: var(--space-2);
  font-size: var(--step--1);
  color: var(--danger);
  font-weight: 550;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--step-0);
}
.checkbox-row input[type="checkbox"] {
  width: 18px; height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent);
  flex: none;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: var(--space-6); }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
}
.card-head h3, .card-head h2 { margin: 0; }
.card-head-sub {
  margin-top: var(--space-1);
  font-size: var(--step--1);
  color: var(--text-subtle);
}
.card-body { padding: var(--space-6); }
.card-foot {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.rule-ornament {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-4) 0;
  color: var(--second);
}
.rule-ornament::before, .rule-ornament::after {
  content: '';
  flex: 1;
  height: 1px;
  background: currentColor;
  opacity: .5;
}
.rule-ornament i {
  width: 7px; height: 7px;
  background: currentColor;
  transform: rotate(45deg);
  flex: none;
}

.divider-text {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-5) 0;
  font-size: var(--step--1);
  color: var(--text-subtle);
}
.divider-text::before, .divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.badge-accent { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-text); }
.badge-second { background: var(--second-soft); border-color: var(--second-border); color: var(--second-strong); }
.badge-success { background: var(--success-soft); border-color: var(--success-border); color: var(--success); }
.badge-warning { background: var(--warning-soft); border-color: var(--warning-border); color: var(--warning); }
.badge-danger { background: var(--danger-soft); border-color: var(--danger-border); color: var(--danger); }

.notice {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-subtle);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface-2);
  font-size: var(--step-0);
  line-height: 1.55;
}
.notice .icon { margin-top: 2px; color: var(--text-subtle); }
.notice-title { font-weight: 600; display: block; margin-bottom: 2px; }
.notice-accent { background: var(--accent-soft); border-color: var(--accent-border); border-left-color: var(--accent); }
.notice-accent .icon { color: var(--accent-text); }
.notice-warning { background: var(--warning-soft); border-color: var(--warning-border); border-left-color: var(--warning); }
.notice-warning .icon { color: var(--warning); }
.notice-danger { background: var(--danger-soft); border-color: var(--danger-border); border-left-color: var(--danger); }
.notice-danger .icon { color: var(--danger); }
.notice-success { background: var(--success-soft); border-color: var(--success-border); border-left-color: var(--success); }
.notice-success .icon { color: var(--success); }

.auth {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.auth-art {
  position: relative;
  overflow: hidden;
  background: var(--paper-deep);
  isolation: isolate;
}
.auth-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 42% 50%;
}

.auth-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 30% 40%, transparent 40%, rgba(84, 68, 46, .13) 100%),
    linear-gradient(90deg, transparent 62%, var(--paper) 100%);
  pointer-events: none;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-6);
  background: var(--paper);
}

.auth-card {
  width: 100%;
  max-width: 424px;
  padding: var(--space-8) var(--space-7) var(--space-7);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.auth-brand .wordmark { font-size: var(--step-5); line-height: 1; }

.auth-tagline {
  margin: 0;
  text-align: center;
  font-family: var(--font-serif);
  font-size: var(--step-1);
  color: var(--text-muted);
}

.auth-form { margin-top: var(--space-7); }

.auth-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  font-size: var(--step--1);
  color: var(--text-muted);
}
.auth-links a { font-weight: 550; }

.auth-assurance {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
  font-size: var(--step--1);
  line-height: 1.5;
  color: var(--text-subtle);
}
.auth-assurance .icon { color: var(--accent-text); margin-top: 1px; }
.auth-assurance strong { color: var(--text-muted); font-weight: 600; display: block; }

.auth-step-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  font-size: var(--step--1);
  font-weight: 550;
  color: var(--text-muted);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.auth-step-back:hover { color: var(--text); }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }

  .auth-art { min-height: 190px; }
  .auth-art::after {
    background:
      radial-gradient(120% 90% at 30% 40%, transparent 40%, rgba(84, 68, 46, .13) 100%),
      linear-gradient(180deg, transparent 55%, var(--paper) 100%);
  }
  .auth-panel { padding: var(--space-6) var(--space-4) var(--space-8); }
  .auth-card { box-shadow: var(--shadow-md); }
}

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-6) var(--space-4);
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-2);
}
.sidebar-brand .wordmark { font-size: var(--step-3); }

.switcher { position: relative; }

.switcher-button {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-raised);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.switcher-button:hover { border-color: var(--text-subtle); background: var(--surface-2); }
.switcher-button .icon:first-child { color: var(--second); }
.switcher-button .switcher-chevron { margin-left: auto; color: var(--text-subtle); }

.switcher-name {
  min-width: 0;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.switcher-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  padding: var(--space-2);
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 340px;
  overflow-y: auto;
}

.switcher-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.switcher-item:hover { background: var(--surface-2); }
.switcher-item[aria-current="true"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.switcher-item .icon { color: var(--text-subtle); }
.switcher-item[aria-current="true"] .icon { color: var(--accent-text); }
.switcher-item-meta {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-subtle);
  font-weight: 500;
}

.switcher-sep { height: 1px; background: var(--border); margin: var(--space-2) 0; }

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav-label {
  padding: var(--space-4) var(--space-3) var(--space-1);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .075em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-weight: 550;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  width: 100%;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item .icon { color: var(--text-subtle); transition: color var(--dur-fast) var(--ease); }
.nav-item:hover .icon { color: var(--text-muted); }

.nav-item[aria-current="page"] {
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
}
.nav-item[aria-current="page"] .icon,
.nav-item[aria-current="page"]:hover .icon { color: var(--accent-contrast); }
.nav-item[aria-current="page"]:hover { background: var(--accent-hover); color: var(--accent-contrast); }

.nav-item-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--text-subtle);
}
.nav-item[aria-current="page"] .nav-item-badge {
  background: rgba(255, 255, 255, .18);
  color: var(--accent-contrast);
}

.sidebar-spacer { flex: 1; min-height: var(--space-5); }

.sidebar-assurance {
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: var(--step--1);
  line-height: 1.5;
}
.sidebar-assurance-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-1);
}
.sidebar-assurance-head .icon { color: var(--accent-text); }
.sidebar-assurance p { color: var(--text-subtle); margin: 0 0 var(--space-3); }
.sidebar-assurance a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-weight: 550;
  font-size: var(--step--1);
}

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.main { display: flex; flex-direction: column; min-width: 0; background: var(--paper); }

.topbar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-7);
  min-height: 76px;
}
.topbar-title { min-width: 0; flex: 1; }
.topbar-title h1 { font-size: var(--step-4); }
.topbar-sub {
  margin-top: 2px;
  font-size: var(--step--1);
  color: var(--text-subtle);
}
.topbar-actions { display: flex; align-items: center; gap: var(--space-3); }

.sidebar-toggle { display: none; }

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  flex: none;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface-raised);
  color: var(--text-muted);
  font-family: var(--font-serif);
  font-size: var(--step-1);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.avatar:hover { border-color: var(--text-subtle); color: var(--text); }
.avatar-lg { width: 56px; height: 56px; font-size: var(--step-3); }
.avatar-sm { width: 30px; height: 30px; font-size: var(--step--1); font-family: var(--font-sans); }

.view {
  flex: 1;
  padding: 0 var(--space-7) var(--space-9);
  max-width: 1180px;
  width: 100%;
}

.view-section { margin-bottom: var(--space-7); }
.view-section:last-child { margin-bottom: 0; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.section-head h2 { font-size: var(--step-2); }
.section-head p { margin: 2px 0 0; font-size: var(--step--1); color: var(--text-subtle); }

@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: min(88vw, var(--sidebar-w));
    z-index: 60;
    transform: translateX(-100%);
    transition: transform var(--dur) var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-toggle { display: inline-flex; }
  .topbar { padding: var(--space-4) var(--space-5); }
  .topbar-title h1 { font-size: var(--step-3); }
  .view { padding: 0 var(--space-5) var(--space-8); }
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--overlay);
  border: 0;
  padding: 0;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-4);
  padding: var(--space-9) var(--space-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.empty-plate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px; height: 76px;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--hero) 0%, var(--hero-2) 100%);
  color: var(--hero-text);
}
.empty h2 { font-size: var(--step-2); }
.empty p {
  max-width: 46ch;
  margin: 0;
  color: var(--text-muted);
}
.empty-soon {
  font-size: var(--step--1);
  color: var(--text-subtle);
}

.table-wrap {

  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.table { width: 100%; border-collapse: collapse; font-size: var(--step-0); }
.table th, .table td {
  padding: 12px var(--space-5);
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table th {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-subtle);
  background: var(--surface-2);
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table td.wrap { white-space: normal; min-width: 18ch; }
.table .row-actions { display: flex; gap: var(--space-2); justify-content: flex-end; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: var(--space-4);
}
.stat {
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.stat-label {
  font-size: var(--step--1);
  color: var(--text-subtle);
  font-weight: 550;
}
.stat-value {
  margin-top: var(--space-1);
  font-family: var(--font-serif);
  font-size: var(--step-4);
  font-weight: 600;
  line-height: 1.1;
  color: var(--text);
}
.stat-note { margin-top: var(--space-1); font-size: 12px; color: var(--text-subtle); }
.stat.is-flagged .stat-value { color: var(--warning); }

.modal-scrim {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  background: var(--overlay);
  overflow-y: auto;
}

.modal {
  width: 100%;
  max-width: 520px;
  margin: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  animation: modal-in var(--dur) var(--ease);
}
.modal-wide { max-width: 720px; }

@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(.99); }
  to { opacity: 1; transform: none; }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-6) var(--space-6) var(--space-4);
}
.modal-head h2 { font-size: var(--step-2); flex: 1; min-width: 0; }
.modal-head p { margin: var(--space-1) 0 0; font-size: var(--step--1); color: var(--text-subtle); }
.modal-close {
  flex: none;
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--text-subtle); cursor: pointer;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }

.modal-body { padding: 0 var(--space-6) var(--space-6); }
.modal-foot {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  flex-wrap: wrap;
  padding: var(--space-5) var(--space-6);
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.mfa-steps {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 236px minmax(0, 1fr);
  align-items: start;
}

.qr-plate {
  padding: var(--space-4);
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  line-height: 0;
}
.qr-plate svg { width: 100%; height: auto; display: block; border-radius: 2px; }

.qr-caption {
  margin-top: var(--space-3);
  font-size: 12px;
  text-align: center;
  color: var(--text-subtle);
  line-height: 1.45;
}

.step-list { counter-reset: step; margin: 0; padding: 0; list-style: none; }
.step-list li {
  position: relative;
  padding-left: 34px;
  margin-bottom: var(--space-4);
  font-size: var(--step-0);
  color: var(--text-muted);
  line-height: 1.5;
}
.step-list li:last-child { margin-bottom: 0; }
.step-list li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0; top: 0;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-sans);
}
.step-list strong { color: var(--text); font-weight: 600; }

.code-plate {
  padding: var(--space-4) var(--space-5);
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: var(--step-1);
  font-weight: 600;
  letter-spacing: .08em;
  word-break: break-all;
  text-align: center;
  color: var(--text);
  user-select: all;
}
.code-plate-label {
  display: block;
  margin-bottom: var(--space-2);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.otp-input {
  font-family: var(--font-mono);
  font-size: var(--step-3);
  font-weight: 600;
  letter-spacing: .34em;
  text-align: center;
  padding-left: var(--space-4);
  min-height: 58px;
}

.recovery-code {
  font-family: var(--font-mono);
  font-size: var(--step-2);
  font-weight: 600;
  letter-spacing: .06em;
  text-align: center;
  color: var(--text);
  padding: var(--space-5);
  background: var(--surface-2);
  border: 2px dashed var(--second-border);
  border-radius: var(--radius);
  user-select: all;
  word-break: break-all;
}

@media (max-width: 620px) {
  .mfa-steps { grid-template-columns: 1fr; }
  .qr-plate { max-width: 240px; margin: 0 auto; }
}

.toasts {
  position: fixed;
  bottom: var(--space-5);
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: min(440px, calc(100vw - var(--space-6)));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
  font-size: var(--step-0);
  color: var(--text);
  pointer-events: auto;
  animation: toast-in var(--dur) var(--ease);
}
.toast .icon { margin-top: 2px; flex: none; }
.toast-ok { border-color: var(--success-border); background: var(--success-soft); }
.toast-ok .icon { color: var(--success); }
.toast-bad { border-color: var(--danger-border); background: var(--danger-soft); }
.toast-bad .icon { color: var(--danger); }
.toast-info .icon { color: var(--accent); }
.toast-text { flex: 1; min-width: 0; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.tabs {
  display: flex;
  gap: var(--space-1);
  margin-bottom: var(--space-5);
  padding-bottom: 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.tab {
  padding: 9px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-weight: 550;
  white-space: nowrap;
  cursor: pointer;
  margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--accent-text); border-bottom-color: var(--accent-text); font-weight: 600; }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--border);
}
.setting-row:last-child { border-bottom: 0; padding-bottom: 0; }
.setting-row:first-child { padding-top: 0; }
.setting-text { min-width: 0; flex: 1; }
.setting-text h4 { margin: 0 0 2px; }
.setting-text p { margin: 0; font-size: var(--step--1); color: var(--text-subtle); }
.setting-control { flex: none; display: flex; align-items: center; gap: var(--space-3); }
.setting-control .select, .setting-control .input { min-width: 190px; }

@media (max-width: 620px) {
  .setting-row { flex-direction: column; align-items: stretch; }
  .setting-control { justify-content: flex-start; }
  .setting-control .select, .setting-control .input { min-width: 0; width: 100%; }
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  gap: 2px;
}
.segmented button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 7px 13px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: var(--step--1);
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] {
  background: var(--surface-raised);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

.doc-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: var(--space-7);
  align-items: start;
}

.doc-toc {
  position: sticky;
  top: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: calc(100vh - var(--space-8));
  overflow-y: auto;
  padding-right: var(--space-2);
}
.doc-toc-item {
  padding: 7px 11px;
  border: 0;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: var(--step--1);
  text-align: left;
  cursor: pointer;
}
.doc-toc-item:hover { background: var(--surface-2); color: var(--text); }
.doc-toc-item[aria-current="true"] {
  border-left-color: var(--accent-text);
  color: var(--accent-text);
  font-weight: 600;
  background: var(--accent-soft);
}

.doc {
  max-width: 68ch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-7);
}
.doc h2 { font-size: var(--step-3); margin: 0 0 var(--space-2); }
.doc h3 {
  font-size: var(--step-1);
  font-family: var(--font-sans);
  font-weight: 650;
  margin: var(--space-7) 0 var(--space-3);
}
.doc h3:first-of-type { margin-top: var(--space-6); }
.doc p, .doc li {
  font-family: var(--font-serif);
  font-size: var(--step-1);
  line-height: 1.62;
  color: var(--text-muted);
}
.doc > p:first-of-type { color: var(--text); }
.doc ul, .doc ol { padding-left: var(--space-6); margin: 0 0 var(--space-4); }
.doc li { margin-bottom: var(--space-2); }
.doc strong { color: var(--text); font-weight: 600; }
.doc code {
  font-family: var(--font-mono);
  font-size: .88em;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.doc-updated {
  margin-top: var(--space-7);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  font-family: var(--font-sans);
  font-size: var(--step--1);
  color: var(--text-subtle);
}
.doc-empty {
  padding: var(--space-6);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  color: var(--text-subtle);
}

@media (max-width: 900px) {
  .doc-layout { grid-template-columns: 1fr; }
  .doc-toc {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    max-height: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: var(--space-2);
  }
  .doc-toc-item { border-left: 0; border-bottom: 2px solid transparent; white-space: nowrap; }
  .doc-toc-item[aria-current="true"] { border-bottom-color: var(--accent); }
  .doc { padding: var(--space-5); }
}

.member-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
}
.member-row:last-child { border-bottom: 0; }
.member-text { min-width: 0; flex: 1; }
.member-name { font-weight: 600; }
.member-meta {
  font-size: var(--step--1);
  color: var(--text-subtle);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.member-actions { display: flex; align-items: center; gap: var(--space-2); flex: none; }

.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.stack-sm { display: flex; flex-direction: column; gap: var(--space-2); }
.stack-lg { display: flex; flex-direction: column; gap: var(--space-6); }
.row { display: flex; align-items: center; gap: var(--space-3); }
.row-wrap { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.row-end { display: flex; align-items: center; gap: var(--space-3); justify-content: flex-end; }
.spacer { flex: 1; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-4); }
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }
.small { font-size: var(--step--1); }
.tiny { font-size: 12px; }
.strong { font-weight: 600; }
.serif { font-family: var(--font-serif); }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.danger-text { color: var(--danger); }
.success-text { color: var(--success); }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }

.boot-error {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-sans);
}
.boot-error-card {
  max-width: 520px;
  padding: var(--space-7);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.boot-error-card h1 { font-size: var(--step-2); margin-bottom: var(--space-3); }
.boot-error-card pre {
  margin: var(--space-4) 0 0;
  padding: var(--space-4);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-muted);
}
