:root {
  --bg: #fff; --ink: #0f1419; --sub: #536471; --line: #eff3f4; --line2: #cfd9de; --hover: #f7f9f9;
  --blue: #1d9bf0; --red: #f4212e; --green: #00ba7c; --pill: #0f1419; --pill-ink: #fff; --glass: rgba(255, 255, 255, .85);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #000; --ink: #e7e9ea; --sub: #71767b; --line: #2f3336; --line2: #536471; --hover: #080808; --pill: #eff3f4; --pill-ink: #0f1419; --glass: rgba(0, 0, 0, .65); }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
i, em { font-style: normal; }
[hidden] { display: none !important; }

.col { max-width: 600px; margin: 0 auto; min-height: 100dvh; border-inline: 1px solid var(--line); padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
.pad { padding-inline: 16px; }
.stack { display: grid; gap: 12px; }

/* 上のバー */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 20px; min-height: 53px; padding: 0 12px; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.top h1 { font-size: 20px; font-weight: 800; line-height: 1.2; }
.top small { font-size: 13px; color: var(--sub); }
.top.home { display: block; padding: 0; border-bottom: 1px solid var(--line); }
.brand { height: 53px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 21px; font-weight: 900; letter-spacing: -.02em; }
.brand small { font-size: 11px; font-weight: 700; color: var(--sub); border: 1px solid var(--line2); border-radius: 99px; padding: 1px 8px; letter-spacing: 0; }
.ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 0; background: none; flex: none; }
.ic:active { background: var(--line); }
.tabs { display: flex; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 1 0 auto; min-width: 72px; height: 53px; padding: 0 16px; border: 0; background: none; color: var(--sub); font-weight: 500; position: relative; }
.tabs button.on { color: var(--ink); font-weight: 700; }
.tabs button.on::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 56px; height: 4px; margin-left: -28px; border-radius: 99px; background: var(--blue); }

/* ボタン */
.btn { display: inline-flex; justify-content: center; align-items: center; min-height: 36px; padding: 0 16px; border-radius: 999px; border: 1px solid transparent; font-weight: 700; font-size: 15px; white-space: nowrap; }
.btn:active { opacity: .8; }
.btn.solid { background: var(--pill); color: var(--pill-ink); }
.btn.blue { background: var(--blue); color: #fff; }
.btn.line { background: none; border-color: var(--line2); color: var(--ink); }
.btn.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.btn.big { width: 100%; min-height: 52px; font-size: 17px; }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 13px; background: none; border-color: var(--line2); }

