:root {
  --bg: #0f0f10; --card: #1b1b1e; --fg: #f2f2f2; --muted: #9a9aa2; --line: #2c2c31;
  --accent: #3b82f6; --ok: #22c55e; --warn: #f59e0b; --bad: #ef4444;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
#app { max-width: 480px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 12px) 14px calc(env(safe-area-inset-bottom) + 24px); }
header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 17px; margin: 0 0 10px; }
h2.section { margin: 22px 0 8px; color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 12px; letter-spacing: .06em; }
h3 { margin: 0 0 6px; }
.hidden { display: none !important; }
.card { background: var(--card); border-radius: 14px; padding: 16px; margin-bottom: 12px; }
.hint { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.err { color: var(--bad); font-size: 14px; min-height: 1em; margin: 6px 0; }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 0; }
input[type=text], input[type=email], input[type=password] {
  display: block; width: 100%; margin-top: 4px; padding: 14px 12px; font-size: 18px; border-radius: 10px;
  border: 1px solid var(--line); background: #0f0f10; color: var(--fg); outline: none;
}
input:focus { border-color: var(--accent); }
label.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--fg); margin-top: 14px; }
label.check input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
button { font: inherit; border: 0; border-radius: 12px; padding: 12px 16px; cursor: pointer; width: 100%; margin-top: 10px; }
button.primary { background: var(--accent); color: #fff; font-weight: 600; }
button.big { padding: 20px; font-size: 20px; }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
button.small { width: auto; padding: 8px 12px; font-size: 13px; margin: 6px 6px 0 0; }
button:disabled { opacity: .5; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mono { font-variant-numeric: tabular-nums; color: var(--muted); }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: #333; color: #ddd; }
.badge.open { background: #1e3a8a; color: #bfdbfe; }
.badge.waiting_photo { background: #78350f; color: #fde68a; }
.badge.sending { background: #1e3a8a; color: #bfdbfe; }
.badge.sent { background: #14532d; color: #bbf7d0; }
.badge.no_photo, .badge.failed { background: #7f1d1d; color: #fecaca; }
.badge.cancelled { background: #333; color: #aaa; }
.item { background: var(--card); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.item .who { font-weight: 600; }
.item .meta { color: var(--muted); font-size: 13px; margin-top: 4px; word-break: break-all; }
.item .sub { font-size: 13px; margin-top: 6px; }
.item .sub.bad { color: var(--bad); }
.item .sub.ok { color: var(--ok); }
.thumbs { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; background: #000; }
.btn-link { text-decoration: none; }
.card .sub { font-size: 13px; margin-top: 6px; }
.card .sub.bad { color: var(--bad); }
.card .sub.ok { color: var(--ok); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); }
.dot.on { background: var(--ok); }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: flex; align-items: flex-end; z-index: 10; }
.modal-box { background: var(--card); width: 100%; max-height: 80vh; overflow: auto; border-radius: 16px 16px 0 0; padding: 16px 16px calc(env(safe-area-inset-bottom) + 16px); }
.pick { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pick img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; }
.pick .t { flex: 1; font-size: 13px; }
.pick button { width: auto; margin: 0; }
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 20px); transform: translateX(-50%);
  background: #fff; color: #000; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 20; max-width: 90vw; }
