@font-face {
  font-family: "IBM Plex Sans Thai";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("assets/fonts/IBMPlexSansThai-Light.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans Thai";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/IBMPlexSansThai-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans Thai";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/IBMPlexSansThai-Medium.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans Thai";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/IBMPlexSansThai-SemiBold.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans Thai";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/IBMPlexSansThai-Bold.woff2") format("woff2");
}
@font-face {
  font-family: "Bai Jamjuree";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/BaiJamjuree-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Bai Jamjuree";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/BaiJamjuree-Medium.woff2") format("woff2");
}
@font-face {
  font-family: "Bai Jamjuree";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/BaiJamjuree-SemiBold.woff2") format("woff2");
}
@font-face {
  font-family: "Bai Jamjuree";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/BaiJamjuree-Bold.woff2") format("woff2");
}

:root {
  --font-sans: "IBM Plex Sans Thai", sans-serif;
  --font-num: "Bai Jamjuree", sans-serif;
  --color-mark-open: #8b9096;
  --color-add-fill: #26282b;
  --today-raise: #c8c6c2;
  --date-near: #f3f1ec;
  --date-mid: #e7e5e1;
  --date-far: #dedede;
  --color-bg-base: #dedede;
  --color-bg-surface: #f8f5ef;
  --color-bg-elevated: #ebe9e5;
  --color-text-primary: #26282b;
  --color-text-secondary: #5c6166;
  --color-accent-red: #e64037;
  --color-accent-red-text: #c4322b;
  --color-accent-off-white: #f8f5ef;
  --color-border-default: #c8c6c2;
  --color-status-locked: #6b6e73;
  --color-text-on-light: #26282b;
  --color-nav-active-bg: #26282b;
  --color-nav-active-fg: #f8f5ef;
  --color-check-border: #8b9096;
  --color-carry-fill: #d0d0d0;
  --color-carry-note: #52565a;
  --color-success: #176b3a;
  --color-success-bg: #d7efdf;
  color-scheme: light;
  font-family: var(--font-sans);
}

:root[data-theme="dark"] {
  --color-mark-open: #525459;
  --color-add-fill: #1a1c1e;
  --today-raise: #2b2d30;
  --date-near: #2b2d30;
  --date-mid: #26282b;
  --date-far: #232527;
  --color-bg-base: #202123;
  --color-bg-surface: #2b2d30;
  --color-bg-elevated: #34363a;
  --color-text-primary: #f8f5ef;
  --color-text-secondary: #a4a5a6;
  --color-accent-red: #ef4b42;
  --color-accent-red-text: #ef4b42;
  --color-accent-off-white: #f8f5ef;
  --color-border-default: #3b3d40;
  --color-status-locked: #6e7175;
  --color-text-on-light: #26282b;
  --color-nav-active-bg: #f8f5ef;
  --color-nav-active-fg: #26282b;
  --color-check-border: #3b3d40;
  --color-carry-fill: #1a1c1e;
  --color-carry-note: #8a8d90;
  --color-success: #8ed7a8;
  --color-success-bg: #1d3326;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body.booting .app { visibility: hidden; }
body.booting .auth { display: none; }
.boot {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--color-bg-base);
  color: var(--color-text-secondary);
}
.boot-logo { width: auto; height: 84px; object-fit: contain; }
.boot-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--color-border-default);
  border-top-color: var(--color-accent-red);
  animation: boot-spin 0.8s linear infinite;
}
body.boot-failed .boot-spinner,
body.boot-failed #bootCopy { display: none; }
#bootFailure { display: none; flex-direction: column; align-items: center; gap: 12px; }
body.boot-failed #bootFailure { display: flex; }
#bootFailure p { color: var(--color-text-primary); font-size: 15px; line-height: 22px; font-weight: 600; }
.boot-retry {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  background: var(--color-accent-red);
  color: var(--color-accent-off-white);
  font-weight: 600;
}
.boot p { margin: 0; font-size: 14px; line-height: 20px; }
body.booting .boot { display: flex; }
@keyframes boot-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .boot-spinner { animation: none; }
}
html, body { margin: 0; max-width: 100%; overflow-x: hidden; }
body {
  min-height: 100dvh;
  background: var(--color-bg-base);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
}
button, input, textarea { font: inherit; color: inherit; }
.num { font-family: var(--font-num); }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: 0.6; }

.icon { display: inline-flex; width: 16px; height: 16px; }
.icon svg { width: 16px; height: 16px; display: block; }
.icon-lg { width: 18px; height: 18px; }
.icon-lg svg { width: 18px; height: 18px; }

.auth {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  background: var(--color-bg-base);
}
.auth.hidden { display: none; }
.auth-inner {
  width: min(100%, 390px);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: max(28px, env(safe-area-inset-top)) 24px max(18px, env(safe-area-inset-bottom));
}
.spacer { flex: 1 1 24px; min-height: 12px; }
.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 17px;
  background: var(--color-accent-off-white);
  color: var(--color-accent-red);
  display: grid;
  place-items: center;
  font-weight: 300;
  font-size: 30px;
  line-height: 44px;
}
/* Brand files: the owner supplies separate light and dark artwork; show the one for the current theme. */
.on-dark { display: none !important; }
:root[data-theme="dark"] .on-light { display: none !important; }
:root[data-theme="dark"] .on-dark { display: block !important; }
.auth h1.auth-brand { line-height: 0; }
.auth-logo {
  width: auto;
  height: 44px;
  max-width: 100%;
  object-fit: contain;
  display: block;
}
.auth h1 {
  margin: 0;
  font-size: 34px;
  line-height: 49px;
  font-weight: 700;
  letter-spacing: 0;
}
.auth .tagline {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 15px;
  line-height: 22px;
  font-weight: 400;
}
.login-form { display: flex; flex-direction: column; gap: 10px; width: 100%; }
#authEmailStep, #authCodeStep { display: flex; flex-direction: column; gap: 10px; }
#authEmailStep[hidden], #authCodeStep[hidden] { display: none; }
.auth .primary-btn { width: 100%; }
.login-form label {
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 19px;
  font-weight: 500;
}
.login-form input {
  width: 100%;
  height: 56px;
  border: 0;
  border-radius: 16px;
  background: var(--color-bg-elevated);
  padding: 0 16px;
  font-size: 16px;
  line-height: 22px;
  outline: none;
}
.login-form input::placeholder { color: var(--color-text-secondary); }
.login-form input:focus { box-shadow: inset 0 0 0 1.5px var(--color-accent-red); }
.primary-btn, .save-btn {
  min-height: 52px;
  height: auto;
  border: 0;
  border-radius: 16px;
  background: var(--color-accent-red);
  color: var(--color-accent-off-white);
  font-size: 15px;
  line-height: 22px;
  font-weight: 600;
  padding: 14px 16px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.auth-status {
  min-height: 16px;
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 12px;
  line-height: 16px;
  overflow-wrap: anywhere;
}
.auth-status.error { color: var(--color-accent-red-text); }
.locale-switch {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 14px 0 0;
}
.locale-switch button {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--color-border-default);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
  line-height: 19px;
  font-weight: 600;
}
.locale-switch button[aria-pressed="true"] {
  background: var(--color-accent-red);
  border-color: transparent;
  color: var(--color-accent-off-white);
}
.locale-row { width: 100%; flex-wrap: wrap; align-items: center; }
.menu .locale-switch { margin: 0; justify-content: flex-end; }
.menu-row > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.auth-foot, .tagline, .dialog p, .locked p, .hint { overflow-wrap: anywhere; }
.auth-foot {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 11px;
  line-height: 16px;
}
.auth h2 {
  margin: 0;
  font-size: 28px;
  line-height: 40px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.otp-boxes {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.otp-digit {
  width: 100%;
  height: 56px;
  border: 0;
  border-radius: 16px;
  background: var(--color-bg-elevated);
  text-align: center;
  font-family: var(--font-num);
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
  outline: none;
}
.otp-digit:focus { box-shadow: inset 0 0 0 1.5px var(--color-accent-red); }
.text-btn {
  border: 0;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 20px;
  padding: 4px 0;
  align-self: center;
}
.text-btn:disabled { opacity: 0.55; }
#pinDialog input {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 16px;
  background: var(--color-bg-elevated);
  padding: 0 16px;
  font-family: var(--font-num);
  font-size: 20px;
  letter-spacing: 0.2em;
  outline: none;
}
body.booting #lockView { display: none; }

#lockView.auth { overflow: hidden; }
#lockView .auth-inner {
  gap: 0;
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
  padding: 24px 24px max(16px, env(safe-area-inset-bottom));
}
#lockView .lock-top { height: 12px; flex: 0 0 12px; }
#lockView .lock-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 36px;
  margin-top: 8px;
}
#lockView .lock-logo {
  width: auto;
  height: 30px;
  object-fit: contain;
  display: block;
}
#lockView .lock-tagline {
  display: flex;
  flex-direction: column;
  margin: 12px 0 0;
  color: var(--color-text-primary);
  font-size: 22px;
  line-height: 28px;
  font-weight: 600;
}
#lockView .lock-mark { color: var(--color-accent-red); }
#lockView .lock-gap { display: none; }
#lockView .lock-form {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}
#lockView .lock-title {
  margin: 0;
  color: var(--color-text-primary);
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
}
#lockView .lock-hint {
  margin: 4px 0 0;
  color: var(--color-text-secondary);
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  overflow-wrap: anywhere;
}
#lockView .lock-hint .num { font-weight: 400; }
#lockView .lock-pin {
  position: relative;
  height: 56px;
  margin-top: 12px;
  border-radius: 16px;
  background: var(--color-bg-surface);
  padding: 8px 14px;
}
#lockView .lock-pin.is-hidden { display: none; }
#lockView .lock-pin:focus-within { box-shadow: inset 0 0 0 1.5px var(--color-accent-red); }
#lockView .lock-slots {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: center;
  justify-items: center;
  height: 100%;
  pointer-events: none;
}
#lockView .lock-slots i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 40px;
  color: #737579;
  font-style: normal;
  font-family: var(--font-num);
  font-size: 22px;
  line-height: 1;
  font-weight: 600;
}
#lockView .lock-slots i.is-filled { color: var(--color-accent-red); }
#lockView .lock-slots i.is-code { color: var(--color-text-primary); }
#lockView .lock-pin-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: 16px;
  opacity: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  -webkit-text-security: disc;
  font-family: var(--font-num);
  font-size: 24px;
  outline: none;
}
#lockView .auth-status { margin-top: 8px; }
#lockView .spacer { flex: 0 1 16px; min-height: 8px; }
#lockView .primary-btn,
#lockView .text-btn { flex: 0 0 auto; }
#lockView .primary-btn {
  height: 56px;
  min-height: 56px;
  padding: 0 16px;
  border-radius: 16px;
  font-size: 16px;
  line-height: 22px;
  font-weight: 500;
}
#lockView .text-btn {
  margin-top: 8px;
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
}
#lockView .pin-pad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(36px, 52px));
  gap: 8px;
  margin-top: 12px;
  flex: 1 1 auto;
  min-height: 0;
  align-content: center;
}
#lockView .pin-pad[hidden] { display: none; }
#lockView .pin-pad button {
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 16px;
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
  font-family: var(--font-num);
  font-size: 22px;
  line-height: 28px;
  font-weight: 600;
}
#lockView .pin-pad button:active { background: var(--color-bg-elevated); }
#lockView #pinDelete {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-secondary);
}
#lockView .primary-btn[hidden],
#lockView .text-btn[hidden] { display: none; }
.settings-lock-copy { align-items: flex-start; }
.settings-lock-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.settings-lock-note {
  color: var(--color-text-secondary);
  font-size: 12px;
  line-height: 16px;
  font-weight: 400;
}
#appLockButton { align-items: center; }
.pin-actions { justify-content: flex-end; gap: 16px; }
.pin-actions[hidden] { display: none; }
.pin-actions button {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--color-accent-red-text);
  font: inherit;
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
}

.app {
  width: min(100%, 390px);
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: max(28px, env(safe-area-inset-top)) 24px calc(96px + env(safe-area-inset-bottom));
}
.view { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.view[hidden] { display: none; }

.header { min-height: 58px; display: flex; align-items: center; gap: 12px; }
.header-copy { flex: 1; min-width: 0; }
.eyebrow {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 10px;
  line-height: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.header h1 {
  margin: 0;
  font-size: 23px;
  line-height: 33px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.theme-btn {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 21px;
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
  display: grid;
  place-items: center;
}
.theme-btn[hidden] { display: none; }

.dashboard {
  min-height: 142px;
  background: var(--color-bg-surface);
  border-radius: 20px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dashboard-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--color-text-secondary);
  font-size: 12px;
  line-height: 17px;
  font-weight: 500;
}
.dashboard-head strong { color: var(--color-text-primary); font-weight: 600; }
.score { display: flex; align-items: center; gap: 12px; min-width: 0; }
.percent {
  margin: 0;
  font-size: 60px;
  line-height: 87px;
  font-weight: 300;
  letter-spacing: -0.04em;
}
.percent.no-plan {
  font-size: 28px;
  line-height: 40px;
  font-weight: 500;
  letter-spacing: 0;
}
.check-hit { display: flex; }
.readonly .check:disabled { opacity: 0.45; pointer-events: none; }
.dots { display: flex; flex-wrap: wrap; gap: 6px; max-width: 150px; }
.dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-border-default);
}
.dot.done { background: var(--color-accent-red); }

