/* 画面モック（docs/mock/）の配色・寸法に合わせる。クリックできる要素は 44px 以上（要件定義書 10章） */
:root {
  --navy: #011638;
  --blue: #1565c0;
  --line: #c9d3e0;
  --soft: #e8eef7;
  --text: #333333;
  --muted: #666666;
  --error: #b3261e;
  --error-soft: #fdecea;
  --radius: 8px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: #ffffff;
  color: var(--text);
  font-family: Arial, 'Noto Sans JP', Meiryo, 'Hiragino Sans', sans-serif;
  font-size: 14px;
  line-height: 1.6;
}
a { color: var(--blue); }
a:hover { color: var(--navy); }
h1, h2, h3 { color: #000000; }
textarea:focus, input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], input[type="search"], input[type="month"], select, textarea {
  font: inherit;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  width: 100%;
}
textarea { resize: vertical; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.js .js-hide { display: none; }

/* ヘッダー */
.site-header { background: var(--navy); color: #ffffff; }
.site-header__inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-height: 60px; }
.site-header__title { font-size: 17px; font-weight: 700; letter-spacing: 0.02em; color: #ffffff; text-decoration: none; margin-right: auto; }
.site-header__title:hover { color: #ffffff; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.site-nav a { color: #ffffff; text-decoration: none; padding: 10px 14px; border-radius: 9999px; min-height: 44px; display: inline-flex; align-items: center; }
.site-nav a[aria-current="page"] { background: rgba(255, 255, 255, 0.16); font-weight: 700; }
.site-nav a:hover { background: rgba(255, 255, 255, 0.1); color: #ffffff; }
.site-header__user { display: flex; align-items: center; gap: 8px; font-size: 13px; }

.page { max-width: 1200px; margin: 0 auto; padding: 36px 24px 56px; display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; align-items: center; gap: 16px; }
.page-head h1 { margin: 0; font-size: 24px; font-weight: 400; white-space: nowrap; }
.page-head__rule { flex: 1; height: 1px; background: #b7b7b7; }
.lead { margin: -14px 0 4px; font-size: 17px; font-weight: 700; color: var(--blue); }
.back-link { font-size: 13px; }
.section-title { margin: 0; font-size: 18px; font-weight: 700; }
.hint, .small { font-size: 12px; }
.hint { color: var(--muted); }
.muted { color: var(--muted); }
.list { margin: 0; padding-left: 1.2em; }

/* レイアウト */
.stack, .stack-lg, .stack-sm { display: flex; flex-direction: column; }
.stack { gap: 16px; }
.stack-lg { gap: 24px; }
.stack-sm { gap: 8px; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 12px; }
.row-wrap--center { align-items: center; }
.row-between { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.with-aside { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.with-aside > form { flex: 999 1 560px; min-width: 0; }
.with-aside > aside { flex: 1 1 280px; min-width: 0; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.form-narrow { max-width: 720px; }

.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.panel--soft { background: var(--soft); border-color: var(--soft); }
.panel__title { margin: 0 0 12px; font-size: 15px; font-weight: 700; color: var(--navy); }
.box { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.box--soft { background: var(--soft); border-color: var(--soft); }
.box__title { font-weight: 700; color: var(--navy); margin: 0 0 6px; font-size: 13px; }
.box__heading { margin: 0; font-size: 15px; }

/* フォーム */
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; color: var(--navy); border: 0; padding: 0; margin: 0; min-width: 0; }
.field input, .field select, .field textarea { font-weight: 400; }
.field__label { font-weight: 700; color: var(--navy); padding: 0; }
.field--grow { flex: 1 1 280px; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.check input { width: 18px; height: 18px; }
.check--disabled { color: var(--muted); cursor: not-allowed; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 9999px; cursor: pointer; font-weight: 700; background: #ffffff; color: var(--navy); border: 1px solid var(--line); }
.pill:has(input:checked) { background: var(--navy); color: #ffffff; border-color: var(--navy); }
.inline-form { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.inline-form select { width: auto; }

.button {
  font: inherit; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 20px; border-radius: 9999px; cursor: pointer; text-decoration: none; border: 1px solid var(--navy);
}
.button--primary { background: var(--navy); color: #ffffff; }
.button--primary:hover { background: var(--blue); border-color: var(--blue); color: #ffffff; }
.button--ghost { background: #ffffff; color: var(--navy); border-color: var(--line); }
.button--ghost:hover { border-color: var(--navy); color: var(--navy); }
.button--danger { background: #ffffff; color: var(--error); border-color: var(--error); }
.button--small { min-height: 36px; padding: 0 14px; font-size: 13px; }
.button:disabled { opacity: 0.45; cursor: not-allowed; }
.link-button { font: inherit; background: none; border: 0; padding: 8px; min-height: 44px; cursor: pointer; text-decoration: underline; }
.link-button--light { color: #ffffff; }

.notice { margin: 0; padding: 12px 16px; border-radius: var(--radius); background: var(--soft); color: var(--navy); }
.notice--error { background: var(--error-soft); color: var(--error); }

/* 手順表示 */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; font-weight: 700; }
.steps__item { padding: 4px 12px; border-radius: 9999px; }
.steps__item--current { background: var(--navy); color: #ffffff; }
.steps__item--done { background: var(--soft); color: var(--navy); }
.steps__item--todo { border: 1px solid var(--line); color: var(--muted); }
.steps__arrow { color: var(--muted); }

.req-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); }
.req-row__no { flex: 0 0 100%; font-weight: 700; color: var(--blue); font-size: 13px; }
.req-row .field { flex: 1 1 200px; }
.req-row .field--grow { flex: 3 1 320px; }

.summary-line { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 14px 18px; background: var(--soft); border-radius: var(--radius); font-size: 13px; }
.summary-line strong { color: var(--navy); }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stats__label { font-size: 12px; color: var(--muted); }
.stats__value { font-size: 22px; font-weight: 700; color: var(--navy); }
.recent { list-style: none; margin: 0 0 12px; padding: 0; }
.recent li + li { border-top: 1px solid var(--line); }
.recent a { display: flex; flex-direction: column; padding: 10px 0; text-decoration: none; min-height: 44px; }
.recent__title { color: var(--navy); font-weight: 700; }
.recent__meta { font-size: 12px; color: var(--muted); }

/* 判定の進行 */
.progress { border: 1px solid var(--blue); border-radius: var(--radius); padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; }
.progress__text { font-weight: 700; color: var(--navy); }
.progress__bar { width: 100%; height: 10px; accent-color: var(--blue); }

/* タブ */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab { display: flex; flex-direction: column; justify-content: center; min-height: 52px; padding: 6px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: #ffffff; color: var(--navy); text-decoration: none; max-width: 260px; }
.tab[aria-current="page"] { background: var(--navy); color: #ffffff; border-color: var(--navy); }
.tab:hover { border-color: var(--navy); }
.tab--disabled { color: var(--muted); cursor: not-allowed; }
.tab__label { font-weight: 700; font-size: 14px; }
.tab__sub { font-size: 11px; opacity: 0.85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 表（狭い画面では横スクロール） */
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 760px; }
.table th, .table td { text-align: left; vertical-align: top; padding: 12px; border-bottom: 1px solid var(--line); }
.table thead th { font-size: 12px; color: var(--muted); font-weight: 700; border-bottom: 2px solid var(--navy); }
.table tbody th { font-weight: 400; }
.table tr.is-inactive { color: var(--muted); }

/* バッジ・難易度 */
.badge { display: inline-block; padding: 2px 10px; border-radius: 9999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge--ok { background: var(--soft); color: var(--navy); }
.badge--part { background: var(--blue); color: #ffffff; }
.badge--ng { background: var(--navy); color: #ffffff; }
.badge--error { background: var(--error-soft); color: var(--error); }
.badge--outline { border: 1px solid var(--line); color: var(--muted); background: #ffffff; }
.badge--none { border: 1px solid var(--line); color: var(--muted); }
.chip { display: inline-block; min-width: 2em; text-align: center; padding: 0 8px; border-radius: 9999px; font-size: 12px; font-weight: 700; }
.chip--low { background: var(--soft); color: var(--navy); }
.chip--mid { background: var(--blue); color: #ffffff; }
.chip--high { background: var(--navy); color: #ffffff; }
.difficulty { display: grid; grid-template-columns: 6em 3em 1fr; gap: 8px; align-items: baseline; }
.difficulty__axis { font-size: 12px; color: var(--muted); }

/* 標準機能の判定 */
.verdict { display: flex; flex-wrap: wrap; gap: 24px; border-left-width: 6px; }
.verdict--ok { border-left-color: var(--soft); }
.verdict--part { border-left-color: var(--blue); }
.verdict--ng { border-left-color: var(--navy); }
.verdict__main { flex: 999 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.verdict__main p { margin: 0; }
.verdict__side { flex: 1 1 220px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.verdict__title { margin: 4px 0 0; font-size: 20px; }
.verdict__title .badge { font-size: 16px; padding: 4px 14px; }

.edit summary { cursor: pointer; color: var(--blue); font-size: 13px; min-height: 32px; display: inline-flex; align-items: center; }
.edit[open] { padding: 12px 16px; background: #fafbfd; border: 1px solid var(--line); border-radius: var(--radius); }

/* アプリカード */
.app-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.app-card--picked { border: 2px solid var(--navy); }
.app-card__head { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.app-card__rank { font-size: 22px; font-weight: 700; color: var(--blue); min-width: 2em; }
.app-card__title { flex: 1 1 320px; min-width: 0; }
.app-card__title h3 { margin: 0; font-size: 17px; }
.app-card__price { text-align: right; }
.app-card__price-value { font-size: 17px; font-weight: 700; color: var(--navy); margin: 0; }
.app-card__body { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; padding: 16px 20px; }
.app-card__body p { margin: 0 0 10px; }
.app-card__foot { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; padding: 8px 20px; background: #fafbfd; border-top: 1px solid var(--line); }
.app-card__edit { margin: 0 20px 12px; }

.bottom-bar { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 20px; background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 -2px 8px rgba(1, 22, 56, 0.08); }

/* 管理 */
.subnav { display: flex; flex-wrap: wrap; gap: 8px; }
.subnav a { padding: 8px 16px; border-radius: 9999px; border: 1px solid var(--line); text-decoration: none; color: var(--navy); min-height: 44px; display: inline-flex; align-items: center; }
.subnav a[aria-current="page"] { background: var(--navy); color: #ffffff; border-color: var(--navy); }

.login { max-width: 420px; width: 100%; margin: 40px auto; display: flex; flex-direction: column; gap: 16px; }
.login__title { margin: 0; font-size: 24px; font-weight: 400; }
.button--google { width: 100%; }

/* 検索結果の保存（F10） */
.save-box { position: relative; }
.save-box > summary { list-style: none; }
.save-box > summary::-webkit-details-marker { display: none; }
.save-box__panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 10; width: min(560px, calc(100vw - 32px)); padding: 20px; background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(1, 22, 56, 0.16); }
.field--indent { margin-left: 26px; }
a.badge { text-decoration: none; }

/* 組み合わせ試算（F09） */
.combo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.combo-req { display: flex; flex-direction: column; gap: 8px; margin: 0; min-width: 0; }
.combo-req__legend { font-weight: 700; color: var(--navy); padding: 0 4px; }
.combo-req__no { color: var(--blue); margin-right: 8px; }
.combo-option { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.combo-option:has(input:checked), .combo-option--on { border: 2px solid var(--navy); background: #fafbfd; }
.combo-option input { width: 18px; height: 18px; margin-top: 3px; flex-shrink: 0; }
.combo-option__body { display: flex; flex-direction: column; min-width: 0; }
.combo-option__name { font-weight: 700; color: var(--navy); }
.combo-option__price { font-weight: 700; }
.combo-option__covers { color: var(--blue); }
.two-col--wide { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); align-items: start; }
.box--navy { background: var(--navy); border-color: var(--navy); color: #ffffff; }
.combo-total { font-size: 28px; font-weight: 700; }
.table tr.table__total th, .table tr.table__total td { font-weight: 700; border-top: 2px solid var(--navy); }
.table tr.is-current { background: var(--soft); }
.plain-list { list-style: none; margin: 0; padding: 0; }
.row-wrap--end { align-items: flex-end; }
[data-combo].is-busy { opacity: 0.6; pointer-events: none; }

/* 変更通知（F12）・ウォッチリスト（F13） */
.with-aside__main { flex: 999 1 560px; min-width: 0; }
.with-aside__side { flex: 1 1 280px; min-width: 0; }
a.pill { text-decoration: none; }
.pill[aria-current="page"] { background: var(--navy); color: #ffffff; border-color: var(--navy); }
.change-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.change { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.change__date { width: 6.5em; font-size: 12px; color: var(--muted); }
.change__body { flex: 1 1 260px; min-width: 0; }
.change__app { font-weight: 700; color: var(--navy); }
.change__customer { flex: 0 1 200px; }
.watch-list { list-style: none; margin: 0; padding: 0; }
.watch-list li { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }

/* 履歴・分析（F14） */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.kpi { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.kpi__label { font-size: 12px; color: var(--muted); font-weight: 700; }
.kpi__value { font-size: 26px; font-weight: 700; color: var(--navy); }
.three-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rank-list__no { color: var(--blue); font-weight: 700; width: 1.5em; flex-shrink: 0; }
.rank-list__count { margin-left: auto; font-weight: 700; color: var(--navy); white-space: nowrap; }

/* 案件・見積（F15）・承認（F16） */
.table--compare th[scope="col"] { min-width: 200px; }
.table tr.table__group th { background: var(--soft); color: var(--navy); font-weight: 700; padding: 6px 12px; }
.source-list { margin: 0; padding-left: 2em; display: flex; flex-direction: column; gap: 4px; }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.box--picked { border: 2px solid var(--navy); }
.queue { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.queue a { display: flex; flex-direction: column; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.queue a[aria-current="true"] { border: 2px solid var(--navy); background: var(--soft); }
.queue__title { font-weight: 700; color: var(--navy); }
.with-aside--reverse > .with-aside__side { order: -1; }
.watermark { margin: 0; padding: 8px 12px; border: 2px dashed var(--error); color: var(--error); font-weight: 700; text-align: center; }
.quote-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; border-bottom: 2px solid var(--navy); padding-bottom: 16px; }
.quote-title { margin: 0 0 12px; font-size: 28px; letter-spacing: 0.3em; }
.quote-to { font-size: 18px; border-bottom: 1px solid var(--text); margin: 0 0 8px; padding-bottom: 4px; }
.quote-meta { text-align: right; }
.quote-meta p { margin: 0 0 8px; }

/* 印刷用ページ（組み合わせの比較資料） */
.print-title { margin: 0; font-size: 22px; font-weight: 700; }
.table--print { min-width: 0; }
@media print {
  .no-print { display: none !important; }
  body { font-size: 11px; }
  .page { padding: 0; max-width: none; gap: 16px; }
  .table th, .table td { padding: 6px 8px; }
  .print-block { break-inside: avoid; }
}

@media (max-width: 640px) {
  .page { padding: 24px 16px 40px; }
  .site-header__inner { padding: 0 16px; }
  .panel { padding: 16px; }
  .app-card__price { text-align: left; }
  .with-aside--reverse > .with-aside__side { order: 0; }
  .quote-meta { text-align: left; }
  .save-box__panel { position: fixed; left: 16px; right: 16px; top: 80px; width: auto; max-height: calc(100vh - 100px); overflow-y: auto; }
}
