:root {
  color-scheme: light;  /* always the light look, whatever the device's theme */
  --bg: #faf7f5;
  --card: #ffffff;
  --ink: #241c1c;
  --muted: #7a6a68;
  --line: #eadfdc;
  --accent: #9b1c31;
  --accent-ink: #ffffff;
  --gold: #b8892b;
  --ok: #2f7a4b;
  --warn: #b5541c;
  --chip: #f3e9e6;
  --real: #c0392b;
  --remote: #2563eb;
  --custom: #b8892b;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  /* gothic / 黑体 only, never mincho / 宋体 */
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP",
    "Noto Sans CJK JP", "Yu Gothic UI", "Yu Gothic", Meiryo, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
header.top {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  border-bottom: 1px solid var(--line); background: var(--card); position: sticky; top: 0; z-index: 5;
}
header.top .brand { font-weight: 700; color: var(--accent); text-decoration: none; font-size: 18px; }
header.top nav { display: flex; gap: 12px; margin-left: auto; font-size: 14px; flex-wrap: wrap; }
main { max-width: 720px; margin: 0 auto; padding: 16px; }
h1 { font-size: 18px; margin: 6px 0 12px; }
h2 { font-size: 15px; margin: 18px 0 6px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.muted { color: var(--muted); font-size: 12.5px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-block; background: var(--chip); border-radius: 999px; padding: 0 7px; font-size: 11px; margin-right: 3px; line-height: 18px; }
.chip.lv4 { background: var(--accent); color: var(--accent-ink); }
.chip.gold { background: var(--gold); color: #fff; }
.chip.ok { background: var(--ok); color: #fff; }
.chip.warn { background: var(--warn); color: #fff; }
button, .btn {
  font: inherit; border: 0; border-radius: 8px; padding: 7px 14px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); text-decoration: none; display: inline-block;
}
button.ghost, .btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
button.small { padding: 3px 9px; font-size: 12px; }
button.danger { background: transparent; color: var(--warn); border: 1px solid var(--warn); }
form.inline { display: inline; }
input[type=text], input[type=password], input[type=url], input[type=number], input[type=email],
input[type=datetime-local], input[type=search], textarea, select {
  font: inherit; width: 100%; padding: 7px 9px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
input[type=number].count { width: 70px; }
textarea { min-height: 70px; }
label { display: block; margin: 8px 0 3px; font-size: 12.5px; color: var(--muted); }
label.check { display: flex; gap: 6px; align-items: center; color: var(--ink); font-size: 14px; margin: 4px 0; }
.error { background: var(--warn); color: #fff; padding: 8px 12px; border-radius: 8px; margin: 10px 0; }
.notice { border: 2px solid var(--gold); border-radius: 12px; padding: 12px 16px; margin: 10px 0; }
.bar { height: 10px; background: var(--chip); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); }
.skill { display: grid; grid-template-columns: 110px 1fr 40px; gap: 8px; align-items: center; font-size: 14px; margin: 4px 0; }
.item-line { border-top: 1px solid var(--line); padding: 10px 0; }
.item-line:first-child { border-top: 0; }
.thumb { max-width: 160px; max-height: 160px; border-radius: 8px; display: block; margin: 6px 0; }
details summary { cursor: pointer; color: var(--accent); }
code.big { font-size: 18px; background: var(--chip); padding: 2px 8px; border-radius: 6px; word-break: break-all; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
td, th { border-bottom: 1px solid var(--line); padding: 6px 4px; text-align: left; }

/* --- compact item lists: colour = kind ------------------------------------------------- */
.legend { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 6px 0; }
.filter { background: var(--chip); color: var(--ink); border: 1px solid transparent; padding: 3px 10px; border-radius: 999px; font-size: 12px; }
.filter.on { border-color: var(--ink); }
.filter.real, .k-real { color: var(--real); }
.filter.remote, .k-remote { color: var(--remote); }
.filter.custom, .k-custom { color: var(--custom); }
details.cat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; margin: 6px 0; overflow: hidden; }
details.cat > summary { padding: 8px 12px; font-weight: 600; display: flex; gap: 8px; align-items: center; list-style: none; }
details.cat > summary::-webkit-details-marker { display: none; }
details.cat > summary::before { content: "▸"; color: var(--muted); }
details.cat[open] > summary::before { content: "▾"; }
details.cat > summary .grow { flex: 1; }
.it { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 8px; border-top: 1px solid var(--line);
      border-left: 4px solid var(--real); font-size: 13.5px; margin: 0; color: var(--ink); }
.it.remote { border-left-color: var(--remote); }
.it.custom { border-left-color: var(--custom); }
.it .t { flex: 1; min-width: 0; }
.it .lv { font-size: 11px; color: var(--muted); white-space: nowrap; }
.it .lv4 { color: var(--accent); font-weight: 700; }
.it input[type=checkbox] { width: 18px; height: 18px; flex: none; }
.it:has(input[type=checkbox]:checked) { background: var(--chip); }
.it .info { background: none; border: 0; color: var(--muted); padding: 0 4px; font-size: 13px; }
.desc { display: none; padding: 4px 12px 8px 30px; font-size: 12.5px; color: var(--muted); border-left: 4px solid transparent; }
.desc.show { display: block; }
.sumbar { position: sticky; bottom: 0; background: var(--card); border-top: 1px solid var(--line);
          padding: 8px 12px; display: flex; gap: 10px; align-items: center; margin: 12px -16px -16px; z-index: 4; }
.sumbar .nums { flex: 1; font-size: 13px; font-variant-numeric: tabular-nums; }
.sumbar .bad { color: var(--warn); font-weight: 700; }
.sumbar button[disabled] { opacity: .45; cursor: not-allowed; }
button[disabled].grey, .btn.grey { background: var(--line); color: var(--muted); border: 1px solid var(--line); cursor: not-allowed; }
details.reveal > summary { list-style: none; display: inline-block; }
details.reveal > summary::-webkit-details-marker { display: none; }
details.reveal[open] > summary { display: none; }
details.it-detail > summary { list-style: none; cursor: pointer; }
details.it-detail > summary::-webkit-details-marker { display: none; }
.it-body { padding: 6px 12px 10px 14px; font-size: 13px; border-top: 1px dashed var(--line); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.skill-in { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.skill-in label { margin: 0; font-size: 11px; }

[hidden] { display: none !important; }

/* hover shows the description on desktop (title tooltip); the ⓘ button is for touch screens */
@media (hover: hover) { .it .info { display: none; } }
.link-btn { background: none; border: 0; color: var(--muted); padding: 0 4px; font-size: 12.5px; }
footer.langs { max-width: 760px; margin: 24px auto 32px; padding: 0 16px; display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; font-size: 12.5px; color: var(--muted); }
footer.langs a { color: var(--muted); }
footer.langs strong { color: var(--ink); font-weight: 600; }
ol.steps { list-style: none; padding: 0; margin: 6px 0 12px; display: flex; gap: 6px; flex-wrap: wrap; counter-reset: step; }
ol.steps li { counter-increment: step; flex: 1 1 0; min-width: 90px; padding: 8px 10px; border-radius: 8px; background: var(--chip); color: var(--muted); font-size: 13px; }
ol.steps li::before { content: counter(step) ". "; }
ol.steps li.done { color: var(--ok); }
ol.steps li.done::before { content: "✓ "; }
ol.steps li.now { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
details.quiet { margin-top: 24px; font-size: 13px; color: var(--muted); }
details.quiet > summary { cursor: pointer; }
a.set-row { display: block; margin: 8px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; color: inherit; text-decoration: none; }
a.set-row .bar { display: block; margin-top: 6px; }
.qcard-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.qcard-head strong { font-size: 17px; }
.qcard-head .sub { display: block; font-size: 12px; margin-top: 2px; }
.chev { color: var(--muted); font-size: 18px; line-height: 1; margin-left: 6px; }
.section-label { font-size: 12px; color: var(--muted); font-weight: 600; margin: 0 0 2px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0 10px; }
.pill { position: relative; display: inline-flex; align-items: baseline; gap: 5px; padding: 5px 11px; font-size: 13px; line-height: 1.3;
  border: 1px solid var(--line); border-left: 3px solid var(--real); border-radius: 999px; background: var(--card); cursor: pointer; user-select: none; }
.pill.remote { border-left-color: var(--remote); }
.pill.custom { border-left-color: var(--custom); }
.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.pill small { color: var(--muted); font-size: 11px; }
.pill.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pill.on small { color: inherit; opacity: .85; }
.pill:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
a.set-row:hover, a.qcard-head:hover strong { border-color: var(--accent); color: inherit; }
a.qcard-head:hover strong { color: var(--accent); }
a.add-row { display: block; margin-top: 8px; padding: 9px 12px; border: 1px dashed var(--line); border-radius: 8px; text-align: center; color: var(--muted); font-size: 13px; text-decoration: none; }
a.add-row:hover { border-color: var(--accent); color: var(--accent); }
.qcard a { text-decoration: none; }
button.linkish { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; text-decoration: underline; }
details.record { margin: 4px 0 18px; font-size: 12.5px; }
details.record > summary { color: var(--muted); }
details.record[open] { color: var(--muted); }
details.record div { margin-top: 4px; }
.pill.tri { padding-right: 12px; }
.pill.tri input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.pill.tri.done { border-color: var(--ok); }
.pill.tri.done::after { content: "✓"; color: var(--ok); font-weight: 700; margin-left: 2px; }
.pill.tri.want { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pill.tri.want small { color: inherit; opacity: .85; }
.pill.tri.want.done::after { color: inherit; }
.tri-legend { font-size: 12px; margin: 6px 0 2px; }
.tri-legend .pill { padding: 1px 8px; font-size: 11px; border-left-width: 1px; cursor: default; }
.card.list { padding: 0; overflow: hidden; }
.row-item { border-bottom: 1px solid var(--line); }
.row-item:last-child { border-bottom: 0; }
label.row-item, details.row-item > summary { display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin: 0; cursor: pointer; font-size: 14px; color: var(--ink); }
details.row-item > summary { list-style: none; }
details.row-item > summary::-webkit-details-marker { display: none; }
details.row-item > summary::after { content: "›"; color: var(--muted); font-size: 16px; transition: transform .15s; }
details.row-item[open] > summary::after { transform: rotate(90deg); }
.row-item .t { flex: 1; min-width: 0; }
.row-item.is-done .t { color: var(--muted); }
.row-item .mark { width: 16px; text-align: center; color: var(--muted); flex: none; }
.row-body { padding: 0 12px 12px 36px; font-size: 13px; }
h2.group { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 15px; margin: 18px 0 6px; }
h2.group .muted { font-size: 12px; font-weight: 400; }
.k-ok { color: var(--ok); font-weight: 700; }
.k-warn { color: var(--warn); font-weight: 700; }
.row-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 0 12px 10px 36px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.row-actions .muted { flex: 1; min-width: 0; }
.gallery { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.gallery .thumb { width: 84px; height: 84px; object-fit: cover; border-radius: 6px; margin: 0; }
/* self-introduction: one tap tag per item */
.tri-counts { font-size: 12px; color: var(--muted); }
.tri-counts b { color: var(--ink); font-weight: 600; }
.tri-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 11.5px; color: var(--muted); margin: 6px 0 2px; }
.tri-legend .pill { padding: 1px 7px; font-size: 11px; cursor: default; }
.tri-legend .pill::before { display: none; }
.tri-tools { display: flex; gap: 12px; margin: 2px 0 6px; }
.tri-tools button { background: none; border: 0; padding: 0; font: inherit; font-size: 11.5px; color: var(--accent); cursor: pointer; }
.tri-tools button:hover { text-decoration: underline; }
.tri-cat { display: flex; justify-content: space-between; font-size: 11.5px; font-weight: 600; color: var(--muted); margin: 10px 0 0; }
.tri-cat .muted { font-weight: 400; }
.tri-group { gap: 5px; padding: 5px 0 2px; }
.pill.tri { gap: 4px; padding: 3px 9px; font-size: 12px; line-height: 1.35; border: 1px solid var(--line); border-left-width: 1px;
  background: var(--chip); transition: background .12s, border-color .12s, color .12s; }
.pill.tri small { font-size: 10px; }
.pill.tri::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--real); align-self: center; flex: none; }
.pill.tri.remote::before { background: var(--remote); }
.pill.tri.custom::before { background: var(--custom); }
.pill.tri:hover { border-color: var(--accent); }
.pill.tri.want::before { background: var(--accent-ink); opacity: .75; }
.pill.tri.done::after { font-size: 11px; }
/* Chinese pages: Chinese glyph forms first (still 黑体) */
:lang(zh) body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC",
  "Noto Sans CJK SC", "Microsoft YaHei", "Source Han Sans SC", "Segoe UI", Roboto, sans-serif; }
/* language switcher: top right, a small menu */
.lang-menu { position: relative; margin-left: auto; margin-right: 10px; font-size: 12.5px; }
.lang-menu > summary { list-style: none; cursor: pointer; color: var(--muted); padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; }
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-menu > summary::after { content: " ▾"; font-size: 10px; }
.lang-menu > div { position: absolute; right: 0; top: calc(100% + 4px); z-index: 10; min-width: 110px; padding: 4px 0;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.lang-menu > div a { display: block; padding: 6px 12px; color: var(--ink); text-decoration: none; }
.lang-menu > div a:hover { background: var(--chip); }
header.top .lang-menu + nav { margin-left: 0; }

/* member pages (profile, people, survey) */
table.kinks td { padding: 3px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.kinks label.check { margin: 0 8px 0 0; font-size: 13px; }
.gallery .ph { display: flex; flex-direction: column; gap: 4px; }
a.card.person { display: flex; gap: 10px; text-decoration: none; color: inherit; }
img.avatar { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex: none; }
.stat { display: grid; grid-template-columns: minmax(0, 1fr) 40% 42px; gap: 8px; align-items: center; font-size: 13px; margin: 3px 0; }
.statbar { background: var(--chip); border-radius: 4px; height: 10px; overflow: hidden; }
.statbar i { display: block; height: 100%; background: var(--accent); }

/* training items: one row per item, 1–5 as a small segmented control */
.irow { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.irow .ititle { flex: 1 1 200px; min-width: 0; }
.small { font-size: 12px; }
.scores { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex: none; }
.scores label { margin: 0; color: var(--ink); font-size: 13px; }
.scores input { position: absolute; opacity: 0; pointer-events: none; }
.scores span { display: block; min-width: 32px; padding: 5px 0; text-align: center; cursor: pointer; border-left: 1px solid var(--line); }
.scores label:first-child span { border-left: 0; color: var(--muted); }
.scores input:checked + span { background: var(--accent); color: var(--accent-ink); }
.scores input:focus-visible + span { outline: 2px solid var(--gold); }
.sticky-save { position: sticky; bottom: 0; background: var(--bg); padding: 8px 0; margin: 0; }
.chip.score b { margin-left: 2px; }
.chip.s5 { background: var(--accent); color: var(--accent-ink); }
.chip.s4 { background: #e9c3c9; }
.chip.s1, .chip.s2 { background: var(--line); color: var(--muted); }
.bulk { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 12.5px; color: var(--muted); margin: 6px 0; }
.bulk button { min-width: 32px; }
.tagcloud { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 6px 0; }
.tagcloud .chip { margin: 0; text-decoration: none; color: var(--ink); border: 0; cursor: pointer; font: inherit; font-size: 12px; line-height: 20px; }
.tagcloud button.chip[disabled] { opacity: .4; cursor: default; }
a.chip { text-decoration: none; color: var(--ink); }
.tagbox { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 5px 6px; background: var(--card); cursor: text; }
.tagbox input[data-tag-input] { border: 0; flex: 1 1 120px; min-width: 100px; padding: 3px; background: transparent; outline: none; }
.chip.tagchip { display: inline-flex; align-items: center; gap: 2px; margin: 0; font-size: 12.5px; line-height: 22px; padding: 0 4px 0 9px; }
.chip.tagchip button { border: 0; background: transparent; color: var(--muted); padding: 0 4px; font-size: 14px; cursor: pointer; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.narrow { max-width: 420px; margin-left: auto; margin-right: auto; }
a.post-link { display: block; color: var(--ink); text-decoration: none; margin-top: 4px; }
a.post-link:hover { text-decoration: underline; }
img.avatar.sm { width: 28px; height: 28px; border-radius: 50%; vertical-align: middle; margin-right: 4px; }
h1.row img.avatar { width: 48px; height: 48px; border-radius: 50%; }
