/* らーめん ふくろう軒 — 順番待ちWeb整理券デモ */
:root {
  --acc: #4F46E5;
  --acc-d: #3730A3;
  --acc-bg: #E0E7FF;
  --ok-bg: #D1FAE5;
  --warn-bg: #FEF3C7;
  --bg: #F4F6F8;
  --ink: #1F2937;
  --mut: #6B7280;
  --line: #E5E7EB;
  --danger: #DC2626;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--bg); color: var(--ink); font-family: 'Noto Sans JP', sans-serif; font-size: 15px; line-height: 1.6; }

/* ---- chrome ---- */
.demo-banner {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: #1F2937; color: #fff; font-size: 12px; padding: 7px 12px;
}
.bn-reset { background: none; border: 1px solid #6B7280; color: #D1D5DB; border-radius: 6px; font-size: 11px; padding: 3px 9px; cursor: pointer; font-family: inherit; }

.app-header {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, var(--acc), var(--acc-d));
  color: #fff; padding: 14px 16px;
}
.logo-emoji { font-size: 30px; }
.shop-name { font-weight: 900; font-size: 17px; line-height: 1.3; }
.shop-sub { font-size: 11px; opacity: .85; }
.role-switch { margin-left: auto; }
.role-switch select {
  appearance: none; background: rgba(255,255,255,.18); color: #fff;
  border: 1px solid rgba(255,255,255,.5); border-radius: 8px;
  font-family: inherit; font-size: 13px; font-weight: 700; padding: 7px 10px;
}
.role-switch option { color: #1F2937; }

main { padding: 14px 14px 86px; max-width: 560px; margin: 0 auto; }

/* ---- cards ---- */
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 12px; }
.card.slim { padding: 12px 14px; }
.sec-t { font-weight: 900; font-size: 14px; margin: 14px 0 8px; }
.card .sec-t, .card.slim .sec-t { margin-top: 0; }
.row-sp { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.mut { color: var(--mut); font-size: 12px; }

.badge { display: inline-block; font-size: 12px; font-weight: 900; border-radius: 999px; padding: 4px 12px; }
.bg-ok { background: var(--ok-bg); color: #047857; }
.bg-stop { background: #FEE2E2; color: #B91C1C; }

.notice { background: var(--bg); border-radius: 10px; padding: 11px 13px; font-size: 13px; margin-bottom: 10px; }
.notice b { font-weight: 900; }
.notice.ok-n { background: var(--ok-bg); color: #065F46; margin-bottom: 12px; }
.notice.warn-n { background: var(--warn-bg); color: #92400E; }
.notice.call-n { background: var(--ok-bg); color: #065F46; font-weight: 700; font-size: 15px; text-align: center; margin-top: 12px; }
.card .notice:last-child { margin-bottom: 0; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  border: 1px solid transparent; border-radius: 10px; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: 13px; padding: 9px 14px;
  background: var(--acc-bg); color: var(--acc-d);
}
.btn.primary { background: var(--acc); color: #fff; }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn.danger { background: #fff; border-color: #FCA5A5; color: var(--danger); }
.btn.big { font-size: 15px; padding: 14px 18px; border-radius: 12px; }
.btn.wide { width: 100%; margin-top: 8px; }
.btn.mini2 { font-size: 11px; padding: 6px 10px; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: default; }
.btnrow { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- board (cust take) ---- */
.board { text-align: center; background: linear-gradient(160deg, #EEF2FF, #fff); }
.board-lb { font-size: 12px; font-weight: 700; color: var(--mut); letter-spacing: .1em; }
.board-num { font-size: 72px; font-weight: 900; color: var(--acc-d); line-height: 1.15; }
.board-num small { font-size: 24px; margin-left: 2px; }
.board-sub { font-size: 13px; color: var(--mut); }
.board-sub b { color: var(--ink); font-size: 16px; }

/* ---- my ticket ---- */
.ticket { border: 2px dashed var(--acc); text-align: center; }
.ticket.called-tk { border-color: #059669; }
.tk-lb { font-size: 12px; color: var(--mut); font-weight: 700; letter-spacing: .1em; }
.tk-num { font-size: 84px; font-weight: 900; color: var(--acc-d); line-height: 1.1; }
.ticket.called-tk .tk-num { color: #047857; }
.tk-num small { font-size: 26px; margin-left: 2px; }
.tk-st { margin: 4px 0 8px; }
.tk-meta { font-size: 12px; color: var(--mut); }
.tk-wait { font-size: 14px; margin: 8px 0 10px; }
.tk-wait b { font-size: 20px; font-weight: 900; }
.tk-board { font-size: 12px; color: var(--mut); background: var(--bg); border-radius: 8px; padding: 7px; margin-bottom: 6px; }
@keyframes pulseB { 0%,100% { box-shadow: 0 0 0 0 rgba(5,150,105,.35); } 50% { box-shadow: 0 0 0 10px rgba(5,150,105,0); } }
.pulse { animation: pulseB 1.6s infinite; }

/* ---- status pills ---- */
.stpill { display: inline-block; font-size: 11px; font-weight: 900; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.st-new { background: var(--warn-bg); color: #B45309; }
.st-call { background: var(--ok-bg); color: #047857; }
.st-served { background: var(--acc-bg); color: var(--acc-d); }
.st-no { background: #FEE2E2; color: #B91C1C; }
.st-x { background: #E5E7EB; color: #6B7280; }
.tagchip { display: inline-block; font-size: 10px; font-weight: 900; background: var(--acc-bg); color: var(--acc-d); border-radius: 6px; padding: 1px 6px; vertical-align: 1px; }

/* ---- queue rows ---- */
.q-row { display: flex; align-items: center; gap: 12px; }
.q-row.q-called { border-color: #6EE7B7; background: #F0FDF9; }
.q-num { font-size: 26px; font-weight: 900; color: var(--acc-d); min-width: 56px; text-align: center; line-height: 1.2; }
.q-num small { font-size: 12px; }
.q-info { flex: 1; font-size: 13px; line-height: 1.5; }
.q-btns { display: flex; flex-direction: column; gap: 5px; align-items: stretch; min-width: 86px; }
.hist-row { display: flex; align-items: center; gap: 12px; }

/* ---- stats ---- */
.stats3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 6px; text-align: center; }
.stat-n { font-size: 24px; font-weight: 900; color: var(--acc-d); line-height: 1.2; }
.stat-u { font-size: 12px; margin-left: 1px; }
.stat-lb { font-size: 11px; color: var(--mut); }

.bar-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 12px; }
.bar-lb { min-width: 36px; color: var(--mut); text-align: right; }
.bar-tr { flex: 1; background: var(--bg); border-radius: 6px; height: 14px; overflow: hidden; }
.bar { display: block; height: 100%; background: var(--acc); border-radius: 6px; }
.bar-n { min-width: 34px; font-weight: 700; }

/* ---- info / steps ---- */
.info-row { display: flex; gap: 10px; font-size: 13px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.info-row:last-child { border-bottom: none; }
.info-lb { min-width: 9em; color: var(--mut); flex-shrink: 0; }
.step-row { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; padding: 5px 0; }
.step-n { font-weight: 900; color: var(--acc); flex-shrink: 0; }

/* ---- forms ---- */
.fld { margin-bottom: 12px; }
.fld label { display: block; font-size: 12px; font-weight: 700; color: var(--mut); margin-bottom: 4px; }
.fld input, .fld select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  font-family: inherit; font-size: 15px; padding: 11px 12px; background: #fff; color: var(--ink);
}

/* ---- tabbar ---- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  display: flex; background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 10px; font-weight: 700; color: var(--mut); padding: 8px 0 9px;
}
.tab.on { color: var(--acc); }
.tab-ic { font-size: 20px; line-height: 1; }

/* ---- sheet ---- */
#sheet { display: none; position: fixed; inset: 0; z-index: 60; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: #fff; border-radius: 18px 18px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  max-width: 560px; margin: 0 auto; max-height: 80vh; overflow-y: auto;
}
.sh-head { display: flex; align-items: center; justify-content: space-between; font-weight: 900; font-size: 16px; margin-bottom: 6px; }
.sh-sub { font-size: 12px; color: var(--mut); margin-bottom: 14px; }

/* ---- toast / spinner ---- */
#toast {
  position: fixed; bottom: 78px; left: 50%; transform: translateX(-50%) translateY(16px);
  background: #1F2937; color: #fff; font-size: 13px; font-weight: 700;
  border-radius: 999px; padding: 10px 18px; opacity: 0; pointer-events: none;
  transition: all .25s; z-index: 70; white-space: nowrap; max-width: 92vw;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.spin-overlay {
  display: none; position: fixed; inset: 0; z-index: 80;
  background: rgba(255,255,255,.7); align-items: center; justify-content: center; flex-direction: column; gap: 12px;
}
.spinner { width: 38px; height: 38px; border: 4px solid var(--acc-bg); border-top-color: var(--acc); border-radius: 50%; animation: sp .8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.spin-msg { font-size: 13px; font-weight: 700; color: var(--acc-d); }

/* ---- intro overlay ---- */
.overlay {
  display: flex; position: fixed; inset: 0; z-index: 90;
  background: rgba(17,24,39,.55); align-items: center; justify-content: center; padding: 20px;
}
.intro { background: #fff; border-radius: 18px; padding: 26px 22px; max-width: 380px; text-align: center; }
.demo-chip { display: inline-block; background: var(--warn-bg); color: #92400E; font-size: 11px; font-weight: 900; border-radius: 999px; padding: 4px 12px; margin-bottom: 10px; }
.intro-emoji { font-size: 44px; }
.intro h1 { font-size: 20px; font-weight: 900; margin: 6px 0 2px; }
.intro .sub { font-size: 12px; color: var(--mut); margin-bottom: 12px; }
.intro ul { list-style: none; text-align: left; font-size: 13px; margin: 0 0 14px; }
.intro li { padding: 4px 0; }

@media (min-width: 760px) {
  main { max-width: 560px; }
}
