/* Multiport Counter — Liquid Glass UI
   -apple-system renders real SF Pro on Apple devices. Apple does not
   license SF Pro for redistribution, so on every other platform this
   falls back to the self-hosted Inter variable font (SIL OFL, see
   assets/fonts/OFL.txt) — metrically close to SF Pro so the app still
   reads as one consistent typeface everywhere. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/Inter-latin.woff2") format("woff2-variations"),
       url("../assets/fonts/Inter-latin.woff2") format("woff2");
}

:root {
  --font-system: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;

  /* Counter palette (independent of the customizable accent below) */
  --blue: #007AFF;
  --red: #FF3B30;
  --green: #34C759;
  --orange: #FF9500;
  --yellow: #FFCC00;
  --purple: #AF52DE;
  --pink: #FF2D55;
  --teal: #5AC8FA;
  --indigo: #5856D6;

  /* Customizable accent — set inline on :root by js/app.js */
  --accent: #0A84FF;
  --accent-rgb: 10, 132, 255;

  --text-primary: #000000;
  --text-secondary: rgba(60, 60, 67, 0.6);
  --separator: rgba(60, 60, 67, 0.22);

  /* Glass material tokens */
  --glass-panel-bg: rgba(255, 255, 255, 0.55);
  --glass-panel-blur: 44px;
  --glass-card-bg: rgba(255, 255, 255, 0.48);
  --glass-card-blur: 26px;
  --glass-control-bg: rgba(255, 255, 255, 0.4);
  --glass-control-blur: 16px;
  --glass-border: rgba(255, 255, 255, 0.55);
  --glass-border-soft: rgba(255, 255, 255, 0.3);
  --glass-highlight: rgba(255, 255, 255, 0.65);
  --glass-shadow: 0 8px 32px rgba(31, 38, 45, 0.14), 0 1px 2px rgba(31, 38, 45, 0.06);
  --sheet-bg: rgba(255, 255, 255, 0.72);

  --page-bg: #D8D8DE;

  /* Fine grain, layered onto glass surfaces so they read as frosted
     material rather than a flat blurred rectangle. */
  --grain: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: #FFFFFF;
    --text-secondary: rgba(235, 235, 245, 0.6);
    --separator: rgba(120, 120, 128, 0.4);

    --glass-panel-bg: rgba(28, 28, 32, 0.5);
    --glass-card-bg: rgba(255, 255, 255, 0.08);
    --glass-control-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.16);
    --glass-border-soft: rgba(255, 255, 255, 0.1);
    --glass-highlight: rgba(255, 255, 255, 0.18);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.3);
    --sheet-bg: rgba(22, 22, 26, 0.75);

    --page-bg: #000000;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  margin: 0;
  color: var(--text-primary);
  font-family: var(--font-system);
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Wallpaper (shows through every glass layer) ---------- */
body { background: var(--page-bg); }
body[data-wallpaper="aurora"]  { background: linear-gradient(135deg, #6B73FF 0%, #8E7BFF 30%, #63C9E8 65%, #7BE0C4 100%); }
body[data-wallpaper="sunset"]  { background: linear-gradient(135deg, #FF7A6E 0%, #FFA65C 45%, #FFD36E 75%, #FF9AC6 100%); }
body[data-wallpaper="ocean"]   { background: linear-gradient(135deg, #0F6FBF 0%, #1FA2C9 40%, #3FD0D4 75%, #8CE6D0 100%); }
body[data-wallpaper="candy"]   { background: linear-gradient(135deg, #F6A6C1 0%, #F7C6D9 35%, #C6B8F7 70%, #A6D8F7 100%); }
body[data-wallpaper="midnight"]{ background: linear-gradient(135deg, #0B1220 0%, #1B2A4A 40%, #33436E 70%, #4A5A8A 100%); }

/* The app always fills the full viewport, at every screen size — no
   centered "phone card" shrinking on wider windows. Inner content
   (nav bar, list, sheets) gets its own max-width further down so text
   doesn't stretch to unreadable widths on very wide screens, but the
   glass background, orbs, and FAB always span the whole window. */
.app-shell {
  display: flex;
  justify-content: center;
  align-items: stretch;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

#app {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: transparent;
  overflow: hidden;
  isolation: isolate;
}

/* Floating blurred color blobs behind the glass — gives the wallpaper
   depth and movement instead of a flat static gradient, so the glass
   panels have something rich to refract. */
.bg-orbs {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}
.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
}
.bg-orb.orb1 {
  width: 60vw; max-width: 300px; height: 60vw; max-height: 300px;
  top: -8%; left: -15%;
  background: color-mix(in srgb, var(--accent) 75%, transparent);
  animation: orbDrift1 24s ease-in-out infinite alternate;
}
.bg-orb.orb2 {
  width: 55vw; max-width: 260px; height: 55vw; max-height: 260px;
  bottom: 12%; right: -18%;
  background: rgba(255, 255, 255, 0.5);
  animation: orbDrift2 28s ease-in-out infinite alternate;
}
.bg-orb.orb3 {
  width: 50vw; max-width: 240px; height: 50vw; max-height: 240px;
  bottom: -10%; left: 18%;
  background: color-mix(in srgb, var(--accent) 40%, white 25%);
  animation: orbDrift3 32s ease-in-out infinite alternate;
}
@media (prefers-color-scheme: dark) {
  .bg-orb.orb2 { background: rgba(255, 255, 255, 0.14); }
  .bg-orb.orb3 { background: color-mix(in srgb, var(--accent) 55%, transparent); }
}
@keyframes orbDrift1 { from { transform: translate(0, 0) scale(1); } to { transform: translate(6%, 8%) scale(1.12); } }
@keyframes orbDrift2 { from { transform: translate(0, 0) scale(1); } to { transform: translate(-8%, -6%) scale(1.08); } }
@keyframes orbDrift3 { from { transform: translate(0, 0) scale(1); } to { transform: translate(5%, -10%) scale(1.15); } }
@media (prefers-reduced-motion: reduce) {
  .bg-orb { animation: none; }
}

.app-scroll {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(104px + env(safe-area-inset-bottom));
}

/* Inner content stays a comfortable reading width and centers itself;
   the app frame around it (background, orbs) still spans edge to edge. */
.navbar-pill,
.large-title-row,
.counter-list,
.empty-state {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* Accessibility / performance: turns every glass surface into a solid
   opaque panel. Mirrors Apple's real "Reduce Transparency" setting. */
#app.no-glass .navbar-pill,
#app.no-glass .counter-card,
#app.no-glass .sheet,
#app.no-glass .fab,
#app.no-glass .stepper-btn,
#app.no-glass .step-chip,
#app.no-glass .text-field,
#app.no-glass .sheet-action-btn,
#app.no-glass .sheet-cancel-btn,
#app.no-glass .sheet-delete-btn,
#app.no-glass .icon-badge,
#app.no-glass .wallpaper-swatch {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
#app.no-glass .navbar-pill { background: var(--bg-solid, #F2F2F7); }
#app.no-glass .counter-card { background: var(--bg-solid, #F2F2F7); }
#app.no-glass .sheet { background: var(--bg-solid, #F2F2F7); }
@media (prefers-color-scheme: dark) {
  #app.no-glass .navbar-pill,
  #app.no-glass .counter-card,
  #app.no-glass .sheet { background: #1C1C1E; }
}
/* ---------- Nav Bar (floating glass pill) ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: calc(env(safe-area-inset-top) + 10px) 12px 6px;
}

.navbar-pill {
  position: relative;
  overflow: hidden;
  background: var(--glass-panel-bg);
  -webkit-backdrop-filter: saturate(180%) blur(var(--glass-panel-blur));
  backdrop-filter: saturate(180%) blur(var(--glass-panel-blur));
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight);
}

/* Fine grain overlay: makes the glass read as frosted material, not a
   flat blurred rectangle. Skipped entirely in Reduce Transparency. */
.navbar-pill::after,
.counter-card::after,
.fab::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--grain);
  opacity: 0.05;
  mix-blend-mode: overlay;
  pointer-events: none;
  border-radius: inherit;
}
#app.no-glass .navbar-pill::after,
#app.no-glass .counter-card::after,
#app.no-glass .fab::after {
  display: none;
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 46px;
  padding: 0 6px 0 14px;
}

.navbar-title {
  font-size: 17px;
  font-weight: 600;
  margin: 0;
}

.large-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  margin-bottom: 12px;
  padding: 0 20px 0 8px;
  box-sizing: border-box;
}

.brand-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.navbar-large-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.06);
}

.nav-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 17px;
  font-family: var(--font-system);
  padding: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-btn:active { opacity: 0.4; }
.nav-btn .icon { width: 22px; height: 22px; fill: var(--accent); }

/* ---------- Counter List ---------- */
.counter-list {
  padding: 0 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
}

.counter-card {
  position: relative;
  background: var(--glass-card-bg);
  border: 1px solid var(--glass-border-soft);
  border-radius: 22px;
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight);
  overflow: hidden;
  transform: translateX(0);
  transition: transform 0.25s cubic-bezier(.25,.9,.35,1);
  touch-action: pan-y;
  animation: cardIn 0.35s ease backwards;
  animation-delay: calc(var(--card-index, 0) * 45ms);
}

/* Opacity-only: a transform here (translate/scale) fights the sticky
   nav bar's layout in Chromium and can leave it stuck off-screen. */
@keyframes cardIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .counter-card { animation: none; }
}

.counter-card.swiped { transform: translateX(-88px); }

.counter-card-content {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  gap: 14px;
  -webkit-backdrop-filter: saturate(180%) blur(var(--glass-card-blur));
  backdrop-filter: saturate(180%) blur(var(--glass-card-blur));
  position: relative;
  z-index: 1;
}

.counter-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  background: color-mix(in srgb, var(--badge-color, var(--accent)) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--badge-color, var(--accent)) 35%, transparent);
}

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

