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

:root {
  --duration-fast: .12s;
  --duration-base: .18s;
  --duration-slow: .26s;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ui-scale: 1.12;
  --char-fx: 0;
  --char-fy: 1;
  --rt-desc-size: 14px;
  --rt-desc-leading: 1.714;
  --rt-desc-block: 0.8em;
}

html {
  zoom: var(--ui-scale);
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font-sans);
  font-weight: var(--weight-body);
  background: var(--canvas);
  color: var(--fg);
  overflow: hidden;
}

button, input, textarea, select {
  font-family: inherit;
  color: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

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

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes rise-in {
  from { opacity: 0; transform: translateY(6px) scale(.98); }
  to { opacity: 1; transform: none; }
}

/* Themes */
[data-theme="stormlikes"] {
  --canvas:#ffffff;--surface:#ffffff;--surface-raised:#ffffff;--surface-hover:#f3f3f3;--surface-active:#e8e8e8;
  --overlay:#11111173;--fg:#111111;--fg-muted:#3d3d3d;--fg-subtle:#5c5c5c;
  --border-subtle:#111111;--border:#111111;--border-strong:#111111;--border-width:2.5px;
  --accent:#111111;--accent-hover:#000000;--accent-fg:#ffffff;--accent-soft:#11111114;
  --support:#ffd43b;--support-fg:#111111;--support-soft:#ffd43b3d;
  --danger:#ff3b3b;--danger-hover:#e10606;--danger-fg:#ffffff;--danger-soft:#ff3b3b1a;
  --radius-tag:8px;--radius-control:12px;--radius-card:16px;--radius-panel:22px;
  --font-sans: "Rubik", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
  --font-display: "Rubik", ui-sans-serif, system-ui, sans-serif;
  --weight-body:500;--weight-medium:650;--weight-heading:800;
  --shadow-popover:5px 5px 0 0 #111111;--shadow-modal:8px 8px 0 0 #111111;
  --shadow-drag:10px 10px 0 0 #111111;
}
[data-theme="broadsheet"] {
  --canvas:#f7f4ec;--surface:#fbfaf5;--surface-raised:#fffdf6;--surface-hover:#edeae2;--surface-active:#e3e0d8;
  --overlay:#2b261e66;--fg:#17140f;--fg-muted:#4e463a;--fg-subtle:#5f584b;
  --border-subtle:#dcd7c9;--border:#c6c0ae;--border-strong:#8a8375;--border-width:1px;
  --accent:#26456e;--accent-hover:#1b3352;--accent-fg:#fff;--accent-soft:#26456e1a;
  --support:#7a4f00;--support-fg:#fff;--support-soft:#7a4f001f;
  --danger:#9e2b20;--danger-hover:#7e2119;--danger-fg:#fff;--danger-soft:#9e2b201a;
  --radius-tag:1px;--radius-control:1px;--radius-card:2px;--radius-panel:3px;
  --font-sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --weight-body:400;--weight-medium:600;--weight-heading:600;
  --shadow-popover:0 2px 10px -2px #17140f2e;--shadow-modal:0 20px 44px -14px #17140f52;
  --shadow-drag:0 1px 1px #17140f1a, 0 14px 28px -8px #17140f4d;
}
[data-theme="indexcard"] {
  --canvas:#c2b398;--surface:#f4eddf;--surface-raised:#fdfaf3;--surface-hover:#efe7d6;--surface-active:#e4dac5;
  --overlay:#2a241c6b;--fg:#241f18;--fg-muted:#413b30;--fg-subtle:#494234;
  --border-subtle:#d6cbb4;--border:#b4a88e;--border-strong:#5b5445;--border-width:1px;
  --accent:#33506e;--accent-hover:#26405a;--accent-fg:#fff;--accent-soft:#33506e1f;
  --support:#5f451e;--support-fg:#fff;--support-soft:#5f451e24;
  --danger:#a32219;--danger-hover:#841b14;--danger-fg:#fff;--danger-soft:#a322191f;
  --radius-tag:1px;--radius-control:2px;--radius-card:3px;--radius-panel:4px;
  --font-sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Courier New", Courier, monospace;
  --font-display: var(--font-sans);
  --weight-body:400;--weight-medium:600;--weight-heading:600;
  --shadow-popover:0 4px 14px -4px #2a241c59;--shadow-modal:0 24px 50px -14px #2a241c73;
  --shadow-drag:0 2px 2px #2a241c24, 0 16px 26px -8px #2a241c57;
}
[data-theme="signalpress"] {
  --canvas:#f1efea;--surface:#fff;--surface-raised:#fff;--surface-hover:#e7e4dd;--surface-active:#dad6ce;
  --overlay:#0a0a0a73;--fg:#0a0a0a;--fg-muted:#4a4742;--fg-subtle:#55524c;
  --border-subtle:#0a0a0a;--border:#0a0a0a;--border-strong:#0a0a0a;--border-width:2px;
  --accent:#b02000;--accent-hover:#8c1a00;--accent-fg:#fff;--accent-soft:#b020001a;
  --support:#8c1a00;--support-fg:#fff;--support-soft:#8c1a001f;
  --danger:#b02000;--danger-hover:#8c1a00;--danger-fg:#fff;--danger-soft:#b020001a;
  --radius-tag:0;--radius-control:0;--radius-card:0;--radius-panel:0;
  --font-sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
  --font-display: var(--font-sans);
  --weight-body:400;--weight-medium:700;--weight-heading:700;
  --shadow-popover:6px 6px 0 0 #0a0a0a;--shadow-modal:12px 12px 0 0 #0a0a0a;
  --shadow-drag:10px 10px 0 0 #0a0a0a;
}
[data-theme="jira"] {
  --canvas:#f4f5f7;--surface:#ffffff;--surface-raised:#ffffff;--surface-hover:#ebecf0;--surface-active:#dfe1e6;
  --overlay:#091e4280;--fg:#172b4d;--fg-muted:#42526e;--fg-subtle:#6b778c;
  --border-subtle:#ebecf0;--border:#dfe1e6;--border-strong:#c1c7d0;--border-width:1px;
  --accent:#0052cc;--accent-hover:#0747a6;--accent-fg:#ffffff;--accent-soft:#deebff;
  --support:#36b37e;--support-fg:#ffffff;--support-soft:#e3fcef;
  --danger:#de350b;--danger-hover:#bf2600;--danger-fg:#ffffff;--danger-soft:#ffebe6;
  --radius-tag:3px;--radius-control:3px;--radius-card:3px;--radius-panel:6px;
  --font-sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
  --font-display: var(--font-sans);
  --weight-body:400;--weight-medium:600;--weight-heading:600;
  --shadow-popover:0 4px 8px -2px #091e4226, 0 0 1px #091e4233;--shadow-modal:0 8px 16px -4px #091e4233;
  --shadow-drag:0 8px 16px -4px #091e423d;
}
[data-theme="monday"] {
  --canvas:#f6f7fb;--surface:#ffffff;--surface-raised:#ffffff;--surface-hover:#eef0f7;--surface-active:#e4e7f2;
  --overlay:#32333873;--fg:#323338;--fg-muted:#676879;--fg-subtle:#8d8f9c;
  --border-subtle:#eceff8;--border:#d0d4e4;--border-strong:#c5c7d0;--border-width:1px;
  --accent:#6161ff;--accent-hover:#4e4ee6;--accent-fg:#ffffff;--accent-soft:#e8e8ff;
  --support:#00c875;--support-fg:#05331d;--support-soft:#c2f0dc;
  --danger:#e44258;--danger-hover:#c7364a;--danger-fg:#ffffff;--danger-soft:#ffd6dc;
  --radius-tag:6px;--radius-control:8px;--radius-card:10px;--radius-panel:14px;
  --font-sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
  --font-display: var(--font-sans);
  --weight-body:500;--weight-medium:650;--weight-heading:700;
  --shadow-popover:0 6px 16px -6px #6161ff2e, 0 1px 3px #32333814;--shadow-modal:0 18px 40px -16px #6161ff33;
  --shadow-drag:0 12px 24px -10px #6161ff40;
}

[data-theme="stormlikes"] .header,
[data-theme="stormlikes"] .app-nav,
[data-theme="stormlikes"] .subhead {
  border-color: var(--fg);
}
[data-theme="stormlikes"] .header {
  border-bottom-width: 3px;
}
[data-theme="stormlikes"] .app-nav {
  border-right-width: 3px;
}
[data-theme="stormlikes"] .brand:hover .board-product { color: var(--fg); }
[data-theme="stormlikes"] .board-product {
  font-weight: 800;
  letter-spacing: -0.045em;
}
[data-theme="stormlikes"] .btn:not(.btn-ghost) {
  border-color: var(--fg);
  box-shadow: 3px 3px 0 0 var(--fg);
  font-weight: 700;
}
[data-theme="stormlikes"] .btn:not(.btn-ghost):hover,
[data-theme="stormlikes"] .btn-primary:hover,
[data-theme="stormlikes"] .hero-chip:hover,
[data-theme="stormlikes"] .checkin-chip:hover,
[data-theme="stormlikes"] .icon-btn:hover:not(.comment-send-btn),
[data-theme="stormlikes"] .nav-add:hover,
[data-theme="stormlikes"] .nav-item:hover,
[data-theme="stormlikes"] .nav-board:hover,
[data-theme="stormlikes"] .journey-board-card:hover,
[data-theme="stormlikes"] .theme-card:hover,
[data-theme="stormlikes"] .summary-portrait:hover,
[data-theme="stormlikes"] .add-card:hover,
[data-theme="stormlikes"] .add-column:hover,
[data-theme="stormlikes"] .create-card-fab:hover {
  background: var(--support);
  color: var(--fg);
  border-color: var(--fg);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 0 var(--fg);
  filter: none;
}
[data-theme="stormlikes"] .card:hover {
  background: var(--surface-hover);
  color: var(--fg);
  border-color: var(--fg);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 0 var(--fg);
  filter: none;
}
[data-theme="stormlikes"] .btn-primary:hover {
  background: var(--support);
  color: var(--fg);
  border-color: var(--fg);
}
[data-theme="stormlikes"] .btn:not(.btn-ghost):active,
[data-theme="stormlikes"] .hero-chip:active,
[data-theme="stormlikes"] .nav-item:active,
[data-theme="stormlikes"] .nav-board:active,
[data-theme="stormlikes"] .journey-board-card:active,
[data-theme="stormlikes"] .card:active,
[data-theme="stormlikes"] .create-card-fab:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 0 var(--fg);
  filter: none;
}
[data-theme="stormlikes"] .btn-primary {
  background: var(--fg);
  color: #fff;
  border-color: var(--fg);
}
[data-theme="stormlikes"] .nav-item.active,
[data-theme="stormlikes"] .nav-board.active {
  background: var(--support);
  border-color: var(--fg);
  box-shadow: 3px 3px 0 0 var(--fg);
  color: var(--fg);
}
[data-theme="stormlikes"] .hero-chip,
[data-theme="stormlikes"] .checkin-chip {
  border-color: var(--fg);
  box-shadow: 3px 3px 0 0 var(--fg);
}
[data-theme="stormlikes"] .column,
[data-theme="stormlikes"] .summary-hero,
[data-theme="stormlikes"] .summary-card,
[data-theme="stormlikes"] .journey-stat,
[data-theme="stormlikes"] .journey-board-card,
[data-theme="stormlikes"] .checkin-card,
[data-theme="stormlikes"] .journey-checkin,
[data-theme="stormlikes"] .modal,
[data-theme="stormlikes"] .gate-card,
[data-theme="stormlikes"] .dd-panel,
[data-theme="stormlikes"] .menu-flyout,
[data-theme="stormlikes"] .theme-card {
  border-color: var(--fg);
  box-shadow: var(--shadow-popover);
}
[data-theme="stormlikes"] .theme-card.active {
  background: var(--support);
  box-shadow: 3px 3px 0 0 var(--fg);
}
[data-theme="stormlikes"] .theme-card.active:hover {
  background: var(--support);
}
[data-theme="stormlikes"] .card {
  background: #fff;
  box-shadow: none;
}
[data-theme="stormlikes"] .card:not(:hover):not(:active):not(.dragging) {
  box-shadow: none;
  transform: none;
}
[data-theme="stormlikes"] .card.is-selected:not(:hover):not(:active) {
  box-shadow: none;
  border-color: var(--accent);
}
[data-theme="stormlikes"] .summary-hero,
[data-theme="stormlikes"] .journey-stat,
[data-theme="stormlikes"] .journey-checkin,
[data-theme="stormlikes"] .checkin-card {
  background: #fff;
}
[data-theme="stormlikes"] .modal,
[data-theme="stormlikes"] .gate-card {
  box-shadow: var(--shadow-modal);
}
[data-theme="stormlikes"] .level-badge {
  background: var(--support);
  color: var(--fg);
  border-color: var(--fg);
  box-shadow: 2px 2px 0 0 var(--fg);
}
[data-theme="stormlikes"] .xp-bar-hero {
  border-color: var(--fg);
  background: #fff;
  box-shadow: 2px 2px 0 0 var(--fg);
}
[data-theme="stormlikes"] .xp-bar-hero .xp-bar-fill {
  background: var(--support);
  box-shadow: none;
}
[data-theme="stormlikes"] .xp-bar-hero .xp-bar-fill::after {
  background: linear-gradient(180deg, color-mix(in srgb, #fff 28%, transparent), transparent);
}
[data-theme="stormlikes"] .create-card-fab {
  border: var(--border-width) solid var(--fg);
  background: var(--fg);
  color: #fff;
  box-shadow: 5px 5px 0 0 var(--fg);
  filter: none;
}
[data-theme="stormlikes"] .view-tab.active {
  background: var(--support);
  color: var(--fg);
  border-bottom-color: var(--fg);
}
[data-theme="stormlikes"] .dd-trigger,
[data-theme="stormlikes"] .field,
[data-theme="stormlikes"] .rt-wrap:not(.previewing) {
  border-color: var(--fg);
}
[data-theme="stormlikes"] .dd.open .dd-trigger,
[data-theme="stormlikes"] .field:focus,
[data-theme="stormlikes"] .rt-wrap:not(.previewing):focus-within {
  box-shadow: 3px 3px 0 0 var(--fg);
  border-color: var(--fg);
}
[data-texture="grid"] body {
  background-image:
    linear-gradient(var(--border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
  background-size: 24px 24px;
}
[data-texture="paper"] body {
  background-image: repeating-linear-gradient(0deg, transparent, transparent 23px, #0000000a 24px);
}
[data-texture="dither"] body {
  background-image: repeating-linear-gradient(45deg, #ffc24a0f 0 1px, transparent 1px 3px);
}

.app {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.app-body {
  display: flex;
  flex: 1;
  min-height: 0;
  min-width: 0;
}
.app-stage {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.nav-toggle { display: none !important; }
.nav-collapse {
  flex-shrink: 0;
}
.nav-collapse-icon {
  width: 16px;
  height: 16px;
}
.app.nav-collapsed .nav-collapse-icon-close { display: none; }
.app.nav-collapsed .nav-collapse-icon-open { display: block; }
.app:not(.nav-collapsed) .nav-collapse-icon-open { display: none; }
.app-nav {
  width: 220px;
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 12px 10px 18px;
  border-right: var(--border-width) solid var(--border);
  background: var(--surface);
  overflow: auto;
  transition:
    width var(--duration-fast) var(--ease-out),
    flex-basis var(--duration-fast) var(--ease-out),
    padding var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out);
}
.app.nav-collapsed .app-nav {
  width: 0;
  flex-basis: 0;
  padding-left: 0;
  padding-right: 0;
  border-right-color: transparent;
  overflow: hidden;
  pointer-events: none;
}
.nav-item {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px;
  border: var(--border-width) solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 13px;
  font-weight: var(--weight-medium);
  text-align: left;
  cursor: pointer;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item:hover,
.nav-board:hover {
  background: var(--surface-hover);
  color: var(--fg);
}
.nav-item:active,
.nav-board:active {
  background: var(--surface-active);
}
.nav-item.active,
.nav-board.active {
  background: var(--surface-raised);
  border-color: var(--border);
  color: var(--fg);
  font-weight: var(--weight-medium);
}
.nav-section { display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.nav-section-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  font-size: 11px;
  font-weight: var(--weight-medium);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}
.nav-add {
  appearance: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
}
.nav-add svg { width: 16px; height: 16px; }
.nav-add:hover { background: var(--surface-hover); color: var(--fg); }
.nav-boards { display: flex; flex-direction: column; gap: 2px; }
.nav-board {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: var(--border-width) solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--fg-muted);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.nav-board span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-empty {
  margin: 0;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--fg-subtle);
}
.nav-backdrop { display: none; }

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 8px 16px;
  border-bottom: var(--border-width) solid var(--border);
  background: var(--surface);
  min-height: 52px;
  flex-shrink: 0;
}
.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 1;
  flex-wrap: wrap;
  margin-left: auto;
}

.brand {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.brand:hover .board-product { color: var(--accent); }

.logo-mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  object-fit: contain;
  display: block;
}
.board-path {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  flex: 1;
  font-family: var(--font-display);
  font-weight: var(--weight-heading);
  font-size: 1.05rem;
}
.board-path[hidden] { display: none !important; }
.board-product {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.12rem;
  letter-spacing: -0.04em;
  line-height: 1;
}

.board-path .slash {
  color: var(--fg-subtle);
  font-weight: 400;
}

.board-path .board-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  font-size: 13px;
  font-weight: var(--weight-medium);
  cursor: pointer;
  white-space: nowrap;
  transition:
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.btn:active { background: var(--surface-active); transform: translateY(1px); }
.btn:disabled { opacity: .45; pointer-events: none; transform: none; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-primary:active { filter: brightness(0.92); }

.btn-danger {
  color: var(--danger);
  background: transparent;
  border-color: var(--danger);
}
.btn-danger:hover { background: var(--danger-soft); }
.btn-danger:active { background: var(--danger); color: var(--danger-fg); }

.btn-ghost {
  color: var(--fg-muted);
  background: transparent;
  border-color: transparent;
}
.btn-ghost:hover { color: var(--fg); background: var(--surface-hover); border-color: transparent; }
.btn-ghost:active { background: var(--surface-active); }
.btn.menu-open {
  background: var(--surface-active);
  color: var(--fg);
}

.icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
}
.icon-btn:hover { background: var(--surface-hover); color: var(--fg); }
.icon-btn:active { background: var(--surface-active); transform: scale(0.94); }
.icon-btn.menu-open { background: var(--surface-active); color: var(--fg); }
.icon-btn svg { width: 16px; height: 16px; }

/* Views */
.subhead {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 16px 0;
  flex-shrink: 0;
}

.view-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--fg-muted);
  font-size: 13px;
  font-weight: var(--weight-medium);
  cursor: pointer;
  border-radius: var(--radius-control) var(--radius-control) 0 0;
  transition: color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}
.view-tab svg { width: 14px; height: 14px; }
.view-tab:hover { color: var(--fg); background: var(--surface-hover); }
.view-tab:active { background: var(--surface-active); }
.view-tab.active {
  color: var(--fg);
  border-bottom-color: var(--accent);
  background: var(--accent-soft);
}

/* Filters */
.filters {
  padding: 10px 16px 12px;
  flex-shrink: 0;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-main {
  gap: 6px;
}
.filter-main .search {
  flex: 1 1 160px;
  min-width: 140px;
  max-width: 320px;
}
.filter-dd {
  flex: 0 1 auto;
}
.filter-dd .dd-trigger {
  height: 34px;
  min-width: 0;
  max-width: 150px;
}
.filter-dd.is-active .dd-trigger {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}
.filter-dd.is-active .dd-chevron {
  color: var(--accent-fg);
}
.filter-dd.is-active .dd-trigger:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-fg);
}
.filter-main .btn.icon-only {
  width: 34px;
  padding: 0;
}
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 180px;
  height: 34px;
  padding: 0 10px;
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-control);
  transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}
