/* Brand tokens — swap these once the official palette is confirmed */
:root {
  --brand: #1C2022;        /* Mondo charcoal (logo background) */
  --brand-2: #2A3033;
  --orange: #ED7E25;       /* logo gradient start */
  --red: #B01E0F;          /* logo gradient end */
  --accent: var(--orange);
  --grad: linear-gradient(135deg, #ED7E25 0%, #C8321A 60%, #A9140E 100%);
  --ok: #1FA463;
  --warn: #E0A106;
  --bad: #D33F3F;
  --bg: var(--tg-theme-bg-color, #F4F6FA);
  --card: var(--tg-theme-secondary-bg-color, #FFFFFF);
  --text: var(--tg-theme-text-color, #0F172A);
  --muted: var(--tg-theme-hint-color, #64748B);
  --radius: 16px;
  --shadow: 0 2px 10px rgba(28,32,34,.10);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

.top { display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  background: var(--brand); color: #fff; }
.logo { height: 40px; width: 40px; object-fit: contain; }
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: .2px; }
.brand-sub { font-size: 12px; color: var(--orange); font-weight: 600; letter-spacing: .4px; }

main { padding: 14px; display: flex; flex-direction: column; gap: 12px; max-width: 520px; margin: 0 auto; }
.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 10px; font-size: 14px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.center { text-align: center; }

.hero { text-align: center; padding-top: 22px; }
.hero-name { font-size: 20px; font-weight: 700; }
.hero-pos { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.clock { font-size: 48px; font-weight: 700; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.date { color: var(--muted); margin-bottom: 12px; }
.status-pill { display: inline-block; padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: 13px;
  background: #ECEEF0; color: var(--brand); }
.status-pill.in { background: #E3F6EC; color: var(--ok); }
.status-pill.lunch { background: #FDEBDD; color: #B4520F; }
.status-pill.done { background: #EEF0F4; color: var(--muted); }

.geo-row { display: flex; align-items: center; gap: 10px; font-size: 14px; margin-bottom: 12px; }
.geo-dot { width: 10px; height: 10px; border-radius: 50%; background: #B8C0CC; flex: none; }
.geo-dot.ok { background: var(--ok); } .geo-dot.warn { background: var(--warn); } .geo-dot.bad { background: var(--bad); }

.actions { display: grid; gap: 10px; }
.btn { width: 100%; border: 0; border-radius: 14px; padding: 16px; font-size: 17px; font-weight: 700;
  background: var(--grad); color: #fff; cursor: pointer; box-shadow: 0 4px 14px rgba(176,30,15,.25); }
.btn.accent { background: var(--brand); box-shadow: none; }
.btn.secondary { background: #ECEEF0; color: var(--brand); box-shadow: none; }
.btn.danger { background: var(--bad); }
.btn:disabled { opacity: .5; }
.hint { font-size: 13px; color: var(--muted); margin: 10px 0 0; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #EEF1F5; font-size: 15px; }
.timeline li:last-child { border-bottom: 0; }
.timeline .t { font-variant-numeric: tabular-nums; color: var(--muted); }
.tag { font-size: 11px; padding: 2px 6px; border-radius: 6px; background: #FDEBDD; color: #B4520F; margin-left: 6px; }

.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 18px 0 28px; }
.spinner { width: 28px; height: 28px; border: 3px solid #E3E8F0; border-top-color: var(--orange);
  border-radius: 50%; margin: 10px auto; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.splash { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 70vh; gap: 16px; }
.splash img { width: 180px; }

.modal { position: fixed; inset: 0; background: rgba(28,32,34,.72); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.modal-card { background: var(--card); width: 100%; max-width: 520px; border-radius: 20px 20px 0 0; padding: 18px 16px 28px; display: grid; gap: 10px; }
.modal-title { font-weight: 700; font-size: 17px; text-align: center; }
.cam-wrap { width: 100%; aspect-ratio: 3/4; max-height: 52vh; border-radius: 16px; overflow: hidden; background: #000; }
.cam-wrap video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
textarea { width: 100%; border: 1px solid #D5DAE1; border-radius: 12px; padding: 12px; font: inherit; resize: vertical; }
.manual-link { display: block; text-align: center; font-size: 13px; color: var(--muted); margin-top: 10px; text-decoration: underline; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--brand); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; z-index: 60; max-width: 90%; text-align: center; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.toast.ok { background: var(--ok); } .toast.bad { background: var(--bad); }
.btn.busy { opacity: .6; pointer-events: none; }
