:root { --bg:#fff; --fg:#111; --muted:#666; --line:#e3e3e3; --accent:#1a56db; --err:#c62828; }
@media (prefers-color-scheme: dark) {
  :root { --bg:#15171a; --fg:#eee; --muted:#9aa0a6; --line:#2c2f33; --accent:#7aa2f7; }
}
* { box-sizing: border-box; }
body { margin:0; background:var(--bg); color:var(--fg); font:16px/1.5 -apple-system,BlinkMacSystemFont,"Apple SD Gothic Neo","Malgun Gothic",sans-serif; }
main { max-width:560px; margin:0 auto; padding:16px 16px 110px; }
h1 { font-size:1.35rem; margin:8px 0 16px; }
label { display:block; margin:12px 0; color:var(--muted); font-size:.9rem; }
input, select, button {
  width:100%; padding:12px; font-size:16px;  /* 16px 미만이면 iOS 가 확대한다 */
  border:1px solid var(--line); border-radius:10px;
  background:var(--bg); color:var(--fg);
}
button { background:var(--accent); color:#fff; border:0; font-weight:600; }
.error { color:var(--err); }

.card { border:1px solid var(--line); border-radius:12px; padding:14px; margin:12px 0; }
.route { font-weight:700; font-size:1.1rem; }
.muted { color:var(--muted); }
.small { font-size:.85rem; }
button.secondary { background:transparent; color:var(--muted); border:1px solid var(--line); margin-top:10px; }
.fab { position:fixed; left:50%; transform:translateX(-50%); bottom:20px;
       width:min(528px,calc(100% - 32px)); padding:16px; text-align:center;
       background:var(--accent); color:#fff; border-radius:12px;
       text-decoration:none; font-weight:700; }

.timerange { display:flex; align-items:center; gap:8px; }
.timerange input { flex:1; }
label.pick { display:grid; grid-template-columns:auto 4.5rem 1fr auto; gap:10px;
             align-items:center; border:1px solid var(--line); border-radius:10px;
             padding:12px; margin:8px 0; color:var(--fg); }
label.pick input[type=checkbox] { width:22px; height:22px; }
.dep { font-weight:700; } .seat { color:var(--muted); font-size:.85rem; }

.tabbar { position:fixed; left:0; right:0; bottom:0; z-index:10;
          display:flex; background:var(--bg); border-top:1px solid var(--line);
          padding-bottom:env(safe-area-inset-bottom); }
.tabbar a, .tabbar button {
  /* 엄지로 누르는 영역이라 넉넉하게. 아이콘 1.6rem / 글자 .85rem 은
     iOS 권장 최소 터치 타겟(44pt)을 넘기는 높이를 만든다. */
  flex:1; display:flex; flex-direction:column; align-items:center; gap:5px;
  padding:12px 4px 14px; font-size:1.6rem; font-weight:600; line-height:1;
  color:var(--muted); text-decoration:none; background:none; border:0;
  min-height:60px; justify-content:center;
}
.tabbar a span, .tabbar button span { font-size:.85rem; font-weight:600; }
.tabbar a:active, .tabbar button:active { background:var(--line); }

.reservation { border:1px solid var(--accent); border-radius:12px; padding:14px; margin:12px 0; }
.reservation.due { background:rgba(198,40,40,.08); border-color:var(--err); }
.reservation .fare { font-weight:700; }
.reservation .hold { font-weight:700; }
.reservation.paid { border-color:var(--line); opacity:.7; }
.reservation.cancelled { border-color:var(--line); opacity:.5; }

table { width:100%; border-collapse:collapse; margin:8px 0 20px; font-size:.9rem; }
th, td { text-align:left; padding:8px 6px; border-bottom:1px solid var(--line); }
th { color:var(--muted); font-weight:600; }
tr.bad td { color:var(--err); }
.card.err { border-color:var(--err); }
pre { white-space:pre-wrap; word-break:break-all; margin:6px 0 0; color:var(--muted); }
.table-wrap { overflow-x:auto; }
@media (min-width:700px) { main { max-width:900px; } }

details.past { margin:20px 0; color:var(--muted); }
details.past summary { cursor:pointer; font-size:.9rem; font-weight:600; }
details.past > div { margin-top:8px; }

/* 표 안 액션 버튼(관리자 대기열 관리) — 셀 안에서 폭 100%짜리 버튼이
   쌓이면 표가 무너지니 폭을 좁히고 나란히 놓는다. */
.table-wrap td form { display:inline-block; width:auto; margin:2px 4px 2px 0; }
.table-wrap td button { width:auto; padding:6px 10px; font-size:.8rem; }
.log-filter { display:flex; gap:8px; align-items:center; margin:8px 0; }
.log-filter select, .log-filter input { width:auto; }
.log-filter button { width:auto; padding:10px 16px; }