.search:hover { border-color: var(--border-strong); }
.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search svg { width: 14px; height: 14px; color: var(--fg-subtle); }
.search input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
}
.search input::placeholder { color: var(--fg-subtle); }

.select, .field {
  height: 34px;
  padding: 0 10px;
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-control);
  font-size: 13px;
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out);
}
.select:hover, .field:hover { border-color: var(--border-strong); }
.select:focus, .field:focus, textarea.field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.filter-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--fg-subtle);
  align-items: center;
}
#brief-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.filter-meta .dot { opacity: .6; }
.brief-link {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 11px;
  font-weight: var(--weight-medium);
  border-radius: var(--radius-control);
  padding: 2px 4px;
  margin: -2px -4px;
  transition: color var(--duration-fast), background var(--duration-fast);
}
.brief-link:hover { color: var(--accent-hover); background: var(--accent-soft); text-decoration: none; }
.brief-link:active { transform: translateY(1px); }

.board-brief {
  margin: 0 16px 10px;
  padding: 10px 12px 12px;
  background: var(--surface-raised);
  border: var(--border-width) solid var(--border-subtle);
  border-radius: var(--radius-panel);
  transition: border-color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out);
}
.board-brief:hover { border-color: var(--border); }
.brief-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.brief-toggle {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  border: none;
  border-radius: var(--radius-control);
  background: var(--surface-hover);
  color: var(--fg-muted);
  cursor: pointer;
  transition: background var(--duration-fast), color var(--duration-fast), transform var(--duration-fast);
}
.brief-toggle:hover { background: var(--surface-active); color: var(--fg); }
.brief-toggle:active { transform: scale(0.94); }
.brief-toggle svg {
  width: 12px;
  height: 12px;
  display: block;
  transition: transform var(--duration-fast) var(--ease-out);
}
.board-brief.collapsed .brief-toggle svg { transform: rotate(-90deg); }
.brief-title {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  font-weight: var(--weight-medium);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg);
}
.brief-edit {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  border: none;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--fg-subtle);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-fast), background var(--duration-fast), color var(--duration-fast), transform var(--duration-fast);
}
.board-brief:hover .brief-edit,
.board-brief:focus-within .brief-edit {
  opacity: 1;
  pointer-events: auto;
}
.brief-edit:hover { background: var(--surface-hover); color: var(--fg); }
.brief-edit:active { background: var(--surface-active); transform: scale(0.94); }
.brief-edit svg { width: 14px; height: 14px; }
.brief-body {
  margin: 8px 0 2px 30px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--fg);
  white-space: pre-wrap;
  word-break: break-word;
}
.board-brief.collapsed {
  padding-bottom: 10px;
}
.board-brief.collapsed .brief-body { display: none; }

/* Board */
.main {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px 16px 24px;
}
.app[data-shell="journey"] .subhead,
.app[data-shell="journey"] .filters,
.app[data-shell="journey"] .board-brief,
.app[data-shell="journey"] ~ .create-card-fab,
.app[data-shell="landing"] .subhead,
.app[data-shell="landing"] .filters,
.app[data-shell="landing"] .board-brief,
.app[data-shell="landing"] .app-nav,
.app[data-shell="landing"] .nav-backdrop,
.app[data-shell="landing"] .nav-toggle,
.app[data-shell="landing"] .nav-collapse,
.app[data-shell="landing"] .hero-chip,
.app[data-shell="landing"] .profile-hover,
.app[data-shell="landing"] #board-menu-btn,
.app[data-shell="landing"] ~ .create-card-fab,
.create-card-fab.hidden-view { display: none !important; }
.landing-header-cta { display: none !important; }
.app[data-shell="landing"] .landing-header-cta { display: inline-flex !important; }
.app[data-shell="landing"] {
  --land-ink: #111111;
  --land-paper: #ffffff;
  --land-sun: #ffd43b;
  --land-mute: #3d3d3d;
}
.app[data-shell="landing"] .app-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.app[data-shell="landing"] .app-stage {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.app[data-shell="landing"] .header {
  position: relative;
  z-index: 8;
  background: #fff !important;
  border-bottom: none;
  flex-shrink: 0;
}
.app[data-shell="landing"] .main {
  flex: 1;
  min-height: 0;
  padding: 0;
  margin-top: -52px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.board {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-height: 100%;
}

.column {
  flex: 0 0 256px;
  width: 256px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-panel);
}

[data-column-frame="rule"] .column {
  background: transparent;
  border-left: none;
  border-right: none;
  border-top: none;
  border-radius: 0;
  border-bottom: none;
  border-right: var(--border-width) solid var(--border-subtle);
}
[data-column-frame="tab"] .column {
  background: var(--surface-raised);
  border-radius: var(--radius-panel) var(--radius-panel) 2px 2px;
}
[data-column-frame="ascii"] .column {
  border-style: dashed;
}

.column.backlog {
  background: color-mix(in srgb, var(--surface) 80%, var(--canvas));
}

.column.drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
}

.column.column-dragging {
  opacity: 0.55;
  outline: 1px dashed var(--accent);
  outline-offset: -1px;
}

.column-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 10px 8px;
  flex-shrink: 0;
}

.col-grip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 22px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--fg-subtle);
  cursor: grab;
  flex-shrink: 0;
  border-radius: var(--radius-control);
}
.col-grip:hover { color: var(--fg); background: var(--surface-hover); }
.col-grip:active,
.column-dragging .col-grip { cursor: grabbing; background: var(--surface-active); }
.col-grip svg {
  display: block;
  width: 10px;
  height: 16px;
}

.column-title {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  font-weight: var(--weight-heading);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  padding: 2px 4px;
  outline: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: border-color var(--duration-fast), background var(--duration-fast);
}
.column-title:hover { border-color: var(--border); }
.column-title:focus { border-color: var(--accent); background: var(--canvas); box-shadow: 0 0 0 3px var(--accent-soft); }

.col-count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--fg);
}
.col-done-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 99px;
  background: var(--support-soft);
  color: color-mix(in srgb, var(--support) 80%, var(--fg));
  border: 1px solid color-mix(in srgb, var(--support) 55%, var(--border));
}
.col-done-pill svg {
  display: block;
  width: 10px;
  height: 10px;
}
[data-theme="stormlikes"] .col-done-pill {
  background: var(--support);
  color: var(--fg);
  border-color: var(--fg);
}

.column-cards {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 48px;
}

.empty-col {
  font-size: 12px;
  color: var(--fg-subtle);
  padding: 16px 8px;
  text-align: center;
}

.column.is-collapsed {
  flex: 0 0 52px;
  width: 52px;
}
.column.is-collapsed .column-cards,
.column.is-collapsed .quick-add {
  display: none;
}
.column.is-collapsed .column-header {
  flex-direction: column;
  align-items: center;
  height: min(100%, 280px);
  padding: 10px 6px;
}
.column.is-collapsed .column-title {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  width: auto;
  flex: 1;
  text-align: center;
  padding: 8px 0;
}
.column.is-collapsed .col-grip,
.column.is-collapsed .col-menu {
  margin: 0;
}
.column.is-collapsed .col-done-pill {
  margin-top: 2px;
}

.quick-add {
  margin: 0 8px 10px;
  border: var(--border-width) dashed var(--border);
  border-radius: var(--radius-control);
  background: transparent;
  transition: border-color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}
.quick-add:hover {
  border-color: var(--border-strong);
}
.quick-add.is-open {
  border-style: solid;
  border-color: var(--accent);
  background: var(--surface-raised);
  box-shadow: 0 0 0 3px var(--accent-soft);
  overflow: hidden;
}
.quick-add-input {
  width: 100%;
  height: 30px;
  border: none;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--fg);
  font-size: 12px;
  padding: 0 10px;
}
.quick-add.is-open .quick-add-input {
  height: 36px;
  font-size: 13px;
}
.quick-add-input::placeholder { color: var(--fg-muted); }
.quick-add-input:focus { outline: none; }
.quick-add-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  padding: 0 6px 6px;
}
.quick-add.is-open .quick-add-bar {
  display: flex;
}
.quick-add-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  min-width: 0;
}
.quick-add-icon-btn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  aspect-ratio: 1;
  padding: 0;
  border: var(--border-width) solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--fg-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color var(--duration-fast) var(--ease-out), color var(--duration-fast), background var(--duration-fast);
}
.quick-add-icon-btn:hover {
  border-color: var(--accent);
  color: var(--fg);
  background: var(--accent-soft);
}
.quick-add-icon-btn svg {
  width: 14px;
  height: 14px;
}
.quick-add-rank {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}
.quick-add-rank.rank-T { color: #64748b; border-color: #64748b55; }
.quick-add-rank.rank-E { color: #3b82f6; border-color: #3b82f655; }
.quick-add-rank.rank-M { color: #f5c400; border-color: #f5c40099; }
.quick-add-rank.rank-H { color: #ff7a1a; border-color: #ff7a1a99; }
.quick-add-due.has-date {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.quick-add-rank-dd {
  position: relative;
  width: 28px;
  min-width: 0;
  flex: 0 0 28px;
}
.quick-add-rank-dd .dd-trigger {
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  height: 28px;
  aspect-ratio: 1;
  padding: 0;
  justify-content: center;
  background: var(--surface);
}
.quick-add-rank-dd .dd-chevron { display: none; }
.quick-add-rank-dd .dd-panel {
  min-width: 180px;
}
.quick-add-submit {
  flex-shrink: 0;
  color: var(--fg-subtle);
}
.quick-add-submit:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.add-card, .add-column {
  margin: 0 8px 10px;
  height: 30px;
  border: var(--border-width) dashed var(--border);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--fg-muted);
  font-size: 12px;
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-out), color var(--duration-fast), background var(--duration-fast), transform var(--duration-fast);
}
.add-card:hover, .add-column:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.add-card:active, .add-column:active {
  transform: translateY(1px);
  background: var(--accent-soft);
}
.add-column {
  flex: 0 0 256px;
  width: 256px;
  height: 40px;
  margin: 0;
  align-self: flex-start;
}

/* Cards */
.card {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-card);
  padding: 10px 12px 12px 16px;
  cursor: grab;
  user-select: none;
  transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out);
}
.card.rank-T,
.card.rank-E,
.card.rank-M,
.card.rank-H {
  background: #fff;
}
[data-card-chrome="rule"] .card {
  background: transparent;
  border-left: none;
  border-right: none;
  border-top: none;
  border-radius: 0;
  padding-left: 12px;
}
[data-card-chrome="ruled-card"] .card {
  background-image: repeating-linear-gradient(transparent, transparent 21px, #00000012 22px);
}
[data-card-chrome="glyph-frame"] .card {
  box-shadow: inset 0 0 0 1px var(--border);
}

.card:hover { box-shadow: var(--shadow-popover); border-color: var(--accent); transform: translateY(-1px); }
.card:active { transform: translateY(0); cursor: grabbing; }
.card.dragging { opacity: .4; cursor: grabbing; box-shadow: var(--shadow-drag); transform: none; }
.card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.card.has-color { padding-left: 16px; }
.card-color-bar,
.card-rank-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 8px;
  border-radius: var(--radius-card) 0 0 var(--radius-card);
}
[data-card-chrome="rule"] .card-rank-bar {
  border-radius: 0;
}
.card.rank-T { --rank-color: #94a3b8; }
.card.rank-E { --rank-color: #3b82f6; }
.card.rank-M { --rank-color: #f5c400; }
.card.rank-H { --rank-color: #ff7a1a; }

.card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.card-title {
  font-size: 15px;
  font-weight: var(--weight-heading);
  line-height: 1.35;
  word-break: break-word;
  min-width: 0;
}
.rank-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1;
}
.rank-T { background: #94a3b824; color: #64748b; }
.rank-E { background: #3b82f624; color: #2563eb; }
.rank-M { background: #f5c40033; color: #b45309; }
.rank-H { background: #ff7a1a29; color: #c2410c; }
.rank-F { background: #8d8d8d2e; color: #6f6f6f; }
.rank-C { background: #30a46c24; color: #1d7a4e; }
.rank-B { background: #3e63dd24; color: #3e63dd; }
.rank-A { background: #8e4ec624; color: #7b3fb0; }
.rank-S { background: #f5b80033; color: #8a6500; }
#fx-layer {
  position: fixed;
  inset: 0;
  z-index: 125;
  pointer-events: none;
  overflow: visible;
}
.create-card-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px 0 14px;
  border: none;
  border-radius: var(--radius-control);
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
  transition: transform var(--duration-fast) var(--ease-out), filter var(--duration-fast);
}
.create-card-fab svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.create-card-fab:hover {
  filter: brightness(1.06);
}
.create-card-fab:active {
  transform: translateY(1px);
  filter: brightness(0.95);
}
.create-card-fab.hidden-view {
  display: none !important;
}
.gold-burst {
  position: fixed;
  z-index: 1;
  transform: translateY(-8px);
  pointer-events: none;
  font-size: 13px;
  font-weight: 700;
  color: #8a6500;
  text-shadow: 0 1px 0 #fff6, 0 0 12px #f5b80088;
  white-space: nowrap;
  opacity: 1;
  transition: transform 1s ease-out, opacity 1s ease-out;
}
.gold-burst.play {
  transform: translateY(-36px);
  opacity: 0;
}
.gold-burst.muted {
  color: var(--fg-muted);
  text-shadow: none;
  font-weight: 600;
}

.checkin-chip,
.hero-chip {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: var(--border-width) solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  color: var(--fg);
  font: inherit;
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out);
}
.checkin-chip:hover,
.hero-chip:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}
.checkin-chip {
  height: 36px;
  padding: 0 12px 0 10px;
  gap: 8px;
}
.checkin-chip-text {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: var(--weight-medium);
  white-space: nowrap;
}
.checkin-chip-progress {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--fg-muted);
}
.checkin-chip.done .checkin-chip-progress {
  color: var(--accent);
}
.checkin-chip-sep {
  opacity: .45;
  margin: 0 1px;
}
#rpg-streak-count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}
.hero-chip {
  height: 36px;
  padding: 0 12px 0 4px;
  gap: 8px;
  max-width: min(200px, 40vw);
}
.hero-chip-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-control);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-chip-avatar .char-stage {
  --scale: 1;
  width: var(--f);
  height: var(--f);
  background-color: transparent;
}
.hero-chip-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  line-height: 1.15;
}
.hero-chip-name {
  font-size: 12px;
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hero-chip-sep,
#hud-level {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-muted);
  flex-shrink: 0;
}
.hero-chip-sep { opacity: .5; }

.profile-hover {
  position: relative;
}
.profile-hover-pop {
  position: absolute;
  top: calc(100% - 8px);
  right: 0;
  z-index: 60;
  padding-top: 12px;
}
.profile-hover-pop[hidden] { display: none; }
.profile-hover-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 260px;
  max-width: min(340px, calc(100vw - 24px));
  padding: 10px 12px 12px;
  background: var(--surface-raised);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-popover);
  cursor: pointer;
}
.profile-hover-card .char-stage,
.profile-hover-card .hud-avatar {
  --scale: 1;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: var(--radius-control);
  overflow: hidden;
  background: var(--accent-soft);
}
.profile-hover-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.profile-hover-copy strong {
  font-size: 13px;
  font-weight: var(--weight-medium);
  color: var(--fg);
  line-height: 1.2;
}
#profile-hover-meta {
  font-size: 11px;
  color: var(--fg-muted);
  line-height: 1.25;
}
.profile-hover-copy .xp-bar {
  margin-top: 4px;
}
.profile-hover-xp-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-subtle);
}

.pixel-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  image-rendering: pixelated;
  object-fit: contain;
}
.checkin-streak-icon {
  width: 14px;
  height: 14px;
}