.date-nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.date-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  flex: 1;
  max-width: 100%;
  min-width: 0;
  scrollbar-width: none;
  padding-bottom: 10px;
}
.date-jump {
  width: 42px;
  height: 58px;
  flex: 0 0 auto;
  border-radius: 16px;
}
.date-nav > .iso-picker {
  overflow: hidden;
  contain: strict;
}
.date-nav > .iso-picker[hidden] { display: none; }
.back-today {
  align-self: flex-start;
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--color-accent-red);
  color: var(--color-accent-off-white);
  font-size: 12px;
  line-height: 17px;
  font-weight: 600;
  white-space: normal;
}
.back-today[hidden] { display: none; }
.add-task {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  background: var(--color-accent-red);
  color: var(--color-accent-off-white);
  font-size: 15px;
  line-height: 22px;
  font-weight: 600;
  padding: 14px 16px;
}
.day-compact {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 6;
  transform: translateX(-50%);
  width: min(100%, 390px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(8px, env(safe-area-inset-top)) 24px 8px;
  background: var(--color-bg-base);
  color: var(--color-text-primary);
}
.day-compact[hidden] { display: none; }
.day-compact strong {
  min-width: 0;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
#taskForm { scroll-margin-top: 12px; }
.swipe-hint,
.gesture-tip {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-text-secondary);
  font-size: 12px;
  line-height: 17px;
  font-weight: 600;
}
.gesture-tip {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.swipe.hinting .swipe-clip { transition: width 0.35s ease; }
.swipe.lifted {
  z-index: 4;
  overflow: visible;
}
.swipe.lifted .swipe-actions { visibility: hidden; }
.swipe.lifted .swipe-clip { overflow: visible; }
.swipe.lifted .swipe-front {
  background: var(--color-bg-elevated);
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}
.swipe.held { position: relative; z-index: 4; }
.swipe.held .swipe-actions { visibility: hidden; }
.swipe.held .swipe-front {
  background: var(--color-bg-elevated);
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}
#dateDialog .move-date-value {
  color: var(--color-text-primary);
  font-family: var(--font-num);
  font-size: 15px;
  line-height: 22px;
  font-weight: 600;
}
#dateDialog .move-task-name {
  color: var(--color-text-primary);
  font-size: 22px;
  line-height: 30px;
  font-weight: 700;
}
.move-date-picks { display: flex; align-items: stretch; gap: 8px; }
.move-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.move-chip {
  min-height: 48px;
  padding: 6px 14px;
  border: 0;
  border-radius: 14px;
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
}
.move-chip .move-chip-date { color: var(--color-text-secondary); font-size: 12px; line-height: 16px; font-weight: 500; }
.move-chip.is-selected { box-shadow: inset 0 0 0 2px var(--color-text-primary); }
:root[data-theme="dark"] .move-chip.is-selected { box-shadow: inset 0 0 0 2px var(--color-accent-off-white); }
.move-calendar {
  flex: 1;
  min-height: 48px;
  padding: 8px 14px;
  border: 1px solid var(--color-border-default);
  border-radius: 14px;
  background: transparent;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
}
.move-calendar .icon,
.move-calendar .icon svg { width: 22px; height: 22px; color: var(--color-accent-red-text); }
.move-calendar.is-selected { box-shadow: inset 0 0 0 2px var(--color-text-primary); }
#dateDialog .move-keep { font-size: 12px; line-height: 17px; }
#dateDialog .primary-btn:disabled { opacity: 0.5; }
.move-date-picks .calendar-btn {
  flex: 0 0 48px;
  width: 48px;
  min-height: 48px;
  height: auto;
  align-self: stretch;
}
.move-date-picks .calendar-btn .icon,
.move-date-picks .calendar-btn .icon svg { width: 22px; height: 22px; }
.series-choices { display: flex; flex-direction: column; gap: 8px; }
.series-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--color-border-default);
  border-radius: 14px;
  background: transparent;
  color: var(--color-text-primary);
  text-align: left;
}
.series-choice strong { font-size: 15px; line-height: 22px; font-weight: 600; }
.series-choice span {
  color: var(--color-text-secondary);
  font-size: 12px;
  line-height: 17px;
  font-weight: 500;
}
html.reordering,
html.reordering body {
  overflow: hidden;
  overscroll-behavior: none;
}
.task-list.reordering { touch-action: none; }
.date-strip::-webkit-scrollbar { display: none; }
.date-tab {
  width: 48px;
  height: 58px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 16px;
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 6px;
}
.date-tab span { font-size: 10px; line-height: 15px; font-weight: 500; color: var(--color-text-secondary); }
.date-tab strong { font-size: 16px; line-height: 23px; font-weight: 600; }
.date-tab i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-status-locked);
  font-style: normal;
}
.date-cell { position: relative; flex: 0 0 auto; }
.date-cell .today-dot {
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 5px;
  height: 5px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--color-accent-red);
  pointer-events: none;
}
.date-tab.active {
  background: var(--color-accent-red);
  color: var(--color-accent-off-white);
}
.date-tab.active span { color: var(--color-accent-off-white); background: transparent; }
.date-tab.active i { background: var(--color-accent-off-white); }

.section-label {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 12px;
  line-height: 17px;
  font-weight: 600;
}
.task-list, .stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.swipe {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  min-height: 62px;
  background: var(--color-bg-elevated);
}
.swipe-actions { position: absolute; top: 0; right: 0; bottom: 0; display: flex; }
.swipe-btn {
  width: 64px;
  border: 0;
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px;
  font-size: 10px;
  line-height: 15px;
  font-weight: 500;
}
.swipe-btn.move { color: var(--color-text-primary); }
.swipe-btn.move .icon { color: var(--color-accent-red-text); }
.swipe-btn.wide { width: 72px; }
.swipe-btn.edit {
  width: 52px;
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
}
.swipe-btn.edit .icon { color: var(--color-accent-red-text); }
.quick-add.is-editing #taskName[readonly],
.quick-add.is-editing #taskDetail { color: var(--color-text-secondary); }
.swipe.open .info-btn,
.swipe.open .push-bell { visibility: hidden; width: 0; margin: 0; border: 0; padding: 0; }
.swipe-btn.delete {
  width: 52px;
  background: var(--color-accent-red);
  color: var(--color-accent-off-white);
  font-size: 11px;
  line-height: 16px;
  font-weight: 600;
}
.swipe-btn.delete .icon {
  width: 22px;
  height: 22px;
  color: var(--color-accent-off-white);
}
.swipe-clip {
  position: relative;
  z-index: 1;
  width: 100%;
  overflow: hidden;
  transition: width 0.18s ease;
}
.swipe.open .swipe-clip { width: calc(100% - var(--reveal) * 1px); }
.swipe.dragging .swipe-clip { transition: none; }
.swipe-front {
  width: 100%;
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--color-bg-surface);
  touch-action: pan-y;
}

.check {
  appearance: none;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  margin: 0;
  border: 1.5px solid var(--color-check-border);
  border-radius: 8px;
  background: transparent;
  display: grid;
  place-items: center;
  color: var(--color-accent-off-white);
}
.check:checked {
  background: var(--color-accent-red);
  border-color: var(--color-accent-red);
}
.check:checked::after {
  content: "×";
  font-size: 22px;
  line-height: 1;
  font-weight: 400;
}
.task-copy { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.task-main { min-width: 0; display: flex; flex-direction: column; }
.origin-badge {
  color: var(--color-text-secondary);
  font-size: 11px;
  line-height: 15px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.task-time {
  flex: 0 0 auto;
  color: var(--color-accent-red-text);
  font-size: 13px;
  line-height: 19px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.task-name {
  min-width: 0;
  font-size: 15px;
  line-height: 22px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-done .task-time,
.task-done .task-name { color: var(--color-text-secondary); }
.task-done .task-name { text-decoration: line-through; }
.info-btn {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 1px solid var(--color-border-default);
  border-radius: 14px;
  background: transparent;
  color: var(--color-text-secondary);
  display: grid;
  place-items: center;
  font-size: 12px;
  line-height: 17px;
  font-weight: 600;
}

.menu-btn {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  margin: -8px -10px -8px -6px;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: var(--color-text-secondary);
  display: grid;
  place-items: center;
}
.menu-btn .menu-dots { font-size: 22px; line-height: 22px; font-weight: 700; }
.menu-btn:active { background: var(--color-bg-elevated); }
.swipe.open .menu-btn { visibility: hidden; width: 0; flex-basis: 0; margin: 0; }
/* A long press on a card is not a text selection (Android Copy/Search bar). */
.swipe-front, .swipe-front .task-copy {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
dialog.task-sheet { padding-top: 8px; }
.task-sheet-body { gap: 6px; }
.task-sheet .task-sheet-name { font-size: 18px; line-height: 26px; font-weight: 700; overflow-wrap: anywhere; }
.task-sheet .task-sheet-when { margin: 0 0 4px; }
.task-sheet-items { display: flex; flex-direction: column; }
.task-sheet-item {
  min-height: 52px;
  border: 0;
  border-top: 1px solid var(--color-border-default);
  background: transparent;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 4px;
  text-align: left;
  font-size: 16px;
  line-height: 22px;
  font-weight: 600;
}
.task-sheet-item .icon, .task-sheet-item .icon svg { width: 22px; height: 22px; flex: 0 0 auto; }
.task-sheet-copy { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.task-sheet-note { color: var(--color-text-secondary); font-size: 12px; line-height: 17px; font-weight: 500; }
.task-sheet-item.is-danger { color: var(--color-accent-red-text); }
.task-sheet-item.is-off { color: var(--color-text-secondary); }
.task-sheet-item .pro-mark {
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--color-nav-active-bg);
  color: var(--color-nav-active-fg);
  font-size: 11px;
  line-height: 15px;
  font-weight: 700;
}
#taskDateButton.is-locked { opacity: 0.55; }
.menu-btn, .move-chip, .move-calendar, .task-sheet-item { -webkit-tap-highlight-color: transparent; }
.menu-btn:focus-visible, .move-chip:focus-visible, .move-calendar:focus-visible, .task-sheet-item:focus-visible { outline: 2px solid var(--color-accent-red); outline-offset: 2px; }

.carry, .locked, .hint, .empty, .menu, .quick-add, .pro-card, .plan {
  background: var(--color-bg-surface);
  border-radius: 18px;
}
.carry, .locked, .hint {
  width: 100%;
  border: 0;
  text-align: left;
  padding: 14px;
  color: inherit;
}
.carry { display: flex; align-items: center; gap: 12px; background: var(--color-carry-fill); }
.carry-box {
  width: 100%;
  border-radius: 18px;
  background: var(--color-carry-fill);
  overflow: hidden;
}
.carry-box > .carry {
  background: transparent;
  border-radius: 0;
  min-height: 44px;
  padding: 0 12px;
  gap: 8px;
  touch-action: manipulation;
  user-select: none;
  cursor: pointer;
}
.carry-box > .carry > * { pointer-events: none; }
.carry-box.is-open > .carry { padding-bottom: 8px; }
.carry-box .carry-summary { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.carry-box .carry-summary .num { color: inherit; font-size: inherit; line-height: inherit; }
.carry-box:not(.is-open) .carry-panel { display: none; }
.carry-box .carry-copy { flex: 1; }
.carry-arrow {
  margin-left: auto;
  flex: 0 0 auto;
  color: var(--color-carry-note);
  transform: rotate(90deg);
}
.carry-box.is-open .carry-arrow { transform: rotate(-90deg); }
.carry-box .carry-list { padding: 0 14px 14px; max-height: 280px; }
.carry-actions { display: flex; flex-direction: column; gap: 8px; padding: 0 14px 8px; }
.carry-action-row { display: flex; gap: 8px; }
.carry-action {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
  font: 600 14px/20px var(--font-sans);
}
.carry-action.is-manage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.carry-action.is-manage .icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: inherit;
}
.carry-action-row .carry-action {
  width: auto;
  flex: 1;
  min-width: 0;
  height: auto;
  padding: 8px;
  text-align: center;
  overflow-wrap: anywhere;
  line-height: 18px;
}
.carry-action.is-danger { color: var(--color-accent-red); }
.carry-action:disabled { opacity: 0.38; }
.carry-selected {
  margin: 0;
  color: var(--color-carry-note);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
}
.carry-item.is-picking { flex-direction: row; align-items: flex-start; gap: 10px; }
.carry-item-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.carry-pick {
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  flex: 0 0 auto;
  accent-color: var(--color-accent-red);
}
.carry-box > .carry:focus-visible {
  outline: 2px solid var(--color-accent-red);
  outline-offset: -4px;
}
@media (prefers-reduced-motion: no-preference) {
  .carry-arrow { transition: transform 160ms ease; }
}
.carry-copy { display: flex; flex-direction: column; min-width: 0; }
.carry-copy strong { color: var(--color-text-primary); }
.carry-badge {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 11px;
  background: var(--color-accent-red);
  color: var(--color-bg-base);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}
.carry strong, .locked strong, .hint strong { display: block; font-size: 13px; line-height: 19px; }
.carry span, .locked p, .hint p, .empty, .quiet {
  color: var(--color-text-secondary);
  font-size: 11px;
  line-height: 16px;
}
.carry > .carry-badge { color: var(--color-bg-base); }
.carry > .carry-copy > span { color: var(--color-carry-note); }
.carry b { margin-left: auto; color: var(--color-accent-red-text); font-size: 12px; }
.locked strong, .hint strong { color: var(--color-accent-red-text); font-size: 12px; font-weight: 600; }
.locked, .hint { display: flex; flex-direction: column; gap: 4px; }
.unlock-cta {
  width: 100%;
  height: 56px;
  margin-top: 8px;
  border: 0;
  border-radius: 16px;
  background: var(--color-accent-red);
  color: var(--color-accent-off-white);
  font-size: 16px;
  line-height: 22px;
  font-weight: 500;
}
.locked-mark { display: flex; align-items: center; gap: 8px; color: var(--color-accent-red-text); }
.empty {
  background: var(--color-bg-surface);
  border-radius: 18px;
  min-height: 62px;
  display: grid;
  place-items: center;
  padding: 14px;
}

.block-title {
  margin: 0;
  font-size: 20px;
  line-height: 29px;
  font-weight: 700;
}
.quick-add { border-radius: 20px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.quick-add input, .quick-add textarea, .date-field input, .dialog input, .dialog textarea {
  width: 100%;
  border: 0;
  border-radius: 14px;
  background: var(--color-bg-elevated);
  padding: 12px 14px;
  font-size: 16px;
  line-height: 22px;
  outline: none;
}
.quick-add textarea, .dialog textarea { min-height: 96px; resize: vertical; }
.quick-add input:focus, .quick-add textarea:focus, .date-field input:focus, .dialog input:focus, .dialog textarea:focus {
  box-shadow: inset 0 0 0 1.5px var(--color-accent-red);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
  padding: 10px 12px;
  font-size: 12px;
  line-height: 17px;
  font-weight: 500;
  white-space: normal;
  overflow-wrap: anywhere;
}
.chip.active { box-shadow: inset 0 0 0 1.5px var(--color-accent-red); color: var(--color-accent-red-text); }
.option-panel { display: flex; flex-direction: column; gap: 8px; }
.option-panel[hidden] { display: none; }
.field-label { color: var(--color-text-secondary); font-size: 12px; line-height: 17px; font-weight: 500; }
.suggestions { display: flex; flex-direction: column; gap: 6px; }
.suggestion {
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 12px;
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
  text-align: left;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 19px;
  overflow-wrap: anywhere;
}
.repeat-modes, .repeat-spans { display: flex; flex-wrap: wrap; gap: 8px; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.days[hidden] { display: none; }
.days label { position: relative; display: grid; place-items: center; min-height: 44px; }
.days input { appearance: none; width: 44px; height: 44px; margin: 0; border-radius: 50%; border: 1px solid var(--color-border-default); background: var(--color-bg-elevated); }
.days input:checked { background: var(--color-accent-red); border-color: var(--color-accent-red); }
.days input:focus-visible { outline: 2px solid var(--color-accent-red); outline-offset: 2px; }
.days span { position: absolute; font-size: 13px; line-height: 18px; font-weight: 600; pointer-events: none; }
.days input:checked + span { color: var(--color-accent-off-white); }
.repeat-summary { margin: 0; color: var(--color-text-secondary); font-size: 13px; line-height: 19px; }
.repeat-summary.is-error { color: var(--color-accent-red-text); }
.date-field { display: flex; flex-direction: column; gap: 6px; }
.date-field[hidden] { display: none; }
.date-entry { position: relative; display: flex; align-items: stretch; gap: 8px; }
.date-entry > input[type="text"] { width: auto; flex: 1; min-width: 0; font-family: var(--font-num); }
.calendar-btn {
  width: 48px;
  border: 0;
  border-radius: 14px;
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
  display: grid;
  place-items: center;
}
.iso-picker {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}
#dateDialog .iso-picker {
  width: 1px;
  height: 1px;
  min-width: 0;
  max-width: 1px;
  padding: 0;
  overflow: hidden;
  contain: strict;
}
#carryMoveDialog .iso-picker {
  width: 1px;
  height: 1px;
  min-width: 0;
  max-width: 1px;
  padding: 0;
  overflow: hidden;
  contain: strict;
}
#carryMoveDialog #carryMoveCount {
  color: var(--color-text-primary);
  font-size: 15px;
  line-height: 22px;
  font-weight: 600;
  text-align: center;
}
#carryMoveDialog .carry-move-picks {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
#carryMoveDialog .carry-move-picks > button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 48px;
  margin: 0;
  padding: 8px 6px;
  border: 0;
  border-radius: 14px;
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
#carryMoveDialog .carry-move-picks > button.is-selected {
  background: var(--color-accent-red);
  color: var(--color-accent-off-white);
}
#carryMoveDialog .carry-move-date {
  font-family: var(--font-num);
  font-weight: 700;
  white-space: nowrap;
}
#carryMoveDialog .carry-move-date .num {
  min-width: 0;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
  font-weight: inherit;
}
#carryMoveDialog .carry-move-date .icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: inherit;
}
#carryMoveDialog .carry-back {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  height: auto;
  padding: 8px;
  text-align: center;
  overflow-wrap: anywhere;
}
#carryMoveDialog .carry-back .icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: inherit;
}

