:root {
  color: #17201e;
  background: #f4f6f5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18.667px;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  display: grid;
  /* 세로는 위 정렬로 고정한다. 가운데 정렬이면 타이머·알림음 영역이
     나타나고 사라질 때 카드 전체가 재중앙정렬되며 버튼이 위아래로 흔들린다. */
  place-items: start center;
  padding: 2rem 1.25rem;
  background: #f4f6f5;
  /* 한글은 음절이 아니라 단어(띄어쓰기) 단위로 줄바꿈한다. */
  word-break: keep-all;
  overflow-wrap: break-word;
}

button,
input,
summary {
  color: inherit;
  font: inherit;
  font-size: 1rem;
}

button,
summary {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid #0b6ecf;
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.app {
  width: min(100%, 42rem);
  padding: 2rem;
  border-radius: 1.4rem;
  background: #ffffff;
  box-shadow: 0 1rem 3rem rgba(23, 32, 30, 0.07);
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  margin: 0;
  font-size: 1.4rem;
  line-height: 1;
  letter-spacing: -0.03em;
}

.brand a {
  color: #17201e;
  font-weight: 800;
  text-decoration: none;
}

.tagline {
  margin: 0.55rem 0 0;
  color: #63706c;
  line-height: 1.4;
}

.language-switch {
  display: inline-flex;
  gap: 0.15rem;
  padding: 0.2rem;
  border-radius: 0.7rem;
  background: #f1f4f3;
}

.language-switch button {
  min-height: 2.35rem;
  padding: 0.4rem 0.65rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
}

.language-switch button[aria-pressed="true"] {
  background: #dfece7;
  color: #0d4c3f;
  font-weight: 750;
}

.status-panel {
  margin-top: 2.75rem;
}

.status-heading {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
}

.status-mark {
  width: 1rem;
  height: 1rem;
  margin-top: 0.4rem;
  border-radius: 50%;
  background: #b7791f;
  box-shadow: 0 0 0 0.3rem #f7ead6;
}

.status-panel[data-state="active"] .status-mark {
  background: #147a5f;
  box-shadow: 0 0 0 0.3rem #dcefe8;
}

.status-panel[data-state="idle"] .status-mark,
.status-panel[data-state="expired"] .status-mark {
  background: #66736f;
  box-shadow: 0 0 0 0.3rem #e5e9e7;
}

.status-panel[data-state="unsupported"] .status-mark,
.status-panel[data-state="error"] .status-mark {
  background: #b42318;
  box-shadow: 0 0 0 0.3rem #f8dfdc;
}

.status-copy h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.35rem);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.status-copy p {
  margin: 0.75rem 0 0;
  color: #4f5d59;
  line-height: 1.55;
}

.status-times {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
  margin: 1.65rem 0 0 2rem;
}

.time-label,
label {
  display: block;
  margin: 0 0 0.3rem;
  color: #63706c;
  font-weight: 650;
}

.time-value {
  display: block;
  color: #17201e;
  font-size: 1.55rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.primary-action {
  width: 100%;
  min-height: 3.3rem;
  margin-top: 1.6rem;
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: 0.75rem;
  background: #145c4b;
  color: #ffffff;
  font-weight: 800;
}

.primary-action[data-action="stop"] {
  background: #e6efec;
  color: #244039;
}

.primary-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.secondary-action {
  width: 100%;
  min-height: 2.9rem;
  margin-top: 0.6rem;
  padding: 0.6rem 1rem;
  border: 1px solid #cdd8d4;
  border-radius: 0.75rem;
  background: #ffffff;
  color: #244039;
  font-weight: 700;
}

.timer-section {
  margin-top: 3.25rem;
}

.section-title {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.timer-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.timer-options button {
  min-height: 3rem;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-radius: 0.7rem;
  background: #eef2f0;
  font-weight: 700;
}

.timer-options button[aria-pressed="true"] {
  background: #145c4b;
  color: #ffffff;
}

.custom-duration {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.75rem;
  align-items: end;
  margin-top: 1rem;
}

input {
  width: 100%;
  min-height: 3rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid #aab8b3;
  border-radius: 0.65rem;
  background: #ffffff;
}

.apply-timer {
  min-height: 3rem;
  padding: 0.55rem 1rem;
  border: 0;
  border-radius: 0.65rem;
  background: #25332f;
  color: #ffffff;
  font-weight: 750;
}

.chime-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 0.9rem;
  margin-top: 1.5rem;
}

.chime-control label {
  margin: 0;
}

.chime-control input[type="range"] {
  flex: 1 1 8rem;
  width: auto;
  min-height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  accent-color: #145c4b;
}

#chime-volume-value {
  min-width: 2.8rem;
  color: #63706c;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

#chime-preview {
  min-height: 2.6rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid #cdd8d4;
  border-radius: 0.6rem;
  background: #ffffff;
  color: #244039;
  font-weight: 700;
}

.limitations {
  margin-top: 3.25rem;
}

.limitations summary {
  color: #52605c;
  font-weight: 750;
}

.limitations-body {
  color: #4f5d59;
  line-height: 1.65;
}

.limitations-body ul {
  padding-left: 1.4rem;
}

.limitations-body li + li {
  margin-top: 0.45rem;
}

.faq {
  margin-top: 3.25rem;
}

.faq h2 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.faq-list {
  margin: 1.25rem 0 0;
}

.faq-item + .faq-item {
  margin-top: 1.4rem;
}

.faq-item dt {
  color: #17201e;
  font-weight: 700;
}

.faq-item dd {
  margin: 0.4rem 0 0;
  color: #4f5d59;
  line-height: 1.65;
}

.site-footer {
  margin-top: 2.75rem;
  text-align: center;
}

.site-footer a {
  color: #52605c;
  font-weight: 650;
}

.noscript {
  padding: 1rem;
  border-radius: 0.7rem;
  background: #fff2f1;
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  padding: 2rem;
  background: #070d0b;
  color: #5e6a65;
}

.ambient:focus-visible {
  outline: none;
}

.ambient.cursor-hidden {
  cursor: none;
}

.ambient-clock {
  max-width: 100%;
  font-size: clamp(2.5rem, 11vw, 8.5rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  line-height: 1.1;
  text-align: center;
  overflow-wrap: anywhere;
}

.ambient-remaining {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: #4f5b56;
}

.ambient-label {
  font-weight: 650;
}

.ambient-remaining-time {
  font-size: clamp(1.5rem, 5vw, 2.75rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ambient-note {
  max-width: 34rem;
  margin: 0;
  text-align: center;
  line-height: 1.5;
}

.ambient-hint {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 1.75rem;
  margin: 0;
  text-align: center;
  color: #45504b;
}

.ambient.cursor-hidden .ambient-hint {
  visibility: hidden;
}

@media (max-width: 560px) {
  body {
    padding: 0;
  }

  .app {
    min-height: 100vh;
    padding: 1.25rem;
    border-radius: 0;
    box-shadow: none;
  }

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

  .custom-duration {
    grid-template-columns: 1fr 1fr;
  }

  .apply-timer {
    grid-column: 1 / -1;
  }
}