.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;
}
.char-sprite-hold {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  pointer-events: none;
}
.modal.profile-modal {
  width: min(1080px, 100%, calc(90vh * 2.55));
  max-width: min(1080px, 100%, calc(90vh * 2.55));
  aspect-ratio: auto;
  height: auto;
  min-height: min(420px, 90vh);
  max-height: 90vh;
  position: relative;
  padding: 0;
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  align-items: stretch;
  overflow: hidden;
  animation: profile-rise var(--duration-base) var(--ease-out);
}
@keyframes profile-rise {
  from { opacity: 0; }
  to { opacity: 1; }
}
.profile-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
}
.profile-sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  text-align: center;
  padding: 28px 36px 20px 18px;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--fg) 35%, var(--surface)) transparent;
}
.profile-sheet::-webkit-scrollbar {
  width: 10px;
}
.profile-sheet::-webkit-scrollbar-track {
  background: transparent;
  margin: 8px 0;
}
.profile-sheet::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--fg) 28%, var(--surface));
  border: 2px solid var(--surface-raised);
  border-radius: 99px;
}
.profile-sheet::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--fg) 42%, var(--surface));
}
.profile-sheet:has(.profile-details:not(.hidden)),
.profile-sheet:has(.profile-badges-section:not(.hidden)) {
  justify-content: flex-start;
}
.char-sprite {
  --sheet-w: 168;
  --sheet-h: 48;
  --frame: 24;
  --scale: 1;
  --f: calc(var(--frame) * var(--scale) * 1px);
  display: block;
  width: var(--f);
  height: var(--f);
  background-repeat: no-repeat;
  background-position: calc(var(--f) * var(--char-fx, 0) * -1) calc(var(--f) * var(--char-fy, 1) * -1);
  background-size: calc(var(--sheet-w) * var(--scale) * 1px) calc(var(--sheet-h) * var(--scale) * 1px);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.char-stage {
  --sheet-w: 168;
  --sheet-h: 48;
  --frame: 24;
  --scale: 1;
  --f: calc(var(--frame) * var(--scale) * 1px);
  position: relative;
  display: block;
  width: var(--f);
  height: var(--f);
  overflow: hidden;
}
.char-stage > .char-sprite {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
}
.char-stage > .char-sprite.is-on {
  opacity: 1;
}
.char-stage > .char-dust {
  --dust: var(--f);
  position: absolute;
  z-index: 0;
  bottom: calc(var(--f) * -0.04);
  left: calc(var(--f) * -0.3);
  width: var(--dust);
  height: var(--dust);
  background-image: url("city/walk-dust.png");
  background-repeat: no-repeat;
  background-size: calc(var(--dust) * 8) var(--dust);
  background-position-x: calc(var(--dust) * var(--dust-fx, 0) * -1);
  image-rendering: pixelated;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--ease-out);
}
.city-scene.is-walking .char-stage > .char-dust { opacity: .85; }
.city-scene > .char-stage { overflow: visible; }
.city-scene:has(> .char-stage) > .city-dust { display: none; }
.profile-portrait {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 12px;
  box-sizing: border-box;
}
.profile-modal .city-scene--walk {
  width: 100%;
  height: 100%;
  max-width: 420px;
  aspect-ratio: auto;
}
.profile-avatar {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  cursor: pointer;
  flex: 0 0 auto;
  display: block;
}
.profile-avatar:hover,
.profile-avatar:focus,
.profile-avatar:active {
  background: transparent;
  box-shadow: none;
  opacity: 1;
}
.profile-avatar:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 0;
}
.profile-avatar .char-stage {
  transform: translateZ(0);
  background-color: transparent;
}

/* Walking city */
.city-scene {
  --city-x: 0px;
  --pace: 1;
  --char-scale: 3;
  --scene-h: 188px;
  --ground-h: 38px;
  --ground: 1;
  --city: .45;
  --sky: .56;
  --lamp: .92;
  --foot: 6px;
  position: relative;
  width: 100%;
  height: var(--scene-h);
  overflow: hidden;
  border-radius: var(--radius-panel);
  border: var(--border-width) solid var(--border);
  background: linear-gradient(#d8eeff 0%, #eef7ff 56%, #fdf6e7 100%);
  isolation: isolate;
}
.city-scene.is-night {
  background:
    radial-gradient(1px 1px at 18% 22%, rgba(255, 255, 255, .55) 0 1px, transparent 1.5px),
    radial-gradient(1px 1px at 62% 14%, rgba(255, 255, 255, .4) 0 1px, transparent 1.5px),
    radial-gradient(1px 1px at 84% 28%, rgba(255, 255, 255, .5) 0 1px, transparent 1.5px),
    linear-gradient(#050816 0%, #10183f 58%, #24305f 100%);
}
.city-moon {
  position: absolute;
  z-index: 1;
  top: 7%;
  left: 34%;
  width: 20cqmin;
  height: 20cqmin;
  transform: translate(-50%, 0);
  background: url("city/night/moon.webp") center / contain no-repeat;
  image-rendering: pixelated;
  mix-blend-mode: screen;
  pointer-events: none;
  opacity: 0;
}
.city-scene.is-night .city-moon { opacity: .95; }
.city-scene.is-night .city-lamps { z-index: 2; }
.city-layer {
  position: absolute;
  left: 0;
  right: 0;
  background-repeat: repeat-x;
  pointer-events: none;
}
.city-clouds,
.city-far,
.city-mid,
.city-near,
.city-front {
  bottom: calc(var(--ground-h) - 7px);
  height: calc(324px * var(--city));
  background-size: calc(576px * var(--city)) 100%;
}
.city-clouds {
  height: calc(324px * var(--sky));
  background-size: calc(1152px * var(--sky)) 100%;
  background-position-x: calc(var(--city-x) * var(--pace) * -.05);
  background-image: url("city/day/clouds.png");
}
.city-far {
  background-position-x: calc(var(--city-x) * var(--pace) * -.12);
  background-image: url("city/day/far.png");
}
.city-mid {
  background-position-x: calc(var(--city-x) * var(--pace) * -.24);
  background-image: url("city/day/mid.png");
}
.city-near {
  background-position-x: calc(var(--city-x) * var(--pace) * -.42);
  background-image: url("city/day/near.png");
}
.city-front {
  background-position-x: calc(var(--city-x) * var(--pace) * -.66);
  background-image: url("city/day/front.png");
}
.city-lamps {
  bottom: calc(var(--ground-h) - 5px);
  height: calc(165px * var(--lamp));
  background-size: calc(400px * var(--lamp)) 100%;
  background-position-x: calc(var(--city-x) * var(--pace) * -1);
  background-image: url("city/day/lamp.png");
}
.city-ground {
  top: calc(var(--scene-h) - var(--ground-h));
  height: calc(67px * var(--ground));
  background-size: calc(100px * var(--ground)) 100%;
  background-position-x: calc(var(--city-x) * var(--pace) * -1);
  background-image: url("city/day/ground.png");
}
.city-scene.is-night .city-clouds { background-image: url("city/night/clouds.png"); }
.city-scene.is-night .city-far { background-image: url("city/night/far.png"); }
.city-scene.is-night .city-mid { background-image: url("city/night/mid.png"); }
.city-scene.is-night .city-near { background-image: url("city/night/near.png"); }
.city-scene.is-night .city-front { background-image: url("city/night/front.png"); }
.city-scene.is-night .city-lamps { background-image: url("city/night/lamp.png"); }
.city-scene.is-night .city-ground { background-image: url("city/night/ground.png"); }
.city-scene > .profile-avatar,
.city-scene > .char-stage {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: calc(var(--ground-h) - var(--foot));
  margin-left: calc(-12px * var(--char-scale));
}
.city-scene > .profile-avatar {
  width: calc(24px * var(--char-scale));
  height: calc(24px * var(--char-scale));
}
.city-dust {
  --dust: calc(24px * var(--char-scale));
  position: absolute;
  z-index: 1;
  bottom: calc(var(--ground-h) - var(--foot) - 4px);
  left: calc(50% - var(--dust) * 1.02);
  width: var(--dust);
  height: var(--dust);
  background-image: url("city/walk-dust.png");
  background-repeat: no-repeat;
  background-size: calc(var(--dust) * 8) var(--dust);
  background-position-x: calc(var(--dust) * var(--dust-fx, 0) * -1);
  image-rendering: pixelated;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--ease-out);
}
.city-scene.is-walking .city-dust { opacity: .85; }
.city-scene--hero {
  --char-scale: 2;
  --scene-h: 116px;
  --ground-h: 28px;
  --ground: .75;
  --city: .34;
  --sky: .42;
  --lamp: .62;
  --foot: 5px;
  --pace: .74;
  border: 0;
  border-radius: 0;
}
.city-scene--square {
  --scene-h: 168px;
  --ground-h: 24px;
  --ground: .68;
  --city: .3;
  --sky: .38;
  --lamp: .56;
  --char-scale: 1.85;
  --foot: 4px;
  --pace: .68;
  width: 168px;
  height: 168px;
}
.city-scene--summary {
  --scene-h: 100%;
  --ground-h: clamp(34px, 10%, 48px);
  --ground: .88;
  --city: .62;
  --sky: .72;
  --lamp: .92;
  --char-scale: clamp(3.4, 10vw, 4.8);
  --foot: clamp(7px, 2%, 11px);
  --pace: .72;
  width: 100%;
  height: 100%;
  min-height: 100%;
}
.city-scene--preview {
  --char-scale: 5;
  --scene-h: 100%;
  --ground-h: 52px;
  --ground: .95;
  --city: .56;
  --sky: .66;
  --lamp: .88;
  --foot: 8px;
  --pace: .74;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
}
.city-scene--walk {
  container-type: size;
  --walk-char: 0.24;
  --scene-h: 100%;
  --char-scale: calc(100cqh * var(--walk-char) / 24px);
  --ground-h: 18cqh;
  --foot: 2.8cqh;
  --world: calc(100cqh / 320px);
  --city: calc(var(--world) * 0.72);
  --sky: calc(var(--world) * 0.92);
  --lamp: calc(var(--world) * 0.84);
  --ground: 1;
  --pace: .74;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
}
.city-scene--walk .city-ground {
  top: auto;
  bottom: 0;
  height: var(--ground-h);
  background-size: calc(100px * (var(--ground-h) / 67px)) 100%;
}
.city-scene--walk > .char-stage,
.city-scene--walk > .profile-avatar {
  --f: calc(100cqh * var(--walk-char));
  width: var(--f);
  height: var(--f);
  margin-left: calc(var(--f) * -0.5);
}
.city-scene--walk > .profile-avatar .char-stage {
  width: 100%;
  height: 100%;
}
.city-scene--walk .char-sprite {
  width: 100%;
  height: 100%;
  background-size: 700% 200%;
  background-position: calc(var(--char-fx, 0) * 100% / 6) calc(var(--char-fy, 1) * 100%);
}
.city-scene--walk .city-dust {
  --dust: calc(100cqh * var(--walk-char));
}
.char-picker {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  justify-content: stretch;
  justify-items: stretch;
  gap: 6px;
  max-height: min(272px, 42vh);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px;
}
.char-option {
  appearance: none;
  -webkit-appearance: none;
  width: auto;
  height: auto;
  aspect-ratio: 1;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: var(--border-width) solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.char-option .char-sprite {
  flex-shrink: 0;
  transform: none;
  background-color: transparent;
}
.char-pick-frame {
  display: block;
  flex: 0 0 auto;
  width: 60px;
  height: 60px;
  overflow: hidden;
}
.char-pick-img {
  display: block;
  width: 420px;
  height: 120px;
  max-width: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
}
.char-option:hover,
.char-option.previewing { border-color: var(--accent); background: var(--accent-soft); }
.char-option.equipped {
  border-color: var(--support);
  box-shadow: inset 0 0 0 3px var(--support);
}
.char-option.equipped:not(.previewing) {
  border-color: var(--support);
  background: var(--support-soft);
  box-shadow: inset 0 0 0 3px var(--support);
}
.char-option.locked .char-pick-img,
.char-option.locked .char-sprite { opacity: 0.42; filter: grayscale(0.35); }
.char-option.locked.previewing .char-pick-img,
.char-option.locked.previewing .char-sprite { opacity: 1; filter: none; }
.char-option.locked.can-unlock { border-color: var(--support); }
.char-option.locked.can-unlock:hover,
.char-option.locked.previewing { background: var(--support-soft); }
.char-unlock-row {
  display: flex;
  justify-content: center;
  padding: 8px 4px 2px;
}
.char-unlock-row.hidden { display: none !important; }
.char-unlock-row .btn { width: 100%; }
.char-lock-cost {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 4px;
  border-radius: var(--radius-tag);
  background: var(--surface-raised);
  border: var(--border-width) solid var(--border-subtle);
  color: var(--fg);
  white-space: nowrap;
}
.char-option { position: relative; }
.char-option.char-shake { animation: char-shake .42s ease; }
@keyframes char-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

/* Character page */
#character-page.overlay {
  overflow: auto;
  overscroll-behavior: contain;
  align-items: flex-start;
  justify-content: center;
}
.modal.character-modal {
  width: min(1080px, calc(100vw - 28px));
  max-width: min(1080px, calc(100vw - 28px));
  max-height: min(86dvh, 720px);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-block: auto;
  position: relative;
}
.character-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 0 18px;
  text-align: left;
  flex-shrink: 0;
}
.character-head-copy {
  min-width: 0;
  flex: 1 1 auto;
}
.character-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: var(--weight-heading);
  line-height: 1.15;
}
.character-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--fg-muted);
}
.character-head-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.character-gold {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px 0 8px;
  border: var(--border-width) solid var(--border);
  border-radius: 99px;
  background: var(--surface-raised);
  color: var(--fg);
}
.character-gold-icon {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.character-gold strong {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
[data-theme="stormlikes"] .character-gold {
  border-color: var(--fg);
  background: var(--support);
  box-shadow: 2px 2px 0 0 var(--fg);
}
.character-close {
  flex-shrink: 0;
}
.character-body {
  display: grid;
  grid-template-columns: minmax(280px, 368px) minmax(0, 1fr);
  gap: 16px;
  padding: 12px 18px 16px;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
  align-items: stretch;
}
.character-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}
.character-preview .city-scene--walk {
  width: 100%;
  max-width: 368px;
}
.character-preview-identity {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 4px 4px;
}
.character-preview-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: var(--weight-heading);
  text-align: center;
}
.character-preview-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  font-weight: var(--weight-medium);
  color: var(--fg-muted);
  text-align: center;
}
.character-preview-xp {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.character-preview-xp .xp-bar {
  width: min(100%, 280px);
}
.character-preview-xp .xp-bar-hero {
  width: min(100%, 280px);
  height: 12px;
}
.character-preview-xp-label {
  margin: 0;
  font-size: 11px;
  color: var(--fg-subtle);
  text-align: center;
  line-height: 1.35;
}
.character-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 0;
  min-height: 100%;
  overflow: hidden;
}
.character-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
  flex-shrink: 0;
}
.character-tab {
  appearance: none;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--fg-muted);
  font: inherit;
  font-size: 13px;
  font-weight: var(--weight-medium);
  padding: 9px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
}
.character-tab.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.character-tab:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.character-soon {
  font-size: 9px;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 99px;
  background: var(--surface-hover);
  color: var(--fg-subtle);
}
.character-panel {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
#character-panel-skins {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.character-panel .char-picker {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  align-items: start;
  justify-items: stretch;
  gap: 8px;
  flex: 1 1 0;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 4px 10px 18px 2px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}
.character-panel .char-option {
  position: relative;
  display: block;
  align-self: start;
  width: 100%;
  height: auto;
  max-height: none;
  min-width: 0;
  min-height: unset;
  aspect-ratio: 1 / 1;
  padding: 0;
  overflow: hidden;
  border-color: var(--border);
  background: var(--surface);
}
.character-panel .char-option.locked {
  border-color: color-mix(in srgb, var(--border) 42%, transparent);
}
.character-panel .char-option .char-pick-frame {
  position: absolute;
  inset: 8px;
  display: block;
  width: auto;
  height: auto;
  overflow: hidden;
}
.character-panel .char-pick-img {
  width: 700%;
  height: 200%;
}
.character-panel .char-pick-name,
.character-panel .char-pick-cost {
  display: none;
}
.char-pick-name {
  display: block;
  max-width: 100%;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.char-pick-cost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--fg-muted);
  line-height: 1;
}
.char-pick-cost img {
  width: 12px;
  height: 12px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.char-pick-equipped {
  color: var(--fg);
  font-family: inherit;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.character-panel .char-option:hover,
.character-panel .char-option.previewing {
  background: color-mix(in srgb, var(--support) 35%, var(--surface));
  border-color: var(--fg);
}
.character-panel .char-option.equipped {
  border-color: var(--support);
  box-shadow: inset 0 0 0 3px var(--support);
}
.character-panel .char-option.equipped:not(.previewing) {
  border-color: var(--support);
  box-shadow: inset 0 0 0 3px var(--support);
  background: color-mix(in srgb, var(--support) 28%, var(--surface));
}
.character-skin-detail {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  margin-top: 4px;
  padding: 10px 12px;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-panel);
  background: var(--surface-raised);
}
.character-skin-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-control);
  background: var(--surface);
  border: var(--border-width) solid var(--border-subtle);
}
.character-skin-thumb .char-pick-img {
  width: 700%;
  height: 200%;
}
.character-skin-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.character-skin-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.character-skin-title strong {
  font-size: 15px;
  font-weight: var(--weight-heading);
  line-height: 1.2;
}
.character-skin-rarity {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--surface-hover);
  color: var(--fg-muted);
  border: var(--border-width) solid var(--border-subtle);
}
.character-skin-brief {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--fg-muted);
  height: calc(1.4em * 2);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.character-skin-detail .btn {
  min-width: 108px;
  justify-self: end;
}
.character-skin-detail .btn.is-equipped,
.character-skin-detail .btn.is-equipped:disabled {
  opacity: 1;
  background: var(--support);
  color: var(--fg);
  border-color: var(--fg);
}
[data-theme="stormlikes"] .character-skin-detail .btn.is-equipped,
[data-theme="stormlikes"] .character-skin-detail .btn.is-equipped:disabled {
  box-shadow: 2px 2px 0 0 var(--fg);
}
.character-panel.hidden { display: none !important; }
.character-coming {
  margin: 12px 0 0;
  padding: 16px;
  border: var(--border-width) dashed var(--border);
  border-radius: var(--radius-panel);
  font-size: 13px;
  color: var(--fg-muted);
  text-align: center;
  background: var(--surface-raised);
}
.profile-stat-with-tip {
  position: relative;
  display: flex;
  align-items: stretch;
}
.profile-stat-with-tip .profile-stat-btn { flex: 1; min-width: 0; }
.profile-stat-tip {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  padding: 0;
}

