/* =========================================================
   日々と、珈琲 店舗管理 — 焙煎所のトーン
   エスプレッソ（文字・サイドバー） / ミルク（背景） / 深煎り（操作） / クレマ（強調）
   ========================================================= */
:root {
  color-scheme: light;
  --bg: #f5f3f0;
  --surface: #ffffff;
  --ink: #2a1d17;
  --muted: #7a6a60;
  --line: #e7e0d9;
  --line-strong: #d6ccc2;
  --roast: #6b3f2a;
  --roast-dark: #4a2b1d;
  --crema: #c99a5b;
  --crema-soft: #f6ecdd;
  --leaf: #4f6e4c;
  --leaf-soft: #e9f0e6;
  --cherry: #a8322d;
  --cherry-soft: #f9e9e6;
  --sidebar: #2a1d17;
  --sidebar-ink: #e6dbd1;
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
  --serif: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  --side-w: 236px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: "palt" 0;
}
a { color: var(--roast); text-underline-offset: 3px; }
a:hover { color: var(--roast-dark); }
p { color: var(--muted); margin: 0 0 10px; }
small { font-size: 0.8em; }

.icon { width: 1.25em; height: 1.25em; fill: currentColor; flex: none; vertical-align: -0.28em; }

h1, h2, h3 { margin: 0; color: var(--ink); font-family: var(--serif); font-weight: 700; letter-spacing: 0.04em; line-height: 1.35; }
h1 { font-size: 26px; display: flex; align-items: center; gap: 10px; }
h1 .icon { width: 34px; height: 34px; padding: 6px; border-radius: 10px; background: var(--crema-soft); fill: var(--roast); }
h2 { font-size: 17px; margin-bottom: 14px; }

:focus-visible { outline: 3px solid rgba(201, 154, 91, .55); outline-offset: 2px; }

