@font-face {
  font-family: "Fredoka";
  src: url("/assets/fonts/Fredoka-VariableFont_wdth,wght.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 700;
  font-display: block;
}

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

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/Inter-Italic-VariableFont_opsz,wght.woff2") format("woff2");
  font-style: italic;
  font-weight: 100 900;
  font-display: block;
}

:root {
  --background: 40 25% 98%;
  --surface: 36 28% 96%;
  --foreground: 22 18% 12%;
  --muted-foreground: 24 10% 42%;
  --border: 28 17% 84%;
  --border-soft: 28 16% 88%;
  --accent: 40 20% 94%;
  --focus: 28 60% 36%;
  --primary: 22 18% 12%;
  --radius: 14px;
  --transition-fast: 140ms ease;
  --transition-medium: 180ms ease;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  touch-action: manipulation;
}

body {
  background:
    radial-gradient(circle at 10% 2%, hsl(40 35% 96%), transparent 28%),
    radial-gradient(circle at 100% 0%, hsl(32 30% 95%), transparent 30%),
    hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: Fredoka, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

button {
  touch-action: manipulation;
}

.app {
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 980px;
  margin: 0 auto;
  padding: 0.9rem 0.95rem 1.2rem;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
  z-index: 2;
}

.topbar-title-wrap {
  min-width: 0;
  align-self: start;
  justify-self: start;
  text-align: left;
}

.app.home-mode .topbar {
  grid-template-columns: 1fr;
}

.app.home-mode #backBtn.hidden {
  display: none;
}

.headline {
  margin: 0;
  font-family: Inter, sans-serif;
  font-weight: 900;
  letter-spacing: -0.04em;
  font-size: clamp(1.5rem, 5.8vw, 2rem);
  line-height: 1;
}

.header-subtitle {
  margin: 0.38rem 0 0;
  color: hsl(var(--muted-foreground));
  font-size: 0.91rem;
  line-height: 1.25;
  font-style: italic;
  max-width: 40rem;
}

.app:not(.home-mode) .topbar {
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  margin-bottom: 0.55rem;
}

.app:not(.home-mode) .headline {
  font-size: clamp(1.4rem, 4.6vw, 2.8rem);
  line-height: 1.02;
}

.app:not(.home-mode) .topbar-title-wrap {
  align-self: center;
  justify-self: center;
  text-align: center;
}

.app:not(.home-mode) .header-subtitle {
  display: none;
}

.view.hidden {
  display: none;
}

.view-active {
  display: block;
}

.app:not(.home-mode) .view-active {
  display: flex;
  justify-content: center;
}

.app-footer {
  margin: auto 0 0;
  padding-top: 1.25rem;
  text-align: center;
  color: hsl(var(--muted-foreground) / 0.72);
  font-size: 0.74rem;
}

.copyright-symbol {
  font-family: Inter, sans-serif;
  font-weight: 300;
}

.toy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.78rem;
}

.toy-card {
  width: 100%;
  min-height: 0;
  border: 1px solid hsl(var(--border-soft));
  border-radius: calc(var(--radius) + 2px);
  background: linear-gradient(180deg, hsl(var(--surface)) 0%, hsl(var(--background)) 100%);
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  display: grid;
  grid-template-rows: 122px auto;
  transition:
    transform var(--transition-medium),
    border-color var(--transition-medium),
    background-color var(--transition-medium);
}

.toy-card:hover {
  transform: scale(1.01);
  border-color: hsl(var(--border));
}

.toy-card:active {
  transform: scale(0.98);
}

.toy-card-body {
  min-height: 0;
  height: 122px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 0.8rem 0.45rem;
}

.toy-card-body svg,
.tool-thumb {
  width: 54%;
  height: 54%;
  color: hsl(0 0% 15% / 0.72);
  transition:
    color var(--transition-fast),
    filter var(--transition-fast),
    opacity var(--transition-fast);
}

.toy-card:hover .toy-card-body svg,
.toy-card:focus-visible .toy-card-body svg,
.toy-card:hover .tool-thumb,
.toy-card:focus-visible .tool-thumb {
  color: hsl(0 0% 12% / 0.9);
}

.tool-thumb {
  display: block;
  object-fit: contain;
  filter: grayscale(1) brightness(0.42);
  opacity: 0.95;
}

.toy-card:hover .tool-thumb,
.toy-card:focus-visible .tool-thumb {
  filter: brightness(0) saturate(100%);
  opacity: 1;
}

