:root {
  --bg: #111318;
  --panel: #181b22;
  --panel-2: #20242d;
  --text: #f1f3f7;
  --muted: #a8b0bf;
  --line: #313743;
  --accent: #48c78e;
  --accent-2: #5aa7ff;
  --warn: #f6b44b;
  --danger: #ff6b6b;
  --radius: 8px;
  --max: 1160px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px max(18px, calc((100vw - var(--max)) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(17, 19, 24, 0.94);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 760;
}

.brand-mark {
  width: 18px;
  height: 18px;
  border: 3px solid var(--accent);
  border-right-color: var(--accent-2);
  border-radius: 50%;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(168, 176, 191, 0.24);
  border-radius: var(--radius);
  color: #d5dae5;
  background: rgba(24, 27, 34, 0.5);
  font-weight: 680;
}

.nav a:hover {
  border-color: rgba(90, 167, 255, 0.42);
  background: var(--panel-2);
  color: var(--text);
}

.nav a.nav-create {
  border-color: rgba(72, 199, 142, 0.45);
  background: rgba(31, 69, 54, 0.72);
  color: var(--text);
}

.nav a.nav-create:hover {
  border-color: rgba(72, 199, 142, 0.7);
  background: #1f4536;
}

.nav-plus,
.nav-heart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.nav-heart {
  color: #ff8ea0;
}

.nav-plus svg,
.nav-heart svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 18px 56px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(360px, 1.2fr);
  gap: 26px;
  align-items: center;
  padding: 34px 0 28px;
}

.timer-hero {
  min-height: calc(100vh - 140px);
}

.hero-copyblock {
  display: grid;
  gap: 16px;
  align-content: center;
}

.timer-hero .hero-copyblock {
  max-width: 440px;
  gap: 14px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero h1,
.page-title h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2.1rem, 6vw, 5.2rem);
  line-height: 0.96;
}

.hero-copy,
.page-title p {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.05rem;
}

.timer-hero h1 {
  max-width: 520px;
  font-size: clamp(2rem, 4.6vw, 4.25rem);
  line-height: 0.98;
}

.timer-hero .hero-copy {
  max-width: 430px;
  font-size: 0.98rem;
}

.timer-hero .eyebrow {
  margin-bottom: 4px;
  font-size: 0.72rem;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.breadcrumbs a,
.breadcrumbs span {
  display: inline-flex;
  align-items: center;
}

.breadcrumbs a {
  color: var(--accent);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--text);
}

.breadcrumbs a::after {
  content: "/";
  margin-left: 8px;
  color: #5d6573;
}

.quick-panel,
.side-panel,
.timer-card,
.editor-panel,
.player,
.library-list,
.related-timers-panel,
.timer-plan-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.quick-panel,
.side-panel,
.editor-panel,
.library-list,
.related-timers-panel,
.timer-plan-panel {
  padding: 18px;
}

.quick-panel h2,
.side-panel h2,
.timer-plan-panel h2 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.section {
  margin-top: 28px;
}

.text-section {
  max-width: 820px;
  padding: 26px 0;
}

.text-section h2,
.guide-section h2 {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 4vw, 3rem);
  line-height: 1.05;
}

.text-section p:last-child {
  color: var(--muted);
  font-size: 1.04rem;
}

.privacy-action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 14px;
}

.privacy-action .form-status {
  margin: 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.8rem;
}

.section-head > a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(168, 176, 191, 0.24);
  border-radius: var(--radius);
  color: #d5dae5;
  background: rgba(24, 27, 34, 0.28);
  font-size: 0.92rem;
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: rgba(213, 218, 229, 0.34);
  text-underline-offset: 3px;
}

.section-head > a:hover {
  border-color: rgba(90, 167, 255, 0.46);
  color: var(--text);
  text-decoration-color: currentColor;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 12px;
  margin: 0 0 18px;
}

.toolbar.has-submit {
  grid-template-columns: minmax(0, 1fr) 220px auto;
}

