/* 落札予報 — 落ち着いた紺と生成りの配色。ライト・ダーク両対応 */
:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #efece5;
  --text: #22262b;
  --text-2: #5b6168;
  --line: #dcd8cf;
  --accent: #24476b;
  --accent-text: #ffffff;
  --link: #1f5a94;
  --series: #257de0;
  --series-soft: rgba(37, 125, 224, .16);
  --ref: #8a8f96;
  --actual: #b4532a;
  --warn-bg: #fbf1dc;
  --warn-line: #e2c27a;
  --retro-bg: #eef0f6;
  --retro-line: #9aa6c4;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #15181c;
    --surface: #1d2126;
    --surface-2: #252a30;
    --text: #e8e6e1;
    --text-2: #a3a8ae;
    --line: #353b42;
    --accent: #9cb9d8;
    --accent-text: #11161c;
    --link: #8fbbe8;
    --series: #338ced;
    --series-soft: rgba(51, 140, 237, .22);
    --ref: #8c929a;
    --actual: #e0895f;
    --warn-bg: #3a3220;
    --warn-line: #7a6633;
    --retro-bg: #232a38;
    --retro-line: #56658a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #15181c; --surface: #1d2126; --surface-2: #252a30; --text: #e8e6e1; --text-2: #a3a8ae;
  --line: #353b42; --accent: #9cb9d8; --accent-text: #11161c; --link: #8fbbe8; --series: #338ced;
  --series-soft: rgba(51, 140, 237, .22); --ref: #8c929a; --actual: #e0895f; --warn-bg: #3a3220;
  --warn-line: #7a6633; --retro-bg: #232a38; --retro-line: #56658a;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  font-size: 16px; line-height: 1.75; font-feature-settings: "palt" 0;
}
a { color: var(--link); text-underline-offset: 2px; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 20px; padding-bottom: 40px; }
h1 { font-size: 1.5rem; line-height: 1.4; margin: .4em 0 .3em; }
h2 { font-size: 1.15rem; margin: 0 0 .6em; }
h3 { font-size: 1rem; margin: 0 0 .4em; }
.lead { color: var(--text-2); margin-top: 0; }
.fine { color: var(--text-2); font-size: .82rem; line-height: 1.6; }
.muted { color: var(--text-2); font-size: .9rem; margin-left: .5em; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ヘッダーとフッター */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; padding-top: 10px; padding-bottom: 10px; }
.brand { text-decoration: none; color: var(--text); display: flex; flex-direction: column; line-height: 1.3; }
.brand-name { font-weight: 700; font-size: 1.2rem; color: var(--accent); letter-spacing: .04em; }
.brand-tag { font-size: .75rem; color: var(--text-2); }
.site-header nav { display: flex; gap: 14px; font-size: .9rem; }
.site-header nav a { text-decoration: none; }
.site-footer { border-top: 1px solid var(--line); background: var(--surface-2); font-size: .82rem; color: var(--text-2); padding: 18px 0 28px; line-height: 1.7; }
.site-footer ul { padding-left: 1.2em; margin: .2em 0 .8em; }
.site-footer a { word-break: break-all; }

/* カード・ボタン・注意書き */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin: 16px 0; }
.button { display: inline-block; background: var(--accent); color: var(--accent-text); text-decoration: none; padding: 10px 18px; border-radius: 8px; font-weight: 600; }
.notice { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 8px; padding: 10px 14px; margin: 12px 0; font-size: .92rem; }
.notice.retro, .card.retro { background: var(--retro-bg); border-color: var(--retro-line); }
.badge { display: inline-block; font-size: .75rem; line-height: 1.5; padding: 0 .55em; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); margin-right: .35em; vertical-align: .08em; white-space: nowrap; }
.badge.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.crumbs { font-size: .85rem; color: var(--text-2); }
.big { font-size: 1.5rem; font-weight: 700; margin: .2em 0; }

/* 物件ページ */
.item-head h1 { font-size: 1.3rem; word-break: break-all; }
.eyebrow { margin: 0; color: var(--text-2); font-size: .9rem; }
.sub { margin: 0; color: var(--text-2); font-size: .9rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 14px 0; }
.stats > div { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; display: flex; flex-direction: column; }
.card .stats > div { background: var(--surface-2); }
.stats .label { font-size: .8rem; color: var(--text-2); }
.stats .value { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.4; }
.stats .hero { border-color: var(--series); }
.stats .hero .value { font-size: 1.6rem; color: var(--text); }
.yen { display: block; font-size: .75rem; color: var(--text-2); font-weight: 400; }
.two { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 720px) { .two { grid-template-columns: 3fr 2fr; } }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
thead th { font-size: .8rem; color: var(--text-2); font-weight: 600; }
.facts th { width: 9em; color: var(--text-2); font-weight: 500; white-space: nowrap; }
.facts td { word-break: break-all; }
.bids td.bar { width: 35%; vertical-align: middle; }
.bids td.bar span { display: block; height: 8px; border-radius: 0 4px 4px 0; background: var(--series); min-width: 1px; }
.bids tr.first td { color: var(--text-2); }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.kotae { min-width: 640px; }

