:root {
  --bg: #0d1420; --card: #172131; --line: #26344a; --text: #eef3fa; --muted: #93a4bb;
  --accent: #3aa0ff; --ok: #34c77b; --warn: #f0a33a; --bad: #ff5d5d; --on: #2a6fd6;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Sukhumvit Set", "Thonburi", "Noto Sans Thai", sans-serif;
  padding: env(safe-area-inset-top) 16px calc(env(safe-area-inset-bottom) + 24px);
  -webkit-user-select: none; user-select: none;
}
header { display: flex; align-items: center; justify-content: space-between; padding: 14px 0 10px; }
.title { font-size: 22px; font-weight: 700; letter-spacing: .2px; }
.pill { font-size: 14px; padding: 6px 12px; border-radius: 999px; background: var(--line); color: var(--muted); white-space: nowrap; }
.pill.ok { background: rgba(52,199,123,.18); color: var(--ok); }
.pill.warn { background: rgba(240,163,58,.18); color: var(--warn); }
.pill.bad { background: rgba(255,93,93,.16); color: var(--bad); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin: 0 0 14px; }
.card h2 { font-size: 17px; margin: 0 0 12px; color: var(--muted); font-weight: 600; }
.hint { border-color: var(--accent); }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap { gap: 12px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.big-num { font-size: 52px; font-weight: 700; line-height: 1; }
.big-num small { font-size: 22px; margin-left: 2px; color: var(--muted); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 16px 0 10px; }
.facts div { display: flex; flex-direction: column; min-width: 0; }
.facts .k { font-size: 13px; color: var(--muted); }
.facts span:last-child, .facts a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a { color: var(--accent); text-decoration: none; }
button { font: inherit; color: var(--text); background: var(--line); border: 0; border-radius: 14px; cursor: pointer; }
button:active { transform: scale(.97); }
button:disabled { opacity: .45; }
.big { flex: 1; min-height: 64px; font-size: 20px; font-weight: 600; }
.primary { background: var(--on); }
.round { width: 52px; height: 52px; border-radius: 50%; font-size: 24px; }
.big-ico { width: 72px; height: 72px; font-size: 36px; }
.temp { display: flex; align-items: center; justify-content: center; gap: 28px; margin: 18px 0 6px; }
.tval { font-size: 46px; font-weight: 700; min-width: 90px; text-align: center; }
.seats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.seat-name { font-weight: 700; margin-bottom: 6px; }
.lbl { font-size: 13px; color: var(--muted); margin: 8px 0 4px; }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; min-height: 54px; font-size: 17px; }
.seg button.cur { background: var(--on); }
.seg[data-kind=heat] button.cur { background: #c4542b; }
.pending { position: relative; }
.pending::after { content: ""; position: absolute; inset: 4px; border-radius: 10px; border: 2px solid rgba(255,255,255,.5); border-top-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#feed { list-style: none; margin: 0; padding: 0; }
#feed li { padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
#feed li:first-child { border-top: 0; }
#feed .ok { color: var(--ok); } #feed .bad { color: var(--bad); } #feed .warn { color: var(--warn); }
input { width: 100%; font: 20px ui-monospace, Menlo, monospace; letter-spacing: 1px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); margin: 8px 0 12px; text-transform: uppercase; -webkit-user-select: text; user-select: text; }
.link { background: none; color: var(--muted); text-decoration: underline; padding: 8px 0; }
#toast { position: fixed; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom) + 16px); background: #24334b; padding: 14px 16px; border-radius: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.4); }
.ico { display: inline-block; }
#pairBtn { width: 100%; }