.toy-card-footer {
  border-top: 1px solid hsl(var(--border-soft));
  text-align: center;
  font-weight: 500;
  font-size: 0.86rem;
  letter-spacing: 0.01em;
  padding: 0.5rem 0.65rem 0.56rem;
}

.list-card,
.display-card,
.timer-readout-card,
.calculator-shell {
  border: 1px solid hsl(var(--border-soft));
  border-radius: calc(var(--radius) + 2px);
  background: linear-gradient(180deg, hsl(var(--surface)) 0%, hsl(var(--background)) 100%);
}

.home-note-title,
.list-card-title {
  margin: 0;
  font-family: Inter, sans-serif;
  font-weight: 900;
  letter-spacing: -0.03em;
  font-size: 1rem;
}

.home-note-copy,
.list-card-meta,
.meta-copy,
.converter-helper,
.alarm-banner-copy {
  margin: 0.3rem 0 0;
  color: hsl(var(--muted-foreground));
  font-size: 0.92rem;
  line-height: 1.35;
}

.panel {
  margin: 0 auto;
  text-align: center;
  max-width: 46rem;
}

.tool-panel {
  min-height: clamp(30rem, 72dvh, 46rem);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.app:not(.home-mode) .tool-panel {
  width: min(100%, 52rem);
  margin-inline: auto;
}

.panel-title {
  margin: 0.2rem 0 0;
  font-family: Inter, sans-serif;
  font-weight: 900;
  letter-spacing: -0.03em;
  font-size: clamp(1.8rem, 6vw, 2.2rem);
}

.panel-desc {
  margin: 0.32rem 0 0.95rem;
  color: hsl(var(--muted-foreground));
}

.tool-panel > .panel-title,
.tool-panel > .panel-desc {
  display: none;
}

.tool-body {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  align-items: stretch;
}

.app:not(.home-mode) .tool-body {
  width: 100%;
  max-width: 52rem;
  margin-inline: auto;
  align-items: center;
}

.app:not(.home-mode) .tool-body > * {
  width: min(100%, 42rem);
  margin-inline: auto;
}

.btn {
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 4px);
  padding: 0.7rem 1rem;
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    transform var(--transition-fast),
    border-color var(--transition-fast);
}

.btn:hover {
  border-color: hsl(var(--border));
}

.btn:active {
  transform: scale(0.98);
}

.btn.hidden {
  visibility: hidden;
}

.btn-ghost {
  background: hsl(var(--surface) / 0.45);
}

.btn-ghost:hover {
  background: hsl(var(--accent));
}

.btn-solid {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
}

.btn-solid:hover {
  background: hsl(var(--foreground) / 0.92);
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 999px;
}

.back-icon {
  width: 18px;
  height: 18px;
  display: block;
  user-select: none;
  -webkit-user-select: none;
}

.icon-btn .icon {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.icon {
  width: 21px;
  height: 21px;
}

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

.display-card,
.timer-readout-card {
  padding: 1rem 1rem 1.05rem;
  text-align: left;
  min-width: 0;
}

.display-card {
  overflow: visible;
}

.display-label,
.field-label,
.alarm-banner-title {
  margin: 0;
  color: hsl(var(--muted-foreground));
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.display-expression {
  margin: 0 0 0.45rem;
  min-height: 1.9rem;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  color: hsl(var(--muted-foreground));
  font-size: clamp(1.1rem, 3vw, 1.65rem);
  line-height: 1.2;
  scrollbar-width: thin;
  text-align: right;
}

.display-result,
.hero-time {
  margin: 0;
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: clamp(2rem, 7vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.05em;
}

.timer-readout-card .hero-time {
  width: 100%;
  text-align: center;
}

#calcResult {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  white-space: nowrap;
  font-size: clamp(3.2rem, 11vw, 5.8rem);
  line-height: 1.08;
  min-height: 1.15em;
  padding: 0.05em 0.02em 0.1em;
  letter-spacing: -0.03em;
  scrollbar-width: thin;
  text-align: right;
}

#stopwatchDisplay {
  font-size: clamp(4.4rem, 14vw, 8rem);
  line-height: 0.95;
}

#timerDisplay {
  font-size: clamp(4.4rem, 14vw, 8rem);
  line-height: 0.95;
}

@media (max-width: 720px) {
  #timerDisplay,
  #stopwatchDisplay {
    font-size: clamp(3.8rem, 17vw, 6.6rem);
  }
}