/* グラフ */
.chart { margin: 0 auto 12px; position: relative; max-width: 620px; }
.chart svg { width: 100%; height: auto; display: block; touch-action: pan-y; }
.chart figcaption { font-size: .82rem; color: var(--text-2); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--text-2); stroke-width: 1; }
.chart .tickmark { stroke: var(--text-2); }
.chart .tick { fill: var(--text-2); font-size: 12px; }
.chart .curve { fill: none; stroke: var(--series); stroke-width: 2.5; stroke-linejoin: round; }
.chart .ref { stroke: var(--ref); stroke-width: 1; stroke-dasharray: 4 3; }
.chart .reflabel { fill: var(--text-2); font-size: 12px; }
.chart .dot { fill: var(--series); stroke: var(--surface); stroke-width: 2; }
.chart .dotlabel { fill: var(--text); font-size: 13px; font-weight: 600; }
.chart .actual { stroke: var(--actual); stroke-width: 2; }
.chart .actuallabel { fill: var(--actual); font-size: 12px; font-weight: 600; }
.chart .hover-line { stroke: var(--text-2); stroke-width: 1; }
.chart .hover-dot { fill: var(--surface); stroke: var(--series); stroke-width: 2.5; }
.chart .tip { position: absolute; top: 0; pointer-events: none; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; font-size: .82rem; box-shadow: 0 2px 6px rgba(0,0,0,.12); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* 一覧 */
.filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 12px 0; position: sticky; top: 0; z-index: 2; }
.filters label { display: flex; flex-direction: column; font-size: .8rem; color: var(--text-2); flex: 1 1 140px; }
.filters select { font: inherit; font-size: .95rem; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); max-width: 100%; }
.filters .count { margin: 0 0 4px; font-size: .9rem; white-space: nowrap; }
.rows { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.rows .row a { display: grid; grid-template-columns: 5.6em 1fr; gap: 2px 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); }
.rows .row a:hover { background: var(--surface); }
.r-date { font-size: .85rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.r-main { display: flex; flex-direction: column; min-width: 0; }
.r-title { font-weight: 600; word-break: break-all; line-height: 1.5; }
.r-sub { font-size: .8rem; color: var(--text-2); }
.r-nums { grid-column: 2; display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: .9rem; font-variant-numeric: tabular-nums; }
.r-nums em { font-style: normal; font-size: .75rem; color: var(--text-2); margin-right: .35em; }
@media (min-width: 760px) {
  .rows .row a { grid-template-columns: 6em 1fr 17em; align-items: center; }
  .r-nums { grid-column: 3; justify-content: flex-end; }
}
.empty { color: var(--text-2); }

/* トップ・登録フォーム */
.hero-block { padding: 8px 0 4px; }
.hero-block h1 { font-size: 1.9rem; color: var(--accent); margin-bottom: .1em; }
.signup { background: var(--surface); border: 1px solid var(--series); border-radius: 10px; padding: 16px; margin: 24px 0; }
.signup p { margin: .2em 0 .6em; }
.signup-form { display: flex; flex-wrap: wrap; gap: 8px; }
.signup-form input { flex: 1 1 220px; font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); min-width: 0; }
.signup-form button { font: inherit; font-weight: 600; padding: 9px 18px; border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-text); cursor: pointer; }
.signup-form button:disabled, .signup-form input:disabled { opacity: .6; cursor: not-allowed; }
.cov { max-width: 520px; }
@media (max-width: 520px) {
  .chart .tick, .chart .reflabel, .chart .actuallabel { font-size: 15px; }
  .chart .dotlabel { font-size: 16px; }
}

/* メール登録・お問い合わせ */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.signup-form .consent { flex: 1 1 100%; font-size: .9em; display: flex; gap: 6px; align-items: flex-start; }
.signup-form .consent input { flex: none; margin-top: .3em; }
.form-msg { flex: 1 1 100%; margin: .4em 0 0; font-weight: 600; }
.form-msg.ok { color: var(--good, var(--accent)); }
.form-msg.ng { color: var(--bad, #c0392b); }
.contact-form { display: grid; gap: 12px; max-width: 560px; }
.contact-form label { display: grid; gap: 4px; font-weight: 600; }
.contact-form input, .contact-form textarea { font: inherit; font-weight: 400; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); }
.contact-form button { justify-self: start; font: inherit; font-weight: 600; padding: 9px 18px; border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-text); cursor: pointer; }
