:root {
  color-scheme: light;
  --ink: #101828;
  --muted: #667085;
  --line: #e6ebf2;
  --paper: #ffffff;
  --page: #f6f8fc;
  --soft-page: #eff6ff;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #dbeafe;
  --green: #15803d;
  --accent: #14b8a6;
  --orange: #c2410c;
  --rose: #e11d48;
  --violet: #7047d9;
  --shadow: 0 22px 60px rgba(16, 24, 40, 0.11);
  --pill-radius: 999px;
  --site-header-height: 72px;
  --body-bg:
    linear-gradient(135deg, rgba(37, 99, 235, 0.09) 0%, rgba(21, 128, 61, 0) 36%),
    linear-gradient(180deg, #fbfdff 0%, var(--page) 48%, #ffffff 100%);
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --glass: rgba(255, 255, 255, 0.88);
  --glass-strong: rgba(255, 255, 255, 0.96);
  --card-bg: linear-gradient(145deg, #ffffff 0%, #f9fbff 100%);
  --panel-bg: rgba(255, 255, 255, 0.84);
  --input-bg: #ffffff;
  --footer-bg: #101828;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f8fafc;
  --muted: #a9b4c6;
  --line: rgba(148, 163, 184, 0.24);
  --paper: #111827;
  --page: #0b1020;
  --soft-page: rgba(96, 165, 250, 0.13);
  --primary: #7dd3fc;
  --primary-dark: #38bdf8;
  --primary-soft: rgba(125, 211, 252, 0.16);
  --green: #34d399;
  --accent: #7dd3fc;
  --orange: #fb923c;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --body-bg:
    radial-gradient(circle at 14% 8%, rgba(125, 211, 252, 0.14), transparent 30%),
    radial-gradient(circle at 92% 4%, rgba(52, 211, 153, 0.12), transparent 26%),
    linear-gradient(180deg, #070b14 0%, #0b1020 48%, #090d18 100%);
  --surface: #111827;
  --surface-soft: #172033;
  --glass: rgba(13, 18, 32, 0.82);
  --glass-strong: rgba(17, 24, 39, 0.96);
  --card-bg: linear-gradient(145deg, rgba(20, 28, 46, 0.96) 0%, rgba(12, 18, 32, 0.98) 100%);
  --panel-bg: rgba(17, 24, 39, 0.82);
  --input-bg: #111827;
  --footer-bg: #050814;
}

* {
  box-sizing: border-box;
}

::selection {
  color: #ffffff;
  background: rgba(37, 99, 235, 0.86);
}

html[data-theme="dark"] ::selection {
  color: #050814;
  background: rgba(125, 211, 252, 0.92);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--site-header-height, 72px) + 16px);
  overflow-x: clip;
}

body {
  margin: 0;
  padding-top: var(--site-header-height, 72px);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--body-bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  transition: background 220ms ease, color 220ms ease;
  overflow-x: clip;
}

@supports not (overflow: clip) {
  html,
  body {
    overflow-x: hidden;
  }
}

main {
  flex: 1 0 auto;
}

img,
svg {
  display: block;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
}

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

textarea {
  resize: vertical;
}

.container {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  padding: 10px 14px;
  color: #fff;
  background: var(--ink);
  border-radius: var(--pill-radius);
  text-decoration: none;
}

.skip-link:focus {
  top: 16px;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--glass);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  transition: background 220ms ease, border-color 220ms ease;
}

.header-inner,
.footer-bottom,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.header-inner {
  min-height: 72px;
  justify-content: flex-start;
}

.header-main {
  display: flex;
  align-items: center;
  margin-left: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 900;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.site-nav,
.site-footer nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.site-nav a,
.site-footer nav a {
  padding: 9px 14px;
  color: var(--muted);
  text-decoration: none;
  border-radius: var(--pill-radius);
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-footer nav a:hover,
.site-footer nav a:focus-visible {
  color: var(--ink);
  background: var(--soft-page);
  outline: none;
}

.theme-picker {
  position: relative;
  flex: 0 0 auto;
  margin-left: auto;
}

.nav-toggle {
  width: 44px;
  height: 44px;
  min-height: 44px;
  display: none;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--pill-radius);
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.08);
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1), 0 12px 28px rgba(16, 24, 40, 0.08);
  outline: none;
}

.nav-toggle-mark,
.nav-toggle-mark::before,
.nav-toggle-mark::after {
  width: 18px;
  height: 2px;
  display: block;
  background: currentColor;
  border-radius: var(--pill-radius);
  transition: background 160ms ease, transform 180ms ease;
}

.nav-toggle-mark {
  position: relative;
}

.nav-toggle-mark::before,
.nav-toggle-mark::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-mark::before {
  transform: translateY(-6px);
}

.nav-toggle-mark::after {
  transform: translateY(6px);
}

.site-header.nav-open .nav-toggle-mark {
  background: transparent;
}

.site-header.nav-open .nav-toggle-mark::before {
  transform: rotate(45deg);
}

.site-header.nav-open .nav-toggle-mark::after {
  transform: rotate(-45deg);
}

.header-search {
  position: relative;
  flex: 1 1 260px;
  width: min(34vw, 420px);
  max-width: 420px;
  margin-left: auto;
}

.header-search + .theme-picker {
  margin-left: 0;
}

.header-search-form {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 0 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--pill-radius);
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.08);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.header-search-form:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1), 0 12px 28px rgba(16, 24, 40, 0.08);
}

.header-search-input {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: none;
  font-weight: 800;
}

.header-search-input::placeholder {
  color: var(--muted);
}

.search-trigger {
  width: 44px;
  height: 44px;
  min-height: 44px;
  display: none;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--pill-radius);
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.08);
  cursor: pointer;
}

.search-trigger:hover,
.search-trigger:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1), 0 12px 28px rgba(16, 24, 40, 0.08);
  outline: none;
}

.search-mark {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-radius: 50%;
  opacity: 0.82;
}

.search-mark::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 8px;
  height: 2px;
  background: currentColor;
  border-radius: var(--pill-radius);
  transform: rotate(45deg);
}

.header-search .search-clear {
  min-height: 30px;
  padding: 0 10px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 0;
  border-radius: var(--pill-radius);
  cursor: pointer;
  font-weight: 900;
}

.header-search .search-clear:hover,
.header-search .search-clear:focus-visible {
  color: var(--ink);
  outline: none;
}

.header-search-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
  padding: 10px;
  background: var(--glass-strong);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.header-search-panel .search-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 6px 10px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.header-search-panel .suggestion-list {
  display: grid;
  gap: 6px;
}

.header-search-panel .suggestion-item {
  min-height: 56px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid transparent;
  border-radius: 20px;
  text-decoration: none;
}

.header-search-panel .suggestion-item:hover,
.header-search-panel .suggestion-item:focus-visible {
  background: var(--surface);
  border-color: rgba(37, 99, 235, 0.28);
  outline: none;
}

.header-search-panel .suggestion-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--green));
  border-radius: 50%;
  font-size: 0.76rem;
  font-weight: 950;
}

html[data-theme="dark"] .header-search-panel .suggestion-icon {
  color: #07111f;
}

.header-search-panel .suggestion-icon.is-fallback::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 6px;
  box-shadow: inset 0 -5px 0 rgba(255, 255, 255, 0.26);
  transform: rotate(-5deg);
}

.ui-icon {
  width: 1.25em;
  height: 1.25em;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-icon .ui-icon,
.collection-icon .ui-icon,
.tool-icon .ui-icon {
  width: 28px;
  height: 28px;
}

.board-grid span .ui-icon,
.panel-list span .ui-icon,
.suggestion-icon .ui-icon {
  width: 18px;
  height: 18px;
}

.featured-icon img,
.card-icon img,
.collection-icon img,
.tool-icon img,
.panel-list span img,
.suggestion-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border-radius: 0;
}

.featured-icon:has(img),
.card-icon:has(img),
.collection-icon:has(img),
.tool-icon:has(img),
.panel-list span:has(img),
.suggestion-icon:has(img) {
  color: inherit;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  overflow: visible;
}

.header-search-panel .suggestion-copy {
  min-width: 0;
}

.header-search-panel .suggestion-copy strong,
.header-search-panel .suggestion-copy span {
  display: block;
}

.header-search-panel .suggestion-copy strong {
  line-height: 1.2;
}

.header-search-panel .suggestion-copy span,
.header-search-panel .suggestion-action {
  color: var(--muted);
  font-size: 0.84rem;
}

.header-search-panel .suggestion-action {
  font-weight: 900;
}

.header-search-panel .suggestion-empty {
  margin: 0;
  padding: 12px 9px;
  color: var(--muted);
}

.theme-trigger {
  width: 44px;
  height: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--pill-radius);
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.08);
  cursor: pointer;
  font-weight: 900;
}

.theme-trigger:hover,
.theme-trigger:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1), 0 12px 28px rgba(16, 24, 40, 0.08);
  outline: none;
}

.theme-icon {
  position: relative;
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid #d0d5dd;
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.72);
  transform: rotate(var(--theme-turn, 0deg)) scale(1);
  transition:
    background 220ms ease,
    border-color 220ms ease,
    transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.theme-core {
  position: relative;
  width: 12px;
  height: 12px;
  display: block;
  background: #101828;
  border-radius: 50%;
  transform: scale(1);
  transition:
    width 220ms ease,
    height 220ms ease,
    background 220ms ease,
    border-radius 220ms ease,
    transform 220ms ease;
}

.theme-core::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -5px;
  width: 16px;
  height: 16px;
  background: #101828;
  border-radius: 50%;
  opacity: 0;
  transform: translateX(2px) scale(0.72);
  transition: opacity 180ms ease, transform 220ms ease, border-radius 220ms ease;
}

.theme-trigger.theme-system .theme-icon {
  background: linear-gradient(90deg, #ffffff 0 50%, #101828 50% 100%);
}

.theme-trigger.theme-system .theme-core {
  width: 4px;
  height: 18px;
  background: rgba(37, 99, 235, 0.92);
  border-radius: var(--pill-radius);
}

.theme-trigger.theme-system .theme-core::after,
.theme-trigger.theme-light .theme-core::after {
  opacity: 0;
}

.theme-trigger.theme-light .theme-icon {
  background: #fef9c3;
  border-color: #fde68a;
}

.theme-trigger.theme-light .theme-core {
  background: #f59e0b;
  box-shadow:
    0 -8px 0 -5px #f59e0b,
    0 8px 0 -5px #f59e0b,
    8px 0 0 -5px #f59e0b,
    -8px 0 0 -5px #f59e0b,
    6px 6px 0 -5px #f59e0b,
    -6px -6px 0 -5px #f59e0b,
    6px -6px 0 -5px #f59e0b,
    -6px 6px 0 -5px #f59e0b;
}

.theme-trigger.theme-dark .theme-icon {
  background: #101828;
  border-color: #344054;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.theme-trigger.theme-dark .theme-core {
  width: 16px;
  height: 16px;
  background: #e0f2fe;
  box-shadow: none;
  overflow: hidden;
  transform: translateX(-1px) scale(1);
}

.theme-trigger.theme-dark .theme-core::after {
  opacity: 1;
  border-radius: 50%;
  transform: translateX(0) scale(1);
}

.theme-trigger.theme-changing .theme-icon {
  transform: rotate(var(--theme-turn, 0deg)) scale(0.88);
}

html[data-theme-choice="system"] .theme-trigger .theme-icon {
  background: linear-gradient(90deg, #ffffff 0 50%, #101828 50% 100%);
}

html[data-theme-choice="system"] .theme-trigger .theme-core {
  width: 4px;
  height: 18px;
  background: rgba(37, 99, 235, 0.92);
  border-radius: var(--pill-radius);
  box-shadow: none;
  overflow: visible;
  transform: scale(1);
}

html[data-theme-choice="system"] .theme-trigger .theme-core::after,
html[data-theme-choice="light"] .theme-trigger .theme-core::after {
  opacity: 0;
}

html[data-theme-choice="light"] .theme-trigger .theme-icon {
  background: #fef9c3;
  border-color: #fde68a;
}

html[data-theme-choice="light"] .theme-trigger .theme-core {
  width: 12px;
  height: 12px;
  background: #f59e0b;
  border-radius: 50%;
  overflow: visible;
  transform: scale(1);
  box-shadow:
    0 -8px 0 -5px #f59e0b,
    0 8px 0 -5px #f59e0b,
    8px 0 0 -5px #f59e0b,
    -8px 0 0 -5px #f59e0b,
    6px 6px 0 -5px #f59e0b,
    -6px -6px 0 -5px #f59e0b,
    6px -6px 0 -5px #f59e0b,
    -6px 6px 0 -5px #f59e0b;
}

html[data-theme-choice="dark"] .theme-trigger .theme-icon {
  background: #101828;
  border-color: #344054;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.08);
}

html[data-theme-choice="dark"] .theme-trigger .theme-core {
  width: 16px;
  height: 16px;
  background: #e0f2fe;
  border-radius: 50%;
  box-shadow: none;
  overflow: hidden;
  transform: translateX(-1px) scale(1);
}

html[data-theme-choice="dark"] .theme-trigger .theme-core::after {
  opacity: 1;
  border-radius: 50%;
  transform: translateX(0) scale(1);
}

.theme-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  min-width: 180px;
  display: grid;
  gap: 6px;
  padding: 8px;
  background: var(--glass-strong);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 22px 54px rgba(16, 24, 40, 0.16);
  backdrop-filter: blur(16px);
}

.theme-option {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: var(--pill-radius);
  cursor: pointer;
  font-weight: 900;
  text-align: left;
}

.theme-option::after {
  content: "";
  width: 8px;
  height: 8px;
  background: transparent;
  border-radius: 50%;
}

.theme-option:hover,
.theme-option:focus-visible {
  color: var(--ink);
  background: var(--soft-page);
  outline: none;
}

.theme-option.is-active {
  color: #07111f;
  background: var(--primary);
}

.theme-option.is-active::after {
  background: currentColor;
}

@media (max-width: 920px) {
  :root {
    --site-header-height: 72px;
  }

  .header-inner {
    min-height: 64px;
    gap: 10px;
    padding: 10px 0;
  }

  .brand {
    min-width: 0;
  }

  .brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand small {
    display: none;
  }

  .header-main {
    margin-left: 0;
  }

  .site-header.nav-ready .header-main {
    position: absolute;
    top: calc(100% + 8px);
    left: 16px;
    right: 16px;
    z-index: 20;
    display: block;
    width: auto;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px) scale(0.98);
    transform-origin: top right;
    transition: opacity 180ms ease, transform 180ms ease, visibility 0s linear 180ms;
  }

  .site-header.nav-ready.nav-open .header-main {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    transition-delay: 0s;
  }

  .site-header.nav-ready .site-nav {
    width: 100%;
    display: grid;
    gap: 4px;
    padding: 8px;
    background: var(--glass-strong);
    border: 1px solid var(--line);
    border-radius: 26px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
  }

  .site-header.nav-ready .site-nav a {
    padding: 12px 14px;
    color: var(--ink);
  }

  .site-header.nav-ready .site-nav a:hover,
  .site-header.nav-ready .site-nav a:focus-visible {
    background: var(--soft-page);
  }

  .header-search {
    flex: 0 0 auto;
    width: auto;
    margin-left: auto;
  }

  .search-trigger,
  .nav-toggle {
    display: inline-flex;
  }

  .header-search-form {
    position: fixed;
    top: calc(var(--site-header-height, 72px) + 8px);
    left: 16px;
    right: 16px;
    z-index: 42;
    display: none;
  }

  .header-search.is-open .header-search-form {
    display: flex;
  }

  .header-search-panel {
    position: fixed;
    top: calc(var(--site-header-height, 72px) + 62px);
    left: 16px;
    right: 16px;
    z-index: 42;
    max-height: min(64svh, 520px);
    overflow: auto;
  }

  .theme-picker {
    width: auto;
    margin-left: 0;
  }

  .theme-menu {
    left: auto;
    right: 0;
    width: min(78vw, 240px);
  }
}

.hero-section {
  padding: 72px 0 38px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  gap: 44px;
  align-items: center;
}

.hero-copy {
  max-width: 720px;
}

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

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: 0;
}

h1 {
  font-size: 4.05rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.14rem;
}

.hero-copy h1 {
  color: transparent;
  background: linear-gradient(90deg, #101828 0%, #1d4ed8 62%, #166534 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

html[data-theme="dark"] .hero-copy h1,
html[data-theme="dark"] .page-hero h1 {
  background: linear-gradient(90deg, #f8fafc 0%, #7dd3fc 58%, #86efac 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-copy h1,
.page-hero h1,
.not-found-copy h1 {
  line-height: 1.14;
  padding-bottom: 0.08em;
}

.hero-text,
.section-heading p,
.tool-intro,
.page-content p,
.page-content li {
  color: var(--muted);
}

.hero-text {
  max-width: 650px;
  margin: 18px 0 0;
  font-size: 1.12rem;
}

.hero-panel {
  display: grid;
  gap: 13px;
  padding: 8px 0;
  color: var(--ink);
}

.panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 10px 2px 34px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.panel-top strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.panel-list {
  display: grid;
  gap: 12px;
}

.panel-list a {
  min-height: 76px;
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  color: var(--ink);
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: 34px;
  box-shadow: 0 18px 48px rgba(16, 24, 40, 0.11);
  text-decoration: none;
  backdrop-filter: blur(14px);
  transition: background 220ms ease, border-color 220ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.panel-list a:nth-child(odd) {
  transform: translateX(22px);
}

.panel-list a:nth-child(even) {
  transform: translateX(-4px);
}

.panel-list a:hover,
.panel-list a:focus-visible {
  border-color: #93c5fd;
  box-shadow: 0 22px 56px rgba(37, 99, 235, 0.16);
  outline: none;
}

.panel-list span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--primary);
  border-radius: 50%;
  font-weight: 900;
}

html[data-theme="dark"] .panel-list span,
html[data-theme="dark"] .tool-icon,
html[data-theme="dark"] .button.primary,
html[data-theme="dark"] .recipe-chip.is-active,
html[data-theme="dark"] .strong-action {
  color: #07111f;
}

.panel-list a:nth-child(2) span {
  background: var(--green);
}

.panel-list a:nth-child(3) span {
  background: linear-gradient(135deg, var(--primary) 0 33%, var(--green) 33% 66%, var(--orange) 66% 100%);
}

.panel-list a:nth-child(4) span {
  background: var(--orange);
}

.hero-panel p {
  width: min(100%, 340px);
  margin: 0 0 0 34px;
  padding: 12px 14px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--pill-radius);
  box-shadow: 0 16px 42px rgba(16, 24, 40, 0.08);
  font-size: 0.9rem;
}

.quick-band {
  background: transparent;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 18px;
  background: linear-gradient(135deg, #101828, #17345d);
  border-radius: 8px;
  box-shadow: 0 24px 62px rgba(16, 24, 40, 0.16);
}

.quick-grid div {
  position: relative;
  padding: 8px 20px;
}

.quick-grid div + div {
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.quick-grid strong,
.quick-grid span {
  display: block;
}

.quick-grid strong {
  color: #fff;
  margin-bottom: 3px;
}

.quick-grid span {
  color: #cbd5e1;
  font-size: 0.94rem;
}

.section {
  padding: 64px 0;
}

.section-heading {
  align-items: flex-end;
  margin-bottom: 24px;
}

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

.tool-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  align-items: start;
  align-content: start;
  grid-column: span 6;
  gap: 18px 16px;
  min-height: 254px;
  padding: 24px;
  color: var(--ink);
  background: var(--card-bg);
  border-radius: 34px;
  text-decoration: none;
  box-shadow: 0 20px 58px rgba(16, 24, 40, 0.08);
  overflow: hidden;
  overflow-wrap: anywhere;
  transition: background 220ms ease, box-shadow 180ms ease, transform 160ms ease;
}

.tool-card:nth-child(1),
.tool-card:nth-child(4) {
  grid-column: span 7;
}

.tool-card:nth-child(2),
.tool-card:nth-child(3) {
  grid-column: span 5;
}

.tool-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(37, 99, 235, 0) 52%);
  pointer-events: none;
}

.tool-card::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--green), var(--orange));
  border-radius: 8px 8px 0 0;
}

.tool-card:nth-child(2)::before,
.tool-card:nth-child(5)::before {
  background: linear-gradient(135deg, rgba(21, 128, 61, 0.13), rgba(21, 128, 61, 0) 54%);
}

.tool-card:nth-child(3)::before,
.tool-card:nth-child(6)::before {
  background: linear-gradient(135deg, rgba(194, 65, 12, 0.12), rgba(194, 65, 12, 0) 54%);
}

