/* ミセすけっと 画面の共通（iOS の作法に寄せる：大きい見出し・角丸のまとまり・下のタブ・下から出る窓） */
:root {
  /* 2026-11-18 作り直し：藍（店の暖簾の色）を主役に。手本＝ダイニー・Airレジ・スマレジの管理画面（白いまとまり・青みの灰の地・PC は左に道具の列） */
  --tint: #2450a6;          /* 藍：選んでいる物・主なボタン（白い文字と 7:1） */
  --tint-soft: #e6edfa;
  --shu: #d23f31;           /* 朱：新しい注文・知らせ */
  --bg: #f2f4f8;
  --card: #ffffff;
  --fill: #e7ebf1;
  --text: #172033;
  --sub: #5a6478;
  --sep: #dde2ea;
  --green: #1b7f4b;
  --orange: #b35900;
  --red: #c8231a;
  --blue: #2450a6;
  --shadow: 0 10px 30px rgba(23, 32, 51, .16);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --side-w: 232px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --tint: #86a8ff; --tint-soft: #1b2849; --shu: #ff6b5c;
    --bg: #0e131b; --card: #182131; --fill: #233047;
    --text: #edf1f8; --sub: #9ba7bc; --sep: #2b3649;
    --green: #3ccf7f; --orange: #ffa53d; --red: #ff6157; --blue: #86a8ff;
  }
}
:root[data-theme="dark"] {
  --tint: #86a8ff; --tint-soft: #1b2849; --shu: #ff6b5c;
  --bg: #0e131b; --card: #182131; --fill: #233047;
  --text: #edf1f8; --sub: #9ba7bc; --sep: #2b3649;
  --green: #3ccf7f; --orange: #ffa53d; --red: #ff6157; --blue: #86a8ff;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  font-size: 17px; line-height: 1.45;
  padding-bottom: calc(84px + var(--safe-b));
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.hidden { display: none !important; }

/* 上の帯と大きい見出し */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  padding: 10px 16px 8px; display: flex; align-items: center; gap: 8px; min-height: 44px;
}
.nav .title { font-weight: 600; flex: 1; text-align: center; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.nav .side { min-width: 70px; display: flex; gap: 4px; }
.nav .side.r { justify-content: flex-end; }
.large-title { font-size: 30px; font-weight: 800; letter-spacing: .02em; margin: 4px 16px 12px; line-height: 1.15; }
.sub { color: var(--sub); font-size: 15px; }
.wrap { max-width: 980px; margin: 0 auto; }

/* ボタン */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 50px; padding: 0 20px; border-radius: 12px; border: 0;
  background: var(--tint); color: #fff; font-weight: 600; font-size: 17px;
  transition: transform .12s, opacity .12s;
}
.btn:active { transform: scale(.97); opacity: .85; }
.btn.block { width: 100%; }
.btn.gray { background: var(--fill); color: var(--text); }
.btn.soft { background: var(--tint-soft); color: var(--tint); }
.btn.green { background: var(--green); }
.btn.red { background: var(--red); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 15px; border-radius: 10px; }
.btn:disabled { opacity: .4; }
.link { text-decoration: none; background: none; border: 0; color: var(--tint); font-size: 17px; padding: 8px 4px; min-height: 44px; }

/* まとまり（inset grouped list） */
.section-h { color: var(--sub); font-size: 13px; font-weight: 700; margin: 22px 30px 8px; }
.group { background: var(--card); border-radius: 14px; margin: 0 16px; overflow: hidden; box-shadow: 0 0 0 1px var(--sep); }
.row {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 10px 16px; background: var(--card);
}
.row + .row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--sep); }
.row .grow { flex: 1; min-width: 0; }
.row .meta { color: var(--sub); font-size: 15px; }
.row .chev::after { content: "›"; color: var(--sub); font-size: 22px; margin-left: 4px; }
.row.tap { cursor: pointer; }
.row.tap:active { background: var(--fill); }
.footnote { color: var(--sub); font-size: 13px; margin: 6px 32px 0; }