@media (max-width: 420px) {
  #timerDisplay,
  #stopwatchDisplay {
    font-size: clamp(3rem, 19vw, 5rem);
  }
}

.calculator-shell {
  padding: 1rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.calculator-grid {
  margin-top: 0.85rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  min-width: 0;
}

.calc-key {
  min-height: 3.4rem;
  border: 1px solid hsl(var(--border-soft));
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--background) / 0.8);
  font-size: clamp(1.7rem, 4.4vw, 2.5rem);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.calc-key-glyph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  line-height: 1;
}

.calc-key:hover {
  border-color: hsl(var(--border));
  background: hsl(var(--surface));
}

.key-muted {
  color: hsl(var(--muted-foreground));
}

.key-operator {
  background: hsl(var(--accent));
  font-size: clamp(2.1rem, 5vw, 2.9rem);
}

.calc-key[data-value="%"] {
  font-size: clamp(1.9rem, 4.6vw, 2.6rem);
}

.key-equals {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  font-size: clamp(2.1rem, 5vw, 2.9rem);
}

.calc-key[data-value="."] {
  font-size: clamp(2.1rem, 5vw, 2.9rem);
}

.calc-key[data-value="/"],
.calc-key[data-value="*"],
.calc-key[data-value="-"],
.calc-key[data-value="+"],
.key-equals,
.calc-key[data-value="."] {
  font-size: clamp(2.6rem, 6vw, 3.4rem);
  font-weight: 400;
}

.calc-key[data-value="/"] .calc-key-glyph,
.calc-key[data-value="*"] .calc-key-glyph,
.calc-key[data-value="-"] .calc-key-glyph,
.calc-key[data-value="+"] .calc-key-glyph,
.key-equals .calc-key-glyph {
  transform: translateY(-0.09em);
}

.calc-key[data-value="."] .calc-key-glyph {
  transform: translateY(-0.26em);
}

.key-equals:hover {
  background: hsl(var(--foreground) / 0.92);
  color: hsl(var(--background));
  border-color: hsl(var(--foreground) / 0.92);
}

.key-span-2 {
  grid-column: span 2;
}

.preset-row,
.action-row,
.split-inputs {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  justify-content: center;
}

.preset-btn {
  flex: 1 1 6rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: left;
  flex: 1 1 9rem;
}

.field-grow {
  flex-basis: 14rem;
}

.input {
  width: 100%;
  min-height: 3rem;
  border: 1px solid hsl(var(--border-soft));
  border-radius: calc(var(--radius) - 4px);
  padding: 0.7rem 0.85rem;
  background: hsl(var(--background) / 0.82);
}

.input:focus-visible,
.calc-key:focus-visible,
.btn:focus-visible,
.swap-btn:focus-visible,
.toy-card:focus-visible {
  outline: 2px solid hsl(var(--focus) / 0.22);
  outline-offset: 2px;
}

.input-select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, hsl(var(--muted-foreground)) 50%),
    linear-gradient(135deg, hsl(var(--muted-foreground)) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2rem;
}

.select-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.select-shell {
  position: relative;
}

.select-trigger {
  width: 100%;
  min-height: 3rem;
  border: 1px solid hsl(var(--border-soft));
  border-radius: calc(var(--radius) - 4px);
  padding: 0.7rem 0.85rem;
  background: hsl(var(--background) / 0.82);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  text-align: left;
}

.select-trigger:hover {
  border-color: hsl(var(--border));
  background: hsl(var(--surface));
}

.select-trigger-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-trigger-icon {
  width: 0;
  height: 0;
  border-left: 0.42rem solid transparent;
  border-right: 0.42rem solid transparent;
  border-top: 0.52rem solid hsl(var(--muted-foreground));
  flex: 0 0 auto;
  transition: transform var(--transition-fast);
}

.select-shell.is-open .select-trigger-icon {
  transform: rotate(180deg);
}

.select-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 20;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 2px);
  background: linear-gradient(180deg, hsl(var(--surface)) 0%, hsl(var(--background)) 100%);
  box-shadow: 0 14px 32px hsl(22 18% 12% / 0.12);
  padding: 0.35rem;
  display: none;
}

.select-shell.is-open .select-menu {
  display: block;
}

.select-option {
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: calc(var(--radius) - 5px);
  padding: 0.72rem 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-align: left;
}

.select-option:hover,
.select-option:focus {
  background: hsl(var(--accent));
}