.search-results-toolbar {
  grid-template-columns: minmax(0, 1fr) 190px 140px auto;
}

.category-search-toolbar {
  grid-template-columns: minmax(0, 1fr) auto;
}

.duration-chooser {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px 12px;
  align-items: center;
  margin: 0 0 10px;
}

.duration-chooser-label .eyebrow {
  margin: 0;
}

.duration-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.duration-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(72, 199, 142, 0.35);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(72, 199, 142, 0.1);
  font-weight: 780;
  text-decoration: none;
}

.duration-pill:hover {
  border-color: rgba(90, 167, 255, 0.58);
  background: rgba(90, 167, 255, 0.11);
}

.duration-pill small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
}

.duration-picker {
  display: grid;
  grid-template-columns: 190px auto;
  gap: 8px;
}

.search-field {
  position: relative;
  min-width: 0;
}

.search-suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #121822;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
}

.search-suggestions[hidden] {
  display: none;
}

.search-suggestions button {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 11px 12px;
  color: var(--text);
  border: 0;
  border-bottom: 1px solid rgba(213, 218, 229, 0.08);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.search-suggestions button:last-child {
  border-bottom: 0;
}

.search-suggestions button:hover,
.search-suggestions button.is-active {
  background: rgba(90, 167, 255, 0.13);
}

.search-suggestions small {
  color: var(--muted);
  font-weight: 650;
}

.search-status {
  margin: 0 0 16px;
  color: var(--muted);
  font-weight: 700;
}

.search-empty {
  grid-column: 1 / -1;
  padding: 22px;
}

.search-empty h2,
.search-empty p {
  margin: 0;
}

.search-empty p {
  margin-top: 8px;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0f1116;
  outline: none;
}

input,
select {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  padding: 12px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(90, 167, 255, 0.16);
}

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

.catalogue-categories {
  display: grid;
  gap: 32px;
}

.catalogue-category {
  display: grid;
  gap: 14px;
}

.catalogue-category-head {
  display: flex;
  align-items: center;
}

.category-break-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 16px;
  color: var(--text);
  border: 1px solid rgba(72, 199, 142, 0.38);
  border-radius: var(--radius);
  background: rgba(72, 199, 142, 0.1);
  font-size: 1.08rem;
  font-weight: 800;
  text-decoration: none;
}

.category-break-link:hover {
  border-color: rgba(90, 167, 255, 0.58);
  background: rgba(90, 167, 255, 0.11);
}

.category-break-count {
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 750;
}

.recent-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.recent-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.recent-card h3 {
  margin: 10px 0 4px;
  font-size: 1rem;
  line-height: 1.2;
}

.recent-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.recent-empty {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 132px;
  padding: 20px;
  border: 1px solid rgba(72, 199, 142, 0.34);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(72, 199, 142, 0.14), rgba(90, 167, 255, 0.08) 48%, rgba(24, 27, 34, 0.94)),
    var(--panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.recent-empty h3 {
  margin: 12px 0 6px;
  font-size: clamp(1.4rem, 3vw, 2.05rem);
  line-height: 1.04;
}

.recent-empty p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.recent-empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 10px;
}

.timer-card {
  display: flex;
  min-height: 245px;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.timer-card h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
}

.timer-card h3 a {
  display: block;
  color: var(--text);
  text-decoration: none;
}

.timer-card h3 a:hover {
  color: var(--accent);
}

.timer-card p {
  margin: 0;
  color: var(--muted);
}

.card-top,
.card-actions,
.meta-row,
.tag-row,
.controls,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.card-top {
  justify-content: space-between;
}

.card-actions {
  margin-top: auto;
}

.player .controls {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr) minmax(58px, 0.72fr);
  gap: 10px;
  align-items: stretch;
  width: 100%;
}

.pill,
.tag-row span,
.meta-row span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: #14171d;
  font-size: 0.78rem;
}

a.pill {
  text-decoration: none;
}

a.pill:hover {
  border-color: rgba(90, 167, 255, 0.46);
  color: var(--text);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--panel-2);
  cursor: pointer;
  font-weight: 720;
}

