:root {
  --ink: #111;
  --sub: #6b6b6b;
  --line: #e3e3e3;
  --soft: #f6f6f4;
  --bg: #fff;
  --accent: #1f3a5f;
  --down: #0b7a43;
  --up: #b3261e;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
small { display: block; color: var(--sub); font-size: 11px; line-height: 1.4; }
h1 { font-size: 20px; margin: 8px 0 4px; letter-spacing: .02em; }
h2 { font-size: 15px; margin: 32px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--ink); }
.sub { color: var(--sub); font-size: 12px; margin: 4px 0 12px; }
main { max-width: 1280px; margin: 0 auto; padding: 16px; }

/* ヘッダー */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; border-bottom: 1px solid var(--ink); position: sticky; top: 0; background: var(--bg); z-index: 10; }
.brand { font-weight: 700; letter-spacing: .12em; color: var(--ink); font-size: 13px; }
.top nav { display: flex; gap: 16px; align-items: center; }
.top nav a { color: var(--sub); font-size: 13px; }
.top nav a.on { color: var(--ink); font-weight: 700; border-bottom: 2px solid var(--ink); }
.top form { margin: 0; }
button.link { background: none; border: 0; color: var(--sub); font-size: 12px; cursor: pointer; padding: 0; }

/* 絞り込み */
.filters details { border: 1px solid var(--line); padding: 8px 12px; }
.filters summary { cursor: pointer; font-weight: 700; }
.filters .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 16px; margin-top: 10px; }
.filters .wide { grid-column: 1 / -1; }
.filters label { display: flex; flex-direction: column; font-size: 12px; color: var(--sub); gap: 2px; }
.filters label.check { flex-direction: row; align-items: center; gap: 6px; color: var(--ink); }
.filters fieldset { border: 0; padding: 0; margin: 0; }
.filters legend { font-size: 12px; color: var(--sub); margin-bottom: 4px; }
.chip { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 4px;
  border: 1px solid var(--line); padding: 2px 8px; margin: 0 4px 4px 0; color: var(--ink) !important; font-size: 12px !important; }
.chip:has(input:checked) { border-color: var(--ink); background: var(--soft); }
.pair { display: flex; align-items: center; gap: 4px; }
input, select { font: inherit; padding: 6px 8px; border: 1px solid #cfcfcf; border-radius: 0; background: #fff; min-width: 0; width: 100%; }
.chip input, .check input { width: auto; }
button { font: inherit; padding: 7px 16px; background: var(--ink); color: #fff; border: 0; cursor: pointer; }
.bar { display: flex; gap: 12px; align-items: center; margin: 10px 0; flex-wrap: wrap; }
.bar select { width: auto; }
.count { display: flex; align-items: baseline; gap: 12px; margin: 12px 0 6px; }
.count strong { font-size: 22px; }
.csv { font-size: 12px; margin-left: auto; }

/* 表 */
table { border-collapse: collapse; width: 100%; }
.list th { text-align: left; font-size: 11px; color: var(--sub); font-weight: 400; border-bottom: 1px solid var(--ink); padding: 6px 8px; white-space: nowrap; }
.list td { border-bottom: 1px solid var(--line); padding: 8px; vertical-align: top; }
.list .r { text-align: right; white-space: nowrap; }
.list .r small { display: inline; margin-left: 2px; }
.list .name a { font-weight: 700; }
.list .co { max-width: 200px; }
.list tr.ended td { color: var(--sub); }
.list tr.bad td { background: #fff4f2; }
.list.compact td { padding: 5px 8px; }
.tag { display: inline-block; font-size: 10px; border: 1px solid var(--ink); padding: 0 4px; margin-right: 4px; white-space: nowrap; }
.price { font-weight: 700; }
.down { display: block; color: var(--down); font-size: 11px; font-weight: 700; }
.up { color: var(--up); font-size: 11px; font-weight: 700; }
.endtag { display: inline-block; font-size: 11px; color: var(--up); }
.barcol { width: 30%; }
.meter { display: block; height: 8px; background: var(--ink); margin-top: 6px; }
.scroll { overflow-x: auto; }
.pager { display: flex; justify-content: center; gap: 20px; margin: 20px 0; }
.error { color: var(--up); }
.ok { color: var(--down); }

/* 物件詳細 */
.crumb { margin: 0 0 8px; font-size: 12px; }
.head h1 { font-size: 22px; }
.bigprice { font-size: 26px; font-weight: 700; margin: 4px 0; }
.ext { display: inline-block; border: 1px solid var(--ink); padding: 4px 12px; color: var(--ink); font-size: 12px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0; border-top: 1px solid var(--ink); margin-top: 16px; }
.facts dl { margin: 0; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.facts dt { font-size: 11px; color: var(--sub); }
.facts dd { margin: 2px 0 0; font-weight: 700; }
.events { list-style: none; padding: 0; margin: 0; }
.events li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.events .d { display: inline-block; width: 100px; color: var(--sub); font-size: 12px; }
.kv th { text-align: left; font-weight: 400; color: var(--sub); font-size: 12px; width: 180px; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.kv td { padding: 6px 8px; border-bottom: 1px solid var(--line); font-size: 13px; }
.company { margin: 6px 0; }
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 12px; overflow-x: auto; }
.tabs a { padding: 8px 14px; color: var(--sub); white-space: nowrap; }
.tabs a.on { color: var(--ink); font-weight: 700; border-bottom: 2px solid var(--ink); }

/* ログイン */
.login { max-width: 360px; margin: 12vh auto; }
.login h1 { letter-spacing: .12em; font-size: 18px; }
.login form { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.login label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--sub); }

/* スマホ：表を縦に積む */
@media (max-width: 760px) {
  main { padding: 12px; }
  .top nav { gap: 12px; }
  .list thead { display: none; }
  .list tr { display: block; border-bottom: 1px solid var(--ink); padding: 8px 0; }
  .list td { display: block; border: 0; padding: 2px 0; text-align: right; overflow: hidden; }
  .list td::before { content: attr(data-l); float: left; margin-right: 12px; color: var(--sub); font-size: 11px; line-height: 1.9; }
  .list td small { display: inline; margin-left: 4px; }
  .list td.name { text-align: left; font-size: 15px; }
  .list td.name::before { content: none; }
  .list td.name small { display: block; margin-left: 0; }
  .list td.barcol { display: block; width: auto; }
  .list .co { max-width: none; }
  .kv th { width: 110px; }
}