.tool-card > * {
  position: relative;
  z-index: 1;
}

.tool-card:hover,
.tool-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 26px 70px rgba(16, 24, 40, 0.13);
  outline: none;
}

.tool-icon {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 14px 34px rgba(16, 24, 40, 0.13);
  font-weight: 900;
}

.tool-card:nth-child(2) .tool-icon {
  background: linear-gradient(135deg, var(--primary) 0 35%, var(--green) 35% 68%, var(--orange) 68% 100%);
}

.tool-card:nth-child(3) .tool-icon {
  background: var(--green);
}

.tool-card:nth-child(4) .tool-icon,
.tool-card:nth-child(6) .tool-icon {
  background: var(--orange);
}

.tool-card:nth-child(5) .tool-icon {
  background: var(--violet);
}

.tool-card.request-tool-card::before {
  background:
    radial-gradient(circle at 82% 18%, rgba(112, 71, 217, 0.16), transparent 36%),
    linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(21, 128, 61, 0.08) 58%, rgba(194, 65, 12, 0.08));
}

.tool-card.request-tool-card .tool-icon {
  color: #07111f;
  background: linear-gradient(135deg, #7dd3fc, #34d399);
  box-shadow: 0 14px 34px rgba(16, 24, 40, 0.13);
}

html[data-theme="dark"] .tool-card.request-tool-card .tool-icon {
  color: #050814;
}

.tool-card h3 {
  grid-column: 1;
  grid-row: 1;
  margin-top: 8px;
}

.tool-card p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
}

.empty-state {
  padding: 24px;
  margin: 0;
  color: var(--muted);
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 20px 58px rgba(16, 24, 40, 0.08);
}

.mini-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  grid-column: 1 / -1;
  padding: 0;
  margin: 0;
  color: var(--muted);
  list-style: none;
  font-size: 0.92rem;
}

.mini-list li {
  position: relative;
  padding: 6px 10px 6px 22px;
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.mini-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  transform: translate(10px, -50%);
}

.content-panel {
  position: relative;
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 20px 58px rgba(16, 24, 40, 0.08);
  overflow: hidden;
  padding: 22px;
}

.content-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(37, 99, 235, 0) 48%);
  pointer-events: none;
}

.content-panel > * {
  position: relative;
  z-index: 1;
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--pill-radius);
  cursor: pointer;
  font-weight: 900;
  text-decoration: none;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.button:hover,
.button:focus-visible {
  border-color: #93c5fd;
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.1);
  outline: none;
}

.button.primary {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.button.primary:hover,
.button.primary:focus-visible {
  background: var(--primary-dark);
}

.page-hero {
  padding: 62px 0 34px;
}

.page-hero h1 {
  max-width: 780px;
  color: transparent;
  background: linear-gradient(90deg, #101828 0%, #1d4ed8 72%, #166534 100%);
  -webkit-background-clip: text;
  background-clip: text;
  font-size: 3rem;
}

.page-content {
  padding: 54px 0 72px;
}

.content-panel {
  max-width: 840px;
}

.content-panel h2 {
  margin-top: 28px;
  font-size: 1.4rem;
}

.content-panel h2:first-child {
  margin-top: 0;
}

.tool-guide,
.hub-guide {
  padding-top: clamp(28px, 5vw, 56px);
}

.tool-guide .container,
.hub-guide .container {
  width: min(1120px, calc(100% - clamp(22px, 6vw, 44px)));
}

.content-panel {
  width: min(100%, 920px);
  max-width: 920px;
  margin-inline: auto;
  padding: clamp(22px, 3.5vw, 38px);
  border-radius: clamp(24px, 3vw, 34px);
}

.content-panel p,
.content-panel li {
  max-width: 74ch;
  line-height: 1.72;
}

.content-panel h2,
.content-panel h3 {
  max-width: 74ch;
}

.content-panel h3 {
  margin: 20px 0 8px;
  font-size: 1.06rem;
  line-height: 1.3;
}

.game-main {
  background:
    radial-gradient(circle at 18% 12%, rgba(125, 211, 252, 0.14), transparent 32%),
    radial-gradient(circle at 84% 8%, rgba(52, 211, 153, 0.12), transparent 30%);
}

.game-section {
  padding: clamp(34px, 6vw, 64px) 0 clamp(28px, 5vw, 48px);
}

.game-title-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  max-width: 1040px;
  margin: 0 auto 18px;
}

.game-title-bar h1 {
  font-size: clamp(1.95rem, 5vw, 3.1rem);
}

.game-title-bar p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.12rem);
  font-weight: 800;
}

.tic-tac-toe-shell {
  width: min(1040px, 100%);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 18px;
  align-items: stretch;
}

.ttt-board-card,
.ttt-side-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 34px;
  box-shadow: 0 24px 70px rgba(16, 24, 40, 0.09);
}

.ttt-board-card {
  min-width: 0;
  padding: clamp(18px, 3vw, 28px);
  display: grid;
  gap: clamp(18px, 3vw, 28px);
}

.ttt-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ttt-status {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--pill-radius);
  font-weight: 950;
}

.ttt-board {
  width: min(100%, 520px);
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(10px, 2vw, 14px);
}

.ttt-cell {
  aspect-ratio: 1;
  min-width: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0)),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: clamp(22px, 4vw, 32px);
  cursor: pointer;
  font-size: clamp(3rem, 11vw, 5.8rem);
  font-weight: 950;
  line-height: 1;
  user-select: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 14px 34px rgba(16, 24, 40, 0.08);
  transition: transform 150ms ease, border-color 160ms ease, background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.ttt-cell:hover:not(:disabled),
.ttt-cell:focus-visible {
  border-color: color-mix(in srgb, var(--primary) 58%, var(--line));
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--primary) 13%, transparent), 0 18px 40px rgba(16, 24, 40, 0.1);
  outline: none;
  transform: translateY(-2px);
}

.ttt-cell:active:not(:disabled) {
  transform: scale(0.98);
}

.ttt-cell:disabled {
  cursor: default;
}

.ttt-cell.is-x {
  color: #2563eb;
}

.ttt-cell.is-o {
  color: #059669;
}

.ttt-cell.is-win {
  color: #07111f;
  background: linear-gradient(135deg, #7dd3fc, #34d399);
  border-color: transparent;
  box-shadow: 0 18px 46px rgba(20, 184, 166, 0.2);
}

html[data-theme="dark"] .ttt-cell {
  background:
    linear-gradient(145deg, rgba(125, 211, 252, 0.08), rgba(52, 211, 153, 0.02)),
    rgba(15, 23, 42, 0.9);
}

html[data-theme="dark"] .ttt-cell.is-x {
  color: #7dd3fc;
}

html[data-theme="dark"] .ttt-cell.is-o {
  color: #34d399;
}

.ttt-side-card {
  min-width: 0;
  padding: 22px;
  display: grid;
  gap: 18px;
  align-content: start;
}

.ttt-option-block {
  display: grid;
  gap: 10px;
}

.ttt-option-block h2 {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ttt-segment {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--pill-radius);
}

.ttt-segment button {
  min-height: 42px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: var(--pill-radius);
  cursor: pointer;
  font-weight: 950;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.ttt-segment button:hover,
.ttt-segment button:focus-visible {
  color: var(--ink);
  background: var(--surface);
  outline: none;
}

.ttt-segment button.is-active {
  color: #07111f;
  background: linear-gradient(135deg, #7dd3fc, #34d399);
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.12);
}

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

.ttt-score-grid div {
  min-width: 0;
  padding: 14px 10px;
  text-align: center;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 24px;
}

.ttt-score-grid span,
.ttt-score-grid strong {
  display: block;
}

.ttt-score-grid span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 950;
}

.ttt-score-grid strong {
  margin-top: 2px;
  font-size: 1.6rem;
  line-height: 1;
}

.ttt-reset-score {
  width: 100%;
}

@media (max-width: 860px) {
  .game-title-bar {
    align-items: flex-start;
  }

  .tic-tac-toe-shell {
    grid-template-columns: 1fr;
  }

  .ttt-side-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ttt-score-grid,
  .ttt-reset-score {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .game-section {
    padding-top: 24px;
  }

  .game-title-bar {
    margin-bottom: 14px;
  }

  .game-title-bar p {
    font-size: 0.98rem;
  }

  .ttt-board-card,
  .ttt-side-card {
    border-radius: 28px;
  }

  .ttt-status-row {
    align-items: stretch;
  }

  .ttt-status {
    min-width: 0;
    flex: 1;
  }

  .ttt-board {
    gap: 9px;
  }

  .ttt-side-card {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .ttt-score-grid,
  .ttt-reset-score {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  .tool-guide .container,
  .hub-guide .container {
    width: min(1120px, calc(100% - 22px));
  }

  .content-panel {
    padding: 20px;
  }
}

.site-footer {
  padding: 24px 0;
  color: #fff;
  background: var(--footer-bg);
}



.site-footer nav a {
  color: #c7ccd1;
}

.site-footer nav a:hover,
.site-footer nav a:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.footer-bottom {
  margin-top: 28px;
  padding-top: 18px;
  color: #aeb6bd;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.92rem;
}

.footer-bottom-minimal {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  flex-wrap: wrap;
}

.footer-bottom-minimal nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.site-footer nav .footer-home-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  color: #07111f;
  background: linear-gradient(135deg, #7dd3fc, #34d399);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--pill-radius);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
  font-weight: 950;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 180ms ease;
}

.site-footer nav .footer-home-link:hover,
.site-footer nav .footer-home-link:focus-visible {
  color: #07111f;
  background: linear-gradient(135deg, #7dd3fc, #34d399);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.22);
  outline: none;
  transform: translateY(-1px);
}

.tool-grid .tool-card:only-child {
  grid-column: span 8;
}

.tool-main {
  background: var(--body-bg);
}

.tool-section {
  padding: 26px 0 72px;
}

.cleaner-shell {
  display: grid;
  gap: 12px;
}

.tool-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.tool-title-bar .eyebrow {
  margin-bottom: 4px;
}

.tool-title-bar h1 {
  color: var(--ink);
  font-size: 1.55rem;
  line-height: 1.05;
}

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

.recipe-strip {
  display: flex;
  align-items: center;
  grid-auto-flow: column;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: thin;
}

.recipe-chip {
  min-height: 40px;
  flex: 0 0 auto;
  padding: 0 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--pill-radius);
  box-shadow: 0 10px 26px rgba(16, 24, 40, 0.06);
  cursor: pointer;
  font-weight: 900;
  white-space: nowrap;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.recipe-chip:hover,
.recipe-chip:focus-visible,
.recipe-chip.is-active {
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.12);
  outline: none;
}

.recipe-chip.is-active {
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #15803d);
}

.editor-zone {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

.editor-card {
  background: var(--glass);
  border: 1px solid var(--line);
  min-width: 0;
  border-radius: 26px;
  box-shadow: 0 20px 56px rgba(16, 24, 40, 0.08);
  backdrop-filter: blur(16px);
  overflow: hidden;
  transition: background 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.result-card {
  background:
    linear-gradient(145deg, var(--glass-strong), var(--panel-bg));
}

.editor-head {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.editor-label {
  display: block;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 950;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.icon-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--pill-radius);
  cursor: pointer;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.icon-button:hover,
.icon-button:focus-visible {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  outline: none;
}

.icon-button:disabled {
  color: var(--muted);
  background: var(--surface-soft);
  border-color: var(--line);
  box-shadow: none;
  cursor: not-allowed;
}

.toggle-action {
  inline-size: 76px;
  flex: 0 0 76px;
}

.toggle-action.is-active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.stable-action {
  min-width: 0;
  inline-size: 112px;
  flex: 0 0 112px;
}

.strong-action {
  min-width: 124px;
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.strong-action:hover,
.strong-action:focus-visible {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.text-box {
  width: 100%;
  height: clamp(410px, 57vh, 620px);
  display: block;
  padding: 16px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: none;
  resize: none;
  font-size: 1rem;
  line-height: 1.58;
}

.result-card.find-replace-open .text-box {
  height: clamp(310px, 43vh, 520px);
}

.text-box::placeholder {
  color: var(--muted);
}

.output-preview {
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.output-preview.is-empty::before {
  color: var(--muted);
  content: attr(data-placeholder);
}

.output-match {
  padding: 1px 2px;
  background: #fef08a;
  border-radius: 5px;
  box-shadow: 0 0 0 1px rgba(234, 179, 8, 0.16);
}

html[data-theme="dark"] .output-match {
  color: #1f2937;
}

.output-match.is-current {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}

html[data-theme="dark"] .output-match.is-current {
  color: #07111f;
}

.metric-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0;
}

.metric-row span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 10px;
  color: var(--muted);
  background: var(--surface-soft);
  border-radius: var(--pill-radius);
  font-size: 0.86rem;
  font-weight: 800;
}

.metric-row strong {
  color: var(--ink);
}

.result-metrics {
  justify-content: center;
}

.segmented-control {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--surface-soft);
  border-radius: var(--pill-radius);
}

.segment {
  min-height: 36px;
  padding: 0 13px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: var(--pill-radius);
  cursor: pointer;
  font-weight: 950;
  white-space: nowrap;
}

.segment:hover,
.segment:focus-visible,
.segment.is-active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.09);
  outline: none;
}

.option-dock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--pill-radius);
  box-shadow: 0 14px 38px rgba(16, 24, 40, 0.07);
}

.shape-control {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.shape-control > span {
  padding-left: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 950;
}

.switch-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.switch-card {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 7px 7px 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--pill-radius);
  cursor: pointer;
  font-weight: 900;
  text-align: left;
}

.switch-card span {
  white-space: nowrap;
}

.switch-card:hover,
.switch-card:focus-visible {
  border-color: rgba(37, 99, 235, 0.45);
  outline: none;
}

.switch-card i {
  position: relative;
  width: 42px;
  height: 26px;
  flex: 0 0 auto;
  background: var(--line);
  border-radius: var(--pill-radius);
  transition: background 160ms ease;
}

.switch-card i::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: var(--surface);
  border-radius: 50%;
  box-shadow: 0 5px 12px rgba(16, 24, 40, 0.24);
  transition: transform 160ms ease;
}

.switch-card.is-on i {
  background: linear-gradient(135deg, var(--primary), var(--green));
}

.switch-card.is-on i::before {
  transform: translateX(16px);
}

.advanced-toggle {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 8px 0 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--pill-radius);
  cursor: pointer;
  font-weight: 950;
  text-align: left;
  white-space: nowrap;
}

.advanced-toggle i {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: var(--surface-soft);
  border-radius: 50%;
}

.advanced-toggle i::before {
  content: "+";
  color: var(--primary);
  font-weight: 950;
}

.advanced-toggle[aria-expanded="true"] i::before {
  content: "-";
}

.advanced-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 14px 38px rgba(16, 24, 40, 0.07);
}

.replace-panel {
  display: grid;
  gap: 12px;
  padding: 10px 12px 12px;
  background: var(--panel-bg);
  border-bottom: 1px solid var(--line);
}

.replace-row {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
}

.replace-row:first-child {
  grid-template-columns: 66px minmax(0, 1fr);
}

.replace-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  grid-column: 2;
  min-width: 0;
}

.match-controls {
  display: flex;
  grid-column: 2;
  grid-row: 2;
  gap: 6px;
  justify-self: start;
}

.compact-button {
  min-height: 40px;
  padding-inline: 12px;
}

.compact-input {
  min-width: 0;
  min-height: 40px;
}

.match-counter {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--pill-radius);
  font-size: 0.82rem;
  font-weight: 900;
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  white-space: nowrap;
}

.field-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.1;
}

.clean-input {
  width: 100%;
  min-height: 46px;
  padding: 0 15px;
  color: var(--ink);
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: var(--pill-radius);
  outline: none;
}

.clean-input:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.compact-switch {
  margin-top: 0;
  min-width: 146px;
  min-height: 40px;
  flex: 0 0 auto;
  padding-left: 14px;
}

.compact-switch i {
  width: 38px;
  height: 24px;
}

.compact-switch i::before {
  width: 18px;
  height: 18px;
}

.compact-switch.is-on i::before {
  transform: translateX(14px);
}

.not-found-page {
  min-height: calc(100vh - var(--site-header-height, 72px));
}

.not-found-hero {
  min-height: calc(100vh - var(--site-header-height, 72px));
  display: grid;
  align-items: center;
  padding: 64px 0;
}

.not-found-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 42px;
  align-items: center;
}

.not-found-copy h1 {
  max-width: 760px;
  color: transparent;
  background: linear-gradient(90deg, #101828 0%, #1d4ed8 62%, #166534 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

html[data-theme="dark"] .not-found-copy h1 {
  background: linear-gradient(90deg, #f8fafc 0%, #7dd3fc 58%, #86efac 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.not-found-copy p:not(.eyebrow) {
  max-width: 660px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.12rem;
}

.not-found-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.not-found-card {
  position: relative;
  padding: 26px;
  color: var(--ink);
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 32px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.not-found-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(21, 128, 61, 0.08), transparent 62%);
  pointer-events: none;
}

.not-found-card > * {
  position: relative;
  z-index: 1;
}

.not-found-code {
  width: fit-content;
  margin-bottom: 18px;
  padding: 8px 14px;
  color: #07111f;
  background: linear-gradient(135deg, var(--primary), var(--green));
  border-radius: var(--pill-radius);
  box-shadow: 0 16px 36px rgba(37, 99, 235, 0.18);
  font-size: clamp(3.5rem, 8vw, 6rem);
  font-weight: 950;
  line-height: 0.95;
}

.not-found-card h2 {
  font-size: 1.4rem;
}

.not-found-links {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.not-found-links a {
  min-height: 62px;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: var(--pill-radius);
  text-decoration: none;
  backdrop-filter: blur(14px);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.not-found-links a:hover,
.not-found-links a:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 18px 42px rgba(37, 99, 235, 0.14);
  transform: translateY(-2px);
  outline: none;
}

.not-found-links span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  font-size: 0.82rem;
  font-weight: 900;
}

.not-found-links .tool-icon {
  grid-column: auto;
  grid-row: auto;
  justify-self: auto;
  background: var(--primary);
  box-shadow: none;
}

@media (max-width: 920px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    max-width: 640px;
  }

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

  .quick-grid div:nth-child(odd) {
    border-left: 0;
  }

  .quick-grid div:nth-child(n + 3) {
    padding-top: 16px;
    margin-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
  }

  .tool-grid {
    grid-template-columns: 1fr;
  }

  .tool-card,
  .tool-card:nth-child(1),
  .tool-card:nth-child(2),
  .tool-card:nth-child(3),
  .tool-card:nth-child(4),
  .tool-card:nth-child(5),
  .tool-card:nth-child(6) {
    grid-column: 1 / -1;
  }

  .not-found-shell {
    grid-template-columns: 1fr;
  }

  .not-found-card {
    max-width: 640px;
  }
}

@media (max-width: 680px) {
  :root {
    --site-header-height: 72px;
  }

  .section-heading,
  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-inner {
    min-height: 64px;
    gap: 10px;
    padding: 10px 0;
  }

  .brand {
    min-width: 0;
  }

  .brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand small {
    display: none;
  }

  .header-main {
    margin-left: 0;
  }

  .site-header.nav-ready .header-main {
    position: absolute;
    top: calc(100% + 8px);
    left: 16px;
    right: 16px;
    z-index: 20;
    display: block;
    width: auto;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px) scale(0.98);
    transform-origin: top right;
    transition: opacity 180ms ease, transform 180ms ease, visibility 0s linear 180ms;
  }

  .site-header.nav-ready.nav-open .header-main {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    transition-delay: 0s;
  }

  .site-header.nav-ready .site-nav {
    width: 100%;
    display: grid;
    gap: 4px;
    padding: 8px;
    background: var(--glass-strong);
    border: 1px solid var(--line);
    border-radius: 26px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
  }

  .site-header.nav-ready .site-nav a {
    padding: 12px 14px;
    color: var(--ink);
  }

  .site-header.nav-ready .site-nav a:hover,
  .site-header.nav-ready .site-nav a:focus-visible {
    background: var(--soft-page);
  }

  .theme-picker {
    width: auto;
    margin-left: 0;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .theme-menu {
    left: auto;
    right: 0;
    width: min(78vw, 240px);
  }

  .hero-section {
    padding: 36px 0 30px;
  }

  h1 {
    font-size: 2.75rem;
  }

  h2 {
    font-size: 1.7rem;
  }

  .page-hero h1 {
    font-size: 2.35rem;
  }

  .panel-top {
    padding-inline: 0;
  }

  .panel-list a:nth-child(odd),
  .panel-list a:nth-child(even) {
    transform: none;
  }

  .hero-panel p {
    width: 100%;
    margin-left: 0;
  }

  .quick-grid {
    grid-template-columns: 1fr;
  }

  .quick-grid div {
    padding-inline: 4px;
  }

  .quick-grid div + div {
    padding-top: 16px;
    margin-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    border-left: 0;
  }

  .tool-card {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) 52px;
    border-radius: 28px;
  }

  .panel-list a {
    border-radius: 28px;
  }

  .tool-icon {
    width: 52px;
    height: 52px;
  }

  .section {
    padding-block: 48px;
  }

  .not-found-hero {
    align-items: start;
    padding: 38px 0 54px;
  }

  .not-found-copy h1 {
    font-size: 2.7rem;
  }

  .not-found-card {
    border-radius: 26px;
    padding: 20px;
  }
}