.profile-name-wrap { width: 100%; }
.profile-name {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: var(--weight-heading);
  letter-spacing: -0.02em;
  padding: 4px 8px;
  border-radius: var(--radius-control);
}
.profile-name:hover { border-color: var(--border); }
.profile-name:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--canvas);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.profile-level-block {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.profile-level-line {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: var(--weight-medium);
  color: var(--fg-muted);
}
.level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 3px 10px;
  border-radius: 99px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--accent);
  background: var(--accent-soft);
  border: var(--border-width) solid color-mix(in srgb, var(--accent) 25%, var(--border));
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 35%, transparent);
}
.xp-bar {
  width: min(280px, 100%);
  height: 8px;
  border-radius: 99px;
  overflow: hidden;
  background: var(--surface-hover);
  border: var(--border-width) solid var(--border-subtle);
}
.xp-bar-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--support));
  transition: width .35s var(--ease-out);
}
.xp-bar-hero {
  width: 100%;
  height: 12px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--surface-hover) 85%, var(--border));
  border: var(--border-width) solid var(--border);
  box-shadow: inset 0 1px 3px color-mix(in srgb, var(--fg) 8%, transparent);
}
.xp-bar-hero .xp-bar-fill {
  position: relative;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--accent) 92%, #fff 8%) 0%,
    var(--accent) 35%,
    color-mix(in srgb, var(--support) 70%, var(--accent) 30%) 100%
  );
  box-shadow:
    0 0 10px color-mix(in srgb, var(--accent) 35%, transparent),
    inset 0 1px 0 color-mix(in srgb, #fff 35%, transparent);
}
.xp-bar-hero .xp-bar-fill::after {
  content: "";
  position: absolute;
  inset: 1px 2px auto 2px;
  height: 40%;
  border-radius: inherit;
  background: linear-gradient(180deg, color-mix(in srgb, #fff 45%, transparent), transparent);
  pointer-events: none;
}
.profile-xp-label {
  font-size: 11px;
  color: var(--fg-subtle);
  letter-spacing: .02em;
}
.checkin-card,
.daily-quest {
  width: 100%;
  margin-top: 4px;
  padding: 14px 14px 12px;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-panel);
  background: var(--surface-raised);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.checkin-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.checkin-card-lead {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.checkin-card-icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.checkin-card-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.checkin-card-title {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: var(--weight-heading);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--fg);
  line-height: 1.2;
}
.checkin-card-sub {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  color: var(--fg-muted);
}
.checkin-card-status {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
  padding: 5px 10px;
  border-radius: 99px;
  border: var(--border-width) solid var(--border);
  background: var(--surface);
  color: var(--fg);
  white-space: nowrap;
}
.checkin-card-status.is-done,
.checkin-card.done .checkin-card-status {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  background: var(--accent-soft);
  color: var(--accent);
}
.checkin-card-track {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
.profile-sheet .checkin-card {
  padding: 12px 10px 10px;
  gap: 10px;
}
.profile-sheet .checkin-card-head {
  flex-wrap: wrap;
  align-items: flex-start;
}
.profile-sheet .checkin-card-status {
  margin-left: auto;
}
.info-tip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--fg-subtle);
  cursor: pointer;
}
.info-tip-btn svg {
  width: 14px;
  height: 14px;
}
.info-tip-btn:hover,
.info-tip-btn:focus-visible,
.info-tip-btn[aria-describedby="active-info-tip"] {
  color: var(--accent);
  background: var(--accent-soft);
}
.info-tip-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.profile-stat-label {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 9px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}
.info-tip-panel {
  position: fixed;
  z-index: 130;
  width: min(280px, calc(100vw - 24px));
  padding: 10px 12px;
  background: var(--surface-raised);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-popover);
  text-align: left;
}
.info-tip-panel::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  height: 14px;
}
.info-tip-panel.is-above::before {
  top: auto;
  bottom: -12px;
}
.info-tip-title {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: var(--weight-medium);
  color: var(--fg);
}
.info-tip-body {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--fg-muted);
}
.info-tip-panel.is-rich {
  width: min(320px, calc(100vw - 24px));
}
.info-tip-rich {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.info-tip-lead,
.info-tip-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--fg-muted);
}
.info-tip-note { font-size: 11px; }
.info-tip-block { min-width: 0; }
.info-tip-kicker {
  margin: 0 0 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}
.info-tip-rows {
  display: grid;
  gap: 3px;
}
.info-tip-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--fg);
}
.info-tip-row strong {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}
.checkin-week {
  display: flex;
  align-items: stretch;
  width: 100%;
  gap: 6px;
  margin: 0;
}
.checkin-week-track {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.checkin-day {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.checkin-sparkle {
  position: absolute;
  left: -2px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  z-index: 2;
  pointer-events: none;
}
.checkin-sparkle i {
  display: block;
  width: 9px;
  height: 2px;
  border-radius: 99px;
  background: var(--support);
  transform: rotate(-28deg);
}
.checkin-sparkle i:nth-child(2) { width: 7px; opacity: .85; }
.checkin-sparkle i:nth-child(3) { width: 5px; opacity: .7; }
.checkin-day-card {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 74px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 3px 5px;
  border: var(--border-width) solid var(--border);
  border-radius: 12px;
  background: var(--surface-raised);
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--fg);
  transition: border-color var(--duration-fast) var(--ease-out), background var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast);
}
.checkin-coin {
  width: 16px;
  height: 16px;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
}
.checkin-day-gold {
  line-height: 1;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.checkin-day-plus {
  font-size: 9px;
  line-height: 1;
  margin-right: -1px;
  color: var(--accent);
}
.checkin-tick {
  width: 16px;
  height: 16px;
  color: var(--fg);
}
.checkin-day-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--fg-subtle);
  white-space: nowrap;
  margin-top: 1px;
}
.checkin-day.hit .checkin-day-card {
  background: var(--support);
  border-color: var(--fg);
  color: var(--support-fg);
  box-shadow: none;
}
.checkin-day.hit .checkin-tick {
  width: 18px;
  height: 18px;
  color: var(--fg);
}
.checkin-day.hit .checkin-day-label {
  color: var(--fg);
}
.checkin-day.current .checkin-day-card {
  background: var(--surface-raised);
  border-color: var(--fg);
  box-shadow:
    inset 0 0 0 3px var(--support),
    2px 2px 0 0 color-mix(in srgb, var(--fg) 85%, transparent);
}
.checkin-day.hit.current .checkin-day-card {
  background: var(--support);
  border-color: var(--fg);
  box-shadow: none;
  color: var(--support-fg);
}
.checkin-day.grand:not(.hit) .checkin-day-gold {
  color: var(--fg);
}
.checkin-day.grand .checkin-day-gold {
  font-size: 12px;
}
.profile-stats {
  list-style: none;
  margin: 12px 0 4px;
  padding: 10px 0;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  border-top: var(--border-width) solid var(--border);
  border-bottom: var(--border-width) solid var(--border);
}
.profile-stats li,
.profile-stat-static {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 6px;
}
.profile-stats li + li { border-left: var(--border-width) solid var(--border-subtle); }
.stat-pixel-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  image-rendering: pixelated;
  color: var(--fg-muted);
}
.profile-stats strong {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.profile-stats span {
  font-size: 9px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}
.profile-stat-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  border-radius: var(--radius-control);
  color: inherit;
}
.profile-stat-btn:hover strong,
.profile-stat-btn.active strong { color: var(--accent); }
.profile-stat-btn.active .stat-pixel-icon { opacity: 1; }
.profile-details {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
}
.profile-details h3 {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  margin-bottom: 6px;
}
.profile-details p { font-size: 13px; color: var(--fg); }
.profile-detail-note { color: var(--fg-muted) !important; margin-top: 4px; }
.profile-rank-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.profile-rank-list li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.profile-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}
.profile-section h3 {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}
.profile-badges-section { align-items: stretch; text-align: left; width: 100%; }
#profile-badges { width: 100%; }
.ach-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.ach-group:last-child { margin-bottom: 0; }
.ach-group-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ach-group-h h4 {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  font-weight: 600;
}
.ach-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 18px;
  padding: 0 6px;
  border-radius: 99px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--fg-muted);
  background: var(--surface-hover);
  border: var(--border-width) solid var(--border-subtle);
}
.ach-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ach-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface);
  border: var(--border-width) solid var(--border-subtle);
  text-align: left;
}
.ach-card.unlocked {
  background: var(--surface-raised);
  border-color: var(--border);
}
.ach-card.locked { opacity: 0.72; }
.ach-card.locked .ach-medal { filter: grayscale(1) contrast(.9) brightness(.9); }
.ach-card strong {
  display: block;
  font-size: 13px;
  font-weight: 650;
  color: var(--fg);
  line-height: 1.25;
}
.ach-card span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--fg-muted);
  line-height: 1.35;
}
.ach-medal {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  flex-shrink: 0;
}
.ach-toast {
  position: fixed;
  right: 18px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  padding: 10px 12px;
  background: var(--surface-raised);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-popover);
  color: var(--fg);
  opacity: 0;
  transform: translateX(16px);
  transition: opacity .25s var(--ease-out), transform .25s var(--ease-out);
}
.ach-toast.play { opacity: 1; transform: none; }
.ach-toast img {
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.ach-toast strong {
  display: block;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--support);
}
.ach-toast span { font-size: 13px; font-weight: 650; }
.rpg-badges {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.rpg-badge {
  padding: 8px 4px;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-control);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 0;
}
.rpg-badge strong {
  font-size: 10px;
  line-height: 1.25;
  font-weight: 600;
}
.rpg-badge img {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.rpg-badge.locked {
  background: var(--surface);
  opacity: 0.72;
}
.rpg-badge.unlocked {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.rpg-badge.locked img { filter: grayscale(1) contrast(.85); }
.archive-wrap { display: flex; flex-direction: column; gap: 20px; padding: 8px 16px 24px; }
.archive-section h3 {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  margin-bottom: 8px;
}
.archive-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.archive-open {
  border: none;
  background: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
  min-width: 0;
  flex: 1;
  color: inherit;
  font: inherit;
}
.archive-open:hover .card-title { color: var(--accent); }
.card-desc {
  margin-top: 6px;
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-desc.md strong { font-weight: 700; color: var(--fg); }
.card-desc.md em { font-style: italic; }
.card-desc.md s { text-decoration: line-through; }
.card-desc.md code {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--surface-hover);
  padding: 0 3px;
  border-radius: 2px;
}
.card-desc.md a { color: #2563eb; text-decoration: underline; }
.card-due {
  display: inline-flex;
  margin-top: 8px;
  font-size: 11px;
  font-weight: var(--weight-medium);
  color: var(--fg-muted);
  background: var(--surface-hover);
  padding: 1px 6px;
  border-radius: var(--radius-tag);
}
.card.due-today { border-color: var(--accent); }
.card.due-overdue { border-color: var(--danger); }
.card-due.due-today {
  color: var(--accent);
  background: var(--accent-soft);
}
.card-due.due-overdue {
  color: var(--danger);
  background: var(--danger-soft);
}

.card.is-subtask { padding-top: 8px; }
.card-parent-link {
  display: block;
  margin: 0 0 6px;
  padding: 0;
  border: none;
  background: none;
  color: var(--fg-subtle);
  font-size: 11px;
  font-weight: var(--weight-medium);
  cursor: pointer;
  text-align: left;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-parent-link:hover { color: var(--accent); }
.card-subtasks {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.subtask-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-subtasks .subtask-progress { margin: 0; flex: 1; }
.card-subtasks .subtask-count {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--fg-subtle);
  flex: 0 0 auto;
}
.card-mini-task {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 1px 2px;
  font-size: 14px;
  color: var(--fg-muted);
  cursor: pointer;
  border-radius: var(--radius-control);
}
.card-mini-task:hover { color: var(--fg); background: var(--surface-hover); }
.card-mini-task.is-done .mini-title { text-decoration: line-through; color: var(--fg-subtle); }
.card-mini-task input { margin: 0; accent-color: var(--accent); flex: 0 0 auto; }
.card-mini-task .mini-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.card-subtask-more {
  font-size: 11px;
  color: var(--fg-subtle);
  padding-left: 22px;
}

.card-crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: var(--weight-medium);
  color: var(--fg-subtle);
}
.card-crumb.hidden { display: none; }
.crumb-link {
  border: none;
  background: none;
  padding: 0;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  max-width: 28ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crumb-link:hover { text-decoration: underline; }

.subtask-panel {
  margin-top: 18px;
  padding-top: 22px;
  padding-bottom: 18px;
  border-top: var(--border-width) solid var(--border-subtle);
}
.subtask-panel.hidden { display: none; }
.subtask-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
  font-size: var(--issue-body-size, 14px);
  font-weight: var(--weight-heading);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.subtask-count { color: var(--fg-subtle); font-variant-numeric: tabular-nums; }
.subtask-progress {
  height: 4px;
  border-radius: 99px;
  background: var(--surface-hover);
  overflow: hidden;
}
.subtask-progress i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}
.subtask-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.subtask-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: var(--radius-control);
}
.subtask-row:hover { background: var(--surface-hover); }
.subtask-row.is-done .subtask-open {
  text-decoration: line-through;
  color: var(--fg-subtle);
}
.subtask-row input { margin: 0; accent-color: var(--accent); }
.subtask-open {
  border: none;
  background: none;
  padding: 0;
  text-align: left;
  color: var(--fg);
  font: inherit;
  font-size: var(--issue-body-size, 14px);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.subtask-open:hover { color: var(--accent); }
.subtask-row .badge { font-size: 11px; }
.subtask-add {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.subtask-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}
.subtask-input-wrap .field {
  width: 100%;
  height: 34px;
  padding-right: 36px;
}
.subtask-add-btn {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  min-width: 26px;
  aspect-ratio: 1;
  padding: 0;
  border: var(--border-width) solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--fg-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.subtask-add-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.subtask-add-btn svg {
  width: 14px;
  height: 14px;
}
.subtask-add-btn.hidden { display: none; }
.subtask-add .field { flex: 1; min-width: 0; }
#subtask-details {
  height: 34px;
  flex-shrink: 0;
}

/* Landing */
.landing-page {
  --land-ink: #111111;
  --land-paper: #ffffff;
  --land-sun: #ffd43b;
  --land-mute: #3d3d3d;
  --land-col: 1120px;
  --land-gutter: 20px;
  color: var(--land-ink);
  background: var(--land-paper);
  font-family: "Rubik", ui-sans-serif, system-ui, sans-serif;
  max-width: none;
  margin: 0;
  padding: 0 0 48px;
}
.landing-hero {
  position: relative;
  isolation: isolate;
  min-height: max(640px, 90dvh);
  overflow: hidden;
  background: transparent;
}
.landing-hero-walk {
  position: absolute;
  inset: 0;
}
.landing-hero-city {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.landing-hero-city .city-scene--landing {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  --walk-char: 0.13;
  --ground-h: 10cqh;
  --ground: 0.85;
  --world: 1;
  --city: 1.88;
  --sky: 2.12;
  --lamp: 1.18;
}
.landing-hero-city .city-scene--landing > .char-stage,
.landing-hero-city .city-scene--landing > .profile-avatar {
  left: 74%;
  z-index: 4;
}
.landing-hero-city .city-scene--landing .city-clouds {
  z-index: 0;
  top: auto;
  left: 0;
  right: 0;
  bottom: calc(var(--ground-h) - 7px);
  height: calc(324px * var(--sky));
  background-image: url("city/night/clouds.png");
  background-size: calc(1152px * var(--sky)) 100%;
  background-position: calc(var(--city-x) * var(--pace) * -.05) 0;
  background-repeat: repeat-x;
  image-rendering: pixelated;
}
.landing-hero-city .city-scene--landing .city-moon {
  z-index: 1;
  left: 76%;
  top: 10%;
  width: 17cqh;
  height: 17cqh;
}
.landing-hero-city .city-scene--landing .city-far,
.landing-hero-city .city-scene--landing .city-mid,
.landing-hero-city .city-scene--landing .city-near,
.landing-hero-city .city-scene--landing .city-front {
  z-index: 2;
}
.landing-hero-city .city-scene--landing .city-lamps {
  z-index: 3;
}
.landing-hero-sheet {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  bottom: 0;
  width: clamp(248px, 31vw, 420px);
  container-type: inline-size;
  pointer-events: none;
  overflow: visible;
}
.landing-hero-paper-fill {
  position: absolute;
  z-index: 0;
  top: -160px;
  left: -50vw;
  bottom: -120px;
  right: 28%;
  width: auto;
  background: #fff;
  pointer-events: none;
}
.landing-hero-paper-clip {
  position: absolute;
  z-index: 1;
  top: -4%;
  right: -38%;
  bottom: -4%;
  left: -14%;
  overflow: hidden;
  pointer-events: none;
}
.landing-hero-paper {
  position: absolute;
  top: -4%;
  left: 0;
  height: 108%;
  width: auto;
  min-width: 132%;
  max-width: none;
  object-fit: cover;
  object-position: 24% center;
  pointer-events: none;
  user-select: none;
}
.landing-hero-paper-mask {
  position: absolute;
  z-index: 2;
  top: -160px;
  left: -50vw;
  bottom: -120px;
  width: calc(50vw + 104px);
  background: #fff;
  pointer-events: none;
}
.landing-hero-paper-cap {
  position: absolute;
  z-index: 2;
  top: -180px;
  left: -50vw;
  height: 210px;
  width: calc(50vw + 68%);
  background: #fff;
  pointer-events: none;
}
.landing-hero-copy {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: none;
  width: 100%;
  padding: 80px 16% 36px 24px;
  pointer-events: auto;
}
.landing-hero-copy h1 {
  margin: 0 0 14px;
  font-size: clamp(3.4rem, 22cqi, 7.2rem);
  font-weight: 800;
  letter-spacing: -0.062em;
  line-height: 0.84;
}
.landing-lead {
  margin: 0 0 22px;
  max-width: 32ch;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--land-mute);
}
.landing-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 0;
}
.landing-cta-main,
.landing-header-cta,
.landing-strip .btn {
  height: 48px;
  padding: 0 22px;
  font-weight: 800;
  border-radius: 10px;
}
.app[data-shell="landing"] .landing-cta-main {
  height: 48px;
  padding: 0 22px;
  font-size: 15px;
  font-weight: 800;
  background: var(--land-sun);
  color: var(--land-ink);
  border: 2.5px solid var(--land-ink);
  border-radius: 10px;
  box-shadow: 3px 3px 0 var(--land-ink);
}
.app[data-shell="landing"] .landing-cta-main:hover,
.app[data-shell="landing"] .landing-cta-main:focus-visible {
  background: #ffe066;
  color: var(--land-ink);
  border-color: var(--land-ink);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--land-ink);
}
.app[data-shell="landing"] .landing-cta-main:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--land-ink);
  filter: none;
}
.app[data-shell="landing"] .header-actions {
  flex-shrink: 0;
}
.app[data-shell="landing"] .landing-header-cta {
  display: inline-flex !important;
  height: 36px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 800;
  background: var(--land-ink);
  color: #fff;
  border: 2.5px solid var(--land-ink);
  border-radius: 10px;
  box-shadow: none;
  flex-shrink: 0;
}
.app[data-shell="landing"] .landing-header-cta:hover,
.app[data-shell="landing"] .landing-header-cta:focus-visible {
  background: #2a2a2a;
  color: #fff;
  border-color: #2a2a2a;
  transform: none;
  box-shadow: none;
}
.landing-how {
  padding: 48px var(--land-gutter) 28px;
  max-width: var(--land-col);
  margin: 0 auto;
}
.landing-how h2 {
  margin: 0 0 16px;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
}
.landing-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
}
.landing-steps li {
  padding: 16px;
  border: 2.5px solid var(--land-ink);
  border-radius: 18px;
  background: #fff;
  box-shadow: 5px 5px 0 0 var(--land-ink);
}
.landing-step-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-bottom: 10px;
  font-size: 18px;
  font-weight: 800;
  background: var(--land-sun);
  border: 2.5px solid var(--land-ink);
  border-radius: 10px;
}
.landing-steps h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 800;
}
.landing-steps p {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--land-mute);
}
.landing-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-sizing: border-box;
  width: calc(100% - (2 * var(--land-gutter)));
  max-width: calc(var(--land-col) - (2 * var(--land-gutter)));
  margin: 0 auto;
  padding: 18px 22px;
  background: var(--land-sun);
  border: 2.5px solid var(--land-ink);
  border-radius: 18px;
  box-shadow: 6px 6px 0 0 var(--land-ink);
}
.landing-strip p {
  margin: 0;
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.landing-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: var(--land-col);
  margin: 28px auto 0;
  padding: 0 var(--land-gutter);
  font-size: 13px;
  font-weight: 700;
  color: var(--land-mute);
}
.landing-foot-dot { opacity: .5; }

