:root {
  color-scheme: dark;
  --timer-bg: #100b08;
  --timer-shell: #130d0a;
  --timer-panel: #1f1815;
  --timer-panel-soft: #2a211d;
  --timer-line: rgba(255, 236, 216, 0.12);
  --timer-line-strong: rgba(255, 236, 216, 0.18);
  --timer-text: #f9f4ef;
  --timer-muted: #a79e9a;
  --timer-dim: #756c67;
  --timer-gold: #e3bc72;
  --timer-ember: #e37449;
  --timer-ember-dark: #6f311f;
  --timer-green: #58d98f;
  --timer-red: #ff5d66;
  --timer-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--timer-bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--timer-bg);
  color: var(--timer-text);
  font-family: Poppins, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button,
a,
select,
input {
  -webkit-tap-highlight-color: transparent;
}

.timer-app {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 50% -12%, rgba(113, 48, 28, 0.42), transparent 42%),
    linear-gradient(180deg, #160e0a 0%, #0e0907 100%);
}

.timer-shell {
  width: min(100%, 430px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 14px 16px 22px;
  background:
    radial-gradient(circle at 54% 0%, rgba(44, 22, 14, 0.8), transparent 36%),
    var(--timer-shell);
  border: 1px solid var(--timer-line);
  border-radius: 38px;
  box-shadow: var(--timer-shadow);
}

.timer-active-screen {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timer-appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  gap: 14px;
}

.timer-brand,
.timer-ios-link {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  color: var(--timer-text);
  text-decoration: none;
}

.timer-brand {
  gap: 10px;
}

.timer-brand-icon,
.timer-full-app-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
}

.timer-brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.timer-brand-icon img,
.timer-full-app-icon img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.timer-brand strong {
  overflow: hidden;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timer-ios-link {
  flex: 0 0 auto;
  gap: 7px;
  color: #cfc6c1;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.timer-ios-link span,
.timer-full-app-button span {
  font-size: 1.55em;
  line-height: 0.6;
  text-decoration: none;
}

.timer-title-block {
  display: grid;
  gap: 5px;
  padding: 8px 0 12px;
  text-align: center;
}

.timer-title {
  margin: 0;
  color: var(--timer-text);
  font-size: clamp(1.72rem, 8.2vw, 2.15rem);
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1;
}

.timer-title-block p {
  margin: 0;
  color: var(--timer-gold);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  line-height: 1.1;
  text-transform: uppercase;
}

.timer-session-card,
.timer-panel,
.timer-history,
.timer-upgrade,
.timer-full-app-card {
  border: 1px solid var(--timer-line);
  background: rgba(32, 24, 20, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.timer-session-card {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 0;
  min-height: 142px;
  align-items: center;
  border-color: rgba(227, 188, 114, 0.2);
  border-radius: 24px;
  padding: 18px 18px 14px;
}

.timer-session-elapsed,
.timer-session-current {
  min-width: 0;
}

.timer-session-elapsed {
  padding-right: 14px;
}

.timer-session-current {
  padding-left: 18px;
  border-left: 1px solid var(--timer-line);
  text-align: right;
}

.timer-session-card span,
.timer-section-head h2,
.timer-upgrade-kicker,
.timer-full-app-card p {
  margin: 0;
  color: var(--timer-muted);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.timer-session-card strong {
  display: block;
  margin: 11px 0 8px;
  color: var(--timer-text);
  font-family: Montserrat, Poppins, system-ui, sans-serif;
  font-size: clamp(2.52rem, 12.8vw, 3.72rem);
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 0.82;
  white-space: nowrap;
}

.timer-session-elapsed strong {
  color: #c9c2bd;
  font-size: clamp(2.28rem, 11.4vw, 3.08rem);
}

.timer-session-card small {
  display: block;
  overflow: hidden;
  color: var(--timer-muted);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timer-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.timer-status-pill i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--timer-gold);
  box-shadow: 0 0 22px rgba(227, 188, 114, 0.76);
}

.timer-progress-track {
  position: relative;
  grid-column: 1 / -1;
  height: 6px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.timer-progress-track span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c6a15f, var(--timer-gold));
}

.timer-progress-track i {
  display: none;
}

.timer-round-dots {
  display: flex;
  grid-column: 1 / -1;
  justify-content: center;
  gap: 7px;
  margin-top: 16px;
}

.timer-round-dots span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  letter-spacing: 0;
}

.timer-round-dots .active {
  background: var(--timer-gold);
  box-shadow: 0 0 0 7px rgba(227, 188, 114, 0.18);
}

.timer-control-dock {
  display: grid;
}

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

.timer-button {
  display: inline-flex;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 850;
  gap: 9px;
  padding: 10px;
  text-align: center;
  text-decoration: none;
}

.timer-button[data-action="start"],
.timer-button[data-action="resume"] {
  grid-column: 1 / -1;
  min-height: 58px;
  border-radius: 20px;
  font-size: 0.98rem;
  box-shadow: 0 18px 48px rgba(227, 116, 73, 0.28);
}

.timer-button-primary {
  border-color: rgba(255, 190, 143, 0.16);
  background: linear-gradient(180deg, #e87f52, #db6d43);
  color: #fffaf5;
}

.timer-button-secondary {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.07);
  color: #d1cac5;
}

.timer-button-danger {
  border-color: rgba(255, 93, 102, 0.16);
  background: rgba(255, 93, 102, 0.12);
  color: #ff797f;
}

.timer-button-muted {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--timer-muted);
}

.timer-signals {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px 14px;
  min-height: 24px;
  margin: 0;
}

.timer-signals span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--timer-muted);
  font-size: 0.66rem;
  font-weight: 800;
  white-space: nowrap;
}