.select-option.is-selected {
  background: hsl(var(--accent));
}

.select-option-check {
  width: 1rem;
  color: hsl(var(--foreground));
  opacity: 0;
  flex: 0 0 1rem;
}

.select-option.is-selected .select-option-check {
  opacity: 1;
}

.list-card {
  padding: 0.95rem 1rem 1rem;
  text-align: left;
}

.list-card-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}

.alarm-banner {
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 2px);
  background: hsl(var(--accent));
  text-align: left;
  padding: 0.95rem 1rem 1rem;
}

.alarm-list,
.lap-list {
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.list-empty {
  padding: 0.85rem 0;
  color: hsl(var(--muted-foreground));
  text-align: left;
}

.alarm-item,
.lap-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
  align-items: center;
  border-top: 1px solid hsl(var(--border-soft));
  padding-top: 0.65rem;
}

.alarm-item:first-child,
.lap-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.alarm-item-title,
.lap-item-title,
.clock-city {
  margin: 0;
  font-weight: 500;
}

.clock-city-btn {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.clock-city-btn:hover,
.clock-city-btn:focus-visible {
  color: hsl(var(--focus));
}

.alarm-item-meta,
.lap-item-meta,
.clock-meta {
  margin: 0.18rem 0 0;
  color: hsl(var(--muted-foreground));
  font-size: 0.88rem;
}

.clock-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.78rem;
}

.clock-card {
  border: 1px solid hsl(var(--border-soft));
  border-radius: calc(var(--radius) + 2px);
  background: linear-gradient(180deg, hsl(var(--surface)) 0%, hsl(var(--background)) 100%);
  text-align: left;
  padding: 1rem;
}

.clock-time {
  margin: 0.5rem 0 0;
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: clamp(1.3rem, 5vw, 1.9rem);
  font-weight: 700;
}

.world-clock-detail {
  align-items: center;
}

.world-clock-detail-card {
  width: min(100%, 42rem);
}

.world-clock-detail.is-hidden,
.world-clock-browser.is-hidden {
  display: none;
}

.analog-clock-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 1rem;
}

.analog-clock-summary {
  width: min(100%, 68vw, 30rem);
  justify-content: center;
}

.analog-clock-card {
  width: min(100%, 68vw, 30rem);
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.analog-clock-face {
  position: relative;
  width: min(100%, 68vw, 30rem);
  aspect-ratio: 1;
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 35%, hsl(var(--surface)), hsl(var(--background)) 68%),
    hsl(var(--background));
  box-shadow:
    inset 0 1px 0 hsl(0 0% 100% / 0.6),
    inset 0 0 0 0.55rem hsl(var(--surface) / 0.55);
}

.analog-clock-markers,
.analog-clock-hand,
.analog-clock-center {
  position: absolute;
  inset: 0;
}

.analog-clock-tick {
  position: absolute;
  inset: 0;
  transform: rotate(var(--rotation));
}

.analog-clock-tick::before {
  content: "";
  position: absolute;
  top: 0.8rem;
  left: 50%;
  width: 2px;
  height: 0.7rem;
  transform: translateX(-50%);
  border-radius: 999px;
  background: hsl(var(--muted-foreground) / 0.35);
}

