/* Chrome 400 — themes: original (chrome silver on near-black), dark (blue), light */

:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  /* Set from JS once the offline banner is shown; 0 while hidden. */
  --banner-h: 0px;
  --font-display: "Avenir Next Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
}

html[data-theme="original"] {
  --bg: #0B0D10;
  --panel: #14181D;
  --panel-alt: #1B2128;
  --ink: #EEF1F4;
  --ink-soft: #A3ADB8;
  --accent: #C7CFD8;
  --accent-deep: #7D8793;
  --border: #2A313A;
  --danger: #E0614D;
  --success: #5FBF8A;
  --chip-active-ink: #0B0D10;
  --head-bg: linear-gradient(180deg, #E9EDF2 0%, #AEB7C2 48%, #7B8591 100%);
  --head-ink: #0B0D10;
  --head-ink-soft: #2B333C;
  --head-btn: rgba(255, 255, 255, 0.45);
  --head-btn-border: rgba(11, 13, 16, 0.35);
}

html[data-theme="dark"] {
  --bg: #101216;
  --panel: #181B21;
  --panel-alt: #1E222A;
  --ink: #E7E9ED;
  --ink-soft: #9AA1AC;
  --accent: #7FB2E5;
  --accent-deep: #4E80AE;
  --border: #2A2E37;
  --danger: #E06C5B;
  --success: #6FBE7A;
  --chip-active-ink: #101216;
  --head-bg: linear-gradient(180deg, #232A36 0%, #181B21 100%);
  --head-ink: #E7E9ED;
  --head-ink-soft: #9AA1AC;
  --head-btn: #1E222A;
  --head-btn-border: #2A2E37;
}

html[data-theme="light"] {
  --bg: #EDF0F3;
  --panel: #FFFFFF;
  --panel-alt: #E3E8ED;
  --ink: #14181D;
  --ink-soft: #55606C;
  --accent: #46525F;
  --accent-deep: #6E7B89;
  --border: #CBD2DA;
  --danger: #B23B27;
  --success: #2F7D4F;
  --chip-active-ink: #FFFFFF;
  --head-bg: linear-gradient(180deg, #FAFBFC 0%, #C8D0D8 100%);
  --head-ink: #14181D;
  --head-ink-soft: #3A444F;
  --head-btn: rgba(255, 255, 255, 0.7);
  --head-btn-border: rgba(20, 24, 29, 0.25);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

body.has-overlay {
  overflow: hidden;
  position: fixed;
  left: 0;
  width: 100%;
}

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

button {
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled {
  opacity: 0.5;
  cursor: default;
}

.screen[hidden] { display: none !important; }

/* ---------- PIN screen ---------- */

#pin-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--safe-top) + 24px) calc(var(--safe-right) + 20px)
           calc(var(--safe-bottom) + 24px) calc(var(--safe-left) + 20px);
}

.pin-card {
  width: 100%;
  max-width: 360px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
}

.pin-card h1 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.pin-sub {
  margin: 0 0 20px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

#pin-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#pin-input, #pin-dialog-input {
  font-size: 1.4rem;
  letter-spacing: 0.3em;
  text-align: center;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-alt);
  color: var(--ink);
  min-height: 52px;
  width: 100%;
}

#pin-submit {
  min-height: 48px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: var(--chip-active-ink);
  font-weight: 700;
  font-size: 1rem;
}

.pin-error {
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 0.9rem;
}

/* ---------- App shell ---------- */

#app {
  padding-bottom: calc(var(--safe-bottom) + 24px);
}

.app-column {
  max-width: 880px;
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--head-bg);
  color: var(--head-ink);
  padding: calc(var(--safe-top) + 12px) calc(var(--safe-right) + 16px) 10px
            calc(var(--safe-left) + 16px);
  border-bottom: 1px solid var(--border);
}

body.is-offline #app {
  padding-top: var(--banner-h);
}

body.is-offline .topbar {
  top: var(--banner-h);
  padding-top: 12px;
}

