:root {
  --red: #cf2030;
  --red-dark: #a3121f;
  --ink: #1d1d1f;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f5f5f7;
  --card: #fff;
  --ok: #15803d;
  --ok-bg: #dcfce7;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --bad: #b91c1c;
  --bad-bg: #fee2e2;
  --gold: #d4a017;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
}
a { color: var(--red-dark); }
h1 { font-size: 1.5rem; margin: 0 0 .5rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
code { background: #f1f1f4; padding: 1px 6px; border-radius: 4px; font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.bad { color: var(--bad); }
.center { text-align: center; }
.mt { margin-top: 1rem; }

/* 頂欄 */
.topbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
  padding: .6rem 16px; background: var(--red); color: #fff; position: sticky; top: 0; z-index: 10;
}
.topbar a { color: #fff; text-decoration: none; }
.brand { font-weight: 700; display: flex; align-items: center; gap: .5rem; margin-right: auto; }
.brand-mark { background: #fff; color: var(--red); border-radius: 6px; padding: 0 .4rem; font-weight: 800; }
.topbar nav { display: flex; flex-wrap: wrap; gap: .25rem; }
.topbar nav a { padding: .25rem .6rem; border-radius: 999px; font-size: .92rem; }
.topbar nav a:hover { background: rgba(255,255,255,.18); }

.container { max-width: 1080px; margin: 0 auto; padding: 20px 16px 60px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 16px; }
.card.narrow { max-width: 420px; margin: 40px auto; }
.card.narrow-lg { max-width: 640px; margin-left: auto; margin-right: auto; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.card-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* 表單 */
label { display: block; margin-bottom: 12px; font-size: .92rem; color: #374151; }
input, select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: .6rem .7rem; font: inherit;
  border: 1px solid #d1d5db; border-radius: 10px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(207,32,48,.35); border-color: var(--red); }
input[type=checkbox] { display: inline-block; width: 1.15rem; height: 1.15rem; margin: 0 .4rem 0 0; vertical-align: -3px; accent-color: var(--red); }
input:disabled, textarea:disabled { background: #f3f4f6; color: var(--muted); }
label.check { display: flex; align-items: center; font-size: 1rem; }
.btn {
  display: inline-block; padding: .55rem 1.1rem; border-radius: 10px; border: 1px solid #d1d5db; background: #fff;
  color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: #f3f4f6; }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-danger { color: var(--bad); border-color: #fca5a5; }
.btn-sm { padding: .25rem .65rem; font-size: .85rem; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.actions form, td form { margin: 0; display: inline-block; }

.flash { padding: .7rem 1rem; border-radius: 10px; margin-bottom: 12px; background: var(--ok-bg); color: var(--ok); }
.flash-warn { background: var(--warn-bg); color: var(--warn); }
.flash-bad { background: var(--bad-bg); color: var(--bad); }
.badge { display: inline-block; padding: 0 .55rem; border-radius: 999px; font-size: .78rem; background: #eef0f3; color: #4b5563; white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }

/* 頭像 */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; background: #e5e7eb; }
.avatar-lg { width: 60px; height: 60px; font-size: 1.5rem !important; }
.avatar-ph { display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #f87171, var(--red)); color: #fff; font-weight: 700; font-size: 1.05rem; }

/* 進度條 */
.pbar { position: relative; height: 12px; border-radius: 999px; background: #e5e7eb; overflow: visible; min-width: 120px; }
.pbar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #f87171, var(--red)); transition: width .4s; }
.pbar.is-done .pbar-fill { background: linear-gradient(90deg, #4ade80, var(--ok)); }
.pbar-marker { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); opacity: .55; }
.my-progress { margin-top: .5rem; }
.my-count { font-size: 1.1rem; color: var(--muted); margin-bottom: .3rem; }
.my-count b { font-size: 2.2rem; color: var(--red); }

/* 配對清單 */
.partner-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.partner { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.partner.is-done { background: #f7fdf9; border-color: #bbf7d0; }
.partner.head { border: 0; padding: 0; background: none; margin-bottom: 12px; }
.partner-main { flex: 1; min-width: 0; }
.photo-preview { display: block; max-width: 100%; max-height: 260px; border-radius: 10px; margin: 6px 0; }
.photo-thumb { width: 180px; height: 135px; object-fit: cover; border-radius: 10px; flex: none; }
.report-body { display: flex; gap: 16px; flex-wrap: wrap; }
.report-body > div { flex: 1; min-width: 220px; }
.report-body p { margin: 0 0 .6rem; }
.report-card.is-empty { opacity: .7; }
.review-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.review-form input { flex: 1; min-width: 160px; margin: 0; }
.review-form .w-num { flex: none; width: 80px; min-width: 0; }

/* 勾選格 */
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-bottom: 16px; }
.check-card { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; margin: 0; cursor: pointer; line-height: 1.3; }
.check-card.is-on { background: #fff5f5; border-color: #fca5a5; }
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: .2rem .7rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); background: #fff; font-size: .9rem; }
.chip b { color: var(--red); }
.chip.is-on { background: var(--red); color: #fff; border-color: var(--red); }
.chip.is-on b { color: #fff; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .55rem .6rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .82rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
tr.is-off { opacity: .45; }
.w-bar { min-width: 180px; width: 35%; }
.member-link { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); line-height: 1.3; }

/* 統計卡 */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.stat b { display: block; font-size: 1.6rem; line-height: 1.2; }
.stat span { display: block; color: var(--muted); font-size: .85rem; margin-bottom: 8px; }

/* 分頁籤 */
.tabs { display: inline-flex; gap: 4px; background: #e9eaee; border-radius: 10px; padding: 3px; margin-bottom: 12px; }
.tabs a { padding: .25rem .9rem; border-radius: 8px; text-decoration: none; color: var(--muted); font-size: .9rem; font-weight: 600; }
.tabs a.is-on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.tabs-lg a { padding: .5rem 1.1rem; font-size: 1rem; }
.card-head .tabs { margin: 0; }

/* 時間粒度長條圖 */
.tchart { display: flex; align-items: flex-end; gap: 4px; height: 210px; overflow-x: auto; padding-top: 4px; }
.tchart-col { flex: 1 0 34px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.tchart-bar { width: 70%; min-height: 2px; background: linear-gradient(180deg, #f87171, var(--red)); border-radius: 5px 5px 0 0; }
.tchart-n { font-size: .75rem; font-weight: 700; }
.tchart-l { font-size: .7rem; color: var(--muted); white-space: nowrap; margin-top: 3px; }
.tchart-c { font-size: .72rem; color: var(--ink); background: #eef0f3; border-radius: 6px; padding: 0 5px; }
.tchart-col { --bar-space: calc(100% - 62px); }
.tchart-col .tchart-bar { max-height: var(--bar-space); }

/* 公開排行榜 */
.board { max-width: 960px; }
.board-hero { background: linear-gradient(135deg, var(--red), #7f0d18); color: #fff; border-radius: 18px; padding: 24px; margin-bottom: 16px; text-align: center; }
.board-hero h1 { font-size: 1.9rem; margin-bottom: .2rem; }
.board-hero p { margin: 0 0 1rem; opacity: .92; }
.board-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.board-stats div { background: rgba(255,255,255,.14); border-radius: 12px; padding: 10px; }
.board-stats b { display: block; font-size: 1.7rem; line-height: 1.2; }
.board-stats span { font-size: .82rem; opacity: .9; }

.rank-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.rank-row { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.rank-no { width: 2rem; text-align: center; font-weight: 800; font-size: 1.15rem; color: var(--muted); flex: none; }
.rank-main { flex: 1; min-width: 0; }
.rank-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .5rem; margin-bottom: 5px; }
.rank-bar { height: 22px; border-radius: 8px; background: #eef0f3; overflow: hidden; }
.rank-bar-fill { height: 100%; min-width: 3px; border-radius: 8px; background: linear-gradient(90deg, #fca5a5, var(--red)); transition: width .6s ease-out; }
.rank-row.is-done .rank-bar-fill { background: linear-gradient(90deg, #86efac, var(--ok)); }
.rank-count { flex: none; width: 4.6rem; text-align: right; color: var(--muted); }
.rank-count b { font-size: 1.5rem; color: var(--ink); }
.rank-row.top-1 { border-color: var(--gold); box-shadow: 0 2px 12px rgba(212,160,23,.25); }
.rank-row.top-1 .rank-no { color: var(--gold); font-size: 1.5rem; }
.rank-row.top-2 .rank-no { color: #8e9aaf; font-size: 1.35rem; }
.rank-row.top-3 .rank-no { color: #b0703c; font-size: 1.25rem; }
.rank-row.top-1 .avatar { box-shadow: 0 0 0 3px var(--gold); }
.rank-row.top-2 .avatar { box-shadow: 0 0 0 3px #b8c0cc; }
.rank-row.top-3 .avatar { box-shadow: 0 0 0 3px #c98a54; }

/* 分頁 */
.pager-gap { align-self: center; color: var(--muted); }
.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 16px 0 24px; }

/* 獎項展示 */
.prize-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.prize-item { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fafafa; }
.prize-item.is-rank { background: #fffbeb; border-color: #fde68a; }
.prize-tag { font-size: .8rem; color: var(--warn); font-weight: 700; }
.rank-prize { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rank-prize:last-child { border-bottom: 0; }

/* 計分區塊 */
fieldset.score-block { border: 1px solid var(--line); border-radius: 12px; padding: 14px 14px 4px; margin: 0 0 16px; }
fieldset.score-block legend { font-weight: 700; padding: 0 .4rem; }
fieldset.score-block label.check { align-items: flex-start; }
fieldset.score-block input[type=checkbox] { margin-top: .25rem; flex: none; }
.pt { display: inline-block; background: var(--gold); color: #fff; border-radius: 999px; padding: 0 .6rem; font-size: .85rem; margin-right: .3rem; }
.my-points { margin-left: 1rem; }
.my-points b { color: var(--gold) !important; }
.char-count.is-ok { color: var(--ok); }

/* 秘訣、確認項目、得主 */
.rules { background: #fffbeb; border: 1px solid #fde68a; border-radius: 14px; padding: 12px 16px; margin-bottom: 16px; }
.rules summary { cursor: pointer; font-weight: 700; color: #92400e; }
.rules ul { margin: .5rem 0 0; padding-left: 1.2rem; }
.rules li { margin-bottom: .2rem; }
fieldset.checks { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 2px; margin: 0 0 16px; }
fieldset.checks legend { font-size: .9rem; color: var(--muted); padding: 0 .4rem; }
fieldset.checks label.check { align-items: flex-start; }
fieldset.checks input[type=checkbox] { margin-top: .25rem; flex: none; }
.winner-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.winner { display: flex; align-items: center; gap: 10px; line-height: 1.3; }

@media (max-width: 560px) {
  .row { grid-template-columns: 1fr; }
  .avatar-lg { width: 46px; height: 46px; }
  .rank-row { gap: 8px; padding: 8px 10px; }
  .rank-no { width: 1.4rem; }
  .rank-count { width: 3.6rem; }
  .rank-count b { font-size: 1.2rem; }
  .photo-thumb { width: 100%; height: auto; }
}

/* ===== 落地頁 ===== */
main.landing { padding-bottom: 60px; }
main.landing > .flash { max-width: 1040px; margin: 12px auto; }
.lp-wrap { max-width: 1040px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.lp-hero { background: radial-gradient(circle at 80% 0%, #e8434f 0%, var(--red) 35%, #6d0a14 100%); color: #fff; text-align: center; padding: 64px 0 72px; }
.lp-kicker { letter-spacing: .3em; font-size: .85rem; opacity: .85; margin: 0 0 .5rem; }
.lp-hero h1 { font-size: clamp(2rem, 6vw, 3.4rem); line-height: 1.2; margin: 0 0 1rem; }
.lp-lead { font-size: clamp(1.05rem, 2.6vw, 1.35rem); opacity: .95; margin: 0 0 1rem; }
.lp-date { opacity: .9; margin: 0 0 1.6rem; }
.lp-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-light { background: #fff; color: var(--red-dark); border-color: #fff; padding: .8rem 1.6rem; font-size: 1.05rem; }
.btn-light:hover { background: #ffe9eb; }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); padding: .8rem 1.6rem; font-size: 1.05rem; }
.btn-ghost:hover { background: rgba(255,255,255,.12); }
.lp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: -36px; position: relative; }
.lp-stats div { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; text-align: center; box-shadow: 0 6px 20px rgba(0,0,0,.06); }
.lp-stats b { display: block; font-size: 1.8rem; color: var(--red); line-height: 1.2; }
.lp-stats span { font-size: .85rem; color: var(--muted); }
.lp-section { padding-top: 48px; padding-bottom: 8px; }
.lp-section h2 { font-size: 1.6rem; text-align: center; margin-bottom: .4rem; }
.lp-sub { text-align: center; color: var(--muted); margin: 0 auto 1.5rem; max-width: 640px; }
.lp-h3 { margin: 2rem 0 .8rem; }
.lp-band { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 48px; padding-bottom: 40px; }
.lp-grid5 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.lp-grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 1rem; }
.lp-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; position: relative; }
.lp-card.is-gold { border-color: var(--gold); background: #fffbeb; box-shadow: 0 4px 16px rgba(212,160,23,.18); }
.lp-card h3, .lp-score h3 { margin: .3rem 0 .4rem; font-size: 1.1rem; }
.lp-card p, .lp-score p { margin: 0; color: #4b5563; font-size: .95rem; }
.lp-no { display: inline-flex; width: 2rem; height: 2rem; align-items: center; justify-content: center; border-radius: 50%; background: var(--red); color: #fff; font-weight: 800; }
.lp-score { background: var(--bg); border-radius: 16px; padding: 18px; }
.lp-podium { display: flex; justify-content: center; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 1.5rem 0; }
.lp-podium-item { display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--bg); border-radius: 16px; padding: 16px 22px; min-width: 170px; }
.lp-podium-item.p1 { order: 2; padding-top: 28px; padding-bottom: 28px; background: #fffbeb; border: 1px solid var(--gold); }
.lp-podium-item.p2 { order: 1; }
.lp-podium-item.p3 { order: 3; }
.lp-medal { font-size: 2rem; line-height: 1; }
.lp-pts b { font-size: 1.4rem; color: var(--red); }
.lp-steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 1.5rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.lp-steps li { counter-increment: step; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px 18px 18px 60px; position: relative; }
.lp-steps li::before { content: counter(step); position: absolute; left: 16px; top: 16px; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.lp-steps strong { display: block; margin-bottom: .2rem; }
.lp-steps span { color: #4b5563; font-size: .93rem; }
.lp-chips { justify-content: center; }
.lp-chips .chip { font-size: 1rem; padding: .35rem 1rem; }
.demo-box { background: #eff6ff; border: 1px dashed #93c5fd; border-radius: 12px; padding: 12px 14px; margin-top: 14px; font-size: .92rem; }
.demo-box table { margin-top: 6px; }
.demo-box td { padding: .25rem .5rem; border: 0; }
.demo-box button { padding: .15rem .6rem; }
@media (max-width: 560px) { .lp-hero { padding: 44px 0 60px; } .lp-podium-item { min-width: 0; flex: 1 1 100%; } .lp-podium-item.p1 { order: 0; } }

.member-filters { display:flex; flex-wrap:wrap; gap:12px; align-items:end; margin-bottom:16px; }
.member-filters > label { flex:1 1 150px; margin:0; }
.member-filters > label:first-child { flex-grow:2; }
input[type="checkbox"] { width:auto; }

.member-management-table { min-width:960px; }
.member-management-table .member-link { white-space:nowrap; }
fieldset { border:1px solid #e1e4ea; border-radius:10px; margin-bottom:16px; padding:16px; min-width:0; }

.bonus-section { margin:24px 0; padding:20px; border:1px solid #eed898; border-radius:12px; background:#fffdf5; }
.bonus-section h2 { margin-top:0; }
.bonus-block { margin:12px 0; border:1px solid #e5d8b5; border-radius:10px; background:#fff; }
.bonus-block > summary { padding:16px; cursor:pointer; font-weight:700; }
.bonus-body { padding:0 16px 16px; }
.bonus-block[open] > summary { border-bottom:1px solid #eee; margin-bottom:16px; }
#photo-editor { width:min(680px, calc(100vw - 24px)); max-height:92dvh; overflow:auto; border:0; border-radius:16px; padding:20px; }
#photo-editor::backdrop { background:rgba(0,0,0,.72); }
.photo-editor-stage { display:flex; justify-content:center; align-items:center; background:#20242a; padding:12px; border-radius:10px; }
#photo-editor-canvas { display:block; max-width:100%; max-height:42dvh; width:auto; height:auto; touch-action:none; cursor:grab; }
#photo-editor-canvas:active { cursor:grabbing; }
.photo-editor-controls { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-top:16px; }
.photo-editor-controls input[type=range] { padding:0; width:100%; }
.edited-photo-preview { display:flex; align-items:start; gap:12px; flex-wrap:wrap; margin:12px 0 20px; }
.edited-photo-preview .photo-preview { margin:0; }
@media(max-width:480px) { .bonus-section { padding:12px; } .photo-editor-controls { grid-template-columns:1fr; gap:0; } #photo-editor { padding:16px; } }

.bonus-block > summary .when-open { display:none; }
.bonus-block[open] > summary .when-open { display:inline; }
.bonus-block[open] > summary .when-closed { display:none; }

/* Primary member action: visible in the sticky navigation and at page entry. */
.topbar nav { align-items:center; }
.topbar nav .nav-report { display:inline-flex; align-items:center; gap:4px; min-height:42px; padding:8px 16px; background:#fff3cf; color:#8c1a22; font-weight:800; border:1px solid #ffe19a; box-shadow:0 2px 5px #650c2520; }
.topbar nav .nav-report:hover { background:#fff; color:#991624; }
.topbar nav .nav-report:focus-visible { outline:3px solid #fff; outline-offset:3px; }
.report-entry { border:2px solid var(--red); background:linear-gradient(135deg,#fff7ed,#fff); scroll-margin-top:220px; }
.report-entry h2 { color:var(--red); margin:0 0 8px; }
.report-entry-eyebrow { font-size:.8rem; font-weight:700; color:#985b38; margin:0 0 6px; }
.report-entry-form { display:flex; align-items:flex-end; gap:12px; }
.report-entry-form label { flex:1; min-width:0; margin:0; }
.report-entry-form .btn { min-height:44px; margin-bottom:0; white-space:nowrap; }
@media(max-width:560px) {
 .report-entry-form { flex-direction:column; align-items:stretch; }
 .report-entry-form .btn { width:100%; }
 .topbar nav .nav-report { font-size:.95rem; }
}

.report-extra { border-top:1px solid #edc8b8; margin-top:20px; padding-top:16px; }
.report-extra h3 { color:var(--red); margin:0 0 8px; }

/* Historical partners grouped by explicit completion state. */
.history-group + .history-group { border-top:1px solid var(--line); padding-top:20px; margin-top:20px; }
.history-person { padding:14px; border:1px solid var(--line); border-radius:12px; background:#fff; }
.history-person.is-met { background:#f1faf5; border-color:#b8ddc7; }
.history-person-head { display:flex; align-items:center; gap:10px; margin-bottom:12px; overflow-wrap:anywhere; }
.history-person-head > div { min-width:0; }
.history-source { margin:8px 0 0; }
.history-mark { display:flex; align-items:center; gap:6px; margin:12px 0 0; font-size:.85rem; cursor:pointer; }

/* Readable controls and reflow, including enlarged browser text. */
body { overflow-wrap:anywhere; }
input, select, textarea, form, .grid-2 > *, .row > * { min-width:0; }
input, select, textarea { max-width:100%; font-size:1rem; }
.btn { max-width:100%; white-space:normal; min-height:44px; }
.badge { max-width:100%; white-space:normal; }
.brand { min-width:0; }
.brand-mark { flex:none; }
.topbar nav { min-width:0; max-width:100%; }
.topbar nav a { min-height:44px; display:inline-flex; align-items:center; }
.grid-2 { grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr)); }
.row { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
.tabs { flex-wrap:wrap; max-width:100%; }
.tabs a { min-height:44px; display:inline-flex; align-items:center; }
.pbar { min-width:0; }
.report-body > div { min-width:min(220px,100%); }
label.check { gap:6px; }
input[type=checkbox] { flex:none; min-width:22px; height:22px; }
:focus-visible { outline:3px solid #1d4ed8; outline-offset:3px; }
.guide-entry { border-left:4px solid var(--red); padding:10px 14px; background:#fff; border-radius:8px; }
@media(max-width:760px) {
  /* A tall fixed menu used to obscure the form on small screens. */
  .topbar { position:relative; }
  .report-entry { scroll-margin-top:16px; }
  .topbar nav .nav-report { flex-basis:100%; justify-content:center; }
}
@media(max-width:560px) {
  .row { grid-template-columns:minmax(0,1fr); }
  .partner { flex-wrap:wrap; }
  .partner-main { flex-basis:calc(100% - 74px); }
  .partner > .btn { margin-left:auto; }
  .partner.head > .badge { margin-left:0; }
  .bonus-section { padding:12px; }
  .bonus-block > summary { padding:12px; }
  .bonus-body { padding:0 12px 12px; }
  .my-points { display:inline-block; margin-left:0; margin-right:1rem; }
  .report-entry-form .btn { white-space:normal; }
}
@media(max-width:760px) {
 .chain-progress table, .chain-progress tbody { display:block; }
 .chain-progress thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
 .chain-progress tr { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); border:1px solid var(--line); border-radius:12px; padding:10px; margin:12px 0; gap:10px; }
 .chain-progress td { display:block; min-width:0; padding:0; border:0; }
 .chain-progress td:first-child { display:none; }
 .chain-progress td:nth-child(2), .chain-progress td.w-bar { grid-column:1/-1; width:100%; }
 .chain-progress td[data-label]:before { content:attr(data-label); display:block; font-size:.85rem; color:#4b5563; margin-bottom:6px; }
}