.timer-signals i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #7b746f;
}

.timer-signals [data-storage-status] i,
.timer-signals [data-offline-status] i {
  background: var(--timer-green);
  box-shadow: 0 0 16px rgba(88, 217, 143, 0.68);
}

.timer-panel,
.timer-history,
.timer-upgrade,
.timer-full-app-card {
  border-radius: 24px;
  padding: 16px 16px;
  scroll-margin-top: 18px;
}

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

.timer-section-head p {
  margin: 0;
  color: var(--timer-muted);
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

.timer-section-head button {
  border: 0;
  background: transparent;
  color: var(--timer-ember);
  cursor: pointer;
  font-weight: 900;
}

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

.timer-stepper-card {
  min-width: 0;
  min-height: 62px;
  border: 1px solid var(--timer-line);
  border-radius: 15px;
  background: var(--timer-panel-soft);
  padding: 8px 9px 7px;
}

.timer-stepper-card > span {
  display: block;
  margin-bottom: 6px;
  color: var(--timer-muted);
  font-size: 0.66rem;
  font-weight: 900;
}

.timer-stepper-card div {
  display: grid;
  grid-template-columns: 32px minmax(2.5ch, 1fr) 32px;
  align-items: center;
  gap: 6px;
}

.timer-stepper-card button {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--timer-text);
  cursor: pointer;
  font-size: 1.02rem;
  font-weight: 900;
  line-height: 1;
}

.timer-stepper-card strong {
  min-width: 2.4ch;
  color: var(--timer-text);
  font-family: Montserrat, Poppins, system-ui, sans-serif;
  font-size: 1.28rem;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  line-height: 1;
  text-align: center;
}

.timer-stepper-card small {
  display: block;
  margin-top: 2px;
  color: var(--timer-dim);
  font-size: 0.58rem;
  font-weight: 900;
  text-align: center;
}

.timer-options {
  margin-top: 8px;
}

.timer-options summary {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  gap: 7px;
  color: #d5ceca;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 850;
  list-style-position: inside;
}

.timer-options summary::marker {
  color: #d5ceca;
}

.timer-options summary b {
  color: var(--timer-muted);
}

.timer-options summary strong {
  color: #d5ceca;
}

.timer-select-label,
.timer-waitlist label {
  display: grid;
  gap: 8px;
  color: #d0cac8;
  font-size: 0.78rem;
  font-weight: 800;
}

.timer-select-label {
  margin-top: 12px;
}

.timer-select-label select,
.timer-waitlist input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 14px;
  background: var(--timer-panel);
  color: var(--timer-text);
  padding: 0 13px;
}

.timer-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  color: #d0cac8;
  font-weight: 800;
}

.timer-toggle strong,
.timer-toggle small {
  display: block;
}

.timer-toggle strong {
  font-size: 0.82rem;
}

.timer-toggle small {
  margin-top: 4px;
  color: var(--timer-muted);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.25;
}

.timer-toggle input {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 26px;
  appearance: none;
  border-radius: 999px;
  background: var(--timer-ember);
  cursor: pointer;
}

.timer-toggle input::after {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  content: "";
  transition: transform 0.2s ease;
}

.timer-toggle input:not(:checked) {
  background: rgba(255, 255, 255, 0.12);
}