@media (max-width: 420px) {
  .container {
    width: min(100% - 22px, 1120px);
  }

  .site-nav a {
    font-size: 0.93rem;
  }

  .panel-list a {
    grid-template-columns: 38px 1fr;
  }

  .panel-list span {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 1040px) {
  .tool-grid .tool-card:only-child {
    grid-column: 1 / -1;
  }

  .option-dock {
    flex-wrap: wrap;
    border-radius: 28px;
  }

  .result-metrics {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    padding-left: 6px;
  }

  .replace-row,
  .replace-row:first-child {
    grid-template-columns: 1fr;
  }

  .match-controls,
  .match-counter,
  .replace-actions {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
  }
}

@media (max-width: 760px) {
  .tool-section {
    padding-top: 18px;
  }

  .editor-zone {
    grid-template-columns: 1fr;
  }

  .tool-title-bar,
  .editor-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .tool-title-bar h1 {
    font-size: 1.35rem;
  }

  .tool-title-bar .editor-actions,
  .editor-actions {
    justify-content: flex-start;
  }

  .text-box {
    height: 330px;
  }

  .recipe-strip {
    margin-inline: -2px;
  }

  .option-dock,
  .shape-control {
    align-items: stretch;
    flex-direction: column;
  }

  .segmented-control {
    overflow-x: auto;
    justify-content: flex-start;
    max-width: 100%;
  }

  .advanced-toggle {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .editor-card {
    border-radius: 22px;
  }

  .tool-title-bar .editor-actions {
    width: 100%;
  }

  .tool-title-bar .icon-button {
    flex: 1 1 auto;
  }

  .editor-head .metric-row {
    width: 100%;
  }

  .segment {
    flex: 0 0 auto;
  }

  .switch-list {
    display: grid;
    grid-template-columns: 1fr;
  }
}

.calculator-tool-section {
  padding: 34px 0 72px;
}

.calculator-tool-shell {
  display: grid;
  gap: 18px;
}

.calculator-title-bar {
  max-width: 560px;
  margin-inline: auto;
}

.calculator-workspace {
  width: min(560px, 100%);
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: stretch;
  margin-inline: auto;
}

.calculator-card,
.history-panel {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 34px;
  box-shadow: var(--shadow);
}

.calculator-card {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.calculator-display {
  min-height: 166px;
  display: grid;
  align-content: end;
  gap: 8px;
  padding: 22px;
  overflow: hidden;
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(37, 99, 235, 0.1), rgba(20, 184, 166, 0.08)),
    var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 28px;
}

html[data-theme="dark"] .calculator-display {
  background:
    linear-gradient(145deg, rgba(125, 211, 252, 0.12), rgba(52, 211, 153, 0.08)),
    var(--surface-soft);
}

.display-formula,
.display-preview {
  min-height: 22px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calculator-keypad {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.calc-key {
  min-width: 0;
  min-height: 66px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--pill-radius);
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.08);
  cursor: pointer;
  font-size: 1.18rem;
  font-weight: 950;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.calc-key:hover,
.calc-key:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1), 0 12px 28px rgba(16, 24, 40, 0.08);
  outline: none;
  transform: translateY(-1px);
}

.calc-key:active {
  transform: translateY(1px) scale(0.98);
}

.key-function {
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.key-operator {
  color: #ffffff;
  background: linear-gradient(145deg, #2563eb, #0f9f8f);
  border-color: transparent;
}

.key-equals {
  color: #ffffff;
  background: linear-gradient(145deg, #101828, #2563eb);
  border-color: transparent;
}

html[data-theme="dark"] .key-equals {
  color: #050814;
  background: linear-gradient(145deg, #7dd3fc, #34d399);
}

.history-panel {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  padding: 18px;
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.history-head span {
  display: block;
  color: var(--ink);
  font-weight: 950;
}

.history-head small {
  color: var(--muted);
  font-weight: 800;
}

.history-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.history-list {
  display: grid;
  align-content: start;
  gap: 10px;
  max-height: 470px;
  overflow: auto;
  padding-right: 4px;
}

.history-list.is-empty {
  align-content: center;
}

.history-list.is-empty p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.history-item {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 20px;
  cursor: pointer;
  text-align: right;
}

.history-item:hover,
.history-item:focus-visible {
  border-color: var(--primary);
  outline: none;
}

.history-item span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item strong {
  font-size: 1.12rem;
  font-weight: 950;
}

#historyOpenButton,
#copyResultButton {
  min-width: 92px;
}

@media (max-width: 860px) {
  .calculator-tool-section {
    padding-top: 22px;
  }

  .history-panel {
    min-height: auto;
    box-shadow: 0 14px 36px rgba(16, 24, 40, 0.08);
  }
}

@media (max-width: 520px) {
  .calculator-card,
  .history-panel {
    border-radius: 24px;
  }

  .calculator-card {
    padding: 12px;
  }

  .calculator-display {
    min-height: 136px;
    padding: 18px;
    border-radius: 22px;
  }

  .calculator-keypad {
    gap: 8px;
  }

  .calc-key {
    min-height: 58px;
    font-size: 1.05rem;
  }
}

body.history-open {
  overflow: hidden;
}

.calculator-display {
  position: relative;
}

.display-input {
  width: 100%;
  min-height: 62px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: none;
  font-size: clamp(2.1rem, 7vw, 3.8rem);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1.05;
  text-align: right;
  text-overflow: ellipsis;
}

.display-input::selection {
  color: #ffffff;
  background: var(--primary);
}

html[data-theme="dark"] .display-input::selection {
  color: #050814;
  background: var(--primary);
}

.display-input::placeholder {
  color: var(--muted);
}

.display-preview {
  min-height: 28px;
  justify-self: end;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 900;
  text-align: right;
}

.display-preview:hover,
.display-preview:focus-visible {
  color: var(--primary-dark);
  outline: none;
}

.display-preview:disabled {
  cursor: default;
}

.display-preview:disabled:hover {
  color: var(--muted);
}

.calculator-display.is-animating-result .display-formula,
.calculator-display.is-animating-result .display-input,
.calculator-display.is-animating-result .display-preview {
  color: transparent;
  caret-color: transparent;
}

.calculator-motion-ghost {
  position: fixed;
  z-index: 180;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  pointer-events: none;
  text-align: right;
  white-space: nowrap;
  transition:
    left 320ms cubic-bezier(0.2, 0.8, 0.2, 1),
    top 320ms cubic-bezier(0.2, 0.8, 0.2, 1),
    width 320ms cubic-bezier(0.2, 0.8, 0.2, 1),
    height 320ms cubic-bezier(0.2, 0.8, 0.2, 1),
    color 240ms ease,
    font-size 320ms cubic-bezier(0.2, 0.8, 0.2, 1),
    line-height 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
  .calculator-motion-ghost {
    transition: none;
  }
}

.history-overlay {
  position: fixed;
  inset: 0;
  z-index: 155;
  background: rgba(15, 23, 42, 0.34);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

html[data-theme="dark"] .history-overlay {
  background: rgba(0, 0, 0, 0.48);
}

.history-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.history-panel {
  position: fixed;
  top: calc(var(--site-header-height, 72px) + 16px);
  right: 16px;
  bottom: 16px;
  z-index: 160;
  width: min(380px, calc(100% - 32px));
  min-height: auto;
  transform: translateX(calc(100% + 28px));
  transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.history-panel.is-open {
  transform: translateX(0);
}

.history-list {
  max-height: none;
  min-height: 0;
}

@media (max-width: 760px) {
  .history-panel {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: min(76svh, 620px);
    border-radius: 28px 28px 0 0;
    transform: translateY(calc(100% + 28px));
  }

  .history-panel.is-open {
    transform: translateY(0);
  }
}

.bmi-tool-section {
  padding: 34px 0 72px;
}

.bmi-tool-shell {
  display: grid;
  gap: 18px;
}

.bmi-title-bar {
  max-width: 980px;
  margin-inline: auto;
}

.bmi-title-bar p {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.bmi-workspace {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
  gap: 18px;
  align-items: stretch;
  margin-inline: auto;
}

.bmi-input-card,
.bmi-result-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 34px;
  box-shadow: var(--shadow);
}

.bmi-input-card {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 22px;
}

.bmi-unit-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--pill-radius);
}

.bmi-unit-toggle button,
.bmi-example-row button {
  min-height: 42px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: var(--pill-radius);
  cursor: pointer;
  font-weight: 950;
}

.bmi-unit-toggle button.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--green));
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.16);
}

html[data-theme="dark"] .bmi-unit-toggle button.is-active {
  color: #050814;
}

.bmi-fields {
  display: grid;
  gap: 14px;
}

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

.bmi-field {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 900;
}

.bmi-input-wrap {
  min-height: 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.bmi-input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.bmi-input-wrap input {
  min-width: 0;
  width: 100%;
  padding: 0;
  appearance: textfield;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: none;
  font-size: 1.6rem;
  font-weight: 950;
}

.bmi-input-wrap input::-webkit-outer-spin-button,
.bmi-input-wrap input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.bmi-input-wrap input::selection {
  color: #ffffff;
  background: var(--primary);
}

html[data-theme="dark"] .bmi-input-wrap input::selection {
  color: #050814;
}

.bmi-input-wrap small {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 950;
}

.bmi-example-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bmi-example-row button {
  padding: 0 13px;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.bmi-example-row button:hover,
.bmi-example-row button:focus-visible,
.bmi-unit-toggle button:focus-visible {
  border-color: var(--primary);
  outline: 3px solid rgba(37, 99, 235, 0.14);
  outline-offset: 2px;
}

.bmi-disclaimer {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
  line-height: 1.55;
}

.bmi-result-card {
  position: sticky;
  top: calc(var(--site-header-height, 72px) + 18px);
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 24px;
  overflow: hidden;
}

.bmi-result-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.11), rgba(20, 184, 166, 0.08));
  pointer-events: none;
}

.bmi-result-card > * {
  position: relative;
  z-index: 1;
}

.bmi-result-top {
  display: grid;
  gap: 6px;
}

.bmi-result-top span,
.bmi-healthy-range span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
}

.bmi-result-top strong {
  color: var(--ink);
  font-size: clamp(4rem, 11vw, 6.5rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.bmi-category-pill {
  justify-self: start;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 15px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--pill-radius);
  font-weight: 950;
}

.bmi-result-card[data-bmi-category="underweight"] .bmi-category-pill {
  color: #075985;
  background: rgba(125, 211, 252, 0.22);
  border-color: rgba(14, 165, 233, 0.28);
}

.bmi-result-card[data-bmi-category="healthy"] .bmi-category-pill {
  color: #166534;
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(22, 163, 74, 0.28);
}

.bmi-result-card[data-bmi-category="overweight"] .bmi-category-pill {
  color: #9a3412;
  background: rgba(251, 146, 60, 0.18);
  border-color: rgba(249, 115, 22, 0.28);
}

.bmi-result-card[data-bmi-category="obesity"] .bmi-category-pill {
  color: #9f1239;
  background: rgba(244, 63, 94, 0.16);
  border-color: rgba(225, 29, 72, 0.24);
}

html[data-theme="dark"] .bmi-result-card[data-bmi-category] .bmi-category-pill {
  color: var(--ink);
}

.bmi-range {
  position: relative;
  height: 16px;
  display: grid;
  grid-template-columns: 21.7fr 21.7fr 16.7fr 40fr;
  gap: 3px;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--pill-radius);
}

.bmi-band {
  border-radius: inherit;
}

.bmi-band.underweight {
  background: #7dd3fc;
}

.bmi-band.healthy {
  background: #34d399;
}

.bmi-band.overweight {
  background: #fb923c;
}

.bmi-band.obesity {
  background: #fb7185;
}

.bmi-marker {
  position: absolute;
  top: 50%;
  left: 0;
  width: 24px;
  height: 24px;
  background: var(--ink);
  border: 4px solid var(--surface);
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.22);
  transform: translate(-50%, -50%);
  transition: left 180ms ease;
}

.bmi-result-card[data-bmi-category="empty"] .bmi-marker {
  opacity: 0;
}

.bmi-range-labels {
  display: grid;
  grid-template-columns: 43.4fr 16.7fr 39.9fr;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.bmi-range-labels span:nth-child(2) {
  text-align: center;
}

.bmi-range-labels span:nth-child(3) {
  text-align: right;
}

.bmi-result-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.55;
}

.bmi-healthy-range {
  display: grid;
  gap: 5px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
}

.bmi-healthy-range strong {
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1.1;
}

#copyBmiButton,
#resetBmiButton {
  min-width: 92px;
}

@media (max-width: 860px) {
  .bmi-tool-section {
    padding-top: 22px;
  }

  .bmi-workspace {
    grid-template-columns: 1fr;
  }

  .bmi-result-card {
    order: -1;
    position: relative;
    top: auto;
  }
}

@media (max-width: 520px) {
  .bmi-input-card,
  .bmi-result-card {
    border-radius: 24px;
  }

  .bmi-input-card,
  .bmi-result-card {
    padding: 16px;
  }

  .bmi-field-group {
    grid-template-columns: 1fr;
  }

  .bmi-input-wrap {
    min-height: 58px;
    border-radius: 20px;
  }

  .bmi-input-wrap input {
    font-size: 1.35rem;
  }
}

.age-tool-section {
  padding: 34px 0 72px;
}

.age-tool-shell {
  display: grid;
  gap: 18px;
}

.age-title-bar {
  max-width: 980px;
  margin-inline: auto;
}

.age-title-bar p {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.age-workspace {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
  gap: 18px;
  align-items: stretch;
  margin-inline: auto;
}

.age-input-card,
.age-result-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 34px;
  box-shadow: var(--shadow);
}

.age-input-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 22px;
}

.age-date-block {
  display: grid;
  gap: 12px;
}

.age-date-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

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

.age-date-heading h2 {
  font-size: 1rem;
}

.age-date-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.age-link-button {
  min-height: 36px;
  padding: 0 13px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: var(--pill-radius);
  cursor: pointer;
  font-weight: 950;
}

.age-link-button[aria-expanded="true"] {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
}

html[data-theme="dark"] .age-link-button[aria-expanded="true"] {
  color: #050814;
}

.age-link-button:hover,
.age-link-button:focus-visible {
  color: #ffffff;
  background: var(--primary);
  outline: none;
}

html[data-theme="dark"] .age-link-button:hover,
html[data-theme="dark"] .age-link-button:focus-visible {
  color: #050814;
}

.age-date-grid {
  display: grid;
  grid-template-columns: 0.8fr 0.8fr 1fr;
  gap: 12px;
}

.age-field {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 900;
}

.age-input-wrap {
  min-height: 64px;
  display: grid;
  align-items: center;
  padding: 0 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.age-input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.age-input-wrap input {
  min-width: 0;
  width: 100%;
  padding: 0;
  appearance: textfield;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: none;
  font-size: 1.48rem;
  font-weight: 950;
}

.age-input-wrap input::-webkit-outer-spin-button,
.age-input-wrap input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.age-input-wrap input::selection {
  color: #ffffff;
  background: var(--primary);
}

html[data-theme="dark"] .age-input-wrap input::selection {
  color: #050814;
}

.age-date-picker {
  position: absolute;
  top: var(--age-picker-top, 96px);
  left: 22px;
  right: 22px;
  z-index: 30;
  display: grid;
  gap: 13px;
  max-height: min(560px, calc(100svh - var(--site-header-height, 72px) - 54px));
  overflow: auto;
  padding: 16px;
  background:
    linear-gradient(145deg, rgba(37, 99, 235, 0.08), rgba(20, 184, 166, 0.06)),
    var(--glass-strong);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.age-date-picker[data-picker-for="birth"] {
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
}

.age-date-picker[data-picker-for="asOf"] {
  box-shadow: inset 0 0 0 1px rgba(21, 128, 61, 0.1);
}

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

.age-picker-nav {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}

.age-picker-nav:hover,
.age-picker-nav:focus-visible {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
  outline: none;
}

html[data-theme="dark"] .age-picker-nav:hover,
html[data-theme="dark"] .age-picker-nav:focus-visible {
  color: #050814;
}

.age-picker-current {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(94px, 0.42fr);
  gap: 10px;
  align-items: center;
}

.age-picker-current strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.age-picker-current label {
  min-height: 42px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--pill-radius);
  font-size: 0.78rem;
  font-weight: 950;
}

.age-picker-current label:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.age-picker-current input {
  min-width: 0;
  width: 100%;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: none;
  appearance: textfield;
  font-weight: 950;
}

.age-picker-current input::-webkit-outer-spin-button,
.age-picker-current input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.age-picker-days button {
  min-width: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--pill-radius);
  cursor: pointer;
  font-weight: 950;
}

.age-picker-days button.is-selected {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--green));
  border-color: transparent;
}

html[data-theme="dark"] .age-picker-days button.is-selected {
  color: #050814;
}

.age-picker-days button:hover,
.age-picker-days button:focus-visible {
  border-color: var(--primary);
  outline: 3px solid rgba(37, 99, 235, 0.14);
  outline-offset: 1px;
}

.age-picker-weekdays,
.age-picker-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.age-picker-weekdays {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  text-align: center;
}

.age-picker-days button,
.age-picker-empty {
  min-height: 40px;
}

.age-picker-days button.is-today:not(.is-selected) {
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.age-picker-days button.is-muted {
  color: var(--muted);
  background: rgba(148, 163, 184, 0.1);
}

.age-picker-days button.is-muted.is-selected {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--green));
}

html[data-theme="dark"] .age-picker-days button.is-muted.is-selected {
  color: #050814;
}

.age-picker-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.age-result-card {
  position: sticky;
  top: calc(var(--site-header-height, 72px) + 18px);
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 24px;
  overflow: hidden;
}

.age-result-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.11), rgba(20, 184, 166, 0.08));
  pointer-events: none;
}

.age-result-card > * {
  position: relative;
  z-index: 1;
}

.age-result-top {
  display: grid;
  gap: 8px;
}

.age-result-top span,
.age-stat span,
.age-next-box span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
}

.age-result-top strong {
  color: var(--ink);
  font-size: clamp(3.5rem, 9vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.age-result-top small {
  color: var(--primary-dark);
  font-size: 1rem;
  font-weight: 950;
}

html[data-theme="dark"] .age-result-top small {
  color: var(--primary);
}

.age-result-card[data-age-state="message"] .age-result-top small {
  color: var(--rose);
}

.age-result-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.55;
}

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

.age-stat,
.age-next-box {
  display: grid;
  gap: 5px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
}

.age-stat strong,
.age-next-box strong {
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1.15;
}

.age-next-box {
  border-radius: 24px;
}

.age-next-box small {
  color: var(--muted);
  font-weight: 900;
}

#copyAgeButton,
#resetAgeButton {
  min-width: 92px;
}

@media (max-width: 860px) {
  .age-tool-section {
    padding-top: 22px;
  }

  .age-workspace {
    grid-template-columns: 1fr;
  }

  .age-result-card {
    position: relative;
    top: auto;
  }
}