/* アイコン */
.av { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: hsl(var(--h, 205) 62% 46%); color: #fff; font-weight: 800; font-size: 17px; line-height: 1; }
.av.lg { width: 56px; height: 56px; font-size: 23px; }
.av.xl { width: 84px; height: 84px; font-size: 36px; }
.av.none { background: none; border: 2px dashed var(--line2); color: var(--sub); font-weight: 400; }
.av.bell { background: var(--blue); }

/* ホーム */
.intro { padding: 24px 16px; border-bottom: 1px solid var(--line); }
.intro h2 { font-size: 27px; font-weight: 900; letter-spacing: -.02em; line-height: 1.25; }
.intro p { color: var(--sub); margin: 8px 0 16px; }
.mine { padding: 12px 0 12px 16px; border-bottom: 1px solid var(--line); }
.mine h3 { font-size: 13px; color: var(--sub); font-weight: 700; margin-bottom: 8px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-right: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 6px 14px; border-radius: 99px; border: 1px solid var(--line2); font-size: 14px; font-weight: 700; }
.chip.off { color: var(--sub); font-weight: 400; }

.post { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.post:active { background: var(--hover); }
.post-body { min-width: 0; flex: 1; }
.post-head { display: flex; gap: 4px; }
.post-head b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-head span { color: var(--sub); flex: none; }
.post-title { font-size: 17px; font-weight: 800; margin-top: 1px; }
.post-text { margin-top: 2px; overflow-wrap: anywhere; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; color: var(--sub); font-size: 13px; }
.post-meta b { font-weight: 700; }
.post-meta b.need { color: var(--blue); }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--line2); }
.dots i.on { background: var(--blue); border-color: var(--blue); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 4px; background: var(--line); color: var(--sub); font-size: 12px; font-weight: 700; white-space: nowrap; }
.tag.w { background: color-mix(in srgb, #f91880 14%, transparent); color: #f91880; }
.empty, .loading { padding: 48px 32px; text-align: center; color: var(--sub); }
.empty b { display: block; color: var(--ink); font-size: 23px; font-weight: 800; margin-bottom: 6px; }
.foot { padding: 20px 16px; font-size: 13px; color: var(--sub); }

/* 下のタブと＋ボタン */
.tabbar { position: fixed; z-index: 6; left: 0; right: 0; bottom: 0; max-width: 600px; margin: 0 auto; display: flex; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { flex: 1; height: 53px; display: grid; place-items: center; position: relative; }
.tabbar svg { width: 26px; height: 26px; }
.tabbar a.on svg { stroke-width: 2.6; }
.tabbar a.on svg path, .tabbar a.on svg circle { stroke-width: 2.8; }
.badge { position: absolute; top: 8px; left: calc(50% + 4px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--blue); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 1.5px solid var(--bg); }
.fab { position: fixed; z-index: 6; right: max(16px, calc(50vw - 284px)); bottom: calc(73px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--blue); color: #fff; display: grid; place-items: center; box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.fab:active { transform: scale(.94); }

/* 入力 */
.form { display: grid; gap: 16px; padding-top: 12px; padding-bottom: 24px; }
.lead { color: var(--sub); }
.field { display: block; position: relative; border: 1px solid var(--line2); border-radius: 4px; padding: 6px 10px 4px; }
.field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.field span { display: block; font-size: 13px; color: var(--sub); }
.field:focus-within span { color: var(--blue); }
.field input, .field select, .field textarea { display: block; width: 100%; min-height: 30px; padding: 0; border: 0; outline: 0; background: none; font-size: 17px; resize: none; -webkit-appearance: none; appearance: none; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.row3 .btn { padding: 0 6px; font-size: 14px; }
.check { display: flex; align-items: center; gap: 10px; }
.check input { width: 20px; height: 20px; accent-color: var(--blue); }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line2); border-radius: 999px; overflow: hidden; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: grid; place-items: center; height: 40px; font-weight: 700; color: var(--sub); }
.seg input:checked + span { background: var(--pill); color: var(--pill-ink); }
.terms { font-size: 13px; color: var(--sub); }

/* 卓のページ */
.detail { padding: 12px 16px 16px; border-bottom: 1px solid var(--line); }
.big-title { font-size: 25px; font-weight: 800; line-height: 1.3; margin: 12px 0 2px; letter-spacing: -.01em; }
.body { margin-top: 12px; font-size: 17px; overflow-wrap: anywhere; }
.info { margin: 14px 0 0; padding: 12px 14px; display: grid; grid-template-columns: 56px 1fr; gap: 8px 12px; border: 1px solid var(--line2); border-radius: 16px; }
.info dt { color: var(--sub); }
.info dd { margin: 0; overflow-wrap: anywhere; }
.lock { color: var(--sub); }
.seats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 16px; padding: 14px 0; border-block: 1px solid var(--line); text-align: center; }
.seats.n3 { grid-template-columns: repeat(3, 1fr); }
.seat { display: grid; justify-items: center; min-width: 0; }
.seat b { margin-top: 6px; font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat span:last-child { font-size: 12px; color: var(--sub); }
.seat.self .av { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--blue); }
.seat.vacant b { color: var(--sub); font-weight: 500; }
.act { margin-top: 16px; display: grid; gap: 10px; }
.state { padding: 14px; border-radius: 16px; background: var(--hover); border: 1px solid var(--line); text-align: center; font-weight: 700; }
.state b { font-size: 20px; color: var(--blue); }
.state.ok { color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, transparent); background: color-mix(in srgb, var(--green) 8%, transparent); }
.state.off { color: var(--sub); }
.hint { font-size: 13px; color: var(--sub); text-align: center; }

.sec { padding: 12px 16px; font-size: 20px; font-weight: 800; display: flex; align-items: baseline; gap: 10px; }
.sec small { font-size: 13px; font-weight: 400; color: var(--sub); }
.cells { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--line); }
.cell { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.cell.flat { padding: 0; }
.who { min-width: 0; flex: 1; }
.who b { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.who span { display: block; font-size: 14px; color: var(--sub); }
.who p { overflow-wrap: anywhere; }
.who em { color: var(--red); }
.tools { display: flex; gap: 6px; align-items: center; flex: none; }
.more { border: 0; background: none; color: var(--sub); font-size: 13px; padding: 6px 2px; }
.done { font-size: 13px; color: var(--sub); }
.cells .none { padding: 24px 16px; color: var(--sub); text-align: center; }
.board .cell { align-items: flex-start; border-top: 1px solid var(--line); }
.quote { margin: 0; padding: 12px 14px; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; border: 1px solid var(--line2); border-radius: 16px; user-select: all; -webkit-user-select: all; }
.reply { display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.reply input { flex: 1; min-width: 0; height: 42px; padding: 0 16px; font-size: 16px; border: 1px solid var(--line2); border-radius: 999px; background: none; outline: 0; }
.reply input:focus { border-color: var(--blue); }

/* お知らせ・自分 */
.notes li { border-bottom: 1px solid var(--line); }
.notes li.new { background: color-mix(in srgb, var(--blue) 8%, transparent); }
.profile { padding: 20px 16px; border-bottom: 1px solid var(--line); }
.profile h2 { font-size: 20px; font-weight: 800; margin-top: 10px; }
.profile p { color: var(--sub); }
.stats { display: flex; gap: 20px; margin-top: 10px; color: var(--sub); }
.stats b { color: var(--ink); }

/* 重ねる画面 */
.sheet { position: fixed; inset: 0; z-index: 20; display: grid; place-items: end center; }
.sheet-bg { position: absolute; inset: 0; background: rgba(91, 112, 131, .4); }
.sheet-body { position: relative; width: 100%; max-width: 600px; max-height: 94dvh; overflow: auto; padding: 14px 24px calc(24px + env(safe-area-inset-bottom)); background: var(--bg); border-radius: 16px 16px 0 0; }
.sheet-body h2 { font-size: 27px; font-weight: 800; margin: 6px 0 8px; letter-spacing: -.01em; }
.sheet-body .x { margin-left: -8px; font-size: 16px; }
@media (min-width: 640px) { .sheet { place-items: center; } .sheet-body { border-radius: 16px; } }
.toast { position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30; max-width: 88vw; padding: 11px 18px; border-radius: 4px; background: var(--blue); color: #fff; font-size: 15px; }

/* 差し替え予定のタグ（?dev を付けた時だけ出る） */
.swap { display: none; }
.dev .swap { display: inline-block; margin: 0 0 10px; padding: 2px 9px; font-size: 12px; font-weight: 700; color: #6a4a00; background: #ffe08a; border-radius: 4px; }

.btn.line-green { background: #06c755; color: #fff; }