.counter-name {
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.counter-step {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.counter-count {
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 64px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: transform 0.12s ease;
}

.counter-count.pulse { transform: scale(1.18); }
.counter-count.negative { color: var(--red); }

.counter-controls {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.stepper-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--glass-border-soft);
  background: var(--glass-control-bg);
  -webkit-backdrop-filter: blur(var(--glass-control-blur));
  backdrop-filter: blur(var(--glass-control-blur));
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease;
  box-shadow: inset 0 1px 0 var(--glass-highlight);
}
.stepper-btn:active { transform: scale(0.88); }
.stepper-btn.plus {
  background: color-mix(in srgb, var(--counter-color, var(--accent)) 24%, var(--glass-control-bg));
  border-color: color-mix(in srgb, var(--counter-color, var(--accent)) 45%, transparent);
  color: var(--counter-color, var(--accent));
}

.counter-swipe-delete {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 88px;
  background: var(--red);
  color: #fff;
  border: none;
  font-size: 15px;
  font-weight: 600;
  z-index: 0;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
/* Glass card content is translucent, so the delete button must stay
   fully hidden until the swipe actually uncovers it — otherwise its
   red bleeds through the frosted content at rest. */
.counter-card.swiped .counter-swipe-delete,
.counter-card.dragging .counter-swipe-delete {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- Empty state ---------- */
.empty-state {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 80px 32px 0;
  color: var(--text-secondary);
}
.empty-state.visible { display: flex; }
.empty-icon-badge {
  width: 84px;
  height: 84px;
  border-radius: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  background: color-mix(in srgb, var(--accent) 20%, var(--glass-control-bg));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  -webkit-backdrop-filter: blur(var(--glass-control-blur));
  backdrop-filter: blur(var(--glass-control-blur));
  box-shadow: 0 8px 24px -6px rgba(var(--accent-rgb), 0.35), inset 0 1px 0 var(--glass-highlight);
}
.empty-icon {
  font-size: 34px;
  color: var(--accent);
  line-height: 1;
}
.empty-title {
  font-size: 19px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px;
}
.empty-sub { font-size: 15px; margin: 0; max-width: 260px; }

/* ---------- FAB (glass orb with specular highlight) ---------- */
.fab {
  position: absolute;
  overflow: hidden;
  right: 24px;
  bottom: calc(28px + env(safe-area-inset-bottom));
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0) 42%),
    color-mix(in srgb, var(--accent) 82%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 10px 28px -4px rgba(var(--accent-rgb), 0.55), inset 0 1px 1px rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s ease;
  z-index: 20;
  animation: fabGlow 3.5s ease-in-out infinite;
}
.fab:active { transform: scale(0.9); }
.fab .icon { width: 26px; height: 26px; position: relative; z-index: 1; }

@keyframes fabGlow {
  0%, 100% { box-shadow: 0 10px 28px -4px rgba(var(--accent-rgb), 0.55), inset 0 1px 1px rgba(255,255,255,0.6); }
  50% { box-shadow: 0 10px 34px -2px rgba(var(--accent-rgb), 0.8), inset 0 1px 1px rgba(255,255,255,0.6); }
}
@media (prefers-reduced-motion: reduce) {
  .fab { animation: none; }
}

.footer-credit {
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  margin: 28px 0 8px;
  letter-spacing: 0.01em;
}

/* ---------- Sheets (glass modal bottom sheets) ---------- */
.sheet-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.sheet {
  width: 100%;
  max-width: 560px;
  background: var(--sheet-bg);
  -webkit-backdrop-filter: saturate(180%) blur(var(--glass-panel-blur));
  backdrop-filter: saturate(180%) blur(var(--glass-panel-blur));
  border: 1px solid var(--glass-border);
  border-bottom: none;
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.18), inset 0 1px 0 var(--glass-highlight);
  padding: 10px 20px calc(28px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(.32,.72,.35,1);
  max-height: 88vh;
  overflow-y: auto;
}
.sheet-overlay.open .sheet { transform: translateY(0); }

.sheet-grabber {
  width: 36px;
  height: 5px;
  border-radius: 3px;
  background: var(--separator);
  margin: 6px auto 14px;
}

.sheet-title {
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 18px;
}

.text-field {
  width: 100%;
  font-family: var(--font-system);
  font-size: 17px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--glass-border-soft);
  background: var(--glass-control-bg);
  -webkit-backdrop-filter: blur(var(--glass-control-blur));
  backdrop-filter: blur(var(--glass-control-blur));
  color: var(--text-primary);
  margin-bottom: 18px;
}
.text-field:focus { outline: 2px solid var(--accent); }

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.step-picker {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.step-chip {
  flex: 1;
  padding: 10px 0;
  border-radius: 14px;
  border: 1px solid var(--glass-border-soft);
  background: var(--glass-control-bg);
  -webkit-backdrop-filter: blur(var(--glass-control-blur));
  backdrop-filter: blur(var(--glass-control-blur));
  font-family: var(--font-system);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}
.step-chip.selected {
  background: color-mix(in srgb, var(--accent) 85%, transparent);
  border-color: var(--accent);
  color: #fff;
}

.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}
.color-swatch-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.5);
  cursor: pointer;
  position: relative;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.5);
}
.color-swatch-btn.selected::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--text-primary);
}