.analog-clock-number {
  position: absolute;
  width: 8rem;
  height: 8rem;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Inter, sans-serif;
  font-size: clamp(3.28rem, 8vw, 4.32rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: hsl(var(--foreground) / 0.7);
  transition:
    transform var(--transition-medium),
    color var(--transition-medium);
}

.analog-clock-number.is-current-hour {
  transform: translate(-50%, -50%) scale(1.32);
  color: hsl(var(--foreground));
}

.analog-clock-hand {
  inset: 50% auto auto 50%;
  width: var(--hand-width);
  height: var(--hand-length);
  transform: translate(-50%, -100%) rotate(var(--hand-rotation, 0deg));
  transform-origin: center bottom;
  border-radius: 999px;
  background: var(--hand-color);
  box-shadow: 0 1px 4px hsl(22 18% 12% / 0.16);
}

.analog-clock-hour {
  --hand-width: 6px;
  --hand-length: 26%;
  --hand-color: hsl(var(--foreground));
}

.analog-clock-minute {
  --hand-width: 4px;
  --hand-length: 40%;
  --hand-color: hsl(var(--foreground) / 0.82);
}

.analog-clock-second {
  --hand-width: 2px;
  --hand-length: 40%;
  --hand-color: hsl(var(--focus));
}

.analog-clock-center {
  inset: auto;
  top: 50%;
  left: 50%;
  width: 0.8rem;
  height: 0.8rem;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: hsl(var(--foreground));
  box-shadow: 0 0 0 0.22rem hsl(var(--background));
}

.converter-shell {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.converter-tabs {
  width: fit-content;
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  padding: 0.34rem;
  border: 1px solid hsl(var(--border-soft));
  border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(180deg, hsl(var(--surface)) 0%, hsl(var(--background)) 100%);
}

.converter-tab {
  border: 1px solid transparent;
  border-radius: calc(var(--radius) + 1px);
  background: transparent;
  color: hsl(var(--muted-foreground));
  font-family: Fredoka, sans-serif;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 0.72rem 1rem;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-fast);
}

.converter-tab:hover {
  border-color: hsl(var(--border-soft));
  background: hsl(var(--surface) / 0.7);
  color: hsl(var(--foreground));
}

.converter-tab.is-active {
  border-color: hsl(var(--border-soft));
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  box-shadow: 0 1px 2px hsl(22 18% 12% / 0.06);
}

.converter-tab:active {
  transform: scale(0.98);
}

.digital-clock-layout {
  align-items: center;
}

.digital-clock-card {
  width: min(100%, 32rem);
  aspect-ratio: 1;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.digital-clock-time {
  margin: 0;
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: clamp(4.8rem, 15vw, 8.8rem);
  font-weight: 700;
  letter-spacing: -0.08em;
  line-height: 0.95;
}

.digital-clock-date,
.digital-clock-zone {
  margin: 0.5rem 0 0;
  text-align: center;
}

.calendar-shell {
  border: 1px solid hsl(var(--border-soft));
  border-radius: calc(var(--radius) + 2px);
  background: linear-gradient(180deg, hsl(var(--surface)) 0%, hsl(var(--background)) 100%);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.calendar-toolbar {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 0.75rem;
  align-items: center;
}

.calendar-nav-btn {
  font-family: Inter, sans-serif;
  font-size: 1.15rem;
  font-weight: 900;
}

.calendar-month-label {
  margin: 0;
  font-family: Inter, sans-serif;
  font-size: clamp(1rem, 3vw, 1.3rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  text-align: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.45rem;
}

.calendar-weekday,
.calendar-day {
  min-height: 3rem;
  border-radius: calc(var(--radius) - 4px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.calendar-weekday {
  color: hsl(var(--muted-foreground));
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.calendar-day {
  border: 1px solid hsl(var(--border-soft));
  background: hsl(var(--background) / 0.7);
  font-weight: 500;
}

.calendar-day.is-today {
  border-color: hsl(var(--focus));
  background: hsl(var(--focus) / 0.12);
  color: hsl(var(--foreground));
  font-weight: 600;
}

.calendar-day.is-outside {
  border-style: dashed;
  color: hsl(var(--muted-foreground) / 0.55);
}

.counter-layout {
  align-items: center;
}

.counter-card {
  width: min(100%, 30rem);
  min-height: 18rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.counter-value {
  margin: 0;
  font-family: Inter, sans-serif;
  font-size: clamp(6rem, 22vw, 12rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 0.95;
}

.dice-layout {
  align-items: stretch;
}

.dice-layout .timer-readout-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.dice-layout .display-label,
.dice-layout .meta-copy {
  text-align: center;
}

.dice-hero {
  width: min(100%, 20rem);
  margin: 0.6rem auto 0;
}

.dice-hero.is-rolling .dice-face-large {
  animation: dice-wobble 0.18s linear infinite;
}

.dice-total-value {
  margin: 0.35rem 0 0;
  font-family: Inter, sans-serif;
  font-size: clamp(2.4rem, 8vw, 3.8rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
}

.dice-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.25rem, 1fr));
  gap: 0.75rem;
}

.dice-result-grid.is-rolling .dice-card {
  opacity: 0.88;
}

.dice-card {
  border: 1px solid hsl(var(--border-soft));
  border-radius: calc(var(--radius) + 2px);
  background: linear-gradient(180deg, hsl(var(--surface)) 0%, hsl(var(--background)) 100%);
  padding: 0.75rem 0.8rem 0.85rem;
  text-align: center;
}

.dice-card-label {
  margin: 0;
  color: hsl(var(--muted-foreground));
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dice-card-value {
  margin: 0.55rem 0 0;
  font-family: Inter, sans-serif;
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
}

.dice-face {
  display: block;
  width: 100%;
  aspect-ratio: 1;
}

.dice-card .dice-face {
  width: min(100%, 4.75rem);
  margin: 0.45rem auto 0;
}

.dice-face-large {
  filter: drop-shadow(0 10px 18px hsl(22 18% 12% / 0.08));
}

.dice-outline {
  fill: hsl(var(--background));
  stroke: hsl(var(--border));
  stroke-width: 4;
}

.dice-pip {
  fill: hsl(var(--foreground));
}

@keyframes dice-wobble {
  0% {
    transform: rotate(-5deg) scale(0.98);
  }

  50% {
    transform: rotate(5deg) scale(1.02);
  }

  100% {
    transform: rotate(-5deg) scale(0.98);
  }
}

.converter-unit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.converter-value-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.converter-column {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.converter-field {
  min-width: 0;
}

.swap-btn {
  width: 1.9rem;
  height: 1.9rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  align-self: start;
  justify-self: center;
  transform: translateY(1.85rem);
}

.swap-icon {
  width: 1.5rem;
  height: 1.5rem;
  object-fit: contain;
  filter: grayscale(1) brightness(0.22);
}

.swap-icon-vertical {
  display: none;
}

.alarm-remove-btn {
  min-width: 5.4rem;
}

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

  .analog-clock-layout {
    width: 100%;
  }

  .analog-clock-card {
    width: min(100%, 80vw, 26rem);
  }

  .analog-clock-face {
    width: min(100%, 80vw, 26rem);
  }

  .analog-clock-number {
    width: 6.8rem;
    height: 6.8rem;
    font-size: clamp(2.7rem, 9.2vw, 3.8rem);
  }

  .analog-clock-summary {
    width: min(100%, 80vw, 26rem);
  }

  .converter-shell {
    gap: 0.5rem;
  }

  .calendar-shell {
    padding: 0.85rem;
  }

  .counter-card {
    width: min(100%, 26rem);
    min-height: 16rem;
    padding: 1rem;
  }

  .counter-value {
    font-size: clamp(5rem, 24vw, 9rem);
  }

  .dice-result-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dice-hero {
    width: min(100%, 16rem);
  }

  .digital-clock-card {
    width: min(100%, 28rem);
    padding: 1rem;
  }

  .digital-clock-time {
    font-size: clamp(3.9rem, 17vw, 6.8rem);
  }

  .calendar-grid {
    gap: 0.35rem;
  }

  .calendar-weekday,
  .calendar-day {
    min-height: 2.55rem;
    font-size: 0.88rem;
  }

  .converter-unit-row {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 0.6rem;
  }

  .converter-value-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
  }

  .swap-btn {
    width: 1.5rem;
    height: 1.5rem;
  }

  .swap-icon {
    width: 1.15rem;
    height: 1.15rem;
  }
}

@media (max-width: 420px) {
  .app:not(.home-mode) .topbar {
    gap: 0.4rem;
  }

  .app:not(.home-mode) .headline {
    font-size: clamp(1.2rem, 6vw, 1.6rem);
  }

  .toy-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .analog-clock-card {
    width: min(100%, 88vw, 22rem);
    padding: 0.8rem;
  }

  .analog-clock-face {
    width: min(100%, 88vw, 22rem);
  }

  .analog-clock-number {
    width: 5.6rem;
    height: 5.6rem;
    font-size: clamp(2.2rem, 10.8vw, 3.2rem);
  }

  .analog-clock-summary {
    width: min(100%, 88vw, 22rem);
  }

  .calendar-toolbar {
    gap: 0.4rem;
  }

  .counter-card {
    width: min(100%, 21rem);
    min-height: 13.5rem;
    padding: 0.85rem;
  }

  .counter-value {
    font-size: clamp(4rem, 28vw, 7rem);
  }

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

  .dice-hero {
    width: min(100%, 13rem);
  }

  .dice-card .dice-face {
    width: min(100%, 4rem);
  }

  .digital-clock-card {
    width: min(100%, 22rem);
    padding: 0.8rem;
  }

  .digital-clock-time {
    font-size: clamp(3.2rem, 20vw, 5.2rem);
  }

  .calendar-shell {
    padding: 0.75rem;
  }

  .calendar-grid {
    gap: 0.28rem;
  }

  .calendar-weekday,
  .calendar-day {
    min-height: 2.15rem;
    font-size: 0.8rem;
  }
}