@media (max-width: 620px) {
  .age-stat-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .age-input-card,
  .age-result-card {
    border-radius: 24px;
    padding: 16px;
  }

  .age-date-picker {
    left: 16px;
    right: 16px;
  }

  .age-date-heading {
    align-items: start;
    flex-direction: column;
  }

  .age-heading-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .age-date-grid {
    gap: 8px;
  }

  .age-input-wrap {
    min-height: 58px;
    padding: 0 10px;
    border-radius: 20px;
  }

  .age-input-wrap input {
    font-size: 1.2rem;
  }

  .age-picker-head,
  .age-picker-current {
    grid-template-columns: 1fr;
  }

  .age-picker-head {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
  }

  .age-picker-current {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .age-picker-nav:first-child {
    grid-column: 1;
    grid-row: 1;
  }

  .age-picker-nav:last-child {
    grid-column: 3;
    grid-row: 1;
  }

}

/* Clock tool */
.clock-tool-section {
  min-height: calc(100svh - var(--site-header-height, 72px));
  display: grid;
  align-items: stretch;
  padding: 18px 0 32px;
}

.clock-shell {
  min-height: calc(100svh - var(--site-header-height, 72px) - 50px);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
}

.clock-title-bar {
  max-width: 760px;
  width: 100%;
  margin-inline: auto;
  align-self: start;
  display: flex;
  justify-content: center;
  text-align: center;
}

.clock-workspace {
  width: min(980px, 100%);
  margin-inline: auto;
  align-self: center;
  display: grid;
  justify-content: stretch;
  min-width: 0;
}

.clock-card {
  position: relative;
  width: 100%;
  min-width: 0;
  display: grid;
  place-items: center;
  padding: clamp(24px, 5vw, 54px) 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.clock-view-actions {
  position: absolute;
  top: 0;
  right: clamp(2px, 1.2vw, 10px);
  z-index: 6;
  min-height: 34px;
  display: flex;
  gap: 8px;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.clock-card:has(.clock-face:hover) .clock-view-actions,
.clock-view-actions:hover,
.clock-view-actions:focus-within {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.clock-view-actions::before {
  content: "";
  position: absolute;
  inset: -18px -10px -14px;
  z-index: -1;
}

.clock-view-action {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 74%, transparent);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  user-select: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.clock-view-action:hover,
.clock-view-action:focus-visible {
  color: var(--accent);
  background: var(--surface);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  transform: translateY(-1px);
  outline: none;
}

.clock-view-action svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.clock-view-action .icon-active {
  display: none;
}

.clock-view-action[aria-pressed="true"] .icon-default {
  display: none;
}

.clock-view-action[aria-pressed="true"] .icon-active {
  display: block;
}

.clock-face {
  --analog-size: clamp(260px, 38vw, 430px);
  width: 100%;
  min-width: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: clamp(10px, 2vmin, 18px);
  text-align: center;
  user-select: none;
}

.clock-digital {
  width: 100%;
  min-width: 0;
}

.clock-time {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 0.95em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-size: clamp(3.2rem, 9.8vw, 7.2rem);
  font-weight: 950;
  line-height: 0.95;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
}

html[data-clock-font="space-grotesk"] .clock-time {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
}

html[data-clock-font="rajdhani"] .clock-time {
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
}

html[data-clock-font="chakra-petch"] .clock-time {
  font-family: "Chakra Petch", sans-serif;
  font-weight: 700;
}

html[data-clock-font="orbitron"] .clock-time {
  font-family: "Orbitron", sans-serif;
  font-weight: 700;
}

html[data-clock-font="roboto-mono"] .clock-time {
  font-family: "Roboto Mono", monospace;
  font-weight: 700;
}

.clock-date {
  margin: 0;
  color: var(--muted);
  font-weight: 850;
  line-height: 1.35;
}

.clock-date {
  font-size: clamp(1.05rem, 2vw, 1.55rem);
}

.clock-period {
  display: inline-block;
  color: var(--muted);
  font-size: 0.34em;
  font-weight: 950;
  line-height: 1;
  transform: translateY(-0.08em);
}

.analog-clock {
  width: min(var(--analog-size), 100%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.analog-clock[hidden],
.clock-digital[hidden] {
  display: none !important;
}

html:not([data-clock-mode="analog"]) .analog-clock,
html[data-clock-mode="analog"] .clock-digital {
  display: none;
}

.analog-clock-face {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--surface) 96%, transparent) 0 48%, transparent 49%),
    radial-gradient(circle at 30% 24%, rgba(125, 211, 252, 0.18), transparent 28%),
    radial-gradient(circle at 72% 78%, rgba(52, 211, 153, 0.18), transparent 30%),
    color-mix(in srgb, var(--surface-soft) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 86%, var(--accent) 14%);
  box-shadow:
    inset 0 0 0 10px color-mix(in srgb, var(--surface) 34%, transparent),
    inset 0 0 44px color-mix(in srgb, var(--accent) 10%, transparent),
    0 28px 70px rgba(15, 23, 42, 0.14);
}

html[data-theme="dark"] .analog-clock-face {
  background:
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--surface) 78%, transparent) 0 48%, transparent 49%),
    radial-gradient(circle at 30% 24%, rgba(125, 211, 252, 0.16), transparent 28%),
    radial-gradient(circle at 72% 78%, rgba(52, 211, 153, 0.16), transparent 30%),
    color-mix(in srgb, var(--surface-soft) 74%, transparent);
  box-shadow:
    inset 0 0 0 10px rgba(255, 255, 255, 0.035),
    inset 0 0 48px rgba(125, 211, 252, 0.08),
    0 30px 80px rgba(0, 0, 0, 0.28);
}

.analog-clock-ticks {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.analog-tick,
.analog-hour-label {
  position: absolute;
  left: 50%;
  top: 50%;
  pointer-events: none;
}

.analog-tick {
  width: 2px;
  height: clamp(6px, calc(var(--analog-size) * 0.025), 11px);
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 45%, transparent);
  transform:
    translate(-50%, -50%)
    rotate(calc(var(--tick-angle) * 1deg))
    translateY(calc(var(--analog-size) * -0.445));
}

.analog-tick.is-hour {
  width: 3px;
  height: clamp(13px, calc(var(--analog-size) * 0.046), 22px);
  background: color-mix(in srgb, var(--ink) 72%, var(--accent) 28%);
}

.analog-hour-label {
  color: color-mix(in srgb, var(--ink) 86%, var(--muted));
  font-size: clamp(0.9rem, calc(var(--analog-size) * 0.055), 1.32rem);
  font-weight: 950;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transform:
    translate(-50%, -50%)
    rotate(calc(var(--tick-angle) * 1deg))
    translateY(calc(var(--analog-size) * -0.39))
    rotate(calc(var(--tick-angle) * -1deg));
}

.analog-hand {
  position: absolute;
  left: 50%;
  bottom: 50%;
  border-radius: 999px;
  transform: translateX(-50%) rotate(var(--hand-angle, 0deg));
  transform-origin: 50% 100%;
  transition: transform 220ms cubic-bezier(0.2, 0.9, 0.2, 1);
  will-change: transform;
}

.analog-clock.is-settling .analog-hand {
  transition: transform 920ms cubic-bezier(0.16, 1, 0.3, 1);
}

.analog-hour-hand {
  width: clamp(7px, calc(var(--analog-size) * 0.025), 12px);
  height: 27%;
  background: linear-gradient(180deg, var(--ink), color-mix(in srgb, var(--ink) 76%, var(--accent)));
}

.analog-minute-hand {
  width: clamp(5px, calc(var(--analog-size) * 0.017), 8px);
  height: 38%;
  background: linear-gradient(180deg, color-mix(in srgb, var(--ink) 90%, var(--accent)), var(--ink));
}

.analog-second-hand {
  width: clamp(2px, calc(var(--analog-size) * 0.008), 4px);
  height: 42%;
  background: linear-gradient(180deg, #fb7185, var(--accent));
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 34%, transparent);
  transition: none;
}

html[data-second-motion="stepped"] .analog-second-hand {
  transition: transform 140ms cubic-bezier(0.3, 0, 0.2, 1);
}

.analog-clock.is-settling .analog-second-hand {
  transition: transform 920ms cubic-bezier(0.16, 1, 0.3, 1);
}

.analog-second-hand[hidden] {
  display: none !important;
}

.analog-center-cap {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(18px, calc(var(--analog-size) * 0.065), 32px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: linear-gradient(135deg, #7dd3fc, #34d399);
  border: clamp(4px, calc(var(--analog-size) * 0.018), 8px) solid var(--surface);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.22);
  transform: translate(-50%, -50%);
}

html[data-clock-face="classic"] .analog-clock-face {
  --classic-dial: #fffaf0;
  --classic-dial-edge: #eadfce;
  --classic-rim: #152033;
  --classic-rim-soft: #334155;
  --classic-mark: #111827;
  --classic-muted-mark: rgba(17, 24, 39, 0.34);
  --classic-second: #dc2626;
  --classic-glare: rgba(255, 255, 255, 0.66);
  --classic-shine: rgba(255, 255, 255, 0.72);
  --classic-ring: rgba(17, 24, 39, 0.16);
  --classic-ring-glow: rgba(255, 255, 255, 0.62);
  --classic-brand: rgba(17, 24, 39, 0.34);
  --classic-label-shadow: rgba(255, 255, 255, 0.72);
  --classic-hand-start: #020617;
  --classic-hand-end: #1f2937;
  --classic-cap: #111827;
  --classic-cap-border: var(--classic-dial);
  box-sizing: border-box;
  background:
    radial-gradient(circle at 50% 50%, var(--classic-glare) 0 7%, transparent 8%),
    radial-gradient(circle at 50% 50%, var(--classic-dial) 0 68%, var(--classic-dial-edge) 70%, transparent 71%),
    radial-gradient(circle at 38% 28%, var(--classic-shine), transparent 32%),
    linear-gradient(145deg, var(--classic-rim-soft), var(--classic-rim));
  border: clamp(7px, calc(var(--analog-size) * 0.025), 15px) solid var(--classic-rim);
  box-shadow:
    inset 0 0 0 clamp(3px, calc(var(--analog-size) * 0.01), 7px) rgba(255, 255, 255, 0.28),
    inset 0 0 0 clamp(18px, calc(var(--analog-size) * 0.055), 30px) rgba(15, 23, 42, 0.035),
    inset 0 -22px 42px rgba(15, 23, 42, 0.1),
    0 34px 88px rgba(15, 23, 42, 0.22);
}

html[data-theme="dark"][data-clock-face="classic"] .analog-clock-face {
  --classic-dial: #121a2a;
  --classic-dial-edge: #0b1220;
  --classic-rim: #cbd5e1;
  --classic-rim-soft: #64748b;
  --classic-mark: #f8fafc;
  --classic-muted-mark: rgba(226, 232, 240, 0.38);
  --classic-glare: rgba(255, 255, 255, 0.08);
  --classic-shine: rgba(125, 211, 252, 0.12);
  --classic-ring: rgba(226, 232, 240, 0.18);
  --classic-ring-glow: rgba(15, 23, 42, 0.38);
  --classic-brand: rgba(226, 232, 240, 0.36);
  --classic-label-shadow: rgba(0, 0, 0, 0.42);
  --classic-hand-start: #ffffff;
  --classic-hand-end: #cbd5e1;
  --classic-cap: #e2e8f0;
  --classic-cap-border: #121a2a;
  box-shadow:
    inset 0 0 0 clamp(3px, calc(var(--analog-size) * 0.01), 7px) rgba(255, 255, 255, 0.16),
    inset 0 0 0 clamp(18px, calc(var(--analog-size) * 0.055), 30px) rgba(255, 255, 255, 0.028),
    inset 0 -30px 50px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(226, 232, 240, 0.16),
    0 38px 96px rgba(0, 0, 0, 0.44);
}

html[data-clock-face="classic"] .analog-clock-face::before {
  content: "";
  position: absolute;
  inset: 9.5%;
  z-index: 1;
  border-radius: 50%;
  border: clamp(2px, calc(var(--analog-size) * 0.008), 5px) solid var(--classic-ring);
  box-shadow:
    0 0 0 clamp(1px, calc(var(--analog-size) * 0.004), 2px) var(--classic-ring-glow),
    inset 0 0 28px rgba(15, 23, 42, 0.045);
  pointer-events: none;
}

html[data-clock-face="classic"] .analog-clock-face::after {
  content: "UTILOZA";
  position: absolute;
  left: 50%;
  top: 34%;
  z-index: 2;
  color: var(--classic-brand);
  font-size: clamp(0.56rem, calc(var(--analog-size) * 0.025), 0.86rem);
  font-weight: 950;
  letter-spacing: 0.16em;
  line-height: 1;
  transform: translateX(-50%);
  pointer-events: none;
}

html[data-clock-face="classic"] .analog-clock-ticks {
  z-index: 2;
}

html[data-clock-face="classic"] .analog-tick {
  width: clamp(1px, calc(var(--analog-size) * 0.006), 3px);
  height: clamp(7px, calc(var(--analog-size) * 0.026), 12px);
  background: var(--classic-muted-mark);
  transform:
    translate(-50%, -50%)
    rotate(calc(var(--tick-angle) * 1deg))
    translateY(calc(var(--analog-size) * -0.424));
}

html[data-clock-face="classic"] .analog-tick.is-hour {
  width: clamp(4px, calc(var(--analog-size) * 0.012), 7px);
  height: clamp(19px, calc(var(--analog-size) * 0.056), 31px);
  background: var(--classic-mark);
  transform:
    translate(-50%, -50%)
    rotate(calc(var(--tick-angle) * 1deg))
    translateY(calc(var(--analog-size) * -0.406));
}

html[data-clock-face="classic"] .analog-hour-label {
  z-index: 2;
  color: var(--classic-mark);
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(1.02rem, calc(var(--analog-size) * 0.062), 1.58rem);
  font-weight: 900;
  text-shadow: 0 1px 0 var(--classic-label-shadow);
  transform:
    translate(-50%, -50%)
    rotate(calc(var(--tick-angle) * 1deg))
    translateY(calc(var(--analog-size) * -0.322))
    rotate(calc(var(--tick-angle) * -1deg));
}

html[data-clock-face="classic"] .analog-hand {
  z-index: 3;
}

html[data-clock-face="classic"] .analog-hour-hand,
html[data-clock-face="classic"] .analog-minute-hand {
  background: linear-gradient(180deg, var(--classic-hand-start), var(--classic-hand-end));
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.18);
}

html[data-clock-face="classic"] .analog-hour-hand {
  width: clamp(9px, calc(var(--analog-size) * 0.029), 15px);
  height: 29%;
}

html[data-clock-face="classic"] .analog-minute-hand {
  width: clamp(6px, calc(var(--analog-size) * 0.019), 10px);
  height: 40%;
}

html[data-clock-face="classic"] .analog-second-hand {
  z-index: 3;
  width: clamp(2px, calc(var(--analog-size) * 0.007), 4px);
  height: 43%;
  background: linear-gradient(180deg, #ef4444, var(--classic-second));
  box-shadow: 0 0 12px rgba(220, 38, 38, 0.26);
}

html[data-clock-face="classic"] .analog-center-cap {
  z-index: 4;
  width: clamp(20px, calc(var(--analog-size) * 0.07), 34px);
  background:
    radial-gradient(circle at 36% 32%, rgba(255, 255, 255, 0.9), transparent 26%),
    var(--classic-cap);
  border: clamp(4px, calc(var(--analog-size) * 0.018), 8px) solid var(--classic-cap-border);
  box-shadow:
    0 0 0 clamp(1px, calc(var(--analog-size) * 0.005), 3px) rgba(17, 24, 39, 0.24),
    0 8px 16px rgba(15, 23, 42, 0.22);
}

html[data-clock-face="minimal"] .analog-clock-face {
  --minimal-dial: #f8fafc;
  --minimal-dial-edge: #e5edf5;
  --minimal-ring: rgba(15, 23, 42, 0.1);
  --minimal-dot: rgba(15, 23, 42, 0.2);
  --minimal-text: #1f2937;
  --minimal-hand: #111827;
  --minimal-second: #ef4444;
  --minimal-cardinal-12: #ef4444;
  --minimal-cardinal-3: #2563eb;
  --minimal-cardinal-6: #eab308;
  --minimal-cardinal-9: #14b8a6;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.82) 0 12%, transparent 13%),
    radial-gradient(circle at 50% 50%, var(--minimal-dial) 0 68%, var(--minimal-dial-edge) 69%, transparent 70%),
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.7), transparent 28%),
    color-mix(in srgb, var(--surface) 76%, transparent);
  border: 1px solid var(--minimal-ring);
  box-shadow:
    inset 0 0 0 clamp(8px, calc(var(--analog-size) * 0.026), 14px) rgba(255, 255, 255, 0.36),
    0 24px 62px rgba(15, 23, 42, 0.1);
}

html[data-theme="dark"][data-clock-face="minimal"] .analog-clock-face {
  --minimal-dial: #0f172a;
  --minimal-dial-edge: #172033;
  --minimal-ring: rgba(226, 232, 240, 0.12);
  --minimal-dot: rgba(226, 232, 240, 0.23);
  --minimal-text: #e5edf5;
  --minimal-hand: #f8fafc;
  --minimal-second: #fb7185;
  --minimal-cardinal-12: #fb7185;
  --minimal-cardinal-3: #60a5fa;
  --minimal-cardinal-6: #facc15;
  --minimal-cardinal-9: #2dd4bf;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.035) 0 12%, transparent 13%),
    radial-gradient(circle at 50% 50%, var(--minimal-dial) 0 68%, var(--minimal-dial-edge) 69%, transparent 70%),
    radial-gradient(circle at 28% 22%, rgba(125, 211, 252, 0.08), transparent 28%),
    #020617;
  box-shadow:
    inset 0 0 0 clamp(8px, calc(var(--analog-size) * 0.026), 14px) rgba(255, 255, 255, 0.025),
    0 30px 76px rgba(0, 0, 0, 0.28);
}

html[data-clock-face="minimal"] .analog-tick {
  width: clamp(2px, calc(var(--analog-size) * 0.007), 4px);
  height: clamp(2px, calc(var(--analog-size) * 0.007), 4px);
  border-radius: 50%;
  background: var(--minimal-dot);
  transform:
    translate(-50%, -50%)
    rotate(calc(var(--tick-angle) * 1deg))
    translateY(calc(var(--analog-size) * -0.438));
}

html[data-clock-face="minimal"] .analog-tick.is-hour {
  width: clamp(8px, calc(var(--analog-size) * 0.026), 14px);
  height: clamp(8px, calc(var(--analog-size) * 0.026), 14px);
  background: color-mix(in srgb, var(--minimal-text) 72%, transparent);
  transform:
    translate(-50%, -50%)
    rotate(calc(var(--tick-angle) * 1deg))
    translateY(calc(var(--analog-size) * -0.438));
}

html[data-clock-face="minimal"] .analog-tick.is-cardinal {
  width: clamp(14px, calc(var(--analog-size) * 0.044), 22px);
  height: clamp(14px, calc(var(--analog-size) * 0.044), 22px);
}

html[data-clock-face="minimal"] .analog-tick[data-hour="12"] {
  background: var(--minimal-cardinal-12);
}

html[data-clock-face="minimal"] .analog-tick[data-hour="3"] {
  background: var(--minimal-cardinal-3);
}

html[data-clock-face="minimal"] .analog-tick[data-hour="6"] {
  background: var(--minimal-cardinal-6);
}

html[data-clock-face="minimal"] .analog-tick[data-hour="9"] {
  background: var(--minimal-cardinal-9);
}

html[data-clock-face="minimal"] .analog-hour-label {
  display: none;
  color: var(--minimal-text);
  font-family: "Space Grotesk", Arial, sans-serif;
  font-size: clamp(0.76rem, calc(var(--analog-size) * 0.04), 1.08rem);
  font-weight: 900;
  transform:
    translate(-50%, -50%)
    rotate(calc(var(--tick-angle) * 1deg))
    translateY(calc(var(--analog-size) * -0.362))
    rotate(calc(var(--tick-angle) * -1deg));
}

html[data-clock-face="minimal"] .analog-hour-label.is-cardinal {
  display: block;
}

html[data-clock-face="minimal"] .analog-hour-hand,
html[data-clock-face="minimal"] .analog-minute-hand {
  background: var(--minimal-hand);
  border-radius: 999px;
  box-shadow: none;
}

html[data-clock-face="minimal"] .analog-hour-hand {
  width: clamp(8px, calc(var(--analog-size) * 0.025), 12px);
  height: 28%;
}

html[data-clock-face="minimal"] .analog-minute-hand {
  width: clamp(5px, calc(var(--analog-size) * 0.017), 8px);
  height: 40%;
}

html[data-clock-face="minimal"] .analog-second-hand {
  width: clamp(2px, calc(var(--analog-size) * 0.006), 3px);
  height: 43%;
  background: var(--minimal-second);
  box-shadow: none;
}

html[data-clock-face="minimal"] .analog-center-cap {
  width: clamp(18px, calc(var(--analog-size) * 0.062), 30px);
  background:
    radial-gradient(circle at 50% 50%, var(--minimal-cardinal-3) 0 26%, transparent 27%),
    conic-gradient(
      from 0deg,
      var(--minimal-cardinal-12) 0 25%,
      var(--minimal-cardinal-3) 0 50%,
      var(--minimal-cardinal-6) 0 75%,
      var(--minimal-cardinal-9) 0
    );
  border: clamp(4px, calc(var(--analog-size) * 0.016), 7px) solid var(--minimal-dial);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
}

