/* 全ページ共通のスタイル: サイドバー・数値タイル・進捗バー・状態札・カード・表・フォーム。ライト/ダーク両対応 */
:root {
  --bg: #f4f5f7; --surface: #ffffff; --surface-2: #f0f1f4; --line: #e3e5ea;
  --ink: #1b2130; --ink-2: #4a5263; --muted: #7a8394;
  --accent: #2f5bd3; --accent-soft: #e8eefc;
  --good: #0ca30c; --good-ink: #006300; --warn: #fab219; --warn-ink: #7a5200; --bad: #d03b3b; --bad-ink: #a82424;
  --side: #1d2433; --side-ink: #c9cfdb; --side-active: #2c3547;
  --radius: 12px; --shadow: 0 1px 2px rgba(20, 30, 50, .06), 0 2px 8px rgba(20, 30, 50, .04);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121419; --surface: #1a1d24; --surface-2: #232730; --line: #2e333e;
    --ink: #e8eaef; --ink-2: #b4bac6; --muted: #8b93a3;
    --accent: #7c9cff; --accent-soft: #1f2a4a;
    --good-ink: #3fcf5b; --warn-ink: #f5c04a; --bad-ink: #ff7b72;
    --side: #0d0f13; --side-active: #1f2430; --shadow: none;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
       background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.55; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.icon { width: 18px; height: 18px; flex-shrink: 0; vertical-align: -3px; }
.icon--sm { width: 14px; height: 14px; vertical-align: -2px; }

/* ---- レイアウト ---- */
.shell { display: flex; min-height: 100vh; }
.side { width: 220px; background: var(--side); color: var(--side-ink); padding: 18px 10px; flex-shrink: 0;
        display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side__brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 18px; color: #fff; font-weight: bold; }
.side__brand small { display: block; font-weight: normal; color: var(--side-ink); font-size: 12px; }
.side__logo { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; color: #fff; }
.side__group { font-size: 11px; color: #7f889b; padding: 14px 12px 4px; letter-spacing: .05em; }
.side__link { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--side-ink); }
.side__link:hover { background: var(--side-active); text-decoration: none; color: #fff; }
.side__link.is-active { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.side__link .count { margin-left: auto; }
.side__foot { margin-top: auto; padding: 12px; border-top: 1px solid #2e3647; font-size: 12px; display: flex; align-items: center; gap: 8px; }
.side__foot button { margin-left: auto; background: none; border: 1px solid #3a4357; color: var(--side-ink); border-radius: 6px; padding: 3px 8px; cursor: pointer; font: inherit; }
.count { background: var(--bad); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; line-height: 18px; font-weight: bold; }
.main { flex: 1; min-width: 0; padding: 24px 28px 60px; max-width: 1280px; }

/* ---- ページ見出し ---- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 22px; margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
h2 { font-size: 16px; margin: 28px 0 10px; display: flex; align-items: center; gap: 8px; }

/* ---- 数値タイル ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
        color: var(--ink); display: block; }
a.tile:hover { text-decoration: none; border-color: var(--accent); }
.tile__label { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13px; }
.tile__value { font-size: 28px; font-weight: bold; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.tile__value small { font-size: 14px; font-weight: normal; color: var(--muted); margin-left: 2px; }
.tile__sub { color: var(--muted); font-size: 12px; }
.tile--warn { border-left: 4px solid var(--warn); }
.tile--bad { border-left: 4px solid var(--bad); }
.tile--good { border-left: 4px solid var(--good); }

/* ---- 進捗バー ---- */
.meter { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.meter__track { flex: 1; height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.meter__fill { height: 100%; background: var(--accent); border-radius: 4px; }
.meter__fill.is-done { background: var(--good); }
.meter__text { font-size: 12px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }
.meter--lg .meter__track { height: 12px; border-radius: 6px; }

/* ---- 状態札（アイコン＋文字。色だけで意味を持たせない） ---- */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px 2px 7px; border-radius: 999px; font-size: 12px;
        white-space: nowrap; color: var(--ink); background: var(--surface-2); line-height: 20px; }
.pill .icon { width: 13px; height: 13px; vertical-align: 0; }
.pill--good { background: color-mix(in srgb, var(--good) 14%, transparent); } .pill--good .icon { color: var(--good-ink); }
.pill--warn { background: color-mix(in srgb, var(--warn) 22%, transparent); } .pill--warn .icon { color: var(--warn-ink); }
.pill--bad { background: color-mix(in srgb, var(--bad) 14%, transparent); } .pill--bad .icon { color: var(--bad-ink); }
.pill--muted { color: var(--muted); }

/* ---- カード・パネル ---- */
.panel, .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { padding: 16px 18px; margin-bottom: 16px; }
.card__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card__head h3 { margin: 0; font-size: 15px; }
.card__body { padding: 14px 18px; }
.card__foot { padding: 12px 18px; background: var(--surface-2); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.notice { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--warn);
          border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; flex-wrap: wrap; }
.notice--good { border-left-color: var(--good); }

/* ---- タブ ---- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tab { padding: 9px 14px; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 6px;
       align-items: center; background: none; border-top: 0; border-left: 0; border-right: 0; cursor: pointer; font: inherit; }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); font-weight: bold; }
.tab .num-badge { background: var(--surface-2); color: var(--ink-2); border-radius: 999px; padding: 0 8px; font-size: 12px; font-weight: normal; }
.tab-panel { display: none; } .tab-panel.is-active { display: block; }

/* ---- 表 ---- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
th { font-size: 12px; color: var(--muted); font-weight: normal; white-space: nowrap; background: var(--surface-2); }
tbody tr:hover, tr.row-link:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
tr.row-link { cursor: pointer; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.amount { font-weight: bold; font-size: 15px; }
.nowrap { white-space: nowrap; }
.muted { color: var(--muted); font-size: 12px; }
.sub { color: var(--muted); font-size: 12px; display: block; }
.empty { text-align: center; padding: 32px; color: var(--muted); }

/* 購入先の頭文字マーク */
.vendor { display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 8px; background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center;
          font-weight: bold; font-size: 13px; flex-shrink: 0; border: 1px solid var(--line); }

/* ---- ボタン・入力 ---- */
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); border-color: var(--accent); }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--accent);
       background: var(--accent); color: #fff; cursor: pointer; font: inherit; white-space: nowrap; }
.btn:hover { text-decoration: none; filter: brightness(1.07); }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--sm { padding: 4px 10px; font-size: 12px; }
.btn--lg { padding: 12px 40px; font-size: 16px; font-weight: bold; }
.btn--danger { color: var(--bad-ink); }
.btn:disabled { opacity: .5; cursor: wait; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters label { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13px; }
.alert { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-radius: 10px; margin-bottom: 10px; background: var(--surface);
         border: 1px solid var(--line); border-left: 4px solid var(--accent); }
.alert--success { border-left-color: var(--good); } .alert--error { border-left-color: var(--bad); } .alert--warning { border-left-color: var(--warn); }
.form-grid { display: grid; grid-template-columns: 180px 1fr; gap: 12px 16px; align-items: start; max-width: 820px; }
.form-grid > label { padding-top: 8px; color: var(--ink-2); }
.form-grid input:not([type=checkbox]), .form-grid select, .form-grid textarea { width: 100%; max-width: 480px; }
.help { color: var(--muted); font-size: 12px; margin-top: 2px; }
.errorlist { color: var(--bad-ink); margin: 4px 0 0; padding-left: 16px; font-size: 13px; }
pre.mail { white-space: pre-wrap; word-break: break-all; max-height: 600px; overflow: auto; background: var(--surface-2); padding: 12px;
           border-radius: 8px; font-size: 12px; margin: 8px 0 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.steps { margin: 8px 0; padding-left: 20px; } .steps li { margin: 4px 0; }
dl.kv { display: grid; grid-template-columns: 90px 1fr; gap: 4px 12px; margin: 0; } dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; }

/* ---- 店舗ページ（仕訳） ---- */
.portal-grid { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 18px; align-items: start; }
.summary { position: sticky; top: 16px; }
.summary table td { padding: 7px 0; border-bottom: 1px solid var(--line); }
.order-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; }
.order-card.is-done { border-left: 4px solid var(--good); }
.order-card.is-pending { border-left: 4px solid var(--warn); }
.order-card.is-canceled { opacity: .5; }
.order-card__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; }
.order-card__total { text-align: right; }
.order-card__total b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.item-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; padding: 12px 18px; border-top: 1px solid var(--line); align-items: center; }
.item-row__name { font-weight: bold; }
.item-row__meta { color: var(--muted); font-size: 12px; }
.picker { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.chip-btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px; cursor: pointer; font: inherit; font-size: 13px; }
.chip-btn:hover { border-color: var(--accent); }
.chip-btn.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.picker select { max-width: 150px; padding: 6px 8px; border-radius: 999px; font-size: 13px; }
.picker select.is-on { border-color: var(--accent); color: var(--accent); font-weight: bold; }
.picker.is-empty .chip-btn { border-color: color-mix(in srgb, var(--warn) 70%, var(--line)); }
.suggest-mark { font-size: 11px; color: var(--warn-ink); }
.order-card__foot { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 18px; background: var(--surface-2);
                    border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
.order-card__foot input { flex: 1; min-width: 200px; }
.save-bar { position: sticky; bottom: 12px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px;
            background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(20, 30, 50, .14); }
.month-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink); font-size: 13px; }
.month-chip.is-current { background: var(--accent); color: #fff; }

/* ---- ログイン ---- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .panel { width: 100%; max-width: 380px; padding: 28px; }
.login input { width: 100%; }

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .side { width: auto; height: auto; position: static; flex-direction: row; flex-wrap: wrap; padding: 8px; gap: 2px; }
  .side__group, .side__foot { display: none; }
  .side__brand { padding: 4px 8px; width: 100%; }
  .main { padding: 16px; }
  .portal-grid, .grid2, .form-grid { grid-template-columns: 1fr; }
  .summary { position: static; }
  .item-row { grid-template-columns: 1fr; }
  .picker { justify-content: flex-start; }
}

/* ---- 領収書（注文詳細の左列・添付枠） ---- */
.order-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.order-detail .form-grid { grid-template-columns: 130px 1fr; }
.order-detail .tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.receipt-viewer { position: sticky; top: 16px; overflow: hidden; }
.receipt-viewer .card__head { flex-wrap: wrap; }
.receipt-viewer .tab { padding: 4px 10px; font-size: 12px; }
.receipt-pane { display: none; } .receipt-pane.is-active { display: block; }
.receipt-pane iframe { width: 100%; height: calc(100vh - 230px); min-height: 420px; border: 0; display: block; background: var(--surface-2); }
.receipt-img { max-height: calc(100vh - 230px); overflow: auto; background: var(--surface-2); text-align: center; }
.receipt-img img { max-width: 100%; }
.receipt-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 14px; border-top: 1px solid var(--line); }
.dropzone { display: flex; align-items: center; gap: 12px; margin: 12px 14px 14px; padding: 14px 16px; border: 2px dashed var(--line);
            border-radius: 10px; cursor: pointer; color: var(--ink-2); position: relative; }
.dropzone.is-empty { min-height: 220px; justify-content: center; flex-direction: column; text-align: center; }
.dropzone.is-empty .icon { width: 36px; height: 36px; }
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.is-busy { opacity: .5; pointer-events: none; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.receipt-links { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.dropzone--mini { margin: 0; padding: 4px 12px; border-width: 1px; font-size: 13px; gap: 6px; }
@media (max-width: 1100px) { .order-detail { grid-template-columns: 1fr; } .receipt-viewer { position: static; } }
/* 注文詳細の明細編集表: 列幅を固定し入力欄を枠内に収める */
.items-edit { table-layout: fixed; }
.items-edit th, .items-edit td { padding: 8px 6px; }
.items-edit th:first-child, .items-edit td:first-child { padding-left: 14px; }
.items-edit input:not([type=checkbox]), .items-edit select { width: 100%; min-width: 0; padding: 6px 8px; }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }

/* ---- ログイン画面: 左にブランド面、右にフォーム ---- */
.login-page { background: var(--surface); }
.login-split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: 100vh; }
.login-hero { position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 40px 56px; color: #fff;
              background: radial-gradient(circle at 85% 15%, rgba(255,255,255,.16) 0, transparent 38%),
                          radial-gradient(circle at 10% 90%, rgba(255,255,255,.10) 0, transparent 40%),
                          linear-gradient(145deg, #2f5bd3 0%, #1f3f9e 55%, #172a66 100%); }
.login-hero__brand { display: flex; align-items: center; gap: 10px; font-weight: bold; font-size: 16px; }
.login-hero__logo { background: rgba(255,255,255,.18); }
.login-hero__body { margin: auto 0; max-width: 520px; }
.login-hero__body h1 { font-size: 34px; line-height: 1.35; margin: 0 0 14px; letter-spacing: .01em; }
                         background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); }
.login-hero__foot { color: rgba(255,255,255,.55); font-size: 12px; }
.login-form { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.login-form__inner { width: 100%; max-width: 380px; }
.login-form h2 { font-size: 26px; margin: 0 0 4px; }
.login-form form { margin-top: 24px; display: grid; gap: 16px; }
.field { display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); }
.field__box { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px;
              background: var(--surface); color: var(--muted); transition: border-color .15s, box-shadow .15s; }
.field__box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); }
.field__box input { flex: 1; min-width: 0; border: 0; padding: 12px 0; background: transparent; font-size: 15px; outline: none; box-shadow: none; }
.field__box input:focus { outline: none; }
.field__toggle { border: 0; background: none; color: var(--accent); cursor: pointer; font: inherit; font-size: 12px; padding: 4px; }
.login-form__submit { width: 100%; justify-content: center; margin-top: 6px; }
.login-form__help { margin-top: 20px; line-height: 1.7; }
@media (max-width: 860px) {
  .login-split { grid-template-columns: minmax(0, 1fr); }
  .login-form { display: block; padding: 28px 20px; }
  .login-form__inner { max-width: none; }
  .login-hero { padding: 24px; }
  .login-hero__body { margin: 20px 0 0; }
  .login-hero__body h1 { font-size: 22px; }
  .login-hero__foot { display: none; }
}
/* 通知メールのリンクから開いた注文を目立たせる */
.order-card:target { box-shadow: 0 0 0 3px var(--accent), var(--shadow); scroll-margin-top: 16px; animation: target-flash 1.6s ease-out 1; }
@keyframes target-flash { 0% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 35%, transparent); } }
/* 電子帳簿保存法ページ: 規程本文 */
pre.regulation { white-space: pre-wrap; font-family: inherit; font-size: 14px; line-height: 1.9; margin: 0; }
@media print { .side, .page-head button, .tiles { display: none !important; } .main { padding: 0; } .card { border: 0; box-shadow: none; } }

