:root {
  --primary: #053668;
  --accent: #29a9e0;
  --bg: #f3f8fc;
  --card: #ffffff;
  --text: #14223a;
  --muted: #5a6b82;
  --line: #d9e3ee;
  --ok: #157a46;
  --warn: #9a5b00;
  --bad: #b42318;
  --radius: 16px;
  --tap: 56px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
.boot, .center-page { max-width: 520px; margin: 0 auto; padding: 48px 20px; text-align: center; color: var(--muted); }
.center-page h1 { color: var(--text); font-size: 24px; }

.wrap { max-width: 560px; margin: 0 auto; padding: 12px max(16px, env(safe-area-inset-left, 0px)) 120px max(16px, env(safe-area-inset-right, 0px)); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0 4px; }
.top img.logo { height: 60px; width: auto; background: #fff; border-radius: 12px; padding: 4px 8px; box-shadow: 0 1px 2px rgba(5, 30, 60, .08); }
.top .back { min-height: 44px; padding: 0 14px; border: 0; background: transparent; color: var(--primary); font-weight: 600; }
h1 { font-size: 26px; line-height: 1.2; margin: 14px 0 6px; text-wrap: balance; }
.card > h2:first-child { margin-top: 0; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 26px 0 10px; }
p.sub { color: var(--muted); margin: 0 0 12px; }

.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: 0 1px 2px rgba(5, 30, 60, .08); margin: 12px 0; }
.big {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  min-height: 72px; border: 0; border-radius: var(--radius); background: var(--primary); color: #fff;
  font-size: 21px; font-weight: 700; box-shadow: 0 4px 14px rgba(5, 54, 104, .25);
}
.big:active { transform: translateY(1px); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap);
  padding: 0 18px; border-radius: 14px; border: 2px solid var(--primary); background: #fff; color: var(--primary); font-weight: 650;
}
.btn.solid { background: var(--primary); color: #fff; }
.btn[disabled], .big[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1 1 0; min-width: 0; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice {
  min-height: var(--tap); padding: 10px 12px; border-radius: 14px; border: 2px solid var(--line); background: #fff;
  font-weight: 600; text-align: center; line-height: 1.2;
}
.choice[aria-pressed="true"] { border-color: var(--primary); background: var(--primary); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .choice { min-height: 48px; padding: 8px 14px; flex: 0 0 auto; }

.status { display: flex; align-items: center; gap: 12px; }
.status .dot { width: 14px; height: 14px; border-radius: 50%; flex: 0 0 auto; background: var(--ok); }
.status.busy .dot { background: var(--accent); animation: pulse 1.2s infinite; }
.status.wait .dot { background: var(--warn); }
.status.bad .dot { background: var(--bad); }
@keyframes pulse { 50% { opacity: .35; } }
.bar { height: 8px; background: var(--line); border-radius: 8px; overflow: hidden; margin-top: 10px; }
.bar > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.thumb { background: #fff; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.thumb .pic { position: relative; aspect-ratio: 4 / 3; background: #e7eef6; display: flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 600; }
.thumb .pic img { width: 100%; height: 100%; object-fit: cover; }
.thumb .x { position: absolute; top: 6px; right: 6px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 20px; }
.seg { display: flex; }
.seg button { flex: 1; min-height: 48px; border: 0; border-top: 1px solid var(--line); background: #fff; font-size: 14px; font-weight: 650; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.adding-as { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.adding-as .seg { flex: 1; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.adding-as .seg button { border-top: 0; }

input[type=text], input[type=date], input[type=time], input[type=email] {
  width: 100%; min-height: var(--tap); padding: 0 14px; border-radius: 14px; border: 2px solid var(--line); background: #fff;
}
input:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.check {
  display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: var(--radius); background: #fff;
  border: 2px solid var(--line); font-weight: 600;
}
.check input { width: 28px; height: 28px; flex: 0 0 auto; margin: 0; accent-color: var(--primary); }
.check.on { border-color: var(--ok); }
.hint { font-size: 14px; color: var(--muted); margin: 8px 2px 0; }
.typed { margin-top: 10px; }
.voice-start { margin-top: 10px; }
.date-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fff; border-radius: var(--radius); padding: 8px 8px 8px 16px; font-weight: 600; }
.voice { display: flex; align-items: center; gap: 10px; }
.rec { color: var(--bad); font-weight: 700; }

.sticky {
  position: fixed; left: 0; right: 0; bottom: 0; padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: linear-gradient(to top, var(--bg) 70%, rgba(243, 248, 252, 0));
}
.sticky .inner { max-width: 560px; margin: 0 auto; }

.jobs { list-style: none; padding: 0; margin: 0; }
.jobs li { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.jobs li:last-child { border-bottom: 0; }
.jobs .what { font-weight: 650; }
.jobs .meta { color: var(--muted); font-size: 14px; }
.pill { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: #e5f4ec; color: var(--ok); white-space: nowrap; align-self: center; }
.pill.wait { background: #fff1dc; color: var(--warn); }

.banner { padding: 14px 16px; border-radius: 14px; background: #fde8e6; color: var(--bad); font-weight: 600; margin: 12px 0; }
.banner.info { background: #e6f3fb; color: var(--primary); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--tap); }
.toggle input { width: 26px; height: 26px; accent-color: var(--primary); }
.links { display: flex; justify-content: center; gap: 18px; margin-top: 18px; }
.links button { border: 0; background: none; color: var(--primary); font-weight: 600; min-height: 44px; }
.overlay { position: fixed; inset: 0; background: rgba(10, 25, 45, .45); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 5; }
.overlay .card { max-width: 360px; width: 100%; text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.file-input { display: none; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