@media (max-height: 820px) {
  .landing-hero {
    min-height: max(600px, 88dvh);
  }
  .landing-hero-copy {
    padding-top: 64px;
    padding-bottom: 28px;
  }
  .landing-hero-copy h1 {
    font-size: clamp(3.1rem, 18cqi, 6.1rem);
  }
}

@media (max-width: 1200px) {
  .landing-hero-city .city-scene--landing > .char-stage,
  .landing-hero-city .city-scene--landing > .profile-avatar {
    left: 70%;
  }
  .landing-hero-city .city-scene--landing .city-moon {
    left: 66%;
    top: 14%;
    width: 15cqh;
    height: 15cqh;
  }
}

@media (max-width: 1050px) {
  .landing-hero {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: visible;
  }
  .landing-hero-walk {
    position: relative;
    order: 2;
    width: 100%;
    height: min(58dvh, 460px);
    flex-shrink: 0;
    overflow: hidden;
    z-index: 1;
  }
  .landing-hero-city .city-scene--landing {
    --walk-char: 0.24;
    --ground-h: 18cqh;
    --city: 1.28;
    --sky: 1.85;
    --lamp: 1;
  }
  .landing-hero-city .city-scene--landing > .char-stage,
  .landing-hero-city .city-scene--landing > .profile-avatar {
    left: 38%;
  }
  .landing-hero-city .city-scene--landing .city-moon {
    left: 72%;
    top: 10%;
    width: 18cqh;
    height: 18cqh;
  }
  .landing-hero-sheet {
    position: relative;
    order: 1;
    width: 100%;
    min-height: 0;
    overflow: visible;
    z-index: 3;
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
  }
  .landing-hero-paper-fill {
    top: -120px;
    left: -20px;
    right: -20px;
    bottom: 72px;
    width: auto;
  }
  .landing-hero-paper-mask {
    top: -120px;
    left: -20px;
    right: auto;
    bottom: 72px;
    width: 48px;
    height: auto;
  }
  .landing-hero-paper-cap {
    top: -120px;
    left: -20px;
    right: -20px;
    width: auto;
    height: auto;
    bottom: 72px;
  }
  .landing-hero-paper-clip {
    position: relative;
    inset: auto;
    width: 100%;
    height: 156px;
    margin: 0 0 -124px;
    overflow: hidden;
    z-index: 5;
    flex-shrink: 0;
  }
  .landing-hero-paper {
    top: 50%;
    left: 50%;
    bottom: auto;
    width: 220px;
    height: min(320vw, 1400px);
    transform: translate(-50%, -50%) rotate(90deg) scale(1.55);
    transform-origin: center center;
    object-fit: cover;
    object-position: 72% center;
  }
  .landing-hero-copy {
    max-width: none;
    padding: 58px 20px 4px;
  }
  .landing-lead {
    max-width: none;
    padding-right: 8px;
    margin-bottom: 14px;
    font-size: 15px;
  }
  .landing-hero-copy h1 {
    font-size: clamp(2.4rem, 11.5vw, 3.55rem);
    max-width: none;
    margin-bottom: 10px;
  }
  .landing-steps { grid-template-columns: 1fr; }
  .app[data-shell="landing"] .main { margin-top: -56px; }
}

/* Journey home */
.journey-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1120px;
}
.journey-xp {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.journey-xp-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.journey-xp-title {
  font-size: 11px;
  font-weight: var(--weight-medium);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}
.journey-xp-nums {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.walk-meter {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-panel);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--support) 28%, var(--surface-raised)), var(--surface-raised));
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 40%, transparent);
}
.summary-hero-copy > .walk-meter {
  margin-top: 14px;
}
.walk-meter.is-compact {
  padding: 8px 10px;
  gap: 10px;
}
.walk-meter-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--fg);
  background: color-mix(in srgb, var(--support) 55%, #fff);
  border: var(--border-width) solid color-mix(in srgb, var(--fg) 20%, var(--border));
}
.walk-meter.is-compact .walk-meter-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}
.walk-meter-icon img,
.walk-meter-icon-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  image-rendering: pixelated;
}
.walk-meter.is-compact .walk-meter-icon img,
.walk-meter.is-compact .walk-meter-icon-img {
  width: 16px;
  height: 16px;
}
.walk-meter-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.walk-meter-label-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.walk-meter-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}
.walk-meter-label-row .info-tip-btn {
  width: 16px;
  height: 16px;
}
.walk-meter-label-row .info-tip-btn svg {
  width: 13px;
  height: 13px;
}
.walk-meter-value {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: var(--weight-heading);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--fg);
}
.walk-meter.is-compact .walk-meter-value {
  font-size: 1.05rem;
}
.walk-meter-sub {
  font-size: 11px;
  color: var(--fg-muted);
}
[data-theme="stormlikes"] .walk-meter {
  border-color: var(--fg);
  box-shadow: 3px 3px 0 0 var(--fg);
  background: #fff;
}
[data-theme="stormlikes"] .walk-meter-icon {
  background: var(--support);
  border-color: var(--fg);
}
.journey-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 4px 0 0;
}
.journey-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-control);
  background: linear-gradient(180deg, var(--surface-raised), var(--surface));
  min-width: 0;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--surface-raised) 90%, #fff);
}
button.journey-stat {
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
button.journey-stat:hover,
button.journey-stat:focus-visible {
  border-color: var(--accent);
}
button.journey-stat:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.journey-stat-icon {
  width: 22px;
  height: 22px;
}
.journey-stat-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.journey-stat strong {
  font-size: 17px;
  font-weight: var(--weight-heading);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.journey-stat span {
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}
@media (max-width: 900px) {
  .journey-stats { grid-template-columns: 1fr 1fr; }
}
#journey-achievements.overlay {
  padding: 32px 40px;
}
.modal.journey-achievements-modal {
  max-width: min(840px, 94vw);
  width: min(840px, 94vw);
  max-height: min(88vh, 800px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  outline: none;
}
.modal.journey-achievements-modal .modal-h {
  padding: 20px 24px 10px;
}
.modal.journey-achievements-modal .modal-desc {
  max-width: none;
}
.modal-b.journey-achievements-body {
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 0;
  flex: 1;
  padding: 8px 24px 24px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}
.journey-achievements-body .ach-group {
  margin-bottom: 18px;
}
.journey-achievements-body .ach-group:last-child {
  margin-bottom: 0;
}
.journey-achievements-body .ach-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.journey-achievements-body .ach-card {
  padding: 12px 14px;
  gap: 14px;
}
@media (max-width: 700px) {
  #journey-achievements.overlay {
    padding: 8px;
  }
  .modal.journey-achievements-modal {
    max-width: 100%;
    width: 100%;
    max-height: min(92dvh, 100%);
  }
  .modal.journey-achievements-modal .modal-h {
    padding: 16px 16px 8px;
  }
  .modal-b.journey-achievements-body {
    padding: 6px 14px 16px;
  }
  .journey-achievements-body .ach-list {
    grid-template-columns: 1fr;
  }
}
.journey-checkin {
  margin-top: 12px;
  padding: 12px;
  border: var(--border-width) solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--surface-raised) 65%, var(--surface));
}
.journey-checkin-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}
.journey-checkin-h p {
  margin: 0;
  font-size: 11px;
  font-weight: var(--weight-medium);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.journey-checkin-status {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  border: var(--border-width) solid var(--border-subtle);
  background: var(--surface);
  color: var(--fg-muted);
}
.journey-checkin-status.is-done {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  background: var(--accent-soft);
  color: var(--accent);
}
.journey-boards-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.journey-boards-h h3 {
  margin: 0;
  font-size: 15px;
}
.journey-board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.journey-board-card {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 14px;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-panel);
  background: var(--surface);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.journey-board-card:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: var(--surface-raised);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--fg) 6%, transparent);
}
.journey-new-board-btn svg { width: 14px; height: 14px; }
.journey-board-card strong {
  font-size: 14px;
  font-weight: var(--weight-heading);
}
.journey-board-card span {
  font-size: 12px;
  color: var(--fg-subtle);
}

/* Summary */
.summary-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 1120px;
}
.summary-hero {
  padding: 14px 16px;
  background: linear-gradient(165deg, var(--surface-raised), var(--surface));
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-panel);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--surface-raised) 80%, #fff);
}
.summary-hero-main {
  display: grid;
  grid-template-columns: clamp(260px, 42%, 380px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.summary-hero-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.summary-portrait {
  padding: 0;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  overflow: hidden;
  cursor: pointer;
  display: block;
  line-height: 0;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: none;
}
.summary-portrait:hover { border-color: var(--accent); }
.summary-portrait .city-scene {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  border: 0;
  border-radius: 0;
  aspect-ratio: auto;
}
.summary-portrait .char-sprite {
  display: block;
  margin: 0;
  background-color: transparent;
}
.summary-hero-copy { min-width: 0; }
.summary-hero-identity { width: 100%; min-width: 0; }
.summary-name-wrap {
  display: block;
  width: 100%;
  min-width: 0;
}
.summary-hero-name {
  margin: 0;
  font-size: 16px;
  font-weight: var(--weight-heading);
}
input.summary-hero-name.journey-name-input {
  display: block;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  padding: 2px 6px;
  margin: 0 -6px;
  border-radius: var(--radius-control);
  color: var(--fg);
  font-family: inherit;
  letter-spacing: -0.02em;
}
input.summary-hero-name.journey-name-input:hover {
  border-color: var(--border);
}
input.summary-hero-name.journey-name-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--canvas);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input.summary-hero-name.journey-name-input::placeholder {
  color: var(--fg-subtle);
}
.summary-hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 8px;
  font-size: 13px;
  color: var(--fg-muted);
}
.summary-xp { width: min(280px, 100%); }
.journey-xp .summary-xp { width: 100%; max-width: none; }
.summary-hero-sub {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--fg-subtle);
  line-height: 1.4;
}
.summary-kpis {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.summary-kpis--stack {
  grid-template-columns: 1fr;
  gap: 6px;
  flex: 1;
}
.summary-kpis--stack li { border-radius: var(--radius-control); }
.summary-kpis--stack .summary-kpi-btn {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
}
.summary-kpis--stack strong { font-size: 18px; }
.summary-kpis--stack span { font-size: 10px; }
.summary-kpis li {
  padding: 0;
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-panel);
}
.summary-kpi-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: inherit;
}
.summary-kpi-btn:hover {
  background: var(--surface-hover);
}
.summary-kpi-btn:hover strong { color: var(--accent); }
.summary-kpi-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.summary-kpis strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
}
.summary-kpis span {
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}
.summary-charts,
.summary-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.summary-card-wide { grid-column: 1 / -1; }
.summary-card {
  padding: 12px;
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-panel);
  min-width: 0;
}
.summary-card h3 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: var(--weight-medium);
}
.summary-card .cal-hint { margin-bottom: 10px; }
.summary-card-h {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.summary-range { display: flex; flex-wrap: wrap; gap: 4px; }
.summary-stack {
  display: block;
  width: 100%;
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-hover);
}
.summary-bars,
.summary-area {
  display: block;
  width: 100%;
  height: 160px;
  color: var(--fg-subtle);
}
.summary-bars text,
.summary-area text {
  font-size: 9px;
  fill: var(--fg-subtle);
}
.summary-bar { fill: var(--accent); }
.summary-bar.is-empty { fill: var(--border); }
.summary-area {
  color: var(--accent);
  overflow: visible;
}
.summary-area-fill { fill: url(#summary-area-fill); }
.summary-area-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.summary-area-base {
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}
.summary-area-dot {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 1.75;
}
.summary-area-hit {
  fill: transparent;
  pointer-events: all;
}
.summary-area-value {
  font-size: 9px;
  font-family: var(--font-mono);
  font-weight: 700;
  fill: var(--accent);
}
.board-overview-pct {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--fg-muted);
}
.board-overview-pct strong {
  font-family: var(--font-mono);
  font-size: 22px;
  color: var(--fg);
  margin-right: 4px;
}
.board-overview-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.board-overview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 8px;
  border: none;
  border-radius: var(--radius-control);
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.board-overview-row:hover { background: var(--surface-hover); }
.board-overview-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.board-overview-label i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.board-overview-row strong {
  font-family: var(--font-mono);
  font-size: 14px;
}
.task-perf {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.task-perf-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.task-perf-label {
  font-size: 13px;
  font-weight: var(--weight-medium);
}
.task-perf-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-subtle);
  white-space: nowrap;
}
.task-perf-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-hover);
  overflow: hidden;
}
.task-perf-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  min-width: 2px;
}
.summary-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  font-size: 12px;
  color: var(--fg-muted);
}
.summary-legend.compact { margin-top: 4px; }
.summary-legend i,
.summary-legend .swatch-solid,
.summary-legend .swatch-faint {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: -1px;
}
.summary-legend .swatch-solid { background: var(--accent); }
.summary-legend .swatch-faint { background: var(--accent); opacity: .45; }
.summary-legend-btn {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: none;
  background: transparent;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.summary-legend-btn:hover { color: var(--fg); }
.summary-legend-btn strong {
  margin-left: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
}
.summary-empty {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--fg-muted);
}
.summary-badges {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}
.summary-badges li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.summary-badges img {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}