.timer-toggle input:not(:checked)::after {
  transform: translateX(-16px);
}

.timer-full-app-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 106px;
  border-color: rgba(227, 116, 73, 0.22);
  background:
    radial-gradient(circle at 92% 10%, rgba(227, 116, 73, 0.27), transparent 42%),
    rgba(34, 22, 17, 0.96);
}

.timer-full-app-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.timer-full-app-card h2 {
  margin: 6px 0 3px;
  color: var(--timer-text);
  font-size: 0.92rem;
  line-height: 1.12;
}

.timer-full-app-card small {
  display: block;
  color: var(--timer-muted);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.35;
}

.timer-full-app-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 66px;
  min-height: 42px;
  border-radius: 14px;
  background: linear-gradient(180deg, #eb8458, #df7146);
  color: #fffaf5;
  font-size: 0.86rem;
  font-weight: 850;
  text-decoration: none;
  box-shadow: 0 14px 34px rgba(227, 116, 73, 0.24);
}

.timer-history ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.timer-history li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--timer-muted);
  font-size: 0.78rem;
  line-height: 1.55;
  list-style: none;
}

.timer-history strong {
  color: var(--timer-text);
}

.timer-upgrade h2 {
  margin: 8px 0;
  color: var(--timer-text);
  font-size: 1rem;
  line-height: 1.2;
}

.timer-upgrade p {
  color: var(--timer-muted);
}

.timer-upgrade-actions,
.timer-waitlist {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.timer-waitlist p {
  min-height: 20px;
  margin: 0;
  color: var(--timer-muted);
}

.timer-install {
  display: grid;
  gap: 7px;
  margin: 14px 0 4px;
  text-align: center;
}

.timer-install-button {
  border: 0;
  background: transparent;
  color: var(--timer-ember);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 850;
}

.timer-install-help {
  max-width: 26rem;
  margin: 0 auto;
  color: var(--timer-muted);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.35;
}

[hidden] {
  display: none !important;
}

@media (max-width: 380px) {
  .timer-shell {
    padding: 12px 12px 18px;
    border-radius: 30px;
  }

  .timer-active-screen {
    gap: 9px;
  }

  .timer-title-block {
    padding: 6px 0 10px;
  }

  .timer-session-card {
    min-height: 136px;
    border-radius: 22px;
    padding: 16px 16px 14px;
  }

  .timer-session-current {
    padding-left: 18px;
  }

  .timer-session-elapsed {
    padding-right: 14px;
  }

  .timer-session-card strong {
    font-size: clamp(2.2rem, 12.4vw, 3.2rem);
  }

  .timer-session-elapsed strong {
    font-size: clamp(2rem, 10.6vw, 2.7rem);
  }

  .timer-button[data-action="start"],
  .timer-button[data-action="resume"] {
    min-height: 54px;
  }

  .timer-panel,
  .timer-history,
  .timer-upgrade,
  .timer-full-app-card {
    border-radius: 20px;
    padding: 14px 12px;
  }

  .timer-stepper-card {
    min-height: 60px;
    padding: 8px 8px 7px;
  }

  .timer-stepper-card div {
    grid-template-columns: 30px minmax(2.4ch, 1fr) 30px;
    gap: 5px;
  }

  .timer-stepper-card button {
    width: 30px;
    height: 30px;
  }

  .timer-stepper-card strong {
    font-size: 1.18rem;
  }

  .timer-full-app-card {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 9px;
  }

  .timer-full-app-icon {
    width: 38px;
    height: 38px;
  }

  .timer-full-app-button {
    min-width: 58px;
  }
}

@media (max-width: 340px) {
  .timer-brand strong {
    font-size: 0.78rem;
  }

  .timer-ios-link {
    font-size: 0.74rem;
  }

  .timer-session-card small,
  .timer-full-app-card small {
    font-size: 0.78rem;
  }

  .timer-stepper-grid {
    gap: 8px;
  }

  .timer-stepper-card {
    padding: 8px 7px;
  }

  .timer-stepper-card > span {
    font-size: 0.6rem;
  }

  .timer-stepper-card div {
    grid-template-columns: 30px minmax(2.2ch, 1fr) 30px;
  }

  .timer-stepper-card button {
    width: 30px;
    height: 30px;
  }

  .timer-full-app-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .timer-full-app-icon {
    display: none;
  }
}

@media (min-width: 760px) {
  .timer-app {
    padding: 24px;
  }

  .timer-shell {
    min-height: calc(100dvh - 48px);
  }
}
