* { box-sizing: border-box; }
:root {
  --bg: #fff7ed;
  --bg2: #ffedd5;
  --ink: #431407;
  --ink-soft: #7c2d12;
  --accent: #ea580c;
  --accent-dark: #c2410c;
  --card: #ffffff;
  --ok: #16a34a;
  --bad: #dc2626;
  --line: #fed7aa;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(160deg, var(--bg), var(--bg2));
  min-height: 100vh;
  color: var(--ink);
}

.hidden { display: none !important; }

.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; max-width: 46rem; margin: 0 auto;
}
.logo { font-weight: 800; font-size: 1.25rem; }
.user-box { display: flex; align-items: center; gap: .5rem; color: var(--ink-soft); font-size: .9rem; }

.container { max-width: 46rem; margin: 0 auto; padding: 0 1.25rem 3rem; }
.container.narrow { max-width: 28rem; text-align: center; padding-top: 2rem; }

h1 { font-size: 2rem; margin: 0 0 .5rem; }
h1 em { color: var(--accent); font-style: normal; }
.tagline { color: var(--ink-soft); margin: 0 0 1.5rem; line-height: 1.5; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 1rem; padding: 1.25rem; text-align: left;
  box-shadow: 0 1px 3px rgba(67, 20, 7, .06);
}

label { display: block; font-size: .85rem; font-weight: 600; color: var(--ink-soft); margin: .75rem 0 .3rem; }
input[type="tel"], input[type="text"], input[type="time"], input[type="number"] {
  width: 100%; padding: .7rem .8rem; font-size: 1rem;
  border: 1px solid var(--line); border-radius: .6rem; background: #fffdfa; color: var(--ink);
}
input:focus { outline: 2px solid var(--accent); border-color: transparent; }

.btn {
  border: 0; border-radius: .6rem; padding: .7rem 1rem; font-size: .95rem;
  font-weight: 700; cursor: pointer; background: #f5e7d8; color: var(--ink);
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-light { background: #fff; color: var(--bad); }
.btn-danger { background: transparent; color: var(--bad); }
.full { width: 100%; margin-top: .75rem; }

.error { color: var(--bad); font-size: .9rem; margin: .75rem 0 0; }
.dev-note { background: #fef3c7; border-radius: .5rem; padding: .5rem .75rem; font-size: .85rem; margin-top: .75rem; }
.hint { color: var(--ink-soft); font-size: .8rem; }
.empty { color: var(--ink-soft); }

.section { margin-top: 2rem; }
.section-head { display: flex; align-items: center; justify-content: space-between; }
.section h2 { font-size: 1.2rem; margin: 0 0 .75rem; }

.checks-list { display: flex; flex-direction: column; gap: .75rem; margin-top: .75rem; }
.check-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 1rem;
  padding: 1rem 1.25rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.check-card.inactive { opacity: .55; }
.check-time { font-size: 1.5rem; font-weight: 800; min-width: 5.5rem; }
.check-info { flex: 1; min-width: 10rem; }
.check-name { font-weight: 700; }
.check-meta { color: var(--ink-soft); font-size: .8rem; margin-top: .15rem; }
.check-actions { display: flex; gap: .25rem; align-items: center; }

.status-chip {
  font-size: .75rem; font-weight: 700; border-radius: 999px; padding: .25rem .6rem;
  background: #f3f4f6; color: #374151;
}
.status-chip.sent { background: #fef3c7; color: #92400e; }
.status-chip.confirmed, .status-chip.confirmed_late { background: #dcfce7; color: #166534; }
.status-chip.escalated { background: #fee2e2; color: #991b1b; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 480px) { .form-grid { grid-template-columns: 1fr; } }

.day-pills { display: flex; gap: .35rem; flex-wrap: wrap; }
.day-pill {
  border: 1px solid var(--line); background: #fffdfa; color: var(--ink-soft);
  border-radius: 999px; padding: .4rem .7rem; font-size: .8rem; font-weight: 700; cursor: pointer;
}
.day-pill.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.checkline { display: flex; align-items: center; gap: .5rem; font-weight: 500; margin-top: 1rem; }
.checkline input { width: auto; }
.form-actions { display: flex; gap: .5rem; margin-top: 1rem; }

.feed-list { display: flex; flex-direction: column; gap: .5rem; }
.feed-item {
  background: var(--card); border: 1px solid var(--line); border-radius: .75rem;
  padding: .6rem .9rem; display: flex; align-items: center; gap: .75rem; font-size: .9rem;
}
.feed-when { color: var(--ink-soft); font-size: .78rem; margin-left: auto; white-space: nowrap; }

.dev-list { display: flex; flex-direction: column; gap: .5rem; }
.dev-item {
  background: #1f2937; color: #e5e7eb; border-radius: .75rem; padding: .6rem .9rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem;
  white-space: pre-wrap; word-break: break-word;
}
.dev-item .to { color: #fbbf24; }
.dev-item a { color: #7dd3fc; }

.alarm-banner {
  position: sticky; top: 0; z-index: 10;
  background: var(--bad); color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem 1.25rem;
  animation: pulse 1s infinite alternate;
}
.alarm-text { font-weight: 800; }
@keyframes pulse { from { filter: brightness(1); } to { filter: brightness(1.25); } }

.site-footer { text-align: center; color: var(--ink-soft); font-size: .8rem; padding: 2rem 0; }