.icon-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}
.icon-swatch-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--glass-border-soft);
  background: var(--glass-control-bg);
  -webkit-backdrop-filter: blur(var(--glass-control-blur));
  backdrop-filter: blur(var(--glass-control-blur));
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.icon-swatch-btn.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 50%, transparent);
}
.icon-swatch-btn.none-option { font-size: 13px; font-weight: 600; color: var(--text-secondary); }

.wallpaper-picker {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.wallpaper-swatch {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--glass-border-soft);
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
}
.wallpaper-swatch[data-wallpaper="mono"] { background: linear-gradient(135deg, #E4E4E9, #B9B9C2); }
.wallpaper-swatch[data-wallpaper="aurora"] { background: linear-gradient(135deg, #6B73FF 0%, #8E7BFF 30%, #63C9E8 65%, #7BE0C4 100%); }
.wallpaper-swatch[data-wallpaper="sunset"] { background: linear-gradient(135deg, #FF7A6E 0%, #FFA65C 45%, #FFD36E 75%, #FF9AC6 100%); }
.wallpaper-swatch[data-wallpaper="ocean"] { background: linear-gradient(135deg, #0F6FBF 0%, #1FA2C9 40%, #3FD0D4 75%, #8CE6D0 100%); }
.wallpaper-swatch[data-wallpaper="candy"] { background: linear-gradient(135deg, #F6A6C1 0%, #F7C6D9 35%, #C6B8F7 70%, #A6D8F7 100%); }
.wallpaper-swatch[data-wallpaper="midnight"] { background: linear-gradient(135deg, #0B1220 0%, #1B2A4A 40%, #33436E 70%, #4A5A8A 100%); }
.wallpaper-swatch.selected::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 16px;
  border: 2px solid var(--text-primary);
}

.sheet-save-btn {
  width: 100%;
  padding: 14px 0;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.4);
  background: color-mix(in srgb, var(--accent) 88%, transparent);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  font-family: var(--font-system);
  cursor: pointer;
  margin-top: 4px;
  box-shadow: 0 6px 20px -4px rgba(var(--accent-rgb), 0.5), inset 0 1px 0 rgba(255,255,255,0.4);
}
.sheet-save-btn:active { opacity: 0.75; }
.sheet-save-btn:disabled { opacity: 0.6; cursor: default; }

.sheet-delete-btn {
  width: 100%;
  padding: 14px 0;
  border-radius: 16px;
  border: 1px solid rgba(255, 59, 48, 0.25);
  background: rgba(255, 59, 48, 0.14);
  -webkit-backdrop-filter: blur(var(--glass-control-blur));
  backdrop-filter: blur(var(--glass-control-blur));
  color: var(--red);
  font-size: 17px;
  font-weight: 600;
  font-family: var(--font-system);
  cursor: pointer;
  margin-bottom: 10px;
  display: none;
}
.sheet-delete-btn.visible { display: block; }

.sheet-action-btn {
  width: 100%;
  padding: 14px 0;
  border-radius: 16px;
  border: 1px solid var(--glass-border-soft);
  background: var(--glass-control-bg);
  -webkit-backdrop-filter: blur(var(--glass-control-blur));
  backdrop-filter: blur(var(--glass-control-blur));
  color: var(--accent);
  font-size: 17px;
  font-weight: 600;
  font-family: var(--font-system);
  cursor: pointer;
  margin-bottom: 10px;
}
.sheet-action-btn.destructive { color: var(--red); }

.sheet-cancel-btn {
  width: 100%;
  padding: 14px 0;
  border-radius: 16px;
  border: 1px solid var(--glass-border-soft);
  background: var(--glass-control-bg);
  -webkit-backdrop-filter: blur(var(--glass-control-blur));
  backdrop-filter: blur(var(--glass-control-blur));
  color: var(--accent);
  font-weight: 600;
  font-size: 17px;
  font-family: var(--font-system);
  cursor: pointer;
  margin-top: 8px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px;
  font-size: 17px;
  border-bottom: 0.5px solid var(--separator);
  margin-bottom: 16px;
}

.switch { position: relative; display: inline-block; width: 51px; height: 31px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track {
  position: absolute; inset: 0;
  background: rgba(120,120,128,0.32);
  border-radius: 999px;
  transition: background 0.2s ease;
}
.switch-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 27px; height: 27px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
  transition: transform 0.2s ease;
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(20px); }

.about-block {
  text-align: center;
  padding: 18px 0 6px;
}
.about-name { font-size: 15px; font-weight: 600; margin: 0; }
.about-version { font-size: 13px; color: var(--text-secondary); margin: 2px 0; }
.about-credit { font-size: 13px; color: var(--text-secondary); margin: 0; }

/* ---------- Account / Auth ---------- */
.account-box { margin-bottom: 22px; }
.account-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 10px;
}
.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--glass-border-soft);
  background: var(--glass-control-bg);
  -webkit-backdrop-filter: blur(var(--glass-control-blur));
  backdrop-filter: blur(var(--glass-control-blur));
}
.account-email {
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-logout-btn {
  flex-shrink: 0;
  border: none;
  background: none;
  color: var(--red);
  font-family: var(--font-system);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
}

.settings-note {
  font-size: 13px;
  color: var(--text-secondary);
  margin: -10px 0 16px;
}

.auth-error {
  font-size: 14px;
  font-weight: 600;
  color: var(--red);
  text-align: center;
  background: rgba(255, 59, 48, 0.12);
  border: 1px solid rgba(255, 59, 48, 0.25);
  border-radius: 12px;
  padding: 10px 12px;
  margin: -6px 0 14px;
}

/* ---------- Currency (points-to-dollar display) ---------- */
.counter-currency {
  color: var(--text-secondary);
}
.counter-currency::before {
  content: " · ";
}