.button:hover {
  border-color: #4b5362;
}

.button.primary {
  border-color: rgba(72, 199, 142, 0.5);
  background: #1f4536;
}

.button.ghost {
  background: transparent;
}

.button.danger {
  border-color: rgba(255, 107, 107, 0.45);
  background: #442326;
}

.text-button {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 2px;
  border: 0;
  color: #d5dae5;
  background: transparent;
  cursor: pointer;
  font-weight: 720;
  text-decoration: underline;
  text-decoration-color: rgba(213, 218, 229, 0.34);
  text-underline-offset: 3px;
}

.text-button:hover {
  color: var(--text);
  text-decoration-color: currentColor;
}

.danger-link {
  color: #ffb3b3;
}

.button.wide {
  width: 100%;
  margin-bottom: 10px;
}

.save-list-button {
  gap: 8px;
}

.save-list-label,
.save-list-short {
  order: 1;
}

.save-list-icon {
  order: 2;
}

.save-list-button.is-saved {
  border-color: rgba(255, 107, 107, 0.58);
  color: #ffd5da;
  background: rgba(68, 35, 38, 0.88);
}

.save-list-icon {
  display: inline-flex;
  flex: 0 0 auto;
  color: #ff8ea0;
}

.save-list-button.is-saved .save-list-icon {
  color: currentColor;
}

.save-list-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.save-list-button.is-saved .save-list-icon svg {
  fill: currentColor;
}

.save-list-short {
  display: none;
}

.button.compact {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.88rem;
}

.control-button {
  width: 100%;
  min-height: 58px;
  gap: 10px;
  padding: 0 16px;
  font-size: 1.05rem;
}

.reset-control {
  padding-inline: 10px;
}

.hero-player .control-button {
  min-height: 62px;
  font-size: 1.08rem;
}

.control-icon {
  display: inline-flex;
  flex: 0 0 auto;
}

.control-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-footer {
  display: flex;
  justify-content: center;
  padding: 28px 18px 36px;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer a {
  text-decoration: underline;
  text-decoration-color: rgba(168, 176, 191, 0.35);
  text-underline-offset: 4px;
}

.site-footer a:hover {
  color: var(--text);
  text-decoration-color: currentColor;
}

.control-label {
  line-height: 1;
}

.muted {
  color: var(--muted);
}

.page-title {
  padding: 28px 0;
}

.timer-page,
.library-layout,
.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.timer-page > *,
.library-layout > *,
.editor-layout > * {
  min-width: 0;
}

.timer-page-header {
  grid-column: 1 / -1;
  max-width: 880px;
}

.timer-page-header h1 {
  margin: 0 0 10px;
  font-size: clamp(2.15rem, 4.6vw, 3.6rem);
  line-height: 1.02;
}

.timer-page-header > p {
  max-width: 78ch;
  margin: 0;
  color: var(--muted);
}

.library-layout {
  grid-template-columns: minmax(0, 1fr);
}

.timer-main h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
}

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

.timer-page .timer-main > .player {
  margin-top: 0;
}

.player {
  --timer-face-control-inset: 12px;
  margin-top: 18px;
  padding: 18px;
  position: relative;
}

.hero-player {
  --timer-face-control-inset: 14px;
  margin-top: 0;
  padding: 22px;
}

.focus-button,
.save-button,
.cycle-button,
.sound-button {
  position: absolute;
  top: 30px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(17, 19, 24, 0.78);
  cursor: pointer;
  font-weight: 760;
}

.hero-save-cluster {
  position: absolute;
  top: 36px;
  left: 36px;
  z-index: 3;
  display: inline-flex;
  gap: 8px;
}

.focus-button {
  right: 30px;
}

.save-button {
  left: 30px;
  justify-content: center;
  width: 36px;
  padding: 0;
}

.sound-button {
  top: auto;
  left: var(--timer-face-control-inset);
  bottom: var(--timer-face-control-inset);
  justify-content: center;
  width: 36px;
  padding: 0;
}

