/* =========================================================
   GD原価管理システム 共通スタイル
   スマホ表示を基本に、PCでは中央に幅560pxで表示
   ========================================================= */
:root {
  --bg: #F4F5F2;
  --card: #FFFFFF;
  --ink: #1C2321;
  --muted: #5B6460;
  --line: #ECEEE9;
  --border: #C9CEC6;
  --border-soft: #DCDFD9;
  --accent: #2F6B4F;
  --accent-dark: #1F4A36;
  --accent-soft: #E6EFEA;
  --accent-tint: #F3F8F5;
  --ok: #1F6B45;      --ok-bg: #E3F1E8;
  --warn: #7A5200;    --warn-bg: #FDF1D6;
  --over: #8A3A0E;    --over-bg: #FBE7DA;
  --danger: #A3341B;
  --neutral-bg: #EEF0EC; --neutral: #3E4743;
  --admin-bg: #EDE9F6;   --admin: #4A3B7A;
  --radius: 12px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #E3E6E1;
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; }
.ico { flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid #7FB79A; outline-offset: 2px; }

/* ---------- 全体の枠 ---------- */
.app {
  max-width: 560px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.main { padding: 16px; display: flex; flex-direction: column; gap: 16px; flex: 1; }
.has-tabbar .main { padding-bottom: calc(96px + var(--safe-bottom)); }
.has-actionbar .main { padding-bottom: calc(180px + var(--safe-bottom)); }
.has-tabbar.has-actionbar .main { padding-bottom: calc(250px + var(--safe-bottom)); }
/* 画面下の固定バーの実際の高さ（app.js が計測）に合わせて余白を取る */
.has-bottom-space .main { padding-bottom: calc(var(--bottom-space) + 24px); }

/* ---------- 上部バー ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  min-height: 56px;
  background: var(--card);
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; gap: 4px;
  padding: 0 8px;
}
.topbar__title { flex: 1; margin: 0; font-size: 17px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__title--pad { padding-left: 8px; }
.topbar__logo { padding: 0 6px 0 8px; }
.topbar__user { font-size: 13px; color: var(--muted); padding: 0 8px; min-height: 44px; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; text-decoration: none; border-radius: 8px; }
.topbar__user:hover { color: var(--ink); background: var(--bg); }
.icon-btn {
  width: 44px; height: 44px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--ink);
  border-radius: 10px; cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--line); color: var(--ink); }

/* ---------- メッセージ ---------- */
.flash { margin: 12px 16px 0; padding: 12px 14px; border-radius: 10px; font-size: 14px; line-height: 1.6; }
.flash--success { background: var(--ok-bg); color: var(--ok); }
.flash--info { background: var(--accent-soft); color: var(--accent-dark); }
.flash--error { background: var(--over-bg); color: var(--over); }
.notice { padding: 12px 14px; border-radius: 10px; font-size: 14px; line-height: 1.6; display: flex; gap: 10px; align-items: flex-start; text-decoration: none; }
.notice--over { background: var(--over-bg); color: var(--over); }
.notice--info { background: var(--accent-soft); color: var(--accent-dark); }
.notice:hover { color: inherit; }

/* ---------- カード ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card--flush { padding: 4px 16px; gap: 0; }
.card--accent { border: 2px solid var(--accent); }
.card__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card__title { margin: 0; font-size: 15px; font-weight: 700; }
.card__sum { font-size: 15px; font-weight: 700; white-space: nowrap; }
.card__link { font-size: 13px; text-decoration: none; white-space: nowrap; }
.help { font-size: 12px; color: var(--muted); line-height: 1.6; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.page-title { display: flex; flex-direction: column; gap: 4px; }
.page-title h2 { margin: 0; font-size: 21px; font-weight: 700; }
.page-title p { margin: 0; font-size: 13px; color: var(--muted); }
.inline { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 8px; }

/* ---------- ボタン ---------- */
.btn {
  min-height: 48px; padding: 0 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--card); color: var(--ink);
  font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { color: var(--ink); background: #F7F8F5; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #FFF; }
.btn--primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #FFF; }
.btn--outline { border-color: var(--accent); color: var(--accent); }
.btn--outline:hover { color: var(--accent-dark); background: var(--accent-tint); }
.btn--danger { background: var(--over); border-color: var(--over); color: #FFF; }
.btn--danger:hover { background: #6E2E0B; color: #FFF; }
.btn--danger-outline { border-color: var(--danger); color: var(--danger); }
.btn--danger-outline:hover { color: var(--danger); background: #FFF6F2; }
.btn--sm { min-height: 40px; padding: 0 12px; font-size: 13px; }
.btn--lg { min-height: 60px; font-size: 17px; border-radius: 12px; }
.btn--block { width: 100%; }
.btn--dashed { border: 1px dashed var(--accent); background: var(--accent-tint); color: var(--accent); font-weight: 500; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.link-btn { border: none; background: none; padding: 8px 0; color: var(--accent); font-size: 14px; font-weight: 500; cursor: pointer; text-align: left; text-decoration: none; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

/* ---------- 入力 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field__label { display: flex; align-items: center; gap: 6px; }
.field__error { color: var(--over); font-size: 12px; }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 8px;
  background: #FFF; color: var(--ink); font-size: 16px;
}
.textarea { padding: 10px 12px; min-height: 80px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,107,79,.18); }
.input--num { text-align: right; font-variant-numeric: tabular-nums; }
.input--strong { border: 2px solid var(--accent); font-weight: 700; font-size: 18px; }
.input--auto { background: #F8FAF7; }
.input--sm { min-height: 44px; font-size: 16px; padding: 0 8px; }
.input[aria-invalid="true"] { border-color: var(--over); }
.unit { font-size: 13px; color: var(--muted); white-space: nowrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.searchbox { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: #FFF; color: var(--muted); }
.searchbox input { flex: 1; border: none; outline: none; background: transparent; font-size: 16px; color: var(--ink); min-width: 0; }
.searchbox:focus-within { border-color: var(--accent); }

/* 区切りボタン（食材／包材／資材 など） */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label, .seg a {
  min-height: 44px; display: flex; align-items: center; justify-content: center;
  background: #FFF; color: var(--ink); font-size: 14px; cursor: pointer; text-decoration: none;
  border-left: 1px solid var(--border);
}
.seg > :first-child, .seg > input:first-child + label { border-left: none; }
.seg input:checked + label, .seg a.is-active { background: var(--accent); color: #FFF; font-weight: 700; }
.seg--dark a.is-active { background: var(--ink); }
.seg input:focus-visible + label { outline: 3px solid #7FB79A; outline-offset: -3px; }

/* スイッチ */
.switch { position: relative; width: 52px; height: 32px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 16px; background: var(--border); transition: background .15s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; border-radius: 13px; background: #FFF; transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid #7FB79A; outline-offset: 2px; }

/* フィルター用の丸ボタン */
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { min-height: 36px; padding: 0 14px; display: inline-flex; align-items: center; border-radius: 999px; border: 1px solid var(--border); background: #FFF; color: var(--ink); font-size: 13px; text-decoration: none; cursor: pointer; }
.pill.is-active { background: var(--ink); border-color: var(--ink); color: #FFF; font-weight: 500; }
.pill--choice.is-active { background: var(--accent); border-color: var(--accent); }

/* ---------- ラベル（チップ） ---------- */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; line-height: 1.6; white-space: nowrap; background: var(--neutral-bg); color: var(--neutral); }
.chip--ok { background: var(--ok-bg); color: var(--ok); font-weight: 700; }
.chip--warn { background: var(--warn-bg); color: var(--warn); font-weight: 700; }
.chip--over { background: var(--over-bg); color: var(--over); font-weight: 700; }
.chip--food { background: var(--accent-soft); color: var(--accent-dark); }
.chip--package { background: #E4ECF4; color: #1D4466; }
.chip--material { background: #F1ECE2; color: #5E4A22; }
.chip--admin { background: var(--admin-bg); color: var(--admin); }
.chip--accent { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.chip .ico { width: 12px; height: 12px; }

/* ---------- 一覧 ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.item { background: var(--card); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink); -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.item:hover { color: var(--ink); background: #FCFDFB; }
.item.is-pressing { outline: 3px solid var(--accent); }
.item.is-inactive { opacity: .6; }
.item__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.item__name { font-size: 16px; font-weight: 700; }
.item__sub { font-size: 12px; color: var(--muted); }
.item__value { font-size: 16px; font-weight: 700; text-align: right; white-space: nowrap; }
.item__meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.item__date { margin-left: auto; font-size: 12px; color: var(--muted); }
.item__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; background: #F7F8F5; border-radius: 8px; padding: 10px; }
.stat-mini { display: flex; flex-direction: column; gap: 2px; }
.stat-mini span:first-child { font-size: 11px; color: var(--muted); }
.stat-mini span:last-child { font-size: 15px; font-weight: 700; }

.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.rows > .row:first-child { border-top: none; }
.card .rows { margin-top: -4px; }
.row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row__name { font-size: 15px; font-weight: 500; }
.row__sub { font-size: 12px; color: var(--muted); }
.row__value { text-align: right; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row--link { text-decoration: none; color: var(--ink); }
.row--link:hover { color: var(--ink); background: #FAFBF9; }
.empty { padding: 24px 8px; text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- 下部タブ・固定ボタン ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 560px; z-index: 30;
  background: var(--card); border-top: 1px solid var(--border-soft);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding-bottom: var(--safe-bottom);
}
.tabbar a { min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--muted); text-decoration: none; }
.tabbar a.is-active { color: var(--accent); font-weight: 700; }
.actionbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 560px; z-index: 25;
  background: var(--card); border-top: 1px solid var(--border-soft);
  padding: 12px 16px calc(16px + var(--safe-bottom));
  display: flex; flex-direction: column; gap: 10px;
}
.has-tabbar .actionbar { bottom: calc(64px + var(--safe-bottom)); padding-bottom: 12px; }
.actionbar__summary { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; }
.big-num { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.big-num small { font-size: 14px; font-weight: 500; }
.label-sm { font-size: 12px; color: var(--muted); }

/* ---------- ボトムシート（長押しメニュー・食材追加など） ---------- */
dialog.sheet {
  margin: auto auto 0; padding: 0; border: none; width: 100%; max-width: 560px;
  max-height: 92vh; border-radius: 20px 20px 0 0; background: var(--card); color: var(--ink);
}
dialog.sheet::backdrop { background: rgba(28, 35, 33, .55); }
.sheet__body { padding: 8px 16px calc(24px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 12px; }
.sheet__grip { align-self: center; width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin-bottom: 4px; }
.sheet__head { display: flex; justify-content: space-between; align-items: center; }
.sheet__title { margin: 0; font-size: 17px; font-weight: 700; }
.menu { display: flex; flex-direction: column; }
.menu form { margin: 0; }
.menu__item { width: 100%; min-height: 56px; display: flex; align-items: center; gap: 14px; padding: 6px 8px; border: none; border-radius: 10px; background: transparent; color: var(--ink); font-size: 16px; text-align: left; text-decoration: none; cursor: pointer; }
.menu__item:hover { background: var(--line); color: var(--ink); }
.menu__item span { display: flex; flex-direction: column; gap: 2px; }
.menu__item small { font-size: 12px; color: var(--muted); }
.menu__item--danger { color: var(--danger); }
.menu__item--danger:hover { color: var(--danger); }
.menu__item:disabled { opacity: .5; cursor: not-allowed; }
.menu__sep { height: 1px; background: var(--line); margin: 4px 0; }

.picker-results { display: flex; flex-direction: column; max-height: 38vh; overflow-y: auto; }
.picker-item { display: flex; align-items: center; gap: 10px; padding: 12px 10px; border: none; border-bottom: 1px solid var(--line); background: #FFF; text-align: left; cursor: pointer; border-radius: 0; color: var(--ink); }
.picker-item.is-selected { background: var(--accent-soft); border-radius: 10px; }
.picker-item:hover { background: #F7F8F5; }

/* ---------- 試作入力 ---------- */
.line { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.lines > .line:first-child { border-top: none; }
.line__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.line__name { font-size: 15px; font-weight: 500; }
.line__sub { font-size: 12px; color: var(--muted); }
.line__qty { width: 76px; }
.line__unit { width: 26px; font-size: 13px; color: var(--muted); }
.line__cost { width: 64px; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.line__del { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: none; background: transparent; color: var(--muted); border-radius: 8px; cursor: pointer; }
.line__del:hover { background: var(--line); color: var(--danger); }
.labor-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 8px; }

/* ---------- 原価結果 ---------- */
.hero { align-items: center; text-align: center; gap: 6px; padding: 20px 16px; }
.hero__value { font-size: 44px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.hero__value small { font-size: 18px; font-weight: 500; }
.price-box { border: 1px solid var(--border-soft); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.price-box--main { border: 2px solid var(--accent); }
.price-box__value { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.price-box--main .price-box__value { color: var(--accent); }
.meter { position: relative; height: 12px; background: var(--line); border-radius: 6px; }
.meter__bar { position: absolute; left: 0; top: 0; height: 12px; border-radius: 6px; background: var(--over); max-width: 100%; }
.meter__bar--ok { background: #3C8A62; }
.meter__bar--warn { background: #C7921E; }
.meter__bar--over { background: #C2601F; }
.meter__mark { position: absolute; left: 50%; top: -4px; width: 2px; height: 20px; background: var(--ink); }
.meter__scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.advice { background: #F4F5F2; border-radius: 8px; padding: 12px; font-size: 14px; line-height: 1.7; display: flex; flex-direction: column; }
.split { display: flex; height: 14px; border-radius: 7px; overflow: hidden; gap: 2px; }
.split > span { display: block; height: 100%; }
.legend { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.c-material { background: #2F6B4F; }
.c-labor { background: #8FB9A3; }
.c-other { background: #C9CEC6; }
.bk-row { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 4px 0; }
.bk-row > :nth-child(2) { flex: 1; }
.bk-row > .num { width: 72px; text-align: right; }
.trend-bar { position: relative; height: 10px; background: var(--line); border-radius: 5px; }
.trend-bar > span { position: absolute; left: 0; top: 0; height: 10px; border-radius: 5px; background: #8FB9A3; }
.trend-bar > span.is-current { background: var(--accent); }
.trend-bar > i { position: absolute; top: -3px; width: 2px; height: 16px; background: var(--ink); }
.cmp { display: grid; grid-template-columns: 1.3fr repeat(3, minmax(0, 1fr)); font-size: 13px; row-gap: 8px; column-gap: 6px; overflow-x: auto; }
.cmp--2 { grid-template-columns: 1.3fr repeat(2, minmax(0, 1fr)); }
.cmp--4 { grid-template-columns: 1.1fr repeat(4, minmax(0, 1fr)); }
.cmp > span { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cmp > span.cmp__label { text-align: left; }
.cmp > span.is-current { font-weight: 700; }

/* ---------- ホーム ---------- */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--ink); }
.stat:hover { color: var(--ink); }
.stat__label { font-size: 12px; color: var(--muted); }
.stat__value { font-size: 24px; font-weight: 700; }
.stat__value small { font-size: 13px; font-weight: 500; }
.stat--over { background: var(--over-bg); color: var(--over); }
.stat--over .stat__label { color: var(--over); }
.stat--over:hover { color: var(--over); }

/* ---------- 起動画面・ログイン ---------- */
.app--bare { min-height: 100vh; }
.splash { flex: 1; min-height: 100vh; background: var(--accent); color: #FFF; display: flex; flex-direction: column; align-items: center; padding: 0 24px calc(40px + var(--safe-bottom)); }
.splash__center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; text-align: center; }
.splash__name { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: .04em; }
.splash__lead { margin: 0; font-size: 14px; color: #D6E7DD; }
.splash__btn { width: 100%; max-width: 420px; min-height: 56px; border-radius: 12px; background: #FFF; color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; text-decoration: none; }
.splash__btn:hover { color: var(--accent-dark); }
.splash__ver { margin-top: 16px; font-size: 12px; color: #D6E7DD; }
.auth { padding: 72px 24px calc(32px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 28px; flex: 1; }
.auth__brand { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.auth__brand h1 { margin: 0; font-size: 22px; font-weight: 700; }
.auth__brand p { margin: 0; font-size: 13px; color: var(--muted); }
.auth .card { padding: 24px 16px; gap: 16px; }
.auth__note { margin-top: auto; font-size: 12px; color: var(--muted); line-height: 1.7; text-align: center; }
.grecaptcha-badge { visibility: hidden; }

/* ---------- 管理 ---------- */
.menu-list { background: var(--card); border-radius: var(--radius); display: flex; flex-direction: column; }
.menu-list a { min-height: 64px; display: flex; align-items: center; gap: 14px; padding: 10px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.menu-list a:last-child { border-bottom: none; }
.menu-list a:hover { background: #FAFBF9; color: var(--ink); }
.menu-list__text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.menu-list__text strong { font-size: 16px; font-weight: 500; }
.menu-list__text small { font-size: 12px; color: var(--muted); }
.set-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.set-row__text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.set-row__text span:first-child { font-size: 14px; }
.set-row__text span:last-child { font-size: 12px; color: var(--muted); }
.set-row .input { width: 92px; }
.set-row .unit { width: 28px; }
.log { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.log:last-child { border-bottom: none; }
.log__dot { width: 10px; height: 10px; border-radius: 5px; margin-top: 6px; flex-shrink: 0; background: var(--accent); }
.log__dot--ng { background: #C2601F; }
.log__dot--lock { background: var(--danger); }
.log__dot--muted { background: var(--border); }
.log__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.log__top { display: flex; justify-content: space-between; gap: 8px; }
.log__event { font-size: 14px; font-weight: 700; }
.log__event--ng { color: var(--over); }
.log__event--lock { color: var(--danger); }
.log__time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.log__detail { font-size: 12px; color: var(--muted); word-break: break-all; }
.pager { display: flex; justify-content: space-between; gap: 8px; }

/* ---------- エラー画面 ---------- */
.error-page { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 40px 24px; text-align: center; }
.error-page__code { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.error-page__title { margin: 0; font-size: 20px; }
.error-page__msg { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.error-page__detail { max-width: 100%; overflow: auto; text-align: left; font-size: 12px; background: #FFF; padding: 12px; border-radius: 8px; }

@media (min-width: 561px) {
  body { padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- 小さな補助クラス（インラインstyleを使わないため） ---------- */
.stack--tight { gap: 2px; }
.end { align-items: flex-end; }
.notice--between { justify-content: space-between; align-items: center; }
.w-date { width: 52px; flex-shrink: 0; }
.txt-over { color: var(--over); }
.txt-ok { color: var(--ok); }
.txt-accent { color: var(--accent); }
.mt-auto { margin-top: auto; }
.gap-16 { gap: 16px; }
[hidden] { display: none !important; }
.labor { border: 1px solid var(--line); border-radius: 10px; padding: 12px 12px 4px; display: flex; flex-direction: column; gap: 8px; }
.labor-foot { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto 36px; align-items: end; gap: 8px; padding-bottom: 8px; }
.labor-foot__wage { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-bottom: 12px; }
.labor-foot .line__cost { padding-bottom: 12px; }
.labor-foot .line__del { margin-bottom: 4px; }
details.card > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
details.card > summary::after { content: "＋"; color: var(--muted); }
details.card[open] > summary::after { content: "−"; }
details.card > summary::-webkit-details-marker { display: none; }
a.stack.row--link { padding: 6px 0; gap: 6px; }
.topbar form { margin: 0; }
.sheet [tabindex="-1"]:focus { outline: none; }

/* ---------- テスト環境の表示（本番と取り違えないため） ---------- */
.env-banner {
  position: sticky; top: 0; z-index: 40;
  background: repeating-linear-gradient(135deg, #B45309 0 14px, #9A4708 14px 28px);
  color: #FFF; font-size: 12px; font-weight: 700; text-align: center;
  padding: 4px 8px; letter-spacing: .04em;
}
.env-banner + .topbar { top: 26px; }
.input[readonly] { background: var(--bg, #f3f5f4); color: var(--muted); }
