/* Good Boy — iOS lock-screen-notification look */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* The app toggles views via the `hidden` attribute. Author display rules
   (e.g. the flex forms below) would otherwise beat the UA's [hidden]
   { display: none } — origin trumps specificity — so lock it here. */
[hidden] { display: none !important; }

:root {
  --bg: #0b0b0f;
  --card: rgba(44, 44, 52, 0.82);
  --text: #f2f2f7;
  --dim: rgba(235, 235, 245, 0.6);
  --accent: #ffd60a;
}

html, body { height: 100%; }

body {
  background: var(--bg)
    radial-gradient(120% 90% at 50% 0%, #1c1c28 0%, var(--bg) 70%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
}

/* lock-screen clock above the notification */
#clock {
  margin-top: 9vh;
  font-size: clamp(56px, 18vw, 84px);
  font-weight: 200;
  letter-spacing: -1px;
  color: var(--text);
  text-align: center;
  user-select: none;
}

#app {
  width: 100%;
  max-width: 420px;
  margin-top: 5vh;
}

.card {
  background: var(--card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 0;
}

.app-icon {
  width: 22px;
  height: 22px;
  border-radius: 5px;
}

.app-name {
  font-size: 13px;
  letter-spacing: 0.4px;
  color: var(--dim);
  flex: 1;
}

.card-when {
  font-size: 13px;
  color: var(--dim);
}

.card-body { padding: 10px 16px 18px; }

.card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.card-text {
  font-size: 15px;
  line-height: 1.4;
  color: var(--text);
}

.card-text + .card-text { margin-top: 10px; }

/* the counter — big and unmissable */
#counter {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 6px 0 4px;
}

#days {
  font-size: clamp(72px, 26vw, 120px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -2px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

#days-label {
  font-size: 22px;
  font-weight: 500;
  color: var(--dim);
}

/* quiet state — earned silence, warm not empty */
.quiet-hero {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  margin: 6px 0 10px;
}

.quiet-hero #quiet-until { color: var(--accent); }

/* "I booked something" */
#book-btn {
  width: 100%;
  margin-top: 14px;
  background: var(--accent);
  border: none;
  border-radius: 12px;
  color: #1c1c1e;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  padding: 13px;
  cursor: pointer;
}

#book-btn:active { opacity: 0.7; }

/* debrief — the how'd-it-go prompt */
#debrief-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

#debrief-yes {
  background: var(--accent);
  border: none;
  border-radius: 12px;
  color: #1c1c1e;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  padding: 13px;
  cursor: pointer;
}

#debrief-no.ghost {
  background: rgba(118, 118, 128, 0.24);
  border: none;
  border-radius: 12px;
  color: var(--text);
  font: inherit;
  font-size: 17px;
  font-weight: 500;
  padding: 13px;
  cursor: pointer;
}

#debrief-yes:active,
#debrief-no.ghost:active { opacity: 0.7; }

/* onboarding + booking + debrief-note + past-date-log forms */
#onboard-form,
#book-form,
#debrief-note-form,
#log-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

#onboard-form input[type="date"],
#book-form input[type="date"],
#debrief-note-form input[type="text"],
#log-form input[type="date"],
#log-form input[type="text"] {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(118, 118, 128, 0.24);
  border: none;
  border-radius: 12px;
  color: var(--text);
  font: inherit;
  font-size: 17px;
  padding: 12px 14px;
  min-height: 46px;
  color-scheme: dark;
}

#onboard-form button,
#book-form button,
#debrief-note-form button,
#log-form button,
#push-enable {
  background: var(--accent);
  border: none;
  border-radius: 12px;
  color: #1c1c1e;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  padding: 13px;
  cursor: pointer;
}

#onboard-form button:active,
#book-form button:active,
#debrief-note-form button:active,
#log-form button:active,
#push-enable:active { opacity: 0.7; }

#book-confirm,
#debrief-ack,
#log-confirm {
  margin-top: 12px;
  font-weight: 600;
}

#push-enable {
  width: 100%;
  margin-top: 12px;
}

.card + .card { margin-top: 12px; }

/* quiet second-row actions: spontaneous log + the record */
#secondary-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

button.secondary {
  flex: 1;
  background: rgba(118, 118, 128, 0.24);
  border: none;
  border-radius: 10px;
  color: var(--dim);
  font: inherit;
  font-size: 14px;
  padding: 8px 12px;
  cursor: pointer;
}

button.secondary:active { opacity: 0.7; }

/* the record — history list */
#history-list {
  list-style: none;
  margin-top: 8px;
}

#history-list li {
  padding: 10px 0;
  border-bottom: 1px solid rgba(118, 118, 128, 0.24);
}

#history-list li:last-child { border-bottom: none; }

.history-date {
  display: block;
  font-size: 15px;
  font-weight: 600;
}

.history-note {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  line-height: 1.35;
  color: var(--dim);
}

.card-error {
  margin-top: 10px;
  font-size: 14px;
  color: #ff453a;
}

.card-note {
  margin-top: 8px;
  font-size: 13px;
  color: var(--dim);
}