.topbar-row {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  grid-template-areas: "spacer title actions";
  align-items: center;
  gap: 8px;
}

.topbar-spacer { grid-area: spacer; }

.topbar-title {
  grid-area: title;
  text-align: center;
  min-width: 0;
}

.topbar-title h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--head-ink);
  line-height: 1.1;
}

.topbar-subtitle {
  margin: 2px 0 0;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  color: var(--head-ink-soft);
}

.topbar-actions {
  grid-area: actions;
  justify-self: end;
  display: flex;
  gap: 6px;
}

.share-topbar {
  padding-bottom: 12px;
}

.icon-btn {
  min-width: 44px;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--ink);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar .icon-btn {
  background: var(--head-btn);
  border-color: var(--head-btn-border);
  color: var(--head-ink);
}

/* ---------- bars / dashboard ---------- */

.progress-track {
  height: 8px;
  border-radius: 8px;
  background: var(--panel-alt);
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  transition: width 0.3s ease;
}

.dashboard {
  padding: 16px 16px 4px;
}

.dash-progress-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 10px;
}

.dash-label {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.dash-figure {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.stat-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.stat-tile {
  flex: 1 1 calc(16.666% - 8px);
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 10px 6px;
  text-align: center;
}

@media (max-width: 560px) {
  .stat-tile {
    flex: 1 1 calc(33.333% - 8px);
  }
}

.stat-number {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.1;
}

.stat-label {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.7rem;
  color: var(--ink-soft);
  margin-top: 4px;
}

.stat-sub {
  font-size: 0.7rem;
  color: var(--ink-soft);
  opacity: 0.85;
  margin-top: 2px;
}

/* ---------- search / tabs ---------- */

.filters {
  padding: 14px 16px 0;
  display: flex;
  flex-direction: column;
}

#search-input {
  min-height: 44px;
  width: 100%;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-alt);
  color: var(--ink);
  padding: 0 16px;
  font-size: 1rem;
}

.views {
  display: flex;
  gap: 6px;
  padding: 12px 16px 0;
  overflow-x: auto;
}

.view-btn {
  flex: 1 1 0;
  min-height: 44px;
  padding: 0 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--ink-soft);
  font-size: 0.82rem;
  white-space: nowrap;
}

.view-btn.active {
  background: var(--accent);
  color: var(--chip-active-ink);
  border-color: var(--accent);
  font-weight: 700;
}

.tab-content {
  padding: 12px 12px 0;
}