/* 左にスワイプして出るボタン（iOS のメールと同じ。削除は赤で一番右） */
.swipe { position: relative; overflow: hidden; }
.swipe + .swipe .row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--sep); }
.swipe .row { transition: transform .22s ease; z-index: 1; touch-action: pan-y; }
.swipe .acts { position: absolute; inset: 0 0 0 auto; display: flex; }
.swipe:not(.sw) .acts { visibility: hidden; }
.swipe .acts button { border: 0; color: #fff; font-weight: 600; font-size: 15px; width: 78px; }

/* 入力 */
.field { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 16px; position: relative; background: var(--card); }
.field + .field::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--sep); }
.field label { width: 7.5em; flex: none; font-size: 16px; }
.field input, .field select, .field textarea {
  flex: 1; min-width: 0; border: 0; background: transparent; font-size: 17px; padding: 10px 0; outline: none; text-align: right;
}
.field textarea { text-align: left; resize: vertical; min-height: 70px; }
.field input:focus-visible, .field select:focus-visible { outline: none; }
.field:focus-within { box-shadow: inset 3px 0 0 var(--tint); }
.toggle { appearance: none; width: 51px; height: 31px; border-radius: 16px; background: var(--fill); position: relative; flex: none; transition: background .2s; cursor: pointer; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.25); transition: transform .2s; }
.toggle:checked { background: var(--green); }
.toggle:checked::after { transform: translateX(20px); }

/* 分け方の切り替え（segmented control） */
.seg { display: flex; background: var(--fill); border-radius: 9px; padding: 2px; margin: 0 16px 12px; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.seg button { flex: 1 0 auto; border: 0; background: transparent; border-radius: 7px; padding: 7px 12px; font-size: 15px; font-weight: 500; white-space: nowrap; }
.seg button[aria-selected="true"] { background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.15); font-weight: 600; }

/* 下のタブ */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; justify-content: space-around;
  background: color-mix(in srgb, var(--card) 90%, transparent);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid var(--sep); padding: 6px 4px calc(6px + var(--safe-b));
}
.tabbar button { flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--sub); padding: 4px 0; min-height: 50px; position: relative; }
.tabbar button svg { width: 26px; height: 26px; }
.tabbar button[aria-selected="true"] { color: var(--tint); }
.badge { position: absolute; top: 0; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; line-height: 18px; text-align: center; }

/* 下から出る窓（sheet） */
.sheet-bg { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.35); opacity: 0; transition: opacity .25s; }
.sheet-bg.on { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-height: 92dvh; overflow-y: auto;
  background: var(--bg); border-radius: 14px 14px 0 0; padding: 0 0 calc(20px + var(--safe-b));
  transform: translateY(100%); transition: transform .3s cubic-bezier(.2,.8,.2,1);
  max-width: 640px; margin: 0 auto;
}
.sheet.on { transform: none; }
.sheet .grab { width: 36px; height: 5px; border-radius: 3px; background: var(--sep); margin: 8px auto 0; }
.sheet .sheet-nav { display: flex; align-items: center; padding: 6px 8px; min-height: 52px; position: sticky; top: 0; background: var(--bg); z-index: 2; }
.sheet .sheet-nav .title { flex: 1; text-align: center; font-weight: 600; }
.sheet .sheet-nav .side { width: 88px; }