/* ---------- 全体の配置 ---------- */
.shell { width: min(1160px, 100%); margin: 0 auto; padding: 28px 28px 48px; }
.is-app .shell { padding-bottom: 110px; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 30;
  display: flex; flex-direction: column; gap: 18px;
  padding: 22px 14px 18px;
  background: var(--sidebar); color: var(--sidebar-ink);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-mark { width: 30px; height: 30px; fill: var(--crema); }
.brand-name { font-family: var(--serif); font-size: 19px; font-weight: 700; letter-spacing: .08em; color: #f4e6d4; display: grid; line-height: 1.25; }
.brand-name small { font-family: var(--font); font-size: 11px; font-weight: 400; letter-spacing: .2em; color: #a8968a; }
.sidebar .brand { padding: 4px 8px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }

.side-nav { display: grid; gap: 2px; }
.side-nav a, .side-foot a, .side-logout {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--sidebar-ink); text-decoration: none; font-size: 15px;
}
.side-nav a .icon, .side-foot .icon { fill: #a8968a; }
.side-nav a:hover, .side-foot a:hover, .side-logout:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-nav a.is-current, .side-foot a.is-current { background: rgba(201,154,91,.16); color: #f6dfbd; }
.side-nav a.is-current .icon, .side-foot a.is-current .icon { fill: var(--crema); }
.side-foot { margin-top: auto; display: grid; gap: 2px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.side-foot form { margin: 0; }
.who { padding: 0 12px 6px; font-size: 12px; color: #a8968a; }
.side-logout { width: 100%; min-height: 0; justify-content: flex-start; background: transparent; border: 0; font: inherit; cursor: pointer; font-weight: 400; }

.mobilebar, .tabbar, .scrim { display: none; }

@media (min-width: 1000px) {
  .is-app .shell { margin-left: var(--side-w); width: auto; max-width: calc(1160px + var(--side-w)); padding: 32px 40px 56px; }
}
@media (max-width: 999px) {
  .mobilebar {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 20;
    padding: 10px 14px 10px 18px; padding-top: max(10px, env(safe-area-inset-top));
    background: var(--sidebar); color: #f4e6d4;
  }
  .mobilebar .brand { font-family: var(--serif); font-weight: 700; letter-spacing: .08em; font-size: 17px; }
  .mobilebar .brand-mark { width: 24px; height: 24px; }
  .icon-button { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; cursor: pointer; }
  .icon-button .icon { width: 26px; height: 26px; fill: #f4e6d4; }
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; width: min(280px, 84vw); }
  .nav-toggle:checked ~ .sidebar { transform: none; }
  .nav-toggle:checked ~ .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(20, 12, 8, .45); }

  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; inset: auto 0 0 0; z-index: 20;
    padding: 6px 6px max(6px, env(safe-area-inset-bottom));
    background: rgba(255,255,255,.97); border-top: 1px solid var(--line);
    backdrop-filter: blur(8px);
  }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 6px 0 4px; border-radius: 10px; font-size: 11px; color: var(--muted); text-decoration: none; }
  .tabbar .icon { width: 24px; height: 24px; fill: var(--muted); }
  .tabbar a.is-current { color: var(--roast); font-weight: 700; }
  .tabbar a.is-current .icon { fill: var(--roast); }
  .shell { padding: 18px 14px 28px; }
  h1 { font-size: 22px; }
  h1 .icon { width: 30px; height: 30px; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

/* ---------- 見出し・パネル ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 4px 0 22px; }
.page-head p { margin: 6px 0 0; max-width: 62ch; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head h2 { margin: 0; }
.narrow { width: min(560px, 100%); }
.links { display: flex; gap: 8px 14px; align-items: center; flex-wrap: wrap; }
.links > a:not(.button-link) { display: inline-flex; align-items: center; gap: 2px; text-decoration: none; font-size: 14px; }
.empty { padding: 18px 0 6px; }

/* ---------- 数字のカード ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-grid.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-grid article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 16px; min-width: 0; }
.kpi-grid span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.kpi-grid span .icon { fill: var(--crema); width: 18px; height: 18px; }
.kpi-grid strong { display: block; margin-top: 6px; font-size: 24px; font-weight: 700; letter-spacing: .01em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-grid:not(.four):not(.compact) strong { font-size: 20px; }
.kpi-grid strong small { font-size: 15px; margin-left: 2px; color: var(--muted); }

/* ---------- ホーム ---------- */
.home-head h1 { font-size: 30px; }
.today { margin: 0 0 4px; font-size: 14px; letter-spacing: .06em; }
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.quick a {
  display: flex; align-items: center; gap: 12px; padding: 16px; min-height: 72px;
  background: var(--sidebar); color: #f4e6d4; border-radius: var(--radius); text-decoration: none; font-weight: 500;
}
.quick a .icon { width: 40px; height: 40px; padding: 8px; border-radius: 12px; background: rgba(201,154,91,.18); fill: var(--crema); }
.quick a:hover { background: var(--roast-dark); color: #fff; }

.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 64px 1fr 100px; gap: 12px; align-items: center; font-variant-numeric: tabular-nums; }
.bar-row span { font-size: 14px; }
.bar-row span small { margin-left: 4px; color: var(--muted); }
.bar-row div { height: 10px; background: #f0ebe5; border-radius: 999px; overflow: hidden; }
.bar-row i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--roast), var(--crema)); }
.bar-row b { text-align: right; font-weight: 700; }

/* ---------- フォーム ---------- */
.stack, .grid-form, .inline-form { display: grid; gap: 14px; }
.grid-form { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
.wide { grid-column: 1 / -1; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
input, select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font: inherit; font-size: 16px; color: var(--ink); background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--crema); box-shadow: 0 0 0 3px rgba(201,154,91,.25); }
input[type="file"] { padding: 9px 10px; font-size: 14px; background: #fbfaf8; }
textarea { line-height: 1.6; }
/* iPhoneの日付・月の欄が横にはみ出さないようにする */
input[type="date"], input[type="month"] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; text-align: left; }
input[type="date"]::-webkit-date-and-time-value, input[type="month"]::-webkit-date-and-time-value { text-align: left; }
label { min-width: 0; }
/* 支払方法の候補 */
.pay-field { display: grid; gap: 8px; min-width: 0; align-self: end; }
.pay-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pay-chip { width: auto; min-height: 32px; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 500; background: #fff; color: var(--ink); border: 1px solid var(--line-strong); }
.pay-chip:hover { background: #f6efe6; color: var(--ink); }
.pay-chip.is-on, .pay-chip.is-on:hover { background: var(--sidebar); color: #f4e6d4; border-color: var(--sidebar); }
button, .button-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 18px; width: 100%;
  border: 0; border-radius: var(--radius-sm);
  background: var(--roast); color: #fff; font: inherit; font-weight: 700; font-size: 15px;
  text-decoration: none; cursor: pointer;
}
button:hover, .button-link:hover { background: var(--roast-dark); color: #fff; }
.button-link { width: auto; min-height: 40px; padding: 8px 16px; font-size: 14px; }
.button-link.ghost { background: transparent; color: var(--roast); border: 1px solid var(--line-strong); }
.button-link.ghost:hover { background: var(--crema-soft); color: var(--roast-dark); }
button .icon, .button-link .icon { fill: currentColor; }
button.danger { background: var(--cherry); }
button.danger:hover { background: #8a2622; }
.inline-form { grid-template-columns: 1.4fr 1fr 1fr auto; align-items: end; margin-bottom: 16px; }
.inline-form.two { grid-template-columns: 1fr auto; }
.inline-form button { width: auto; }
.date-jump { display: grid; grid-template-columns: 1fr auto; gap: 8px; min-width: min(320px, 100%); }
.date-jump button { width: auto; }
label.check { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--ink); }
label.check input { width: 20px; height: 20px; min-height: 0; accent-color: var(--roast); }

/* ---------- 表 ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table { width: 100%; border-collapse: collapse; min-width: 720px; font-variant-numeric: tabular-nums; }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: .04em; white-space: nowrap; border-bottom-color: var(--line-strong); }
tbody tr:hover td { background: #fbf9f6; }
tfoot td { font-weight: 700; border-top: 2px solid var(--ink); border-bottom: 0; }
.num-table td, .num-table th { text-align: right; white-space: nowrap; }
.num-table .text, .num-table th:first-child { text-align: left; }
.num-table tr.group-row td { background: var(--crema-soft); }
.num-table tr.sub-row td { color: var(--muted); padding-top: 7px; padding-bottom: 7px; }
.r { text-align: right; white-space: nowrap; }
.sub { color: var(--muted); font-size: 12px; }
tr.highlight td { background: #fdf8ef; }
.lines td:nth-child(-n+5), .lines th { white-space: nowrap; }
.checks td:nth-child(-n+3), .checks th { white-space: nowrap; }

/* ---------- 小さな部品 ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; margin: 1px; border-radius: 999px; background: #efe7de; color: var(--roast-dark); font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge.warn { background: var(--cherry-soft); color: var(--cherry); }
.badge.ok { background: var(--leaf-soft); color: var(--leaf); }
.badge .icon { width: 14px; height: 14px; }
.notice, .alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); margin: 0 0 16px; }
.notice { background: var(--leaf-soft); color: var(--leaf); }
.alert { background: var(--cherry-soft); color: var(--cherry); }
.notice .icon, .alert .icon { margin-top: 2px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--muted); margin-top: 10px; }
.facts b { color: var(--ink); margin-left: 4px; font-variant-numeric: tabular-nums; }
.row-delete { display: flex; gap: 6px; min-width: 230px; }
.row-delete input { min-height: 36px; padding: 6px 10px; font-size: 13px; }
.row-delete button { width: auto; min-height: 36px; padding: 6px 12px; font-size: 13px; white-space: nowrap; }
.check-list { margin: 0; padding-left: 20px; }
.check-list li { margin: 4px 0; }

/* ---------- ログイン ---------- */
.is-auth { background: var(--sidebar); }
.is-auth .shell { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.auth { display: grid; gap: 28px; justify-items: center; width: min(400px, 100%); }
.auth-brand { text-align: center; }
.auth-mark { width: 58px; height: 58px; fill: var(--crema); }
.auth-name { margin: 8px 0 0; font-family: var(--serif); font-size: 30px; font-weight: 700; letter-spacing: .14em; color: #f4e6d4; }
.auth-sub { margin: 2px 0 0; font-size: 12px; letter-spacing: .4em; color: #a8968a; }
.auth-card { width: 100%; background: var(--surface); border-radius: 18px; padding: 26px 24px; }
.auth-card h1 { font-size: 19px; margin-bottom: 16px; }

/* ---------- レシート読み取り ---------- */
.ocr-area { display: grid; gap: 10px; padding: 14px; border-radius: var(--radius); background: var(--crema-soft); }
.camera-button {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 58px;
  border-radius: 12px; background: var(--sidebar); color: #f4e6d4; font-size: 16px; font-weight: 700; cursor: pointer;
}
.camera-button .icon { width: 26px; height: 26px; fill: var(--crema); }
.camera-button:hover { background: var(--roast-dark); }
/* display:none にすると一部のiPhoneで写真を選んだあとの通知（change）が届かないことがあるため、見えないだけにする */
.camera-button { position: relative; overflow: hidden; }
.camera-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ocr-area > .sub { color: #8a7566; }
.ocr-box { display: grid; grid-template-columns: 140px 1fr; gap: 14px; align-items: start; }
.ocr-thumbs { display: flex; flex-direction: column; gap: 6px; }
.ocr-thumbs img { width: 140px; max-height: 200px; object-fit: contain; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.ocr-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.camera-button.secondary { min-height: 48px; font-size: 14px; background: #fff; color: var(--sidebar); border: 1px solid var(--line-strong); }
.camera-button.secondary .icon { width: 22px; height: 22px; fill: var(--sidebar); }
.camera-button.secondary:hover { background: #f6efe6; }
.batch-box { padding: 12px 14px; border-radius: var(--radius-sm); background: #fff; border: 1px solid var(--line); }
.batch-status { margin: 0 0 8px; font-weight: 700; color: var(--ink); }
.batch-list { display: grid; gap: 4px; margin: 0 0 6px; padding: 0; list-style: none; max-height: 220px; overflow: auto; }
.batch-item { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 4px 6px; border-radius: 8px; font-size: 12px; }
.batch-item img { width: 32px; height: 40px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); background: #fff; }
.batch-item .batch-pdf { display: grid; place-items: center; width: 32px; height: 40px; border-radius: 4px; background: #b3261e; color: #fff; font-size: 10px; font-weight: 700; }
.batch-item .batch-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-item .batch-state { color: #8a7566; }
.batch-item.is-current { background: var(--crema-soft); font-weight: 700; }
.batch-item.is-saved .batch-state { color: #2e7d32; }
.batch-item.is-error .batch-state { color: #b3261e; }
.batch-item.is-skipped { opacity: .55; }
.camera-button.small { min-height: 44px; padding: 0 16px; font-size: 14px; }
.camera-button.small .icon { width: 20px; height: 20px; }
.ocr-actions .button-link { min-height: 44px; }
.ocr-box p { margin: 0 0 6px; color: var(--ink); }
#ocr-status.has-warn { padding: 8px 10px; border-radius: 8px; background: var(--cherry-soft); color: var(--cherry); }
.ocr-box pre { white-space: pre-wrap; font-size: 12px; max-height: 240px; overflow: auto; background: #fff; padding: 10px; border-radius: 8px; }
.ocr-ver { font-size: 11px; opacity: .85; }
.ocr-log { margin: 6px 0 0; padding-left: 1.4em; font-size: 12px; line-height: 1.6; color: #6b5a4e; max-height: 260px; overflow: auto; }
.ocr-log li.err { color: #b3261e; font-weight: 700; }
.ocr-check { border-color: #b3261e !important; box-shadow: 0 0 0 3px rgba(179,38,30,.18) !important; }
.ocr-filled { background: #fff8ea !important; border-color: var(--crema) !important; }
.sub-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.sub-grid[hidden], [data-single-only][hidden] { display: none; }
.split-box { padding: 14px; border-radius: var(--radius-sm); background: #fbf8f3; border: 1px dashed var(--line-strong); }

/* ---------- 取引先を選ぶ（経費の入力） ---------- */
.vendor-pick { display: grid; gap: 10px; padding: 14px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line-strong); }
.vendor-pick-title { margin: 0; font-weight: 700; color: var(--ink); }
.vendor-pick-title .sub { margin-left: 6px; font-weight: 400; }
.vendor-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.vendor-chip { width: auto; min-height: 44px; padding: 6px 14px; border-radius: 12px; font-size: 14px; font-weight: 700; background: var(--crema-soft); color: var(--roast-dark); border: 1px solid #ead9c2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vendor-chip:hover { background: #f1e1c9; color: var(--roast-dark); }
.vendor-chip.is-on, .vendor-chip.is-on:hover { background: var(--sidebar); color: #f4e6d4; border-color: var(--sidebar); }
.vendor-pick-row { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 12px; align-items: end; }
#vendor-note:empty { display: none; }
.pick-filled { background: #f3f7f1 !important; border-color: #a9c1a3 !important; }
/* 読み方の切り替え（速く／詳しく） */
.ocr-mode { display: flex; flex-wrap: wrap; gap: 6px; }
.mode-opt { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--line-strong); color: var(--ink); font-size: 13px; font-weight: 400; cursor: pointer; }
.mode-opt input { width: 18px; height: 18px; min-height: 0; accent-color: var(--roast); }
.mode-opt:has(input:checked) { border-color: var(--roast); box-shadow: 0 0 0 2px rgba(107,63,42,.15); }
/* 保存ボタン（入力中の取引先と合計を出したまま、画面の下に付いてくる） */
.entry-bar { position: sticky; top: 6px; z-index: 15; display: grid; gap: 8px; margin: 0 -10px; padding: 10px 12px; border-radius: 14px;
  background: rgba(42, 29, 23, .96); color: #f4e6d4; box-shadow: 0 6px 18px rgba(42, 29, 23, .18); }
.entry-now { margin: 0; display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; min-width: 0; }
.entry-label { font-size: 11px; color: #c8b4a2; }
#entry-vendor { font-size: 16px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
#entry-vendor.is-empty { color: #f2c14e; }
.entry-total { font-size: 14px; font-variant-numeric: tabular-nums; color: #f4e6d4; }
.entry-tax, .entry-date { font-size: 13px; font-variant-numeric: tabular-nums; color: #d9c6b4; }
.entry-tax:empty { display: none; }
/* 金額と税額の照合（v31）: 合っていれば緑、合わなければ赤 */
.entry-bar { transition: background-color .2s; }
.entry-bar.is-ok { background: rgba(28, 82, 52, .97); }
.entry-bar.is-ng { background: rgba(158, 32, 32, .97); }
.entry-check { font-size: 13px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.entry-check:empty { display: none; }
.vendor-pick.need-vendor { outline: 3px solid #c0392b; outline-offset: 4px; border-radius: 12px; }
.entry-bar.is-ok .entry-check { background: #d7f0df; color: #14462b; }
.entry-bar.is-ng .entry-check { background: #ffe1dc; color: #7a1c1c; }
.entry-buttons { display: flex; gap: 8px; }
.entry-buttons button { width: auto; flex: 1 1 auto; min-height: 46px; background: var(--crema); color: var(--sidebar); }
.entry-buttons button:hover { background: #d8ad72; color: var(--sidebar); }
.entry-buttons .save-end { flex: 0 0 auto; background: transparent; color: #f4e6d4; border-color: rgba(244, 230, 212, .4); }
.entry-buttons .save-end:hover { background: rgba(255,255,255,.08); color: #fff; }
.save-help { margin: -6px 0 0; }
/* 使い方（開閉） */
.help-box summary { cursor: pointer; font-size: 12px; color: #8a7566; }
.clickpost-link { display: inline-flex; align-items: center; gap: 4px; color: #8a7566; }
.clickpost-link .icon { width: 16px; height: 16px; fill: currentColor; }
.help-box p { margin: 6px 0 0; }
.vendor-chip.is-fav { background: #fff6dc; border-color: #e8cf8a; }
.vendor-chip .star { color: #c58a00; margin-right: 4px; }
.vendor-chip.is-on .star { color: #f2c14e; }
.vendor-chips-label { margin: 2px 0 -4px; }
/* 最近登録したレシート（どこまで入力したか） */
.recent-box { margin: -4px 0 14px; padding: 10px 14px; border-radius: var(--radius-sm); background: #fbf9f6; border: 1px solid var(--line); }
.recent-box summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.recent-list { margin: 8px 0 2px; padding: 0; list-style: none; display: grid; gap: 2px; }
.recent-list li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 10px; align-items: baseline; padding: 3px 6px; border-radius: 6px; font-size: 14px; }
.recent-box summary { list-style: none; }
.recent-box summary::-webkit-details-marker { display: none; }
.recent-last b { color: var(--ink); }
.recent-list li.is-last { background: var(--leaf-soft); font-weight: 700; }
.recent-list .r-vendor { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-list .r-total { font-variant-numeric: tabular-nums; text-align: right; }
/* 登録済みのレシート一覧 */
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.seg a { padding: 8px 14px; font-size: 13px; text-decoration: none; color: var(--roast); }
.seg a.is-on { background: var(--sidebar); color: #f4e6d4; }
.day-strip { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 3px; margin-bottom: 14px; }
.day-strip .day { display: grid; text-align: center; padding: 3px 0; border-radius: 6px; background: #f3efea; font-size: 11px; color: var(--muted); }
.day-strip .day i { font-style: normal; }
.day-strip .day b { min-height: 1.2em; color: var(--ink); font-size: 13px; }
.day-strip .day.has { background: var(--leaf-soft); }
.day-strip .day.sun i { color: var(--cherry); }
.day-strip .day.sat i { color: #2f5d8a; }
.registered-table tr.is-last td { background: var(--leaf-soft); }
.registered-table tr.new-day td { border-top: 2px solid var(--line-strong); }
/* 取引先の統合・★ */
.merge-box { display: grid; gap: 10px; margin-bottom: 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: #fff4e5; border: 1px solid #f0d3a8; }
.merge-title { margin: 0; display: flex; gap: 6px; align-items: center; font-weight: 700; color: var(--roast-dark); }
.merge-title .icon { width: 18px; height: 18px; fill: #b06a00; }
.merge-group { display: grid; gap: 6px; padding: 10px 12px; border-radius: 8px; background: #fff; border: 1px solid var(--line); }
.merge-num { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.merge-opts { display: grid; gap: 4px; }
.merge-group button { justify-self: start; }
.fav-form { display: inline; margin-right: 4px; }
.fav-button { width: auto; min-height: 0; padding: 0 4px; background: transparent; color: #b9a690; font-size: 20px; line-height: 1; border: 0; }
.fav-button:hover { background: transparent; color: #c58a00; }
.fav-button.is-on { color: #e0a800; }

/* ---------- 店舗以外の売上・売上の合計 ---------- */
.grand-total { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 16px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--crema-soft); }
.grand-total > div { display: grid; gap: 2px; }
.grand-total span { font-size: 12px; color: var(--muted); }
.grand-total b { font-size: 18px; font-variant-numeric: tabular-nums; color: var(--ink); }
.grand-total .op { font-size: 18px; color: var(--muted); }
.grand-total .sum { margin-left: auto; text-align: right; }
.grand-total .sum b { font-size: 24px; color: var(--roast-dark); }
@media (max-width: 760px) { .grand-total .sum { margin-left: 0; width: 100%; text-align: left; } }

/* ---------- クリックポストの取り込み ---------- */
#clickpost-result, #clickpost-form > * { min-width: 0; }
.clickpost-table { min-width: 620px; }
.clickpost-table td { vertical-align: middle; padding: 6px 8px; }
.clickpost-table input[type="date"] { min-height: 38px; padding: 6px 8px; font-size: 14px; width: 150px; }
.clickpost-table .fare-input { min-height: 38px; padding: 6px 8px; width: 90px; text-align: right; font-size: 14px; }
.clickpost-table input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; accent-color: var(--roast); }
.clickpost-table tr.is-check td { background: var(--cherry-soft); }
.clickpost-table tr.is-off td { opacity: .45; }
.clickpost-table .badge { margin-left: 6px; }
.clickpost-group { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.clickpost-group legend { font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 4px; }
.clickpost-summary { margin: 0; font-weight: 700; color: var(--ink); }
#clickpost-status.has-warn, #settlement-status.has-warn { padding: 8px 10px; border-radius: 8px; background: var(--cherry-soft); color: var(--cherry); }
.upload-kinds { margin: 0 0 12px; padding-left: 20px; line-height: 1.8; }

/* ---------- 取引先ページ ---------- */
.number-state:empty { display: none; }
.number-state.is-ok { color: var(--leaf); }
.number-state.is-ng { color: var(--cherry); font-weight: 700; }
.vendor-found { margin: 6px 0; padding: 8px 10px; border-radius: 8px; background: #fff4e5; color: var(--roast-dark); font-size: 13px; }
.inline-search { display: flex; gap: 8px; align-items: center; }
.inline-search input { min-height: 40px; width: 220px; }
.button-link.small { min-height: 34px; padding: 4px 10px; font-size: 13px; }
.badge.ghost { background: transparent; border: 1px dashed var(--line-strong); }
.nowrap { white-space: nowrap; }
.vendor-table td { vertical-align: top; }

/* ---------- レシートの合計欄 ---------- */
.receipt-sum { padding: 14px 16px; border-radius: var(--radius-sm); background: #fffdf8; border: 1px solid var(--line); }
.receipt-sum-title { margin: 0 0 8px; font-weight: 700; }
.receipt-sum dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 18px; margin: 0; }
.receipt-sum dl > div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dotted var(--line); }
.receipt-sum dl > div[hidden] { display: none; }
.receipt-sum dt { color: #8a7566; font-size: 13px; }
.receipt-sum dd { margin: 0; font-variant-numeric: tabular-nums; }
.receipt-sum .sum-total dd { font-weight: 700; font-size: 17px; }
.receipt-sum .sub { margin: 8px 0 0; }
.warn-text { color: #b3261e !important; font-weight: 700; }

/* ---------- 経費一覧（レシート単位） ---------- */
.receipt-row td { vertical-align: top; }
.receipt-thumb { display: inline-block; width: 44px; height: 58px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); background: #fff; vertical-align: middle; }
.receipt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.receipt-parts { margin: 6px 0 0; padding: 0; list-style: none; font-size: 12px; color: #6b5a4e; line-height: 1.7; }
.receipt-parts li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.receipt-parts a { color: inherit; }
.receipt-parts .n { font-variant-numeric: tabular-nums; }
td .sub-line { display: block; font-size: 12px; color: #8a7566; font-variant-numeric: tabular-nums; }

/* ---------- 重複・削除 ---------- */
.dup-box { align-items: flex-start; }
.dup-box p { margin: 0 0 6px; }
.dup-box ul { margin: 0 0 8px; padding-left: 1.2em; }
.dup-box .inline-actions button { width: auto; }
.dup-warn { margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; background: #fdecea; color: #b3261e; font-weight: 700; font-size: 13px; }
.dup-warn a { color: inherit; }
a.badge.warn { text-decoration: none; }
.danger-zone { border: 1px solid #f1c7c2; }
button.danger { background: #b3261e; width: auto; }
button.danger:hover { background: #8f1d17; }
.link-button { width: auto; min-height: 0; padding: 0; background: none; color: inherit; text-decoration: underline; font-weight: 500; font-size: inherit; }
.link-button:hover { background: none; }

/* ---------- スマホ ---------- */
@media (max-width: 760px) {
  .kpi-grid, .kpi-grid.four, .kpi-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-grid strong { font-size: 20px; }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .quick a { padding: 12px; min-height: 64px; font-size: 14px; }
  .grid-form, .inline-form, .sub-grid { grid-template-columns: 1fr; }
  .inline-form button { width: 100%; }
  .date-jump { grid-template-columns: 1fr auto; width: 100%; }
  .panel { padding: 16px; }
  .page-head { margin-bottom: 16px; }
  .ocr-box { grid-template-columns: 90px 1fr; }
  .ocr-thumbs img { width: 90px; }
  .ocr-actions > * { flex: 1 1 100%; }
  .receipt-sum dl { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; }
  /* 経費一覧はスマホではレシートごとのカード表示 */
  .receipt-table { min-width: 0; }
  .receipt-table thead { display: none; }
  .receipt-table, .receipt-table tbody, .receipt-table tfoot { display: block; width: 100%; }
  .receipt-table tr.receipt-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 2px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .receipt-table tr.receipt-row td { display: block; padding: 0; border: 0; white-space: normal; }
  .receipt-row .c-thumb { grid-column: 1; grid-row: 1 / span 4; }
  .receipt-row .c-date { grid-column: 2; grid-row: 1; font-size: 12px; color: #8a7566; }
  .receipt-row .c-vendor { grid-column: 2; grid-row: 2; font-weight: 700; }
  .receipt-row .c-total { grid-column: 3; grid-row: 1 / span 3; text-align: right; }
  .receipt-row .c-acct { grid-column: 2; grid-row: 3; }
  .receipt-row .c-type, .receipt-row .c-rate, .receipt-row .c-pay { grid-row: 4; display: inline-block; font-size: 12px; }
  .receipt-row .c-type { grid-column: 2; }
  .receipt-row .c-rate { grid-column: 3; justify-self: end; }
  .receipt-row .c-pay { grid-column: 2; justify-self: end; color: #8a7566; }
  .receipt-row .c-edit { grid-column: 3; grid-row: 3; text-align: right; align-self: end; }
  .receipt-row .c-total { grid-row: 1 / span 2; }
  .receipt-table tr.receipt-foot { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; }
  .receipt-table tr.receipt-foot td { display: block; padding: 0; border: 0; }
  .receipt-table tr.receipt-foot td:last-child { display: none; }
  .receipt-sum dt { font-size: 12px; }
  .vendor-pick-row { grid-template-columns: 1fr; }
  .entry-bar { top: calc(64px + env(safe-area-inset-top)); margin: 0 -6px; padding: 8px 10px; }
  #entry-vendor { font-size: 15px; }
  .entry-buttons button { min-height: 42px; font-size: 14px; }
  .recent-list li { grid-template-columns: 38px minmax(0, 1fr) auto auto; gap: 8px; font-size: 13px; }
  .day-strip { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .seg { display: flex; }
  .seg a { flex: 1; text-align: center; }
  .vendor-chip { min-height: 38px; padding: 4px 11px; font-size: 13px; border-radius: 10px; }
  .vendor-pick { padding: 12px; gap: 8px; }
  .ocr-area { padding: 12px; gap: 8px; }
  .camera-button { min-height: 52px; }
  .camera-button.secondary { min-height: 42px; font-size: 13px; }
  .mode-opt { padding: 6px 10px; font-size: 12px; }
  .pay-chip { min-height: 30px; padding: 3px 10px; font-size: 11.5px; }
  .inline-search, .inline-search input { width: 100%; }
  .save-row button, .save-row .save-end { flex: 1 1 100%; }
  .bar-row { grid-template-columns: 54px 1fr 86px; }
}
.lines td.sub { white-space: nowrap; }

/* ---------- カード払いの請求書・領収書の取り込み ---------- */
#card-result, #card-form > * { min-width: 0; }
.card-table { min-width: 980px; }
.card-table .card-text { min-height: 38px; padding: 6px 8px; font-size: 14px; width: 150px; }
.card-table tr.card-note td { padding-top: 0; border-top: 0; color: #8a5a44; }
.card-table tr[data-index] td:nth-child(2) { min-width: 240px; }
.card-table .card-text { width: 130px; }

/* 月次資料: この月の書類チェック（v24） */
.month-checklist details > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.month-checklist details > summary::-webkit-details-marker { display: none; }
.month-checklist details > summary h2 { margin: 0; }
.month-checklist h3 { margin: 18px 0 6px; font-size: 15px; }
.checklist-table td { vertical-align: top; }
.checklist-table td.st { width: 96px; white-space: nowrap; }
.checklist-table td.act { width: 150px; text-align: right; white-space: nowrap; }
.checklist-table tr.is-missing td { background: #fff7f3; }
.checklist-table tr.is-none td, .checklist-table tr.is-na td { color: #8b7d72; }
.checklist-table .badge.ghost { margin-left: 6px; font-size: 11px; padding: 0 8px; }
.cl-form { display: inline; margin: 0; }
.cl-form button { width: auto; min-height: 32px; padding: 4px 12px; font-size: 13px; }
.cl-form button.ghost { background: transparent; color: var(--roast-dark); border: 1px solid var(--line-strong); }
.cl-form button.link-button { min-height: 0; padding: 0; }
.cl-upload { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.cl-upload input[type=file] { max-width: 260px; font-size: 13px; }
@media (max-width: 640px) {
  .checklist-table, .checklist-table tbody { display: block; min-width: 0; width: 100%; }
  .checklist-table tr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; padding: 10px 4px; border-bottom: 1px solid var(--line-strong); }
  .checklist-table td { display: block; width: auto !important; padding: 0; border: 0; overflow-wrap: anywhere; }
  .checklist-table td.act { grid-column: 2; text-align: left; }
  .cl-upload input[type=file] { max-width: 100%; }
}

/* v25: 通帳から反映した経費に請求書を付ける */
.bank-attach { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-top: 4px; }
.bank-attach label.link-button { cursor: pointer; display: inline-flex; align-items: center; gap: 2px; }
.bank-attach svg { width: 16px; height: 16px; }

/* v26: 書類チェックのリンク・ログイン情報 */
.cl-linkbar { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: 6px; }
.cl-linkbar .button-link svg, .cl-linkedit summary svg { width: 15px; height: 15px; }
.cl-linkbar .cl-id { color: var(--ink); font-variant-numeric: tabular-nums; }
.cl-linkbar .link-button { min-height: 0; padding: 0; width: auto; }
.cl-linkedit { margin-top: 6px; }
.cl-linkedit summary { cursor: pointer; display: inline-flex; align-items: center; gap: 4px; list-style: none; }
.cl-linkedit summary::-webkit-details-marker { display: none; }
.cl-linkform { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; margin-top: 8px; padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--surface); }
.cl-linkform .wide { grid-column: 1 / -1; }
.cl-linkform > * { min-width: 0; }
.cl-linkform input { width: 100%; min-width: 0; box-sizing: border-box; }
.cl-linkbtns { display: flex; gap: 14px; align-items: center; }
.cl-linkbtns button { width: auto; min-height: 34px; padding: 4px 16px; font-size: 13px; }
.cl-linkbtns button.link-button { min-height: 0; padding: 0; }
@media (max-width: 640px) { .cl-linkform { grid-template-columns: minmax(0, 1fr); } }
.checklist-table td:nth-child(2), .cl-linkform, .cl-linkbar { white-space: normal; }

/* v27: 書類チェックの取り込み先 */
.checklist-table td.act { width: auto; min-width: 150px; }
.checklist-table td.act .cl-import { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 6px 6px; white-space: nowrap; }
.checklist-table td.act .cl-import svg { width: 15px; height: 15px; }
@media (max-width: 640px) { .checklist-table td.act { white-space: normal; min-width: 0; } .checklist-table td.act .cl-import { margin: 0 8px 6px 0; } }

/* v32: 月次資料の経費の絞り込み・日ごとの経費 */
a.pay-chip { display: inline-flex; align-items: center; text-decoration: none; }
.pay-filter { justify-content: flex-end; }
.day-expenses tr.is-sun td:first-child { color: var(--cherry); }
.day-expenses tr.is-sat td:first-child { color: #3b6ea5; }
.day-expenses .badge { font-size: 11px; padding: 0 8px; }
.refund-field { display: grid; gap: 4px; }
.refund-field label.check { font-size: 13.5px; }
.refund-field:has(input:checked) { padding: 8px 10px; border-radius: 10px; background: var(--cherry-soft); }

/* v33: 消費税のまとめ（参考） */
.tax-summary tfoot td { font-weight: 700; }
.tax-input { margin-top: 10px; }
.tax-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 8px 0; }
.tax-form .wide { grid-column: 1 / -1; }
.tax-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tax-actions button { width: auto; }
.tax-actions button.ghost { background: transparent; color: var(--roast-dark); border: 1px solid var(--line-strong); }
@media (max-width: 600px) { .tax-form { grid-template-columns: 1fr; } }

/* v34: 請求書を作る */
.invoice-form .grid-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.invoice-form .wide2 { grid-column: span 2; }
.invoice-form input.readonly { background: #f6f3ef; color: var(--muted); }
.basis-field { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.basis-field legend { font-size: 13px; font-weight: 500; color: var(--muted); padding: 0; margin-bottom: 6px; }
.inv-items { min-width: 720px; }
.inv-items td { padding: 6px 4px; }
.inv-items input, .inv-items select { min-height: 38px; padding: 6px 8px; font-size: 14px; }
.inv-items .c-date { width: 76px; } .inv-items .c-qty { width: 70px; } .inv-items .c-unit { width: 100px; } .inv-items .c-rate { width: 112px; }
.inv-items .c-incl { width: 44px; text-align: center; } .inv-items .c-incl input { width: 20px; height: 20px; min-height: 0; accent-color: var(--roast); }
.inv-items .c-amount { width: 110px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.inv-items .c-del { width: 34px; } .inv-items .c-del button { background: none; color: var(--muted); border: 0; min-height: 0; padding: 4px 8px; font-size: 18px; width: auto; }
.inv-items th.r, .inv-items td.r { text-align: right; }
.inv-totals { margin-top: 8px; }
.inv-total { font-size: 18px; color: var(--ink); text-align: right; margin: 8px 0 0; }
.inv-total b { font-size: 24px; margin-left: 8px; }
.seller-box summary { font-weight: 700; cursor: pointer; }
.seller-box .grid-form { margin-top: 12px; }
.inv-actions { border-color: var(--line-strong); }
.inv-actions .inv-buttons { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.inv-actions .inv-buttons button { width: auto; }
.inv-actions button.ghost { background: transparent; color: var(--roast); border: 1px solid var(--line-strong); }
.inv-sum b { font-size: 20px; margin-left: 6px; }
.inv-preview iframe { width: 100%; height: 75vh; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
@media (max-width: 760px) {
  /* 明細はスマホでは1行を2段にする: 日付・品名・× ／ 数量・単価・税率・税込・金額 */
  .inv-items { min-width: 0; }
  .inv-items thead { display: none; }
  .inv-items tr { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .inv-items td { padding: 0; border: 0; width: auto !important; min-width: 0; }
  .inv-items td.c-date { grid-row: 1; grid-column: 1 / 4; } .inv-items td.c-name { grid-row: 1; grid-column: 4 / 10; } .inv-items td.c-del { grid-row: 1; grid-column: 10 / 11; text-align: right; }
  .inv-items td.c-qty, .inv-items td.c-unit, .inv-items td.c-rate, .inv-items td.c-incl, .inv-items td.c-amount { grid-row: 2; }
  .inv-items td.c-qty { grid-column: span 2; } .inv-items td.c-unit { grid-column: span 2; } .inv-items td.c-rate { grid-column: span 2; }
  .inv-items td.c-incl { grid-column: span 1; display: flex; align-items: center; justify-content: center; } .inv-items td.c-amount { grid-column: span 3; align-self: end; font-size: 12.5px; white-space: normal; text-align: right; }
  .inv-items select { padding-right: 2px; }
  .inv-items td[data-label]::before { content: attr(data-label); display: block; font-size: 10.5px; color: var(--muted); margin-bottom: 2px; }
  .inv-items td.c-incl { flex-direction: column; } .inv-items td.c-name::before, .inv-items td.c-date::before { display: none; }
  .inv-items input, .inv-items select { padding: 6px; font-size: 16px; }
  .invoice-form .grid-form { grid-template-columns: 1fr; }
  .invoice-form .wide2 { grid-column: auto; }
  .inv-preview iframe { height: 60vh; }
}
.invoice-form button.ghost { background: transparent; color: var(--roast); border: 1px solid var(--line-strong); width: auto; }
.invoice-form button.small { min-height: 34px; padding: 4px 12px; font-size: 13px; }

/* v35: 登録番号が2つあるレシート */
.dual-box { padding: 14px; border-radius: var(--radius-sm); background: #fbf8f3; border: 1px dashed var(--line-strong); }
.dual-box .dual-note { margin: 0; }

/* v36: 登録番号が2つあるレシートの入れ忘れ */
.need-dual { outline: 2px solid var(--cherry); outline-offset: 3px; border-radius: var(--radius-sm); }
.dual-error { margin: 0; color: var(--cherry); font-size: 13px; font-weight: 500; }
.dual-skip { font-size: 13px; }

/* v38: 納品書 */
.inv-items .from-delivery input, .inv-items .from-delivery select { background: #f6f3ef; color: var(--ink); }
.inv-items .from-delivery td.c-name input { font-weight: 600; }
.delivery-pick { border-color: var(--line-strong); }
.delivery-pick .delivery-list { display: grid; gap: 6px; margin: 4px 0 10px; }
.delivery-pick .delivery-list label { font-weight: 400; }
.delivery-take { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.inline-delete summary { cursor: pointer; list-style: none; }
.inline-delete summary::-webkit-details-marker { display: none; }
.inline-delete .row-delete { margin-top: 6px; }
@media (max-width: 760px) {
  .inv-items.is-delivery td.c-name { grid-column: 1 / 10; }
}

/* 税理士さんに渡すリンク（v40） */
.share-new { border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 14px; margin: 0 0 16px; background: var(--crema-soft); }
.share-new .notice { margin-bottom: 12px; }
.share-new-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; margin: 0 0 12px; }
.share-new-label { grid-column: 1 / -1; font-size: 13px; font-weight: 700; color: var(--ink); }
.share-url { width: 100%; font-size: 13px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.share-password { font-size: 22px; letter-spacing: .12em; font-weight: 700; font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--ink); background: var(--surface); padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); justify-self: start; }
.share-copy-out { display: block; min-height: 1.2em; font-size: 12px; color: var(--leaf); }
.share-create { display: grid; gap: 10px; margin: 0 0 16px; }
.share-create details { font-size: 13px; }
.share-create summary { cursor: pointer; color: var(--muted); }
.share-create .share-base { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--ink); word-break: break-all; }
.share-create label { display: grid; gap: 4px; margin-top: 8px; }
.share-create > button { justify-self: start; width: auto; }
.share-table tr.share-expired td, .share-table tr.share-revoked td { color: var(--muted); }
.share-page .auth-card p { color: var(--ink); }
.share-page .auth-card p.sub { color: var(--muted); }
.share-dl { width: 100%; min-height: 48px; font-size: 16px; }

/* ---------- 経費の登録画面を短く・読み方の撮影ボタン（v42） ---------- */
.step-no { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px; border-radius: 50%; background: var(--sidebar); color: #f4e6d4; font-size: 12px; font-weight: 700; vertical-align: 1px; }
.ocr-area .vendor-pick-title { margin: 0; }
.ocr-mode { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mode-cam { justify-content: flex-start; gap: 10px; min-height: 66px; padding: 8px 14px; text-align: left; }
.mode-cam[data-mode="full"] { background: var(--roast); }
.mode-cam[data-mode="full"]:hover { background: var(--roast-dark); }
.mode-cam .mode-text { display: grid; gap: 1px; line-height: 1.25; min-width: 0; }
.mode-cam .mode-text b { font-size: 17px; letter-spacing: .04em; }
.mode-cam .mode-text small { font-size: 11.5px; font-weight: 400; opacity: .85; }
.mode-cam .mode-last { display: none; position: absolute; top: 6px; right: 8px; padding: 1px 7px; border-radius: 999px; background: var(--crema); color: var(--roast-dark); font-size: 10.5px; font-weight: 700; }
.mode-cam.is-last { box-shadow: 0 0 0 3px rgba(200, 150, 90, .55); }
.mode-cam.is-last .mode-last { display: inline-block; }
.ocr-more-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.ocr-more-links .camera-button.secondary { flex: 1 1 260px; min-height: 42px; padding: 0 12px; font-size: 13.5px; }
.ocr-more-links .clickpost-link { font-size: 12.5px; }
.ocr-area .help-box .ocr-ver { display: block; margin-top: 6px; }
.ocr-tools summary { cursor: pointer; font-size: 12px; color: #8a7566; }
.ocr-tools > .sub { margin: 8px 0 2px; }
@media (max-width: 760px) {
  .page-head p { display: none; }
  .save-help { display: none; }
  /* ★と直近のお店は1行で横にスクロール */
  .vendor-pick .vendor-chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -12px; padding: 2px 12px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
  .vendor-pick .vendor-chips::-webkit-scrollbar { display: none; }
  .vendor-pick .vendor-chip { flex: 0 0 auto; max-width: 70vw; scroll-snap-align: start; }
  .vendor-pick-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .mode-cam { min-height: 60px; padding: 8px 10px; gap: 8px; }
  .mode-cam .icon { width: 22px; height: 22px; }
  .mode-cam .mode-text b { font-size: 15.5px; }
  .mode-cam .mode-text small { font-size: 10.5px; }
  .mode-cam .mode-last { top: 4px; right: 6px; font-size: 9.5px; padding: 0 5px; }
  .ocr-more-links .camera-button.secondary { min-height: 38px; font-size: 12.5px; }
}
/* 撮影した写真を送るための見えない入力欄の入れ物。表の1マスを使わないようにする（PCで日付の左が空いていた・v42） */
#receipt-extra { display: contents; }
