/* SPOSAKU CROSSMALL 在庫更新  白基調 × ネイビー */
:root {
  --navy: #14284b;
  --navy-2: #1f3b6e;
  --navy-soft: #e8eef8;
  --ink: #1b2330;
  --muted: #5f6b7a;
  --line: #d9dfe8;
  --bg: #f5f7fa;
  --white: #ffffff;
  --ok: #1d8a4a;
  --ok-soft: #e6f5ec;
  --ng: #c62828;
  --ng-soft: #fdecec;
  --warn: #a35f00;
  --warn-soft: #fff4e0;
  --radius: 10px;
  --font: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.7; }
a { color: var(--navy-2); }
h1, h2, h3, h4 { line-height: 1.4; margin: 0 0 .5em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.1rem; margin-top: .5em; }
h4 { font-size: 1rem; margin-top: 1.2em; }
.small { font-size: .875rem; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.txt-ok { color: var(--ok); font-weight: 700; }
.txt-ng { color: var(--ng); font-weight: 700; }
.inline { display: inline; }
[hidden] { display: none !important; }

/* ヘッダー */
.topbar { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.topbar-inner { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { color: #fff; text-decoration: none; display: flex; align-items: baseline; gap: 8px; margin-right: auto; }
.brand-mark { font-weight: 800; letter-spacing: .08em; }
.brand-name { font-size: .9rem; opacity: .9; }
.nav { display: flex; gap: 4px; }
.nav a { color: #dfe7f5; text-decoration: none; padding: 6px 12px; border-radius: 6px; font-weight: 600; }
.nav a.active, .nav a:hover { background: rgba(255,255,255,.15); color: #fff; }
.userbox { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.username { color: #fff; }
.topbar .btn-link { color: #dfe7f5; }

.container { max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; }
.footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 16px; }
.page-head { margin-bottom: 16px; }

/* カード・ステップ */
.card, .step { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 2px rgba(20,40,75,.04); }
.step { padding: 0; border-left: 6px solid var(--ng); }
.step.step-ok { border-left-color: var(--ok); }
.step.step-run { border-left-color: var(--navy-2); }
.step.step-warn { border-left-color: var(--warn); }
.step-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.step-head h2 { margin: 0; flex: 1; }
.step-no { width: 36px; height: 36px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; flex: none; }
.step-ok .step-no { background: var(--ok); }
.step-body { padding: 16px 20px 20px; }
.desc { margin-top: 0; }

.chip { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: .85rem; font-weight: 700; white-space: nowrap; }
.chip-ng { background: var(--ng-soft); color: var(--ng); }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-run { background: var(--navy-soft); color: var(--navy-2); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }

.tag { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-ng { background: var(--ng-soft); color: var(--ng); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-navy { background: var(--navy-soft); color: var(--navy-2); }
.tag-gray { background: #eef0f3; color: var(--muted); }

/* ボタン */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 18px; border: 1px solid var(--navy); background: #fff; color: var(--navy); border-radius: 8px; font-size: 1rem; font-weight: 700; font-family: inherit; cursor: pointer; text-decoration: none; line-height: 1.3; }
.btn:hover { background: var(--navy-soft); }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #17733d; }
.btn-danger { border-color: var(--ng); color: var(--ng); }
.btn-danger:hover { background: var(--ng-soft); }
.btn-lg { min-height: 56px; padding: 12px 28px; font-size: 1.1rem; }
.btn-sm { min-height: 34px; padding: 4px 12px; font-size: .875rem; }
.btn-block { width: 100%; }
.btn-link { background: none; border: none; padding: 0; color: var(--navy-2); text-decoration: underline; cursor: pointer; font: inherit; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0; }

/* ファイル選択 */
.uploader { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.filepick { display: flex; align-items: center; gap: 12px; flex: 1 1 320px; border: 2px dashed var(--line); border-radius: var(--radius); padding: 10px 14px; cursor: pointer; background: #fafbfd; min-height: 56px; }
.filepick:hover { border-color: var(--navy-2); }
.filepick input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.filepick-btn { background: var(--navy-soft); color: var(--navy); font-weight: 700; padding: 6px 12px; border-radius: 6px; white-space: nowrap; }
.filepick-name { color: var(--muted); word-break: break-all; }
.filepick:focus-within { outline: 3px solid rgba(31,59,110,.35); }

/* 進行バー */
.bars { display: grid; gap: 10px; margin: 12px 0; }
.bars:empty { display: none; }
.pbar { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fff; }
.pbar-head { display: flex; justify-content: space-between; font-weight: 700; }
.pbar-pct { font-variant-numeric: tabular-nums; }
.pbar-track { height: 14px; background: #e9edf3; border-radius: 999px; overflow: hidden; margin: 6px 0 4px; }
.pbar-fill { height: 100%; width: 0; background: var(--navy-2); border-radius: 999px; transition: width .3s ease; }
.pbar.is-run .pbar-fill { background-image: linear-gradient(45deg, rgba(255,255,255,.18) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.18) 50%, rgba(255,255,255,.18) 75%, transparent 75%); background-size: 24px 24px; animation: stripe 1s linear infinite; }
.pbar.is-done .pbar-fill { background: var(--ok); }
.pbar.is-done .pbar-head { color: var(--ok); }
.pbar.is-fail .pbar-fill { background: var(--ng); }
.pbar.is-fail .pbar-head, .pbar.is-fail .pbar-remain { color: var(--ng); }
.pbar-meta { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
@keyframes stripe { from { background-position: 0 0; } to { background-position: 24px 0; } }
@media (prefers-reduced-motion: reduce) { .pbar.is-run .pbar-fill { animation: none; } }

/* アラート */
.alert { border-radius: 8px; padding: 12px 14px; margin: 12px 0; border: 1px solid transparent; }
.alert ul { margin: 6px 0; padding-left: 1.3em; }
.alert-ok { background: var(--ok-soft); border-color: #b5e0c5; color: #135e33; }
.alert-ng { background: var(--ng-soft); border-color: #f2b8b8; color: #8e1b1b; }
.alert-warn { background: var(--warn-soft); border-color: #f0d29b; color: #6e4200; }
.alert-info { background: var(--navy-soft); border-color: #c8d5ea; color: var(--navy); }
.check { display: flex; gap: 8px; align-items: center; font-weight: 700; margin-top: 8px; cursor: pointer; }
.check input { width: 22px; height: 22px; }

/* 表 */
.table-wrap { overflow-x: auto; margin: 10px 0; border: 1px solid var(--line); border-radius: 8px; }
.tbl { width: 100%; border-collapse: collapse; background: #fff; font-size: .92rem; }
.tbl th, .tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { background: #f0f3f8; color: var(--navy); font-weight: 700; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: none; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .path { word-break: break-all; }
.row-muted td { color: var(--muted); }
.meta-line { font-size: .9rem; color: var(--muted); margin-top: 8px; }

/* キー・値 */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin: 8px 0; }
.kv > div { background: #f7f9fc; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.kv span { display: block; font-size: .8rem; color: var(--muted); }
.kv b { font-size: 1.05rem; }

/* プレビュー */
.preview { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 10px 0; }
.tile { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fff; }
.tile-label { font-size: .8rem; color: var(--muted); }
.tile-value { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.tile-note { font-size: .78rem; color: var(--muted); }
.tile-navy { background: var(--navy); border-color: var(--navy); }
.tile-navy .tile-label, .tile-navy .tile-value { color: #fff; }
.tile-warn { border-color: #f0d29b; background: var(--warn-soft); }
.checks { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.checks li::before { content: "✔ "; color: var(--ok); font-weight: 800; }
.lookup { margin-top: 16px; }
.lookup-row { display: flex; gap: 8px; max-width: 480px; }
.lookup-row input { flex: 1; }
.lookup-box { margin-top: 8px; }
.lookup-final { margin: 8px 0; }
.lookup-final .big { font-size: 1.4rem; color: var(--navy); }
.done-box { border: 2px solid var(--ok); background: var(--ok-soft); border-radius: var(--radius); padding: 16px; margin-top: 16px; }
.done-title { font-size: 1.15rem; font-weight: 800; color: var(--ok); }
.done-box .btn { margin-top: 12px; }

details.sub { margin: 10px 0; }
details.sub > summary { cursor: pointer; font-weight: 700; color: var(--navy-2); padding: 6px 0; }

/* フォーム */
.field { display: block; margin: 0 0 14px; }
.field > span { display: block; font-weight: 700; margin-bottom: 4px; font-size: .95rem; }
.field small, .help { display: block; color: var(--muted); font-size: .82rem; margin-top: 2px; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #b9c3d1; border-radius: 8px; font-size: 1rem; font-family: inherit; background: #fff; min-height: 44px; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(31,59,110,.25); border-color: var(--navy-2); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 20px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
.perm-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px; margin: 6px 0 14px; }
.perm-list label { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.perm-list input { width: 20px; height: 20px; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin: 0 0 16px; }
legend { font-weight: 800; color: var(--navy); padding: 0 6px; }

/* ログイン */
.login-wrap { min-height: 60vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 100%; max-width: 420px; }
.login-title { color: var(--navy); }

/* タブ */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 2px solid var(--line); margin-bottom: 16px; }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); font-weight: 700; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs a.active { color: var(--navy); border-bottom-color: var(--navy); }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.menu-card { display: block; text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.menu-card:hover { border-color: var(--navy-2); box-shadow: 0 2px 8px rgba(20,40,75,.1); }
.menu-card b { color: var(--navy); font-size: 1.05rem; display: block; }

/* ダイアログ */
.dlg { border: none; border-radius: var(--radius); padding: 0; width: min(900px, 94vw); max-height: 86vh; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.dlg::backdrop { background: rgba(10,20,40,.45); }
.dlg-body { padding: 16px 20px; overflow: auto; max-height: calc(86vh - 70px); }
.dlg-foot { padding: 10px 20px; border-top: 1px solid var(--line); text-align: right; }

.preview-grid td.hl { background: #fff4c2; font-weight: 700; }
.preview-grid td.hl-q { background: #dff3e6; font-weight: 700; }
.preview-grid td.hl-h { background: #e8eef8; }
.preview-grid th.colno { font-family: var(--mono); font-size: .8rem; }
.pager { display: flex; gap: 8px; align-items: center; margin: 8px 0; flex-wrap: wrap; }
.searchbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.searchbar input { flex: 1 1 220px; }
.inline-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-form input { min-height: 36px; padding: 4px 8px; width: auto; flex: 1 1 140px; }

/* スマートフォン */
@media (max-width: 720px) {
  body { font-size: 15px; }
  .container { padding: 16px 10px 40px; }
  .topbar-inner { gap: 8px; }
  .brand-name { display: none; }
  .nav a { padding: 6px 8px; }
  .step-head { padding: 12px 14px; }
  .step-body { padding: 12px 14px 16px; }
  .btn-lg { width: 100%; }
  .tbl-files thead { display: none; }
  .tbl-files tr { display: block; border-bottom: 1px solid var(--line); padding: 6px 0; }
  .tbl-files td { display: flex; justify-content: space-between; gap: 12px; border: none; padding: 3px 10px; text-align: right; }
  .tbl-files td::before { content: attr(data-th); color: var(--muted); font-size: .8rem; text-align: left; flex: none; }
  .tbl-files td.path { display: block; text-align: left; }
  .tbl-files td.path::before { display: block; }
}
.hl-demo { background: #fff4c2; padding: 0 4px; }