.pro-card { border-radius: 24px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.pro-kicker { margin: 0; color: var(--color-accent-red-text); font-size: 13px; line-height: 19px; font-weight: 600; }
.pro-card h3 { margin: 0; font-size: 19px; line-height: 28px; font-weight: 700; }
.pro-card .quiet { margin: 0 0 4px; }
.plan {
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--color-border-default);
}
.plan.best { border-color: var(--color-accent-red); }
.plan-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan-row span { font-size: 12px; line-height: 17px; }
.plan.best .plan-row span { color: var(--color-accent-red-text); font-weight: 600; }
.plan-row strong { font-size: 13px; line-height: 19px; font-weight: 600; }
.plan .primary-btn { min-height: 42px; height: auto; width: 100%; padding: 10px 12px; }
.plan .primary-btn.selected { background: var(--color-bg-elevated); color: var(--color-text-primary); }

.menu { border-radius: 20px; padding: 10px 14px; display: flex; flex-direction: column; }
.menu-row {
  width: 100%;
  min-height: 36px;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 13px;
  line-height: 19px;
  font-weight: 500;
  text-align: left;
}
.menu-row.muted, .account-line { color: var(--color-text-secondary); font-weight: 400; }
.account-line { margin: 8px 2px 0; font-size: 11px; line-height: 16px; }
.sync-state { font-weight: 600; }
.sync-state.busy { color: var(--color-text-secondary); }
.sync-state.error { color: var(--color-accent-red-text); }
.sync-state.ok { color: var(--color-text-primary); }

.nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: max(18px, env(safe-area-inset-bottom));
  width: min(calc(100% - 48px), 342px);
  height: 64px;
  padding: 4px;
  border-radius: 22px;
  background: var(--color-bg-surface);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  z-index: 5;
}
.nav button {
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  padding: 0 8px;
  font-size: 13px;
  line-height: 19px;
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}
.nav button.active { background: var(--color-nav-active-bg); color: var(--color-nav-active-fg); }

.time-readout {
  min-height: 48px;
  border: 0;
  border-radius: 16px;
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
  padding: 0 16px;
  font-size: 16px;
  line-height: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: left;
}
.time-readout.is-empty { color: var(--color-text-secondary); font-weight: 500; }
html.time-wheel-open,
html.time-wheel-open body,
html.words-open,
html.words-open body { overflow: hidden; overscroll-behavior: none; }
dialog.words-dialog {
  width: min(calc(100% - 32px), 358px);
  max-height: calc(var(--viewport-height, 100dvh) - 48px);
  padding: 0;
  overflow: hidden;
}
dialog.words-dialog[open] { display: flex; flex-direction: column; }
.words-sheet {
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px 16px 8px;
  gap: 8px;
}
.words-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.words-head h3 { flex: 1 1 auto; min-width: 0; font-size: 17px; line-height: 24px; }
.words-close {
  flex: none;
  width: 40px;
  height: 40px;
  margin: -8px -8px -8px 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  display: grid;
  place-items: center;
}
.words-sheet .suggestions {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;
  padding: 0 4px 8px;
}
.app.is-add .words-btn, .words-sheet .suggestion, .words-close { -webkit-tap-highlight-color: transparent; }
.words-sheet .suggestion { flex: none; user-select: none; min-height: 44px; padding: 11px 14px; font-size: 14px; line-height: 21px; white-space: normal; }
#timeWheelDialog {
  width: min(100%, 390px);
  max-height: calc(100dvh - 12px);
  margin: auto auto 0;
  border-radius: 24px 24px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
}
#timeWheelDialog .dialog-actions button { min-height: 48px; }
.time-wheel-face {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 28px 1fr;
  height: 220px;
  touch-action: none;
  overscroll-behavior: none;
  user-select: none;
}
.time-wheel-mark {
  position: absolute;
  left: 0;
  right: 0;
  top: 88px;
  height: 44px;
  border-radius: 14px;
  background: var(--color-bg-base);
  z-index: 0;
}
.time-wheel-colon {
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-num);
  font-size: 28px;
  line-height: 1;
  font-weight: 700;
}
.time-wheel-col {
  z-index: 1;
  height: 220px;
  overflow-y: scroll;
  scrollbar-width: none;
  touch-action: none;
  overscroll-behavior: none;
  mask-image: linear-gradient(to bottom, transparent, #000 28%, #000 72%, transparent);
}
.time-wheel-col::-webkit-scrollbar { display: none; }
.time-wheel-pad { pointer-events: none; }
.time-wheel-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--color-text-secondary);
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  line-height: 22px;
  font-weight: 500;
  opacity: 0.28;
}
.time-wheel-item[data-distance="1"] { opacity: 0.62; }
.time-wheel-item.is-center {
  color: var(--color-text-primary);
  font-size: 22px;
  line-height: 28px;
  font-weight: 700;
  opacity: 1;
}

html.keyboard-open dialog[open]:not(.calendar-sheet):not(#timeWheelDialog) {
  top: calc(var(--viewport-offset, 0px) + 12px);
  bottom: auto;
  height: auto;
  max-height: calc(var(--viewport-height, 100dvh) - 24px);
  margin-top: 0;
  overflow-y: auto;
  transform: none;
}
html.keyboard-open .auth {
  top: var(--viewport-offset, 0px);
  bottom: auto;
  height: var(--viewport-height, 100dvh);
  max-height: var(--viewport-height, 100dvh);
  overflow-y: auto;
}
dialog {
  width: min(calc(100% - 32px), 342px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  border: 0;
  border-radius: 24px;
  padding: 20px;
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.62); }
.dialog { display: flex; flex-direction: column; gap: 12px; }
.dialog h3 { margin: 0; font-size: 19px; line-height: 28px; overflow-wrap: anywhere; }
.dialog p { margin: 0; color: var(--color-text-secondary); font-size: 13px; line-height: 19px; }
.dialog-actions, .carry-actions { display: flex; gap: 8px; }
.dialog-actions button, .ghost-btn, .carry-actions button {
  flex: 1;
  min-height: 42px;
  border: 0;
  border-radius: 14px;
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
  font-size: 13px;
  font-weight: 600;
  white-space: normal;
}
.dialog-actions .primary-btn, .carry-actions .danger {
  background: var(--color-accent-red);
  color: var(--color-accent-off-white);
}
.carry-item {
  background: var(--color-bg-elevated);
  border-radius: 16px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.carry-item strong { font-size: 15px; line-height: 22px; }
.carry-item p {
  margin: 0;
  color: var(--color-accent-red);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
}
.carry-list { display: flex; flex-direction: column; gap: 8px; max-height: 46dvh; overflow: auto; }
.toast {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: 50%;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: min(calc(100% - 32px), 320px);
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--color-border-default);
  border-radius: 14px;
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
  box-shadow: 0 6px 18px rgb(32 33 35 / 0.16);
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
  overflow-wrap: anywhere;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -6px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-icon { display: inline-flex; flex: 0 0 16px; width: 16px; height: 16px; }
.toast-icon svg { display: block; width: 16px; height: 16px; }
.toast.is-error .toast-icon { color: var(--color-accent-red); }
.toast-text { min-width: 0; }
.toast-undo {
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  min-height: 32px;
  padding: 0;
  pointer-events: auto;
}
@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
}

@media (min-width: 800px) {
  body { display: flex; justify-content: center; }
  .app { min-height: 100dvh; }
}

.app.is-today {
  --today-dock-bottom: max(18px, env(safe-area-inset-bottom));
  --today-nav-size: 64px;
  --today-add-gap: 12px;
  --today-add-size: 48px;
  --today-fade-rise: 56px;
  --today-fade-height: calc(var(--today-nav-size) + var(--today-add-gap) + var(--today-add-size) + var(--today-fade-rise) + var(--today-dock-bottom));
  gap: 10px;
  height: 100dvh;
  max-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  padding: max(14px, env(safe-area-inset-top)) 20px var(--today-fade-height);
}
.app.is-today::after {
  content: "";
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 4;
  width: min(100%, 390px);
  height: var(--today-fade-height);
  background: linear-gradient(to bottom, rgb(222 222 222 / 0), #dedede var(--today-fade-rise));
  transform: translateX(-50%);
  pointer-events: none;
}
:root[data-theme="dark"] .app.is-today::after {
  background: linear-gradient(to bottom, rgb(32 33 35 / 0), #202123 var(--today-fade-rise));
}
.app.is-today .today-scroll-pad { height: 0; flex: none; }
.app.is-today .header { min-height: 0; flex-shrink: 0; align-items: center; }
.app.is-today .eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 18px;
  margin: 0;
  letter-spacing: 0;
  line-height: 18px;
  font-size: 10px;
  font-weight: 600;
}
.app.is-today .brand-logo {
  width: auto;
  height: 18px;
  object-fit: contain;
  display: block;
}
.app.is-today .brand-logo[hidden] { display: none; }
/* Header: the owner's wordmark file per theme; Pro today adds the word PRO. */
.brand-logo img { width: auto; height: 18px; object-fit: contain; }
#eyebrowText[hidden] { display: none; }
.app.is-today .header h1 {
  font-size: 26px;
  line-height: 43px;
  font-weight: 700;
}
.app.is-today .header h1 .num { font-weight: 700; }
.app.is-today .theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 18px;
}
.app.is-today .num { font-family: var(--font-num); }
.app.is-today #todayView { gap: 10px; }
.app.is-today #todayView.fills { flex: 0 0 auto; min-height: min-content; }
.app.is-today .today-spacer { flex: 1 1 auto; min-height: 12px; }
.app.is-today .dashboard {
  position: relative;
  height: 109px;
  min-height: 109px;
  max-height: 109px;
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 16px 28px 16px 24px;
  overflow: hidden;
}
.app.is-today .percent {
  position: relative;
  flex: 0 0 auto;
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  font-weight: 700;
}
.app.is-today .percent-slot {
  display: inline-grid;
  justify-items: center;
  align-items: start;
}
.app.is-today .percent-sizer,
.app.is-today .percent-group {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: flex-start;
}
.app.is-today .percent-sizer { visibility: hidden; }
.app.is-today .percent .num {
  font-size: 44px;
  line-height: 44px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}
