:root {
  --navy: #0f2a44; --navy-2: #1b3d5f; --bg: #eef2f6; --card: #fff; --text: #13202e; --muted: #5d6b7a;
  --line: #dde3ea; --green: #15803d; --green-2: #16a34a; --red: #c62828; --red-2: #dc2626; --amber: #b45309;
  --amber-bg: #fff7e6; --blue: #1d4ed8; --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); -webkit-tap-highlight-color: transparent; }
a { color: var(--blue); }
.topbar { background: var(--navy); color: #fff; padding: 14px 18px; display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 5; }
.topbar img { width: 30px; height: 30px; border-radius: 8px; }
.topbar .title { font-weight: 700; font-size: 17px; flex: 1; }
.topbar .sub { font-size: 12px; opacity: .75; font-weight: 500; }
.topbar a, .topbar button.link { color: #cfe0f1; font-size: 14px; text-decoration: none; background: none; border: 0; padding: 4px; cursor: pointer; }
main { max-width: 560px; margin: 0 auto; padding: 16px 16px 40px; }
main.wide { max-width: 1100px; }
.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; box-shadow: 0 1px 2px rgba(15,42,68,.06), 0 2px 10px rgba(15,42,68,.05); }
.card h2 { font-size: 15px; margin: 0 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.hello { font-size: 22px; font-weight: 700; margin: 4px 0 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }

/* Big punch button */
.punch-wrap { display: flex; flex-direction: column; align-items: center; padding: 10px 0 4px; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; background: #e9eef4; color: var(--muted); }
.status-pill .dot { width: 10px; height: 10px; border-radius: 50%; background: #9aa7b4; }
.status-pill.in { background: #e6f6ec; color: var(--green); }
.status-pill.in .dot { background: var(--green-2); box-shadow: 0 0 0 4px rgba(22,163,74,.18); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(22,163,74,.05); } }
.punch { margin: 18px 0 10px; width: 220px; height: 220px; border-radius: 50%; border: 0; color: #fff; font-size: 30px; font-weight: 800; letter-spacing: .01em; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; touch-action: manipulation;
  background: radial-gradient(circle at 35% 30%, var(--green-2), var(--green)); box-shadow: 0 10px 30px rgba(21,128,61,.35), inset 0 -6px 0 rgba(0,0,0,.12); transition: transform .08s; }
.punch.out { background: radial-gradient(circle at 35% 30%, var(--red-2), var(--red)); box-shadow: 0 10px 30px rgba(198,40,40,.35), inset 0 -6px 0 rgba(0,0,0,.12); }
.punch:active { transform: scale(.97); }
.punch:disabled { opacity: .6; }
.punch small { font-size: 14px; font-weight: 600; opacity: .9; }
.since { font-size: 15px; color: var(--muted); min-height: 22px; }
.since b { color: var(--text); }
.clock { font-variant-numeric: tabular-nums; font-size: 15px; color: var(--muted); }

.times { display: grid; grid-template-columns: 1fr 1fr 1fr; text-align: center; gap: 8px; }
.times .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.times .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); gap: 10px; }
.list li:first-child { border-top: 0; }
.list .d { font-weight: 600; }
.list .t { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.list .h { font-weight: 700; font-variant-numeric: tabular-nums; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: #eef2f6; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.tag.pending { background: var(--amber-bg); color: var(--amber); }
.tag.approved, .tag.on, .tag.done, .tag.sent { background: #e6f6ec; color: var(--green); }
.tag.denied, .tag.failed { background: #fdecec; color: var(--red); }
.tag.edited { background: #e8efff; color: var(--blue); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 13px 18px; font-size: 16px; font-weight: 700; cursor: pointer; text-decoration: none; background: var(--navy); color: #fff; touch-action: manipulation; }
.btn.block { display: flex; width: 100%; }
.btn.secondary { background: #e4ebf2; color: var(--navy); }
.btn.green { background: var(--green); }
.btn.red { background: var(--red); }
.btn.ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--line); }
.btn.sm { padding: 8px 12px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: .55; cursor: default; }

.banner { border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; font-size: 15px; display: flex; gap: 10px; align-items: flex-start; }
.banner.warn { background: var(--amber-bg); color: #6b3d00; border: 1px solid #f5d79b; }
.banner.info { background: #e8f0fb; color: #183b6b; border: 1px solid #c8d9f2; }
.banner .ico { font-size: 20px; line-height: 1.2; }
.banner a, .banner button { font-weight: 700; }

label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 6px; }
input, select, textarea { width: 100%; font: inherit; padding: 12px; border-radius: 10px; border: 1.5px solid #cfd8e2; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(29,78,216,.25); border-color: var(--blue); }
textarea { min-height: 90px; resize: vertical; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg input { display: none; }
.seg label { margin: 0; text-align: center; padding: 12px; border: 1.5px solid #cfd8e2; border-radius: 10px; cursor: pointer; background: #fff; }
.seg input:checked + label { border-color: var(--navy); background: var(--navy); color: #fff; }
.err { color: var(--red); font-weight: 600; min-height: 20px; margin-top: 10px; }

/* Install guide */
.steps { counter-reset: s; list-style: none; margin: 0; padding: 0; }
.step { position: relative; padding: 16px 16px 16px 62px; }
.step::before { counter-increment: s; content: counter(s); position: absolute; left: 16px; top: 16px; width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.step.done::before { content: "✓"; background: var(--green); }
.step h3 { margin: 4px 0 6px; font-size: 18px; }
.step p { margin: 6px 0; }
.step .ok { color: var(--green); font-weight: 700; }
.kbd { display: inline-block; padding: 1px 7px; border-radius: 6px; background: #eef2f6; border: 1px solid var(--line); font-weight: 700; }
.mock { margin: 10px 0 4px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 14px; background: #fafbfc; }
.mock .bar { background: #fff; padding: 8px 10px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.mock .url { flex: 1; background: #eef2f6; border-radius: 999px; padding: 5px 10px; color: var(--muted); font-size: 12px; }
.mock .dots { font-size: 20px; font-weight: 900; padding: 0 6px; border-radius: 8px; background: #ffe58a; line-height: 1.1; }
.mock .menu { margin: 6px 8px 8px auto; width: 70%; background: #fff; border-radius: 10px; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.mock .menu div { padding: 8px 12px; color: var(--muted); }
.mock .menu div.hl { background: #fff3c4; color: var(--text); font-weight: 700; }

/* Manager */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; }
.tabs button { flex: none; border: 0; background: #dfe6ee; color: var(--navy); padding: 9px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; cursor: pointer; }
.tabs button.active { background: var(--navy); color: #fff; }
.tabs .count { background: var(--red-2); color: #fff; border-radius: 999px; padding: 0 7px; margin-left: 4px; font-size: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 8px; border-top: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; border-top: 0; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.req { border-top: 1px solid var(--line); padding: 12px 0; }
.req:first-of-type { border-top: 0; }
.req .what { font-weight: 700; font-size: 16px; }
.req .why { background: #f5f7fa; border-radius: 8px; padding: 8px 10px; margin: 8px 0; font-size: 14px; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.filters label { margin: 0 0 4px; font-size: 12px; }
.filters input, .filters select { padding: 9px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; word-break: break-all; }
.days { display: flex; gap: 4px; flex-wrap: wrap; }
.days label { margin: 0; font-weight: 600; font-size: 13px; display: flex; gap: 3px; align-items: center; background: #eef2f6; border-radius: 8px; padding: 6px 8px; }
.days input { width: auto; }
dialog { border: 0; border-radius: 16px; padding: 18px; width: min(420px, 92vw); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(15,42,68,.45); }
.hide { display: none !important; }
@media (max-width: 640px) {
  table.resp thead { display: none; }
  table.resp tbody tr { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 6px 10px; border-top: 1px solid var(--line); padding: 10px 0; }
  table.resp tbody tr:first-child { border-top: 0; }
  table.resp td { display: block; border: 0; padding: 0; }
  table.resp td::before { content: attr(data-l); display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
  table.resp td[data-l=""]::before { display: none; }
  table.resp td[data-l=""] { text-align: right; align-self: end; }
  table.resp td[colspan] { grid-column: 1 / -1; }
}
.err:empty { min-height: 0; margin: 0; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; transition: .25s; background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; z-index: 50; max-width: 90vw; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.toast.err { background: var(--red); }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.inline-icon { width: 22px; height: 22px; vertical-align: -5px; border-radius: 5px; }
.ok { color: var(--green); font-weight: 700; }
input[type=checkbox], input[type=radio] { width: auto; }
