/* ============================================================
   Substack番付 つみあげウォッチ — デザイン: モダン・エディトリアル × 番付
   ============================================================ */
:root {
  --paper:   #f5f1ea;   /* 和紙色の背景 */
  --paper-2: #fbf9f4;
  --card:    #ffffff;
  --ink:     #211d18;   /* 墨 */
  --ink-2:   #5c5448;
  --ink-3:   #8a8174;
  --line:    #e7e0d3;
  --line-2:  #f0ebe1;
  --accent:  #ef6011;   /* つみあげオレンジ */
  --accent-2:#c94b00;
  --accent-tint: #fdeede;
  --gold:    #b88a2a;
  --silver:  #8d9298;
  --bronze:  #b06a37;
  --shadow-sm: 0 1px 2px rgba(33,29,24,.04), 0 2px 6px rgba(33,29,24,.05);
  --shadow-md: 0 6px 24px rgba(33,29,24,.09);
  --r: 16px; --r-sm: 11px; --r-pill: 999px;
  --font-ui: "Zen Kaku Gothic New", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  --font-serif: "Zen Old Mincho", "Hiragino Mincho ProN", serif;
  --font-num: "Fraunces", Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background:
    radial-gradient(1200px 480px at 80% -120px, #fff6ec 0%, rgba(255,246,236,0) 70%),
    var(--paper);
  line-height: 1.7;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--accent); }