.app.is-today .percent-mark {
  position: relative;
  top: -2px;
  margin: 0 0 0 1px;
  font-family: var(--font-sans);
  font-size: 24px;
  line-height: 24px;
  font-weight: 700;
}
.app.is-today .dash-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}
.app.is-today .dash-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}
.app.is-today .dash-count {
  position: static;
  flex: 1 1 auto;
  min-width: min-content;
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 12px;
  line-height: 20px;
  font-weight: 500;
  white-space: nowrap;
}
@media (max-width: 359px) {
  .app.is-today .dashboard {
    padding-right: 12px;
    padding-left: 16px;
  }
}
.app.is-today .dash-status {
  position: static;
  flex: 0 0 auto;
  margin: 0 0 0 auto;
  height: 24px;
  padding: 4px 10px 0;
  border-radius: 7px;
  background: var(--color-accent-red);
  color: var(--color-accent-off-white);
  font-size: 11px;
  line-height: 15px;
  font-weight: 600;
  white-space: nowrap;
}
.app.is-today .marks {
  position: static;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}
.app.is-today .mark {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--color-mark-open);
  color: var(--color-accent-off-white);
  display: grid;
  place-items: center;
  font-family: var(--font-sans);
  font-size: 10px;
  line-height: 14px;
  font-weight: 700;
}
.app.is-today .mark.done { background: var(--color-accent-red); }
.app.is-today .mark.more {
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 32px;
  height: 14px;
  padding: 0 6px;
  white-space: nowrap;
  font-family: var(--font-num);
  font-weight: 700;
}
.app.is-today .date-nav { align-items: flex-start; gap: 4px; }
.app.is-today .date-strip {
  align-items: flex-end;
  gap: 4px;
  height: 60px;
  padding: 4px 0 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  touch-action: pan-y;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent);
}
.app.is-today .date-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 50px;
  scroll-snap-align: center;
}
.app.is-today .date-tab {
  width: 39px;
  height: 50px;
  border-radius: 14px;
  padding: 6px 0 0;
  gap: 1px;
  justify-content: flex-start;
  background: var(--date-far);
}
.app.is-today .date-tab.dist-1 { background: var(--date-near); }
.app.is-today .date-tab.dist-2 { background: var(--date-mid); }
.app.is-today .date-tab span { font-size: 10px; line-height: 17px; font-weight: 600; }
.app.is-today .date-tab strong { font-size: 16px; line-height: 20px; font-weight: 700; }
.app.is-today .date-tab.active {
  background: var(--color-accent-red);
  color: var(--color-accent-off-white);
  transform: translateY(-4px);
  box-shadow: 0 4px 0 var(--today-raise);
}
.app.is-today .date-cell .today-dot {
  bottom: -6px;
  width: 4px;
  height: 4px;
  pointer-events: none;
}
.app.is-today .date-jump {
  width: 36px;
  height: 50px;
  margin-top: 4px;
  border-radius: 14px;
}
.app.is-today .back-today {
  align-self: flex-start;
  margin-top: 4px;
  width: 46px;
  min-height: 50px;
  padding: 0 2px;
  border-radius: 0;
  background: transparent;
  color: var(--color-accent-red);
  font-size: 11px;
  line-height: 16px;
  font-weight: 600;
}
.app.is-today .day-compact .back-today {
  width: auto;
  min-height: 32px;
  padding: 0 4px;
}
.app.is-today .task-list { gap: 10px; }
.app.is-today .swipe {
  min-height: 46px;
  border-radius: 16px;
  background: var(--color-bg-surface);
}
.app.is-today .swipe-actions { opacity: 0; pointer-events: none; }
.app.is-today .swipe.open .swipe-actions,
.app.is-today .swipe.dragging .swipe-actions { opacity: 1; pointer-events: auto; }
.app.is-today .swipe-front {
  min-height: 46px;
  gap: 10px;
  padding: 0 12px;
  border-radius: 16px;
  background: var(--color-bg-surface);
}
.app.is-today .task-list .empty {
  min-height: 0;
  padding: 2px 0 0;
  background: transparent;
  border-radius: 0;
  display: block;
  place-items: unset;
  text-align: left;
}
.app.is-today .check { width: 26px; height: 26px; border-radius: 8px; }
.app.is-today .check:checked::after { font-size: 16px; font-weight: 700; }
.app.is-today .task-time { font-weight: 600; }
.app.is-today .task-name { font-weight: 500; }
.app.is-today .info-btn,
.app.is-today .push-bell {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
}
.app.is-today .push-bell {
  position: relative;
  flex: 0 0 28px;
  padding: 0;
  color: #8a8f98;
}
.app.is-today .push-glyph,
.settings-bell {
  width: 18px;
  height: 18px;
  display: block;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 3a1 1 0 0 1 1 1v.2A6 6 0 0 1 18.8 10v4.2l1.4 2.1a1 1 0 0 1-.8 1.5H4.6a1 1 0 0 1-.8-1.5L5.2 14.2V10A6 6 0 0 1 11 4.2V4a1 1 0 0 1 1-1Zm0 18a2.5 2.5 0 0 0 2.4-2h-4.8A2.5 2.5 0 0 0 12 21Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 3a1 1 0 0 1 1 1v.2A6 6 0 0 1 18.8 10v4.2l1.4 2.1a1 1 0 0 1-.8 1.5H4.6a1 1 0 0 1-.8-1.5L5.2 14.2V10A6 6 0 0 1 11 4.2V4a1 1 0 0 1 1-1Zm0 18a2.5 2.5 0 0 0 2.4-2h-4.8A2.5 2.5 0 0 0 12 21Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.app.is-today .push-bell.is-on { color: #ef4b42; }
.app.is-today .push-lead {
  position: absolute;
  top: 0;
  right: 0;
  color: #ef4b42;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}
.settings-bell { color: var(--color-text-secondary, #8a8f98); }
.settings-row.is-step { justify-content: flex-start; align-items: flex-start; gap: 10px; }
.step-no { width: 22px; flex: 0 0 22px; font-weight: 700; }
.step-copy { flex: 1; text-align: left; }
.push-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.push-scope { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.push-scope[hidden] { display: none; }
.push-choice {
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line, #3a3d42);
  background: transparent;
  color: inherit;
}
.push-choice[aria-pressed="true"] { border-color: #ef4b42; color: #ef4b42; }
/* Support details: only in support mode (see initDebugMode in app.js). */
:root:not(.xp-debug) .debug-only { display: none !important; }
.push-diag {
  margin: 8px 0 0;
  color: var(--color-text-secondary, #8a8f98);
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.02em;
}
.app.is-today .swipe-btn.edit,
.app.is-today .swipe-btn.delete { width: 48px; }
.app.is-today .gesture-tip {
  font-size: 11px;
  line-height: normal;
  font-weight: 400;
  white-space: normal;
}
.app.is-today .gesture-tip .tip-lead { color: var(--color-text-primary); }
.app.is-today .add-task {
  position: fixed;
  left: 50%;
  bottom: calc(var(--today-nav-size) + var(--today-add-gap) + var(--today-dock-bottom));
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: min(calc(100% - 40px), 350px);
  height: var(--today-add-size);
  min-height: var(--today-add-size);
  padding: 0 16px;
  border: 0;
  border-radius: 16px;
  background: var(--color-add-fill);
  color: var(--color-accent-off-white);
  box-shadow: none;
  font-size: 14px;
  line-height: 18px;
  font-weight: 600;
  transform: translateX(-50%);
}
.app.is-today .add-mark {
  color: var(--color-accent-red);
  font-size: 22px;
  line-height: 26px;
  font-weight: 600;
}
.app.is-today .nav {
  width: min(calc(100% - 40px), 350px);
}
.app.is-today .nav button {
  border-radius: 16px;
  font-size: 14px;
  line-height: normal;
}
.app.is-today .nav .icon { display: none; }

.app.is-add {
  --keyboard-inset: 0px;
  --add-selected: #352725;
  gap: 10px;
  height: 100dvh;
  max-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-padding-bottom: calc(12px + var(--keyboard-inset));
  padding: max(14px, env(safe-area-inset-top)) 20px calc(12px + var(--keyboard-inset) + env(safe-area-inset-bottom));
}
.app.is-add .header { min-height: 62px; align-items: center; }
.app.is-add .eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  letter-spacing: 0;
  line-height: normal;
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-secondary);
}
.app.is-add .brand-logo {
  width: auto;
  height: 18px;
  object-fit: contain;
  display: block;
}
.app.is-add .brand-logo[hidden] { display: none; }
.app.is-add .header h1 {
  margin: 0;
  font-size: 26px;
  line-height: 39px;
  font-weight: 700;
}
.app.is-add .theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 18px;
}
.app.is-add #addBack .add-back-label { display: none; }
:root:not([data-theme="dark"]) .add-back-icon { filter: brightness(0); }
.app.is-add.is-feature #addBack {
  width: 79px;
  border-radius: 999px;
  padding: 8px 10px;
}
.app.is-add.is-feature #addBack .add-back-icon { display: none; }
.app.is-add.is-feature #addBack .add-back-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  line-height: normal;
  white-space: nowrap;
}
.app.is-add #addView {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.app.is-add .quick-add {
  flex: 1 0 auto;
  min-height: 100%;
  background: transparent;
  padding: 0;
  border-radius: 0;
  gap: 10px;
}
.app.is-add .name-card,
.app.is-add .option-panel {
  background: var(--color-bg-surface);
  border-radius: 20px;
  padding: 14px;
}
.app.is-add .name-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.app.is-add .field-label,
.app.is-add .name-card .field-label {
  margin: 0;
  font-size: 12px;
  line-height: normal;
  font-weight: 400;
}
.app.is-add .words-btn {
  align-self: flex-start;
  max-width: 100%;
  min-height: 32px;
  margin: -2px 0 -6px;
  padding: 6px 2px;
  border: 0;
  background: transparent;
  color: var(--color-accent-red-text);
  font-size: 13px;
  line-height: 20px;
  font-weight: 600;
  text-align: left;
}
.app.is-add .words-btn[hidden] { display: none; }
.app.is-add .name-card input {
  height: 48px;
  padding: 0 14px;
  font-size: 14px;
  line-height: 22px;
}
.app.is-add .quick-add > .date-field,
.app.is-add .date-control {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 52px;
  min-height: 52px;
  margin: 0;
  padding: 14px;
  border: 0;
  border-radius: 20px;
  background: var(--color-bg-surface);
  text-align: left;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.app.is-add .date-control .field-label { flex: 0 0 auto; }
.app.is-add .date-control .num {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--color-accent-red);
  font-weight: 500;
  font-size: 14px;
  line-height: 18px;
}
.app.is-add .date-control .date-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  background: none;
  mask: none;
  -webkit-mask: none;
}
.app.is-add .quick-add > .chips { flex-wrap: nowrap; gap: 8px; }
.app.is-add .quick-add > .chips .chip {
  flex: 1 1 0;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  padding: 8px 4px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: normal;
}
.app.is-add .chip.active {
  background: var(--add-selected);
  border-color: var(--color-accent-red);
  box-shadow: none;
  color: var(--color-accent-red);
  font-weight: 500;
}
.app.is-add .panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 24px;
}
.app.is-add .panel-title {
  margin: 0;
  color: var(--color-text-primary);
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
}
.app.is-add .panel-close {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
}
.app.is-add #timePanel,
.app.is-add #detailPanel { gap: 8px; }
.app.is-add #repeatPanel { gap: 12px; }
.app.is-add .time-readout {
  position: relative;
  height: 46px;
  min-height: 46px;
  border-radius: 14px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: normal;
}
.app.is-add .time-readout img { position: absolute; left: 14px; }
.app.is-add #timeReadout,
.app.is-add #timeSuffix {
  font-family: var(--font-num);
  font-weight: 600;
  font-size: 22px;
  line-height: normal;
}
.app.is-add #timeSuffix { font-family: var(--font-sans); white-space: pre; }
.app.is-add .time-readout.is-empty #timeReadout {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
}
.app.is-add #taskDetail {
  min-height: 98px;
  border: 1px solid var(--color-bg-elevated);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 24px;
}
.app.is-add .repeat-modes,
.app.is-add .repeat-spans { flex-wrap: nowrap; gap: 8px; }
.app.is-add .repeat-modes .chip,
.app.is-add .repeat-spans .chip,
.app.is-add .repeat-custom {
  height: 38px;
  min-height: 38px;
  border: 1px solid var(--color-bg-elevated);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  line-height: normal;
}
.app.is-add .repeat-spans .chip { flex: 1 1 0; }
.app.is-add .repeat-spans .num {
  font-family: var(--font-num);
  font-weight: 400;
}
.app.is-add .repeat-custom {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
  font-weight: 400;
}
.app.is-add .repeat-custom.active {
  background: var(--add-selected);
  border-color: var(--color-accent-red);
  color: var(--color-accent-red);
}
.app.is-add .days { gap: 4px; }
.app.is-add .days label { min-height: 38px; }
.app.is-add .days input {
  width: 100%;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--color-bg-elevated);
}
.app.is-add .days span { font-size: 12px; line-height: normal; font-weight: 500; }
.app.is-add .days input:checked {
  background: var(--add-selected);
  border-color: var(--color-accent-red);
}
.app.is-add .days input:checked + span { color: var(--color-accent-red); }
.app.is-add #repeatEndField { gap: 8px; display: flex; flex-direction: column; }
.app.is-add #repeatEndField .date-control {
  height: 46px;
  min-height: 46px;
  padding: 0;
  background: transparent;
}
.app.is-add .repeat-summary {
  margin: 0;
  border-top: 1px solid var(--color-border-default);
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.app.is-add .repeat-frequency,
.app.is-add .repeat-range,
.app.is-add .repeat-count-line { margin: 0; }
.app.is-add .repeat-range[hidden],
.app.is-add .repeat-count-line[hidden] { display: none; }
.app.is-add .repeat-frequency {
  color: var(--color-text-primary);
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
}
.app.is-add .repeat-summary.is-error .repeat-frequency {
  color: var(--color-accent-red);
  font-size: 12px;
  line-height: 17px;
  font-weight: 400;
}
.app.is-add .repeat-range {
  font-family: var(--font-num);
  font-size: 12px;
  font-weight: 400;
  line-height: normal;
  color: var(--color-text-secondary);
}
.app.is-add .repeat-count-line { display: flex; align-items: center; gap: 6px; }
.app.is-add #repeatCount {
  font-family: var(--font-num);
  font-size: 20px;
  font-weight: 600;
  line-height: normal;
  color: var(--color-accent-red);
}
.app.is-add #repeatUnit {
  font-size: 12px;
  line-height: 17px;
  font-weight: 400;
  color: var(--color-text-secondary);
}
.app.is-add .add-spacer { flex: 1 1 auto; min-height: 0; }
.app.is-add .save-btn {
  width: 100%;
  height: 49px;
  min-height: 49px;
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 15px;
  line-height: normal;
  font-weight: 600;
}
.app.is-add .nav { display: none; }

