:root {
  --bg: #eef1f5;
  --panel: #ffffff;
  --ink: #1d2733;
  --muted: #64707d;
  --line: #c9d1db;
  --bar: #2c3e57;
  --bar-ink: #ffffff;
  --accent: #1f6fd1;
  --accent-weak: #e3eefc;
  --warn: #c62828;
  --ok: #2e7d32;
  --sel: #ffb300;
  --grid: #e7a3a3;
  --grid-strong: #c94a4a;
  --mono: "Noto Sans Mono CJK JP", "Noto Sans Mono CJK", "MS Gothic", "Osaka-Mono", monospace;
}
/* ---------- exam themes ---------- */
body[data-exam="sa"] { --theme: #5B3F9E; --theme-d: #3E2A72; --theme-t: #EFEAF8; }
body[data-exam="db"] { --theme: #2E7D5B; --theme-d: #1F5A41; --theme-t: #E5F2EC; }
body[data-exam="ap"] { --theme: #B8352D; --theme-d: #85241E; --theme-t: #F9E7E5; }
body[data-exam="home"] { --theme: #22304A; --theme-d: #22304A; --theme-t: #E9EDF1; }
body[data-exam] { --bar: var(--theme-d); --accent: var(--theme); --accent-weak: var(--theme-t); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink);
  font-family: "Noto Sans CJK JP", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif; font-size: 14px; }
body.invert { filter: invert(1) hue-rotate(180deg); }
body.invert img { filter: none; }
button { font: inherit; cursor: pointer; border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 4px; padding: 5px 12px; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.danger { background: var(--warn); color: #fff; border-color: var(--warn); }
button:disabled { opacity: .45; cursor: default; }
h1, h2, h3 { margin: 0; }

/* ---------- paper screens (home / review) ---------- */
.paper { --paper: #F5F7F9; --ink: #22304A; --rule: #DCE1E7; --usui: #68707C; --shu: #C8442B; --pm1: var(--theme); --pm1-t: var(--theme-t); --pm2: var(--theme); --pm2-t: var(--theme-t);
  background: var(--paper); color: var(--ink); min-height: 100vh; }
.paper .mincho, .paper h1, .paper h2 { font-weight: 700; letter-spacing: .01em; }
.paper button { border-color: var(--rule); color: var(--ink); background: #fff; border-radius: 3px; }
.paper button:hover { border-color: var(--ink); }
.paper button.primary { background: var(--theme); border-color: var(--theme); color: #fff; }
.paper button:focus-visible, .paper select:focus-visible, .paper input:focus-visible { outline: 2px solid var(--shu); outline-offset: 2px; }
.paper select { font: inherit; border: 1px solid var(--rule); border-radius: 3px; padding: 4px 6px; background: #fff; color: var(--ink); }

.home { max-width: 1320px; margin: 0 auto; padding: 44px 32px 80px; }
.masthead { padding-bottom: 20px; margin-bottom: 8px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.masthead h1 { margin-right: auto; color: var(--theme-d); }
.exam-switch { display: flex; background: #E9EDF1; border-radius: 6px; padding: 3px; }
.paper .exam-switch button { border: none; background: transparent; color: var(--usui); padding: 6px 14px; border-radius: 4px; font-size: 13px; }
.paper .exam-switch button:hover { color: var(--ink); }
.paper .exam-switch button.on { background: var(--theme); color: #fff; font-weight: 700; box-shadow: 0 1px 2px rgba(34,48,74,.15); }
.coming { background: #fff; box-shadow: 0 0 0 1px var(--rule); border-radius: 6px; padding: 48px; text-align: center; color: var(--usui); }
.masthead h1 { font-size: 28px; line-height: 1.3; }
.masthead p { margin: 6px 0 0; color: var(--usui); font-size: 13px; }
.resume { display: flex; gap: 12px; align-items: center; padding: 12px 16px; margin-bottom: 16px; background: #fff; border-left: 4px solid var(--shu); flex-wrap: wrap; }
.resume span { margin-right: auto; }

.matrix { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 1px var(--rule); }
.matrix th { text-align: left; font-weight: 700; font-size: 14px; padding: 12px 20px; }
.matrix th.pm1, .matrix th.pm { color: var(--pm1); background: var(--pm1-t); }
.matrix th.pm2 { color: var(--pm2); background: var(--pm2-t); }
.matrix th:first-child { background: #EEF1F4; color: var(--usui); font-weight: 500; font-size: 12px; }
.matrix td { vertical-align: top; padding: 16px 20px; border-top: 1px solid var(--rule); }
.matrix td.year { width: 150px; background: #FBFCFD; white-space: nowrap; padding-top: 22px; }
.matrix td.year .mincho { font-size: 17px; }
.matrix td.year span.ki { color: var(--usui); font-size: 12px; margin-left: 6px; }
.matrix .go { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.matrix .cond { font-size: 12.5px; color: var(--usui); min-width: 9.5em; }
.matrix td.pm button.primary, .matrix td.pm1 button.primary { background: var(--pm1); border-color: var(--pm1); }
.matrix td.pm2 button.primary { background: var(--pm2); border-color: var(--pm2); }
.matrix details { margin-top: 8px; font-size: 12.5px; }
.matrix details summary { cursor: pointer; color: var(--usui); width: max-content; }
.matrix ol { list-style: none; margin: 6px 0 0; padding: 0; line-height: 1.7; }
.matrix ol li { display: grid; grid-template-columns: 2.6em 1fr; }
.matrix ol li b { font-weight: 500; color: var(--usui); }
.matrix .done { color: var(--shu); font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }
.matrix .done::before { content: "済"; display: inline-grid; place-items: center; width: 20px; height: 20px; border: 1.5px solid var(--shu);
  border-radius: 50%; font-size: 11px; font-weight: 700; transform: rotate(-8deg); }

.histlist { margin-top: 40px; }
.histlist h2 { font-size: 16px; margin-bottom: 8px; }
.histlist table { border-collapse: collapse; width: 100%; font-size: 13px; background: #fff; box-shadow: 0 0 0 1px var(--rule); border-radius: 6px; }
.histlist th { text-align: left; font-weight: 500; color: var(--usui); font-size: 12px; border-bottom: 1px solid var(--rule); padding: 8px 12px; }
.histlist td { border-bottom: 1px solid var(--rule); padding: 8px 12px; }
.histlist td.score { color: var(--shu); font-variant-numeric: tabular-nums; }
.credit { margin-top: 32px; color: var(--usui); font-size: 12px; line-height: 1.8; }
.credit a { color: var(--ink); }

@media (max-width: 760px) {
  .home { padding: 28px 16px 60px; }
  .matrix thead { display: none; }
  .matrix tr, .matrix td { display: block; }
  .matrix td { border-top: none; padding: 8px 16px; }
  .matrix td.year { width: auto; padding-top: 12px; }
  .matrix tr { border-top: 1px solid var(--rule); padding: 8px 0; }
  .matrix td[data-part]::before { content: attr(data-part); display: block; font-weight: 700; font-size: 13px; margin: 2px 0 6px; }
  .matrix td.pm[data-part]::before, .matrix td.pm1[data-part]::before { color: var(--pm1); } .matrix td.pm2[data-part]::before { color: var(--pm2); }
}

/* ---------- exam layout ---------- */
.exam-root { display: flex; flex-direction: column; height: 100vh; }
.topbar { background: var(--bar); color: var(--bar-ink); display: flex; align-items: center; gap: 8px; padding: 6px 12px; flex: none; }
.topbar .title { font-weight: 600; margin-right: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .timer { font-variant-numeric: tabular-nums; background: rgba(255,255,255,.12); padding: 4px 10px; border-radius: 4px; }
.topbar .timer.low { background: var(--warn); }
.topbar button { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.topbar button:hover { background: rgba(255,255,255,.12); }
.topbar button.end { background: #fff; color: var(--bar); }
.qtabs { display: flex; gap: 4px; padding: 6px 12px 0; background: #dde3ea; flex: none; }
.qtabs button { border-bottom: none; border-radius: 6px 6px 0 0; background: #c9d2dc; }
.qtabs button.cur { background: var(--panel); font-weight: 600; }
.qtabs button.unsel { opacity: .55; }
.qtabs .flag { color: var(--sel); }
.split { flex: 1; display: flex; min-height: 0; background: var(--panel); }
.pane { min-width: 220px; display: flex; flex-direction: column; min-height: 0; }
.pane.left { flex: none; width: 56%; }
.pane.right { flex: 1; }
.divider { width: 7px; cursor: col-resize; background: #d3dae2; flex: none; }
.divider:hover, .divider.drag { background: var(--accent); }
.toolbar { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--line); flex: none; flex-wrap: wrap; background: #f7f9fb; }
.toolbar label { color: var(--muted); font-size: 12px; }
.toolbar .sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.mk { width: 26px; height: 26px; padding: 0; border-radius: 50%; }
.mk.on { outline: 2px solid var(--ink); outline-offset: 1px; }
.mk.red { background: #ff5a5a; } .mk.blue { background: #5aa0ff; } .mk.yellow { background: #ffe14d; }
.mk.off { background: #fff; font-size: 12px; } .mk.eraser { background: #fff; font-size: 12px; }
.scroll { overflow: auto; flex: 1; min-height: 0; }
.pages { padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.page { position: relative; box-shadow: 0 1px 4px rgba(0,0,0,.18); background: #fff; }
.page img { display: block; width: 100%; user-select: none; -webkit-user-drag: none; }
.page canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.page canvas.active { cursor: crosshair; }
.page canvas:not(.active) { pointer-events: none; }
.bottombar { display: flex; gap: 6px; padding: 6px 12px; border-top: 1px solid var(--line); background: #f7f9fb; flex: none; align-items: center; }
.bottombar .spacer { flex: 1; }
.bottombar button.flagged { background: #fff4d6; border-color: var(--sel); }

/* ---------- answers ---------- */
.answers { padding: 14px 18px 60px; }
.answers .qhead { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.answers .qnote { color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.group { margin-bottom: 18px; }
.group > .ghead { font-weight: 600; background: #eef2f7; padding: 4px 8px; border-left: 4px solid var(--accent); margin-bottom: 8px; }
.field { margin: 0 0 12px 6px; }
.field .flabel { font-size: 13px; margin-bottom: 4px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.field .flabel .kind { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; }
.field .prompt { color: var(--muted); font-size: 12px; }
.field input[type=text] { width: 100%; max-width: 420px; font: inherit; padding: 5px 7px; border: 1px solid #9aa6b3; border-radius: 3px; }
.field textarea { width: 100%; font: inherit; padding: 6px 8px; border: 1px solid #9aa6b3; border-radius: 3px; resize: vertical; line-height: 1.6; }
.field .counter { font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.field .counter.over { color: var(--warn); font-weight: 600; }
.choices { display: flex; flex-wrap: wrap; gap: 6px; }
.choices.long { flex-direction: column; align-items: stretch; }
.choice { border: 1px solid #9aa6b3; border-radius: 4px; padding: 5px 10px; background: #fff; text-align: left; }
.choice.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.choice .k { font-weight: 600; margin-right: 6px; }

/* masu (small grid for PM1 text answers) */
.masu-wrap { position: relative; }

/* ---------- genkou (PM2) ---------- */
.genkou-field { margin-bottom: 26px; }
.genkou-field .ghead { font-weight: 600; background: #eef2f7; padding: 4px 8px; border-left: 4px solid var(--accent); margin-bottom: 6px; }
.genkou-field .gprompt { font-size: 12.5px; color: #3b4652; white-space: pre-wrap; margin: 0 0 8px; line-height: 1.6; }
.genkou-stat { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin: 4px 0; font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.genkou-stat b { color: var(--ink); }
.genkou-stat .bad { color: var(--warn); font-weight: 600; }
.genkou-stat .good { color: var(--ok); font-weight: 600; }
.genkou-outer { overflow-x: auto; padding-bottom: 4px; }
.genkou { position: relative; display: inline-block; --cell: 22px; border: 2px solid var(--grid-strong); background: #fffdf8; }
.genkou .gridbg { position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: var(--cell) var(--cell); }
.genkou .rowmarks { position: absolute; left: 100%; top: 0; width: 64px; pointer-events: none; }
.genkou .rowmarks div { position: absolute; left: 4px; font-size: 10px; color: var(--grid-strong); white-space: nowrap; transform: translateY(-50%); }
.genkou .limitline { position: absolute; left: -2px; right: -2px; height: 0; border-top: 2px solid var(--grid-strong); pointer-events: none; }
.genkou .limitline.min { border-top-style: dashed; }
.genkou textarea { position: relative; display: block; margin: 0; padding: 0; border: 0; outline: none; background: transparent; resize: none; overflow: hidden;
  font-family: var(--mono); font-size: calc(var(--cell) * .82); line-height: var(--cell); letter-spacing: 0;
  white-space: break-spaces; word-break: break-all; overflow-wrap: anywhere; line-break: anywhere;
  color: transparent; caret-color: #c00; }
.genkou textarea::selection { background: rgba(31,111,209,.25); color: transparent; }
.genkou .glyphs { position: absolute; inset: 0; pointer-events: none; font-family: var(--mono); color: #111; }
.genkou .glyphs span { position: absolute; display: flex; align-items: center; justify-content: center; height: var(--cell); font-size: calc(var(--cell) * .74); line-height: 1; }
.genkou .overrow { position: absolute; left: 0; right: 0; background: rgba(198,40,40,.08); pointer-events: none; }
.genkou-mirror { position: absolute; visibility: hidden; left: -9999px; top: 0; }

/* ---------- overlays ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15,25,40,.45); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { background: #fff; border-radius: 8px; padding: 20px 22px; width: min(620px, 92vw); max-height: 86vh; overflow: auto; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.modal h2 { font-size: 17px; margin-bottom: 10px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.qselect { display: flex; flex-direction: column; gap: 6px; }
.qselect label { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; cursor: pointer; }
.qselect label.on { border-color: var(--accent); background: var(--accent-weak); }
.qselect .count { margin: 8px 0; font-weight: 600; }
.float { position: fixed; z-index: 40; background: #fff; border: 1px solid #8c99a8; border-radius: 6px; box-shadow: 0 6px 24px rgba(0,0,0,.25); display: flex; flex-direction: column; }
.float .fhead { background: var(--bar); color: #fff; padding: 4px 8px; cursor: move; display: flex; justify-content: space-between; align-items: center; border-radius: 5px 5px 0 0; user-select: none; }
.float .fhead button { background: transparent; color: #fff; border: none; padding: 0 4px; }
.float textarea { flex: 1; border: 0; padding: 8px; font: inherit; resize: none; outline: none; }
.memo { width: 340px; height: 260px; resize: both; overflow: hidden; }
.calc { width: 230px; }
.calc .disp { font: 20px/1.2 var(--mono); text-align: right; padding: 8px; border-bottom: 1px solid var(--line); overflow: hidden; }
.calc .keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 6px; }
.calc .keys button { padding: 8px 0; }
.status-panel { position: absolute; bottom: 48px; left: 12px; z-index: 30; background: #fff; border: 1px solid #8c99a8; border-radius: 6px; padding: 10px 12px; box-shadow: 0 6px 24px rgba(0,0,0,.2); max-height: 60vh; overflow: auto; min-width: 280px; }
.status-panel table { border-collapse: collapse; font-size: 12px; }
.status-panel td { padding: 2px 6px; border-bottom: 1px solid #eef0f3; }

/* ---------- review ---------- */
.review { max-width: 1320px; margin: 0 auto; padding: 40px 32px 80px; }
.review .rhead { display: flex; gap: 10px; align-items: center; padding-bottom: 6px; flex-wrap: wrap; }
.review h1 { font-size: 22px; margin-right: auto; }
.review .summary { margin: 10px 0 8px; color: var(--usui); font-size: 13px; }
.review .summary b { color: var(--shu); font-weight: 600; }
.review section { padding: 20px 24px; margin-top: 16px; background: #fff; border-radius: 6px; box-shadow: 0 0 0 1px var(--rule); }
.review section h2 { font-size: 17px; margin-bottom: 4px; }
.review .src { color: var(--usui); font-size: 12px; margin-bottom: 10px; }
.review details { margin: 10px 0; }
.review details summary { cursor: pointer; font-size: 13px; }
.review .prose { white-space: pre-wrap; line-height: 1.8; font-size: 13.5px; max-width: 46em; margin-top: 6px; }
.review .howto { font-size: 12.5px; color: var(--usui); margin: 10px 0 0; max-width: 60em; line-height: 1.7; }
.cmp { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 10px; }
.cmp th { text-align: left; font-weight: 500; color: var(--usui); font-size: 12px; background: #F3F5F8; padding: 7px 10px; }
.cmp td { border-bottom: 1px solid var(--rule); padding: 10px; vertical-align: top; line-height: 1.6; }
.cmp td:first-child { white-space: nowrap; }
.cmp td.mine { white-space: pre-wrap; }
.cmp td.mine.empty { color: var(--usui); }
.cmp .note { color: var(--usui); font-size: 12px; }
.judge { display: flex; gap: 2px; }
.judge button { width: 34px; height: 34px; padding: 0; border: none; background: transparent; font-size: 18px; color: #B9BEC6;
  border-radius: 50%; }
.judge button:hover { color: var(--shu); background: transparent; }
.judge button.on { color: var(--shu); font-size: 26px; font-weight: 700; transform: rotate(-6deg); }
.essay { white-space: pre-wrap; font-size: 14px; line-height: 1.9; max-width: 46em; border-left: 3px solid var(--rule); padding: 2px 0 2px 14px; }
.review h3 { font-size: 15px; margin: 18px 0 4px; font-weight: 600; }
.review .ok { color: var(--usui); font-weight: normal; font-size: 12px; }
.review .ng { color: var(--shu); font-weight: normal; font-size: 12px; }
.checklist label { display: block; margin: 6px 0; font-size: 13.5px; }
.checklist input { accent-color: var(--shu); }
.ai-box textarea { width: 100%; min-height: 160px; font: 12px/1.6 var(--mono); border: 1px solid var(--rule); }

/* ---------- site chrome ---------- */
.paper .inner { max-width: 1320px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
.site-header { background: #fff; border-bottom: 3px solid var(--theme); }
.site-header .inner { display: flex; align-items: center; gap: 24px; height: 52px; }
.brand { font-weight: 700; font-size: 17px; color: var(--ink); text-decoration: none; }
.gnav { display: flex; gap: 4px; height: 100%; }
.gnav a { display: flex; align-items: center; padding: 0 14px; color: var(--usui); text-decoration: none; font-size: 14px; border-bottom: 3px solid transparent; margin-bottom: -3px; }
.gnav a:hover { color: var(--ink); }
.gnav a.on { color: var(--theme); font-weight: 700; border-bottom-color: var(--theme); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 0 0; margin: 0; font-size: 12.5px; color: var(--usui); }
.breadcrumb li + li::before { content: "›"; margin-right: 6px; color: #A3AAB4; }
.breadcrumb a { color: var(--theme); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
main.inner { padding-top: 4px; padding-bottom: 64px; min-height: calc(100vh - 160px); }
.page-title { font-size: 26px; margin: 18px 0 20px; color: var(--theme-d); display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.page-title small { font-size: 13px; font-weight: 400; color: var(--usui); }
.site-footer { background: #1E2228; color: #A9B0BA; font-size: 12px; line-height: 1.8; }
.site-footer .inner { padding-top: 28px; padding-bottom: 32px; display: flex; gap: 32px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.site-footer .credit-text { max-width: 46em; }
.site-footer a { color: #E6E9ED; }
.fnav ul { list-style: none; margin: 0; padding: 0; text-align: right; font-size: 13px; line-height: 2; }
.fnav a { text-decoration: none; }
.fnav a:hover { text-decoration: underline; }
.fnav a[aria-current="page"] { color: #fff; font-weight: 700; }

.exam-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.exam-card { display: flex; flex-direction: column; min-height: 150px; text-decoration: none; color: var(--ink); background: #fff; border-radius: 8px; padding: 20px 22px; box-shadow: 0 0 0 1px var(--rule); border-top: 6px solid var(--c); transition: box-shadow .15s; }
.exam-card:hover { box-shadow: 0 0 0 2px var(--c); }
.exam-card h2 { font-size: 18px; color: var(--c); margin-bottom: 8px; }
.exam-card p { margin: 4px 0; font-size: 13px; }
.exam-card .meta { color: var(--usui); }
.exam-card .cnt { color: var(--c); font-weight: 700; }
.exam-card .parts { margin-top: auto; padding-top: 12px; align-self: flex-end; font-size: 11.5px; color: var(--usui); }
.card-sa { --c: #5B3F9E; } .card-db { --c: #2E7D5B; } .card-ap { --c: #B8352D; }
.tag { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 3px; color: #fff; }
.tag-sa { background: #5B3F9E; } .tag-db { background: #2E7D5B; } .tag-ap { background: #B8352D; }
.histlist td.ops { white-space: nowrap; text-align: right; }
.histlist td.ops a { color: var(--theme); margin-right: 12px; }
.paper button.link { border: none; background: none; color: var(--usui); padding: 0; text-decoration: underline; }
.review { max-width: none; padding: 0; }
.review .rhead { padding-top: 18px; }
.matrix ol { margin-bottom: 12px; }
@media (max-width: 760px) {
  .paper .inner { padding-left: 16px; padding-right: 16px; }
  .site-header .inner { height: auto; flex-wrap: wrap; padding-top: 10px; gap: 6px; }
  .gnav { width: 100%; overflow-x: auto; }
  .gnav a { padding: 8px 10px; }
}

/* masu (PM1 limited text) */
.masu { position: relative; margin: 2px 0 2px; }
.masu-grid { display: grid; border-top: 1px solid #9AA6B3; border-left: 1px solid #9AA6B3; width: max-content; background: #fff; }
.masu-grid i { display: block; width: var(--cell); height: var(--cell); border-right: 1px solid #9AA6B3; border-bottom: 1px solid #9AA6B3; }
.masu .glyphs { position: absolute; inset: 0; pointer-events: none; font-family: var(--mono); color: #111; }
.masu .glyphs.ph { color: #A9B1BB; }
.masu .glyphs span { position: absolute; height: var(--cell); display: flex; align-items: center; justify-content: center; font-size: calc(var(--cell) * .66); }
.masu textarea { position: absolute; left: 0; top: 0; margin: 0; padding: 0; border: 0; outline: none; background: transparent; resize: none; overflow: hidden;
  font-family: var(--mono); letter-spacing: 0; white-space: pre-wrap; word-break: break-all; line-break: anywhere; color: transparent; caret-color: var(--accent); }
.masu textarea::selection { background: rgba(31,111,209,.25); color: transparent; }
.masu:focus-within .masu-grid, .masu:focus-within .masu-grid i { border-color: var(--accent); }

/* contact */
.paper .contact-btn { margin-left: auto; border: 1px solid var(--rule); background: #fff; color: var(--ink); font-size: 13px; padding: 5px 12px; }
.paper .contact-btn:hover { border-color: var(--theme); color: var(--theme); }
.contact-form { display: flex; flex-direction: column; gap: 6px; }
.contact-form label { font-weight: 700; font-size: 13px; margin-top: 6px; }
.contact-form select, .contact-form textarea { font: inherit; border: 1px solid #9AA6B3; border-radius: 4px; padding: 6px 8px; }
.contact-form textarea { resize: vertical; line-height: 1.6; }
.contact-form .c-ctx { color: var(--muted); font-size: 12px; margin: 4px 0 0; }
.contact-form .c-msg { color: var(--warn); font-size: 13px; margin: 4px 0 0; min-height: 1em; }
