/* ---- style.css ---- */
:root {
  --bg: #f4f1ea;
  --panel: #fffdf8;
  --ink: #1d1b22;
  --sub: #6f6a73;
  --line: #e4ddd0;
  --accent: #ff5a36;
  --accent-ink: #ffffff;
  --accent-soft: #ffe7df;
  --good: #1f9d63;
  --danger: #d6284d;
  --shadow: 0 1px 0 rgba(29, 27, 34, .06), 0 6px 18px rgba(29, 27, 34, .05);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141217;
    --panel: #1d1a21;
    --ink: #f3eff7;
    --sub: #a59fae;
    --line: #2f2a36;
    --accent: #ff6b4a;
    --accent-soft: #3a211b;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141217; --panel: #1d1a21; --ink: #f3eff7; --sub: #a59fae; --line: #2f2a36;
  --accent: #ff6b4a; --accent-soft: #3a211b; --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.7 "Noto Sans JP", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 6px; background: var(--accent);
  box-shadow: inset 0 0 0 4px var(--accent), inset 0 0 0 6px var(--accent-ink);
}
.brand-name { font-family: "M PLUS Rounded 1c", sans-serif; font-weight: 800; font-size: 18px; letter-spacing: .02em; }
.nav { margin-left: auto; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.nav a, .link-btn {
  text-decoration: none; padding: 6px 10px; border-radius: 999px; font-size: 14px;
  background: none; border: 0; cursor: pointer; color: var(--sub);
}
.nav a.active { background: var(--ink); color: var(--bg); }
.nav a:hover, .link-btn:hover { color: var(--ink); }
.badge {
  display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 5px;
  border-radius: 999px; background: var(--accent); color: var(--accent-ink);
  font-size: 11px; line-height: 18px; text-align: center; font-weight: 700;
}

.ban-banner {
  margin: 0; padding: 10px 16px; background: var(--danger); color: #fff; font-weight: 700; text-align: center;
}

.app { max-width: 640px; margin: 0 auto; padding: 16px 16px 80px; }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px;
}
h1, h2, h3 { font-family: "M PLUS Rounded 1c", sans-serif; line-height: 1.3; margin: 0 0 10px; }
h1 { font-size: 24px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
.muted { color: var(--sub); }
.small { font-size: 13px; }
.center { text-align: center; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

label { display: block; font-size: 13px; color: var(--sub); margin: 10px 0 4px; }
input[type=text], input[type=password], textarea, select {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 84px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); font-weight: 700; cursor: pointer;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.small { padding: 4px 12px; font-size: 13px; }

.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tab {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel); cursor: pointer; font-size: 14px;
}
.tab.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.composer .count { font-size: 12px; color: var(--sub); }
.composer .count.over { color: var(--danger); font-weight: 700; }

.post { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.post:last-child { border-bottom: 0; }
.feed { padding: 0; overflow: hidden; }
.post-head { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.post-name { font-weight: 700; text-decoration: none; }
.post-handle, .post-time { color: var(--sub); font-size: 13px; text-decoration: none; }
.post-body { white-space: pre-wrap; word-break: break-word; margin: 4px 0 8px; }
.post-body a { color: var(--accent); }
.post-reply-to { font-size: 12px; color: var(--sub); text-decoration: none; }
.post-actions { display: flex; gap: 2px; flex-wrap: wrap; }
.act {
  background: none; border: 0; padding: 4px 10px; border-radius: 999px;
  color: var(--sub); font-size: 13px; cursor: pointer; text-decoration: none;
}
.act:hover { background: var(--accent-soft); color: var(--ink); }
.act.on { color: var(--accent); font-weight: 700; }
.tag-ban {
  font-size: 11px; padding: 0 6px; border-radius: 4px; background: var(--danger); color: #fff; font-weight: 700;
}
.tag-admin {
  font-size: 11px; padding: 0 6px; border-radius: 4px; background: var(--ink); color: var(--bg); font-weight: 700;
}

.profile-head .name { font-size: 22px; font-weight: 800; font-family: "M PLUS Rounded 1c", sans-serif; }
.stats { display: flex; gap: 16px; font-size: 14px; color: var(--sub); margin: 6px 0 10px; }
.stats b { color: var(--ink); }

.dm-list a { display: block; padding: 12px 16px; border-bottom: 1px solid var(--line); text-decoration: none; }
.dm-list a:last-child { border-bottom: 0; }
.dm-thread { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; padding: 4px; }
.bubble {
  max-width: 80%; padding: 8px 12px; border-radius: 16px; white-space: pre-wrap; word-break: break-word;
  background: var(--bg); border: 1px solid var(--line);
}
.bubble.mine { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.bubble .meta { display: block; font-size: 11px; opacity: .75; margin-top: 2px; }
.bubble button { background: none; border: 0; color: inherit; opacity: .7; font-size: 11px; cursor: pointer; padding: 0 0 0 6px; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table td, .table th { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table-wrap { overflow-x: auto; }

.roulette {
  font-family: "M PLUS Rounded 1c", sans-serif; font-weight: 800; font-size: 22px;
  text-align: center; padding: 14px; border-radius: 12px; background: var(--accent-soft); margin-top: 10px;
}

.modal {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: rgba(0, 0, 0, .45);
}
.modal-card { width: min(440px, 100%); background: var(--panel); border-radius: var(--radius); padding: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px;
  font-size: 14px; max-width: calc(100% - 32px);
}

.auth { max-width: 420px; margin: 24px auto; }
.auth .hero { text-align: center; margin-bottom: 18px; }
.auth .hero p { margin: 4px 0 0; }
.error { color: var(--danger); font-size: 14px; margin-top: 8px; }

@media (max-width: 480px) {
  .brand-name { font-size: 16px; }
  .nav a, .link-btn { padding: 6px 8px; font-size: 13px; }
}

/* ---- extra.css ---- */
/* ===== v2 追加スタイル ===== */
.post { display: block; }
.post-inner { display: flex; gap: 12px; }
.post-main { flex: 1; min-width: 0; }
.post-avatar { flex: none; text-decoration: none; }
.post-id { color: var(--sub); font-size: 12px; font-variant-numeric: tabular-nums; }
.repost-by { font-size: 12px; color: var(--sub); margin: 0 0 6px 52px; }
.repost-by a { text-decoration: none; font-weight: 700; }

.avatar {
  display: inline-grid; place-items: center; flex: none; border-radius: 50%; object-fit: cover;
  background: hsl(var(--hue, 20) 70% 88%); color: hsl(var(--hue, 20) 55% 28%);
  font-family: "M PLUS Rounded 1c", sans-serif; font-weight: 800; line-height: 1;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar { background: hsl(var(--hue, 20) 35% 26%); color: hsl(var(--hue, 20) 80% 85%); } }
:root[data-theme="dark"] .avatar { background: hsl(var(--hue, 20) 35% 26%); color: hsl(var(--hue, 20) 80% 85%); }
img.avatar { background: var(--line); }

/* 投稿の下のボタン: 均等配置 */
.post-actions { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; margin-left: -8px; }
.post-actions .act { display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 6px 0; min-height: 34px; font-size: 15px; }
.post-actions .act span { font-size: 12px; min-width: 1ch; }
.act.on-green { color: #1f9d63; font-weight: 700; }
.act.on-blue { color: #2b6cb0; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px; }
.chip { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 2px 10px; font-size: 13px; cursor: pointer; }
.chip.on { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }

.quote { display: block; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin: 0 0 8px; text-decoration: none; background: var(--bg); }
.quote .row { gap: 6px; }
.quote-body { white-space: pre-wrap; word-break: break-word; font-size: 14px; margin-top: 4px; }

.yt { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; margin: 0 0 8px; padding: 0; border: 0; border-radius: 12px; overflow: hidden; cursor: pointer; background: #000; }
.yt img { width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.yt-play { position: absolute; inset: 0; margin: auto; width: 64px; height: 44px; border-radius: 12px; background: #ff0000; color: #fff; display: grid; place-items: center; font-size: 20px; }
.yt:hover .yt-play { transform: scale(1.06); }
.yt-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 0 0 8px; border-radius: 12px; overflow: hidden; }
.yt-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.popover { position: absolute; z-index: 40; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 4px; }
.menu { display: flex; flex-direction: column; min-width: 200px; }
.menu button { text-align: left; background: none; border: 0; padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.menu button:hover { background: var(--accent-soft); }
.danger-text { color: var(--danger); }
.react-pick { display: flex; gap: 2px; }
.react-pick button { font-size: 22px; background: none; border: 0; border-radius: 10px; padding: 6px 8px; cursor: pointer; }
.react-pick button:hover, .react-pick button.on { background: var(--accent-soft); }

.new-pill { position: sticky; top: 60px; z-index: 5; display: block; margin: 0 auto 10px; padding: 6px 16px; border-radius: 999px; border: 0; cursor: pointer; background: var(--accent); color: var(--accent-ink); font-weight: 700; box-shadow: var(--shadow); }
.home-top { margin-bottom: 10px; }

.notif { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--line); text-decoration: none; }
.notif:last-child { border-bottom: 0; }
.notif.unread { background: var(--accent-soft); }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kbd-hint { margin-left: 8px; }
@media (hover: none) { .kbd-hint { display: none; } }

/* プロフィール */
.profile-head { padding: 0 0 16px; overflow: hidden; }
.profile-head > *:not(.header-img):not(.profile-top) { padding-left: 16px; padding-right: 16px; }
.header-img { height: 150px; background: linear-gradient(135deg, var(--accent), #ffb547) center / cover no-repeat; }
.profile-top { display: flex; align-items: flex-end; gap: 8px; padding: 0 16px; margin-top: -42px; flex-wrap: wrap; }
.profile-top .avatar { border: 4px solid var(--panel); box-sizing: content-box; }
.profile-top .row { margin-bottom: 4px; }
.profile-head .name { margin-top: 8px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 14px; margin: 6px 0; }
.meta-row a { color: var(--accent); }
.tag-soft { background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; }

/* ランキング */
.rank-row { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); text-decoration: none; }
.rank-row:last-child { border-bottom: 0; }
.rank-no { width: 28px; text-align: center; font-weight: 800; font-family: "M PLUS Rounded 1c", sans-serif; color: var(--sub); }
.rank-no.r1 { color: #d4a017; font-size: 20px; } .rank-no.r2 { color: #9aa3ad; font-size: 18px; } .rank-no.r3 { color: #b87333; font-size: 17px; }
a.tab { text-decoration: none; }

/* DM */
.dm-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.dm-form textarea { flex: 1; min-height: 48px; }
.bubble a { color: inherit; text-decoration: underline; word-break: break-all; }
.dm-list a .row { align-items: center; }

/* ナビ: スマホでは画面下のタブバー */
.nav-ico { display: none; }
a.btn { text-decoration: none; }
@media (max-width: 640px) {
  body { padding-bottom: 64px; }
  .top { backdrop-filter: none; background: var(--bg); }
  .nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0; padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    background: var(--panel); border-top: 1px solid var(--line); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; }
  .nav[hidden] { display: none !important; }
  .nav a { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 4px 0; border-radius: 10px; font-size: 10px; position: relative; }
  .nav a.active { background: var(--accent-soft); color: var(--ink); }
  .nav-ico { display: block; font-size: 20px; line-height: 1.2; }
  .nav .badge { position: absolute; top: 0; right: 18%; margin: 0; }
  .nav #logout { display: none; }
  .new-pill { top: 64px; }
}

/* ---- nation.css ---- */
/* ===== 国家機能 ===== */
.nation-hero { display: flex; align-items: center; gap: 14px; }
.nation-emoji { font-size: 44px; line-height: 1; }
.coin-box { text-align: right; flex: none; }
.coin-box b { font-size: 18px; }
.scroll-x { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
.scroll-x .tab { flex: none; }
.topic { background: var(--accent-soft); border-radius: 10px; padding: 8px 12px; margin: 10px 0 0; }
.president-panel { border-color: #d4a017; }
.laws { margin: 0; padding-left: 20px; }
.cands { display: flex; flex-direction: column; gap: 8px; }
.cand { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.cand.voted { border-color: var(--accent); background: var(--accent-soft); }
.pledge { font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.badge-soft { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); white-space: nowrap; }
.st-passed { background: #1f9d63; color: #fff; border-color: #1f9d63; }
.st-rejected { color: var(--sub); }
.st-vetoed { background: #2b6cb0; color: #fff; border-color: #2b6cb0; }
.bill { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 6px; }
.bill.amend { border-color: #d4a017; }
.vote-bar { height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--danger) 35%, var(--bg)); overflow: hidden; }
.vote-bar span { display: block; height: 100%; background: #1f9d63; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.history li:last-child { border-bottom: 0; }
.h-ico { width: 24px; text-align: center; flex: none; }
.nation-strip { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 12px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line); text-decoration: none; box-shadow: var(--shadow); }
.ns-emoji { font-size: 28px; line-height: 1; }
.ns-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ns-topic { font-size: 13px; color: var(--accent); }
.ns-go { font-size: 22px; color: var(--sub); }
@media (max-width: 640px) { .nav a { white-space: nowrap; overflow: hidden; font-size: 9px; letter-spacing: -.02em; } }
/* はじめての人向け */
.next-action { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; margin-bottom: 12px; border-radius: var(--radius);
  border: 2px solid var(--accent); background: var(--accent-soft); text-decoration: none; cursor: pointer; font: inherit; color: inherit; }
.na-ico { font-size: 26px; line-height: 1; }
.na-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.missions .m-bar { height: 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; margin: 10px 0; }
.missions .m-bar span { display: block; height: 100%; background: var(--accent); }
.m-list { list-style: none; margin: 0; padding: 0; }
.m-list a { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); text-decoration: none; }
.m-list li:last-child a { border-bottom: 0; }
.m-check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 13px; flex: none; }
.m-list li.done .m-check { background: #1f9d63; border-color: #1f9d63; color: #fff; }
.m-list li.done b { text-decoration: line-through; color: var(--sub); }
.tut { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.55); }
.tut-card { width: min(420px, 100%); background: var(--panel); border-radius: 18px; padding: 22px; text-align: center; }
.tut-card p { text-align: left; }
.tut-ico { font-size: 56px; line-height: 1.1; margin-bottom: 6px; }
.tut-dots { display: flex; justify-content: center; gap: 6px; margin: 4px 0 14px; }
.tut-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.tut-dots span.on { background: var(--accent); width: 20px; border-radius: 999px; }
/* ===== 第2弾 ===== */
.flag { display: block; border-radius: 4px; box-shadow: 0 0 0 1px var(--line); image-rendering: pixelated; }
.nation-emoji .flag, .ns-emoji .flag { display: inline-block; vertical-align: middle; }
.flag-grid { display: grid; grid-template-columns: repeat(8, 1fr); width: min(280px, 100%); margin: 0 auto 10px; border: 1px solid var(--line); touch-action: none; }
.flag-grid button { aspect-ratio: 1; border: 0; border-right: 1px solid rgba(0,0,0,.08); border-bottom: 1px solid rgba(0,0,0,.08); padding: 0; cursor: pointer; }
.flag-pal { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.flag-pal button { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; }
.flag-pal button.on { outline: 3px solid var(--accent); outline-offset: 2px; }
.party-badge { text-decoration: none; }
.nation-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.nation-badges a { text-decoration: none; }
.festival { background: linear-gradient(90deg, #ffe08a, #ffb3c7); color: #3a2a00; font-size: 15px; }
.big-num { font-size: 24px; font-variant-numeric: tabular-nums; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 4px; border: 1px solid var(--line); }
.monuments { margin: 0; padding-left: 4px; list-style: none; }
.monuments li { padding: 4px 0; }
.party-emoji { font-size: 30px; line-height: 1; width: 40px; text-align: center; flex: none; }
.row.wrap { flex-wrap: wrap; }
.evidence { margin: 4px 0; padding: 8px 10px; border-left: 3px solid var(--line); background: var(--bg); border-radius: 6px; }
.jury-duty { border: 2px solid var(--accent); }
.poll-opts { display: flex; flex-direction: column; gap: 6px; }
.poll-opts .btn { width: 100%; text-align: left; }
.poll-res { position: relative; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); overflow: hidden; }
.poll-res.mine { border-color: var(--accent); }
.poll-bar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent-soft); z-index: 0; }
.poll-label { flex: 1; position: relative; z-index: 1; }
.poll-res b { position: relative; z-index: 1; }
.newspaper { font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; }
.np-head { text-align: center; border-bottom: 3px double var(--ink); padding-bottom: 8px; margin-bottom: 10px; }
.np-title { font-size: 28px; font-weight: 800; letter-spacing: .1em; }
.np-headline { font-size: 22px; line-height: 1.4; margin: 8px 0 12px; }
.np-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; margin-bottom: 12px; }
.np-stats div { border: 1px solid var(--line); border-radius: 8px; padding: 6px 2px; display: flex; flex-direction: column; }
.np-stats b { font-size: 18px; } .np-stats span { font-size: 11px; color: var(--sub); }
.np-cols { columns: 2 260px; column-gap: 20px; }
.news-sec { break-inside: avoid; margin-bottom: 10px; }
.news-sec h3 { border-bottom: 1px solid var(--line); padding-bottom: 2px; margin: 6px 0; font-size: 15px; }
.news-sec ul { margin: 0; padding-left: 18px; font-size: 14px; }
.history li.redacted { color: var(--sub); letter-spacing: .02em; }
.declass { background: #d4a017; color: #fff; border-color: #d4a017; }
.plus { color: #1f9d63; }
.state-bill { border-style: dashed; }

/* ---- ui.css ---- */
/* ===== 見た目の仕上げ ===== */
/* テーマ切替はヘッダーへ(ホームの上の余白をなくす) */
.home-top { display: none; }
.theme-top { order: 3; width: 34px; height: 34px; display: grid; place-items: center; flex: none;
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel); cursor: pointer; font-size: 16px; line-height: 1; }
.theme-top:hover { border-color: var(--accent); }

/* 国家タブ: アイコン付きで全部見える */
.ntabs { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; overflow: visible; padding: 0; }
.ntabs .tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 12px; font-size: 12px; min-width: 0; white-space: nowrap; }
.ntabs .t-ico { font-size: 18px; line-height: 1.15; }
.ntabs .tab.active { box-shadow: var(--shadow); }

/* くわしい説明(折りたたみ) */
details.help { margin-top: 2px; }
details.help summary { cursor: pointer; font-size: 13px; color: var(--sub); list-style: none; width: fit-content; padding: 2px 0; }
details.help summary::-webkit-details-marker { display: none; }
details.help summary::before { content: "ℹ️ "; }
details.help summary::after { content: " ▾"; font-size: 11px; }
details.help[open] summary::after { content: " ▴"; }
details.help p { margin: 6px 0 0; }

/* ミッションの折りたたみ */
.missions .m-head { cursor: pointer; }
.missions .m-head::after { content: "▴"; font-size: 12px; color: var(--sub); margin-left: 2px; }
.missions.collapsed .m-head::after { content: "▾"; }
.missions.collapsed .m-list, .missions.collapsed > p, .missions.collapsed > .row:last-child { display: none; }
.missions.collapsed .m-bar { margin-bottom: 0; }

/* 下部ナビ: 文字を少し大きく、長いラベルは短縮 */
.lbl-s { display: none; }

@media (max-width: 640px) {
  .theme-top { margin-left: auto; width: 32px; height: 32px; }
  .nav a { font-size: 10px; letter-spacing: 0; }
  .lbl-l { display: none; } .lbl-s { display: inline; }
  .ntabs { grid-template-columns: repeat(6, 1fr); }
  .ntabs .tab { font-size: 11px; padding: 5px 0; }
  .ntabs .t-ico { font-size: 17px; }
  /* 国家ページ上部をコンパクトに */
  .nation-hero { padding: 12px 14px; gap: 10px; }
  .nation-hero h1 { font-size: 20px; }
  .nation-emoji { font-size: 34px; }
  .nation-emoji .flag { width: 40px; height: 40px; }
  .coin-box b { font-size: 16px; }
  .bill .row .btn.small { padding: 4px 10px; }
}

/* ---- ui2.css ---- */
/* ===== 第3弾 ===== */
/* ヘッダーの所持金 */
.coin-chip { order: 3; text-decoration: none; font-weight: 700; font-size: 14px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); white-space: nowrap; font-variant-numeric: tabular-nums; }
.coin-chip:hover { border-color: var(--accent); }
@media (max-width: 640px) { .coin-chip { margin-left: auto; font-size: 13px; padding: 4px 10px; } .coin-chip:not([hidden]) ~ .theme-top { margin-left: 0; } }

/* 赤い点 */
.has-dot { position: relative; }
.nav a.has-dot::after, .ntabs .tab.has-dot::after {
  content: ""; position: absolute; top: 4px; right: 6px; width: 9px; height: 9px; border-radius: 50%;
  background: #e53935; box-shadow: 0 0 0 2px var(--panel);
}
.nav a.has-dot::after { top: 2px; right: 22%; }
@media (min-width: 641px) { .nav a.has-dot::after { top: 3px; right: 2px; } }

/* 開票速報 */
.flash { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.6); animation: fl-in .25s ease-out; }
.flash-card { width: min(440px, 100%); max-height: 90vh; overflow: auto; background: var(--panel); border-radius: 18px; padding: 20px; animation: fl-pop .35s cubic-bezier(.2,1.4,.4,1); }
.flash-tag { display: inline-block; background: #e53935; color: #fff; font-weight: 800; padding: 3px 12px; border-radius: 6px; font-size: 13px; letter-spacing: .08em; margin-bottom: 8px; }
.flash-rows { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.flash-row { display: flex; gap: 10px; align-items: center; }
.flash-main { flex: 1; min-width: 0; }
.flash-bar { height: 10px; border-radius: 999px; background: var(--bg); overflow: hidden; margin-top: 4px; }
.flash-bar span { display: block; height: 100%; width: 0; background: var(--sub); border-radius: 999px; transition: width 1.2s cubic-bezier(.2,.8,.2,1); }
.flash-row.win .flash-bar span { background: #d4a017; }
.flash-n { font-size: 20px; font-variant-numeric: tabular-nums; }
.flash-result { font-size: 18px; text-align: center; margin: 14px 0 4px; animation: fl-in .4s 1.3s both; }
@keyframes fl-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fl-pop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }

/* 国からのお知らせ */
.nn-title { font-size: 15px; margin: 4px 0 8px; color: var(--sub); }
.nn .notif { align-items: center; }
.nn .notif.strong { border-left: 4px solid var(--accent); }
.nn-ico { width: 32px; height: 32px; flex: none; display: grid; place-items: center; font-size: 18px; border-radius: 50%; background: var(--bg); }

/* 管理の見張り */
.alerts { border-color: #e53935; }
.al-list { list-style: none; margin: 8px 0 0; padding: 0; }
.al-list li { display: flex; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.al-list li:last-child { border-bottom: 0; }
.al-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--sub); }
.al-high .al-dot { background: #e53935; } .al-high { font-weight: 700; }
.al-mid .al-dot { background: #fb8c00; }
.ok-text { color: #1f9d63; margin: 6px 0 0; }

/* 経済タブ */
.tx-list { display: flex; flex-direction: column; }
.tx { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.tx:last-of-type { border-bottom: 0; }
.tx-main { flex: 1; min-width: 0; }
.tx-main a { text-decoration: none; font-weight: 700; }
.tx-side { text-align: right; }
.tx.me { background: var(--accent-soft); margin: 0 -8px; padding: 8px; border-radius: 8px; }
.mine-only .tx:not(.me) { display: none; }
.tx-empty { display: none; }
.mine-only.none-mine .tx-empty { display: block; }
.minus { color: var(--danger); }
.rank-row.is-me { background: var(--accent-soft); }

/* 新聞の保存 */
.np-tools { margin-bottom: 8px; }

/* ログイン前の紹介 */
.intro { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 16px; }
.intro-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 12px 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.intro-card span { font-size: 28px; line-height: 1.1; }
.intro-card b { font-size: 13px; }
.intro-card small { font-size: 11px; color: var(--sub); line-height: 1.5; }
@media (max-width: 400px) { .intro { grid-template-columns: 1fr; } .intro-card { flex-direction: row; text-align: left; flex-wrap: wrap; } .intro-card small { flex-basis: 100%; padding-left: 36px; } }

/* はじめての人 */
.newbie { display: flex; gap: 8px; align-items: flex-start; padding: 10px 14px; margin-bottom: 12px; border-radius: var(--radius);
  background: #fff6d6; color: #5a4300; border: 1px solid #f0d77a; font-size: 13px; }
:root[data-theme="dark"] .newbie { background: #3a3110; color: #f5e3a3; border-color: #6b5a1c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .newbie { background: #3a3110; color: #f5e3a3; border-color: #6b5a1c; } }

/* ホーム画面に追加 */
.install-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 12px; border-radius: var(--radius); background: var(--panel); border: 1px dashed var(--accent); }

/* ---- theme.css ---- */
/* ===== デザイン一新「国民パスポート」 =====
   表紙(ヘッダー・国のカード)だけ深緑×金箔、本文は冷たい白の紙と黒インク。
   派手さは表紙に集め、中身は静かにする。 */
:root {
  --bg: #eef2ef;          /* 紙 */
  --panel: #fbfcfa;       /* ページ */
  --ink: #15211e;         /* インク */
  --sub: #5d6b66;
  --line: #d5deda;
  --brand: #0f4c45;       /* パスポートの表紙 */
  --brand-ink: #f4efe0;
  --gold: #c9a13b;        /* 箔押し(大統領・コイン) */
  --seal: #c8372d;        /* 朱印(警告・赤い点) */
  --accent: #0f6b5f;
  --accent-ink: #ffffff;
  --accent-soft: #dcebe6;
  --good: #1d8a5b;
  --danger: #c8372d;
  --shadow: none;
  --radius: 10px;
  --display: "BIZ UDPGothic", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1412; --panel: #131e1b; --ink: #e3ece8; --sub: #8fa39c; --line: #22322e;
    --brand: #0a2e2a; --accent: #5cc3a9; --accent-ink: #062320; --accent-soft: #173a33; --danger: #ff6b5e; --seal: #ff6b5e;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1412; --panel: #131e1b; --ink: #e3ece8; --sub: #8fa39c; --line: #22322e;
  --brand: #0a2e2a; --accent: #5cc3a9; --accent-ink: #062320; --accent-soft: #173a33; --danger: #ff6b5e; --seal: #ff6b5e;
  color-scheme: dark;
}

body { font: 15px/1.75 "BIZ UDPGothic", system-ui, sans-serif; letter-spacing: .02em; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: .02em; }
h1 { font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: .02em; }
h2 { font-size: 17px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- 上のバー: 白地で見やすく、押しやすく ---------- */
.top { background: var(--panel); color: var(--ink); border-bottom: 1px solid var(--line); backdrop-filter: none; padding: 0 20px; height: 60px; gap: 16px; flex-wrap: nowrap; box-shadow: 0 1px 0 var(--line); }
.brand { flex: none; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--brand); }
:root[data-theme="dark"] .brand-name { color: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand-name { color: var(--accent); } }
.brand-mark { background: var(--brand); border: 0; border-radius: 7px; box-shadow: inset 0 0 0 5px var(--brand), inset 0 0 0 8px var(--gold); width: 26px; height: 26px; }
.nav { flex-wrap: nowrap; gap: 2px; height: 100%; }
.nav a, .link-btn { color: var(--sub); border-radius: 0; height: 100%; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; font-size: 14px; font-weight: 700; border-bottom: 3px solid transparent; }
.nav a:hover, .link-btn:hover { color: var(--ink); background: var(--bg); }
.nav a.active { background: none; color: var(--brand); border-bottom-color: var(--brand); }
:root[data-theme="dark"] .nav a.active { color: var(--accent); border-bottom-color: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nav a.active { color: var(--accent); border-bottom-color: var(--accent); } }
.nav .nav-ico { display: inline; font-size: 16px; }
.link-btn { font-weight: 400; font-size: 13px; }
.nav .badge, .badge { background: var(--seal); color: #fff; }
.coin-chip { background: var(--panel); border: 1px solid var(--gold); color: var(--ink); font-size: 14px; padding: 5px 12px; }
.coin-chip:hover { background: color-mix(in srgb, var(--gold) 12%, var(--panel)); }
.theme-top { background: var(--panel); border: 1px solid var(--line); color: var(--ink); width: 36px; height: 36px; }
.theme-top:hover { border-color: var(--accent); }
/* 横幅が中くらいの時は詰める(文字は残す)。もっと狭い時だけアイコンのみ */
@media (max-width: 1100px) and (min-width: 901px) {
  .nav .nav-ico { display: none; }
  .nav a { padding: 0 9px; }
}
@media (max-width: 900px) and (min-width: 641px) {
  .nav a { padding: 0 10px; font-size: 0; gap: 0; }
  .nav a .nav-ico { font-size: 20px; }
  .nav a .badge { font-size: 11px; }
}

/* ---------- ページ(パネル) ---------- */
.app { padding-top: 20px; }
.panel { border-radius: var(--radius); box-shadow: none; border: 1px solid var(--line); }
.feed { border-radius: var(--radius); }

/* ボタン: 角を少し残したハンコ型 */
.btn { border-radius: 8px; font-weight: 700; letter-spacing: .02em; padding: 8px 16px; }
.btn.small { border-radius: 7px; padding: 4px 11px; }
.btn.ghost { background: var(--panel); }
.btn.ghost:hover { border-color: var(--accent); }
.btn.danger { background: var(--seal); border-color: var(--seal); }
input[type=text], input[type=password], textarea, select { border-radius: 8px; background: var(--panel); }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* タブ: 下線式 */
.tabs { gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 8px 14px; margin-bottom: -1px; color: var(--sub); font-weight: 700; }
.tab:hover { color: var(--ink); }
.tab.active { background: none; color: var(--ink); border-bottom-color: var(--accent); }

/* ---------- 投稿 ---------- */
.post { padding: 14px 18px; }
.post-name { font-weight: 700; }
.post-id { font-variant-numeric: tabular-nums; }
.post-actions .act { border-radius: 8px; }
.act:hover { background: var(--accent-soft); }
.act.on { color: var(--seal); }
.chip { border-radius: 8px; background: var(--panel); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); }
.quote { border-radius: 8px; border-left: 3px solid var(--line); }
.composer textarea { background: var(--bg); border-color: transparent; }
.composer textarea:focus { background: var(--panel); }

/* ---------- 国の表紙(国家ページ上部・ホームの国カード) ---------- */
.nation-hero { background: var(--brand); color: var(--brand-ink); border: 0; position: relative; overflow: hidden; padding: 18px 20px; }
.nation-hero::before { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(201, 161, 59, .55); border-radius: 6px; pointer-events: none; }
.nation-hero h1 { font-family: var(--display); font-weight: 700; color: var(--brand-ink); font-size: 26px; letter-spacing: .02em; }
.nation-hero .muted, .nation-hero .small { color: rgba(244, 239, 224, .7); }
.nation-hero .coin-box b { color: var(--gold); font-family: var(--display); font-weight: 700; font-size: 20px; }
.nation-emoji .flag, .ns-emoji .flag { box-shadow: 0 0 0 2px var(--gold); border-radius: 3px; }
.nation-strip { background: var(--brand); color: var(--brand-ink); border: 0; border-left: 4px solid var(--gold); border-radius: var(--radius); box-shadow: none; }
.nation-strip b { font-family: var(--display); font-weight: 700; letter-spacing: .02em; }
.nation-strip .muted { color: rgba(244, 239, 224, .7); }
.nation-strip .ns-topic { color: var(--gold); }
.nation-strip .ns-go { color: var(--gold); }

/* 今やれること: 付箋 */
.next-action { border: 1px solid var(--line); border-left: 4px solid var(--seal); background: var(--panel); border-radius: var(--radius); }
.next-action .muted { color: var(--seal); font-weight: 700; }

/* 国家タブ: アイコン付きの目次 */
.ntabs { border-bottom: 0; gap: 4px; grid-template-columns: repeat(10, 1fr); }
.ntabs .tab { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--sub); margin: 0; padding: 7px 0 5px; }
.ntabs .tab.active { background: var(--ink); color: var(--panel); border-color: var(--ink); box-shadow: none; }
.has-dot::after { background: var(--seal) !important; }

/* 大統領・権力は金 */
.president-panel { border: 1px solid var(--gold); border-top: 4px solid var(--gold); }
.badge-soft { border-radius: 6px; }
.st-passed { background: var(--good); border-color: var(--good); }
.st-vetoed { background: #2f5d8a; border-color: #2f5d8a; }
.vote-bar { background: color-mix(in srgb, var(--seal) 30%, var(--panel)); border-radius: 3px; height: 6px; }
.vote-bar span { background: var(--accent); }
.bill { border-radius: 8px; }
.bill.amend { border-color: var(--gold); border-left-width: 4px; }
.cand { border-radius: 8px; }
.cand.voted { border-color: var(--accent); background: var(--accent-soft); }
.topic { border-radius: 8px; border-left: 3px solid var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--panel)); }
.missions .m-bar span, .m-bar span { background: var(--gold); }
.m-list li.done .m-check { background: var(--accent); border-color: var(--accent); }
.festival { background: color-mix(in srgb, var(--gold) 22%, var(--panel)); color: var(--ink); border-color: var(--gold); }
.big-num { font-family: var(--display); font-weight: 700; }
.rank-no { font-family: var(--display); font-weight: 700; }
.rank-no.r1 { color: var(--gold); }
.history li.redacted { color: var(--sub); }
.declass { background: var(--gold); border-color: var(--gold); color: #1d1600; }

/* 開票速報・チュートリアル: 表紙色で */
.flash-card, .tut-card { border-top: 6px solid var(--gold); border-radius: 12px; }
.flash-tag { background: var(--seal); border-radius: 4px; }
.flash-card h2, .tut-card h2 { font-family: var(--display); font-weight: 700; font-size: 21px; letter-spacing: .02em; }
.flash-row.win .flash-bar span { background: var(--gold); }
.flash-n { font-family: var(--display); font-weight: 700; }
.tut-dots span.on { background: var(--gold); }

/* 管理・通知 */
.alerts { border-color: var(--seal); border-top: 4px solid var(--seal); }
.al-high .al-dot { background: var(--seal); }
.notif.unread { background: var(--accent-soft); }
.nn .notif.strong { border-left-color: var(--seal); }

/* DM */
.bubble { border-radius: 14px 14px 14px 4px; background: var(--bg); }
.bubble.mine { border-radius: 14px 14px 4px 14px; background: var(--accent); border-color: var(--accent); }

/* モーダル・トースト */
.modal { background: rgba(8, 20, 18, .55); }
.modal-card { border-radius: 12px; border-top: 4px solid var(--brand); }
.toast { background: var(--brand); color: var(--brand-ink); border-radius: 8px; border-left: 4px solid var(--gold); }

/* ログイン前: 表紙 */
.auth .hero { background: var(--brand); color: var(--brand-ink); border-radius: 12px; padding: 28px 20px 24px; position: relative; }
.auth .hero::before { content: ""; position: absolute; inset: 7px; border: 1px solid rgba(201, 161, 59, .6); border-radius: 7px; pointer-events: none; }
.auth .hero h1 { font-family: var(--display); font-weight: 700; font-size: 34px; color: var(--brand-ink); letter-spacing: .02em; margin: 0; }
.auth .hero p { color: var(--gold); }
.intro-card { border-radius: 10px; }

/* はじめての人・ホーム追加 */
.newbie { border-radius: var(--radius); border-left: 4px solid var(--gold); }
.install-card { border-radius: var(--radius); border-style: solid; border-color: var(--line); border-left: 4px solid var(--accent); }

/* プロフィール */
.header-img { background: var(--brand) center / cover no-repeat; }
.profile-head .name { font-family: var(--display); font-weight: 700; letter-spacing: .02em; }

/* ---------- スマホ ---------- */
@media (max-width: 640px) {
  .app { padding: 14px 12px 88px; }
  .top { padding: 0 12px; height: 54px; }
  .nav { background: var(--panel); border-top: 1px solid var(--line); height: auto; padding: 2px 4px calc(2px + env(safe-area-inset-bottom)); }
  .nav a { height: auto; flex-direction: column; gap: 0; padding: 6px 0 4px; font-size: 10px; border-bottom: 0; border-top: 3px solid transparent; border-radius: 0; color: var(--sub); }
  .nav a .nav-ico { display: block; font-size: 21px; }
  .nav a.active { background: none; color: var(--brand); border-top-color: var(--brand); }
  .nav a.has-dot::after { box-shadow: 0 0 0 2px var(--panel); }
  .ntabs { grid-template-columns: repeat(5, 1fr); }
  .nation-hero { padding: 14px 16px; }
  .nation-hero h1 { font-size: 21px; }
  .post { padding: 12px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .flash, .flash-card, .flash-result { animation: none !important; }
  .flash-bar span { transition: none !important; }
}

/* ---- shell.css ---- */
/* ===== 画面の骨組み(UI/UX一新) ===== */
.shell { display: block; }
.side-r { display: none; }
.nav-more, .side-post { display: none; }

/* ---------- PC: 左メニュー / 中央 / 右 ---------- */
@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 236px minmax(0, 620px); justify-content: center; column-gap: 28px; align-items: start; }
  .main-col { min-width: 0; }
  html body .app { max-width: none; margin: 0; padding: 22px 0 80px; }
  /* 左メニュー */
  html body .top { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start;
    gap: 4px; padding: 18px 0 18px; background: none; border: 0; box-shadow: none; flex-wrap: nowrap; z-index: 5; }
  html body .top .brand { padding: 6px 14px 18px; }
  html body .brand-name { font-size: 20px; }
  html body .nav { position: static; display: flex; flex-direction: column; align-items: stretch; height: auto; margin: 0; gap: 2px; background: none; border: 0; padding: 0; }
  html body .nav[hidden] { display: none !important; }
  html body .nav a { height: auto; padding: 11px 16px; border: 0; border-radius: 999px; font-size: 16px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 14px; position: relative; }
  html body .nav a .nav-ico { display: inline-block; width: 26px; text-align: center; font-size: 21px; line-height: 1; }
  html body .nav a .lbl-l { display: inline; } html body .nav a .lbl-s { display: none; }
  html body .nav a:hover { background: var(--accent-soft); color: var(--ink); }
  html body .nav a.active { background: var(--panel); color: var(--brand); box-shadow: inset 0 0 0 1px var(--line); }
  :root[data-theme="dark"] body .nav a.active { color: var(--accent); }
  html body .nav .badge { margin-left: auto; }
  html body .nav a.has-dot::after { top: 9px; left: 36px; right: auto; box-shadow: 0 0 0 2px var(--bg); }
  html body .side-post { display: flex; margin: 14px 0 6px; padding: 13px 16px; border-radius: 999px; font-size: 16px; width: 100%; }
  html body .nav #logout { height: auto; padding: 8px 16px; border: 0; font-size: 13px; color: var(--sub); text-align: left; justify-content: flex-start; border-radius: 999px; }
  html body .coin-chip { order: 5; align-self: flex-start; margin: auto 14px 0; font-size: 15px; }
  html body .theme-top { order: 6; margin: 10px 14px 0; }
}
@media (min-width: 1240px) {
  .shell { grid-template-columns: 236px minmax(0, 620px) 300px; }
  .side-r { display: block; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 22px 0 22px; scrollbar-width: thin; }
  .nation-strip { display: none !important; } /* 右の国カードと重複するため */
}

/* ---------- 右の国の情報 ---------- */
.sr-search input { width: 100%; border-radius: 999px; padding: 10px 16px; background: var(--panel); border: 1px solid var(--line); }
.sr-nation { display: block; margin: 14px 0; padding: 16px; border-radius: 14px; background: var(--brand); color: var(--brand-ink); text-decoration: none; position: relative; }
.sr-nation::before { content: ""; position: absolute; inset: 5px; border: 1px solid rgba(201, 161, 59, .5); border-radius: 10px; pointer-events: none; }
.sr-n-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.sr-n-head b { font-size: 18px; }
.sr-n-head .small { color: rgba(244, 239, 224, .7); }
.sr-emoji { font-size: 34px; line-height: 1; }
.sr-facts { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.sr-facts div { min-width: 0; }
.sr-facts dt { font-size: 11px; color: rgba(244, 239, 224, .65); }
.sr-facts dd { margin: 0; font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-topic { margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(244, 239, 224, .18); color: var(--gold); font-size: 14px; font-weight: 700; }
.sr-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 14px; }
.sr-card h2 { font-size: 16px; margin: 0 0 6px; }
.sr-tags { list-style: none; margin: 0; padding: 0; }
.sr-tags a { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; text-decoration: none; border-bottom: 1px solid var(--line); font-weight: 700; }
.sr-tags li:last-child a { border-bottom: 0; }
.sr-foot { padding: 0 4px; }

/* ---------- スマホ・タブレット: 上バー + 下に5つ ---------- */
@media (max-width: 899px) {
  html body .top { position: sticky; top: 0; z-index: 20; height: 52px; padding: 0 14px; display: flex; flex-direction: row; align-items: center; gap: 10px;
    background: var(--panel); border-bottom: 1px solid var(--line); box-shadow: none; }
  html body .brand-name { font-size: 17px; }
  html body .coin-chip { margin-left: auto; }
  html body .theme-top { display: none; }
  html body .nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0; height: auto; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    gap: 2px; background: var(--panel); border-top: 1px solid var(--line); padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); }
  html body .nav[hidden] { display: none !important; }
  html body .nav a, html body .nav-more { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: auto; padding: 6px 0 5px;
    font-size: 11px; font-weight: 700; color: var(--sub); border: 0; border-radius: 12px; background: none; position: relative; cursor: pointer; font-family: inherit; }
  html body .nav a .nav-ico, html body .nav-more .nav-ico { display: block; font-size: 22px; line-height: 1.1; }
  html body .nav a.active { color: var(--brand); background: var(--accent-soft); }
  :root[data-theme="dark"] body .nav a.active { color: var(--accent); }
  html body .nav a[data-nav="ranking"], html body .nav a[data-nav="search"], html body .nav a[data-nav="admin"], html body .nav #logout, html body .side-post { display: none !important; }
  html body .nav a[data-nav="home"] { order: 1; } html body .nav a[data-nav="nation"] { order: 2; }
  html body .nav a[data-nav="notifications"] { order: 3; } html body .nav a[data-nav="dm"] { order: 4; }
  html body .nav a[data-nav="me"] { order: 5; } html body .nav-more { order: 6; }
  html body .nav .badge { position: absolute; top: 1px; left: 52%; margin: 0; }
  html body .nav a.has-dot::after { top: 4px; right: auto; left: 58%; box-shadow: 0 0 0 2px var(--panel); }
  html body .app { max-width: 640px; margin: 0 auto; padding: 12px 12px 92px; }
  body { padding-bottom: 0; }
}

/* その他メニュー(下から出る) */
.sheet-bg { position: fixed; inset: 0; z-index: 90; background: rgba(8, 20, 18, .45); display: flex; align-items: flex-end; justify-content: center; animation: sh-fade .15s ease-out; }
.sheet { width: min(520px, 100%); background: var(--panel); border-radius: 18px 18px 0 0; padding: 4px 8px calc(12px + env(safe-area-inset-bottom)); animation: sh-up .2s ease-out; }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 8px auto 8px; }
.sheet a, .sheet button { display: flex; gap: 14px; align-items: center; width: 100%; padding: 13px 16px; font: inherit; font-size: 16px; font-weight: 700; text-decoration: none;
  background: none; border: 0; border-radius: 12px; color: var(--ink); cursor: pointer; text-align: left; }
.sheet a:hover, .sheet button:hover { background: var(--accent-soft); }
.sheet span { width: 26px; text-align: center; font-size: 20px; }
.sheet .danger-text { color: var(--seal); }
@keyframes sh-fade { from { opacity: 0; } }
@keyframes sh-up { from { transform: translateY(30px); opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .sheet-bg, .sheet { animation: none; } }

/* ---------- 中身の整理 ---------- */
/* 投稿欄: 普段は小さく、書き始めたら広がる */
html body .composer { padding: 12px 14px; }
html body .composer textarea { min-height: 50px; transition: min-height .15s ease; }
html body .composer textarea:focus, html body .composer textarea:not(:placeholder-shown) { min-height: 112px; }
html body .composer .row { margin-top: 6px !important; }

/* 国家ページのタブ: 横にスクロールする1列(上に貼り付く) */
html body .ntabs { display: flex; grid-template-columns: none; overflow-x: auto; gap: 6px; padding: 8px 0; margin: 0 0 10px; border: 0;
  position: sticky; top: 0; z-index: 4; background: var(--bg); scrollbar-width: none; }
html body .ntabs::-webkit-scrollbar { display: none; }
html body .ntabs .tab { flex: none; flex-direction: row; gap: 6px; padding: 7px 14px; border-radius: 999px; font-size: 14px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); margin: 0; }
html body .ntabs .t-ico { font-size: 16px; line-height: 1; }
html body .ntabs .tab.active { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
html body .ntabs .tab.has-dot::after { top: 3px; right: 6px; }
@media (max-width: 899px) { html body .ntabs { top: 52px; margin: 0 -12px 10px; padding: 8px 12px; } }

/* 国家ページ上部: 小さく */
html body .nation-hero { padding: 14px 18px; margin-bottom: 4px; }
html body .nation-hero h1 { font-size: 22px; }
html body .nation-emoji .flag { width: 44px; height: 44px; }

/* 投稿の並び: 区切り線だけで軽く */
html body .feed { background: var(--panel); }
html body .post { padding: 14px 16px 6px; }
html body .post-actions { margin-left: -10px; max-width: 460px; }
html body .post-actions .act { min-height: 36px; font-size: 16px; }

/* リアクション・リポスト廃止後の投稿ボタン(返信・いいね・保存・その他) */
html body .post-actions { grid-template-columns: repeat(4, 1fr); max-width: 360px; }

/* 運営からのお知らせ */
.news-bar { display: flex; align-items: stretch; margin-bottom: 12px; background: var(--brand); color: var(--brand-ink); border-radius: 14px; overflow: hidden; }
.news-open { flex: 1; display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.news-ico { font-size: 22px; line-height: 1; }
.news-text { display: flex; flex-direction: column; min-width: 0; }
.news-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-text small { color: var(--gold); font-weight: 700; }
.news-x { background: none; border: 0; color: inherit; font-size: 20px; padding: 0 16px; cursor: pointer; opacity: .75; }
.news-x:hover, .news-open:hover { opacity: 1; background: rgba(255, 255, 255, .06); }
.news-list { max-height: 60vh; overflow-y: auto; }
.news-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.news-item:last-child { border-bottom: 0; }
.news-item p { margin: 6px 0 0; white-space: normal; }
.panel.buster { border: 2px solid var(--seal); }
.panel.buster h2 { color: var(--seal); }

/* 利用規約・プライバシーポリシー */
.legal h1 { margin-top: 28px; scroll-margin-top: 70px; }
.legal h1:first-of-type { margin-top: 14px; }
.legal h2 { font-size: 17px; margin: 20px 0 6px; }
.legal p, .legal li { line-height: 1.8; }
.legal ol, .legal ul { padding-left: 1.4em; }
.legal-jump { gap: 8px; flex-wrap: wrap; }

/* ---- settlers.css ---- */
/* 先住民(先着100人) */
.settler-tag { display: inline-flex; align-items: center; gap: 2px; margin-left: 4px; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  color: #7a5a0c; background: color-mix(in srgb, var(--gold) 22%, transparent); white-space: nowrap; vertical-align: 1px; }
:root[data-theme="dark"] .settler-tag { color: var(--gold); }
.settler-card, .settler-hello, .settler-slots { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); background: color-mix(in srgb, var(--gold) 10%, var(--panel)); }
.settler-card { margin-top: 12px; }
.settler-hello, .settler-slots { margin-bottom: 12px; }
.settler-card div, .settler-hello div, .settler-slots div { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.settler-card small, .settler-hello small, .settler-slots small { color: var(--sub); }
.settler-slots em { font-style: normal; font-weight: 700; color: var(--ink); font-size: 1.15em; }
.settler-ico { font-size: 26px; line-height: 1; }
.settler-hello button { background: none; border: 0; font-size: 20px; color: var(--sub); cursor: pointer; padding: 0 4px; }

/* ---- v6.css ---- */
/* ===== v6: 独自アイコン・投稿の境目・音声/動画・ショップ・招待 ===== */
.ic { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.22em; flex: none; }
.ic .f { fill: currentColor; stroke: none; }
.ic path.f { stroke: currentColor; stroke-width: 1.8; }
.nav-ico.svg .ic { width: 24px; height: 24px; }
@media (min-width: 900px) { html body .nav a .nav-ico.svg { font-size: 0; } html body .nav a .nav-ico.svg .ic { width: 25px; height: 25px; } }
html body .nav a.active .nav-ico.svg .ic { stroke-width: 2.3; }
.sheet span.svg .ic { width: 22px; height: 22px; }
html body .ntabs .t-ico.svg .ic { width: 17px; height: 17px; vertical-align: -3px; }
.theme-top .ic { width: 20px; height: 20px; }
.coin-chip .ic { width: 17px; height: 17px; margin-right: 4px; color: var(--gold); vertical-align: -3px; }

/* 投稿のボタン */
html body .post-actions .act { display: inline-flex; align-items: center; gap: 6px; color: var(--sub); }
html body .post-actions .act .ic { width: 19px; height: 19px; }
html body .post-actions .act.on { color: #d64545; }
html body .post-actions .act.on-blue { color: var(--brand); }
:root[data-theme="dark"] body .post-actions .act.on-blue { color: var(--accent); }
html body .post-actions .act span { font-size: 13px; }

/* 投稿の境目: 1件ずつカードにする */
html body .feed:has(> .post) { background: none; border: 0; box-shadow: none; overflow: visible; border-radius: 0; padding: 0; }
html body .feed:has(> .post) > .post { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; margin: 0 0 10px; padding: 14px 16px 6px;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--line) 70%, transparent); }
html body .feed:has(> .post) > .post:last-child { margin-bottom: 0; }
html body #main-post > .post { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); border-width: 1.5px; }

/* 音声・動画 */
.post-media { margin-top: 10px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #000; }
.post-media video { display: block; width: 100%; max-height: 520px; background: #000; }
.post-media.audio { background: var(--bg); padding: 8px; }
.post-media audio { display: block; width: 100%; height: 40px; }
.attach { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; color: var(--brand); cursor: pointer; }
.attach:hover { background: var(--accent-soft); }
.attach .ic { width: 21px; height: 21px; }
.attach-name { display: inline-flex; align-items: center; gap: 4px; max-width: 46%; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--accent-soft);
  font-size: 12.5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.attach-name button { border: 0; background: none; font-size: 15px; color: var(--sub); cursor: pointer; padding: 0 6px; }

/* 名前の色・称号 */
.title-tag { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700; color: var(--brand-ink);
  background: var(--brand); white-space: nowrap; vertical-align: 1px; }
.title-tag.big { font-size: 13px; padding: 3px 10px; margin: 0; }
.title-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }

/* ショップ */
.shop-head { display: flex; align-items: center; gap: 14px; padding: 18px 20px; margin-bottom: 12px; border-radius: 16px; background: var(--brand); color: var(--brand-ink); }
.shop-head .ic { width: 40px; height: 40px; color: var(--gold); }
.shop-head div { display: flex; flex-direction: column; }
.shop-head .muted { color: rgba(244, 239, 224, .7); }
.shop-head b { font-size: 34px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.panel h2 .ic { color: var(--brand); }
:root[data-theme="dark"] .panel h2 .ic { color: var(--accent); }
.use-list { list-style: none; margin: 0 0 8px; padding: 0; }
.use-list li > a, .use-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.use-list li { padding: 0; border-bottom: 1px solid var(--line); }
.use-list li:last-child { border-bottom: 0; }
.use-list li > a { width: 100%; padding: 11px 2px; }
.use-list.plain li { padding: 11px 2px; }
.use-list b { font-variant-numeric: tabular-nums; color: #8a6510; }
:root[data-theme="dark"] .use-list b { color: var(--gold); }
.shop-item { padding: 14px 0; border-top: 1px solid var(--line); }
.shop-item:first-of-type { border-top: 0; padding-top: 4px; }
.shop-top { display: flex; justify-content: space-between; align-items: center; }
.price { font-weight: 700; color: #8a6510; }
.price .ic { color: var(--gold); width: 16px; height: 16px; margin-right: 2px; }
.cswatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.cswatch { display: flex; width: auto; height: auto; margin: 0; vertical-align: baseline; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel);
  font: inherit; font-size: 13px; font-weight: 700; color: var(--c); cursor: pointer; }
.cswatch span { width: 14px; height: 14px; border-radius: 50%; background: var(--c); flex: none; }
.cswatch.on { border: 2px solid var(--c); }
@media (max-width: 420px) { .cswatches { grid-template-columns: repeat(2, 1fr); } }
.shop-item .row input { flex: 1; }

/* 友達招待 */
.invite-hero { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.invite-hero > .ic { width: 46px; height: 46px; color: var(--brand); flex: none; }
.invite-hero h1 { margin: 0 0 2px; font-size: 22px; }
.invite-hero p { margin: 0; }
.invite-rewards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.invite-rewards div, .invite-stats div { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px;
  background: color-mix(in srgb, var(--gold) 12%, var(--panel)); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); }
.invite-rewards b { font-size: 22px; color: #8a6510; }
.invite-rewards b .ic { color: var(--gold); }
.invite-rewards span, .invite-stats span { font-size: 12.5px; color: var(--sub); }
.invite .row input { flex: 1; }
.invite-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0 10px; }
.invite-stats div { background: var(--bg); border-color: var(--line); }
.invite-stats b { font-size: 26px; }
.invite-stats small { font-size: 14px; color: var(--sub); }
.ref-note { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 12px; border-radius: 14px; background: var(--brand); color: var(--brand-ink); }
.ref-note .ic { width: 28px; height: 28px; color: var(--gold); }
.ref-note div { display: flex; flex-direction: column; }
.ref-note small { color: rgba(244, 239, 224, .75); }

/* スマホ: ショップ・招待は「その他」から */
@media (max-width: 899px) { html body .nav a[data-nav="shop"], html body .nav a[data-nav="invite"] { display: none !important; } }
.settler-tag .ic { width: 13px; height: 13px; }