.app.is-settings,
.app.is-pro {
  gap: 8px;
  height: 100dvh;
  max-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  padding: max(14px, env(safe-area-inset-top)) 20px calc(84px + env(safe-area-inset-bottom));
}
.app.is-pro {
  gap: 0;
  padding: max(20px, env(safe-area-inset-top)) 20px 0;
}
.app.is-pro .header { display: none; }
.app.is-settings .header { min-height: 61px; align-items: flex-start; }
.app.is-pro .header { min-height: 0; align-items: flex-start; }
.app.is-settings .eyebrow,
.app.is-pro .eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 18px;
  margin: 0;
  letter-spacing: 0;
  line-height: 18px;
  font-size: 10px;
  font-weight: 600;
}
.app.is-settings .brand-logo,
.app.is-pro .brand-logo {
  width: auto;
  height: 18px;
  object-fit: contain;
  display: block;
}
.app.is-settings .brand-logo[hidden],
.app.is-pro .brand-logo[hidden] { display: none; }
.app.is-settings .header h1,
.app.is-pro .header h1 {
  margin: 0;
  font-size: 26px;
  line-height: 43px;
  font-weight: 700;
}
.app.is-settings .theme-btn,
.app.is-pro #addBack {
  width: 36px;
  height: 36px;
  border-radius: 18px;
}
.app.is-pro #addBack .add-back-label { display: none; }
.app.is-pro .nav { display: none; }
.app.is-reflection {
  gap: 0;
  height: 100dvh;
  max-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  padding: max(24px, env(safe-area-inset-top)) 24px 32px;
}
.app.is-reflection .header,
.app.is-reflection .nav { display: none; }
#reflectionView[hidden] { display: none; }
.app.is-reflection #reflectionView:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.reflection-back {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text-secondary);
  font: 500 14px/23px var(--font-sans);
}
.reflection-title {
  margin: 0;
  color: var(--color-text-primary);
  font: 600 20px/28px var(--font-sans);
}
.reflection-lead,
.reflection-range,
.reflection-scope,
.reflection-count {
  margin: 8px 0 0;
  color: var(--color-text-secondary);
  font: 400 14px/22px var(--font-sans);
}
.reflection-scope,
.reflection-count { font-size: 13px; line-height: 20px; }
.reflection-kicker {
  margin: 36px 0 0;
  color: var(--color-text-primary);
  font: 500 15px/22px var(--font-sans);
}
.reflection-rate-lead {
  margin: 8px 0 0;
  color: var(--color-text-primary);
  font: 600 22px/30px var(--font-sans);
}
.reflection-percent {
  display: flex;
  align-items: flex-start;
  margin: 4px 0 0;
  color: var(--color-text-primary);
  font-family: var(--font-num);
  font-size: 96px;
  line-height: 104px;
  font-weight: 700;
}
.reflection-mark {
  margin-top: 14px;
  font-family: var(--font-sans);
  font-size: 28px;
  line-height: 34px;
  font-weight: 600;
}
.reflection-status {
  margin: 36px 0 0;
  color: var(--color-text-primary);
  font: 500 18px/28px var(--font-sans);
}
.app.is-settings #settingsView,
.app.is-pro #proView { gap: 8px; }
.pro-banner {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 12px;
  border: 0;
  border-radius: 16px;
  background: var(--color-bg-surface);
  color: inherit;
  text-align: left;
}
.pro-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pro-banner .pro-kicker {
  margin: 0;
  color: var(--color-accent-red);
  font-size: 11px;
  line-height: 16px;
  font-weight: 600;
}
.pro-banner strong {
  font-size: 14px;
  line-height: 22px;
  font-weight: 700;
}
.pro-banner .pro-copy > span:last-child {
  color: var(--color-text-secondary);
  font-size: 12px;
  line-height: 20px;
  font-weight: 400;
}
.pro-banner:active { background: var(--color-bg-elevated); }
.current-plan {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--color-border-default);
  border-radius: 16px;
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
}
.current-plan-kicker {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
}
.current-plan-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.current-plan-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.current-plan-name {
  margin: 0;
  font-size: 22px;
  line-height: 30px;
  font-weight: 700;
}
.current-plan-body,
.current-plan-quiet,
.current-plan-detail {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 22px;
  font-weight: 400;
}
.current-plan-mark { flex: 0 0 auto; width: 28px; height: 28px; }
.current-plan-crown {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  background: var(--color-text-primary);
  -webkit-mask: url("assets/settings/crown.svg") center / contain no-repeat;
  mask: url("assets/settings/crown.svg") center / contain no-repeat;
}
.current-plan-rule {
  height: 1px;
  background: var(--color-border-default);
}
.current-plan-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--color-text-primary);
  font-size: 14px;
  line-height: 22px;
  font-weight: 600;
}
.current-plan-chip {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--color-success-bg);
  color: var(--color-success);
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
}
.current-plan-cta,
.current-plan-retry {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  background: var(--color-nav-active-bg);
  color: var(--color-nav-active-fg);
  font: 600 15px/22px var(--font-sans);
}
.current-plan-retry { border-radius: 12px; }
.current-plan-cta:focus-visible,
.current-plan-retry:focus-visible {
  outline: 2px solid var(--color-accent-red);
  outline-offset: 2px;
}
.pro-open {
  flex: 0 0 auto;
  min-width: 92px;
  height: 44px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--color-accent-red);
  color: var(--color-accent-off-white);
  display: grid;
  place-items: center;
  font-size: 13px;
  line-height: normal;
  font-weight: 600;
  white-space: nowrap;
}
.settings-section { display: flex; flex-direction: column; gap: 6px; }
/* The sections are shown or hidden from app.js (in the app: Alarm, no Web
   Push; in a browser: Web Push, no Alarm). Without this the flex above wins
   over the hidden attribute and every section stays on screen. */
.settings-section[hidden] { display: none; }
.settings-section h2 {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 11px;
  line-height: normal;
  font-weight: 600;
}
.settings-group {
  background: var(--color-bg-surface);
  border-radius: 16px;
  overflow: hidden;
}
.settings-row[hidden] { display: none; }
.settings-row {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border: 0;
  background: transparent;
  color: var(--color-text-primary);
  text-align: left;
  font-size: 14px;
  line-height: normal;
  font-weight: 500;
}
.settings-group > * + * { border-top: 1px solid var(--color-border-default); }
.settings-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
button.settings-note {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  color: var(--color-accent-red-text);
}
.settings-note,
.settings-row #appLockState {
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: normal;
  font-weight: 400;
  flex: 0 0 auto;
}
.settings-row.is-danger,
.settings-row.is-danger .settings-label { color: var(--color-accent-red); }
.settings-avatar {
  width: 32px;
  height: 32px;
  border-radius: 16px;
  background: var(--color-border-default);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
#accountEmail {
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: normal;
  font-weight: 400;
  overflow-wrap: anywhere;
}
.app.is-settings .locale-switch {
  margin: 0;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: nowrap;
}
.app.is-settings .locale-switch { align-items: center; }
.app.is-settings .locale-switch button[aria-pressed="false"] { display: none; }
.app.is-settings .locale-switch button {
  min-height: 28px;
  height: 28px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 20px;
  font-weight: 600;
}
.app.is-settings .locale-switch button[aria-pressed="true"] {
  background: var(--color-nav-active-bg);
  border-color: transparent;
  color: var(--color-nav-active-fg);
}
.app.is-settings .locale-chevron { display: block; flex: 0 0 auto; }
#appLockButton { position: relative; }
#appLockState {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}
.theme-switch {
  width: 44px;
  height: 26px;
  border: 0;
  border-radius: 13px;
  background: var(--color-border-default);
  position: relative;
  flex: 0 0 auto;
  padding: 0;
}
.theme-switch::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 10px;
  background: var(--color-text-secondary);
  top: 3px;
  left: 3px;
}
.theme-switch[aria-pressed="true"] { background: var(--color-accent-red); }
.theme-switch[aria-pressed="true"]::after {
  left: 21px;
  background: var(--color-accent-off-white);
}
.app.is-settings .sync-state { font-size: 13px; font-weight: 400; color: var(--color-text-secondary); }
.app.is-settings .sync-state.ok::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  background: #4ade80;
  vertical-align: 1px;
}
.app.is-settings .nav {
  width: min(calc(100% - 40px), 350px);
  height: 55px;
  bottom: max(12px, env(safe-area-inset-bottom));
}
.app.is-settings .nav button {
  border-radius: 16px;
  font-size: 14px;
  line-height: normal;
}
.app.is-settings .nav .icon { display: none; }
.pro-note {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 12px;
  line-height: 20px;
}
dialog.calendar-sheet {
  position: fixed;
  top: auto;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  max-width: none;
  height: auto;
  max-height: calc(100dvh - 24px);
  margin: 0;
  overflow: auto;
  border-radius: 20px 20px 0 0;
  padding: 8px 20px calc(34px + env(safe-area-inset-bottom));
  background: var(--color-bg-surface);
}
dialog.calendar-sheet::backdrop { background: rgba(0, 0, 0, 0.38); }
.calendar-sheet-body { gap: 4px; }
.calendar-handle {
  width: 32px;
  height: 3px;
  margin: 0 auto 4px;
  border-radius: 99px;
  background: var(--color-border-default);
}
.calendar-sheet h3 {
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
  text-align: left;
}
.calendar-sheet .calendar-preview {
  margin: 0;
  text-align: left;
  color: var(--color-accent-red);
  font-family: var(--font-num);
  font-size: 16px;
  line-height: 20px;
  font-weight: 500;
}
.calendar-month {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.calendar-month-label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
}
.calendar-nav-group { display: flex; flex: 0 0 auto; }
.calendar-month-label strong {
  font-size: 28px;
  line-height: 36px;
  font-weight: 600;
}
.calendar-month-label .num {
  font-family: var(--font-num);
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  color: var(--color-text-secondary);
}
.calendar-nav {
  width: 40px;
  height: 44px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--color-text-primary);
  display: grid;
  place-items: center;
}
.calendar-arrow {
  width: 18px;
  height: 18px;
  background: currentColor;
  mask: url('assets/calendar/next.svg') center / contain no-repeat;
  -webkit-mask: url('assets/calendar/next.svg') center / contain no-repeat;
}
.calendar-arrow.is-prev {
  mask-image: url('assets/calendar/prev.svg');
  -webkit-mask-image: url('assets/calendar/prev.svg');
}
.calendar-weekdays, .calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-width: 0;
}
.calendar-weekdays span {
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 12px;
  line-height: 17px;
}
.calendar-day {
  position: relative;
  height: 48px;
  min-width: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--color-text-primary);
  font-family: var(--font-num);
  font-size: 20px;
  line-height: 28px;
  font-weight: 500;
}
.calendar-day .num { font-family: var(--font-num); font-weight: 500; }
:root[data-theme="dark"] .calendar-day.is-outside { color: #717377; }
:root:not([data-theme="dark"]) .calendar-day.is-outside { color: var(--color-text-secondary); }
.calendar-day.is-selected { color: var(--color-accent-red); }
.calendar-day.is-locked, .calendar-day:disabled { opacity: 0.32; cursor: default; }
.calendar-day.is-locked .calendar-dot { display: none; }
.calendar-nav:disabled { opacity: 0.32; cursor: default; }
.calendar-nav:focus,
.calendar-nav:focus-visible { outline: none; box-shadow: none; }
.calendar-dot {
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-accent-red);
  transform: translateX(-50%);
}
.calendar-actions { margin-top: 8px; gap: 12px; }
.calendar-actions button {
  min-height: 52px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 600;
}
.calendar-actions #calendarCancel {
  flex: 0 0 104px;
  background: transparent;
  color: var(--color-text-secondary);
  font-weight: 500;
}

#alarmProposal .alarm-demo {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 16px;
  background: var(--color-bg-surface);
}
#alarmProposal .alarm-demo > span:first-child {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  line-height: 22px;
}
#alarmProposal .alarm-untimed {
  min-height: 46px;
  margin: 0;
  padding: 12px;
  border-radius: 16px;
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
  font-size: 15px;
  line-height: 22px;
}
#alarmProposal .alarm-bell {
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--color-text-secondary);
}
#alarmProposal .alarm-bell.is-on { color: var(--color-accent-red); }
#alarmProposal .alarm-glyph {
  display: block;
  width: 18px;
  height: 18px;
  margin: 0 auto;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 3.2a1 1 0 0 1 1 1V5a6 6 0 0 1 5.2 5.9v2.2l1.2 2.1a1 1 0 0 1-.9 1.5H5.5a1 1 0 0 1-.9-1.5l1.2-2.1v-2.2A6 6 0 0 1 11 5V4.2a1 1 0 0 1 1-1zm-2.2 15.2a2.2 2.2 0 0 0 4.4 0h-4.4z'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 3.2a1 1 0 0 1 1 1V5a6 6 0 0 1 5.2 5.9v2.2l1.2 2.1a1 1 0 0 1-.9 1.5H5.5a1 1 0 0 1-.9-1.5l1.2-2.1v-2.2A6 6 0 0 1 11 5V4.2a1 1 0 0 1 1-1zm-2.2 15.2a2.2 2.2 0 0 0 4.4 0h-4.4z'/%3E%3C/svg%3E") center / contain no-repeat;
}
#alarmProposal .alarm-lead {
  position: absolute;
  top: 2px;
  right: 4px;
  font-family: var(--font-num);
  font-size: 10px;
  line-height: 12px;
  font-weight: 600;
}