/* Calendar / timeline / pulse */
.calendar-wrap {
  display: grid;
  grid-template-columns: 252px 1fr;
  gap: 20px;
  min-height: 100%;
}
.unscheduled {
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-panel);
  padding: 16px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: auto;
}
.unscheduled h3 {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 0 0 2px;
  color: var(--fg-subtle);
}
.cal-hint {
  font-size: 11px;
  color: var(--fg-subtle);
  margin: 0 0 6px;
  line-height: 1.4;
}
.view-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.view-toolbar .cal-hint { margin: 0; max-width: 72ch; }
.undo-toast {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 72;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 14px;
  background: var(--surface-raised);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-popover);
  font-size: 13px;
}
.undo-toast[hidden] { display: none; }
.reward-toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 125;
  display: inline-flex;
  align-items: center;
  max-width: min(94vw, 420px);
  padding: 8px 10px;
  background: var(--surface-raised);
  border: var(--border-width) solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-popover);
  font-size: 13px;
  font-weight: var(--weight-medium);
  color: var(--fg);
  pointer-events: none;
  overflow: visible;
  opacity: 0;
  transform: translate(-50%, 16px) scale(0.96);
  transition:
    opacity .28s var(--ease-out),
    transform .32s var(--ease-out);
}
.reward-toast[hidden] { display: none; }
.reward-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}
.reward-toast.is-pop {
  animation: reward-toast-pop .38s var(--ease-out);
}
.reward-toast.is-leaving {
  opacity: 0;
  transform: translate(-50%, 10px) scale(0.98);
}
.reward-toast.is-muted {
  color: var(--fg-muted);
  font-weight: var(--weight-body);
  padding: 10px 16px;
}
.reward-toast-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  min-width: 0;
  max-width: 100%;
}
.reward-toast-levelup {
  display: none;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.reward-toast-levelup[hidden] { display: none !important; }
.reward-toast-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.reward-toast-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-transform: uppercase;
}
.reward-toast-sub {
  font-size: 12px;
  font-weight: var(--weight-medium);
  color: var(--fg-muted);
  white-space: nowrap;
}
.reward-toast-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}
.reward-toast-chips:empty,
.reward-toast-text:empty {
  display: none;
}
.reward-toast-text {
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}
.reward-chip {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 6px;
  height: 28px;
  padding: 0 10px 0 6px;
  border: var(--border-width) solid var(--border);
  border-radius: 999px;
  background: var(--support);
  color: var(--support-fg);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.reward-chip-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
}
.reward-chip-walk .reward-chip-icon {
  width: 16px;
  height: 16px;
}
@keyframes reward-toast-pop {
  0% { transform: translate(-50%, 0) scale(1); }
  35% { transform: translate(-50%, -4px) scale(1.04); }
  100% { transform: translate(-50%, 0) scale(1); }
}
[data-theme="stormlikes"] .reward-toast {
  border-color: var(--fg);
  box-shadow: 5px 5px 0 0 var(--fg);
}
.reward-toast:not(.is-level-up):not(.is-muted) {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  padding: 0;
}
[data-theme="stormlikes"] .reward-toast:not(.is-level-up):not(.is-muted) {
  border-color: transparent;
  box-shadow: none;
}
.reward-toast:not(.is-level-up) .reward-toast-inner,
.reward-toast:not(.is-level-up) .reward-toast-chips {
  justify-content: center;
}
.reward-toast.is-level-up {
  max-width: min(96vw, 640px);
  padding: 12px 16px 12px 12px;
  border-radius: 28px;
  background: var(--surface-raised);
}
.reward-toast.is-level-up .reward-toast-chips {
  margin-left: 4px;
}
.reward-toast.is-level-up .reward-toast-levelup {
  display: inline-flex;
}
.reward-toast-level-mark {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--fg);
  background: var(--support);
}
.reward-toast.is-level-up.is-pop {
  animation: reward-level-celebrate 0.55s var(--ease-out);
}
.reward-toast-confetti {
  display: none;
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}
.reward-toast.is-level-up .reward-toast-confetti {
  display: block;
}
.reward-confetti-piece {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 7px;
  height: 11px;
  border-radius: 1px;
  transform: translate(-50%, -50%) scale(0.3);
  animation: reward-confetti-fly var(--fly, 3.8s) linear both;
}
@keyframes reward-confetti-fly {
  0% {
    transform: translate(-50%, -50%) scale(0.35) rotate(0deg);
    opacity: 1;
  }
  12% {
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--rot));
    opacity: 1;
  }
  62% {
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--drift)), calc(-50% + var(--fall))) scale(0.85) rotate(var(--spin));
    opacity: 0;
  }
}
@keyframes reward-level-celebrate {
  0% { transform: translate(-50%, 0) scale(1); }
  40% { transform: translate(-50%, -3px) scale(1.02); }
  100% { transform: translate(-50%, 0) scale(1); }
}
.cal-cell.cal-drop,
.unscheduled.cal-drop {
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
}
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cal-head h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: var(--weight-heading);
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border-subtle);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-panel);
  overflow: hidden;
}
.cal-dow, .cal-cell {
  background: var(--surface);
  min-height: 88px;
  padding: 6px;
  font-size: 12px;
}
.cal-dow {
  min-height: 28px;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: .06em;
  color: var(--fg-subtle);
  font-weight: var(--weight-medium);
}
.cal-cell.mute { color: var(--fg-subtle); background: var(--canvas); }
.cal-cell.today { outline: 1px solid var(--accent); outline-offset: -1px; }
.cal-card {
  margin-top: 4px;
  font-size: 11px;
  padding: 4px 6px 4px 7px;
  background: var(--accent-soft);
  border-radius: var(--radius-tag);
  cursor: pointer;
  border: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  text-align: left;
  transition: background var(--duration-fast), color var(--duration-fast), transform var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.cal-card.rank-T { --rank-color: #94a3b8; }
.cal-card.rank-E { --rank-color: #3b82f6; }
.cal-card.rank-M { --rank-color: #f5c400; }
.cal-card.rank-H { --rank-color: #ff7a1a; }
.cal-card-rank {
  flex: 0 0 4px;
  align-self: stretch;
  min-height: 12px;
  border-radius: 99px;
  background: var(--rank-color, var(--border));
}
.cal-card-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-card-diff {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--fg-muted);
  line-height: 1;
}
.cal-card:not(.is-roomy) .cal-card-diff { display: none; }
.cal-card.is-roomy {
  margin-top: 0;
  padding: 10px 10px 10px 12px;
  gap: 8px;
  font-size: 12px;
  font-weight: var(--weight-medium);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  color: var(--fg);
}
.cal-card.is-roomy .cal-card-rank {
  flex-basis: 6px;
  min-height: 18px;
}
.cal-card.is-roomy .cal-card-title {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.35;
}
.cal-card.is-roomy .cal-card-diff {
  font-size: 9px;
  padding: 3px 6px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--rank-color) 22%, var(--surface));
  color: var(--fg);
}
.cal-card:hover { background: var(--accent); color: var(--accent-fg); }
.cal-card.is-roomy:hover {
  background: var(--surface-hover);
  color: var(--fg);
  border-color: var(--fg);
}
.cal-card:active { transform: scale(0.98); }
[data-theme="stormlikes"] .cal-card.is-roomy {
  box-shadow: 2px 2px 0 0 var(--fg);
}
[data-theme="stormlikes"] .cal-card.is-roomy:hover {
  background: var(--support);
}

.feed {
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.feed-item {
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-card);
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
  transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast), transform var(--duration-fast), background var(--duration-fast);
}
.feed-item:hover { border-color: var(--accent); box-shadow: var(--shadow-popover); transform: translateY(-1px); }
.feed-item:active { transform: translateY(0); background: var(--surface-hover); }
.feed-meta {
  font-size: 11px;
  color: var(--fg-subtle);
  margin-top: 6px;
  display: flex;
  gap: 10px;
}

.empty-view {
  color: var(--fg-subtle);
  padding: 48px 16px;
  text-align: center;
}

/* Overlay / modal */
.overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 24px;
  animation: fade-in var(--duration-base) var(--ease-out);
}
.overlay[hidden] { display: none; }
#adventurer-profile.overlay {
  animation: none;
  transition: opacity var(--duration-base) var(--ease-out), visibility 0s linear var(--duration-base);
}
#adventurer-profile.overlay[hidden] {
  display: flex !important;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
#adventurer-profile.overlay:not([hidden]) {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity var(--duration-base) var(--ease-out), visibility 0s;
}
#card-editor {
  z-index: 95;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.image-lightbox {
  z-index: 128;
  background: color-mix(in srgb, #0b0b0b 72%, transparent);
  padding: 28px 20px;
  cursor: zoom-out;
}
.image-lightbox-close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 1;
  background: var(--surface-raised);
  border: var(--border-width) solid var(--border);
}
.image-lightbox-img {
  max-width: min(96vw, 1100px);
  max-height: min(88dvh, 900px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-panel);
  border: var(--border-width) solid var(--border);
  box-shadow: var(--shadow-modal);
  cursor: default;
}
[data-theme="stormlikes"] .image-lightbox-img {
  border-color: var(--fg);
  box-shadow: 6px 6px 0 0 var(--fg);
}
#dialog { z-index: 110; }
.dialog-copy {
  font-size: 14px;
  line-height: 1.45;
  color: var(--fg);
  margin: 0;
}

.modal {
  width: 100%;
  max-width: 460px;
  max-height: min(90vh, 720px);
  overflow: auto;
  background: var(--surface-raised);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-modal);
  animation: rise-in var(--duration-base) var(--ease-out);
}
.modal.wide { max-width: 560px; }
.appearance-modal {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: min(86vh, 720px);
}
.appearance-modal .modal-h,
.appearance-modal .modal-f {
  flex-shrink: 0;
}
.appearance-modal .appearance-body {
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 0;
  flex: 1;
  padding-right: 14px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--fg) 35%, var(--surface)) transparent;
}
.appearance-modal .appearance-body::-webkit-scrollbar {
  width: 10px;
}
.appearance-modal .appearance-body::-webkit-scrollbar-track {
  background: transparent;
  margin: 4px 0;
}
.appearance-modal .appearance-body::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--fg) 28%, var(--surface));
  border: 2px solid var(--surface-raised);
  border-radius: 99px;
}
.appearance-modal .appearance-body::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--fg) 45%, var(--surface));
}
.issue-modal {
  max-width: min(960px, 96vw);
  width: 100%;
  height: min(calc((100dvh - 32px) / var(--ui-scale, 1)), 880px);
  max-height: min(calc((100dvh - 32px) / var(--ui-scale, 1)), 880px);
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.issue-modal.modal {
  overflow: hidden;
  height: min(calc((100dvh - 32px) / var(--ui-scale, 1)), 880px);
  max-height: min(calc((100dvh - 32px) / var(--ui-scale, 1)), 880px);
}
.issue-modal .issue-top {
  flex-shrink: 0;
}
.issue-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 8px;
  flex-shrink: 0;
}
.issue-top .card-crumb { margin: 0; }
.issue-key {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-subtle);
  letter-spacing: .02em;
}
.issue-top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.issue-more-btn {
  flex-shrink: 0;
}
.issue-body {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(220px, .85fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  padding: 0;
  min-height: 0;
  overflow: hidden;
  flex: 1 1 0;
}
.issue-body .issue-main,
.issue-body .issue-side {
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--fg) 35%, var(--surface)) transparent;
}
.issue-body .issue-main::-webkit-scrollbar,
.issue-body .issue-side::-webkit-scrollbar {
  width: 10px;
}
.issue-body .issue-main::-webkit-scrollbar-track,
.issue-body .issue-side::-webkit-scrollbar-track {
  background: transparent;
  margin: 4px 0;
}
.issue-body .issue-main::-webkit-scrollbar-thumb,
.issue-body .issue-side::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--fg) 28%, var(--surface));
  border: 2px solid var(--surface-raised);
  border-radius: 99px;
}
.issue-body .issue-main::-webkit-scrollbar-thumb:hover,
.issue-body .issue-side::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--fg) 45%, var(--surface));
}
.issue-main {
  --issue-title-size: 16px;
  --issue-body-size: 12px;
  --desc-size: var(--rt-desc-size, 14px);
  --desc-leading: var(--rt-desc-leading, 1.714);
  --desc-block: var(--rt-desc-block, 0.8em);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  padding: 4px 18px 20px 22px;
}
.issue-modal #desc-wrap {
  display: flex;
  flex-direction: column;
  min-height: 96px;
  max-height: none;
  flex: 0 0 auto;
  overflow: hidden;
}
.issue-modal #desc-wrap.previewing {
  overflow: hidden;
}
.issue-modal #desc-wrap:not(.previewing) .rt-toolbar {
  position: sticky;
  top: 0;
  z-index: 4;
  flex-shrink: 0;
  margin: 0;
  margin-top: -1px;
  padding-top: 5px;
  background: var(--surface-hover);
  box-shadow: 0 1px 0 var(--border-subtle);
  border-radius: calc(var(--radius-control) - var(--border-width)) calc(var(--radius-control) - var(--border-width)) 0 0;
}
.issue-modal #desc-wrap .rt-editor {
  flex: 1 1 auto;
  min-height: 72px;
  max-height: min(480px, 55dvh);
  overflow-x: auto;
  overflow-y: auto;
}
.issue-modal #desc-wrap .rt-preview {
  flex: 0 0 auto;
  min-height: 72px;
  max-height: none;
  overflow: visible;
}
.issue-modal #desc-wrap .rt-editor::-webkit-scrollbar,
.issue-modal #desc-wrap .rt-preview::-webkit-scrollbar {
  width: 8px;
}
.issue-modal #desc-wrap .rt-editor::-webkit-scrollbar-thumb,
.issue-modal #desc-wrap .rt-preview::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--fg) 28%, var(--surface));
  border: 2px solid var(--surface);
  border-radius: 99px;
}
.issue-modal #desc-wrap.previewing {
  max-height: none;
  overflow: hidden;
}
.issue-modal #desc-wrap.previewing .rt-preview {
  display: block;
  max-height: none;
  overflow: visible;
}
.issue-title {
  width: 100%;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: var(--issue-title-size);
  font-weight: var(--weight-heading);
  line-height: 1.35;
  letter-spacing: normal;
  color: var(--fg);
  padding: 4px 0;
  outline: none;
}
.issue-title:focus {
  box-shadow: 0 1px 0 var(--accent);
}
.issue-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 8px 18px 20px 20px;
  border-left: var(--border-width) solid var(--border-subtle);
}
.issue-status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}
.issue-status-dd,
.issue-rank-dd {
  min-width: 0;
}
.issue-status-dd .status-trigger {
  width: 100%;
  height: 34px;
  font-weight: 600;
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.issue-rank-dd .dd-trigger {
  position: relative;
  width: 100%;
  height: 34px;
  padding-left: 14px;
  overflow: hidden;
  font-weight: 600;
}
.issue-rank-dd .dd-trigger::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  background: var(--rank-accent, var(--border));
  border-radius: calc(var(--radius-control) - 2px) 0 0 calc(var(--radius-control) - 2px);
}
.issue-rank-dd .dd-trigger.rank-T { --rank-accent: #94a3b8; color: #64748b; }
.issue-rank-dd .dd-trigger.rank-E { --rank-accent: #3b82f6; color: #2563eb; }
.issue-rank-dd .dd-trigger.rank-M { --rank-accent: #f5c400; color: #b45309; }
.issue-rank-dd .dd-trigger.rank-H { --rank-accent: #ff7a1a; color: #c2410c; }
.issue-details {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 4px;
}
.issue-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.issue-field-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}
.issue-assignee {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  font-size: 13px;
  font-weight: 600;
}
.issue-assignee .char-sprite.hud-avatar,
.comment-item .char-sprite.hud-avatar {
  width: var(--f);
  height: var(--f);
  flex-shrink: 0;
  border-radius: var(--radius-control);
  overflow: hidden;
  background-color: transparent;
}
.issue-comments {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 20px;
  margin-top: 8px;
  border-top: var(--border-width) solid var(--border-subtle);
}
.issue-comments h3 {
  margin: 0 0 4px;
  font-size: var(--issue-body-size, 14px);
  font-weight: var(--weight-heading);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.comment-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}
.comment-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: start;
  padding: 4px 0 10px;
}
.comment-content {
  min-width: 0;
}
.comment-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
}
.comment-item:hover .comment-actions,
.comment-item:focus-within .comment-actions {
  opacity: 1;
}
.comment-action {
  border: none;
  background: none;
  padding: 0;
  font-size: 11px;
  font-weight: var(--weight-medium);
  color: var(--fg-subtle);
  cursor: pointer;
}
.comment-action:hover { color: var(--accent); }
.comment-action[data-action="delete"]:hover { color: var(--danger); }
.comment-edit-input {
  width: 100%;
  height: auto;
  resize: vertical;
}
.comment-edit-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.comment-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: var(--issue-body-size, 12px);
}
.comment-meta strong { font-weight: 600; }
.comment-meta time { color: var(--fg-subtle); font-size: inherit; }
.comment-body {
  font-size: var(--issue-body-size, 12px);
  line-height: 1.55;
  color: var(--fg);
  margin-top: 6px;
}
.comment-body.md p { margin: 0 0 .35em; }
.comment-compose {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 20px;
  margin-bottom: 4px;
  scroll-margin-bottom: 24px;
}
.comment-rt-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 34px;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  overflow: hidden;
  transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast);
}
.comment-rt-wrap:not(.is-active) {
  height: 34px;
  overflow: hidden;
}
.comment-rt-wrap.is-active {
  height: auto;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  z-index: 3;
}
.comment-rt-wrap:not(.is-active) .comment-rt-toolbar {
  display: none;
}
.comment-rt-wrap.is-active .comment-rt-toolbar {
  display: flex;
  position: static;
  flex-shrink: 0;
  left: auto;
  right: auto;
  bottom: auto;
  padding: 4px 6px;
  border: none;
  border-bottom: var(--border-width) solid var(--border-subtle);
  border-radius: 0;
  background: var(--surface-hover);
  box-shadow: none;
}
.comment-rt-toolbar {
  padding: 4px 6px;
  border-bottom: var(--border-width) solid var(--border-subtle);
}
.comment-field-shell {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-height: calc(34px - 2 * var(--border-width));
  min-width: 0;
  max-height: 140px;
  overflow: hidden;
}
.comment-rt-wrap:not(.is-active) .comment-field-shell {
  height: 100%;
  max-height: none;
}
.comment-compose .comment-input {
  flex: 1;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: 140px;
  padding: 0 36px 0 12px;
  line-height: 1.35;
  font-size: 13px;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  background: transparent;
  overflow-x: hidden;
  overflow-y: auto;
  outline: none;
}
.comment-edit-wrap {
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  overflow: hidden;
}
.comment-edit-input {
  min-height: 44px;
  max-height: 140px;
  padding: 10px 12px;
  line-height: 1.45;
  font-size: var(--issue-body-size, 12px);
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  background: transparent;
  overflow: auto;
  outline: none;
}
.comment-send-btn {
  position: absolute;
  top: 50%;
  right: 4px;
  bottom: auto;
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  transform: translateY(-50%);
  border-radius: var(--radius-control);
  background: var(--fg);
  color: #fff;
  border: var(--border-width) solid var(--fg);
  box-shadow: none;
  filter: none;
  transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}
