:root {
  color-scheme: dark light;

  --bg: #09090b;
  --surface: #111114;
  --surface-elevated: #18181c;
  --surface-hover: #1d1d22;
  --border: rgba(255, 255, 255, 0.085);
  --border-strong: rgba(255, 255, 255, 0.18);

  --text: #fafafa;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;

  --cta-bg: #fafafa;
  --cta-fg: #09090b;
  --cta-hover: #e4e4e7;

  --signal-green: #22c55e;
  --signal-green-bg: rgba(34, 197, 94, 0.11);
  --signal-green-border: rgba(34, 197, 94, 0.34);

  --signal-amber: #f59e0b;
  --signal-amber-bg: rgba(245, 158, 11, 0.11);
  --signal-amber-border: rgba(245, 158, 11, 0.34);

  --signal-rose: #f43f5e;
  --signal-rose-bg: rgba(244, 63, 94, 0.12);
  --signal-rose-border: rgba(244, 63, 94, 0.38);

  --dot-systems: #38bdf8;
  --dot-wealth: #f59e0b;
  --dot-martial: #f43f5e;
  --dot-german: #22c55e;

  --radius: 12px;
  --radius-sm: 8px;

  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, monospace;

  --bottom-nav-height: 62px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f7f5;
    --surface: #ffffff;
    --surface-elevated: #f1f1ee;
    --surface-hover: #e8e8e4;
    --border: rgba(9, 9, 11, 0.09);
    --border-strong: rgba(9, 9, 11, 0.22);

    --text: #09090b;
    --text-muted: #52525b;
    --text-dim: #71717a;

    --cta-bg: #09090b;
    --cta-fg: #fafafa;
    --cta-hover: #27272a;

    --signal-green: #15803d;
    --signal-green-bg: rgba(21, 128, 61, 0.09);
    --signal-green-border: rgba(21, 128, 61, 0.3);

    --signal-amber: #b45309;
    --signal-amber-bg: rgba(180, 83, 9, 0.09);
    --signal-amber-border: rgba(180, 83, 9, 0.3);

    --signal-rose: #be123c;
    --signal-rose-bg: rgba(190, 18, 60, 0.09);
    --signal-rose-border: rgba(190, 18, 60, 0.34);

    --dot-systems: #0284c7;
    --dot-wealth: #b45309;
    --dot-martial: #be123c;
    --dot-german: #15803d;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: var(--signal-green);
  color: #09090b;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h2 {
  font-size: 16px;
  line-height: 1.3;
}

h3 {
  font-size: 15px;
  line-height: 1.3;
}

p {
  margin: 0;
}

button,
a,
input,
select,
textarea {
  touch-action: manipulation;
  font-family: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

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

.small {
  font-size: 12px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 200;
  background: var(--cta-bg);
  color: var(--cta-fg);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  left: 16px;
}

/* Login Shell */

.login-body {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.login-shell {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon,
.hud-logo {
  border-radius: 8px;
  flex-shrink: 0;
}

.login-brand-copy h1 {
  font-size: 20px;
  line-height: 1.2;
}

.login-form,
.stack-md {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stack-lg {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  min-height: 40px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-size: 14px;
  line-height: 1.4;
}

textarea {
  min-height: 68px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-dim);
}

.error-text {
  color: var(--signal-rose);
  font-size: 13px;
  font-weight: 500;
}

/* Header Telemetry HUD */

.hud-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.hud-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hud-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.hud-title-block {
  min-width: 0;
}

.hud-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lvl-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--signal-green);
  background: var(--signal-green-bg);
  border: 1px solid var(--signal-green-border);
  border-radius: 6px;
  padding: 1px 7px;
  white-space: nowrap;
}

.hud-tier {
  font-size: 16px;
  line-height: 1.2;
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--text-dim);
  flex-shrink: 0;
}

.sync-pill.ok {
  border-color: var(--signal-green-border);
  color: var(--signal-green);
}

.sync-pill.ok .sync-dot {
  background: var(--signal-green);
}

.sync-pill.warn {
  border-color: var(--signal-amber-border);
  color: var(--signal-amber);
}

.sync-pill.warn .sync-dot {
  background: var(--signal-amber);
}

.hud-telemetry {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hud-xp-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.hud-xp-num {
  font-size: 14px;
  font-weight: 600;
}

.xp-rail {
  position: relative;
  width: 100%;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
}

.xp-progress {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
}

.xp-progress::-webkit-progress-bar {
  background: transparent;
}

.xp-progress::-webkit-progress-value {
  background: var(--signal-green);
  border-radius: 999px;
  transition: width 220ms ease;
}

.xp-progress::-moz-progress-bar {
  background: var(--signal-green);
  border-radius: 999px;
}

.rail-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--bg);
  opacity: 0.7;
  pointer-events: none;
}

.tick-25 {
  left: 25%;
}

.tick-50 {
  left: 50%;
}

.tick-75 {
  left: 75%;
}

.desktop-tabs {
  display: none;
  gap: 6px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.tab-btn {
  appearance: none;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
}

.tab-btn:hover {
  color: var(--text);
  background: var(--surface);
}

.tab-btn.active {
  color: var(--text);
  background: var(--surface-elevated);
  border-color: var(--border-strong);
}

/* Main Workspace */

.main-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 16px calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 24px);
}