.proposal { gap: 8px; padding: 20px; }
.proposal-mark {
  margin: 0;
  color: var(--color-accent-red);
  font-size: 12px;
  line-height: 17px;
  font-weight: 600;
}
.app.is-pro #proView:not([hidden]) {
  flex: 1 0 auto;
  min-height: calc(100dvh - max(20px, env(safe-area-inset-top)));
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.app.is-pro #proView[hidden] { display: none; }
.pro-back {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text-secondary);
  font: 500 14px/23px var(--font-sans);
}
.member-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--color-border-default);
  border-radius: 16px;
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
}
.member-card[hidden] { display: none; }
.member-head { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.member-mark { font: 700 20px/1.3 var(--font-sans); letter-spacing: 0.02em; }
.member-mark.is-pro { color: var(--color-accent-red-text); }
.member-kind {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--color-bg-elevated);
  color: var(--color-text-secondary);
  font: 600 12px/18px var(--font-sans);
}
.member-left { margin: 2px 0 0; font: 700 28px/1.25 var(--font-sans); }
.member-until { margin: 0; color: var(--color-text-secondary); font: 500 14px/1.5 var(--font-sans); }
.member-until-date { color: var(--color-accent-red-text); font-weight: 700; }
.member-details {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  margin: 4px 0 -6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text-primary);
  font: 600 14px/1.4 var(--font-sans);
}
.member-chevron { color: var(--color-text-secondary); font-size: 20px; line-height: 1; }
.member-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.member-action {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--color-border-default);
  border-radius: 12px;
  background: var(--color-bg-elevated);
  color: var(--color-accent-red-text);
  font: 600 14px/1.4 var(--font-sans);
}
.member-quiet { margin: 0; color: var(--color-text-secondary); font: 500 14px/1.5 var(--font-sans); }
.member-error { margin: 0; font: 600 15px/1.4 var(--font-sans); }
.member-details:focus-visible,
.member-action:focus-visible {
  outline: 2px solid var(--color-accent-red);
  outline-offset: 2px;
}
#memberDialog {
  position: fixed;
  top: auto;
  right: max(8px, env(safe-area-inset-right, 0px));
  bottom: max(8px, env(safe-area-inset-bottom, 0px));
  left: max(8px, env(safe-area-inset-left, 0px));
  width: auto;
  max-width: none;
  max-height: calc(100dvh - 16px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  margin: 0;
  padding: 0;
  overflow: hidden;
  display: none;
  flex-direction: column;
  border: 0;
  border-radius: 20px;
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
}
#memberDialog[open] { display: flex; }
@media (min-width: 720px) {
  #memberDialog {
    top: 50%;
    bottom: auto;
    left: 50%;
    width: min(480px, calc(100dvw - 48px));
    max-height: min(640px, calc(100dvh - 48px));
    transform: translate(-50%, -50%);
  }
}
.member-dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 16px 16px;
}
.member-dialog-body:focus { outline: none; }
.member-row { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; border-top: 1px solid var(--color-border-default); }
.member-row:first-child { border-top: 0; }
.member-label { color: var(--color-text-secondary); font: 500 12px/1.4 var(--font-sans); }
.member-value { font: 600 15px/1.5 var(--font-sans); }
.member-note { margin: 0; color: var(--color-text-secondary); font: 400 13px/1.5 var(--font-sans); }
.member-list { display: flex; flex-direction: column; gap: 4px; margin: 2px 0 0; padding: 0; list-style: none; font: 400 14px/1.5 var(--font-sans); }
.member-list li { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.member-date { color: var(--color-text-secondary); }
.pro-heading { display: flex; flex-direction: column; gap: 6px; }
.pro-heading .pro-kicker {
  margin: 0;
  color: var(--color-accent-red);
  font-size: 13px;
  line-height: normal;
  font-weight: 600;
}
.pro-heading h1 {
  margin: 0;
  font-size: 28px;
  line-height: 34px;
  font-weight: 700;
}
.pro-promise {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  font-weight: 700;
}
.pro-lead {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 20px;
  font-weight: 400;
}
.app.is-pro .pro-carousel {
  width: calc(100% + 40px);
  margin-inline: -20px;
  container-type: inline-size;
}
.pro-carousel {
  --pro-gap: 12px;
  --pro-card: min(310px, calc(100cqw - 64px));
  --pro-inset: calc((100cqw - var(--pro-card)) / 2);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pro-rail {
  display: flex;
  gap: var(--pro-gap);
  height: 136px;
  padding-inline: var(--pro-inset);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--pro-inset);
  overscroll-behavior-x: contain;
  /* Touch scrolls natively (1.0.2 fix): the browser follows the finger on
     the compositor, picks the axis, and snaps one card at a time. With
     pan-y the finger was followed by script instead, and a slight vertical
     move handed the touch to the page (pointercancel): the rail jumped back. */
  touch-action: pan-x pan-y;
  scrollbar-width: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.pro-rail.is-dragging {
  scroll-snap-type: none;
  cursor: grabbing;
}
.pro-rail::-webkit-scrollbar { display: none; }
.feature-card {
  position: relative;
  flex: 0 0 var(--pro-card);
  width: var(--pro-card);
  height: 136px;
  scroll-snap-align: center;
  /* A fast flick stops on the next card, never skips one. */
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--color-border-default);
  border-radius: 16px;
  background: #212223;
  color: #f8f5ef;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
.feature-card img {
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}
.feature-art {
  position: absolute;
  display: block;
  background: transparent;
  pointer-events: none;
}
.feature-card .feature-art {
  top: 0;
  left: 50%;
  width: calc(136px * 930 / 409);
  height: 136px;
  transform: translateX(-50%);
}
.feature-icon, .feature-copy { position: relative; z-index: 1; }
.feature-icon {
  display: flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
}
.feature-card .feature-icon { flex: 0 0 24px; }
.feature-card .feature-icon img { display: block; width: 18px; height: 18px; }
.feature-copy { display: flex; flex-direction: column; gap: 4px; width: 100%; max-width: 278px; }
.feature-card .feature-copy { flex: 0 0 auto; }
.feature-copy strong {
  font-size: 16px;
  line-height: 22px;
  font-weight: 700;
}
.feature-card .feature-copy strong { line-height: 27px; }
.feature-body, .cloud-card .feature-copy > span {
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 18px;
  font-weight: 400;
}
.feature-card .feature-body {
  display: block;
  max-width: 180px;
  color: #a4a5a6;
  white-space: pre-line;
}
.feature-card .feature-body > span { white-space: pre; }
.feature-body .accent, .feature-copy .accent {
  color: var(--color-accent-red);
  font-weight: 700;
}
.feature-card .feature-body .accent { color: #ef4b42; }
.feature-card.is-near .feature-art {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 28px;
}
.feature-card.is-near .feature-art img { width: 56px; height: 56px; }
.feature-soon {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  padding: 1px 8px;
  border: 1px solid #ef4b42;
  border-radius: 99px;
  background: rgba(33, 34, 35, 0.88);
  color: #ef4b42;
  font-size: 11px;
  line-height: 16px;
  font-weight: 700;
}
.pro-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 8px;
  gap: 6px;
}
.pro-dots button {
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: var(--color-mark-open);
}
.pro-dots button[aria-current="true"] {
  width: 16px;
  background: var(--color-accent-red);
}
.compare-open {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--color-border-default);
  border-radius: 14px;
  background: var(--color-bg-surface);
  color: var(--color-accent-red);
  font: 600 14px/20px var(--font-sans);
}
.compare-inline {
  margin-top: 4px;
  border: 1px solid var(--color-border-default);
  border-radius: 20px;
  overflow: hidden;
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
}
.compare-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  padding: 14px 14px 8px 16px;
  background: var(--color-bg-surface);
}
.compare-bar h2 {
  margin: 0;
  font-size: 18px;
  line-height: 26px;
  font-weight: 700;
}
.compare-close {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
  font: 600 13px/20px var(--font-sans);
}
.compare-open:focus-visible,
.compare-close:focus-visible {
  outline: 2px solid var(--color-accent-red);
  outline-offset: 2px;
}
.compare-scroll:focus {
  outline: none;
}
/* Not a scroll box: the table sits inline on the PRO page (1.0.2) and is
   never wider than the screen (fixed layout, 100% width). As a scroll box
   that could not scroll, with overscroll-behavior: contain left from the old
   sheet, it swallowed vertical drags that start on the table, so the page
   only moved from outside it. Drags on it now move the page. */
.compare-scroll {
  overflow: visible;
}
.compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}
.compare-table th,
.compare-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--color-border-default);
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
  text-align: center;
  overflow-wrap: anywhere;
  vertical-align: middle;
}
.compare-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--color-bg-surface);
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
}
.compare-table th:first-child,
.compare-table td:first-child { width: 50%; text-align: left; padding-left: 16px; }
.compare-table th:nth-child(2),
.compare-table td:nth-child(2) { width: 25%; }
.compare-table th:nth-child(3),
.compare-table td:nth-child(3) { width: 25%; }
@media (max-width: 360px) {
  .compare-bar { padding: 12px 10px 8px 12px; }
  .compare-bar h2 { font-size: 16px; line-height: 22px; }
  .compare-table th,
  .compare-table td { padding: 8px 4px; font-size: 12px; line-height: 16px; }
  .compare-table th:first-child,
  .compare-table td:first-child { padding-left: 10px; }
}
.compare-table .is-pro {
  background: rgba(230, 64, 55, 0.1);
  color: var(--color-text-primary);
}
:root[data-theme="dark"] .compare-table .is-pro { background: rgba(239, 75, 66, 0.16); }
.compare-table thead th.is-pro {
  color: var(--color-accent-red);
  background: var(--color-bg-surface);
  box-shadow: inset 0 -2px 0 var(--color-accent-red);
}
.compare-table .compare-group th {
  padding-top: 14px;
  background: var(--color-bg-elevated);
  color: var(--color-text-secondary);
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
  text-align: left;
}
.compare-mark { position: relative; font-family: var(--font-num); font-size: 16px; font-weight: 700; }
.compare-mark.is-yes { color: var(--color-accent-red); }
.compare-mark.is-no { color: var(--color-mark-open); font-weight: 500; }
.compare-note { color: var(--color-text-secondary); font-size: 12px; line-height: 16px; font-weight: 600; }
.compare-table td.compare-span {
  width: auto;
  padding-top: 4px;
  padding-bottom: 12px;
  text-align: left;
  color: var(--color-text-secondary);
  font-size: 11px;
  line-height: 15px;
  font-weight: 500;
}
.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;
}
.app.is-compare-open { overflow: hidden; }
.cloud-card[hidden] { display: none; }
.cloud-card {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--color-bg-surface);
}
.cloud-card .feature-copy { width: auto; }
.plan-list { display: flex; flex-direction: column; gap: 8px; }
.plan-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 72px;
  padding: 10px 14px;
  border: 0;
  border-radius: 16px;
  background: var(--color-bg-surface);
  color: inherit;
  text-align: left;
}
.plan-option.is-plain { min-height: 60px; }
.plan-option:has(.plan-badge) { min-height: 76px; }
.plan-option.is-selected { background: var(--color-bg-elevated); }
.plan-identity { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.plan-choice { display: flex; align-items: center; gap: 6px; min-height: 28px; }
.plan-name { font-size: 16px; line-height: 1.5; font-weight: 600; }
.plan-name .num, .plan-save .num, .plan-prices .num, .plan-cta .num { font-family: var(--font-num); }
.plan-badge {
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--color-accent-red);
  color: var(--color-accent-off-white);
  font-size: 11px;
  line-height: 22px;
  font-weight: 600;
}
.plan-save { color: var(--color-text-secondary); font-size: 12px; line-height: 18px; font-weight: 500; }
.plan-prices { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; width: 128px; }
.plan-was {
  position: relative;
  display: inline-block;
  color: #3a3f44;
  font-family: var(--font-num);
  font-size: 15px;
  line-height: 20px;
  font-weight: 500;
  text-decoration: none;
}
.plan-was::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: currentColor;
  transform: translateY(-50%);
  pointer-events: none;
}
:root[data-theme="dark"] .plan-was { color: #a4a5a6; }
.plan-prices strong { font-size: 22px; line-height: 30px; font-weight: 700; }
.pro-spacer { flex: 1 1 auto; min-height: 12px; }
.pro-cta {
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding: 12px 0 max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, transparent, var(--color-bg-base) 16px);
}
.plan-cta {
  width: 100%;
  height: 54px;
  border: 0;
  border-radius: 16px;
  background: var(--color-accent-red);
  color: var(--color-accent-off-white);
  font: 600 16px/1.4 var(--font-sans);
}
.plan-cta::before, .plan-cta::after { content: none; }
/* PRO with no end date has nothing to renew. Active and ended PRO see "ต่ออายุ PRO". */
.is-pro-open .pro-cta,
.is-pro-open .pro-spacer,
.is-pro-open #planRenew { display: none; }
.plan-cta[hidden] { display: none; }
.plan-renew { display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; padding: 12px 14px; border-radius: 14px; background: var(--color-bg-surface); color: var(--color-text-primary); font: 400 14px/1.5 var(--font-sans); }
.plan-renew[hidden] { display: none; }
.plan-renew p { margin: 0; }
.plan-renew-now { font-weight: 600; }
.plan-renew-rule, .plan-renew-new { color: var(--color-text-secondary, inherit); }
.plan-note { margin: 8px 2px 0; font: 400 13px/1.5 var(--font-sans); color: var(--color-text-primary); text-align: center; }
.plan-note[hidden] { display: none; }
.plan-badge.is-current { background: var(--color-text-primary); color: var(--color-bg-surface); }