html[data-clock-face="neon"] .analog-clock-face {
  --neon-dial: #ecfeff;
  --neon-dial-edge: #cffafe;
  --neon-bg: #f8fafc;
  --neon-cyan: #0891b2;
  --neon-teal: #0f766e;
  --neon-magenta: #db2777;
  --neon-label: #0f172a;
  --neon-muted: rgba(8, 145, 178, 0.34);
  --neon-hour: rgba(8, 145, 178, 0.76);
  --neon-glow-cyan: rgba(8, 145, 178, 0.2);
  --neon-glow-magenta: rgba(219, 39, 119, 0.16);
  --neon-hand-start: #0f172a;
  --neon-hand-end: #0891b2;
  --neon-ring: rgba(8, 145, 178, 0.34);
  --neon-inner-ring: rgba(219, 39, 119, 0.16);
  box-sizing: border-box;
  background:
    radial-gradient(circle at 50% 50%, transparent 0 48%, var(--neon-inner-ring) 48.4% 49.2%, transparent 49.8%),
    radial-gradient(circle at 50% 50%, var(--neon-dial) 0 66%, var(--neon-dial-edge) 67%, transparent 68%),
    radial-gradient(circle at 26% 22%, rgba(255, 255, 255, 0.72), transparent 28%),
    linear-gradient(145deg, var(--neon-bg), #e0f2fe);
  border: clamp(2px, calc(var(--analog-size) * 0.01), 6px) solid var(--neon-ring);
  box-shadow:
    inset 0 0 0 clamp(8px, calc(var(--analog-size) * 0.028), 16px) rgba(255, 255, 255, 0.52),
    inset 0 0 42px var(--neon-glow-cyan),
    0 0 34px var(--neon-glow-cyan),
    0 30px 78px rgba(15, 23, 42, 0.16);
}

html[data-theme="dark"][data-clock-face="neon"] .analog-clock-face {
  --neon-dial: #04111f;
  --neon-dial-edge: #071a2f;
  --neon-bg: #020617;
  --neon-cyan: #67e8f9;
  --neon-teal: #2dd4bf;
  --neon-magenta: #f472b6;
  --neon-label: #e0f2fe;
  --neon-muted: rgba(103, 232, 249, 0.32);
  --neon-hour: rgba(103, 232, 249, 0.86);
  --neon-glow-cyan: rgba(34, 211, 238, 0.28);
  --neon-glow-magenta: rgba(244, 114, 182, 0.24);
  --neon-hand-start: #f0f9ff;
  --neon-hand-end: #67e8f9;
  --neon-ring: rgba(103, 232, 249, 0.62);
  --neon-inner-ring: rgba(244, 114, 182, 0.26);
  background:
    radial-gradient(circle at 50% 50%, transparent 0 48%, var(--neon-inner-ring) 48.4% 49.2%, transparent 49.8%),
    radial-gradient(circle at 50% 50%, var(--neon-dial) 0 66%, var(--neon-dial-edge) 67%, transparent 68%),
    radial-gradient(circle at 28% 22%, rgba(34, 211, 238, 0.16), transparent 30%),
    radial-gradient(circle at 78% 80%, rgba(244, 114, 182, 0.14), transparent 32%),
    var(--neon-bg);
  box-shadow:
    inset 0 0 0 clamp(8px, calc(var(--analog-size) * 0.028), 16px) rgba(34, 211, 238, 0.04),
    inset 0 0 58px rgba(34, 211, 238, 0.12),
    0 0 54px var(--neon-glow-cyan),
    0 0 90px var(--neon-glow-magenta),
    0 34px 90px rgba(0, 0, 0, 0.34);
}

html[data-clock-face="neon"] .analog-clock-face::before {
  content: "";
  position: absolute;
  inset: 12%;
  z-index: 1;
  border-radius: 50%;
  border: clamp(1px, calc(var(--analog-size) * 0.005), 3px) solid var(--neon-inner-ring);
  box-shadow:
    0 0 20px var(--neon-glow-magenta),
    inset 0 0 18px var(--neon-glow-cyan);
  pointer-events: none;
}

html[data-clock-face="neon"] .analog-clock-face::after {
  content: "";
  position: absolute;
  inset: 17%;
  z-index: 1;
  border-radius: 50%;
  background:
    conic-gradient(
      from 18deg,
      transparent 0deg 22deg,
      var(--neon-ring) 22deg 54deg,
      transparent 54deg 104deg,
      var(--neon-inner-ring) 104deg 138deg,
      transparent 138deg 204deg,
      var(--neon-ring) 204deg 238deg,
      transparent 238deg 292deg,
      var(--neon-inner-ring) 292deg 326deg,
      transparent 326deg 360deg
    );
  -webkit-mask: radial-gradient(circle, transparent 0 58%, #000 59% 69%, transparent 70%);
  mask: radial-gradient(circle, transparent 0 58%, #000 59% 69%, transparent 70%);
  opacity: 0.72;
  filter: drop-shadow(0 0 10px var(--neon-glow-cyan));
  pointer-events: none;
}

html[data-theme="dark"][data-clock-face="neon"] .analog-clock-face::after {
  opacity: 0.84;
}

html[data-clock-face="neon"] .analog-clock-ticks {
  z-index: 2;
}

html[data-clock-face="neon"] .analog-tick {
  width: clamp(3px, calc(var(--analog-size) * 0.009), 5px);
  height: clamp(3px, calc(var(--analog-size) * 0.009), 5px);
  border-radius: 50%;
  background: var(--neon-muted);
  box-shadow: 0 0 10px var(--neon-glow-cyan);
  transform:
    translate(-50%, -50%)
    rotate(calc(var(--tick-angle) * 1deg))
    translateY(calc(var(--analog-size) * -0.432));
}

html[data-clock-face="neon"] .analog-tick.is-hour {
  width: clamp(4px, calc(var(--analog-size) * 0.014), 8px);
  height: clamp(18px, calc(var(--analog-size) * 0.06), 32px);
  border-radius: 999px;
  background: var(--neon-hour);
  box-shadow: 0 0 16px var(--neon-glow-cyan);
  transform:
    translate(-50%, -50%)
    rotate(calc(var(--tick-angle) * 1deg))
    translateY(calc(var(--analog-size) * -0.402));
}

html[data-clock-face="neon"] .analog-tick.is-cardinal {
  background: var(--neon-magenta);
  box-shadow: 0 0 20px var(--neon-glow-magenta);
}

html[data-clock-face="neon"] .analog-tick[data-hour="12"],
html[data-clock-face="neon"] .analog-tick[data-hour="6"] {
  background: var(--neon-cyan);
  box-shadow: 0 0 20px var(--neon-glow-cyan);
}

html[data-clock-face="neon"] .analog-hour-label {
  display: none;
  z-index: 2;
  color: var(--neon-label);
  font-family: "Orbitron", "Space Grotesk", sans-serif;
  font-size: clamp(0.78rem, calc(var(--analog-size) * 0.043), 1.14rem);
  font-weight: 800;
  text-shadow: 0 0 14px var(--neon-glow-cyan);
  transform:
    translate(-50%, -50%)
    rotate(calc(var(--tick-angle) * 1deg))
    translateY(calc(var(--analog-size) * -0.318))
    rotate(calc(var(--tick-angle) * -1deg));
}

html[data-clock-face="neon"] .analog-hour-label.is-cardinal {
  display: block;
}

html[data-clock-face="neon"] .analog-hand {
  z-index: 3;
}

html[data-clock-face="neon"] .analog-hour-hand {
  width: clamp(8px, calc(var(--analog-size) * 0.026), 13px);
  height: 29%;
  background: linear-gradient(180deg, var(--neon-hand-start), var(--neon-hand-end));
  box-shadow: 0 0 18px var(--neon-glow-cyan);
}

html[data-clock-face="neon"] .analog-minute-hand {
  width: clamp(5px, calc(var(--analog-size) * 0.017), 8px);
  height: 41%;
  background: linear-gradient(180deg, var(--neon-hand-start), var(--neon-teal));
  box-shadow: 0 0 18px var(--neon-glow-cyan);
}

html[data-clock-face="neon"] .analog-second-hand {
  z-index: 3;
  width: clamp(2px, calc(var(--analog-size) * 0.007), 4px);
  height: 44%;
  background: linear-gradient(180deg, #ffffff, var(--neon-magenta));
  box-shadow: 0 0 24px var(--neon-glow-magenta);
}

html[data-clock-face="neon"] .analog-center-cap {
  z-index: 4;
  width: clamp(20px, calc(var(--analog-size) * 0.07), 34px);
  background:
    radial-gradient(circle at 50% 50%, #ffffff 0 20%, transparent 21%),
    conic-gradient(from 45deg, var(--neon-cyan), var(--neon-magenta), var(--neon-teal), var(--neon-cyan));
  border: clamp(4px, calc(var(--analog-size) * 0.018), 8px) solid var(--neon-dial);
  box-shadow:
    0 0 0 clamp(1px, calc(var(--analog-size) * 0.005), 3px) var(--neon-ring),
    0 0 28px var(--neon-glow-cyan);
}

html[data-clock-face="numberless"] .analog-clock-face {
  --numberless-shell: #f8fafc;
  --numberless-shell-edge: #dbeafe;
  --numberless-dial: #f6fbfd;
  --numberless-dial-shadow: rgba(15, 23, 42, 0.08);
  --numberless-rim: rgba(15, 23, 42, 0.16);
  --numberless-inner-ring: rgba(14, 116, 144, 0.13);
  --numberless-minute: rgba(71, 85, 105, 0.18);
  --numberless-hour: rgba(30, 41, 59, 0.58);
  --numberless-cardinal: #0e7490;
  --numberless-cardinal-alt: #2563eb;
  --numberless-hand: #0f172a;
  --numberless-hand-soft: #334155;
  --numberless-second: #0f766e;
  --numberless-cap: #f8fafc;
  --numberless-cap-ring: rgba(14, 116, 144, 0.34);
  background:
    radial-gradient(circle at 36% 26%, rgba(255, 255, 255, 0.7), transparent 30%),
    radial-gradient(circle at 50% 50%, var(--numberless-dial) 0 63%, var(--numberless-shell-edge) 65%, transparent 67%),
    linear-gradient(145deg, var(--numberless-shell), #e8f3f7);
  border: clamp(2px, calc(var(--analog-size) * 0.008), 5px) solid var(--numberless-rim);
  box-shadow:
    inset 0 0 0 clamp(9px, calc(var(--analog-size) * 0.03), 18px) rgba(255, 255, 255, 0.48),
    inset 0 -28px 52px var(--numberless-dial-shadow),
    0 30px 82px rgba(15, 23, 42, 0.16);
}

html[data-theme="dark"][data-clock-face="numberless"] .analog-clock-face {
  --numberless-shell: #0b1220;
  --numberless-shell-edge: #172033;
  --numberless-dial: #101a2b;
  --numberless-dial-shadow: rgba(0, 0, 0, 0.32);
  --numberless-rim: rgba(125, 211, 252, 0.22);
  --numberless-inner-ring: rgba(125, 211, 252, 0.12);
  --numberless-minute: rgba(226, 232, 240, 0.14);
  --numberless-hour: rgba(226, 232, 240, 0.62);
  --numberless-cardinal: #67e8f9;
  --numberless-cardinal-alt: #2dd4bf;
  --numberless-hand: #f8fafc;
  --numberless-hand-soft: #cbd5e1;
  --numberless-second: #5eead4;
  --numberless-cap: #0f172a;
  --numberless-cap-ring: rgba(125, 211, 252, 0.36);
  background:
    radial-gradient(circle at 34% 24%, rgba(125, 211, 252, 0.12), transparent 32%),
    radial-gradient(circle at 72% 78%, rgba(45, 212, 191, 0.1), transparent 32%),
    radial-gradient(circle at 50% 50%, var(--numberless-dial) 0 63%, var(--numberless-shell-edge) 65%, transparent 67%),
    var(--numberless-shell);
  box-shadow:
    inset 0 0 0 clamp(9px, calc(var(--analog-size) * 0.03), 18px) rgba(255, 255, 255, 0.035),
    inset 0 -34px 58px var(--numberless-dial-shadow),
    0 36px 96px rgba(0, 0, 0, 0.38);
}

html[data-clock-face="numberless"] .analog-clock-face::before {
  content: "";
  position: absolute;
  inset: 10.5%;
  z-index: 1;
  border-radius: 50%;
  border: 1px solid var(--numberless-inner-ring);
  box-shadow:
    inset 0 0 34px var(--numberless-dial-shadow),
    0 0 0 clamp(1px, calc(var(--analog-size) * 0.004), 3px) rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

html[data-clock-face="numberless"] .analog-clock-face::after {
  content: "";
  position: absolute;
  inset: 6.5%;
  z-index: 1;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--numberless-rim) 62%, transparent);
  pointer-events: none;
}

html[data-clock-face="numberless"] .analog-hour-label {
  display: none;
}

html[data-clock-face="numberless"] .analog-clock-ticks {
  z-index: 2;
}

html[data-clock-face="numberless"] .analog-tick {
  width: clamp(2px, calc(var(--analog-size) * 0.006), 4px);
  height: clamp(2px, calc(var(--analog-size) * 0.006), 4px);
  border-radius: 50%;
  background: var(--numberless-minute);
  transform:
    translate(-50%, -50%)
    rotate(calc(var(--tick-angle) * 1deg))
    translateY(calc(var(--analog-size) * -0.432));
}

html[data-clock-face="numberless"] .analog-tick.is-hour {
  width: clamp(10px, calc(var(--analog-size) * 0.032), 17px);
  height: clamp(10px, calc(var(--analog-size) * 0.032), 17px);
  border-radius: 50%;
  background: var(--numberless-hour);
  box-shadow: 0 0 0 clamp(3px, calc(var(--analog-size) * 0.01), 6px) rgba(255, 255, 255, 0.08);
  transform:
    translate(-50%, -50%)
    rotate(calc(var(--tick-angle) * 1deg))
    translateY(calc(var(--analog-size) * -0.407));
}

html[data-clock-face="numberless"] .analog-tick.is-cardinal {
  width: clamp(8px, calc(var(--analog-size) * 0.024), 13px);
  height: clamp(25px, calc(var(--analog-size) * 0.074), 40px);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--numberless-cardinal), var(--numberless-cardinal-alt));
  box-shadow:
    0 0 0 clamp(3px, calc(var(--analog-size) * 0.011), 7px) color-mix(in srgb, var(--numberless-cardinal) 14%, transparent),
    0 10px 20px rgba(15, 23, 42, 0.12);
  transform:
    translate(-50%, -50%)
    rotate(calc(var(--tick-angle) * 1deg))
    translateY(calc(var(--analog-size) * -0.397));
}

html[data-clock-face="numberless"] .analog-hand {
  z-index: 3;
  clip-path: polygon(50% 0, 72% 100%, 28% 100%);
}

html[data-clock-face="numberless"] .analog-hour-hand,
html[data-clock-face="numberless"] .analog-minute-hand {
  background: linear-gradient(180deg, var(--numberless-hand), var(--numberless-hand-soft));
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.14);
}

html[data-clock-face="numberless"] .analog-hour-hand {
  width: clamp(11px, calc(var(--analog-size) * 0.032), 17px);
  height: 30%;
}

html[data-clock-face="numberless"] .analog-minute-hand {
  width: clamp(8px, calc(var(--analog-size) * 0.022), 12px);
  height: 41%;
}

html[data-clock-face="numberless"] .analog-second-hand {
  z-index: 3;
  width: clamp(2px, calc(var(--analog-size) * 0.006), 3px);
  height: 43%;
  background: var(--numberless-second);
  box-shadow: 0 0 12px color-mix(in srgb, var(--numberless-second) 28%, transparent);
  clip-path: none;
}

html[data-clock-face="numberless"] .analog-center-cap {
  z-index: 4;
  width: clamp(20px, calc(var(--analog-size) * 0.068), 34px);
  background:
    radial-gradient(circle at 50% 50%, var(--numberless-second) 0 22%, transparent 23%),
    var(--numberless-cap);
  border: clamp(4px, calc(var(--analog-size) * 0.016), 8px) solid var(--numberless-cap);
  box-shadow:
    0 0 0 clamp(1px, calc(var(--analog-size) * 0.006), 3px) var(--numberless-cap-ring),
    0 10px 24px rgba(15, 23, 42, 0.16);
}

html.clock-focus-mode,
html.clock-focus-mode body {
  overflow: hidden;
}

html.clock-focus-mode body {
  padding-top: 0;
}

html.clock-fullscreen-mode.clock-cursor-idle,
html.clock-fullscreen-mode.clock-cursor-idle * {
  cursor: none !important;
}

html.clock-fullscreen-mode.clock-cursor-idle .clock-view-actions:not(:focus-within) {
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
}

html.clock-focus-mode .site-header,
html.clock-focus-mode .site-footer,
html.clock-focus-mode .clock-title-bar,
html.clock-focus-mode .clock-page-actions {
  display: none !important;
}

html.clock-focus-mode .tool-main > :not(.clock-tool-section) {
  display: none !important;
}

html.clock-focus-mode .tool-main {
  min-height: 100svh;
  padding: 0;
}

html.clock-focus-mode .clock-tool-section {
  position: fixed;
  inset: 0;
  z-index: 120;
  width: 100%;
  height: 100svh;
  min-height: 100svh;
  padding: clamp(14px, 3vmin, 30px);
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 20%, rgba(125, 211, 252, 0.16), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(52, 211, 153, 0.16), transparent 30%),
    var(--page);
}

html.clock-focus-mode .clock-shell,
html.clock-focus-mode .clock-workspace {
  width: min(1100px, 100%);
  min-height: 0;
  display: grid;
  place-items: center;
}

html.clock-focus-mode .clock-card {
  width: 100%;
  padding: 0;
}

html.clock-focus-mode .clock-time {
  font-size: clamp(4rem, 12.5vw, 10rem);
}

html.clock-focus-mode .clock-face {
  --analog-size: clamp(310px, 62vmin, 620px);
}

html.clock-focus-mode .clock-view-actions {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 122;
  min-width: 116px;
  min-height: 80px;
  padding: clamp(14px, 3vmin, 24px);
  align-items: flex-start;
  justify-content: flex-end;
  pointer-events: auto;
}

html.clock-focus-mode .clock-view-actions:hover,
html.clock-focus-mode .clock-view-actions:focus-within {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

@media (hover: none) {
  .clock-view-actions {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
}

@media (max-width: 720px) {
  .clock-card {
    padding-block: 28px;
  }

  .clock-face {
    --analog-size: clamp(250px, 76vw, 390px);
  }

  .clock-time {
    font-size: clamp(3.2rem, 15vw, 5.4rem);
  }
}

@media (max-width: 430px) {
  .clock-face {
    --analog-size: min(82vw, 340px);
  }

  .clock-time {
    font-size: clamp(2.85rem, 14vw, 4.55rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .clock-view-actions,
  .clock-view-action,
  .analog-hand,
  .analog-second-hand,
  .analog-clock.is-settling .analog-hand,
  .analog-clock.is-settling .analog-second-hand,
  html[data-second-motion="stepped"] .analog-second-hand {
    transition: none;
  }
}

/* Stopwatch tool */
.stopwatch-tool-section {
  min-height: calc(100svh - var(--site-header-height, 72px));
  display: grid;
  align-items: stretch;
  padding: 18px 0 32px;
}

.stopwatch-shell {
  min-height: calc(100svh - var(--site-header-height, 72px) - 50px);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
}

.stopwatch-title-bar {
  max-width: 760px;
  width: 100%;
  margin-inline: auto;
  align-self: start;
  display: flex;
  justify-content: center;
  text-align: center;
}

.stopwatch-title-bar h1 {
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  font-weight: 900;
}

.time-tool-switch {
  --time-tool-count: 2;
  --time-tool-index: 0;
  position: relative;
  width: min(360px, 100%);
  min-height: 48px;
  padding: 4px;
  display: grid;
  grid-template-columns: repeat(var(--time-tool-count), minmax(0, 1fr));
  align-items: center;
  isolation: isolate;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 84%, var(--accent) 16%);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 42%, transparent), 0 18px 46px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.time-tool-switch-thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  z-index: -1;
  width: calc((100% - 8px) / var(--time-tool-count));
  border-radius: 999px;
  background: linear-gradient(135deg, #7dd3fc, #34d399);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 18%, transparent);
  transform: translateX(calc(var(--time-tool-index) * 100%));
  transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1), background 180ms ease;
}

.time-tool-option {
  min-width: 0;
  min-height: 40px;
  padding: 0 18px;
  display: grid;
  place-items: center;
  color: inherit;
  border-radius: 999px;
  font-weight: 950;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: color 160ms ease, transform 160ms ease;
}

.time-tool-option:hover,
.time-tool-option:focus-visible {
  color: var(--ink);
  outline: none;
}

.time-tool-option:focus-visible {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 54%, transparent);
}

.time-tool-option.is-active {
  color: #07111f;
}

html[data-theme="dark"] .time-tool-switch {
  background: rgba(15, 23, 42, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 18px 46px rgba(0, 0, 0, 0.22);
}

.stopwatch-workspace {
  width: min(760px, 100%);
  margin-inline: auto;
  align-self: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-content: center;
  gap: 14px;
}

.stopwatch-workspace.has-laps {
  grid-template-columns: minmax(0, 1fr);
}

.stopwatch-card,
.stopwatch-laps-card {
  min-width: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.stopwatch-card {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 8px 0 4px;
}

.stopwatch-card.is-layout-moving {
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.stopwatch-view-actions {
  position: absolute;
  top: 4px;
  right: 0;
  z-index: 3;
  display: flex;
  gap: 8px;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.stopwatch-card:has(.stopwatch-face:hover) .stopwatch-view-actions,
.stopwatch-view-actions:hover,
.stopwatch-view-actions:focus-within {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.stopwatch-view-action {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 74%, transparent);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  user-select: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.stopwatch-view-action:hover,
.stopwatch-view-action:focus-visible {
  color: var(--accent);
  background: var(--surface);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  transform: translateY(-1px);
  outline: none;
}

.stopwatch-view-action svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stopwatch-view-action .icon-active {
  display: none;
}

.stopwatch-view-action[aria-pressed="true"] .icon-default {
  display: none;
}

.stopwatch-view-action[aria-pressed="true"] .icon-active {
  display: block;
}

.stopwatch-face {
  position: relative;
  min-height: 126px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  user-select: none;
}

.stopwatch-time {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-size: clamp(3rem, 11vw, 6.6rem);
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  user-select: none;
  white-space: nowrap;
}

.stopwatch-state {
  display: none;
}

.stopwatch-face[data-state="running"] .stopwatch-state {
  color: var(--green);
  background: transparent;
  border-color: transparent;
}

html[data-theme="dark"] .stopwatch-face[data-state="running"] .stopwatch-state {
  color: #a7f3d0;
}

.stopwatch-controls {
  display: grid;
  grid-template-columns: repeat(2, auto);
  justify-content: center;
  gap: 12px;
  user-select: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.stopwatch-controls .button {
  width: 104px;
  min-width: 104px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
}

.stopwatch-controls .button.secondary {
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 15%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.stopwatch-controls .button.secondary:hover,
.stopwatch-controls .button.secondary:focus-visible {
  background: color-mix(in srgb, var(--accent) 22%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
}

.stopwatch-controls .button.secondary:disabled {
  color: var(--muted);
  background: var(--surface-soft);
  border-color: var(--line);
  opacity: 0.72;
}

html[data-theme="dark"] .stopwatch-controls .button.secondary {
  color: #f8fbff;
  background: rgba(125, 211, 252, 0.12);
  border-color: rgba(125, 211, 252, 0.42);
}

html[data-theme="dark"] .stopwatch-controls .button.secondary:hover,
html[data-theme="dark"] .stopwatch-controls .button.secondary:focus-visible {
  background: rgba(125, 211, 252, 0.18);
  border-color: rgba(125, 211, 252, 0.58);
}

html[data-theme="dark"] .stopwatch-controls .button.secondary:disabled {
  color: var(--muted);
  background: var(--surface-soft);
  border-color: var(--line);
}

.stopwatch-laps-card {
  display: none;
  align-content: start;
  max-height: min(270px, 36svh);
  padding: 14px 16px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transform: translateY(12px) scale(0.98);
}

.stopwatch-workspace:not(.has-laps) .stopwatch-laps-card {
  display: none;
}

.stopwatch-workspace.has-laps .stopwatch-laps-card {
  display: grid;
  animation: lapPanelReveal 260ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes lapPanelReveal {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.lap-list {
  display: grid;
  gap: 6px;
  max-height: min(240px, 30svh);
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.lap-list::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.lap-row,
.lap-empty {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 8px 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  font-weight: 850;
  overflow: hidden;
}

.lap-row.is-new {
  animation: lapRowReveal 300ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

@keyframes lapRowReveal {
  from {
    min-height: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-bottom-color: transparent;
    transform: translateY(-14px);
  }

  58% {
    transform: translateY(0);
  }

  to {
    min-height: 46px;
    max-height: 96px;
    padding-top: 8px;
    padding-bottom: 8px;
    border-bottom-color: var(--line);
    transform: translateY(0);
  }
}

.lap-row strong,
.lap-row small {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.lap-row strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lap-row small {
  color: var(--muted);
  font-weight: 900;
}

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

html.stopwatch-focus-mode,
html.stopwatch-focus-mode body {
  overflow: hidden;
}

html.stopwatch-focus-mode body {
  padding-top: 0;
}

html.stopwatch-fullscreen-mode.stopwatch-cursor-idle,
html.stopwatch-fullscreen-mode.stopwatch-cursor-idle * {
  cursor: none !important;
}

html.stopwatch-fullscreen-mode.stopwatch-cursor-idle .stopwatch-card:has(.stopwatch-face:hover) .stopwatch-view-actions:not(:focus-within),
html.stopwatch-fullscreen-mode.stopwatch-cursor-idle .stopwatch-view-actions:hover:not(:focus-within) {
  opacity: 0;
  transform: translateY(-4px);
}

html.stopwatch-fullscreen-mode.stopwatch-cursor-idle .stopwatch-controls:not(:focus-within) {
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
}

html.stopwatch-focus-mode .site-header,
html.stopwatch-focus-mode .site-footer,
html.stopwatch-focus-mode .stopwatch-title-bar {
  display: none !important;
}

html.stopwatch-focus-mode .tool-main {
  min-height: 100svh;
  display: grid;
  place-items: center;
}

html.stopwatch-focus-mode .stopwatch-tool-section {
  width: 100%;
  min-height: 100svh;
  padding: 0 18px;
}

html.stopwatch-focus-mode .stopwatch-shell {
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr;
  place-items: center;
}

html.stopwatch-focus-mode .stopwatch-workspace {
  width: min(820px, 100%);
  align-content: center;
  gap: 18px;
}

html.stopwatch-focus-mode .stopwatch-laps-card {
  max-height: min(300px, 32svh);
}

html.stopwatch-focus-mode .lap-list {
  max-height: min(238px, 25svh);
}

html.stopwatch-focus-mode .stopwatch-card {
  width: 100%;
  padding: 0;
}

html.stopwatch-focus-mode .stopwatch-face {
  min-height: 170px;
}

html.stopwatch-focus-mode .stopwatch-time {
  font-size: clamp(3.4rem, 12vw, 7.8rem);
}

@media (hover: none) {
  .stopwatch-view-actions {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  html.stopwatch-focus-mode .stopwatch-view-actions {
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
  }

  html.stopwatch-focus-mode .stopwatch-card:has(.stopwatch-face:hover) .stopwatch-view-actions,
  html.stopwatch-focus-mode .stopwatch-view-actions:hover,
  html.stopwatch-focus-mode .stopwatch-view-actions:focus-within {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  html.stopwatch-fullscreen-mode.stopwatch-cursor-idle .stopwatch-controls:not(:focus-within) {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stopwatch-view-actions,
  .stopwatch-view-action,
  .stopwatch-card.is-layout-moving {
    transition: none;
  }

  .stopwatch-workspace.has-laps .stopwatch-laps-card,
  .lap-row.is-new {
    animation: none;
  }
}

@media (max-width: 860px) {
  .stopwatch-tool-section {
    min-height: calc(100svh - var(--site-header-height, 72px));
    padding-top: 12px;
    padding-bottom: 24px;
  }

  .stopwatch-workspace {
    grid-template-columns: 1fr;
  }

  .stopwatch-workspace.has-laps {
    grid-template-columns: 1fr;
  }

  .stopwatch-laps-card {
    max-height: clamp(152px, 31svh, 260px);
  }

  .lap-list {
    max-height: clamp(104px, 23svh, 206px);
  }

  .lap-row {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 12px;
    row-gap: 2px;
    overflow: visible;
  }

  .lap-row span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .lap-row small {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

@media (max-width: 560px) {
  html.stopwatch-focus-mode .stopwatch-tool-section {
    padding-inline: 8px;
  }

  html.stopwatch-focus-mode .stopwatch-workspace {
    width: 100%;
    gap: 14px;
  }

  .stopwatch-card {
    padding-inline: 0;
  }

  .stopwatch-laps-card {
    padding-inline: 16px;
  }

  .stopwatch-view-actions {
    right: 0;
  }

  .stopwatch-face {
    width: 100%;
    min-height: 118px;
  }

  .stopwatch-time {
    font-size: clamp(4rem, 19vw, 6.2rem);
  }

  html.stopwatch-focus-mode .stopwatch-face {
    width: 100%;
    min-height: clamp(138px, 32svh, 190px);
  }

  html.stopwatch-focus-mode .stopwatch-time {
    font-size: clamp(4rem, 20vw, 7rem);
  }

  .stopwatch-laps-card {
    max-height: clamp(140px, 29svh, 230px);
    padding-block: 12px;
  }

  .lap-list {
    max-height: clamp(94px, 21svh, 178px);
  }

  .stopwatch-controls {
    grid-template-columns: repeat(2, auto);
  }

  .stopwatch-controls .button {
    width: 94px;
    min-width: 94px;
    min-height: 40px;
    padding: 0 16px;
  }
}

/* Timer tool */
.timer-tool-section {
  min-height: calc(100svh - var(--site-header-height, 72px));
  display: grid;
  align-items: stretch;
  padding: 18px 0 32px;
}

.timer-shell {
  min-height: calc(100svh - var(--site-header-height, 72px) - 50px);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
}

.timer-title-bar {
  max-width: 760px;
  width: 100%;
  margin-inline: auto;
  align-self: start;
  display: flex;
  justify-content: center;
  text-align: center;
}

.timer-title-bar h1 {
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  font-weight: 900;
}

.timer-workspace {
  width: min(760px, 100%);
  margin-inline: auto;
  align-self: center;
  display: grid;
  justify-content: stretch;
  min-width: 0;
}

.timer-card {
  position: relative;
  width: 100%;
  max-width: 760px;
  min-width: 0;
  display: grid;
  gap: 14px;
  padding: 8px 0 4px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.timer-page-actions {
  position: fixed;
  top: calc(var(--site-header-height, 72px) + 14px);
  right: max(16px, calc((100vw - 1120px) / 2));
  z-index: 90;
}

.timer-view-actions {
  position: absolute;
  top: 0;
  right: clamp(2px, 1.2vw, 10px);
  z-index: 6;
  min-height: 34px;
  display: flex;
  gap: 8px;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.timer-stage:hover .timer-view-actions,
.timer-view-actions:hover,
.timer-view-actions:focus-within {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.timer-view-actions::before {
  content: "";
  position: absolute;
  inset: -18px -10px -14px;
  z-index: -1;
}

.timer-view-action,
.timer-settings-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 74%, transparent);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  user-select: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.timer-settings-button {
  width: 42px;
  height: 42px;
}

.timer-view-action:hover,
.timer-view-action:focus-visible,
.timer-settings-button:hover,
.timer-settings-button:focus-visible {
  color: var(--accent);
  background: var(--surface);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  transform: translateY(-1px);
  outline: none;
}

.timer-view-action svg,
.timer-settings-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.timer-view-action .icon-active {
  display: none;
}

.timer-view-action[aria-pressed="true"] .icon-default {
  display: none;
}

.timer-view-action[aria-pressed="true"] .icon-active {
  display: block;
}

.timer-settings-backdrop {
  position: fixed;
  top: var(--site-header-height, 72px);
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 88;
  background: rgba(15, 23, 42, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.timer-settings-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.timer-settings-panel {
  --settings-panel-gap: 14px;
  box-sizing: border-box;
  position: fixed;
  top: calc(var(--site-header-height, 72px) + var(--settings-panel-gap));
  right: 0;
  bottom: var(--settings-panel-gap);
  z-index: 92;
  width: min(390px, 100vw);
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 12px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: color-mix(in srgb, var(--accent) 42%, var(--line)) transparent;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border-left: 1px solid color-mix(in srgb, var(--line) 86%, var(--accent) 14%);
  border-radius: 30px 0 0 30px;
  box-shadow: 0 22px 58px rgba(15, 23, 42, 0.18);
  transform: translateX(105%);
  pointer-events: none;
  transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.timer-settings-panel::-webkit-scrollbar {
  width: 8px;
}

.timer-settings-panel::-webkit-scrollbar-track {
  background: transparent;
}

.timer-settings-panel::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent) 42%, var(--line));
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}

.timer-settings-panel.is-open {
  transform: translateX(0);
  pointer-events: auto;
}

html[data-theme="dark"] .timer-settings-panel {
  background: color-mix(in srgb, var(--surface) 92%, #020617 8%);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.38);
}

.timer-settings-head {
  position: sticky;
  top: -18px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -18px -18px 0;
  padding: 18px 18px 14px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 68%, transparent);
  font-size: 0.95rem;
  backdrop-filter: blur(16px);
}

html[data-theme="dark"] .timer-settings-head {
  background: color-mix(in srgb, var(--surface) 92%, #020617 8%);
}

.timer-settings-close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface-strong) 78%, transparent);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-weight: 950;
}

.timer-setting-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.clock-setting-group-label {
  margin: 4px 2px -4px;
  color: color-mix(in srgb, var(--muted) 84%, var(--accent));
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.clock-settings-panel .timer-notify {
  width: 100%;
}

.clock-segmented {
  min-width: 0;
  min-height: 42px;
  padding: 4px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  background: color-mix(in srgb, var(--surface) 82%, var(--accent) 8%);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.clock-size-segmented {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.clock-segmented button {
  min-height: 34px;
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 950;
  line-height: 1;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.clock-segmented button:hover,
.clock-segmented button:focus-visible {
  color: var(--ink);
  outline: none;
}

.clock-segmented button.is-active {
  color: #07111f;
  background: linear-gradient(135deg, #7dd3fc, #34d399);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 18%, transparent);
}

.clock-font-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.clock-font-grid button {
  min-width: 0;
  min-height: 58px;
  padding: 10px 12px;
  display: grid;
  align-content: center;
  gap: 3px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 78%, var(--accent) 6%);
  border: 1px solid var(--line);
  border-radius: 18px;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.clock-font-grid button:hover,
.clock-font-grid button:focus-visible {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  outline: none;
  transform: translateY(-1px);
}

.clock-font-grid button.is-active {
  color: var(--ink);
  background: color-mix(in srgb, var(--primary-soft) 46%, var(--surface) 54%);
  border-color: color-mix(in srgb, var(--accent) 54%, var(--line));
  box-shadow: 0 14px 30px color-mix(in srgb, var(--accent) 14%, transparent);
}

.clock-font-grid span,
.clock-font-grid small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clock-font-grid span {
  font-size: 0.82rem;
  font-weight: 950;
  line-height: 1.15;
}

.clock-font-grid small {
  color: currentColor;
  font-family: var(--clock-font-preview-family, inherit);
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
  opacity: 0.82;
}

.clock-font-grid [data-clock-font-choice="space-grotesk"] {
  --clock-font-preview-family: "Space Grotesk", sans-serif;
}

.clock-font-grid [data-clock-font-choice="rajdhani"] {
  --clock-font-preview-family: "Rajdhani", sans-serif;
}

.clock-font-grid [data-clock-font-choice="chakra-petch"] {
  --clock-font-preview-family: "Chakra Petch", sans-serif;
}

.clock-font-grid [data-clock-font-choice="orbitron"] {
  --clock-font-preview-family: "Orbitron", sans-serif;
}

.clock-font-grid [data-clock-font-choice="roboto-mono"] {
  --clock-font-preview-family: "Roboto Mono", monospace;
}

.clock-face-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 176px), 1fr));
  gap: 8px;
}

.clock-face-grid button {
  min-width: 0;
  min-height: 76px;
  padding: 10px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 78%, var(--accent) 6%);
  border: 1px solid var(--line);
  border-radius: 20px;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.clock-face-grid button:hover,
.clock-face-grid button:focus-visible {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  outline: none;
  transform: translateY(-1px);
}

.clock-face-grid button.is-active {
  color: var(--ink);
  background: color-mix(in srgb, var(--primary-soft) 46%, var(--surface) 54%);
  border-color: color-mix(in srgb, var(--accent) 54%, var(--line));
  box-shadow: 0 14px 30px color-mix(in srgb, var(--accent) 14%, transparent);
}

.clock-face-grid button > span:not(.clock-face-preview),
.clock-face-grid button > small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clock-face-grid button > span:not(.clock-face-preview) {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  font-size: 0.86rem;
  font-weight: 950;
  line-height: 1.1;
}

.clock-face-grid button > small {
  color: currentColor;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.1;
  opacity: 0.72;
}

.clock-face-preview {
  grid-row: 1 / span 2;
  position: relative;
  width: 46px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 0.26) 0 38%, transparent 39%),
    radial-gradient(circle at 34% 24%, rgba(125, 211, 252, 0.34), transparent 34%),
    radial-gradient(circle at 76% 82%, rgba(52, 211, 153, 0.32), transparent 36%),
    color-mix(in srgb, var(--surface-soft) 88%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 74%, var(--accent));
  box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--surface) 36%, transparent);
}

.clock-face-preview::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 2px dotted color-mix(in srgb, var(--muted) 42%, transparent);
}

.preview-hand {
  position: absolute;
  left: 50%;
  bottom: 50%;
  border-radius: 999px;
  transform-origin: 50% 100%;
}

.preview-hour {
  width: 4px;
  height: 25%;
  background: var(--ink);
  transform: translateX(-50%) rotate(124deg);
}

.preview-minute {
  width: 3px;
  height: 34%;
  background: var(--ink);
  transform: translateX(-50%) rotate(236deg);
}

.preview-second {
  width: 2px;
  height: 38%;
  background: #fb7185;
  transform: translateX(-50%) rotate(82deg);
}

.preview-cap {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: linear-gradient(135deg, #7dd3fc, #34d399);
  transform: translate(-50%, -50%);
}

.clock-face-grid [data-clock-face-choice="classic"] .clock-face-preview {
  background:
    radial-gradient(circle at 50% 50%, #fffaf0 0 64%, #e8dcc8 66%, transparent 68%),
    linear-gradient(145deg, #334155, #111827);
  border-color: rgba(15, 23, 42, 0.34);
  box-shadow:
    inset 0 0 0 4px rgba(15, 23, 42, 0.12),
    0 10px 20px rgba(15, 23, 42, 0.12);
}

.clock-face-grid [data-clock-face-choice="classic"] .clock-face-preview::before {
  border-style: solid;
  border-width: 3px;
  border-color: rgba(17, 24, 39, 0.42);
}

.clock-face-grid [data-clock-face-choice="classic"] .preview-hour,
.clock-face-grid [data-clock-face-choice="classic"] .preview-minute {
  background: #111827;
}

.clock-face-grid [data-clock-face-choice="classic"] .preview-second {
  background: #dc2626;
}

.clock-face-grid [data-clock-face-choice="classic"] .preview-cap {
  background: #111827;
  box-shadow: 0 0 0 2px #fffaf0;
}

html[data-theme="dark"] .clock-face-grid [data-clock-face-choice="classic"] .clock-face-preview {
  background:
    radial-gradient(circle at 50% 50%, #121a2a 0 64%, #0b1220 66%, transparent 68%),
    linear-gradient(145deg, #cbd5e1, #64748b);
  border-color: rgba(226, 232, 240, 0.32);
  box-shadow:
    inset 0 0 0 4px rgba(226, 232, 240, 0.16),
    0 10px 22px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .clock-face-grid [data-clock-face-choice="classic"] .clock-face-preview::before {
  border-color: rgba(226, 232, 240, 0.46);
}

html[data-theme="dark"] .clock-face-grid [data-clock-face-choice="classic"] .preview-hour,
html[data-theme="dark"] .clock-face-grid [data-clock-face-choice="classic"] .preview-minute {
  background: #f8fafc;
}

html[data-theme="dark"] .clock-face-grid [data-clock-face-choice="classic"] .preview-cap {
  background: #e2e8f0;
  box-shadow: 0 0 0 2px #121a2a;
}

.clock-face-grid [data-clock-face-choice="minimal"] .clock-face-preview {
  background:
    radial-gradient(circle at 50% 15%, #ef4444 0 5%, transparent 5.5%),
    radial-gradient(circle at 85% 50%, #2563eb 0 5%, transparent 5.5%),
    radial-gradient(circle at 50% 85%, #eab308 0 5%, transparent 5.5%),
    radial-gradient(circle at 15% 50%, #14b8a6 0 5%, transparent 5.5%),
    radial-gradient(circle at 50% 50%, #f8fafc 0 66%, #e5edf5 67%, transparent 68%),
    color-mix(in srgb, var(--surface) 88%, transparent);
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.36);
}

.clock-face-grid [data-clock-face-choice="minimal"] .clock-face-preview::before {
  border-style: solid;
  border-width: 1px;
  border-color: rgba(15, 23, 42, 0.14);
}

.clock-face-grid [data-clock-face-choice="minimal"] .preview-hour,
.clock-face-grid [data-clock-face-choice="minimal"] .preview-minute {
  background: #111827;
}

.clock-face-grid [data-clock-face-choice="minimal"] .preview-second {
  background: #ef4444;
}

.clock-face-grid [data-clock-face-choice="minimal"] .preview-cap {
  background:
    radial-gradient(circle at 50% 50%, #2563eb 0 30%, transparent 31%),
    conic-gradient(#ef4444 0 25%, #2563eb 0 50%, #eab308 0 75%, #14b8a6 0);
  box-shadow: 0 0 0 2px #f8fafc;
}

html[data-theme="dark"] .clock-face-grid [data-clock-face-choice="minimal"] .clock-face-preview {
  background:
    radial-gradient(circle at 50% 15%, #fb7185 0 5%, transparent 5.5%),
    radial-gradient(circle at 85% 50%, #60a5fa 0 5%, transparent 5.5%),
    radial-gradient(circle at 50% 85%, #facc15 0 5%, transparent 5.5%),
    radial-gradient(circle at 15% 50%, #2dd4bf 0 5%, transparent 5.5%),
    radial-gradient(circle at 50% 50%, #0f172a 0 66%, #172033 67%, transparent 68%),
    #020617;
  border-color: rgba(226, 232, 240, 0.12);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.025);
}

html[data-theme="dark"] .clock-face-grid [data-clock-face-choice="minimal"] .clock-face-preview::before {
  border-color: rgba(226, 232, 240, 0.18);
}

html[data-theme="dark"] .clock-face-grid [data-clock-face-choice="minimal"] .preview-hour,
html[data-theme="dark"] .clock-face-grid [data-clock-face-choice="minimal"] .preview-minute {
  background: #f8fafc;
}

html[data-theme="dark"] .clock-face-grid [data-clock-face-choice="minimal"] .preview-second {
  background: #fb7185;
}

html[data-theme="dark"] .clock-face-grid [data-clock-face-choice="minimal"] .preview-cap {
  background:
    radial-gradient(circle at 50% 50%, #60a5fa 0 30%, transparent 31%),
    conic-gradient(#fb7185 0 25%, #60a5fa 0 50%, #facc15 0 75%, #2dd4bf 0);
  box-shadow: 0 0 0 2px #0f172a;
}

.clock-face-grid [data-clock-face-choice="neon"] .clock-face-preview {
  background:
    radial-gradient(circle at 50% 50%, transparent 0 48%, rgba(219, 39, 119, 0.2) 49%, transparent 50%),
    radial-gradient(circle at 50% 50%, #ecfeff 0 66%, #cffafe 67%, transparent 68%),
    linear-gradient(145deg, #f8fafc, #e0f2fe);
  border-color: rgba(8, 145, 178, 0.38);
  box-shadow:
    0 0 16px rgba(8, 145, 178, 0.16),
    inset 0 0 16px rgba(8, 145, 178, 0.13);
}

.clock-face-grid [data-clock-face-choice="neon"] .clock-face-preview::before {
  z-index: 1;
  border-color: rgba(219, 39, 119, 0.26);
  box-shadow: 0 0 10px rgba(8, 145, 178, 0.18);
}

.clock-face-grid [data-clock-face-choice="neon"] .clock-face-preview::after {
  content: "";
  position: absolute;
  inset: 9px;
  z-index: 1;
  border-radius: 50%;
  background:
    conic-gradient(
      from 18deg,
      transparent 0deg 26deg,
      rgba(8, 145, 178, 0.54) 26deg 62deg,
      transparent 62deg 122deg,
      rgba(219, 39, 119, 0.32) 122deg 154deg,
      transparent 154deg 218deg,
      rgba(8, 145, 178, 0.5) 218deg 250deg,
      transparent 250deg 304deg,
      rgba(219, 39, 119, 0.3) 304deg 334deg,
      transparent 334deg 360deg
    );
  -webkit-mask: radial-gradient(circle, transparent 0 54%, #000 55% 72%, transparent 73%);
  mask: radial-gradient(circle, transparent 0 54%, #000 55% 72%, transparent 73%);
  pointer-events: none;
}

.clock-face-grid [data-clock-face-choice="neon"] .preview-hour,
.clock-face-grid [data-clock-face-choice="neon"] .preview-minute {
  z-index: 2;
  background: #0f172a;
}

.clock-face-grid [data-clock-face-choice="neon"] .preview-second {
  z-index: 2;
  background: #db2777;
  box-shadow: 0 0 10px rgba(219, 39, 119, 0.24);
}

.clock-face-grid [data-clock-face-choice="neon"] .preview-cap {
  z-index: 3;
  background:
    radial-gradient(circle at 50% 50%, #ffffff 0 25%, transparent 26%),
    conic-gradient(from 45deg, #0891b2, #db2777, #0f766e, #0891b2);
  box-shadow: 0 0 0 2px #ecfeff, 0 0 12px rgba(8, 145, 178, 0.22);
}

html[data-theme="dark"] .clock-face-grid [data-clock-face-choice="neon"] .clock-face-preview {
  background:
    radial-gradient(circle at 50% 50%, transparent 0 48%, rgba(244, 114, 182, 0.28) 49%, transparent 50%),
    radial-gradient(circle at 50% 50%, #04111f 0 66%, #071a2f 67%, transparent 68%),
    #020617;
  border-color: rgba(103, 232, 249, 0.62);
  box-shadow:
    0 0 18px rgba(34, 211, 238, 0.26),
    inset 0 0 16px rgba(34, 211, 238, 0.14);
}

html[data-theme="dark"] .clock-face-grid [data-clock-face-choice="neon"] .clock-face-preview::before {
  border-color: rgba(244, 114, 182, 0.34);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.28);
}

html[data-theme="dark"] .clock-face-grid [data-clock-face-choice="neon"] .clock-face-preview::after {
  background:
    conic-gradient(
      from 18deg,
      transparent 0deg 26deg,
      rgba(103, 232, 249, 0.72) 26deg 62deg,
      transparent 62deg 122deg,
      rgba(244, 114, 182, 0.46) 122deg 154deg,
      transparent 154deg 218deg,
      rgba(103, 232, 249, 0.68) 218deg 250deg,
      transparent 250deg 304deg,
      rgba(244, 114, 182, 0.42) 304deg 334deg,
      transparent 334deg 360deg
    );
}

html[data-theme="dark"] .clock-face-grid [data-clock-face-choice="neon"] .preview-hour,
html[data-theme="dark"] .clock-face-grid [data-clock-face-choice="neon"] .preview-minute {
  background: #e0f2fe;
}

html[data-theme="dark"] .clock-face-grid [data-clock-face-choice="neon"] .preview-second {
  background: #f472b6;
  box-shadow: 0 0 10px rgba(244, 114, 182, 0.46);
}

html[data-theme="dark"] .clock-face-grid [data-clock-face-choice="neon"] .preview-cap {
  background:
    radial-gradient(circle at 50% 50%, #ffffff 0 25%, transparent 26%),
    conic-gradient(from 45deg, #67e8f9, #f472b6, #2dd4bf, #67e8f9);
  box-shadow: 0 0 0 2px #04111f, 0 0 14px rgba(34, 211, 238, 0.42);
}

.clock-face-grid [data-clock-face-choice="numberless"] .clock-face-preview {
  background:
    radial-gradient(circle at 50% 12%, #0e7490 0 5%, transparent 5.8%),
    radial-gradient(circle at 88% 50%, #2563eb 0 5%, transparent 5.8%),
    radial-gradient(circle at 50% 88%, #0e7490 0 5%, transparent 5.8%),
    radial-gradient(circle at 12% 50%, #2563eb 0 5%, transparent 5.8%),
    radial-gradient(circle at 50% 50%, #f6fbfd 0 64%, #dbeafe 66%, transparent 68%),
    linear-gradient(145deg, #f8fafc, #e8f3f7);
  border-color: rgba(15, 23, 42, 0.16);
  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.48),
    0 10px 20px rgba(15, 23, 42, 0.1);
}

.clock-face-grid [data-clock-face-choice="numberless"] .clock-face-preview::before {
  inset: 6px;
  border-style: solid;
  border-width: 1px;
  border-color: rgba(14, 116, 144, 0.18);
  box-shadow: inset 0 0 10px rgba(15, 23, 42, 0.08);
}

.clock-face-grid [data-clock-face-choice="numberless"] .clock-face-preview::after {
  content: "";
  position: absolute;
  inset: 5px;
  z-index: 1;
  border-radius: 50%;
  background:
    repeating-conic-gradient(
      from 0deg,
      rgba(71, 85, 105, 0.2) 0deg 1.4deg,
      transparent 1.4deg 6deg
    );
  -webkit-mask: radial-gradient(circle, transparent 0 82%, #000 83% 88%, transparent 89%);
  mask: radial-gradient(circle, transparent 0 82%, #000 83% 88%, transparent 89%);
  pointer-events: none;
}

.clock-face-grid [data-clock-face-choice="numberless"] .preview-hour,
.clock-face-grid [data-clock-face-choice="numberless"] .preview-minute {
  z-index: 2;
  background: linear-gradient(180deg, #0f172a, #334155);
  clip-path: polygon(50% 0, 72% 100%, 28% 100%);
}

.clock-face-grid [data-clock-face-choice="numberless"] .preview-second {
  z-index: 2;
  background: #0f766e;
  box-shadow: 0 0 8px rgba(15, 118, 110, 0.22);
}

.clock-face-grid [data-clock-face-choice="numberless"] .preview-cap {
  z-index: 3;
  background:
    radial-gradient(circle at 50% 50%, #0f766e 0 24%, transparent 25%),
    #f8fafc;
  box-shadow: 0 0 0 2px rgba(14, 116, 144, 0.34);
}

html[data-theme="dark"] .clock-face-grid [data-clock-face-choice="numberless"] .clock-face-preview {
  background:
    radial-gradient(circle at 50% 12%, #67e8f9 0 5%, transparent 5.8%),
    radial-gradient(circle at 88% 50%, #2dd4bf 0 5%, transparent 5.8%),
    radial-gradient(circle at 50% 88%, #67e8f9 0 5%, transparent 5.8%),
    radial-gradient(circle at 12% 50%, #2dd4bf 0 5%, transparent 5.8%),
    radial-gradient(circle at 50% 50%, #101a2b 0 64%, #172033 66%, transparent 68%),
    #0b1220;
  border-color: rgba(125, 211, 252, 0.22);
  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.035),
    0 10px 22px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .clock-face-grid [data-clock-face-choice="numberless"] .clock-face-preview::before {
  border-color: rgba(125, 211, 252, 0.16);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] .clock-face-grid [data-clock-face-choice="numberless"] .clock-face-preview::after {
  background:
    repeating-conic-gradient(
      from 0deg,
      rgba(226, 232, 240, 0.14) 0deg 1.4deg,
      transparent 1.4deg 6deg
    );
}

html[data-theme="dark"] .clock-face-grid [data-clock-face-choice="numberless"] .preview-hour,
html[data-theme="dark"] .clock-face-grid [data-clock-face-choice="numberless"] .preview-minute {
  background: linear-gradient(180deg, #f8fafc, #cbd5e1);
}

html[data-theme="dark"] .clock-face-grid [data-clock-face-choice="numberless"] .preview-second {
  background: #5eead4;
  box-shadow: 0 0 8px rgba(94, 234, 212, 0.2);
}

html[data-theme="dark"] .clock-face-grid [data-clock-face-choice="numberless"] .preview-cap {
  background:
    radial-gradient(circle at 50% 50%, #5eead4 0 24%, transparent 25%),
    #0f172a;
  box-shadow: 0 0 0 2px rgba(125, 211, 252, 0.34);
}

.timer-preset-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(15, 23, 42, 0.34);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.timer-preset-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.timer-preset-dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 151;
  width: min(720px, calc(100vw - 28px));
  max-height: min(680px, calc(100svh - 28px));
  padding: clamp(16px, 3vw, 24px);
  display: grid;
  gap: 16px;
  color: var(--ink);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 96%, transparent), color-mix(in srgb, var(--surface-strong) 90%, transparent)),
    var(--surface);
  border: 1px solid color-mix(in srgb, var(--line) 76%, var(--accent) 24%);
  border-radius: 34px;
  box-shadow: 0 34px 90px rgba(15, 23, 42, 0.24);
  opacity: 0;
  overflow: auto;
  pointer-events: none;
  transform: translate(-50%, -46%) scale(0.96);
  transition: opacity 190ms ease, transform 230ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.timer-preset-dialog.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

html[data-theme="dark"] .timer-preset-dialog {
  background:
    radial-gradient(circle at 18% 0%, rgba(125, 211, 252, 0.12), transparent 34%),
    radial-gradient(circle at 88% 10%, rgba(52, 211, 153, 0.12), transparent 34%),
    color-mix(in srgb, var(--surface) 94%, #020617 6%);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.42);
}

.timer-preset-dialog-head,
.timer-preset-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.timer-preset-dialog-head strong {
  font-size: 1rem;
  font-weight: 950;
}

.timer-preset-dialog-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface-strong) 78%, transparent);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-weight: 950;
}

.timer-preset-picker {
  width: min(620px, 100%);
}

.timer-preset-name-field {
  display: grid;
  gap: 8px;
  font-weight: 900;
}

.timer-preset-name-field span {
  color: var(--muted);
  font-size: 0.82rem;
}

.timer-preset-name-field input {
  min-height: 50px;
  padding: 0 18px;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 88%, var(--accent) 6%);
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 999px;
  font: inherit;
  font-weight: 900;
  outline: none;
}

.timer-preset-name-field input:focus {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
}

.timer-preset-dialog-message {
  min-height: 1.2em;
  color: var(--orange);
  font-size: 0.82rem;
  font-weight: 900;
}

.timer-preset-dialog-actions {
  justify-content: flex-end;
}

.timer-preset-dialog-actions .button {
  min-width: 126px;
  border-radius: 999px;
}

.timer-setting-row span,
.timer-setting-row small {
  display: block;
}

.timer-setting-row span {
  font-size: 0.92rem;
  font-weight: 900;
}

.timer-setting-row small {
  min-height: 1.15em;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.timer-stage {
  position: relative;
  width: 100%;
  min-height: clamp(282px, 41svh, 350px);
  display: grid;
  align-items: center;
  overflow: visible;
  isolation: isolate;
}

.timer-face,
.timer-setup-panel {
  grid-area: 1 / 1;
  width: 100%;
  transform-origin: center;
  will-change: opacity, transform, filter;
  transition: opacity 360ms ease, transform 400ms cubic-bezier(0.2, 0.8, 0.2, 1), filter 360ms ease;
}

.timer-setup-panel {
  display: grid;
  gap: 14px;
  align-content: center;
}

.timer-face {
  width: 100%;
  min-height: 130px;
  display: grid;
  place-items: center;
  align-content: center;
  overflow: hidden;
  background: transparent;
  user-select: none;
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.timer-progress-shell {
  --timer-ring-size: clamp(290px, 54vw, 430px);
  position: relative;
  width: min(var(--timer-ring-size), calc(100vw - 32px), 100%);
  aspect-ratio: 1;
  container-type: inline-size;
  display: grid;
  place-items: center;
  margin-inline: auto;
}

.timer-progress-dots {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.timer-progress-dot {
  position: absolute;
  width: clamp(4px, 0.8vw, 7px);
  height: clamp(4px, 0.8vw, 7px);
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 38%, transparent);
  opacity: 0.42;
  transform: translate(-50%, -50%) scale(0.92);
  transition:
    background 180ms ease,
    opacity 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.timer-progress-dot.is-active {
  background: linear-gradient(135deg, #7dd3fc, #34d399 58%, #fb923c);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent);
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.18);
}

html[data-theme="dark"] .timer-progress-dot {
  background: rgba(148, 163, 184, 0.28);
  opacity: 0.6;
}

html[data-theme="dark"] .timer-progress-dot.is-active {
  background: linear-gradient(135deg, #7dd3fc, #34d399 58%, #fb923c);
  box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.08);
  opacity: 1;
}

.timer-face-content {
  position: relative;
  z-index: 1;
  width: min(90%, 680px);
  display: grid;
  place-items: center;
}

.timer-display {
  width: 100%;
  max-width: 100%;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-size: clamp(3rem, 18cqw, 5.35rem);
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
}

.timer-status {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  min-height: 1.4em;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
  opacity: 0;
  transition: opacity 180ms ease, color 180ms ease;
}

.timer-face[data-state="finished"] .timer-status {
  color: var(--orange);
  opacity: 1;
}

html[data-theme="dark"] .timer-face[data-state="finished"] .timer-status {
  color: #fbbf24;
}

.timer-controls {
  --timer-control-width: 112px;
  --timer-control-shift: 62px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, var(--timer-control-width));
  justify-content: center;
  gap: 12px;
  user-select: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.timer-controls .button {
  width: var(--timer-control-width);
  min-width: var(--timer-control-width);
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  transition: opacity 210ms ease, transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1), background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.timer-card:not(.is-ready) .timer-face,
.timer-card:not(.is-ready) .timer-setup-panel,
.timer-card:not(.is-ready) .timer-picker,
.timer-card:not(.is-ready) .timer-preset-area,
.timer-card:not(.is-ready) .timer-controls,
.timer-card:not(.is-ready) .timer-controls .button,
.timer-card:not(.is-ready) .timer-wheel-item {
  animation: none !important;
  transition: none !important;
}

.timer-controls .button.secondary {
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 15%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.timer-controls .button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  box-shadow: none;
  transform: none;
}

html[data-theme="dark"] .timer-controls .button.secondary {
  color: #f8fbff;
  background: rgba(125, 211, 252, 0.12);
  border-color: rgba(125, 211, 252, 0.42);
}

html.timer-focus-mode,
html.timer-focus-mode body {
  overflow: hidden;
}

html.timer-focus-mode body {
  padding-top: 0;
}

html.timer-fullscreen-mode.timer-cursor-idle,
html.timer-fullscreen-mode.timer-cursor-idle * {
  cursor: none !important;
}

html.timer-fullscreen-mode.timer-cursor-idle .timer-view-actions:not(:focus-within) {
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
}

html.timer-fullscreen-mode.timer-cursor-idle .timer-stage:hover .timer-view-actions:not(:focus-within),
html.timer-fullscreen-mode.timer-cursor-idle .timer-view-actions:hover:not(:focus-within) {
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
}

@media (hover: hover) {
  html.timer-fullscreen-mode.timer-cursor-idle .timer-controls:not(:focus-within) {
    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
  }
}

html.timer-focus-mode .site-header,
html.timer-focus-mode .site-footer,
html.timer-focus-mode .timer-title-bar,
html.timer-focus-mode .timer-page-actions {
  display: none !important;
}

html.timer-focus-mode .tool-main > :not(.timer-tool-section) {
  display: none !important;
}

html.timer-focus-mode .tool-main {
  min-height: 100svh;
  padding: 0;
}

html.timer-focus-mode .timer-tool-section {
  position: fixed;
  inset: 0;
  z-index: 120;
  width: 100%;
  height: 100svh;
  min-height: 100svh;
  padding: clamp(14px, 3vmin, 28px);
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 20%, rgba(125, 211, 252, 0.16), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(52, 211, 153, 0.16), transparent 30%),
    var(--page);
}

html.timer-focus-mode .timer-shell {
  width: min(820px, 100%);
  min-height: 0;
  display: grid;
  place-items: center;
}

html.timer-focus-mode .timer-workspace {
  width: min(820px, 100%);
  align-content: center;
}

html.timer-focus-mode .timer-card {
  width: 100%;
  padding-top: 0;
}

html.timer-focus-mode .timer-face {
  min-height: 170px;
}

html.timer-focus-mode .timer-progress-shell {
  --timer-ring-size: clamp(320px, 72vmin, 620px);
}

html.timer-focus-mode .timer-display {
  display: block;
  font-size: clamp(3.25rem, 15.5cqw, 5.85rem);
}

html.timer-focus-mode .timer-view-actions {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 122;
  min-width: 116px;
  min-height: 80px;
  padding: clamp(14px, 3vmin, 24px);
  align-items: flex-start;
  justify-content: flex-end;
  pointer-events: auto;
}

html.timer-focus-mode .timer-view-actions:hover,
html.timer-focus-mode .timer-view-actions:focus-within {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

@media (hover: none) {
  .timer-view-actions {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  html.timer-focus-mode .timer-view-actions {
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
  }

  html.timer-focus-mode .timer-stage:hover .timer-view-actions,
  html.timer-focus-mode .timer-view-actions:hover,
  html.timer-focus-mode .timer-view-actions:focus-within {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .timer-view-actions,
  .timer-view-action,
  .timer-face,
  .timer-setup-panel,
  .timer-picker,
  .timer-preset-area,
  .timer-controls .button,
  .timer-notify,
  .timer-switch-track,
  .timer-switch-thumb {
    animation: none !important;
    transition: none;
  }

  .timer-progress-dot {
    transition: none;
  }
}

@media (max-width: 860px) {
  .timer-tool-section {
    min-height: calc(100svh - var(--site-header-height, 72px));
    padding-top: 12px;
    padding-bottom: 24px;
  }
}

@media (max-width: 560px) {
  html.timer-focus-mode .timer-tool-section {
    padding-inline: 8px;
  }

  html.timer-focus-mode .timer-workspace {
    width: 100%;
  }

  .timer-card {
    padding-inline: 0;
  }

  .timer-view-actions {
    right: 0;
  }

  .timer-page-actions {
    right: 12px;
  }

  .timer-settings-panel {
    --settings-panel-gap: 10px;
    width: min(360px, calc(100vw - 10px));
    border-radius: 24px 0 0 24px;
  }

  .timer-face {
    min-height: 118px;
  }

  .timer-progress-shell {
    --timer-ring-size: clamp(290px, calc(565px - 46vw), 340px);
  }

  .timer-face-content {
    width: 90%;
  }

  .timer-display {
    font-size: clamp(2.8rem, 17cqw, 4.65rem);
  }

  html.timer-focus-mode .timer-face {
    min-height: clamp(300px, 52svh, 410px);
  }

  html.timer-focus-mode .timer-progress-shell {
    --timer-ring-size: clamp(310px, calc(650px - 54vw), 390px);
  }

  html.timer-focus-mode .timer-display {
    font-size: clamp(3.1rem, 15.5cqw, 5.3rem);
  }

  .timer-controls {
    --timer-control-width: 98px;
    --timer-control-shift: 55px;
  }

  .timer-controls .button {
    min-height: 40px;
    padding: 0 16px;
  }
}

/* Timer wheel refinement */
.timer-card[data-state="setup"] .timer-face {
  opacity: 0;
  transform: translateY(24px) scale(0.96);
  filter: blur(6px);
  pointer-events: none;
}

.timer-card[data-state="setup"] .timer-setup-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
  pointer-events: auto;
}

.timer-card[data-state="setup"] .timer-start {
  transform: translateX(var(--timer-control-shift));
}

.timer-card[data-state="setup"] .timer-controls .button.secondary {
  opacity: 0;
  transform: translateX(calc(-1 * var(--timer-control-shift))) scale(0.82);
  pointer-events: none;
}

.timer-card[data-state="running"] .timer-face,
.timer-card[data-state="paused"] .timer-face,
.timer-card[data-state="finished"] .timer-face {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
  pointer-events: auto;
}

.timer-card[data-state="running"] .timer-setup-panel,
.timer-card[data-state="paused"] .timer-setup-panel,
.timer-card[data-state="finished"] .timer-setup-panel {
  opacity: 0;
  transform: translateY(-24px) scale(0.97);
  filter: blur(6px);
  pointer-events: none;
}

.timer-card[data-state="running"] .timer-start,
.timer-card[data-state="paused"] .timer-start,
.timer-card[data-state="finished"] .timer-start {
  transform: translate(0, 0);
}

.timer-card[data-state="running"] .timer-controls .button.secondary,
.timer-card[data-state="paused"] .timer-controls .button.secondary,
.timer-card[data-state="finished"] .timer-controls .button.secondary {
  opacity: 1;
  transform: translate(0, 0);
}

.timer-card[data-state="running"],
.timer-card[data-state="paused"],
.timer-card[data-state="finished"] {
  gap: 14px;
}

.timer-card[data-state="running"] .timer-face,
.timer-card[data-state="paused"] .timer-face,
.timer-card[data-state="finished"] .timer-face {
  min-height: clamp(310px, 48svh, 450px);
}

.timer-card[data-state="finished"] .timer-status {
  color: var(--orange);
  font-size: clamp(1.1rem, 3vw, 1.45rem);
}

html[data-theme="dark"] .timer-card[data-state="finished"] .timer-status {
  color: #fbbf24;
}

.timer-picker {
  width: min(620px, 100%);
  max-height: 230px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 260ms ease, transform 300ms ease, max-height 340ms ease;
}

.timer-wheel {
  min-width: 0;
  display: grid;
  gap: 8px;
  text-align: center;
}

.timer-wheel-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0;
}

.timer-wheel-window {
  position: relative;
  min-height: 156px;
  color: var(--ink);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 68%, transparent), color-mix(in srgb, var(--surface-strong) 72%, transparent)),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: 34px;
  cursor: grab;
  outline: none;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  box-shadow: inset 0 1px 0 color-mix(in srgb, #ffffff 50%, transparent), 0 18px 42px rgba(15, 23, 42, 0.08);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}

.timer-wheel.is-dragging .timer-wheel-window {
  cursor: grabbing;
}

.timer-wheel-window::before,
.timer-wheel-window::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  height: 1px;
  background: color-mix(in srgb, var(--line) 72%, transparent);
  pointer-events: none;
}

.timer-wheel-window::before {
  top: 50px;
}

.timer-wheel-window::after {
  bottom: 50px;
}

.timer-wheel-window:hover,
.timer-wheel-window:focus-visible,
.timer-wheel.is-editing .timer-wheel-window {
  border-color: color-mix(in srgb, var(--accent) 56%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent), 0 18px 42px rgba(15, 23, 42, 0.1);
}

.timer-wheel-track {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
}

.timer-wheel-item {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: clamp(2.35rem, 8vw, 3.4rem);
  font-weight: 950;
  line-height: 1;
  opacity: var(--wheel-opacity, 0.6);
  transform: translateY(calc(-50% + var(--wheel-y, 0px))) scale(var(--wheel-scale, 0.7));
  transform-origin: center;
  transition: color 120ms ease;
}

.timer-wheel-item.is-center {
  color: var(--ink);
}

.timer-wheel-input {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(86px, 72%);
  height: 54px;
  transform: translate(-50%, -50%);
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 90%, var(--accent) 7%);
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line));
  border-radius: 18px;
  font-size: clamp(1.8rem, 7vw, 2.6rem);
  font-weight: 950;
  line-height: 1;
  text-align: center;
  outline: none;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 13%, transparent);
  z-index: 2;
}

.timer-wheel.is-editing .timer-wheel-track {
  visibility: hidden;
}

.timer-picker-separator {
  align-self: end;
  padding-bottom: 48px;
  color: color-mix(in srgb, var(--muted) 72%, var(--ink));
  font-size: 1.8rem;
  font-weight: 950;
  line-height: 1;
}

.timer-preset-area {
  width: min(760px, 100%);
  max-height: 92px;
  min-width: 0;
  margin-inline: auto;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 240ms ease, transform 300ms ease, max-height 320ms ease;
}

.timer-preset-shell {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow-x: auto;
  overflow-y: hidden;
  box-shadow: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.timer-preset-shell::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.timer-presets {
  width: max-content;
  min-width: 0;
  max-width: none;
  margin-inline: auto;
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  overflow: visible;
  padding: 0;
  scroll-padding-inline: 16px;
}

.timer-presets::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.timer-preset,
.timer-add-preset {
  min-height: 52px;
  padding: 7px 14px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 82%, var(--accent) 8%);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  line-height: 1.05;
  user-select: none;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.timer-preset span,
.timer-preset-wrap .timer-preset span {
  display: block;
  width: 7ch;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.timer-preset:not(.has-name) span {
  align-self: center;
}

.timer-preset small {
  display: block;
  max-width: 7.6rem;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timer-add-preset {
  width: 52px;
  min-width: 52px;
  max-width: 52px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  color: #07111f;
  background: linear-gradient(135deg, #7dd3fc, #34d399);
  border-color: transparent;
  font-size: 1.35rem;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 10%, transparent);
}

.timer-preset:hover,
.timer-preset:focus-visible {
  background: color-mix(in srgb, var(--surface) 74%, var(--accent) 16%);
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  outline: none;
}

.timer-add-preset:hover,
.timer-add-preset:focus-visible {
  color: #031322;
  background: linear-gradient(135deg, #a5e8ff, #45e0a9);
  border-color: transparent;
  box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 14%, transparent);
  transform: translateY(-1px);
  outline: none;
}

.timer-preset:disabled,
.timer-add-preset:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.timer-preset-wrap {
  min-height: 52px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 84%, var(--green) 9%);
  border: 1px solid color-mix(in srgb, var(--green) 42%, var(--line));
  border-radius: 999px;
}

.timer-preset-wrap .timer-preset {
  min-width: 0;
  min-height: 50px;
  padding-right: 8px;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.timer-preset-remove {
  width: 28px;
  height: 28px;
  margin-right: 4px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-strong) 78%, transparent);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 950;
  line-height: 1;
  transition: color 160ms ease, background 160ms ease;
}

.timer-preset-form {
  min-height: 52px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  background: color-mix(in srgb, var(--surface) 82%, var(--accent) 9%);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: 999px;
}

.timer-preset-input {
  width: 116px;
  min-height: 38px;
  padding: 0 12px;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 999px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 900;
  outline: none;
}

.timer-preset-input:focus {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
}

.timer-preset-form-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface-strong) 78%, transparent);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-weight: 950;
  line-height: 1;
}

.timer-preset-form-button.is-save {
  color: #07111f;
  background: linear-gradient(135deg, #7dd3fc, #34d399);
}

.timer-preset-remove:hover,
.timer-preset-remove:focus-visible {
  color: var(--ink);
  background: color-mix(in srgb, var(--orange) 18%, var(--surface));
  outline: none;
}

.timer-notify {
  min-width: 0;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 6px 5px 12px;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 82%, var(--accent) 8%);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 900;
  line-height: 1;
  user-select: none;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.timer-notify:hover,
.timer-notify:focus-visible {
  background: color-mix(in srgb, var(--surface) 74%, var(--accent) 16%);
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  outline: none;
}

.timer-notify:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.timer-volume-control {
  min-width: 0;
  min-height: 54px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 82%, var(--accent) 8%);
  border: 1px solid var(--line);
  border-radius: 22px;
  font-weight: 950;
}

.timer-volume-control > span {
  min-width: 44px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1;
}

.timer-volume-slider {
  --timer-volume: 65%;
  width: 100%;
  min-width: 0;
  height: 34px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}

.timer-volume-slider:focus-visible {
  outline: none;
}

.timer-volume-slider::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, #7dd3fc 0%, #34d399 var(--timer-volume), color-mix(in srgb, var(--muted) 24%, var(--surface)) var(--timer-volume), color-mix(in srgb, var(--muted) 24%, var(--surface)) 100%);
}

.timer-volume-slider::-webkit-slider-thumb {
  width: 24px;
  height: 24px;
  margin-top: -8px;
  appearance: none;
  -webkit-appearance: none;
  background: #ffffff;
  border: 3px solid color-mix(in srgb, var(--accent) 74%, #7dd3fc);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.2);
}

.timer-volume-slider::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 24%, var(--surface));
}

.timer-volume-slider::-moz-range-progress {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #7dd3fc, #34d399);
}

.timer-volume-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #ffffff;
  border: 3px solid color-mix(in srgb, var(--accent) 74%, #7dd3fc);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.2);
}

.timer-volume-slider:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 18%, transparent), 0 8px 18px rgba(15, 23, 42, 0.2);
}

.timer-volume-slider:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 18%, transparent), 0 8px 18px rgba(15, 23, 42, 0.2);
}

.timer-switch-track {
  position: relative;
  width: 48px;
  height: 30px;
  flex: 0 0 auto;
  order: 2;
  background: color-mix(in srgb, var(--muted) 36%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 999px;
  transition: background 170ms ease, border-color 170ms ease;
}

.timer-switch-thumb {
  position: absolute;
  left: 4px;
  top: 50%;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 5px 12px rgba(15, 23, 42, 0.22);
  transform: translateY(-50%);
  transition: transform 170ms ease;
}

.timer-notify[aria-checked="true"] .timer-switch-track {
  background: linear-gradient(135deg, #7dd3fc, #34d399);
  border-color: transparent;
}

.timer-notify[aria-checked="true"] .timer-switch-thumb {
  transform: translate(18px, -50%);
}

@media (prefers-reduced-motion: reduce) {
  .timer-wheel-window,
  .timer-wheel-item,
  .timer-face,
  .timer-setup-panel,
  .timer-picker,
  .timer-preset-area,
  .timer-controls .button,
  .timer-preset,
  .timer-add-preset,
  .timer-preset-remove,
  .timer-notify,
  .timer-switch-track,
  .timer-switch-thumb {
    transition: none;
  }
}

@media (max-width: 560px) {
  .time-tool-switch {
    width: min(330px, 100%);
    min-height: 44px;
  }

  .time-tool-option {
    min-height: 36px;
    padding-inline: 12px;
    font-size: 0.9rem;
  }

  .timer-preset-dialog {
    left: 10px;
    right: 10px;
    top: auto;
    bottom: 10px;
    width: auto;
    max-height: calc(100svh - 20px);
    border-radius: 28px;
    transform: translateY(18px) scale(0.98);
  }

  .timer-preset-dialog.is-open {
    transform: translateY(0) scale(1);
  }

  .timer-preset-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .timer-preset-dialog-actions .button {
    width: 100%;
    min-width: 0;
  }

  .timer-picker {
    gap: 5px;
  }

  .timer-wheel-label {
    font-size: 0.68rem;
  }

  .timer-wheel-window {
    min-height: 132px;
    border-radius: 26px;
  }

  .timer-wheel-window::before {
    top: 41px;
  }

  .timer-wheel-window::after {
    bottom: 41px;
  }

  .timer-wheel-item {
    font-size: clamp(2rem, 14vw, 3rem);
  }

  .timer-picker-separator {
    padding-bottom: 41px;
    font-size: 1.2rem;
  }

  .timer-preset-area {
    width: min(100%, 520px);
  }

  .timer-presets {
    padding-inline: 4px;
  }
}

/* Shared view controls for Time, Timer, and Stopwatch.
   Keep one source of truth so hide/fullscreen buttons stay reachable in every mode. */
.clock-view-actions,
.stopwatch-view-actions,
.timer-view-actions {
  z-index: 30;
  pointer-events: none;
}

.clock-view-actions::before,
.stopwatch-view-actions::before,
.timer-view-actions::before {
  content: "";
  position: absolute;
  inset: -22px -16px -28px -220px;
  z-index: -1;
}

.clock-card:has(.clock-face:hover) .clock-view-actions,
.clock-view-actions:hover,
.clock-view-actions:focus-within,
.stopwatch-card:has(.stopwatch-face:hover) .stopwatch-view-actions,
.stopwatch-view-actions:hover,
.stopwatch-view-actions:focus-within,
.timer-stage:hover .timer-view-actions,
.timer-view-actions:hover,
.timer-view-actions:focus-within {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

html.clock-focus-mode .clock-view-actions,
html.stopwatch-focus-mode .stopwatch-view-actions,
html.timer-focus-mode .timer-view-actions {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 122;
  min-width: clamp(108px, 16vw, 148px);
  min-height: clamp(76px, 12vw, 104px);
  padding: clamp(14px, 3vmin, 24px);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 8px;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
}

html.clock-focus-mode .clock-view-actions::before,
html.stopwatch-focus-mode .stopwatch-view-actions::before,
html.timer-focus-mode .timer-view-actions::before {
  inset: 0;
}

html.clock-focus-mode .clock-tool-section:hover .clock-view-actions,
html.clock-focus-mode .clock-view-actions:hover,
html.clock-focus-mode .clock-view-actions:focus-within,
html.stopwatch-focus-mode .stopwatch-tool-section:hover .stopwatch-view-actions,
html.stopwatch-focus-mode .stopwatch-view-actions:hover,
html.stopwatch-focus-mode .stopwatch-view-actions:focus-within,
html.timer-focus-mode .timer-tool-section:hover .timer-view-actions,
html.timer-focus-mode .timer-view-actions:hover,
html.timer-focus-mode .timer-view-actions:focus-within {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

html.clock-fullscreen-mode.clock-cursor-idle .clock-tool-section:hover .clock-view-actions:not(:focus-within),
html.clock-fullscreen-mode.clock-cursor-idle .clock-view-actions:hover:not(:focus-within),
html.stopwatch-fullscreen-mode.stopwatch-cursor-idle .stopwatch-tool-section:hover .stopwatch-view-actions:not(:focus-within),
html.stopwatch-fullscreen-mode.stopwatch-cursor-idle .stopwatch-view-actions:hover:not(:focus-within),
html.timer-fullscreen-mode.timer-cursor-idle .timer-tool-section:hover .timer-view-actions:not(:focus-within),
html.timer-fullscreen-mode.timer-cursor-idle .timer-view-actions:hover:not(:focus-within) {
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
}

@media (hover: none) {
  .clock-view-actions,
  .stopwatch-view-actions,
  .timer-view-actions,
  html.clock-focus-mode .clock-view-actions,
  html.stopwatch-focus-mode .stopwatch-view-actions,
  html.timer-focus-mode .timer-view-actions {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .clock-view-actions,
  .stopwatch-view-actions,
  .timer-view-actions {
    transition: none;
  }
}

html[data-clock-size="small"] .clock-time {
  font-size: clamp(2.55rem, 7.4vw, 5.3rem);
}

html[data-clock-size="small"] .clock-face {
  --analog-size: clamp(220px, 32vw, 340px);
}

html[data-clock-size="large"] .clock-time {
  font-size: clamp(3.9rem, 12vw, 9.2rem);
}

html[data-clock-size="large"] .clock-face {
  --analog-size: clamp(300px, 44vw, 520px);
}

html.clock-focus-mode[data-clock-size="small"] .clock-time {
  font-size: clamp(3.2rem, 9.6vw, 7.2rem);
}

html.clock-focus-mode[data-clock-size="small"] .clock-face {
  --analog-size: clamp(270px, 52vmin, 520px);
}

html.clock-focus-mode[data-clock-size="large"] .clock-time {
  font-size: clamp(4.8rem, 15vw, 12rem);
}

html.clock-focus-mode[data-clock-size="large"] .clock-face {
  --analog-size: clamp(340px, 72vmin, 740px);
}

@media (max-width: 430px) {
  .clock-face-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  html[data-clock-size="small"] .clock-time {
    font-size: clamp(2.45rem, 12vw, 3.9rem);
  }

  html[data-clock-size="small"] .clock-face {
    --analog-size: min(72vw, 300px);
  }

  html[data-clock-size="large"] .clock-time {
    font-size: clamp(3.15rem, 15.6vw, 5.2rem);
  }

  html[data-clock-size="large"] .clock-face {
    --analog-size: min(88vw, 370px);
  }
}

@media (max-width: 720px) {
  [data-clock-size-row] {
    display: none;
  }

  html[data-clock-size] .clock-time,
  html.clock-focus-mode[data-clock-size] .clock-time {
    font-size: clamp(2.85rem, 14vw, 4.9rem);
  }

  html[data-clock-size] .clock-face {
    --analog-size: clamp(260px, 78vw, 360px);
  }

  html.clock-focus-mode[data-clock-size] .clock-face {
    --analog-size: clamp(280px, 72vmin, 520px);
  }
}

@media (max-width: 430px) {
  html[data-clock-size] .clock-time,
  html.clock-focus-mode[data-clock-size] .clock-time {
    font-size: clamp(2.85rem, 13.5vw, 4.5rem);
  }

  html[data-clock-size] .clock-face {
    --analog-size: min(82vw, 340px);
  }

  html.clock-focus-mode[data-clock-size] .clock-face {
    --analog-size: min(84vmin, 430px);
  }
}