.hero-save-cluster .save-button,
.cycle-button {
  position: static;
  top: auto;
  left: auto;
  justify-content: center;
  width: 36px;
  padding: 0;
}

.cycle-button:disabled {
  opacity: 0.38;
  cursor: default;
}

.save-button.is-saved {
  border-color: rgba(255, 107, 107, 0.58);
  color: #ff8ea0;
  background: rgba(68, 35, 38, 0.88);
}

.sound-button.is-muted {
  color: var(--muted);
}

.focus-icon,
.save-icon,
.cycle-icon,
.sound-icon {
  display: inline-flex;
  flex: 0 0 auto;
}

.focus-icon svg,
.save-icon svg,
.cycle-icon svg,
.sound-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.save-button.is-saved .save-icon svg {
  fill: currentColor;
}

.save-feedback {
  position: absolute;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(72, 199, 142, 0.42);
  border-radius: var(--radius);
  color: #dffbea;
  background: rgba(31, 69, 54, 0.94);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
  font-size: 0.88rem;
  font-weight: 760;
  pointer-events: none;
  transform: translateY(-50%);
  animation: save-feedback-fade 2.3s ease forwards;
}

.save-feedback.is-below {
  transform: translateY(0);
  animation-name: save-feedback-fade-below;
}

.sound-feedback {
  border-color: rgba(255, 107, 107, 0.54);
  color: #ffe5e8;
  background: rgba(94, 37, 42, 0.96);
}

@keyframes save-feedback-fade {
  0% {
    opacity: 0;
    transform: translateY(-50%) translateX(-4px);
  }
  12%,
  72% {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-50%) translateX(4px);
  }
}

@keyframes save-feedback-fade-below {
  0% {
    opacity: 0;
    transform: translateY(-4px);
  }
  12%,
  72% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(4px);
  }
}

.focus-label {
  line-height: 1;
}

.hero-player .focus-button {
  top: 36px;
  right: 36px;
}

.hero-player .save-button {
  top: 36px;
  left: 36px;
}

.player.is-focused .focus-button {
  top: 28px;
  right: 28px;
}

.player.is-focused .save-button {
  top: 28px;
  left: 28px;
}

.player.is-focused .sound-button {
  left: 14px;
  bottom: 14px;
}

.player.is-focused .hero-save-cluster {
  top: 28px;
  left: 28px;
}

.focus-button:hover,
.save-button:hover,
.cycle-button:hover:not(:disabled),
.sound-button:hover {
  border-color: #4b5362;
}

body.has-focused-player {
  overflow: hidden;
}

.player.is-focused {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  align-content: center;
  margin: 0;
  padding: 28px;
  border-radius: 0;
  background: rgba(17, 19, 24, 0.98);
}

.timer-face {
  position: relative;
  display: grid;
  min-height: 340px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--timer-wheel, conic-gradient(from 270deg, var(--accent) var(--timer-pct, 0%), #242a34 0));
}

.hero-player .timer-face {
  min-height: min(68vh, 620px);
}

.player.is-focused .timer-face {
  min-height: min(78vh, 760px);
}

.timer-core {
  position: relative;
  isolation: isolate;
  display: grid;
  width: min(292px, calc(100% - 64px));
  aspect-ratio: 1;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 22px;
  border-radius: 50%;
  background: transparent;
  text-align: center;
}

.timer-core::before,
.timer-core::after {
  content: "";
  position: absolute;
  border-radius: inherit;
  pointer-events: none;
}

.timer-core::before {
  inset: -10px;
  z-index: -2;
  background:
    conic-gradient(from 270deg, var(--segment-color, var(--accent)) var(--segment-pct, 0%), rgba(73, 84, 101, 0.5) 0 100%);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
}

.timer-core::after {
  inset: 0;
  z-index: -1;
  border: 1px solid #343b47;
  background: #111318;
}

.hero-player .timer-core {
  width: min(430px, calc(100% - 72px));
}

.hero-player .timer-core::before {
  inset: -14px;
}

.player.is-focused .timer-core {
  width: min(560px, calc(100% - 72px));
}

.player.is-focused .timer-core::before {
  inset: -18px;
}

.phase {
  margin: 0;
  max-width: 100%;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  overflow-wrap: anywhere;
}

.hero-player .phase {
  font-size: 1.45rem;
}

.player.is-focused .phase {
  font-size: 1.65rem;
}

.timer-face .muted {
  width: 100%;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 680;
  text-align: center;
  white-space: nowrap;
}

.hero-player .timer-face .muted,
.player.is-focused .timer-face .muted {
  font-size: 1.28rem;
}

.segment-meta {
  margin: -2px 0 0;
  color: #d5dae5;
  font-size: 0.92rem;
  font-weight: 740;
  text-align: center;
  white-space: nowrap;
}

.hero-player .segment-meta {
  font-size: 1.05rem;
}

.player.is-focused .segment-meta {
  font-size: 1.15rem;
}

.player-meta-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 12px;
  margin-top: 14px;
}