.comment-rt-wrap.is-expanded .comment-send-btn {
  top: auto;
  bottom: 4px;
  transform: none;
}
.comment-send-btn svg {
  width: 16px;
  height: 16px;
}
.icon-btn.comment-send-btn:hover,
.icon-btn.comment-send-btn:active,
.icon-btn.comment-send-btn:focus-visible {
  background: var(--support);
  color: var(--fg);
  border-color: var(--fg);
  transform: translateY(-50%);
  box-shadow: none;
  filter: none;
}
.comment-rt-wrap.is-expanded .icon-btn.comment-send-btn:hover,
.comment-rt-wrap.is-expanded .icon-btn.comment-send-btn:active,
.comment-rt-wrap.is-expanded .icon-btn.comment-send-btn:focus-visible {
  transform: none;
}
.comment-compose .comment-input:empty::before,
.comment-edit-input:empty::before {
  content: attr(data-placeholder);
  color: var(--fg-subtle);
  pointer-events: none;
}
@media (max-width: 760px) {
  .issue-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    overflow: auto;
  }
  .issue-body .issue-main,
  .issue-body .issue-side {
    max-height: none;
    overflow: visible;
  }
  .issue-side {
    border-left: none;
    border-top: var(--border-width) solid var(--border-subtle);
    padding-left: 22px;
  }
  .issue-status-row { grid-template-columns: 1fr; }
}
.modal-h {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 18px 0;
}
.modal-h h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: var(--weight-heading);
  letter-spacing: -0.02em;
}
.modal-desc {
  margin-top: 4px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: var(--weight-body);
  color: var(--fg-muted);
  line-height: 1.4;
  max-width: 46ch;
}
.modal-b { padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; }
.modal-b label { font-size: 12px; font-weight: var(--weight-medium); color: var(--fg-muted); }
.appearance-body { gap: 20px; }
.modal-f {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 0 18px 16px;
}
.modal-f .right { display: flex; gap: 8px; margin-left: auto; }

.desc-label {
  font-size: var(--issue-body-size, 14px);
  font-weight: var(--weight-heading);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.rt-wrap {
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  overflow: hidden;
  transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}
.rt-wrap.previewing {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
.rt-wrap.previewing:hover { border-color: transparent; }
.rt-wrap:not(.previewing):hover { border-color: var(--border-strong); }
.rt-wrap:not(.previewing):focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.rt-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: var(--surface-hover);
  border-bottom: var(--border-width) solid var(--border-subtle);
}
.rt-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font-display);
  font-weight: var(--weight-heading);
  transition: background var(--duration-fast), color var(--duration-fast), transform var(--duration-fast);
}
.rt-btn:hover { background: var(--surface); color: var(--fg); }
.rt-btn:disabled,
.rt-btn.is-disabled {
  opacity: .38;
  cursor: default;
  pointer-events: none;
}
.rt-btn:focus-visible {
  outline: none;
  color: var(--fg);
  background: var(--surface);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.rt-btn svg { width: 14px; height: 14px; }
.rt-color {
  position: relative;
  overflow: hidden;
}
.rt-color:active { transform: none; }
.rt-color-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  pointer-events: none;
}
.rt-color-letter {
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}
.rt-color-mark i {
  display: block;
  width: 12px;
  height: 3px;
  border-radius: 99px;
  background: currentColor;
}
#desc-font-color-swatch { background: #2563eb; }
#desc-cell-bg-swatch { background: #fde68a; }
.rt-color input[type="color"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: none;
  padding: 0;
  cursor: pointer;
}
.rt-mono { font-family: var(--font-mono); font-size: 10px; font-weight: 600; }
.rt-sep {
  width: 1px;
  height: 16px;
  margin: 0 4px;
  background: var(--border);
}
.rt-heading-menu { position: relative; }
.rt-heading-trigger {
  width: auto;
  min-width: 40px;
  padding: 0 5px;
  gap: 2px;
  font-size: 11px;
  font-weight: 600;
}
.rt-heading-chevron {
  width: 8px;
  height: 8px;
}
.rt-heading-panel {
  position: fixed;
  z-index: 120;
  min-width: 148px;
  padding: 6px;
  background: var(--surface-raised);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-popover);
}
.rt-heading-panel[hidden] { display: none; }
.rt-heading-opt {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  border-radius: var(--radius-control);
  padding: 6px 8px;
  color: var(--fg);
  cursor: pointer;
  font-family: inherit;
  font-weight: inherit;
  line-height: 1.25;
}
.rt-heading-opt:hover,
.rt-heading-opt.selected { background: var(--surface-hover); }
.rt-heading-opt[data-fmt="title"] {
  font-size: 16px;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.rt-heading-opt[data-fmt="h1"] { font-size: 14px; }
.rt-heading-opt[data-fmt="h2"] { font-size: 13px; }
.rt-heading-opt[data-fmt="h3"] { font-size: 12px; }
.rt-heading-opt[data-fmt="p"] { font-size: 12px; }
.rt-editor {
  width: 100%;
  min-height: 44px;
  max-height: 480px;
  overflow: auto;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  background: transparent;
  resize: none;
  line-height: 1.45;
  font-size: var(--issue-body-size, 14px);
  padding: 8px 10px;
  outline: none;
}
#desc-wrap .rt-editor {
  font-size: var(--desc-size, var(--rt-desc-size, 14px));
  line-height: var(--desc-leading, var(--rt-desc-leading, 1.714));
  padding: 10px 12px 14px;
}
.rt-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--fg-subtle);
  pointer-events: none;
}
.rt-editor strong { font-weight: 700; }
.rt-editor em { font-style: italic; }
.rt-editor s, .rt-editor del { text-decoration: line-through; }
.rt-editor code {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--surface-hover);
  padding: 1px 4px;
  border-radius: 4px;
}
.rt-editor blockquote {
  margin: 0.35em 0;
  padding-left: 10px;
  border-left: 3px solid var(--accent);
  color: var(--fg-muted);
}
.rt-editor a { color: #2563eb; text-decoration: underline; text-underline-offset: 2px; }
.rt-img-wrap {
  display: inline-block;
  position: relative;
  max-width: 100%;
  margin: 8px 0;
  line-height: 0;
  vertical-align: top;
}
.rt-editor img.rt-img,
.md-img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0;
  border-radius: var(--radius-control);
  border: var(--border-width) solid var(--border-subtle);
  cursor: zoom-in;
}
.rt-img-handle {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 12px;
  height: 12px;
  cursor: nwse-resize;
  touch-action: none;
  background: var(--accent);
  border: 1px solid #fff;
  border-radius: 2px;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
}
.rt-img-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  border: 1px solid #fff;
  border-radius: 2px;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
}
.rt-img-remove svg {
  width: 12px;
  height: 12px;
}
.rt-img-wrap:hover .rt-img-handle,
.rt-img-wrap.is-resizing .rt-img-handle,
.rt-img-wrap:hover .rt-img-remove {
  opacity: 1;
}
.rt-wrap.previewing .rt-img-remove,
.rt-preview .rt-img-remove,
.rt-preview .rt-img-handle {
  display: none;
}
.comment-body .md-img {
  margin: 6px 0;
}
.rt-preview {
  min-height: 0;
  padding: 2px 0 8px;
  cursor: text;
  font-size: var(--issue-body-size, 12px);
  line-height: 1.45;
}
#desc-wrap .rt-preview {
  font-size: var(--desc-size, var(--rt-desc-size, 14px));
  line-height: var(--desc-leading, var(--rt-desc-leading, 1.714));
  padding: 4px 2px 12px;
}
.desc-empty-trigger {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 12px;
  color: var(--fg-subtle);
  cursor: text;
  text-align: left;
}
.desc-empty-trigger:hover { color: var(--fg-muted); }
.rt-wrap.previewing .rt-toolbar,
.rt-wrap.previewing .rt-editor { display: none; }
.rt-wrap.previewing .rt-preview { display: block; }
.rt-preview.hidden { display: none; }
.card-save-status {
  font-size: 12px;
  color: var(--fg-subtle);
  min-width: 0;
  text-align: right;
  white-space: nowrap;
}
.card-save-status:empty { display: none; }
.card-save-status[data-state="saving"] { color: var(--fg-muted); }
.card-save-status[data-state="saved"] { color: #30a46c; }

.md s, .md del { text-decoration: line-through; color: var(--fg-muted); }
.md blockquote {
  margin: .4em 0;
  padding: 4px 10px;
  border-left: 3px solid var(--accent);
  color: var(--fg-muted);
}
.md pre {
  margin: .5em 0;
  padding: 8px 10px;
  background: var(--surface-hover);
  border-radius: var(--radius-control);
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 12px;
}

.colors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  background: var(--surface-hover);
  transition: transform var(--duration-fast) var(--ease-out), border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.swatch:hover { transform: scale(1.14); box-shadow: 0 0 0 2px var(--accent-soft); }
.swatch:active { transform: scale(0.94); }
.swatch.active { border-color: var(--fg); }
.swatch.none {
  background:
    linear-gradient(to top right, transparent calc(50% - 1px), var(--fg-muted) 50%, transparent calc(50% + 1px)),
    var(--surface);
}

.due-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: var(--radius-tag);
  background: var(--accent-soft);
  color: var(--accent);
}
.view-move {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.view-move-label {
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}
.view-move-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.view-move-btns .btn {
  height: 28px;
  font-size: 12px;
}
.view-due-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.view-due-actions .btn { height: 28px; font-size: 12px; }
#view-desc,
#view-desc * {
  user-select: text;
}
#view-desc { cursor: text; }
#view-desc a { cursor: pointer; }

.md h1, .md h2, .md h3,
.rt-editor h1, .rt-editor h2, .rt-editor h3 {
  font-weight: inherit;
  margin: .4em 0;
}
.md h1.rt-title, .rt-editor h1.rt-title, .md .rt-title, .rt-editor .rt-title {
  font-size: 1.7em;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin: .5em 0 .3em;
}
.md h1, .rt-editor h1 { font-size: 1.32em; line-height: 1.25; }
.md h2, .rt-editor h2 { font-size: 1.16em; }
.md h3, .rt-editor h3 { font-size: 1.05em; }
.md p, .rt-editor p { margin: .4em 0; font-weight: inherit; }
.md strong, .rt-editor strong, .md b, .rt-editor b { font-weight: 700; }
.md ul, .md ol, .rt-editor ul, .rt-editor ol { padding-left: 1.2em; margin: .4em 0; }
#desc-wrap .md p,
#desc-wrap .rt-editor p {
  margin: 0 0 var(--desc-block, 0.8em);
}
#desc-wrap .md p:last-child,
#desc-wrap .rt-editor p:last-child {
  margin-bottom: 0;
}
#desc-wrap .md h1,
#desc-wrap .rt-editor h1 {
  font-size: 1.5em;
  line-height: 1.28;
  font-weight: var(--weight-heading);
  letter-spacing: -0.02em;
  margin: 1.15em 0 0.4em;
}
#desc-wrap .md h2,
#desc-wrap .rt-editor h2 {
  font-size: 1.28em;
  line-height: 1.32;
  font-weight: var(--weight-heading);
  margin: 1.05em 0 0.35em;
}
#desc-wrap .md h3,
#desc-wrap .rt-editor h3 {
  font-size: 1.14em;
  line-height: 1.38;
  font-weight: var(--weight-heading);
  margin: 0.95em 0 0.3em;
}
#desc-wrap .md h1:first-child,
#desc-wrap .rt-editor h1:first-child,
#desc-wrap .md h2:first-child,
#desc-wrap .rt-editor h2:first-child,
#desc-wrap .md h3:first-child,
#desc-wrap .rt-editor h3:first-child {
  margin-top: 0.55em;
}
#desc-wrap .md h1.rt-title,
#desc-wrap .rt-editor h1.rt-title {
  font-size: 1.7em;
  line-height: 1.22;
  margin: 0.2em 0 0.45em;
}
#desc-wrap .md ul,
#desc-wrap .md ol,
#desc-wrap .rt-editor ul,
#desc-wrap .rt-editor ol {
  margin: 0 0 var(--desc-block, 0.8em);
  padding-left: 1.5em;
}
#desc-wrap .md li,
#desc-wrap .rt-editor li {
  margin: 0.22em 0;
}
#desc-wrap .md blockquote,
#desc-wrap .rt-editor blockquote {
  margin: 0 0 var(--desc-block, 0.8em);
  padding: 2px 0 2px 12px;
}
.md table, .rt-editor table, .rt-table {
  border-collapse: collapse;
  width: 100%;
  max-width: 100%;
  margin: .5em 0;
  table-layout: fixed;
  font-size: .95em;
}
.md th, .md td, .rt-editor th, .rt-editor td {
  border: var(--border-width) solid var(--border);
  padding: 4px 8px;
  min-width: 2.2em;
  min-height: 1.8em;
  vertical-align: top;
  font-weight: inherit;
  position: relative;
}
#desc-wrap .md th,
#desc-wrap .md td,
#desc-wrap .rt-editor th,
#desc-wrap .rt-editor td {
  padding: 8px 10px;
  min-height: 2.15em;
  line-height: 1.45;
}
.md th, .rt-editor th {
  background: var(--surface-hover);
  font-weight: var(--weight-medium);
}
.rt-editor td, .rt-editor th { cursor: text; }
.rt-editor td:hover,
.rt-editor th:hover {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, var(--border));
}
.rt-editor td.rt-cell-active,
.rt-editor th.rt-cell-active {
  box-shadow: inset 0 0 0 2px var(--accent);
}
.rt-col-handle {
  position: absolute;
  top: 0;
  right: -3px;
  width: 7px;
  height: 100%;
  cursor: col-resize;
  z-index: 2;
  user-select: none;
}
.rt-row-handle {
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 7px;
  cursor: row-resize;
  z-index: 2;
  user-select: none;
}
.rt-col-handle:hover,
.rt-col-handle.is-dragging,
.rt-row-handle:hover,
.rt-row-handle.is-dragging {
  background: var(--accent);
  opacity: .45;
}
.rt-wrap.previewing .rt-col-handle,
.rt-preview .rt-col-handle,
.rt-wrap.previewing .rt-row-handle,
.rt-preview .rt-row-handle {
  display: none;
}
.md code {
  font-family: var(--font-mono);
  font-size: .9em;
  background: var(--surface-hover);
  padding: 0 4px;
  border-radius: 2px;
}
.md a,
.rt-editor a,
.rt-preview a {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.md a:hover,
.rt-editor a:hover,
.rt-preview a:hover {
  color: #1d4ed8;
}
.md ul.rt-check,
.rt-editor ul.rt-check {
  list-style: none;
  padding-left: .15em;
  margin: .45em 0;
}
.md ul.rt-check > li,
.rt-editor ul.rt-check > li,
.md li.check,
.rt-editor li.check {
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: .2em 0;
  margin-left: 0;
}
.md ul.rt-check input[type="checkbox"],
.rt-editor ul.rt-check input[type="checkbox"],
.md li.check input[type="checkbox"] {
  margin: .28em 0 0;
  flex: 0 0 auto;
  pointer-events: auto;
  cursor: pointer;
  accent-color: var(--accent);
}

/* Menus */
.menu {
  position: fixed;
  z-index: 100;
  min-width: 220px;
  padding: 6px;
  background: var(--surface-raised);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-popover);
  animation: rise-in var(--duration-fast) var(--ease-out);
}
.menu[hidden] { display: none; }
.menu button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  text-align: left;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: var(--radius-control);
  font-size: 13px;
  cursor: pointer;
  color: var(--fg);
  transition: background var(--duration-fast) var(--ease-out);
}
.menu button:hover { background: var(--surface-hover); }
.menu button:active { background: var(--surface-active); }
.menu button.danger { color: var(--danger); }
.menu button.danger:hover { background: var(--danger-soft); }
.menu hr {
  border: none;
  border-top: var(--border-width) solid var(--border-subtle);
  margin: 4px 0;
}
.menu-category {
  justify-content: space-between;
}
.menu-category-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.menu-category-label {
  font-weight: var(--weight-medium);
}
.menu-category-hint {
  font-size: 11px;
  color: var(--fg-subtle);
  font-weight: 400;
}
.menu-chevron {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  color: var(--fg-subtle);
}
.menu-nested { overflow: visible; }
.menu-row { position: relative; }
.menu-category-anchor {
  position: relative;
  width: 100%;
}
.menu-flyout {
  position: absolute;
  left: 10px;
  top: 0;
  width: max-content;
  max-width: min(320px, 72vw);
  padding: 6px;
  background: var(--surface-raised);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-popover);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(calc(-100% - 6px));
  transition: opacity var(--duration-fast) var(--ease-out), visibility var(--duration-fast);
  z-index: 2;
}
.menu-category-anchor:hover > .menu-flyout,
.menu-category-anchor:focus-within > .menu-flyout {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.menu-flyout-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: max-content;
  max-width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: var(--radius-control);
  font-size: 13px;
  cursor: pointer;
  color: var(--fg);
}
.menu-flyout-item:hover:not(:disabled) { background: var(--surface-hover); }
.menu-flyout-item:disabled { opacity: .45; cursor: not-allowed; }
.menu-flyout-item.danger { color: var(--danger); }
.menu-flyout-item.danger:hover:not(:disabled) { background: var(--danger-soft); }
.menu-flyout-label { font-weight: var(--weight-medium); }
.menu-flyout-hint {
  font-size: 11px;
  color: var(--fg-subtle);
  font-weight: 400;
  white-space: normal;
  text-align: left;
}

