/* ═══════════════════════════════════════════════════════════════
   わがこと日本 — site shell（アプリ外の全ページ共通スキン）
   styles.css と同じトークン体系（washi / 行灯）
   ═══════════════════════════════════════════════════════════════ */
:root {
  --bg: #f7f3ea; --card: #fffdf8; --bg-dim: #efe9db;
  --ink: #211d16; --ink-soft: #575044;
  --line: #e0d8c6; --line-strong: #c9bfa8;
  --shu: #a63b28; --shu-soft: #f3e2dc;
  --fact: #2b5c8f; --fact-bg: #e9eff6;
  --interp: #7a5200; --interp-bg: #f6eeda;
  --ok: #2f6b46; --risk-high: #9c2323; --risk-bg: #f7e5e2;
  --serif: "Shippori Mincho", "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  --sans: "Zen Kaku Gothic New", "Yu Gothic UI", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Meiryo", sans-serif;
  --rad: 10px;
  --shadow: 0 1px 2px rgba(35,28,18,.06), 0 8px 28px rgba(35,28,18,.09);
}
[data-theme="dark"] {
  --bg: #17140e; --card: #201c14; --bg-dim: #12100b;
  --ink: #ece3d2; --ink-soft: #b4aa97;
  --line: #383226; --line-strong: #4c4433;
  --shu: #d0674f; --shu-soft: #3a231d;
  --fact: #7fa8d0; --fact-bg: #1d2734;
  --interp: #cfa64a; --interp-bg: #2e2716;
  --ok: #7fb894; --risk-high: #d07f74; --risk-bg: #362020;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 28px rgba(0,0,0,.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body.shell-body {
  font-family: var(--sans); background: var(--bg); color: var(--ink);
  line-height: 1.9; font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* header */
.sh-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.sh-header-in {
  max-width: 1080px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 18px;
}
.sh-mark {
  font-family: var(--serif); font-weight: 800; font-size: 19px;
  text-decoration: none; display: flex; align-items: center; gap: 9px;
}
.sh-mark i {
  font-style: normal; display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--shu); color: #fff8ef; font-size: 15px;
}
.sh-nav { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.sh-nav a {
  text-decoration: none; font-size: 13.5px; color: var(--ink-soft);
  padding: 7px 11px; border-radius: 7px; white-space: nowrap;
}
.sh-nav a:hover { background: var(--bg-dim); color: var(--ink); }
.sh-nav a[aria-current="page"] { color: var(--shu); font-weight: 700; }
.sh-auth { margin-left: 6px; }
.sh-auth a, .sh-auth button {
  font-size: 13px; text-decoration: none; border: 1px solid var(--line-strong);
  background: var(--card); color: var(--ink); padding: 7px 14px; border-radius: 999px;
}

/* layout */
.sh-main { max-width: 860px; margin: 0 auto; padding: 48px 20px 80px; }
.sh-main.wide { max-width: 1080px; }
.sh-kicker { color: var(--shu); font-size: 13px; letter-spacing: .18em; font-weight: 700; }
h1.sh-title { font-family: var(--serif); font-size: clamp(26px, 4.5vw, 38px); line-height: 1.4; margin: 10px 0 14px; }
.sh-lede { color: var(--ink-soft); max-width: 40em; }
.sh-section { margin-top: 44px; }
h2.sh-h2 { font-family: var(--serif); font-size: 22px; margin-bottom: 14px; padding-left: 12px; border-left: 4px solid var(--shu); }
.sh-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--rad); padding: 22px 24px; box-shadow: var(--shadow);
}
.sh-card + .sh-card { margin-top: 14px; }
.sh-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.sh-muted { color: var(--ink-soft); font-size: 14px; }
.sh-small { font-size: 13px; }

/* status badges — 誠実表示 */
.badge {
  display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .08em;
  padding: 3px 10px; border-radius: 999px; vertical-align: 2px;
}
.badge.live   { background: var(--fact-bg);   color: var(--fact); }
.badge.concept{ background: var(--interp-bg); color: var(--interp); }
.badge.locked { background: var(--risk-bg);   color: var(--risk-high); }
.badge.ok     { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }

/* forms */
.sh-form { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.sh-form input, .sh-form select {
  font: inherit; font-size: 15px; padding: 10px 14px; min-width: 240px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--card); color: var(--ink);
}
.sh-btn {
  font-size: 14.5px; font-weight: 700; padding: 10px 22px; border-radius: 8px;
  border: 0; background: var(--shu); color: #fff8ef;
}
.sh-btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); }
.sh-note { font-size: 13px; color: var(--ink-soft); margin-top: 10px; }
.sh-msg { margin-top: 12px; font-size: 14px; }
.sh-msg.err { color: var(--risk-high); }
.sh-msg.ok { color: var(--ok); }

/* tables */
.sh-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sh-table th, .sh-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.sh-table th { font-size: 12px; letter-spacing: .08em; color: var(--ink-soft); }

/* footer */
.sh-footer { border-top: 1px solid var(--line); margin-top: 60px; background: var(--bg-dim); }
.sh-footer-in {
  max-width: 1080px; margin: 0 auto; padding: 36px 20px;
  display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  font-size: 13.5px;
}
.sh-footer h3 { font-size: 12px; letter-spacing: .14em; color: var(--ink-soft); margin-bottom: 10px; }
.sh-footer a { display: block; text-decoration: none; color: var(--ink-soft); padding: 3px 0; }
.sh-footer a:hover { color: var(--shu); }
.sh-copy { max-width: 1080px; margin: 0 auto; padding: 0 20px 28px; font-size: 12px; color: var(--ink-soft); }

@media (max-width: 720px) {
  .sh-header-in { flex-wrap: wrap; gap: 8px; }
  .sh-nav {
    width: 100%; overflow-x: auto; margin-left: 0;
    flex-wrap: nowrap; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .sh-nav::-webkit-scrollbar { display: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ─── ナビ「きろく」ドロップダウン ─── */
.sh-dd { position: relative; display: inline-flex; }
.sh-dd-btn {
  font: inherit; font-size: 13.5px; padding: 8px 12px;
  border: none; background: transparent; color: var(--ink-soft);
  border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
}
.sh-dd-btn:hover { background: var(--bg-dim); color: var(--ink); }
.sh-dd-btn.current { color: var(--shu); font-weight: 700; }
.sh-dd-caret { font-size: 10px; opacity: .7; }
.sh-dd-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
  min-width: 230px; padding: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 14px 34px -12px rgba(0,0,0,.25);
  display: flex; flex-direction: column;
}
.sh-dd-menu a {
  font-size: 13.5px; padding: 9px 12px; border-radius: 8px;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.sh-dd-menu a:hover { background: var(--bg-dim); }
.sh-dd-menu a[aria-current="page"] { color: var(--shu); font-weight: 700; }
.sh-dd-sep { height: 1px; background: var(--line); margin: 6px 4px; }
@media (max-width: 720px) {
  .sh-dd-menu { position: fixed; left: 12px; right: 12px; top: auto; min-width: 0; }
}

/* back to top */
.to-top {
  position: fixed; right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom)); z-index: 55;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px -8px rgba(0,0,0,.28);
  font-size: 18px; cursor: pointer;
  opacity: 0; pointer-events: none; transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { color: var(--shu, #c0392b); }
