:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  color: #19362c;
  background: #e9f5ef;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 255, 255, .8), transparent 35%),
    linear-gradient(145deg, #edf8f3, #e4f2f0 55%, #f6f7ee);
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.card {
  width: min(100%, 480px);
  padding: clamp(26px, 7vw, 48px);
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 32px;
  background: rgba(255, 255, 255, .8);
  box-shadow: 0 24px 70px rgba(49, 102, 82, .14);
  backdrop-filter: blur(18px);
}

.eyebrow {
  color: #5e9a7d;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
}

h1 { margin: 12px 0 8px; font-size: clamp(28px, 8vw, 42px); letter-spacing: -.04em; }
.subtitle { margin: 0; color: #71867d; font-size: 15px; }

.time-panel { margin: 34px 0 16px; text-align: center; }
.clock { font-variant-numeric: tabular-nums; font-size: clamp(48px, 14vw, 76px); font-weight: 720; letter-spacing: -.07em; line-height: 1; }
.countdown { margin-top: 12px; color: #6e837a; font-size: 14px; }

.status { min-height: 24px; margin: 12px 0 16px; padding: 10px 12px; border-radius: 12px; background: #f2f8f4; color: #497262; font-size: 13px; text-align: center; }
.status[data-tone="error"] { background: #fff3f0; color: #a95448; }
.status[data-tone="success"] { background: #e5f6e9; color: #287449; }

.actions { display: grid; gap: 10px; }
.button { min-height: 48px; border: 0; border-radius: 15px; padding: 12px 16px; cursor: pointer; font-weight: 700; transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
.button:active { transform: translateY(1px); }
.button:focus-visible, input:focus-visible, .modal-close:focus-visible { outline: 3px solid rgba(63, 143, 106, .35); outline-offset: 2px; }
.button-primary { background: #2f8f65; color: #fff; box-shadow: 0 10px 22px rgba(47, 143, 101, .2); }
.button-primary:hover { background: #277a56; }
.button-secondary { background: #e8f2ec; color: #347457; }
.button-secondary:hover { background: #dceee4; }

.setup-note { margin: 16px 0 24px; color: #82958d; font-size: 12px; line-height: 1.6; text-align: center; }
.settings-group { margin: 0; padding: 18px 0 0; border: 0; border-top: 1px solid #e1eee7; }
.settings-group legend { padding: 0; color: #365d4c; font-size: 14px; font-weight: 800; }
.time-inputs { display: flex; align-items: end; gap: 12px; margin-top: 14px; }
.time-inputs label { flex: 1; color: #7a9086; font-size: 12px; }
.time-inputs input { display: block; width: 100%; margin-top: 7px; border: 1px solid #d7e8df; border-radius: 12px; padding: 12px; background: #fbfefc; color: #234d3c; font-size: 18px; text-align: center; }
.time-separator { padding-bottom: 13px; color: #9aad9f; font-size: 13px; }
.switch-row { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 18px; }
.switch-label { display: flex; align-items: center; gap: 8px; color: #527365; font-size: 13px; }
.switch-label input { width: 18px; height: 18px; accent-color: #2f8f65; }
.tips { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-top: 26px; color: #8da197; font-size: 11px; }
.tips span { padding: 5px 9px; border-radius: 999px; background: rgba(231, 242, 235, .75); }

.modal-backdrop { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(25, 54, 44, .24); backdrop-filter: blur(5px); }
.modal-backdrop[hidden] { display: none; }
.modal { position: relative; width: min(100%, 380px); padding: 34px 24px 24px; border-radius: 28px; background: #fff; box-shadow: 0 24px 80px rgba(19, 56, 40, .25); text-align: center; }
.modal-close { position: absolute; top: 12px; right: 14px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: #85a095; font-size: 25px; cursor: pointer; }
.modal-icon { color: #e7b85c; font-size: 38px; }
.modal h2 { margin: 8px 0; font-size: 27px; }
.modal p { margin: 0 0 22px; color: #71867d; font-size: 14px; }
.modal-actions { display: grid; gap: 10px; }

@media (min-width: 640px) {
  .actions-primary { grid-template-columns: 1.35fr 1fr; }
}