::selection { background: var(--accent-tint); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
b, strong { font-weight: 700; }

/* ── Hero ─────────────────────────────────────────────── */
.hero {
  position: relative;
  background:
    linear-gradient(180deg, var(--paper-2) 0%, rgba(251,249,244,0) 100%);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.hero::before {            /* 上部のアクセント罫 */
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, #ffa766 100%);
}
.hero::after {            /* 背景の巨大な「番」ゴースト */
  content: "番"; position: absolute; right: -2%; top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-serif); font-weight: 900;
  font-size: 320px; line-height: 1; color: #ec600d;
  opacity: .05; pointer-events: none; user-select: none;
}
.hero-inner { padding: 30px 20px 26px; position: relative; z-index: 1; }
.hero-brand { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 16px; }
.hero-icon {
  width: 72px; height: 72px; flex: none; align-self: center;
  filter: drop-shadow(0 6px 14px rgba(239,96,17,.28));
}
.kicker {
  margin: 0 0 10px; font-size: .68rem; font-weight: 700;
  letter-spacing: .22em; color: var(--accent-2); text-transform: uppercase;
}
.hero-title {
  margin: 0; font-weight: 900; font-size: clamp(1.5rem, 5vw, 2.4rem);
  letter-spacing: .01em; line-height: 1.18;
}
.hero-title .accent { color: var(--accent); display: block; margin-top: 1px; }
.hero-lead {
  margin: 16px 0 0; max-width: 40em;
  font-size: 1rem; color: var(--ink-2); line-height: 1.85;
}
.hero-lead a { font-weight: 700; border-bottom: 1px solid currentColor; }
.pitch { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 9px; max-width: 640px; }
.pitch li {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 10px 14px; font-size: .86rem;
  box-shadow: var(--shadow-sm);
}
.pitch .pitch-ic { font-size: 1rem; line-height: 1.5; }
.pitch b { display: inline-block; margin-right: .5em; color: var(--ink); }
.pitch li span:last-child { color: var(--ink-2); }

/* メタ情報 */
.meta-bar {
  display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 20px;
  padding-top: 16px; border-top: 1px dashed var(--line);
  font-size: .8rem; color: var(--ink-3);
}
.meta-bar b { color: var(--ink); font-family: var(--font-num); font-weight: 600;
  font-size: .95rem; letter-spacing: 0; }

/* ── ビュータブ ───────────────────────────────────────── */
main { padding-bottom: 8px; }
.tabs { display: flex; gap: 4px; margin: 26px 0 18px; border-bottom: 1px solid var(--line); }
.tab {
  appearance: none; background: none; border: none; cursor: pointer;
  font: inherit; font-weight: 700; color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-bottom: 2.5px solid transparent; margin-bottom: -1px;
  transition: color .15s;
}
.tab-ic { width: 15px; height: 15px; display: inline-flex; color: currentColor; }
.tab-ic svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.tab .tab-no {
  font-family: var(--font-serif); font-weight: 700; font-size: .82rem;
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--line-2); color: var(--ink-3); transition: all .15s;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.tab.is-active .tab-no { background: var(--accent); color: #fff; }

/* ── コントロール（期間・検索） ───────────────────────── */
.controls {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  justify-content: space-between; margin-bottom: 12px;
}
.period-tabs { display: flex; flex-wrap: wrap; gap: 7px; }
.period-tabs button, .month-select {
  appearance: none; cursor: pointer; font: inherit; font-size: .82rem; font-weight: 500;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  padding: 6px 14px; border-radius: var(--r-pill); transition: all .14s;
  box-shadow: var(--shadow-sm);
}
.period-tabs button:hover { border-color: #d8cdb8; color: var(--ink); }
.period-tabs button.is-active {
  background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 700;
  box-shadow: 0 3px 10px rgba(33,29,24,.18);
}
.month-select {
  padding: 6px 30px 6px 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235c5448' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.custom-range { display: inline-flex; align-items: center; gap: 6px; }
.custom-range input[type="date"] {
  font: inherit; font-size: .8rem; padding: 5px 10px; border: 1px solid var(--accent);
  border-radius: var(--r-pill); background: var(--card); color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.custom-range input[type="date"]:focus { outline: none; box-shadow: 0 0 0 3px var(--accent-tint); }
.custom-range .cr-sep { color: var(--ink-3); font-size: .8rem; }
.search-wrap { flex: 1 1 200px; min-width: 170px; max-width: 280px; }
#searchBox {
  width: 100%; font: inherit; font-size: .86rem; padding: 8px 16px;
  border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--card);
  box-shadow: var(--shadow-sm);
}
#searchBox::placeholder { color: var(--ink-3); }
#searchBox:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.export-btn {
  appearance: none; cursor: pointer; font: inherit; font-size: .78rem; font-weight: 700;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  padding: 7px 13px; border-radius: var(--r-pill); box-shadow: var(--shadow-sm);
}
.export-btn:hover { border-color: var(--accent); color: var(--accent-2); }
.period-note { font-size: .76rem; color: var(--ink-3); margin: 2px 0 12px; letter-spacing: .02em; }

/* ── テーブル ─────────────────────────────────────────── */
.table-scroll {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--card); box-shadow: var(--shadow-sm);
}
.rank-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.rank-table thead th {
  position: sticky; top: 0; z-index: 2;
  background: #f4efe6; color: var(--ink-2);
  font-weight: 700; font-size: .72rem; letter-spacing: .03em; text-align: right;
  padding: 11px 10px; white-space: nowrap;
  border-bottom: 2px solid var(--ink);
}
.rank-table th.col-action { width: 88px; text-align: center; }
.rank-table thead th.num { text-align: center; }
.rank-table th.col-action { text-align: center; }
.rank-table th[data-sort] { cursor: pointer; user-select: none; transition: background .12s, color .12s; }
.rank-table th[data-sort]:hover { color: var(--accent-2); }
.rank-table th.col-idx { text-align: center; width: 46px; }
.rank-table th.col-avatar { width: 48px; padding: 0; }
.rank-table th.col-name { text-align: left; }
.rank-table th.sorted::after { content: " ▾"; }
.rank-table th.sorted.asc::after { content: " ▴"; }

.rank-table tbody td {
  padding: 11px 10px; border-bottom: 1px solid var(--line-2);
  text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap;
  color: var(--ink); transition: background .12s;
}
.rank-table tbody tr:last-child td { border-bottom: none; }
.rank-table tbody tr:hover td { background: #fcf9f3; }

.col-idx { text-align: center !important; width: 46px; }
.rank-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 26px; padding: 0 6px; border-radius: 8px;
  font-family: var(--font-num); font-weight: 600; font-size: .98rem; color: var(--ink-3);
}
.score-value-badge,
.score-rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 28px; padding: 0 8px; border-radius: 8px;
  background: var(--paper-2); border: 1px solid var(--line); color: var(--accent-2);
  font-family: var(--font-num); font-size: .95rem; font-weight: 600;
}
.rank-table th.col-score, .rank-table td.col-score { border-left: 1px solid var(--line); }
.col-score .score-value-badge {
  background: var(--accent-tint); border-color: #f6dcc3; color: var(--accent-2); font-weight: 700;
  min-width: 40px; height: 30px; font-size: 1rem;
}
.detail-btn {
  appearance: none; cursor: pointer; font: inherit; font-size: .72rem; font-weight: 700;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 9px; border-radius: var(--r-pill); border: 1px solid var(--accent);
  background: var(--accent); color: #fff; box-shadow: var(--shadow-sm);
}
.detail-btn:hover { background: var(--accent-2); border-color: var(--accent-2); }
.detail-btn svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.medal-1 .rank-num { background: linear-gradient(180deg,#f6e6b4,#e9cf86); color: #7a5a12; box-shadow: inset 0 0 0 1px #e3c267; }
.medal-2 .rank-num { background: linear-gradient(180deg,#eceef0,#dde1e5); color: #5a6066; box-shadow: inset 0 0 0 1px #d2d6da; }
.medal-3 .rank-num { background: linear-gradient(180deg,#f3ddc8,#e7c3a2); color: #84502a; box-shadow: inset 0 0 0 1px #e0b48d; }

.col-avatar { padding: 6px 0 6px 8px !important; width: 48px; text-align: center !important; }
.avatar-link { display: inline-block; line-height: 0; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
  background: #eee; display: inline-block; vertical-align: middle;
  box-shadow: 0 0 0 1px var(--line), var(--shadow-sm);
}
.avatar-link:hover .avatar { box-shadow: 0 0 0 2px var(--accent); }
.avatar-fallback {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-size: 1.05rem; font-weight: 700; color: #fff;
  background: linear-gradient(160deg,#f5853d,#ef6011);
}
.col-name { text-align: left !important; white-space: normal !important;
  min-width: 190px; max-width: 340px; line-height: 1.4; }
.col-name a { font-weight: 700; color: var(--ink); }
.col-name a:hover { color: var(--accent-2); }
.col-name .host { display: block; font-size: .68rem; color: var(--ink-3); font-weight: 400; margin-top: 1px; }
.rank-table .host { display: block; font-size: .68rem; color: var(--ink-3); font-weight: 400; margin-top: 1px; }
.num.hot, td.hot { color: var(--accent-2); font-weight: 700; }

/* ソート中の列ハイライト */
.rank-table thead th.sorted { background: var(--ink); color: #fff; border-bottom-color: var(--accent); }
.rank-table thead th.sorted:hover { color: #fff; }
.rank-table tbody td.is-sorted { background: var(--accent-tint); color: var(--accent-2); font-weight: 700; }
.rank-table tbody tr:hover td.is-sorted { background: #fce0cb; }
.col-name.is-sorted a { color: var(--accent-2); }

.rank-table.compact { font-size: .84rem; }
.rank-table.compact thead th { border-bottom-width: 2px; }
.rank-table.compact td, .rank-table.compact th { padding: 9px 11px; }

.empty-note { color: var(--ink-3); font-size: .86rem; padding: 18px 4px; }

/* ── 番付偏差値 ─────────────────────────────────────── */
.score-panel {
  margin: 0 0 14px; padding: 13px 14px;
  border: 1px solid #f2d4bb; border-radius: var(--r);
  background: linear-gradient(180deg,#fffaf4,#fff3e8);
  box-shadow: var(--shadow-sm);
}
.score-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 10px;
}
.score-eyebrow {
  font-size: .68rem; font-weight: 700; letter-spacing: .16em;
  color: var(--accent-2); text-transform: uppercase;
}
.score-panel button {
  appearance: none; cursor: pointer; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; border-radius: var(--r-pill);
  padding: 5px 12px; font: inherit; font-size: .76rem; font-weight: 700;
}
.score-panel button:hover { background: var(--accent-2); border-color: var(--accent-2); }
.score-main {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 13px;
}
.score-ring {
  width: 72px; height: 72px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at center, #fff 0 55%, transparent 57%),
    conic-gradient(var(--accent) 0 78%, #f3ddc8 78% 100%);
  box-shadow: inset 0 0 0 1px #f2d4bb, var(--shadow-sm);
  flex: none;
}
.score-ring span {
  font-family: var(--font-num); font-size: 1.5rem; line-height: 1; font-weight: 600;
  color: var(--accent-2); font-variant-numeric: tabular-nums;
}
.score-ring small { margin-top: 2px; font-size: .58rem; font-weight: 700; color: var(--ink-3); }
.score-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.score-copy b { font-family: var(--font-serif); font-size: 1.02rem; color: var(--ink); }
.score-copy span { font-size: .78rem; color: var(--ink-2); line-height: 1.6; }
.score-copy small { font-size: .68rem; color: var(--ink-3); line-height: 1.5; }
.score-rank-line { font-size: .72rem; color: var(--accent-2); font-weight: 700; }

/* ── トレンド ─────────────────────────────────────────── */
.trend-grid { display: grid; gap: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.card h3 {
  margin: 0 0 5px; font-family: var(--font-serif); font-weight: 700; font-size: 1.06rem;
  letter-spacing: .02em;
}
.card h3::before {
  content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); vertical-align: middle; margin: -3px 9px 0 0;
}
.card-note { margin: 0 0 14px; font-size: .77rem; color: var(--ink-3); line-height: 1.6; }
.stat-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat-card {
  background: linear-gradient(180deg,#fff8f1,#fdeede);
  border: 1px solid #f6dcc3; border-radius: var(--r-sm);
  padding: 16px 12px; text-align: center; display: flex; flex-direction: column; gap: 3px;
}
.stat-card .stat-val {
  font-family: var(--font-num); font-size: 1.85rem; font-weight: 600; color: var(--accent-2);
  font-variant-numeric: tabular-nums; line-height: 1.05;
}
.stat-card .stat-lbl { font-size: .72rem; color: #936a4d; font-weight: 500; }
.compare-controls { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.compare-controls select {
  appearance: none; cursor: pointer; font: inherit; font-size: .82rem; font-weight: 500;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  padding: 7px 12px; border-radius: var(--r-pill); box-shadow: var(--shadow-sm); min-width: 240px;
}
.compare-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.compare-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: var(--r-pill);
  background: var(--paper-2); border: 1px solid var(--line); font-size: .74rem; color: var(--ink-2);
}
.compare-pill b { color: var(--ink); }
.category-detail {
  margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: linear-gradient(180deg,#fffaf4,#fffdf9);
}
.category-detail-head {
  display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 12px;
}
.category-eyebrow {
  display: inline-block; font-size: .66rem; font-weight: 700; letter-spacing: .16em;
  color: var(--accent-2); text-transform: uppercase; margin-bottom: 4px;
}
.category-detail h4 {
  margin: 0; font-family: var(--font-serif); font-size: 1.06rem; line-height: 1.3;
}
.category-detail button {
  appearance: none; cursor: pointer; font: inherit; font-size: .76rem; font-weight: 700;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  padding: 6px 10px; border-radius: var(--r-pill); box-shadow: var(--shadow-sm);
}
.category-detail button:hover { border-color: var(--accent); color: var(--accent-2); }
.category-detail-grid { display: grid; gap: 14px; }
.category-mini-title { font-size: .75rem; color: var(--ink-3); font-weight: 700; margin-bottom: 8px; }
.category-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.category-list li {
  display: flex; justify-content: space-between; gap: 10px; align-items: baseline;
  padding: 8px 10px; border-radius: 10px; background: var(--card); border: 1px solid var(--line);
}
.category-list li a { font-weight: 700; color: var(--ink); }
.category-list li a:hover { color: var(--accent-2); }
.category-list li span { font-size: .72rem; color: var(--ink-3); white-space: nowrap; }
.newcomer-note { font-size: .72rem; }

/* ── フッター ─────────────────────────────────────────── */
.site-footer { margin-top: 40px; border-top: 1px solid var(--line);
  background: var(--paper-2); padding: 26px 0 56px; }
.site-footer p { margin: 5px 0; font-size: .78rem; color: var(--ink-3); }
.site-footer .disclaimer { line-height: 1.6; max-width: 52em; }
.site-footer .gen { font-size: .72rem; color: #a89e8d; margin-top: 10px; }
.creator {
  display: inline-flex; align-items: center; gap: 13px; margin-bottom: 16px;
  padding: 11px 20px 11px 11px; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--card); text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm);
  transition: all .15s;
}
.creator:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.creator-icon { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--line); }
.creator-text { display: flex; flex-direction: column; line-height: 1.35; }
.creator-label { font-size: .66rem; color: var(--ink-3); letter-spacing: .14em; text-transform: uppercase; }
.creator-name { font-size: .92rem; font-weight: 700; }
.creator-sub { font-size: .72rem; color: var(--accent-2); }

/* ── レスポンシブ ─────────────────────────────────────── */
@media (min-width: 720px) {
  .hero-inner { padding: 44px 20px 34px; }
  .hero-icon { width: 86px; height: 86px; }
  .pitch { grid-template-columns: 1fr 1fr; }
  .trend-grid { grid-template-columns: 1fr 1fr; }
  .trend-grid .card:first-child { grid-column: 1 / -1; }
  .trend-grid .card:nth-child(4) { grid-column: 1 / -1; }
  .stat-cards { grid-template-columns: repeat(4, 1fr); }
  .category-detail-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .hero::after { font-size: 200px; opacity: .045; }
  .score-main { grid-template-columns: 1fr; justify-items: start; }
  .score-panel-head { align-items: flex-start; flex-direction: column; }
  .compare-controls select { min-width: 0; width: 100%; }
  .category-detail-head { flex-direction: column; }
  .category-list li { flex-direction: column; align-items: flex-start; }
  .category-list li span { white-space: normal; }
}

/* ── クリック可能な行 / 日別ビュー ─────────────────────── */
.row-click { cursor: pointer; }
.daily-nav { display: flex; align-items: center; gap: 8px; }
.day-arrow {
  appearance: none; cursor: pointer; font: inherit; font-size: 1.1rem; line-height: 1;
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm);
}
.day-arrow:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.day-arrow:disabled { opacity: .35; cursor: default; }
.day-select { min-width: 148px; text-align: center; font-variant-numeric: tabular-nums; }
.daily-title {
  display: block; margin-top: 2px; font-size: .76rem; font-weight: 400;
  color: var(--ink-2); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.daily-title:hover { color: var(--accent-2); }

/* ── モーダル ─────────────────────────────────────────── */
body.modal-open { overflow: hidden; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end;
  justify-content: center; background: rgba(33,29,24,.5); backdrop-filter: blur(2px);
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  position: relative; width: 100%; max-width: 620px; max-height: 92vh; overflow-y: auto;
  background: var(--card); border-radius: 20px 20px 0 0; padding: 24px 20px 30px;
  box-shadow: 0 -8px 40px rgba(33,29,24,.3); animation: slideUp .22s cubic-bezier(.2,.7,.3,1);
}
@keyframes slideUp { from { transform: translateY(24px); } to { transform: translateY(0); } }
.modal-close {
  position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%;
  border: none; background: var(--line-2); color: var(--ink-2); font-size: 1.3rem; line-height: 1;
  cursor: pointer;
}
.modal-close:hover { background: var(--line); color: var(--ink); }
.dm-head { display: flex; align-items: center; gap: 13px; padding-right: 36px; }
.dm-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--line); flex: none; }
.dm-head-text { display: flex; flex-direction: column; min-width: 0; }
.dm-name { font-family: var(--font-serif); font-size: 1.18rem; font-weight: 700; color: var(--ink); line-height: 1.3; }
.dm-name:hover { color: var(--accent-2); }
.dm-host { font-size: .74rem; color: var(--ink-3); margin-top: 2px; }
.dm-actions {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 2px;
}
.dm-share-btn {
  appearance: none; cursor: pointer; font: inherit; font-size: .76rem; font-weight: 700;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: var(--r-pill); border: 1px solid var(--line);
  background: var(--card); color: var(--ink-2); box-shadow: var(--shadow-sm);
}
.dm-share-btn:hover { border-color: var(--accent); color: var(--accent-2); }
.dm-share-btn:disabled { opacity: .6; cursor: default; }
.dm-share-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.dm-share-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.dm-share-primary svg { stroke: currentColor; }
.dm-share-btn svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dm-stats {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 18px 0 6px;
}
.dm-stat {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 4px; text-align: center; display: flex; flex-direction: column; gap: 1px;
}
.dm-stat-v { font-family: var(--font-num); font-size: 1.05rem; font-weight: 600; color: var(--ink); }
.dm-stat-l { font-size: .6rem; color: var(--ink-3); white-space: nowrap; }
.dm-score {
  margin-top: 12px; padding: 12px;
  border: 1px solid #f2d4bb; border-radius: 12px;
  background: linear-gradient(180deg,#fffaf4,#fff3e8);
}
.dm-score:empty { display: none; }
.dm-score .score-main.compact { gap: 11px; }
.dm-score .score-ring { width: 60px; height: 60px; }
.dm-score .score-ring span { font-size: 1.25rem; }
.dm-score .score-copy b { font-size: .95rem; }
.dm-score .score-copy span { font-size: .74rem; }
.dm-score .score-rank-line { font-size: .68rem; }
.dm-chart-wrap, .dm-history-wrap { margin-top: 20px; }
.dm-chart-title { font-size: .82rem; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.dm-chart-title span { font-weight: 400; font-size: .74rem; color: var(--ink-3); }
.dm-chart {
  border: 1px solid var(--line); border-radius: 12px; background: var(--paper-2); padding: 8px 6px;
}
.dm-loading { text-align: center; color: var(--ink-3); font-size: .82rem; padding: 30px 0; }
.rank-chart { width: 100%; height: auto; display: block; }
.rank-chart .g-grid { stroke: #e3dccd; stroke-width: 1; stroke-dasharray: 3 3; }
.rank-chart .g-lbl { fill: #a89e8d; font-size: 11px; font-family: var(--font-num); }
.rank-chart .g-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.rank-chart .g-dot { fill: #fff; stroke: var(--accent); stroke-width: 1.6; }
.rank-chart .g-best { fill: var(--gold); stroke: #a9781f; }
.dm-history { display: flex; flex-direction: column; gap: 2px; }
.dm-h-row {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px;
  padding: 9px 8px; border-radius: 9px; text-decoration: none; color: var(--ink);
}
.dm-h-row:hover { background: var(--paper-2); }
.dm-h-rank {
  font-family: var(--font-num); font-weight: 600; font-size: .82rem; text-align: center;
  padding: 3px 0; border-radius: 7px; background: var(--line-2); color: var(--ink-2);
}
.dm-h-rank.medal-1 { background: linear-gradient(180deg,#f6e6b4,#e9cf86); color: #7a5a12; }
.dm-h-rank.medal-2 { background: linear-gradient(180deg,#eceef0,#dde1e5); color: #5a6066; }
.dm-h-rank.medal-3 { background: linear-gradient(180deg,#f3ddc8,#e7c3a2); color: #84502a; }
.dm-h-title { font-size: .84rem; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-h-meta { font-size: .7rem; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }

@media (min-width: 620px) {
  .modal-backdrop { align-items: center; }
  .modal { border-radius: 20px; max-height: 88vh; }
}
@media (max-width: 520px) {
  .dm-stats { gap: 5px; }
  .dm-stat { padding: 8px 2px; }
  .dm-stat-v { font-size: .82rem; }
  .dm-stat-l { font-size: .52rem; overflow: hidden; text-overflow: ellipsis; }
  .dm-h-row { grid-template-columns: 40px 1fr; }
  .dm-h-meta { grid-column: 2; }
}
.modal-backdrop[hidden] { display: none; }

/* スクロール追従ヘッダー（フローティング） */
.sticky-head {
  position: fixed; top: 0; z-index: 50; overflow: hidden;
  background: #f4efe6; border-bottom: 2px solid var(--ink);
  box-shadow: 0 6px 16px rgba(33,29,24,.10); border-radius: 0 0 4px 4px;
}
.sticky-head[hidden] { display: none; }
.sticky-inner { overflow: hidden; }
.sticky-head table { border-collapse: collapse; }
.sticky-head thead th { position: static; box-shadow: none; }

/* 共有トースト */
.card-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px);
  background: var(--ink); color: #fff; font-size: .82rem; font-weight: 600;
  padding: 11px 18px; border-radius: var(--r-pill); box-shadow: var(--shadow-md);
  z-index: 200; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  max-width: 90vw; text-align: center;
}
.card-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── 偏差値ガイド ─────────────────────────────────────── */
.score-guide { margin: 32px 0 12px; scroll-margin-top: 16px; }
.guide-card {
  background: linear-gradient(180deg,#fffaf4,#fffefb);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 26px 26px 28px; box-shadow: var(--shadow-sm);
}
.guide-card h2 {
  margin: 0; font-family: var(--font-serif); font-weight: 700;
  font-size: clamp(1.45rem, 4.5vw, 1.9rem); line-height: 1.3;
}
.guide-card h2::before {
  content: "📐"; margin-right: .4em; font-size: .85em;
}
.guide-lead {
  margin: 14px 0 0; max-width: 60em; font-size: .9rem; color: var(--ink-2); line-height: 1.85;
}
.guide-lead b { color: var(--ink); }
.guide-formula {
  margin-top: 18px; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--card); box-shadow: var(--shadow-sm); overflow-x: auto;
}
.guide-formula code {
  font-family: var(--font-num); font-size: .92rem; color: var(--ink); white-space: nowrap;
  letter-spacing: .01em;
}
.guide-points {
  margin: 18px 0 0; padding-left: 1.3em; color: var(--ink-2); font-size: .86rem; line-height: 1.85;
  list-style-position: outside;
}
.guide-points li { padding-left: 4px; }
.guide-points li + li { margin-top: 6px; }
.guide-points b { color: var(--ink); }

/* ヘッダの偏差値ガイドへのリンク */
.score-guide-link {
  display: inline-flex; align-items: center; margin-top: 14px; font-size: .8rem; font-weight: 700;
  color: var(--accent-2); border-bottom: 1px solid transparent;
}
.score-guide-link:hover { border-bottom-color: currentColor; }

/* 購読者数（参考値・概数） */
.col-subs { text-align: right; white-space: nowrap; }
.subs-badge {
  display: inline-block; font-weight: 700; font-size: .82rem;
  color: var(--ink-2); background: #f3efe7;
  border-radius: 999px; padding: 1px 8px;
}
.subs-none { color: var(--ink-3); }