.receipt-deleted { margin: 0 14px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 12px; }

/* ---- チュートリアル（invoice と同じ吹き出し）・手順案内・初回の確認・マニュアル ---- */
.tutorial-tip { position: absolute; z-index: 70; max-width: 320px; padding: 10px 14px; border-radius: 11px;
                background: rgba(15, 30, 64, .95); color: #fff; font-size: 12.5px; line-height: 1.7;
                box-shadow: 0 12px 30px rgba(15, 30, 64, .3); pointer-events: none; }
.tutorial-tip::after { content: ""; position: absolute; left: 50%; margin-left: -6px; border: 6px solid transparent;
                       border-top-color: rgba(15, 30, 64, .95); bottom: -12px; }
.tutorial-tip.below::after { bottom: auto; top: -12px; border-top-color: transparent; border-bottom-color: rgba(15, 30, 64, .95); }
.tutorial-tip strong { color: #9fc0ff; }
.tutorial-on [data-tip] { box-shadow: inset 3px 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
.guide { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: var(--radius);
         padding: 12px 18px; margin-bottom: 16px; }
.guide summary { cursor: pointer; font-weight: bold; color: var(--accent); display: flex; align-items: center; gap: 6px; }
.guide__steps { margin: 10px 0 4px; padding: 0; list-style: none; counter-reset: g; display: grid; gap: 8px; }
.guide__steps li { counter-increment: g; display: grid; grid-template-columns: 26px 1fr; gap: 2px 10px; }
.guide__steps li::before { content: counter(g); grid-row: span 2; width: 24px; height: 24px; border-radius: 50%; background: var(--accent);
                           color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: bold; }
.guide__steps li span { color: var(--ink-2); font-size: 13px; }
.guide p { margin: 6px 0 0; }
.side__tutorial { padding: 4px 10px; }
.side__tutorial button { width: 100%; display: flex; justify-content: space-between; align-items: center; background: none; border: 0;
                         color: var(--side-ink); font: inherit; font-size: 13px; padding: 8px 2px; cursor: pointer; }
.switch { width: 34px; height: 20px; border-radius: 10px; background: #3a4357; position: relative; transition: background .2s; }
.switch i { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .2s; }
.switch.is-on { background: var(--good); } .switch.is-on i { left: 16px; }
.modal-back { position: fixed; inset: 0; background: rgba(10, 16, 30, .45); display: grid; place-items: center; z-index: 80; padding: 16px; }
.modal { background: var(--surface); border-radius: 14px; padding: 24px; max-width: 460px; width: 100%; box-shadow: 0 20px 50px rgba(0, 0, 0, .3); }
.modal h3 { margin: 0 0 8px; } .modal p { color: var(--ink-2); line-height: 1.8; }
.manual { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; }
.manual__toc { position: sticky; top: 16px; display: grid; gap: 4px; }
.manual__toc a { padding: 6px 8px; border-radius: 6px; color: var(--ink-2); font-size: 13px; }
.manual__toc a:hover { background: var(--surface-2); text-decoration: none; }
.manual__section { margin-bottom: 16px; scroll-margin-top: 16px; }
.manual__section .card__body { line-height: 1.9; }
.manual__section h4 { margin: 16px 0 6px; }
.manual-table { width: 100%; border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; font-size: 13px; }
.manual-table th { background: var(--surface-2); }
@media (max-width: 900px) { .manual { grid-template-columns: 1fr; } .manual__toc { position: static; } }
.warn-ink { color: var(--warn-ink); }

/* 検索ページ */
.search-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px 16px; align-items: start; margin: 0 0 16px; }
.search-form__wide { grid-column: 1 / -1; }
.search-form__wide input { width: 100%; }
.search-form__q { display: flex; gap: 8px; }
.search-form__q input { flex: 1; min-width: 0; }
.search-form select { width: 100%; }
.search-form__q select { width: auto; flex: none; }
.search-form__range { display: flex; align-items: center; gap: 6px; }
.search-form__range input { flex: 1; min-width: 0; }
.search-form__foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.search-form__foot label { margin-right: auto; }
.source-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--surface-2); color: var(--ink-2); }
.source-tag--mail { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.source-tag--shinko { background: color-mix(in srgb, var(--good) 14%, transparent); }
.source-tag--petty { background: color-mix(in srgb, var(--warn) 22%, transparent); }