.menu-hub-modal {
  width: min(380px, 92vw);
}
.menu-hub-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 4px !important;
}
.menu-hub-item {
  display: flex;
  width: 100%;
  align-items: center;
  text-align: left;
  padding: 10px 12px;
  border: var(--border-width) solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--surface);
  cursor: pointer;
  color: var(--fg);
  transition: border-color var(--duration-fast), background var(--duration-fast);
}
.menu-hub-item:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}
.menu-hub-item:active:not(:disabled) {
  background: var(--surface-active);
}
.menu-hub-item.danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 25%, var(--border-subtle));
}
.menu-hub-item.danger:hover:not(:disabled) {
  background: var(--danger-soft);
}
.menu-hub-item:disabled {
  opacity: 0.55;
  cursor: default;
}
.menu-hub-item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.menu-hub-item-label {
  font-size: 13px;
  font-weight: var(--weight-medium);
}
.menu-hub-item-hint {
  font-size: 11px;
  color: var(--fg-subtle);
  font-weight: 400;
}

/* Appearance */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}
.theme-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  text-align: left;
  padding: 8px;
  min-width: 0;
  border: var(--border-width) solid var(--border-subtle);
  border-radius: var(--radius-card);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}
.theme-card:hover { background: var(--surface-hover); }
.theme-card:active { background: var(--surface-active); }
.theme-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px var(--accent);
}
.theme-card.active:hover { background: var(--accent-soft); }
.theme-swatch {
  width: 100%;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-tag);
}
.theme-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.theme-card strong {
  display: block;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: var(--weight-medium);
  color: var(--fg);
  line-height: 1.25;
  margin: 0;
  overflow-wrap: anywhere;
}
.theme-card .tagline { display: none; }

.tune-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.tune-field { min-width: 0; }
.tune-label {
  display: block;
  font-size: 12px;
  font-weight: var(--weight-medium);
  color: var(--fg-muted);
  margin-bottom: 6px;
}
.tune-grid .select,
.tune-grid .field {
  width: 100%;
}
.hex-field {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hex-swatch {
  width: 40px;
  height: 32px;
  flex-shrink: 0;
  padding: 3px;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.hex-swatch:hover { border-color: var(--border-strong); }
.hex-swatch:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hex-text {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.01em;
}
.radius-value {
  margin-left: 6px;
  font-family: var(--font-mono);
  font-weight: var(--weight-body);
  color: var(--fg-subtle);
  font-variant-numeric: tabular-nums;
}
.radius-slider {
  display: block;
  width: 100%;
  height: 32px;
  accent-color: var(--accent);
  cursor: pointer;
}
.radius-slider:hover { filter: brightness(1.05); }

input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  cursor: pointer;
}
.due-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.due-row:has(> input[type="checkbox"]) {
  cursor: pointer;
  padding: 4px 6px;
  margin: -4px -6px;
  border-radius: var(--radius-control);
}
.due-row:has(> input[type="checkbox"]):hover { background: var(--surface-hover); }

.theme-preview {
  border: var(--border-width) solid var(--border-subtle);
  border-radius: var(--radius-card);
  background: var(--surface);
  padding: 12px;
}
.preview-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.contrast-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.contrast-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--fg-muted);
}
.contrast-mark {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  border-radius: 50%;
}
.contrast-mark.ok { color: var(--support); }
.contrast-mark.fail { color: var(--danger); }
.contrast-ratio {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-subtle);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 560px) {
  .tune-grid { grid-template-columns: 1fr; }
  .rpg-badges { grid-template-columns: 1fr 1fr; }
  .char-picker { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .summary-hero-main { grid-template-columns: 1fr; }
  .summary-portrait--square { max-width: none; }
  .journey-stats { grid-template-columns: 1fr 1fr; }
}

/* Password gate */
.gate {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--canvas);
}
.gate-card {
  width: 360px;
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-panel);
  padding: 28px 24px;
  box-shadow: var(--shadow-modal);
}
.gate-card h1 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-bottom: 8px;
}
.gate-card p { color: var(--fg-muted); font-size: 13px; margin-bottom: 16px; }
.gate-card .field { width: 100%; margin-bottom: 12px; }

/* Custom dropdowns */
.dd {
  position: relative;
  min-width: 148px;
}
.issue-status-row > .dd {
  min-width: 0;
}
.tune-grid .dd { width: 100%; min-width: 0; }
.quick-add .dd {
  min-width: 0;
  width: auto;
}
.dd-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 34px;
  padding: 0 8px 0 10px;
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-control);
  font-size: 13px;
  color: var(--fg);
  cursor: pointer;
  text-align: left;
  transition:
    background var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}
.dd-trigger:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.dd-trigger:active { background: var(--surface-active); }
.dd.open .dd-trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.dd-label .label-compact { display: none; }
.dd-chevron {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  color: var(--fg-subtle);
  transition: transform var(--duration-fast) var(--ease-out);
}
.dd.open .dd-chevron { transform: rotate(180deg); color: var(--fg); }
.dd-panel {
  position: fixed;
  z-index: 80;
  min-width: 160px;
  max-height: min(280px, 50vh);
  overflow: auto;
  padding: 6px;
  background: var(--surface-raised);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-popover);
  animation: rise-in var(--duration-fast) var(--ease-out);
}
.dd-panel[hidden] { display: none; }
.dd-option {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  text-align: left;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: var(--radius-control);
  font-size: 13px;
  cursor: pointer;
  color: var(--fg);
  transition: background var(--duration-fast) var(--ease-out);
}
.dd-option:hover { background: var(--surface-hover); }
.dd-option:active { background: var(--surface-active); }
.dd-option.selected {
  background: var(--accent-soft);
  color: var(--fg);
  font-weight: var(--weight-medium);
}
.dd-option.selected:hover { background: var(--accent-soft); }
.dd-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
}

.date-picker {
  position: fixed;
  z-index: 120;
  width: 280px;
  max-height: none;
  padding: 0;
  overflow: hidden;
}
#card-editor .dd-panel {
  z-index: 120;
}
.date-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 10px 8px;
  border-bottom: var(--border-width) solid var(--border-subtle);
}
.date-picker-title {
  font-size: 13px;
  font-weight: var(--weight-medium);
  color: var(--fg);
}
.date-picker-nav {
  display: flex;
  gap: 2px;
}
.date-picker-nav .icon-btn {
  width: 28px;
  height: 28px;
}
.date-picker-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 8px 10px 4px;
  font-size: 10px;
  font-weight: var(--weight-medium);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  text-align: center;
}
.date-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 0 10px 8px;
}
.date-picker-day {
  width: 100%;
  aspect-ratio: 1;
  min-height: 32px;
  border: var(--border-width) solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  font-size: 12px;
  color: var(--fg);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out), border-color var(--duration-fast), color var(--duration-fast);
}
.date-picker-day:hover {
  background: var(--surface-hover);
  border-color: var(--border);
}
.date-picker-day.is-muted {
  color: var(--fg-subtle);
}
.date-picker-day.is-today {
  border-color: var(--accent);
  color: var(--accent);
}
.date-picker-day.is-selected {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--fg);
  font-weight: var(--weight-medium);
}
.date-picker-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 10px;
  border-top: var(--border-width) solid var(--border-subtle);
}
.date-picker-action {
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: var(--weight-medium);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-control);
}
.date-picker-action:hover {
  background: var(--accent-soft);
}
.date-picker-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 148px;
  justify-content: flex-start;
  cursor: pointer;
  text-align: left;
}
.date-picker-trigger svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--fg-subtle);
}

.hidden { display: none !important; }
.view-only .edit-only { display: none !important; }
.view-only .card { cursor: pointer; }

.menu-compact .menu-flyout { display: none; }

@media (max-width: 720px) {
  html { zoom: 1; }
  html, body { height: 100dvh; }
  body { overflow: hidden; }

  .app {
    height: 100dvh;
    padding-top: env(safe-area-inset-top);
  }

  .header {
    padding: 6px 10px;
    gap: 8px;
    min-height: 44px;
    flex-wrap: nowrap;
  }
  .nav-toggle { display: inline-flex !important; }
  .nav-collapse { display: none !important; }
  .app-nav {
    position: fixed;
    z-index: 40;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(280px, 86vw);
    padding-top: calc(12px + env(safe-area-inset-top));
    transform: translateX(-105%);
    transition: transform .22s var(--ease-out);
    box-shadow: var(--shadow-modal);
  }
  .app.nav-open .app-nav { transform: none; }
  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 39;
    background: var(--overlay);
  }
  .nav-backdrop[hidden] { display: none; }
  .header-actions {
    flex-wrap: nowrap;
    flex-shrink: 0;
    gap: 4px;
  }
  .logo-mark { width: 24px; height: 24px; }
  .board-path { font-size: 1rem; min-width: 0; }
  .board-product { font-size: 1rem; }
  .hero-chip {
    height: 36px;
    min-width: 0;
    max-width: none;
    padding: 0 8px 0 3px;
    gap: 6px;
  }
  .hero-chip-name,
  .hero-chip-sep { display: none; }
  .icon-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }

  .subhead {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 12px 0;
    gap: 2px;
  }
  .subhead::-webkit-scrollbar { display: none; }
  .view-tab {
    flex: 0 0 auto;
    height: 44px;
    padding: 0 12px;
  }
  .summary-kpis { grid-template-columns: 1fr 1fr; }
  .summary-charts,
  .summary-lists { grid-template-columns: 1fr; }
  .summary-card-wide { grid-column: auto; }
  .character-body { grid-template-columns: 1fr; }
  .character-main {
    height: auto;
    min-height: 0;
    max-height: min(52vh, 420px);
  }
  .character-preview .city-scene--walk {
    width: min(100%, 280px);
  }
  .character-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .character-tab { flex: none; }
  .character-panel .char-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .character-skin-detail {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .character-skin-detail .btn {
    grid-column: 1 / -1;
    width: 100%;
    justify-self: stretch;
  }

  .filters { padding: 6px 10px 8px; }
  .filter-main {
    flex-wrap: nowrap;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .filter-main::-webkit-scrollbar { display: none; }
  .filter-main .search {
    flex: 1 1 0;
    min-width: 72px;
    max-width: none;
    height: 36px;
    padding: 0 8px;
    gap: 6px;
  }
  .filter-main .search input::placeholder {
    font-size: 13px;
  }
  .filter-main .search input,
  .issue-title,
  input, textarea, select {
    font-size: 16px;
  }
  .filter-dd {
    flex: 0 0 auto;
    min-width: 0;
  }
  .filter-dd .dd-trigger {
    width: auto;
    max-width: 76px;
    height: 36px;
    min-height: 36px;
    padding: 0 8px;
    gap: 4px;
  }
  .filter-dd .dd-chevron { width: 10px; height: 10px; }
  .filter-dd .label-full { display: none; }
  .filter-dd .label-compact { display: inline; }
  .filter-main .btn.icon-only {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }

  .main {
    padding: 8px 12px calc(96px + env(safe-area-inset-bottom));
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .board {
    gap: 12px;
    min-height: calc(100% - 8px);
    padding-right: 8px;
  }
  .column {
    flex: 0 0 min(86vw, 340px);
    width: min(86vw, 340px);
    scroll-snap-align: start;
    scroll-snap-stop: always;
    max-height: 100%;
  }

  .create-card-fab {
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: var(--radius-control);
    justify-content: center;
    box-shadow: var(--shadow-popover);
  }
  .create-card-fab-label { display: none; }
  .create-card-fab svg { width: 22px; height: 22px; }

  .undo-toast {
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(80px + env(safe-area-inset-bottom));
  }
  .reward-toast {
    bottom: calc(88px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 24px);
    font-size: 13px;
  }
  .reward-toast.is-level-up {
    padding: 10px 12px;
    border-radius: 24px;
  }
  .reward-toast.is-level-up .reward-toast-inner {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 8px;
  }
  .reward-toast.is-level-up .reward-toast-chips {
    justify-content: center;
  }
  .reward-toast-sub {
    white-space: normal;
  }

  .overlay {
    padding: 8px;
    padding-top: max(8px, env(safe-area-inset-top));
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
  #card-editor {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
  }
  .issue-modal {
    max-width: 100%;
    max-height: calc(100dvh / var(--ui-scale, 1));
    height: calc(100dvh / var(--ui-scale, 1));
    width: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  .issue-top { padding: 10px 14px 6px; }
  .issue-top-actions .icon-btn { width: 44px; height: 44px; }
  .issue-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    overflow: auto;
    padding: 0;
    gap: 0;
  }
  .issue-body .issue-main,
  .issue-body .issue-side {
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .issue-main { padding: 4px 14px 16px; }
  .issue-side {
    border-left: none;
    border-top: var(--border-width) solid var(--border-subtle);
    padding: 14px 14px 16px;
  }

  .modal {
    max-width: calc(100vw - 16px);
    max-height: min(92dvh, 100%);
  }
  .menu-hub-modal { width: min(100%, 420px); }
  .profile-modal {
    width: min(100%, calc(88dvh * 2));
    max-width: min(100%, calc(88dvh * 2));
    max-height: min(88dvh, 100%);
    aspect-ratio: 2 / 1;
    grid-template-columns: 1fr 1fr;
  }
  .profile-portrait { padding: 8px; }
  .profile-sheet {
    padding: 24px 28px 14px 10px;
    gap: 8px;
  }
  .city-scene--wide {
    --scene-h: 156px;
    --ground-h: 34px;
  }
  .city-scene--hero {
    --scene-h: 104px;
    --ground-h: 26px;
  }
  .menu-hub-item { min-height: 48px; padding: 12px 14px; }

  .rt-btn {
    width: 40px;
    height: 40px;
  }
  .rt-toolbar { gap: 4px; padding: 6px; }
  .subtask-add .field,
  .subtask-input-wrap .field,
  #subtask-details {
    height: 44px;
    min-height: 44px;
  }
  .comment-rt-wrap { min-height: 44px; }
  .comment-rt-wrap:not(.is-active) { height: 44px; }
  .comment-field-shell { min-height: calc(44px - 2 * var(--border-width)); }
  .comment-send-btn { width: 32px; height: 32px; min-width: 32px; min-height: 32px; }

  .calendar-wrap { grid-template-columns: 1fr; overflow-x: auto; }
  .cal-grid { min-width: 560px; }
  .cal-cell { min-height: 72px; }
  .checkin-card { padding: 10px 10px 8px; gap: 8px; }
  .checkin-card-icon { width: 30px; height: 30px; }
  .checkin-card-title { font-size: 11px; }
  .checkin-card-sub { font-size: 10px; }
  .checkin-card-status { font-size: 10px; padding: 4px 8px; }
  .checkin-day-card { min-height: 62px; padding: 4px 2px; border-radius: 10px; }
  .checkin-day-gold { font-size: 11px; }
  .checkin-day-label { font-size: 8px; }
  .checkin-coin { width: 14px; height: 14px; }

  .gate-card { width: min(360px, calc(100vw - 24px)); }
}

@media (hover: none) and (pointer: coarse) {
  .icon-btn { min-width: 44px; min-height: 44px; }
  .btn { min-height: 44px; }
  .dd-trigger { min-height: 44px; }
  .rt-btn { width: 40px; height: 40px; }
  .rt-img-handle {
    width: 22px;
    height: 22px;
    opacity: 1;
    right: 6px;
    bottom: 6px;
    touch-action: none;
  }
  .rt-img-remove {
    width: 28px;
    height: 28px;
    opacity: 1;
    top: 6px;
    right: 6px;
  }
  .menu button,
  .menu-flyout-item,
  .menu-hub-item {
    min-height: 44px;
  }
}