.empty-note {
  margin: 24px 12px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.section-heading {
  margin: 16px 4px 8px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---------- team sections ---------- */

.team-section {
  margin-bottom: 8px;
}

.team-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 6px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  font-size: 0.98rem;
}

.team-head .team-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-head .team-count {
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.team-head .team-count.done {
  color: var(--success);
  font-weight: 700;
}

.team-head .chev {
  color: var(--ink-soft);
  width: 14px;
  text-align: center;
}

.team-stripe {
  width: 10px;
  height: 28px;
  border-radius: 4px;
  flex: 0 0 10px;
  background: var(--accent-deep);
}

.card-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 6px 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  touch-action: manipulation;
  cursor: pointer;
}

.card-row.owned {
  border-color: var(--accent-deep);
}

.card-row:focus-visible, .team-head:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Display-only check mark (a span, never a button). */
.check {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 6px;
  border: 1.5px solid var(--ink-soft);
  background: var(--panel-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  line-height: 1;
}

.check.checked {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--chip-active-ink);
  font-weight: 800;
}

.card-row .num {
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  font-size: 0.85rem;
  min-width: 34px;
}

.card-row .dot, .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 10px;
  background: var(--accent-deep);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.card-row .info {
  flex: 1;
  min-width: 0;
}

.card-row .name {
  font-size: 0.95rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-row .ver {
  font-size: 0.74rem;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rc-badge {
  flex: 0 0 auto;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 5px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--chip-active-ink);
}

.times-badge {
  flex: 0 0 auto;
  min-width: 28px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--accent-deep);
  color: var(--accent);
}

@media (max-width: 400px) {
  .card-row {
    gap: 6px;
    padding: 6px 8px;
  }
  .card-row .num {
    min-width: 30px;
  }
  .card-row .name {
    font-size: 0.9rem;
  }
}

/* ---------- card page (full-screen sheet) ---------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-end;
  z-index: 20;
}

.overlay[hidden] { display: none !important; }

.overlay.sheet {
  align-items: stretch;
  justify-content: center;
  background: var(--bg);
  z-index: 15;
}

.sheet-panel {
  width: 100%;
  max-width: 880px;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: calc(var(--safe-top) + 8px) calc(var(--safe-right) + 14px)
           calc(var(--safe-bottom) + 24px) calc(var(--safe-left) + 14px);
}

.sheet-bar {
  display: flex;
  align-items: center;
  min-height: 52px;
}

.back-btn {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--ink);
  font-size: 0.95rem;
}

.sheet-body {
  padding-top: 4px;
}

.cp-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.cp-head .cp-titles {
  flex: 1;
  min-width: 0;
}

.cp-num {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.cp-title {
  margin: 2px 0 6px;
  font-family: var(--font-display);
  font-size: 1.8rem;
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.cp-team {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--ink-soft);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.star-btn {
  flex: 0 0 auto;
  min-width: 48px;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--ink-soft);
  font-size: 1.5rem;
  line-height: 1;
}

.star-btn.on {
  color: #F4C542;
  border-color: #F4C542;
}

.shop-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 6px;
}

.shop-btn {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--ink);
  font-size: 0.9rem;
  text-decoration: none;
  text-align: center;
}

.shop-btn:hover, .shop-btn:focus-visible {
  border-color: var(--accent);
}

.copy-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.copy-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
}

.copy-item.is-keeper {
  border-color: #F4C542;
}

.copy-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  overflow-wrap: anywhere;
}

.copy-version {
  font-weight: 700;
  font-size: 1rem;
}

.copy-serial {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.copy-hit {
  font-size: 0.85rem;
}

.copy-tag {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--accent-deep);
  color: var(--ink-soft);
}

.copy-tag.keep {
  color: #F4C542;
  border-color: #F4C542;
}

.copy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.mini-btn {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-alt);
  color: var(--ink);
  font-size: 0.88rem;
}

.mini-btn.keeper-on {
  color: #F4C542;
  border-color: #F4C542;
}

.mini-btn.danger {
  color: var(--danger);
  border-color: var(--danger);
}

.big-add-btn {
  width: 100%;
  min-height: 52px;
  margin-top: 14px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: var(--chip-active-ink);
  font-size: 1.05rem;
  font-weight: 800;
}

.cp-empty {
  color: var(--ink-soft);
  margin: 10px 2px 0;
  font-size: 0.95rem;
}

/* ---------- overlays / modals ---------- */

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.drawer-head h2 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--accent);
}

.overlay.modal {
  align-items: center;
  justify-content: center;
  padding: calc(var(--safe-top) + 16px) calc(var(--safe-right) + 14px)
           calc(var(--safe-bottom) + 16px) calc(var(--safe-left) + 14px);
  z-index: 25;
}

.overlay.picker {
  z-index: 30;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  max-height: 88vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
}

