/* 運送請求 画面スタイル */
:root {
  --ink: #1c2530;
  --ink-2: #4a5866;
  --muted: #7a8794;
  --line: #dde3e9;
  --line-2: #eef2f5;
  --bg: #f4f6f8;
  --card: #ffffff;
  --brand: #1f4e6b;
  --brand-2: #2b6a8f;
  --brand-soft: #e6f0f6;
  --ok: #1e7a4f;
  --ok-soft: #e5f4ec;
  --warn: #9a5b00;
  --warn-soft: #fff4dd;
  --danger: #b4232c;
  --danger-soft: #fdecec;
  --radius: 8px;
  --font: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Meiryo", "Noto Sans JP", sans-serif;
}
* { box-sizing: border-box; }
html { font-size: 14px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.6; -webkit-text-size-adjust: 100%; }
a { color: var(--brand-2); }
a:hover { color: var(--brand); }
h1 { font-size: 1.55rem; margin: 0 0 .8rem; letter-spacing: .02em; }
h2 { font-size: 1.12rem; margin: 0 0 .8rem; }
h3 { font-size: 1rem; margin: 1.2rem 0 .6rem; }
code { background: var(--line-2); padding: .1em .35em; border-radius: 4px; }

/* ヘッダー */
.topbar { display: flex; align-items: center; gap: 1.2rem; padding: 0 1.2rem; height: 56px; background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 10; box-shadow: 0 1px 0 rgba(0,0,0,.08); }
.brand { display: flex; align-items: center; gap: .55rem; color: #fff; text-decoration: none; font-weight: 700; white-space: nowrap; }
.brand:hover { color: #fff; }
.brand small { display: block; font-weight: 400; font-size: .72rem; opacity: .75; line-height: 1.1; }
.brand > span:last-child { line-height: 1.2; }
.brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; background: #fff; color: var(--brand); font-weight: 800; font-size: 1rem; }
.mainnav { display: flex; gap: .15rem; flex: 1; overflow-x: auto; }
.mainnav a { color: rgba(255,255,255,.82); text-decoration: none; padding: .45rem .8rem; border-radius: 6px; white-space: nowrap; }
.mainnav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.mainnav a.is-active { background: rgba(255,255,255,.18); color: #fff; font-weight: 700; }
.userbox { display: flex; align-items: center; gap: .8rem; white-space: nowrap; }
.userbox a { color: #fff; }
.userbox form { margin: 0; }
.linklike { background: none; border: 0; color: rgba(255,255,255,.8); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }

.container { max-width: 1280px; margin: 0 auto; padding: 1.4rem 1.2rem 4rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.page-head h1, .page-head h2 { margin: 0; }
.section-title { margin-top: 1.8rem; }
.crumb { margin: 0 0 .2rem; color: var(--muted); }
.lead { color: var(--ink-2); margin-top: -.4rem; }

/* カード */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; margin-bottom: 1.1rem; }
.card.narrow { max-width: 480px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; align-items: start; }
.two-col > .card { margin-bottom: 0; }
.two-col + * { margin-top: 1.1rem; }
.danger-zone { border-color: #f1d3d5; background: #fffafa; }

/* ボタン */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; padding: .48rem 1rem; border: 1px solid #c4cdd6; border-radius: 6px; background: #fff; color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; line-height: 1.3; }
.btn:hover { background: #f3f6f8; color: var(--ink); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--brand-2); }
.btn-danger-outline { color: var(--danger); border-color: #e6b8bb; }
.btn-danger-outline:hover { background: var(--danger-soft); color: var(--danger); }
.btn-sm { padding: .22rem .6rem; font-size: .88rem; font-weight: 500; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* フォーム */
input, select, textarea { font: inherit; color: var(--ink); width: 100%; padding: .45rem .6rem; border: 1px solid #c8d1da; border-radius: 6px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(43,106,143,.35); outline-offset: 0; border-color: var(--brand-2); }
input[readonly] { background: var(--line-2); color: var(--ink-2); }
input[type="checkbox"], input[type="radio"] { width: auto; padding: 0; accent-color: var(--brand); }
input[type="file"] { padding: .3rem; }
label { display: flex; flex-direction: column; gap: .25rem; font-size: .9rem; color: var(--ink-2); font-weight: 600; }
label.check { flex-direction: row; align-items: center; gap: .4rem; font-weight: 500; color: var(--ink); }
label.check.mini { font-size: .82rem; white-space: nowrap; }
.align-end { align-self: end; padding-bottom: .5rem; }
.form-stack { display: flex; flex-direction: column; gap: .85rem; }
.grid-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem 1rem; align-items: start; }
.grid-form h2, .grid-form h3 { margin: .6rem 0 0; padding-top: .6rem; border-top: 1px solid var(--line-2); }
.grid-form h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: 1 / -1; }
.form-actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: .4rem; }
.hint { font-size: .85rem; color: var(--muted); margin: 0; font-weight: 400; }
.w-m { width: 11rem; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset:disabled { opacity: .75; }
.seal-row { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.seal-preview { width: 72px; height: 72px; object-fit: contain; border: 1px dashed var(--line); border-radius: 6px; background: #fff; }

/* 絞り込み */
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem .6rem; align-items: center; margin-bottom: .8rem; }
.filter-bar input, .filter-bar select { width: auto; min-width: 8rem; }
.filter-bar label { flex-direction: row; align-items: center; gap: .4rem; font-weight: 500; }
.filter-bar.compact { margin: 0; }

/* テーブル */
.table-wrap { overflow-x: auto; }
.card.table-wrap { padding: .4rem .6rem; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .55rem .6rem; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
.table th { font-size: .82rem; color: var(--muted); font-weight: 600; border-bottom-color: var(--line); white-space: nowrap; background: #fafbfc; }
.table tbody tr:hover { background: #f8fafb; }
.table-compact th, .table-compact td { padding: .4rem .5rem; font-size: .92rem; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.actions { white-space: nowrap; }
.actions .btn + .btn, .actions .btn + form, .actions form + .btn { margin-left: .2rem; }
.inline-form { display: inline-flex; gap: .3rem; align-items: center; margin: 0; }
.is-muted td { color: var(--muted); }
.is-current { background: #fff9e6 !important; }
.row-link { cursor: pointer; }
.w-check { width: 2.2rem; text-align: center !important; }

/* バッジ・メッセージ */
.badge { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--line-2); color: var(--ink-2); vertical-align: middle; }
.badge-billed { background: var(--ok-soft); color: var(--ok); }
.badge-muted { background: #eceff2; color: var(--muted); }
.flash { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid; }
.flash ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.flash-ok { background: var(--ok-soft); border-color: #bfe3cf; color: #145c3a; }
.flash-info { background: var(--brand-soft); border-color: #c4dbe9; }
.flash-warn { background: var(--warn-soft); border-color: #f2d59a; color: #6e4300; }
.flash-error { background: var(--danger-soft); border-color: #f0c2c5; color: #8d1820; }
.text-warn { color: var(--warn); }
.muted { color: var(--muted); }
.center { text-align: center; }
.warn-strong { color: var(--danger); font-weight: 700; }

/* ホーム */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; margin-bottom: 1.1rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; display: flex; flex-direction: column; }
.stat span { color: var(--muted); font-size: .85rem; font-weight: 600; }
.stat strong { font-size: 1.6rem; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.stat strong em { font-style: normal; font-size: .9rem; margin-left: .2rem; color: var(--ink-2); }
.stat small { color: var(--ink-2); }
.stat-warn { border-color: #f2d59a; background: var(--warn-soft); }
.setup { border-left: 4px solid var(--brand-2); }
.checklist { margin: 0; padding-left: 1.4rem; }
.checklist li { margin: .2rem 0; }
.checklist li.done { color: var(--muted); text-decoration: line-through; }
.checklist li.done::marker { content: "✓  "; color: var(--ok); }

/* 売上入力 */
.entry-form { border-top: 4px solid var(--brand); }
.entry-form.is-editing { border-top-color: #d08a00; }
.entry-title { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: .8rem; }
.entry-title h2 { margin: 0; }
.entry-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .7rem .9rem; align-items: start; }
.entry-grid .f-wide { grid-column: span 2; }
.f-pick { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.f-pick .lbl { font-size: .9rem; color: var(--ink-2); font-weight: 600; }
.code-pick { display: flex; gap: .35rem; }
.code-pick .code { width: 4.2rem; flex: none; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; background: #fffdf3; }
.code-pick select { flex: 1; min-width: 0; }
.is-invalid { border-color: var(--danger) !important; background: var(--danger-soft) !important; }
.suggest-wrap { position: relative; display: block; }
.suggest { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 2px); margin: 0; padding: .2rem 0; list-style: none; background: #fff; border: 1px solid #c8d1da; border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.08); max-height: 240px; overflow-y: auto; font-weight: 400; color: var(--ink); }
.suggest li { padding: .35rem .7rem; cursor: pointer; }
.suggest li:hover, .suggest li.is-active { background: var(--brand-soft); }
.route-info { grid-column: 1 / -1; margin: -.2rem 0 0; font-size: .85rem; min-height: 1.2em; }
.route-info.is-ok { color: var(--ok); }
.route-info.is-warn { color: var(--warn); }
.calc-box { display: grid; grid-template-columns: minmax(0, 1fr) 260px; grid-template-rows: auto 1fr; gap: .7rem 1.2rem; margin-top: 1rem; padding: 1rem; background: #f8fafb; border: 1px solid var(--line-2); border-radius: var(--radius); }
.rate-type { display: inline-flex; border: 1px solid #c4cdd6; border-radius: 7px; overflow: hidden; background: #fff; justify-self: start; }
.seg { flex-direction: row; gap: 0; font-weight: 600; color: var(--ink-2); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { padding: .42rem 1rem; cursor: pointer; border-right: 1px solid #e1e6ea; }
.seg:last-child span { border-right: 0; }
.seg input:checked + span { background: var(--brand); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--brand-2); outline-offset: -2px; }
.calc-grid { grid-column: 1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .7rem; align-content: start; }
.calc-grid .f-note { grid-column: span 2; }
.calc-grid input[data-num] { text-align: right; font-variant-numeric: tabular-nums; }
.input-with-check { display: flex; gap: .4rem; align-items: center; }
.calc-result { grid-column: 2; grid-row: 1 / span 2; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .9rem; display: flex; flex-direction: column; gap: .1rem; }
.calc-result > div { display: grid; grid-template-columns: 1fr auto; column-gap: .5rem; align-items: baseline; padding: .2rem 0; border-bottom: 1px dashed var(--line-2); }
.calc-result span { color: var(--ink-2); font-size: .88rem; }
.calc-result strong { font-variant-numeric: tabular-nums; font-size: 1.05rem; }
.calc-result small { grid-column: 1 / -1; color: var(--muted); font-size: .78rem; line-height: 1.35; }
.calc-result small:empty { display: none; }
.calc-result .total { border-bottom: 0; border-top: 2px solid var(--ink); margin-top: .3rem; padding-top: .45rem; }
.calc-result .total strong { font-size: 1.45rem; color: var(--brand); }
.is-hidden { display: none !important; }

.summary-strip { display: flex; flex-wrap: wrap; gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: .8rem; overflow: hidden; }
.summary-strip > div { flex: 1 1 110px; padding: .55rem .9rem; border-right: 1px solid var(--line-2); display: flex; flex-direction: column; }
.summary-strip > div:last-child { border-right: 0; }
.summary-strip span { font-size: .78rem; color: var(--muted); font-weight: 600; }
.summary-strip strong { font-variant-numeric: tabular-nums; }
.summary-strip .total { background: var(--brand-soft); }

.pager { display: flex; gap: .3rem; flex-wrap: wrap; padding: .8rem .4rem .3rem; }
.pager a { padding: .2rem .6rem; border: 1px solid var(--line); border-radius: 5px; text-decoration: none; }
.pager a.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ログイン */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: linear-gradient(160deg, #e9f0f5, #f4f6f8 55%); }
.auth-card { width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 2rem 1.8rem; box-shadow: 0 10px 30px rgba(31,78,107,.08); }
.auth-card.wide { max-width: 520px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: .6rem; font-size: 1.25rem; font-weight: 800; color: var(--brand); margin-bottom: 1.1rem; }
.auth-brand .brand-mark { background: var(--brand); color: #fff; }

/* スマホ・タブレット */
@media (max-width: 1100px) {
  .entry-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .calc-box { grid-template-columns: 1fr; }
  .calc-result { grid-column: 1; grid-row: auto; }
  .calc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  html { font-size: 15px; }
  .topbar { height: auto; flex-wrap: wrap; padding: .5rem .8rem; gap: .4rem .8rem; }
  .mainnav { order: 3; flex-basis: 100%; }
  .userbox { margin-left: auto; }
  .container { padding: 1rem .8rem 3rem; }
  .two-col, .stats { grid-template-columns: 1fr; }
  .grid-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-3, .span-4 { grid-column: 1 / -1; }
  .entry-grid, .calc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entry-grid .f-pick, .entry-grid .f-wide, .calc-grid .f-note { grid-column: 1 / -1; }
  .rate-type { justify-self: stretch; }
  .seg { flex: 1; }
  .seg span { width: 100%; text-align: center; padding: .5rem .3rem; }
}

/* 固定ヘッダーに隠れないように */
.entry-form, #issued, #routes, #users, #route-form { scroll-margin-top: 72px; }
@media (max-width: 760px) { .entry-form, #issued, #routes, #users, #route-form { scroll-margin-top: 120px; } }

/* 2段階認証 */
.auth-title { font-size: 1.2rem; text-align: center; margin: .2rem 0 1rem; }
.otp-input { font-size: 1.6rem; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; padding: .5rem; }
.mt { margin-top: 1rem; }
.choice-list { display: flex; flex-direction: column; gap: .8rem; }
.choice { display: flex; flex-direction: column; gap: .3rem; text-align: left; padding: 1rem 1.1rem; border: 1px solid #c4cdd6; border-radius: 10px; background: #fff; cursor: pointer; font: inherit; color: var(--ink); }
.choice:hover { border-color: var(--brand-2); background: var(--brand-soft); }
.choice strong { color: var(--brand); font-size: 1.02rem; }
.choice span { color: var(--ink-2); font-size: .9rem; line-height: 1.5; }
.steps { padding-left: 1.3rem; margin: 0 0 .8rem; }
.steps li { margin: .3rem 0; }
.qr-box { display: flex; justify-content: center; margin: .5rem 0 1rem; }
.qr { width: 210px; height: 210px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.qr svg { width: 100%; height: 100%; display: block; }
.secret-key { font-family: ui-monospace, Consolas, monospace; font-size: 1.05rem; letter-spacing: .08em; background: var(--line-2); padding: .5rem .7rem; border-radius: 6px; text-align: center; word-break: break-all; }
.help { margin-top: 1rem; font-size: .9rem; color: var(--ink-2); }
.help summary { cursor: pointer; color: var(--brand-2); }
.backup-codes { columns: 2; padding-left: 1.6rem; font-family: ui-monospace, Consolas, monospace; font-size: 1.1rem; letter-spacing: .06em; margin: .8rem 0 1rem; }
.backup-codes li { margin: .25rem 0; }
@media print {
  .auth-page { background: #fff; }
  .auth-card { box-shadow: none; border: 0; }
  .auth-card form, .auth-card .btn { display: none; }
}

/* マスタのタブ */
.tabs { display: flex; flex-wrap: wrap; gap: .3rem; border-bottom: 2px solid var(--line); margin: -.2rem 0 1rem; }
.tabs a { padding: .5rem .95rem; text-decoration: none; color: var(--ink-2); font-weight: 600; border-radius: 6px 6px 0 0; margin-bottom: -2px; border-bottom: 2px solid transparent; }
.tabs a:hover { background: var(--line-2); color: var(--ink); }
.tabs a.is-active { color: var(--brand); border-bottom-color: var(--brand); background: #fff; }

/* F1のマスタ一覧 */
.picker-backdrop { position: fixed; inset: 0; background: rgba(20, 30, 40, .35); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 1rem 1rem; }
.picker { background: #fff; border-radius: 10px; width: 100%; max-width: 520px; max-height: 80vh; display: flex; flex-direction: column; box-shadow: 0 16px 50px rgba(0,0,0,.25); }
.picker-head { display: flex; align-items: center; gap: .6rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.picker-head strong { white-space: nowrap; }
.picker-head input { flex: 1; }
.picker ul { list-style: none; margin: 0; padding: .3rem 0; overflow-y: auto; }
.picker li { display: grid; grid-template-columns: 4.5rem 1fr; gap: .6rem; padding: .45rem 1rem; cursor: pointer; }
.picker li b { text-align: right; font-variant-numeric: tabular-nums; color: var(--brand); }
.picker li:hover, .picker li.is-active { background: var(--brand-soft); }
.picker .empty { padding: 1rem; color: var(--muted); }
.picker-foot { padding: .5rem 1rem; border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted); }

/* 乗務員別本数 */
.day-matrix th, .day-matrix td { padding: .35rem .4rem; font-size: .88rem; }
.day-matrix thead th { text-align: center !important; line-height: 1.15; }
.day-matrix thead th small { font-weight: 500; }
.day-matrix .is-sun { color: #c0392b; }
.day-matrix .is-sat { color: #2667b8; }
.day-matrix .sticky-col { position: sticky; left: 0; background: var(--card); white-space: nowrap; z-index: 1; box-shadow: 1px 0 0 var(--line-2); }
.day-matrix thead .sticky-col, .day-matrix tfoot th { background: #fafbfc; }
.day-matrix tfoot th { color: var(--ink); border-top: 2px solid var(--line); }
.w-s { width: 7rem; }
.filter-bar .w-s { min-width: 6rem; width: 7rem; }
.route-jump { display: flex; flex-wrap: wrap; gap: .3rem .8rem; font-size: .9rem; }
.route-group { margin: 1.2rem 0 .4rem; font-size: 1rem; display: flex; align-items: center; gap: .5rem; }
.f-pick.is-off { opacity: .35; }

/* 分析（スマホで見やすく） */
.an { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: .9rem; }
.an-head { display: flex; align-items: center; justify-content: center; gap: .6rem; }
.an-month input { font-size: 1.05rem; font-weight: 700; text-align: center; padding: .4rem .6rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.an-nav { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--card); border: 1px solid var(--line); text-decoration: none; font-size: 1.4rem; color: var(--brand); }
.an-tabs { display: flex; gap: .4rem; overflow-x: auto; position: sticky; top: 56px; z-index: 5; background: var(--bg); padding: .3rem 0; }
.an-tabs a { flex: 1 0 auto; text-align: center; padding: .45rem .8rem; border-radius: 999px; background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .92rem; white-space: nowrap; }
.an-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .9rem; display: flex; flex-direction: column; gap: .1rem; }
.kpi span { font-size: .8rem; color: var(--muted); font-weight: 600; }
.kpi strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.kpi strong em { font-style: normal; font-size: .8rem; font-weight: 600; margin-left: .15rem; color: var(--ink-2); }
.kpi small { font-size: .78rem; color: var(--muted); }
.kpi-main { grid-column: 1 / -1; background: var(--brand); border-color: var(--brand); color: #fff; }
.kpi-main span, .kpi-main small { color: rgba(255,255,255,.8); }
.kpi-main strong { font-size: 1.9rem; }
.kpi-main .delta.up { color: #b8f0cf; } .kpi-main .delta.down { color: #ffd0d0; }
.delta { font-weight: 700; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--ok); } .delta.down { color: var(--danger); }
.an-sec h2 { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.an-sec h2 small { font-size: .78rem; color: var(--muted); font-weight: 500; }
.an-sec h2.mt { margin-top: 1.4rem; }
.an-trend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.an-trend li { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr) auto; gap: .6rem; align-items: center; }
.an-trend li.is-cur { background: var(--brand-soft); border-radius: 6px; padding: .2rem .3rem; margin: 0 -.3rem; }
.an-trend .lbl { font-size: .85rem; font-weight: 700; color: var(--ink-2); text-decoration: none; line-height: 1.2; text-align: right; }
.an-trend .bars { display: flex; flex-direction: column; gap: 2px; }
.an-trend .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; font-size: .92rem; line-height: 1.25; }
.an-trend .val small { display: block; font-weight: 500; color: var(--muted); font-size: .74rem; }
.bar { height: 10px; background: var(--line-2); border-radius: 5px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--brand-2); border-radius: 5px; }
.bar.ly { height: 5px; background: transparent; }
.bar.ly i { background: #b9c7d3; }
.an-legend { font-size: .78rem; color: var(--muted); margin: .7rem 0 0; display: flex; align-items: center; gap: .3rem; }
.an-legend .sw { display: inline-block; width: 14px; height: 8px; border-radius: 3px; background: var(--brand-2); }
.an-legend .sw.ly { background: #b9c7d3; height: 4px; }
.an-rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.an-rank > li { padding: .55rem 0; border-bottom: 1px solid var(--line-2); }
.an-rank > li:last-child { border-bottom: 0; }
.rk { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.rk-top { display: flex; justify-content: space-between; gap: .6rem; align-items: baseline; }
.rk-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.rk-val { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rk-sub { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.an-rank details summary { list-style: none; cursor: pointer; }
.an-rank details summary::-webkit-details-marker { display: none; }
.an-rank details summary .rk-name::after { content: ' ▾'; color: var(--muted); font-size: .8em; }
.an-rank details[open] summary .rk-name::after { content: ' ▴'; }
.an-sub { list-style: none; margin: .4rem 0 0; padding: .4rem .7rem; background: var(--line-2); border-radius: 6px; font-size: .85rem; }
.an-sub li { display: flex; justify-content: space-between; gap: .6rem; padding: .15rem 0; }
.an-sub li span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.an-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; }
.an-kinds > div { border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .8rem; display: flex; flex-direction: column; }
.an-kinds span { font-size: .8rem; color: var(--muted); font-weight: 600; }
.an-kinds strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.an-kinds small { font-size: .76rem; color: var(--muted); }
.an-note { font-size: .78rem; color: var(--muted); margin: .6rem 0 0; }
.an section[id] { scroll-margin-top: 110px; }
@media (max-width: 760px) { .an-tabs { position: static; } .an section[id] { scroll-margin-top: 110px; } }
@media (max-width: 760px) { .mainnav { flex-wrap: wrap; overflow-x: visible; } .head-actions { display: flex; gap: .4rem; flex-wrap: wrap; } }
/* 分析：内訳の色 */
.sw-fare { background: #2b6a8f !important; } .sw-sc { background: #e0a23b !important; } .sw-toll { background: #4f9d69 !important; } .sw-other { background: #9b7fc4 !important; }
.bar.stack { display: flex; gap: 1px; background: var(--line-2); }
.bar.stack i { border-radius: 0; flex: none; }
.bar.stack i:first-child { border-radius: 5px 0 0 5px; } .bar.stack i:last-child { border-radius: 0 5px 5px 0; } .bar.stack i:only-child { border-radius: 5px; }
.rk-parts { font-size: .76rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.kpi-parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .3rem .8rem; margin: .5rem 0 0; padding-top: .5rem; border-top: 1px solid rgba(255,255,255,.2); }
.kpi-parts div { display: flex; justify-content: space-between; gap: .4rem; }
.kpi-parts dt { font-size: .8rem; color: rgba(255,255,255,.85); display: flex; align-items: center; gap: .3rem; }
.kpi-parts dt i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; border: 1px solid rgba(255,255,255,.6); }
.kpi-parts dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.an-kinds small + small { color: var(--ink-2); }
.an-legend { flex-wrap: wrap; }
/* 売上入力：伝票番号 */
.slip-no { display: flex; align-items: baseline; gap: .45rem; padding: .3rem .8rem; border-radius: var(--radius); background: var(--brand); color: #fff; }
.slip-no span { font-size: .78rem; opacity: .85; }
.slip-no strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.slip-no small { font-size: .75rem; padding: .05rem .4rem; border-radius: 999px; background: rgba(255,255,255,.2); }
.slip-no .slip-new { color: #fff; font-size: .78rem; margin-left: .3rem; }
.quick-range { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; font-size: .88rem; margin: -.3rem 0 .8rem; }
.quick-range a { padding: .15rem .65rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card); text-decoration: none; }
.quick-range a.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.quick-range .muted { font-size: .8rem; }
.geo-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; }
.geo-bar span { flex: 1 1 320px; font-size: .9rem; color: var(--ink-2); }
td.geo { font-size: .85rem; } td.geo .inline-form { margin-left: .3rem; }
.route-lookup-info { font-size: .85rem; margin: .2rem 0 0; }
.route-lookup-info.is-ok { color: var(--ok); } .route-lookup-info.is-warn { color: var(--warn); }
/* 元の位置に戻ったときのメッセージ（画面上部に浮かべる） */
.toast-box { position: fixed; top: calc(64px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 50; width: min(720px, calc(100% - 32px)); box-shadow: 0 6px 24px rgba(0,0,0,.18); border-radius: var(--radius); transition: opacity .8s; }
.toast-box .flash { margin: 0; }
.toast-box .flash + .flash { margin-top: .4rem; }
.toast-box.is-fading { opacity: 0; }
.toast-close { position: absolute; top: .35rem; right: .5rem; border: 0; background: transparent; font-size: 1.2rem; cursor: pointer; color: var(--ink-2); }