.tab-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.two-col-desktop {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

/* Flush 2x2 -> 4x1 Pillar Telemetry Matrix */

.pillar-matrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.pillar-cell {
  background: var(--surface);
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.pillar-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.pillar-label-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.pillar-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  flex-shrink: 0;
}

.dot-systems {
  background: var(--dot-systems);
}

.dot-wealth {
  background: var(--dot-wealth);
}

.dot-martial {
  background: var(--dot-martial);
}

.dot-german {
  background: var(--dot-german);
}

.pillar-name {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}

.pillar-xp {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

.pillar-sub {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Surface Groups & Flush Hairline Lists */

.surface-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.section-head.wrap {
  flex-wrap: wrap;
}

.hairline-list {
  display: flex;
  flex-direction: column;
}

.hairline-row {
  border-top: 1px solid var(--border);
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hairline-row:first-child {
  border-top: 0;
  padding-top: 2px;
}

.hairline-row:last-child {
  padding-bottom: 2px;
}

.row-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.row-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.row-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  overflow-wrap: break-word;
}

.row-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.row-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.log-row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.log-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-note {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  overflow-wrap: anywhere;
}

.log-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.meta-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-transform: lowercase;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  color: var(--text-muted);
  white-space: nowrap;
}

.badge.green {
  color: var(--signal-green);
  background: var(--signal-green-bg);
  border-color: var(--signal-green-border);
}

.badge.amber {
  color: var(--signal-amber);
  background: var(--signal-amber-bg);
  border-color: var(--signal-amber-border);
}

.badge.rose {
  color: var(--signal-rose);
  background: var(--signal-rose-bg);
  border-color: var(--signal-rose-border);
}

/* Note Inline Form */

.note-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding-top: 2px;
}

/* Buttons */

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-elevated);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 120ms ease, border-color 120ms ease, transform 80ms ease;
}

.btn:hover:not(:disabled) {
  background: var(--surface-hover);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--cta-bg);
  color: var(--cta-fg);
  border-color: transparent;
}

.btn.primary:hover:not(:disabled) {
  background: var(--cta-hover);
}

.btn.danger {
  background: var(--signal-rose-bg);
  color: var(--signal-rose);
  border-color: var(--signal-rose-border);
}

.btn.small-btn,
.btn.compact-btn {
  min-height: 36px;
  padding: 6px 11px;
  font-size: 12px;
}

.btn.full-width {
  width: 100%;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.link-btn {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 4px 2px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.link-btn:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Segmented Filter & Skill Tree */

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

.seg-btn {
  appearance: none;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.seg-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.seg-btn.active {
  background: var(--cta-bg);
  color: var(--cta-fg);
  border-color: transparent;
}

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

.branch-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.branch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.branch-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.skill-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skill-node {
  appearance: none;
  width: 100%;
  text-align: left;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, transform 80ms ease;
}

.skill-node:hover {
  background: var(--surface-elevated);
  border-color: var(--border-strong);
}

.skill-node:active {
  transform: translateY(1px);
}

.skill-node.unlocked {
  border-color: var(--signal-green-border);
  background: color-mix(in srgb, var(--signal-green-bg) 55%, var(--bg));
}

.skill-node.ready {
  border-color: var(--signal-amber-border);
}

.skill-node.locked {
  opacity: 0.72;
}

.skill-node-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.skill-state-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.state-icon {
  flex-shrink: 0;
}

.state-icon.unlocked {
  color: var(--signal-green);
}

.state-icon.ready {
  color: var(--signal-amber);
}

.state-icon.locked {
  color: var(--text-dim);
}

.skill-node-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  overflow-wrap: break-word;
}

.skill-node-req {
  font-size: 12px;
  color: var(--text-dim);
}

/* Toggle Controls */

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
}

.toggle-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--signal-green);
  cursor: pointer;
}

/* Mobile Thumb Navigation */

.mobile-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
  height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.bottom-btn {
  appearance: none;
  background: transparent;
  color: var(--text-dim);
  border: 0;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  min-height: 44px;
  transition: color 120ms ease, background 120ms ease;
}

.bottom-btn.active {
  color: var(--text);
  background: var(--surface-elevated);
}

.nav-icon {
  flex-shrink: 0;
}

/* Bottom Sheet / Inspector Dialog */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.62);
}

.bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  max-height: 86dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border-top: 1px solid var(--border-strong);
  border-radius: 16px 16px 0 0;
  padding: 12px 18px calc(22px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: var(--border-strong);
  margin: 0 auto;
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sheet-copy {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}

.prereq-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.prereq-item {
  appearance: none;
  width: 100%;
  text-align: left;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  cursor: pointer;
}

.prereq-item:hover {
  border-color: var(--border-strong);
  background: var(--surface-elevated);
}

.prereq-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

/* Toast Notifications */

.toast-region {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 12px);
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--cta-bg);
  color: var(--cta-fg);
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.toast.level-up {
  background: var(--signal-green);
  color: #09090b;
}

/* Desktop Breakpoint */

@media (min-width: 768px) {
  .desktop-tabs {
    display: flex;
  }

  .mobile-bottom-nav {
    display: none;
  }

  .main-shell {
    padding: 20px 24px 40px;
  }

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

  .pillar-top {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
  }

  .pillar-name {
    font-size: 13px;
  }

  .pillar-xp {
    font-size: 12px;
  }

  .two-col-desktop {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

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

  .bottom-sheet {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    width: min(500px, calc(100vw - 32px));
    transform: translate(-50%, -50%);
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    padding: 20px;
  }

  .sheet-handle {
    display: none;
  }

  .toast-region {
    left: auto;
    right: 24px;
    bottom: 24px;
    align-items: flex-end;
  }
}

@media (min-width: 1080px) {
  .tree-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