.admin-page { background: var(--color-bg-base); color: var(--color-text-primary); }
.admin-frame {
  width: 100%;
  max-width: 1120px;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: max(20px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
}
.admin-body { position: relative; min-width: 0; }
.admin-content { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.admin-panel { display: flex; flex-direction: column; gap: 24px; }
.admin-page-head h2 { margin: 0; font-size: 27px; line-height: 34px; font-weight: 700; }
.admin-page-head p { margin: 6px 0 0; color: var(--color-text-secondary); font-size: 15px; line-height: 22px; font-weight: 400; }
.admin-toolbar { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.admin-accounts-body { display: flex; flex-direction: column; gap: 16px; }
.admin-controls { display: flex; flex-direction: column; gap: 12px; }
.admin-block { display: flex; flex-direction: column; gap: 12px; }
.admin-block[hidden] { display: none; }
.admin-block h3 { margin: 0; font-size: 18px; line-height: 26px; font-weight: 600; }
.admin-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.admin-top-main { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 220px; }
.admin-top-main img { width: auto; height: 24px; object-fit: contain; flex: 0 0 auto; }
.admin-top h1 { margin: 0; font-size: 22px; line-height: 30px; font-weight: 700; }
.admin-top-side { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-left: auto; }
.admin-owner { margin: 0; max-width: 280px; color: var(--color-text-secondary); font-size: 13px; line-height: 19px; overflow-wrap: anywhere; }
.admin-owner[hidden] { display: none; }
.admin-menu {
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 14px;
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
  font-weight: 700;
}
.admin-nav {
  display: none;
  flex-direction: column;
  gap: 4px;
}
.admin-nav.is-open {
  display: flex;
  position: absolute;
  z-index: 5;
  inset: 0 0 auto 0;
  padding: 8px;
  border-radius: 16px;
  background: var(--color-bg-surface);
}
.admin-nav button,
.admin-range button,
.admin-filters button {
  min-height: 42px;
  border: 0;
  border-radius: 14px;
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
  font-weight: 600;
  padding: 0 14px;
  text-align: start;
}
.admin-nav button { position: relative; display: flex; align-items: center; gap: 10px; }
.admin-nav svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}
.admin-nav button[aria-current="page"] {
  background: var(--color-nav-active-bg);
  color: var(--color-nav-active-fg);
}
.admin-nav button[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--color-accent-red);
}
.admin-range button[aria-pressed="true"],
.admin-filters button[aria-pressed="true"] {
  background: var(--color-nav-active-bg);
  color: var(--color-nav-active-fg);
}
.admin-range, .admin-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-filters[hidden] { display: none; }
.admin-window { margin: 0; color: var(--color-text-secondary); font-size: 12px; line-height: 16px; font-weight: 400; }
.admin-window:empty, .admin-updated:empty { display: none; }
.admin-metrics, .admin-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.admin-pair { grid-template-columns: 1fr; }
.admin-metric {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  background: var(--color-bg-surface);
  border-radius: 16px;
  padding: 16px;
  border-top: 3px solid transparent;
}
.admin-metric.is-blue { border-top-color: #2f6fdb; }
.admin-metric.is-green { border-top-color: #1f8a4c; }
.admin-metric.is-red { border-top-color: var(--color-accent-red); }
.admin-metric p { margin: 0; }
.admin-k { color: var(--color-text-secondary); font-size: 13px; line-height: 18px; font-weight: 600; }
.admin-v { display: flex; align-items: baseline; gap: 6px; font-size: 34px; line-height: 40px; font-weight: 700; }
.admin-unit { font-size: 14px; line-height: 18px; font-weight: 600; color: var(--color-text-secondary); }
.admin-dash { font-weight: 700; }
.admin-metric.is-blue .admin-v { color: #1d4e96; }
.admin-metric.is-green .admin-v { color: #176b3a; }
.admin-metric.is-red .admin-v { color: var(--color-accent-red-text); }
:root[data-theme="dark"] .admin-metric.is-blue .admin-v { color: #a9c8ff; }
:root[data-theme="dark"] .admin-metric.is-green .admin-v { color: #8ed7a8; }
.admin-metric .admin-unit { color: var(--color-text-secondary); }
.admin-since, .admin-sub { margin: 0; font-size: 12px; line-height: 16px; font-weight: 400; color: var(--color-text-secondary); }
.admin-sub { margin-top: 2px; }
.admin-funnel { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 12px; }
.admin-funnel li {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  background: var(--color-bg-surface);
  border-radius: 16px;
  padding: 14px 16px;
}
.admin-step-head { display: flex; align-items: center; gap: 8px; }
.admin-step {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
}
.admin-funnel li.is-blue .admin-step { background: #d7e4fa; color: #1d4e96; }
.admin-funnel li.is-green .admin-step { background: #d7efdf; color: #176b3a; }
.admin-funnel li.is-red .admin-step { background: #f8d9d6; color: var(--color-accent-red-text); }
:root[data-theme="dark"] .admin-funnel li.is-blue .admin-step { background: #24344d; color: #a9c8ff; }
:root[data-theme="dark"] .admin-funnel li.is-green .admin-step { background: #1d3326; color: #8ed7a8; }
:root[data-theme="dark"] .admin-funnel li.is-red .admin-step { background: #3d2624; color: #ffb1ab; }
.admin-step-name { font-size: 15px; line-height: 22px; font-weight: 600; }
.admin-funnel-value { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.admin-funnel-value strong, .admin-funnel .admin-dash { font-size: 28px; line-height: 34px; font-weight: 700; }
.admin-funnel-value small { color: var(--color-text-secondary); font-size: 12px; line-height: 16px; font-weight: 400; }
.admin-source-rows { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.admin-source-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.admin-source-row span { color: var(--color-text-secondary); font-size: 13px; line-height: 18px; font-weight: 400; }
.admin-source-row strong { font-size: 18px; line-height: 24px; font-weight: 700; }
.admin-signup-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.admin-signup-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-signup .admin-status:empty, .admin-signup .admin-fault:empty, .admin-signup .admin-since:empty { display: none; }
.admin-recent, .admin-tester-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.admin-recent .admin-source-row span:first-child, .admin-tester-list .admin-source-row span { overflow-wrap: anywhere; min-width: 0; }
.admin-tester-form { margin-top: 12px; }
.admin-signup .admin-retry[aria-pressed="true"] { border-color: var(--color-accent-red); }
.admin-warnings { display: flex; flex-direction: column; gap: 8px; }
.admin-warnings p {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
  font-size: 13px;
  line-height: 19px;
  font-weight: 400;
}
.admin-method { border-radius: 16px; background: var(--color-bg-surface); padding: 14px 16px; }
.admin-method summary { cursor: pointer; font-size: 15px; line-height: 22px; font-weight: 600; }
.admin-notes { margin: 12px 0 0; padding-left: 18px; color: var(--color-text-secondary); font-size: 13px; line-height: 19px; font-weight: 400; }
.admin-notes li + li { margin-top: 8px; }
.admin-updated { margin: 0; color: var(--color-text-secondary); font-size: 12px; line-height: 16px; font-weight: 400; }
.admin-mix-bar { display: flex; height: 16px; width: 100%; border-radius: 8px; overflow: hidden; background: var(--color-bg-elevated); }
.admin-mix-bar span { display: block; height: 100%; }
.admin-mix-bar .is-free { background: #8d9298; }
.admin-mix-bar .is-pro { background: var(--color-accent-red); }
:root[data-theme="dark"] .admin-mix-bar .is-free { background: #b0b4b8; }
.admin-mix-legend { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; }
.admin-mix-label { margin: 0; font-size: 14px; line-height: 20px; font-weight: 600; }
.admin-mix-label.is-pro { color: var(--color-accent-red-text); }
.admin-rate-note { margin: 0; font-size: 15px; line-height: 22px; font-weight: 600; }
.admin-rates, .admin-age-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.admin-age-slot {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  background: var(--color-bg-surface);
  border-radius: 16px;
  padding: 16px;
}
.admin-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  max-width: 100%;
  min-height: 22px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
}
.admin-badge.is-amber { background: #f4e4c4; color: #7a4e0d; }
:root[data-theme="dark"] .admin-badge.is-amber { background: #3f3422; color: #f0d7a2; }
.admin-badge.is-pro { background: color-mix(in srgb, var(--color-accent-red) 18%, var(--color-bg-surface)); color: var(--color-accent-red-text); }
.admin-badge.is-free { background: #e4e2de; color: #3d4146; }
:root[data-theme="dark"] .admin-badge.is-free { background: #3b3d40; color: #e6e4df; }
@media (min-width: 900px) {
  .admin-menu { display: none; }
  .admin-body { display: flex; align-items: flex-start; gap: 28px; }
  .admin-nav, .admin-nav.is-open {
    display: flex;
    position: static;
    width: 220px;
    flex: 0 0 220px;
    padding: 0;
    background: transparent;
  }
  .admin-content { flex: 1; }
  .admin-metrics, .admin-pair, .admin-funnel, .admin-rates { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .admin-age-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.admin-header { display: flex; align-items: center; gap: 12px; }
.admin-header img { width: 36px; height: 36px; object-fit: contain; flex: 0 0 auto; }
.admin-heading { min-width: 0; flex: 1; }
.admin-heading p {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 19px;
  font-weight: 600;
}
.admin-heading h1 {
  margin: 0;
  font-size: 23px;
  line-height: 33px;
  font-weight: 700;
}
.admin-theme {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 21px;
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
  display: grid;
  place-items: center;
}
.admin-theme svg { width: 18px; height: 18px; }
.admin-sample {
  margin: 0;
  border-radius: 14px;
  padding: 10px 12px;
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
  font-size: 13px;
  line-height: 19px;
}
.admin-page .login-form input,
.admin-search input,
.admin-page #adminCode {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 16px;
  background: var(--color-bg-elevated);
  padding: 0 16px;
  font-size: 16px;
  line-height: 22px;
  outline: none;
}
.admin-page .login-form input:focus,
.admin-search input:focus,
.admin-page #adminCode:focus { box-shadow: inset 0 0 0 1.5px var(--color-accent-red); }
.admin-search { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.admin-search[hidden] { display: none; }
.admin-search-field { flex: 1 1 180px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.admin-search-field span { color: var(--color-text-secondary); font-size: 13px; line-height: 19px; font-weight: 500; }
.admin-search .primary-btn { flex: 0 0 auto; min-height: 48px; padding: 0 16px; }
.admin-alert { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.admin-alert[hidden] { display: none; }
.admin-fault { flex: 1 0 100%; margin: 0; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--color-text-secondary); overflow-wrap: anywhere; }
.admin-fault:empty { display: none; }
.admin-status { margin: 0; min-height: 22px; font-size: 15px; line-height: 22px; font-weight: 600; }
.admin-status:empty { display: none; }
.admin-status[data-state="failed"],
.admin-status[data-state="forbidden"] { color: var(--color-accent-red-text); }
.admin-retry, .admin-signout, .admin-pager button {
  min-height: 42px;
  border: 0;
  border-radius: 14px;
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
  font-weight: 600;
}
.admin-retry { align-self: flex-start; padding: 0 16px; }
.admin-retry[hidden],
.admin-signout[hidden],
.admin-sample[hidden],
#adminAuth[hidden],
#adminOverview[hidden],
#adminAccounts[hidden],
#adminCodeStep[hidden] { display: none; }
#adminAuth .login-form { max-width: 420px; }
.admin-table-wrap { display: none; min-width: 0; }
.admin-table-wrap[hidden], .admin-cards[hidden] { display: none; }
.admin-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.admin-table th, .admin-table td {
  text-align: start;
  vertical-align: top;
  padding: 14px 10px;
  border-bottom: 1px solid var(--color-border-default);
}
.admin-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--color-bg-surface) 72%, transparent); }
.admin-table th { font-size: 12px; line-height: 16px; color: var(--color-text-secondary); font-weight: 600; }
.admin-table th:nth-child(1), .admin-table td:nth-child(1) { width: 32%; }
.admin-table th:nth-child(2), .admin-table td:nth-child(2) { width: 20%; }
.admin-table th:nth-child(3), .admin-table td:nth-child(3) { width: 24%; }
.admin-table th:nth-child(4), .admin-table td:nth-child(4) { width: 24%; }
.admin-plan-cell .admin-badge { margin-bottom: 4px; }
.admin-when { margin: 0; font-size: 14px; line-height: 20px; font-weight: 600; }
.admin-slots { display: flex; gap: 14px; }
.admin-slot { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.admin-slot-n { margin: 0; font-size: 19px; line-height: 24px; font-weight: 700; }
.admin-slot.is-date .admin-slot-n { font-size: 14px; line-height: 20px; font-weight: 600; }
.admin-slot-k { margin: 0; font-size: 12px; line-height: 16px; font-weight: 400; color: var(--color-text-secondary); }
.admin-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.admin-account {
  background: var(--color-bg-surface);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
}
.admin-card-summary {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
  padding: 8px 12px;
  cursor: pointer;
}
.admin-card-summary:focus-visible { outline: 2px solid var(--color-accent-red); outline-offset: -2px; }
.admin-card-summary .admin-email {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-card-brief { display: flex; align-items: center; gap: 8px; flex: none; }
.admin-brief {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 16px;
  font-weight: 700;
}
.admin-brief svg, .admin-chevron { width: 16px; height: 16px; flex: none; }
.admin-chevron { color: var(--color-text-secondary); }
.admin-card-summary[aria-expanded="true"] .admin-chevron { transform: rotate(180deg); }
.admin-card-detail { display: flex; flex-direction: column; gap: 12px; padding: 0 12px 12px; }
.admin-card-detail .admin-manage { flex: none; align-self: flex-start; padding: 0 14px; }
#proEmail { margin: 0; color: var(--color-text-primary); font-size: 16px; line-height: 24px; font-weight: 700; overflow-wrap: anywhere; }
#proState, #proFields { display: flex; flex-direction: column; gap: 8px; }
#proDialog .admin-pro-confirm { margin: 0; color: var(--color-text-primary); font-size: 15px; line-height: 22px; font-weight: 600; }
.admin-pro-sources, .admin-pro-history { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.admin-pro-history { max-height: 140px; overflow: auto; color: var(--color-text-secondary); font-size: 13px; line-height: 19px; }
#proDialog .dialog-actions { flex-wrap: wrap; }
#proStatus.error { color: var(--color-accent-red-text); }
.admin-card-detail[hidden] { display: none; }
.admin-card-meta { display: flex; flex-direction: column; gap: 2px; }
.admin-card-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.admin-card-stats .is-date, .admin-card-stats .is-wide { grid-column: 1 / -1; }
.admin-email { margin: 0; font-size: 15px; line-height: 22px; font-weight: 600; overflow-wrap: break-word; }
.admin-pager { display: flex; align-items: center; gap: 8px; }
.admin-pager[hidden] { display: none; }
.admin-pager button { flex: 1; }
.admin-pager p { margin: 0; min-width: 64px; text-align: center; font-weight: 700; }
.admin-signout { padding: 0 16px; }
.admin-page .auth-status.error { color: var(--color-accent-red-text); }

.export-row { display: flex; justify-content: flex-end; margin: -2px 0 0; }
.export-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--color-text-secondary);
  font: 600 13px/20px var(--font-sans);
}
.export-open .icon { color: var(--color-accent-red); display: inline-grid; }
.export-open .icon svg { width: 18px; height: 18px; }
.export-open:disabled { opacity: 0.6; }
dialog.export-dialog { width: min(calc(100% - 24px), 420px); padding: 18px; }
.export-head { display: flex; flex-direction: column; gap: 2px; }
.dialog .export-meta { color: var(--color-text-secondary); font-size: 14px; line-height: 21px; }
.export-preview {
  max-height: min(52dvh, 460px);
  overflow: auto;
  border-radius: 14px;
  background: #ffffff;
  color: #1f2124;
  border: 1px solid var(--color-border-default);
}
.export-preview .sheet { padding: 16px 14px; font-size: 13px; }
.dialog .export-empty { padding: 28px 16px; text-align: center; color: #5c6166; font-size: 14px; line-height: 21px; }
.dialog .export-hint { font-size: 12px; line-height: 18px; }
.dialog-actions button:disabled { opacity: 0.55; }

.sheet {
  font-family: var(--font-sans);
  color: #1f2124;
  background: #ffffff;
  font-size: 11pt;
  line-height: 1.5;
}
.sheet p, .sheet h1, .sheet ol { margin: 0; padding: 0; color: inherit; font-size: inherit; line-height: inherit; }
.sheet .sheet-head { padding-bottom: 10px; margin-bottom: 4px; border-bottom: 2px solid #e64037; }
.sheet .sheet-brand { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 0.85em; letter-spacing: 0.04em; color: #5c6166; }
.sheet .sheet-brand img { display: block; width: auto; height: 1.4em; }
.sheet .sheet-date { font-size: 1.55em; line-height: 1.35; font-weight: 600; color: #1f2124; }
.sheet .sheet-progress { font-size: 0.9em; color: #5c6166; }
.sheet .sheet-list { list-style: none; }
.sheet .sheet-item {
  display: grid;
  grid-template-columns: 1.3em minmax(0, 1fr) auto;
  gap: 0 0.7em;
  align-items: start;
  padding: 0.6em 0;
  border-bottom: 1px solid #d9d7d3;
  break-inside: avoid;
  page-break-inside: avoid;
}
.sheet .sheet-box {
  width: 1.15em;
  height: 1.15em;
  margin-top: 0.2em;
  border: 1.5px solid #1f2124;
  border-radius: 0.25em;
  display: grid;
  place-items: center;
  font-weight: 700;
  line-height: 1;
  color: #ffffff;
}
.sheet .sheet-item.is-done .sheet-box { background: #e64037; border-color: #e64037; }
.sheet .sheet-copy { min-width: 0; }
.sheet .sheet-line { display: flex; flex-wrap: wrap; gap: 0 0.5em; }
.sheet .sheet-time { color: #c4322b; font-weight: 600; white-space: nowrap; }
.sheet .sheet-name, .sheet .sheet-detail { overflow-wrap: anywhere; word-break: break-word; }
.sheet .sheet-name { font-weight: 500; }
.sheet .sheet-detail { white-space: pre-wrap; color: #3f4347; font-size: 0.92em; margin-top: 0.15em; }
.sheet .sheet-status { font-size: 0.85em; font-weight: 600; white-space: nowrap; color: #c4322b; }
.sheet .sheet-item.is-done .sheet-status { color: #5c6166; }


/* Inside the Android app (TWA) nothing can be bought unless this app sells the
   packs through Google Play and the owner put a pack on sale (can-buy). Never a
   price or a pay button that points elsewhere. The web's "checkout not open"
   dialog never shows in the app. */
.is-twa:not(.can-buy) #planList,
.is-twa:not(.can-buy) #planRenew,
.is-twa:not(.can-buy) .pro-cta,
.is-twa:not(.can-buy) .pro-spacer,
.is-twa #planDialog { display: none !important; }

.alarm-diag pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 11px;
  line-height: 1.4;
  max-height: 50vh;
  overflow: auto;
  user-select: text;
}

/* Feedback form: one topic picker styled like the dialog inputs. */
.dialog select {
  width: 100%;
  border: 0;
  border-radius: 14px;
  background: var(--color-bg-elevated) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.33 6L8 10.67L12.67 6' stroke='%23A4A5A6' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center / 16px 16px;
  color: var(--color-text-primary);
  padding: 12px 40px 12px 14px;
  font: inherit;
  font-size: 16px;
  line-height: 22px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.dialog select:focus { box-shadow: inset 0 0 0 1.5px var(--color-accent-red); }
.dialog select:invalid, .dialog select option[value=""] { color: var(--color-text-secondary); }
.feedback-form .field-label { margin-top: 4px; }
.feedback-note { color: var(--color-text-secondary); font-size: 12px; line-height: 17px; }

/* Settings: long notes and test details fold under one "Details" line. */
.settings-more { margin-bottom: 8px; }
.settings-more summary { cursor: pointer; color: var(--color-text-secondary, #8a8f98); font-weight: 500; }
.settings-more[open] summary { margin-bottom: 6px; }
.settings-more > p, .settings-more > ul { margin: 6px 0 0; }
.settings-more .settings-row { margin-top: 6px; }
.settings-more .alarm-diag { margin-top: 8px; }

/* Feedback: fields (idle / sending / error) or the saved view, inside one dialog. */
.feedback-fields { display: flex; flex-direction: column; gap: 12px; }
.feedback-fields[hidden], .feedback-done[hidden] { display: none; }
.feedback-form .feedback-status.error {
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--color-accent-red) 12%, transparent);
  font-weight: 500;
}
.feedback-form .primary-btn.is-busy { opacity: 0.7; cursor: progress; }
.feedback-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--color-border-default);
  text-align: center;
}
.feedback-done-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--color-success-bg);
  color: var(--color-success);
}
.feedback-done h4 { margin: 4px 0 0; font-size: 18px; line-height: 26px; font-weight: 700; color: var(--color-text-primary); overflow-wrap: anywhere; }
.dialog .feedback-done p { max-width: 32ch; overflow-wrap: anywhere; }
.dialog .feedback-done .feedback-done-note {
  align-self: stretch;
  max-width: none;
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--color-bg-elevated);
  font-size: 12px;
  line-height: 17px;
}
.feedback-done .primary-btn { align-self: stretch; min-height: 44px; margin-top: 6px; }

/* Privacy Policy and Terms (/privacy, /terms) */
/* overflow-x: hidden on html/body turns body into a scroll box and breaks sticky; clip keeps the guard without that. */
html:has(body.legal-page), body.legal-page { overflow-x: clip; }
.legal-frame {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.legal-top {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -4px;
  padding: 6px 4px;
  background: var(--color-bg-base);
}
.legal-back {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--color-text-secondary);
  font: 500 14px/23px var(--font-sans);
  text-decoration: none;
}
.legal-tools { display: flex; align-items: center; gap: 8px; }
.legal-tools .locale-switch { margin: 0; flex-wrap: nowrap; }
.legal-tools .locale-switch button { min-height: 32px; padding: 0 10px; font-size: 12px; }
.legal-theme {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--color-border-default);
  border-radius: 999px;
  background: transparent;
  color: var(--color-text-primary);
}
.legal-theme svg { width: 18px; height: 18px; }
.legal-layout { display: flex; flex-direction: column; gap: 16px; padding-top: 8px; }
.legal-head { display: flex; flex-direction: column; gap: 8px; }
.legal-kicker {
  margin: 0;
  color: var(--color-accent-red-text);
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
}
.legal-head h1 {
  margin: 0;
  font-size: 28px;
  line-height: 40px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.legal-lead { margin: 0; font-size: 15px; line-height: 25px; color: var(--color-text-primary); }
.legal-updated { margin: 0; font-size: 13px; line-height: 20px; color: var(--color-text-secondary); }
.legal-draft {
  margin: 4px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--color-accent-red);
  color: var(--color-text-primary);
  font-size: 13px;
  line-height: 20px;
  font-weight: 500;
}
.legal-draft[hidden] { display: none; }
.legal-toc {
  padding: 14px 14px 10px;
  border-radius: 16px;
  background: var(--color-bg-surface);
}
.legal-toc h2 {
  margin: 0 0 6px;
  color: var(--color-text-secondary);
  font-size: 11px;
  line-height: normal;
  font-weight: 600;
}
.legal-toc ol { margin: 0; padding: 0 0 0 22px; }
.legal-toc li { padding: 2px 0; font-size: 14px; line-height: 22px; }
.legal-toc li::marker { color: var(--color-text-secondary); font-family: var(--font-num); font-size: 12px; }
.legal-toc a { display: inline-block; padding: 4px 0; color: var(--color-text-primary); text-decoration: none; overflow-wrap: anywhere; }
.legal-toc a:hover, .legal-toc a:focus-visible { color: var(--color-accent-red-text); }
.legal-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.legal-section {
  scroll-margin-top: 64px;
  padding: 16px;
  border-radius: 16px;
  background: var(--color-bg-surface);
  font-size: 15px;
  line-height: 26px;
  overflow-wrap: anywhere;
}
.legal-section h2 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 28px;
  font-weight: 600;
}
.legal-no { color: var(--color-accent-red-text); font-size: 15px; font-weight: 600; }
.legal-section p { margin: 0 0 10px; }
.legal-section ul { margin: 0 0 10px; padding-left: 20px; }
.legal-section li + li { margin-top: 6px; }
.legal-section li::marker { color: var(--color-text-secondary); }
.legal-action {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  background: var(--color-accent-red);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.legal-action:focus-visible { outline: 2px solid var(--color-text-primary); outline-offset: 2px; }
.legal-pending {
  padding: 1px 4px;
  border-radius: 6px;
  background: rgba(239, 75, 66, 0.16);
  color: var(--color-accent-red-text);
  font-weight: 600;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.legal-top-link {
  display: inline-block;
  margin-top: 2px;
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 20px;
}
.legal-foot { padding: 8px 0 0; text-align: center; font-size: 14px; }
.legal-foot a { color: var(--color-accent-red-text); }
@media (min-width: 900px) {
  .legal-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 680px);
    grid-template-areas: "head head" "toc body" ". foot";
    column-gap: 32px;
    justify-content: center;
  }
  .legal-head { grid-area: head; max-width: 972px; }
  .legal-toc { grid-area: toc; position: sticky; top: 64px; align-self: start; max-height: calc(100dvh - 80px); overflow-y: auto; }
  .legal-body { grid-area: body; }
  .legal-foot { grid-area: foot; }
}

.auth-legal {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 11px;
  line-height: 16px;
  text-align: center;
  overflow-wrap: anywhere;
}
.auth-legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
a.settings-row { text-decoration: none; }
.legal-section:focus { outline: none; }
.legal-section:focus-visible { box-shadow: inset 0 0 0 1.5px var(--color-accent-red); }

/* 1.0.2: inside the Android app, Web Push shows only in support mode, titled as the browser's. */
.push-title-browser { display: none; }
#pushSection.is-browser-only .push-title-device { display: none; }
#pushSection.is-browser-only .push-title-browser { display: inline; }

/* 1.0.2: widget privacy while the PIN is on (this device only). */
.widget-privacy { margin-top: 10px; }
.widget-privacy-title { margin: 0; padding: 12px 16px 4px; font-size: 13px; color: var(--color-text-secondary); }
.widget-privacy-note { margin: 0; padding: 4px 16px 12px; font-size: 12px; line-height: 1.45; color: var(--color-text-secondary); }
.widget-privacy-choice { width: 100%; text-align: start; cursor: pointer; }
.widget-privacy-mark { width: 20px; height: 20px; border-radius: 50%; border: 2px solid currentColor; opacity: .45; flex: none; box-sizing: border-box; }
.widget-privacy-choice[aria-checked="true"] .widget-privacy-mark { opacity: 1; border-color: var(--color-accent-red); background: radial-gradient(circle, var(--color-accent-red) 0 45%, transparent 50%); }

/* Version line at the very end of Settings, above the bottom navigation
   (the page keeps 96px + the safe area free under its last item). */
.app-version {
  margin: 8px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--color-text-secondary);
  letter-spacing: 0.02em;
}