/* 小さい知らせ */
.toast { position: fixed; left: 50%; top: calc(10px + env(safe-area-inset-top, 0px)); transform: translate(-50%, -20px); z-index: 80; background: rgba(30,30,32,.94); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 15px; opacity: 0; transition: .25s; pointer-events: none; max-width: calc(100% - 32px); text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* 画面ツアー */
.tour-spot { position: fixed; z-index: 90; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(0,0,0,.6); transition: all .3s ease; pointer-events: none; outline: 3px solid #fff; }
.tour-block { position: fixed; inset: 0; z-index: 89; }
.tour-bubble { position: fixed; z-index: 91; background: var(--card); color: var(--text); border-radius: 14px; padding: 14px 16px; width: min(340px, calc(100% - 32px)); box-shadow: var(--shadow); transition: top .3s, left .3s; }
.tour-bubble p { margin: 0 0 12px; font-size: 16px; }
.tour-bubble .tour-step { color: var(--sub); font-size: 13px; margin-bottom: 4px; }
.tour-bubble .tour-btns { display: flex; gap: 8px; align-items: center; }
.tour-bubble .tour-btns .sp { flex: 1; }

.empty { text-align: center; color: var(--sub); padding: 40px 24px; }
.empty b { display: block; color: var(--text); font-size: 18px; margin-bottom: 6px; }
.pill { display: inline-block; font-size: 13px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--fill); color: var(--sub); }
.pill.new { background: var(--tint); color: #fff; }
.pill.making { background: var(--orange); color: #fff; }
.pill.served { background: var(--green); color: #fff; }
.num { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* 入力欄の中の切り替え（.field input の決まりに負けないように） */
.field input.toggle { flex: none; width: 51px; height: 31px; padding: 0; background: var(--fill); border-radius: 16px; text-align: left; }
.field input.toggle:checked { background: var(--green); }

/* PC・タブレットの横置き：下のタブを左の道具の列に（ダイニー・Airレジの管理画面と同じ形）。お客さんの画面は除く */
.tabbar .tb-brand { display: none; }
@media (min-width: 1024px) {
  body:not(.guest):has(> .tabbar) { padding-left: var(--side-w); padding-bottom: 32px; }
  body:not(.guest) > .tabbar {
    top: 0; right: auto; width: var(--side-w); flex-direction: column; justify-content: flex-start; gap: 2px;
    padding: 18px 12px; border-top: 0; border-right: 1px solid var(--sep); background: var(--card);
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  body:not(.guest) > .tabbar .tb-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; padding: 4px 10px 18px; color: var(--text); }
  body:not(.guest) > .tabbar .tb-brand::before { content: ""; width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(var(--tint) 0 0) top / 100% 38% no-repeat, linear-gradient(90deg, var(--tint) 0 30%, transparent 30% 35%, var(--tint) 35% 65%, transparent 65% 70%, var(--tint) 70%); }
  body:not(.guest) > .tabbar button { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 15px; font-weight: 600; min-height: 46px; padding: 0 12px; border-radius: 10px; color: var(--sub); }
  body:not(.guest) > .tabbar button svg { width: 22px; height: 22px; }
  body:not(.guest) > .tabbar button:hover { background: var(--fill); }
  body:not(.guest) > .tabbar button[aria-selected="true"] { background: var(--tint-soft); color: var(--tint); }
  body:not(.guest) > .tabbar .badge { position: static; margin-left: auto; }
  body:not(.guest) .nav { padding-left: 24px; padding-right: 24px; }
  body:not(.guest) .large-title { margin-left: 24px; }
  .group, .seg { margin-left: 24px; margin-right: 24px; }
  .section-h { margin-left: 38px; }
}
@media (min-width: 1024px) { body:not(.guest):has(> .tabbar) .wrap { max-width: 1240px; margin: 0; } }
.field input[type="search"], input[type="search"] { text-align: left; }

/* 品の写真 */
.thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex: none; background: var(--fill); }
.thumb.noimg { display: inline-flex; align-items: center; justify-content: center; color: var(--sub); }
.thumb.noimg svg { width: 24px; height: 24px; }
.photo-pick { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--card); border-radius: 14px; margin: 0 16px 14px; box-shadow: 0 0 0 1px var(--sep); }
.photo-pick .thumb { width: 88px; height: 88px; border-radius: 12px; }
.photo-pick .acts { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