.player-meta-row .muted {
  min-width: 0;
  margin: 0;
  font-size: 1.06rem;
  font-weight: 650;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.player-meta-row .button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.timer-tags {
  margin-top: 12px;
}

.related-timers-panel {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.related-timers-head {
  display: grid;
  gap: 4px;
}

.related-timers-head .eyebrow {
  margin: 0;
}

.related-timers-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

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

.related-timer-grid .timer-card {
  min-height: 245px;
}

.timer-plan-panel {
  margin-top: 18px;
}

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

.timer-plan-head h2 {
  margin-bottom: 0;
}

.timer-side-actions {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.timer-guidance-panel {
  display: grid;
  gap: 14px;
}

.guidance-heading {
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.guidance-heading .eyebrow {
  margin-bottom: 6px;
}

.guidance-heading h2 {
  margin: 0;
  font-size: 1.28rem;
}

.guidance-block {
  display: grid;
  gap: 5px;
}

.guidance-block h3 {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.2;
}

.guidance-block p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.guidance-block ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.clock {
  margin: 6px 0;
  width: 100%;
  font-variant-numeric: tabular-nums;
  font-size: clamp(3rem, 10vw, 5.3rem);
  font-weight: 820;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.hero-player .clock,
.player.is-focused .clock {
  font-size: clamp(4rem, 9vw, 7rem);
}

.progress-track {
  position: relative;
  height: 10px;
  margin: 14px 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: #252b35;
}

.progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 1;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}

.progress-ticks {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.progress-tick {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 1px;
  transform: translateX(-0.5px);
  background: rgba(241, 243, 247, 0.52);
  box-shadow: 0 0 0 1px rgba(17, 19, 24, 0.22);
}

.json-preview {
  max-height: 420px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: #d5dae5;
  background: #0f1116;
  font-size: 0.78rem;
  white-space: pre-wrap;
}

.library-list {
  display: grid;
  gap: 10px;
}

.library-list.is-empty {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 160px;
  padding: 20px;
  border-color: rgba(72, 199, 142, 0.36);
  background:
    linear-gradient(135deg, rgba(72, 199, 142, 0.14), rgba(90, 167, 255, 0.08) 48%, rgba(24, 27, 34, 0.94)),
    var(--panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.library-empty-content {
  min-width: 0;
}

.library-empty-content h2 {
  margin: 12px 0 6px;
  font-size: clamp(1.45rem, 3vw, 2.25rem);
  line-height: 1.04;
}

.library-empty-content p {
  max-width: 570px;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.library-empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 10px;
}

.library-empty-create {
  min-height: 56px;
  padding: 0 22px;
  gap: 9px;
  font-size: 1.05rem;
}

.cta-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}

.cta-plus svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.saved-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #14171d;
}

.saved-item.is-dragging {
  opacity: 0.55;
}

.saved-item.is-drop-before {
  border-top-color: var(--accent-2);
  box-shadow: 0 -3px 0 var(--accent-2);
}

.saved-item.is-drop-after {
  border-bottom-color: var(--accent-2);
  box-shadow: 0 3px 0 var(--accent-2);
}

.saved-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-width: 34px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(168, 176, 191, 0.18);
  border-radius: var(--radius);
  color: var(--muted);
  background:
    radial-gradient(circle, currentColor 1.5px, transparent 1.7px) center / 8px 8px,
    rgba(24, 27, 34, 0.55);
  cursor: grab;
  opacity: 0.82;
}

.saved-drag-handle:hover {
  border-color: rgba(90, 167, 255, 0.42);
  color: var(--text);
}

.saved-item:active .saved-drag-handle {
  cursor: grabbing;
}

.saved-item h3 {
  margin: 0 0 4px;
  font-size: 0.98rem;
}

.saved-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.saved-note-panel {
  display: grid;
  gap: 8px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.saved-note-panel h2 {
  margin: 0;
}

.saved-note-panel p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  white-space: pre-wrap;
}

.editor-layout label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 680;
}

.editor-panel {
  display: grid;
  gap: 18px;
}

.editor-fields {
  display: grid;
  gap: 12px;
}

.builder-panel {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

.builder-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.builder-head h2 {
  margin: 0;
  font-size: 1.45rem;
}

.builder-actions,
.builder-utility,
.loop-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.builder-actions {
  justify-content: end;
}

.builder-tree {
  display: grid;
  gap: 8px;
}

.builder-dropzone {
  display: grid;
  min-height: 10px;
  place-items: center;
  border: 1px dashed transparent;
  border-radius: var(--radius);
  color: transparent;
  font-size: 0.82rem;
  transition: min-height 0.14s ease, border-color 0.14s ease, color 0.14s ease, background 0.14s ease;
}

.builder-dropzone.is-empty {
  min-height: 74px;
  border-color: rgba(168, 176, 191, 0.32);
  color: var(--muted);
  background: rgba(15, 17, 22, 0.6);
}

.builder-dropzone.is-drag-over {
  min-height: 42px;
  border-color: rgba(90, 167, 255, 0.72);
  color: #d5dae5;
  background: rgba(90, 167, 255, 0.14);
}

.builder-node {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--node-color, var(--accent));
  border-radius: var(--radius);
  background: #14171d;
}

.builder-node.is-loop {
  background: #171a22;
}

.builder-node.is-collapsed {
  gap: 0;
}

.builder-node.is-dragging {
  opacity: 0.55;
}

.builder-node-head {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid rgba(168, 176, 191, 0.28);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(15, 17, 22, 0.72);
  cursor: grab;
  font-size: 0.76rem;
  font-weight: 760;
  text-transform: uppercase;
}

.drag-handle:active {
  cursor: grabbing;
}

.node-toggle {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--panel-2);
  cursor: pointer;
  font-weight: 820;
}

.node-title {
  display: grid;
  grid-template-columns: auto minmax(0, auto) minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  min-width: 0;
}

.node-title strong,
.node-title span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-title span:last-child {
  color: var(--muted);
  font-size: 0.86rem;
}

.node-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--node-color, var(--accent));
  box-shadow: 0 0 0 2px rgba(241, 243, 247, 0.08);
}