.picker-sub {
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.picker-group-label {
  margin: 12px 0 6px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.ver-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ver-btn {
  min-height: 44px;
  max-width: 100%;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-alt);
  color: var(--ink);
  font-size: 0.88rem;
  text-align: center;
  overflow-wrap: anywhere;
}

.ver-btn.selected {
  background: var(--accent);
  color: var(--chip-active-ink);
  border-color: var(--accent);
  font-weight: 700;
}

.more-btn {
  margin-top: 10px;
  min-height: 44px;
  width: 100%;
  border-radius: 10px;
  border: 1px dashed var(--accent-deep);
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.picker-other, .picker-fields {
  margin-top: 12px;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.field-note {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.picker-other input, .picker-fields input[type="text"], .share-url {
  width: 100%;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-alt);
  color: var(--ink);
  padding: 0 12px;
  font-size: 1rem;
}

.share-url {
  margin: 8px 0;
  font-size: 0.78rem;
}

.menu-select {
  width: 100%;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-alt);
  color: var(--ink);
  padding: 0 10px;
  font-size: 0.95rem;
}

.summary-percent {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--accent);
  text-align: center;
  line-height: 1.1;
}

.summary-count {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin: 2px 0 16px;
}

.summary-progress-track {
  margin-bottom: 18px;
}

.summary-totals {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.summary-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.summary-total-row span:last-child {
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.summary-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.summary-actions .secondary-btn {
  flex: 1;
}

.secondary-btn {
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--ink);
  font-size: 0.92rem;
}

.primary-btn {
  background: var(--accent);
  color: var(--chip-active-ink);
  border-color: var(--accent);
  font-weight: 700;
}

.danger-btn {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
  font-weight: 700;
}

/* ---------- banner / toast ---------- */

.banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--danger);
  color: #fff;
  text-align: center;
  font-size: 0.85rem;
  padding: calc(var(--safe-top) + 8px) 12px 8px;
}

.banner[hidden] { display: none !important; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 20px);
  transform: translateX(-50%);
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--accent);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.88rem;
  z-index: 60;
  max-width: 88vw;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.toast[hidden] { display: none !important; }

/* ---------- hamburger menu drawer ---------- */

.overlay.side-drawer {
  align-items: stretch;
  justify-content: flex-end;
  z-index: 40;
}

.side-drawer-panel {
  width: 320px;
  max-width: 88vw;
  height: 100%;
  background: var(--panel);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.35);
  padding: calc(var(--safe-top) + 16px) calc(var(--safe-right) + 16px)
           calc(var(--safe-bottom) + 16px) 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.menu-section {
  margin: 14px 0;
}

.menu-section-heading {
  margin: 0 0 10px;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
}

.menu-section-heading-danger {
  color: var(--danger);
}

.menu-divider {
  height: 1px;
  background: var(--border);
  margin: 14px 0;
}

.menu-item-btn {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  text-align: left;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-alt);
  color: var(--ink);
  font-size: 0.92rem;
  margin-bottom: 8px;
  text-decoration: none;
}

.menu-item-btn:last-child {
  margin-bottom: 0;
}

.menu-item-danger {
  border-color: var(--danger);
  color: var(--danger);
}

.menu-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  gap: 10px;
  margin-top: 6px;
}

.menu-toggle-label {
  font-size: 0.92rem;
  color: var(--ink);
}

.switch-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  flex-shrink: 0;
}

.switch-toggle-track {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-alt);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.switch-toggle[aria-checked="true"] .switch-toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}

.switch-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ink-soft);
  transition: transform 0.15s ease;
}

.switch-toggle[aria-checked="true"] .switch-toggle-knob {
  transform: translateX(20px);
  background: var(--bg);
}

.theme-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.theme-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-alt);
  color: var(--ink);
  font-size: 0.8rem;
}

.theme-tile.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
  font-weight: 700;
}

.theme-tile-swatch {
  width: 100%;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.theme-tile-swatch-original {
  background: linear-gradient(135deg, #0B0D10 50%, #C7CFD8 50%);
}

.theme-tile-swatch-dark {
  background: linear-gradient(135deg, #101216 50%, #7FB2E5 50%);
}

.theme-tile-swatch-light {
  background: linear-gradient(135deg, #EDF0F3 50%, #46525F 50%);
}

.reset-warning {
  margin: 4px 0 16px;
  font-size: 0.88rem;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

#pin-dialog-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ---------- special cards (R15) ---------- */

.specials .big-add-btn {
  margin: 0 0 12px;
}

.special-row .rc-badge {
  min-width: 34px;
  text-align: center;
}