.node-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 10px;
}

.builder-fields {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(110px, 0.7fr) minmax(130px, 0.8fr) minmax(90px, 0.4fr);
  gap: 10px;
}

.builder-node.is-loop > .builder-fields {
  grid-template-columns: minmax(180px, 1fr) minmax(110px, 160px);
}

.builder-fields label,
.json-tools label {
  margin-bottom: 0;
}

.builder-fields input[type="color"] {
  min-height: 44px;
  padding: 5px;
}

.builder-children {
  display: grid;
  gap: 8px;
  margin-left: 8px;
  padding-left: 8px;
  border-left: 1px solid rgba(168, 176, 191, 0.2);
}

.json-tools {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.json-tools summary {
  cursor: pointer;
  color: #d5dae5;
  font-weight: 760;
}

.json-tools textarea {
  margin-top: 12px;
}

.form-status {
  min-height: 22px;
  color: var(--muted);
}

.empty-player {
  padding: 40px 16px;
  text-align: center;
}

.guide-section {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

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

.guide-grid article {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  padding: 22px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  text-align: center;
}

.guide-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 14px;
  border: 1px solid rgba(168, 176, 191, 0.2);
  border-radius: 999px;
  color: #d5dae5;
  background: rgba(24, 27, 34, 0.62);
}

.guide-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.guide-icon-home {
  color: #6fc6ff;
  border-color: rgba(111, 198, 255, 0.28);
  background: rgba(43, 91, 134, 0.35);
}

.guide-icon-heart {
  color: #ff8ea0;
  border-color: rgba(255, 142, 160, 0.28);
  background: rgba(87, 38, 48, 0.38);
}

.guide-icon-create {
  color: var(--accent);
  border-color: rgba(72, 199, 142, 0.3);
  background: rgba(31, 69, 54, 0.45);
}

.guide-icon-focus {
  color: #b8a2ff;
  border-color: rgba(184, 162, 255, 0.3);
  background: rgba(58, 46, 99, 0.38);
}

.guide-grid h3 {
  margin: 0 0 9px;
}

.guide-grid p {
  max-width: 34ch;
  margin: 0;
  color: var(--muted);
}

.saved-preview {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.preview-link {
  display: block;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #14171d;
}

[hidden] {
  display: none !important;
}

@media (max-width: 920px) {
  .hero,
  .timer-page,
  .library-layout,
  .editor-layout,
  .guide-section {
    grid-template-columns: 1fr;
  }

  .timer-grid,
  .recent-grid,
  .related-timer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 920px) and (orientation: landscape) {
  .hero-player .timer-face {
    min-height: clamp(300px, 72vh, 360px);
  }

  .hero-player .timer-core {
    width: min(330px, calc(100% - 72px), calc(100vh - 150px));
  }

  .hero-player .timer-core::before {
    inset: -12px;
  }
}

@media (max-width: 620px) {
  .site-header,
  .section-head,
  .toolbar,
  .toolbar.has-submit,
  .search-results-toolbar,
  .category-search-toolbar,
  .duration-chooser,
  .duration-picker {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .related-timer-grid {
    grid-template-columns: 1fr;
  }

  .site-header {
    position: static;
    flex-direction: column;
  }

  .nav {
    width: 100%;
    justify-content: space-between;
  }

  .nav a {
    flex: 1 1 0;
  }

  .timer-grid,
  .recent-grid,
  .guide-grid {
    grid-template-columns: 1fr;
  }

  .recent-empty {
    grid-template-columns: 1fr;
  }

  .library-list.is-empty {
    grid-template-columns: 1fr;
  }

  .recent-card {
    grid-template-columns: 1fr;
  }

  .recent-actions {
    justify-content: stretch;
  }

  .recent-actions .button {
    flex: 1 1 0;
  }

  .recent-empty-actions {
    justify-content: stretch;
  }

  .recent-empty-actions .button,
  .library-empty-actions .button {
    flex: 1 1 100%;
    justify-content: center;
  }

  .library-empty-actions {
    justify-content: stretch;
  }

  .player .controls {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(50px, 0.72fr);
    gap: 8px;
  }

  .timer-page .timer-main > .player {
    width: 100%;
    max-width: 100%;
    padding: 12px;
  }

  .timer-page .timer-face {
    min-height: 320px;
  }

  .timer-page .timer-core {
    width: min(292px, calc(100% - 52px));
    padding: 18px;
  }

  .timer-page .clock {
    font-size: clamp(2.7rem, 12vw, 4.7rem);
  }

  .timer-page .timer-face .muted,
  .timer-page .segment-meta {
    white-space: normal;
  }

  .player.is-focused {
    --focused-player-edge-inset: 14px;
    --focused-face-top: 54px;
    align-content: start;
    row-gap: 12px;
    overflow-y: auto;
    padding:
      max(20px, calc(env(safe-area-inset-top) + 14px))
      14px
      max(18px, calc(env(safe-area-inset-bottom) + 14px));
  }

  .player.is-focused .focus-button {
    top: calc(max(20px, calc(env(safe-area-inset-top) + 14px)) + var(--focused-face-top) + 5px);
    right: calc(var(--focused-player-edge-inset) + var(--timer-face-control-inset));
  }

  .player.is-focused .save-button {
    top: calc(max(20px, calc(env(safe-area-inset-top) + 14px)) + var(--focused-face-top) + 5px);
    left: calc(var(--focused-player-edge-inset) + var(--timer-face-control-inset));
  }

  .player.is-focused .hero-save-cluster {
    top: calc(max(20px, calc(env(safe-area-inset-top) + 14px)) + var(--focused-face-top) + 5px);
    left: calc(var(--focused-player-edge-inset) + var(--timer-face-control-inset));
  }

  .player.is-focused .timer-face {
    min-height: min(58vh, 520px);
    margin-top: var(--focused-face-top);
  }

  .player.is-focused .timer-core {
    width: min(420px, calc(100% - 48px));
  }

  .player.is-focused .timer-core::before {
    inset: -14px;
  }

  .control-button {
    min-height: 56px;
    gap: 7px;
    padding: 0 8px;
    font-size: 0.96rem;
  }

  .save-list-label {
    display: none;
  }

  .save-list-short {
    display: inline;
  }

  .saved-item {
    grid-template-columns: 1fr;
  }

  .saved-drag-handle {
    display: none;
  }

  .builder-head,
  .builder-node-head {
    grid-template-columns: 1fr;
  }

  .builder-head {
    align-items: stretch;
    flex-direction: column;
  }

  .builder-actions,
  .node-actions {
    justify-content: stretch;
  }

  .builder-actions .button,
  .node-actions .text-button,
  .loop-tools .button {
    flex: 1 1 auto;
  }

  .node-title {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .node-title span:last-child {
    grid-column: 2;
  }

  .builder-fields,
  .builder-node.is-loop > .builder-fields {
    grid-template-columns: 1fr;
  }

  .builder-children {
    margin-left: 2px;
    padding-left: 6px;
  }
}

@media (max-width: 620px) and (orientation: portrait) {
  .hero-player .timer-face {
    aspect-ratio: 1 / 1.38;
    min-height: 0;
  }
}

@media (max-width: 420px) {
  .timer-page .timer-main > .player {
    --timer-face-control-inset: 10px;
    padding: 10px;
  }

  .timer-page .timer-main > .player.is-focused {
    --focused-player-edge-inset: 14px;
    --focused-face-top: 54px;
  }

  .timer-page .save-button,
  .timer-page .focus-button,
  .timer-page .sound-button {
    justify-content: center;
    width: 40px;
    min-height: 40px;
    padding: 0;
  }

  .timer-page .save-button {
    top: 20px;
    left: 20px;
  }

  .timer-page .focus-button {
    top: 20px;
    right: 20px;
  }

  .timer-page .player.is-focused .save-button,
  .timer-page .player.is-focused .focus-button {
    top: calc(max(20px, calc(env(safe-area-inset-top) + 14px)) + var(--focused-face-top) + 5px);
  }

  .timer-page .player.is-focused .save-button {
    left: calc(var(--focused-player-edge-inset) + var(--timer-face-control-inset));
  }

  .timer-page .player.is-focused .focus-button {
    right: calc(var(--focused-player-edge-inset) + var(--timer-face-control-inset));
  }

  .timer-page .focus-label {
    display: none;
  }

  .card-actions .save-list-button {
    width: 42px;
    padding: 0;
  }

  .card-actions .save-list-short {
    display: none;
  }

  .control-button {
    min-height: 58px;
    padding: 0;
  }

  .control-label {
    display: none;
  }

  .control-icon svg {
    width: 25px;
    height: 25px;
  }
}
