/* 学習ノート（ホーム）。英単語ノートと同じ「罫線ノート」の配色・見た目を使う */
:root {
  --paper: #fbfcfe;
  --desk: #eef2f8;
  --ink: #1d2740;
  --muted: #5d6781;
  --rule: #d5deee;
  --margin: #e58b8b;
  --accent: #2c4fa3;
  --accent-ink: #ffffff;
  --redpen: #d23a3a;
  --sheet: #e0473f;
  --chip: #e6ecf8;
  --g1: #2e8a5c;
  --g2: #2c6fb7;
  --g3: #8a4bb5;
  --font-en: "Lexend", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-jp: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1a2030; --desk: #121724; --ink: #e7ebf5; --muted: #a2abc2; --rule: #2c3550; --margin: #a65a5a;
    --accent: #8fb0ff; --accent-ink: #10172a; --redpen: #ff8a80; --sheet: #c8473f; --chip: #252e45;
    --g1: #6fd0a0; --g2: #7fb4ff; --g3: #c99bf0; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1a2030; --desk: #121724; --ink: #e7ebf5; --muted: #a2abc2; --rule: #2c3550; --margin: #a65a5a;
  --accent: #8fb0ff; --accent-ink: #10172a; --redpen: #ff8a80; --sheet: #c8473f; --chip: #252e45;
  --g1: #6fd0a0; --g2: #7fb4ff; --g3: #c99bf0; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* ===== 見た目の切り替え（右上の「見た目」）。ライト／ダークに関係なく、それぞれ決まった配色 ===== */
:root[data-style="chalk"] {
  --paper: #24443a; --desk: #1b342c; --ink: #f1efe6; --muted: #b9d1c5; --rule: #3b5d51; --margin: #f4b2c0;
  --accent: #f6d55c; --accent-ink: #1b342c; --redpen: #f6d55c; --sheet: #c96a5f; --chip: #2f5246;
  --g1: #9fe0b9; --g2: #9cc8ff; --g3: #e3b5ff;
  --font-en: "Kalam", "Comic Sans MS", "Segoe Print", cursive; --font-jp: "Klee One", "Zen Kaku Gothic New", "Hiragino Sans", sans-serif;
  color-scheme: dark;
}
:root[data-style="washi"] {
  --paper: #fbf7ee; --desk: #efe6d2; --ink: #2b2420; --muted: #6e6255; --rule: #e3d8c2; --margin: #c8402a;
  --accent: #b2361f; --accent-ink: #fffaf0; --redpen: #b2361f; --sheet: #b2361f; --chip: #f1e6cf;
  --g1: #3d7a4e; --g2: #2d5f8a; --g3: #7b4a8c;
  --font-en: "EB Garamond", Georgia, serif; --font-jp: "Zen Old Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --radius: 6px; color-scheme: light;
}
:root[data-style="grid"] {
  --paper: #ffffff; --desk: #e9f1ee; --ink: #1c2b2a; --muted: #55706b; --rule: #cfe3dc; --margin: #2a9d8f;
  --accent: #127566; --accent-ink: #ffffff; --redpen: #d1495b; --sheet: #d1495b; --chip: #dcefe9;
  --g1: #2e8a5c; --g2: #2c6fb7; --g3: #8a4bb5;
  --font-en: "Space Grotesk", "Segoe UI", sans-serif; --font-jp: "IBM Plex Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
  --radius: 4px; color-scheme: light;
}
:root[data-style="night"] {
  --paper: #18213f; --desk: #0e1530; --ink: #eef0ff; --muted: #a9b1d6; --rule: #2a3560; --margin: #ffc857;
  --accent: #ffc857; --accent-ink: #1a1a2e; --redpen: #ff9e7a; --sheet: #d0583f; --chip: #243058;
  --g1: #7fe0b0; --g2: #8fc1ff; --g3: #d6a8ff;
  --radius: 12px; color-scheme: dark;
}
:root[data-style="sakura"] {
  --paper: #ffffff; --desk: #fcecf1; --ink: #3a2a33; --muted: #7a6470; --rule: #f5d9e2; --margin: #f08aa8;
  --accent: #c2416b; --accent-ink: #ffffff; --redpen: #c2416b; --sheet: #c2416b; --chip: #fde2ea;
  --g1: #3f8a5e; --g2: #3c76b8; --g3: #9a4fa6;
  --font-en: "Quicksand", "Segoe UI", sans-serif; --font-jp: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", sans-serif;
  --radius: 18px; color-scheme: light;
}
:root[data-style="kraft"] {
  --paper: #fff8c9; --desk: #c9ab7d; --ink: #3a2c1a; --muted: #5e4c33; --rule: #eadf9f; --margin: #e07a3f;
  --accent: #3a2c1a; --accent-ink: #fff8c9; --redpen: #c2410c; --sheet: #c2410c; --chip: #f5ea9a;
  --g1: #3d7a3a; --g2: #2d5f8a; --g3: #8a3f7b;
  --font-en: "Kosugi Maru", "Hiragino Maru Gothic ProN", sans-serif; --font-jp: "Kosugi Maru", "Hiragino Maru Gothic ProN", sans-serif;
  --radius: 2px; color-scheme: light;
}
:root[data-style="ocean"] {
  --paper: #ffffff; --desk: #e9f6fc; --ink: #0c2a43; --muted: #4f6b82; --rule: #d3e7f3; --margin: #3aa6d9;
  --accent: #0a6fb5; --accent-ink: #ffffff; --redpen: #e0553b; --sheet: #e0553b; --chip: #d6ecf8;
  --g1: #13866f; --g2: #0a6fb5; --g3: #7a4fc2;
  --font-en: "Nunito", "Segoe UI", sans-serif; --font-jp: "M PLUS 1p", "Hiragino Sans", sans-serif;
  --radius: 14px; color-scheme: light;
}
:root[data-style="forest"] {
  --paper: #f6f2e7; --desk: #e9e4d3; --ink: #23301f; --muted: #5d6a55; --rule: #e1dbc8; --margin: #7aa35b;
  --accent: #3f6b3a; --accent-ink: #f6f2e7; --redpen: #b5482a; --sheet: #b5482a; --chip: #e5e3cf;
  --g1: #3f6b3a; --g2: #2d5f8a; --g3: #7b4a8c;
  --font-en: "Merriweather Sans", "Segoe UI", sans-serif;
  --radius: 8px; color-scheme: light;
}
:root[data-style="retro"] {
  --paper: #0d1a12; --desk: #07110b; --ink: #c6f7d1; --muted: #82c093; --rule: #1e3a27; --margin: #39ff88;
  --accent: #39ff88; --accent-ink: #07110b; --redpen: #ffd166; --sheet: #b88a1c; --chip: #15301f;
  --g1: #39ff88; --g2: #7fd8ff; --g3: #ff9bd6;
  --font-en: "DotGothic16", "MS Gothic", monospace; --font-jp: "DotGothic16", "MS Gothic", monospace;
  --radius: 0px; color-scheme: dark;
}
/* ドット：Chiko Log と同じ、昔のゲームのウィンドウ風 */
:root[data-style="dot"] {
  --paper: #f6f1e3; --desk: #e6dfcc; --ink: #2e2a33; --muted: #6b6470; --rule: #d9d0b8; --margin: #c4473a;
  --accent: #1f5f8b; --accent-ink: #ffffff; --redpen: #c4473a; --sheet: #c4473a; --chip: #ebe3cc;
  --g1: #2f7a4a; --g2: #1f5f8b; --g3: #7b4a8c;
  --font-en: "DotGothic16", "MS Gothic", monospace; --font-jp: "DotGothic16", "MS Gothic", "Osaka-Mono", monospace;
  --radius: 0px; color-scheme: light;
}
:root[data-style="dot"] body { background-image: radial-gradient(rgba(46,42,51,.09) 1px, transparent 1.4px); background-size: 12px 12px; }
:root[data-style="dot"] *, :root[data-style="dot"] *::before, :root[data-style="dot"] *::after { border-radius: 0 !important; }
:root[data-style="dot"] :is(.side, .words, .test-form, .sheet-paper, .card, .resume-main, .howto, .sent, .deck-done, .fc-face, .modes, .qr-dialog, .pw) {
  border-color: transparent;
  box-shadow: 0 -4px 0 0 var(--ink), 0 4px 0 0 var(--ink), -4px 0 0 0 var(--ink), 4px 0 0 0 var(--ink), 4px 8px 0 0 rgba(46,42,51,.25), 8px 4px 0 0 rgba(46,42,51,.25);
}
:root[data-style="dot"] h1 { font-weight: 400; letter-spacing: .03em; }
:root[data-style="dot"] h1::after { content: "_"; color: #c4473a; animation: dot-blink 1s steps(1) infinite; }
@keyframes dot-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { :root[data-style="dot"] h1::after { animation: none; } }
@media print { :root[data-style="dot"] h1::after { content: none; } :root[data-style="dot"] :is(.side, .words, .test-form, .sheet-paper, .card, .howto) { box-shadow: none; } }
:root[data-style="kraft"] :is(input:not([type="checkbox"]):not([type="radio"]), textarea, select) { background-color: #fffbe3; }
/* 見た目ごとの背景の模様 */
:root[data-style="grid"] body { background-image: linear-gradient(#d6e6e0 1px, transparent 1px), linear-gradient(90deg, #d6e6e0 1px, transparent 1px); background-size: 20px 20px; }
:root[data-style="ocean"] body { background-image: linear-gradient(180deg, #bfe4f7 0, #e9f6fc 360px); background-repeat: no-repeat; }
:root[data-style="night"] body { background-image: radial-gradient(1px 1px at 12% 3%, #fff9, transparent), radial-gradient(1px 1px at 78% 2%, #fff7, transparent), radial-gradient(1.5px 1.5px at 52% 1%, #fff8, transparent), radial-gradient(1px 1px at 92% 6%, #fff6, transparent); background-repeat: no-repeat; }
/* 森：机（背景）が暗い緑なので、紙の外に出ている文字は明るい色にする */
:root[data-style="forest"] body { background: #2f4a3a; }
:root[data-style="forest"] .masthead, :root[data-style="forest"] .foot, :root[data-style="forest"] :is(.resume-head, .games-head, .inbox-status) { --ink: #f6f2e7; --muted: #c9d8bf; --accent: #c9e4a8; --s-ga: #ff94c0; color: var(--ink); }
:root[data-style="kraft"] :is(.resume-head, .games-head) { --s-ga: #7a1640; --muted: #4a3a24; }  /* ふせん：机の色の上でも読める濃さ（4.5以上） */
:root[data-style="forest"] .masthead :is(select, input, .modes, .btn, .contact-link, .who) { --ink: #23301f; --muted: #5d6a55; --accent: #3f6b3a; }
:root[data-style="kraft"] .kicker { color: #8a3d0c; }


/* 教科の色（カードの左の帯と1文字マーク） */
:root { --s-en: #c0582b; --s-ma: #2c6fb7; --s-ja: #2e8a5c; --s-sc: #8a4bb5; --s-so: #a8741a; --s-ga: #c2366e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]):not([data-style]) { --s-en: #ff9f73; --s-ma: #7fb4ff; --s-ja: #6fd0a0; --s-sc: #c99bf0; --s-so: #e8bd62; --s-ga: #ff8ab8; } }
:root[data-theme="dark"]:not([data-style]) { --s-en: #ff9f73; --s-ma: #7fb4ff; --s-ja: #6fd0a0; --s-sc: #c99bf0; --s-so: #e8bd62; --s-ga: #ff8ab8; }
:root[data-style="chalk"] { --s-en: #ffb38a; --s-ma: #9cc8ff; --s-ja: #9fe0b9; --s-sc: #e3b5ff; --s-so: #f6d55c; --s-ga: #ff9cc4; }
:root[data-style="night"] { --s-en: #ffb38a; --s-ma: #8fc1ff; --s-ja: #7fe0b0; --s-sc: #d6a8ff; --s-so: #ffc857; --s-ga: #ff94c0; }
:root[data-style="retro"] { --s-en: #ffb38a; --s-ma: #7fd8ff; --s-ja: #39ff88; --s-sc: #ff9bd6; --s-so: #ffd166; --s-ga: #ff6fa8; }

body { margin: 0; background: var(--desk); color: var(--ink); font-family: var(--font-jp); font-size: 15px; line-height: 1.7; }
[hidden] { display: none !important; }
button, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.page {
  max-width: 1080px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 32px 48px;
  display: grid; gap: 24px;
}

/* 見出し */
.masthead { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; }
.kicker { margin: 0; font-family: var(--font-en); font-size: 12px; letter-spacing: .25em; color: var(--margin); font-weight: 600; }
.brand h1 { margin: 0; font-size: clamp(28px, 5.5vw, 40px); line-height: 1.2; font-weight: 700; letter-spacing: .02em; text-wrap: balance; }
.lede { margin: 6px 0 0; color: var(--muted); }
.style-pick { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 700; }
.style-pick select { border: 1px solid var(--rule); background: var(--paper); color: var(--ink); border-radius: 8px; padding: 5px 8px; font-weight: 500; }

/* 教科でしぼる */
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--rule); background: var(--paper);
  border-radius: 999px; padding: 5px 14px; cursor: pointer; font-weight: 500; color: var(--muted);
}
.chip .n { font-family: var(--font-en); font-size: 12px; font-variant-numeric: tabular-nums; opacity: .8; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* サイトのカード：ノートの1ページ。左に教科の色の帯、紙に罫線 */
.sites { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.card {
  --line: 30px; --faint: color-mix(in srgb, var(--rule) 55%, transparent);
  position: relative; display: grid; gap: 10px; align-content: start;
  padding: 18px 20px 18px 34px; min-height: 260px;
  background-color: var(--paper);
  background-image:
    linear-gradient(to right, transparent 25px, var(--margin) 25px, var(--margin) 26px, transparent 26px),
    repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--line) - 1px), var(--faint) calc(var(--line) - 1px), var(--faint) var(--line));
  background-position: 0 0, 0 14px;
  border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: 0 10px 24px -18px rgba(20, 30, 60, .55);
  color: inherit; text-decoration: none; overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 10px; background: var(--sub); }
a.card:hover { transform: translateY(-3px); box-shadow: 0 16px 30px -18px rgba(20, 30, 60, .6); }
a.card:active { transform: translateY(-1px); }
.card.soon { border-style: dashed; opacity: .75; }
@media (prefers-reduced-motion: reduce) { .card { transition: none; } a.card:hover { transform: none; } }

.card-head { display: flex; align-items: center; gap: 10px; }
.mark {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--sub); color: var(--paper); font-weight: 700; font-size: 19px; line-height: 1;
}
.card-meta { display: grid; line-height: 1.35; }
.subject { font-weight: 700; color: var(--sub); font-size: 14px; }
.grades { color: var(--muted); font-size: 13px; }
.badge { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--muted); border: 1px solid var(--rule); border-radius: 999px; padding: 1px 10px; background: var(--paper); }
.card-title { margin: 4px 0 0; font-size: 23px; line-height: 1.3; font-weight: 700; }
.card-desc { margin: 0; color: var(--ink); }
.features { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.features li { font-size: 13px; background: var(--chip); color: var(--ink); border-radius: 6px; padding: 1px 9px; }
.go {
  justify-self: start; margin-top: 6px; display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; border-radius: 999px; padding: 6px 18px;
}
.go .arrow { font-family: var(--font-en); transition: transform .15s ease; }
a.card:hover .go .arrow { transform: translateX(3px); }
.empty { color: var(--muted); }

:root[data-style="chalk"] .card { box-shadow: none; }

/* 続きから：最後に開いたサイトを大きく、その前のサイトを小さく */
.resume { display: grid; gap: 10px; }
.resume-head { display: flex; align-items: baseline; gap: 12px; }
.resume-head h2 { margin: 0; font-size: 18px; }
.resume-clear { margin-left: auto; border: 0; background: none; padding: 2px 4px; color: var(--muted); font-size: 12px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.resume-list { display: grid; gap: 10px; }
.resume-main, .resume-sub {
  position: relative; display: flex; align-items: center; gap: 14px; overflow: hidden;
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius);
  color: inherit; text-decoration: none; box-shadow: 0 10px 24px -18px rgba(20, 30, 60, .55);
  transition: transform .15s ease, box-shadow .15s ease;
}
.resume-main::before, .resume-sub::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 8px; background: var(--sub); }
.resume-main { padding: 14px 18px 14px 26px; }
.resume-main:hover, .resume-sub:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -18px rgba(20, 30, 60, .6); }
.resume-main:hover .go .arrow { transform: translateX(3px); }
.resume-body { display: grid; min-width: 0; flex: 1; line-height: 1.45; }
.resume-title { font-weight: 700; font-size: 18px; }
.resume-where { color: var(--ink); font-size: 14px; overflow-wrap: anywhere; }
.resume-ago { color: var(--muted); font-size: 12px; }
.resume-view { display: inline-block; margin-right: 8px; padding: 0 8px; border-radius: 6px; background: var(--chip); font-weight: 700; font-size: .92em; }
.resume-main .go { margin: 0; flex: none; }
.resume-more { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.resume-sub { padding: 8px 12px 8px 18px; gap: 10px; }
.resume-sub .mark { width: 30px; height: 30px; font-size: 15px; }
.resume-sub .resume-title { font-size: 14px; }
.resume-sub .resume-where { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) {
  .resume-main { flex-wrap: wrap; padding: 12px 14px 12px 22px; }
  .resume-main .resume-body { flex-basis: calc(100% - 54px); }
  .resume-main .go { margin-left: 54px; }
}
@media (prefers-reduced-motion: reduce) { .resume-main, .resume-sub { transition: none; } .resume-main:hover, .resume-sub:hover { transform: none; } }
:root[data-style="chalk"] :is(.resume-main, .resume-sub) { box-shadow: none; }
@media print { .resume { display: none !important; } }

/* ゲーム枠：教科のサイトとは分けて、点線で区切る */
.games { display: grid; gap: 14px; padding-top: 20px; border-top: 2px dashed var(--rule); }
.games-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.games-head h2 { margin: 0; font-size: 20px; color: var(--s-ga); }
.games-head p { margin: 0; color: var(--muted); font-size: 14px; }
.games .card { min-height: 0; }

/* つかいかた */
.howto { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px 20px; }
.howto h2 { margin: 0 0 6px; font-size: 17px; }
.howto ol { margin: 0; padding-left: 1.4em; display: grid; gap: 4px; }

.foot { color: var(--muted); font-size: 12px; }
.foot p { margin: 0; }

/* 見出し右：QRボタンと見た目 */
.mast-right { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  border: 1px solid var(--rule); background: var(--paper); color: var(--ink); border-radius: 8px;
  padding: 6px 14px; font-weight: 700;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.qr-open::before {
  content: ""; width: 14px; height: 14px; flex: none;
  background:
    linear-gradient(currentColor 0 0) 0 0 / 5px 5px no-repeat, linear-gradient(currentColor 0 0) 100% 0 / 5px 5px no-repeat,
    linear-gradient(currentColor 0 0) 0 100% / 5px 5px no-repeat, linear-gradient(currentColor 0 0) 100% 100% / 3px 3px no-repeat;
}

/* QRのダイアログ */
.qr-dialog { border: 0; padding: 0; border-radius: 14px; background: var(--paper); color: var(--ink); width: min(440px, calc(100vw - 32px)); }
.qr-dialog::backdrop { background: rgba(15, 20, 35, .55); }
.qr-sheet { padding: 22px; display: grid; gap: 12px; justify-items: center; text-align: center; }
.qr-sheet h2 { margin: 0; font-size: 20px; }
.qr-code { background: #fff; padding: 12px; border-radius: 8px; line-height: 0; min-height: 100px; }
.qr-code svg { display: block; width: 220px; height: 220px; max-width: 100%; }
.qr-fail { line-height: 1.6; color: #1d2740; max-width: 20em; margin: 0; }
.qr-howto { margin: 0; font-size: 13px; color: var(--muted); }
.qr-layout { border: 0; margin: 0; padding: 0; display: grid; gap: 4px; justify-items: start; width: 100%; text-align: left; }
.qr-layout legend { font-size: 13px; font-weight: 700; color: var(--muted); padding: 0; margin-bottom: 4px; }
.qr-layout label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.qr-layout input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.qr-sheet .actions { display: flex; gap: 8px; justify-content: center; }

/* 印刷：QRだけを白黒で出す */
.print-sheet { display: none; }
@media print {
  /* 余白0の @page はホーム（index.html）の中だけに置く。ここに置くと規約ページなどの印刷まで余白0になる */
  html, body.printing { margin: 0 !important; padding: 0 !important; }
  body.printing { background: #fff !important; color: #000 !important; }
  body.printing .page, body.printing .qr-dialog { display: none !important; }
  body.printing .print-sheet { display: block !important; box-sizing: border-box; padding: 12mm; font-family: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", sans-serif; color: #000; }
  .print-sheet p { margin: 0; }
  .pq-code svg { display: block; width: 100%; height: 100%; }

  .print-sheet.big .pq-big { display: grid; justify-items: center; text-align: center; gap: 14pt; padding-top: 30mm; }
  .pq-big .pq-name { font-size: 30pt; font-weight: 700; }
  .pq-big .pq-code { width: 120mm; height: 120mm; }

  body.printing .print-sheet.cards { display: grid !important; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 67mm; }
  .pq-card {
    display: grid; justify-items: center; align-content: center; text-align: center; gap: 2mm;
    border: 1px dashed #999; margin: -0.5px; break-inside: avoid;
  }
  .pq-card .pq-name { font-size: 11pt; font-weight: 700; }
  .pq-card .pq-code { width: 40mm; height: 40mm; }
}

/* QRのパスワード */
.qr-lock, .qr-body { display: grid; gap: 12px; justify-items: center; width: 100%; }
.qr-lock-note { margin: 0; color: var(--muted); font-size: 14px; }
.qr-pass { display: grid; gap: 4px; width: 100%; text-align: left; font-size: 13px; font-weight: 700; color: var(--muted); }
.qr-pass input { border: 1px solid var(--rule); background: var(--desk); color: var(--ink); border-radius: 8px; padding: 9px 12px; font-size: 16px; font-weight: 400; }
.qr-remember { display: inline-flex; align-items: center; gap: 8px; justify-self: start; cursor: pointer; font-size: 14px; }
.qr-remember input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.qr-error { margin: 0; color: var(--redpen); font-weight: 700; font-size: 14px; }

/* ===== 要望・不具合のページ（contact.html）と先生用一覧（inbox.html） ===== */
.home-link { display: inline-block; margin-bottom: 6px; color: var(--accent); font-weight: 700; text-decoration: none; font-size: 14px; }
.home-link:hover { text-decoration: underline; }
.foot a { color: var(--muted); }

.contact-layout { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 860px) { .contact-layout { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); } }
.contact-form {
  display: grid; gap: 18px; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 22px; box-shadow: 0 10px 24px -18px rgba(20, 30, 60, .55);
}
.contact-side { display: grid; gap: 16px; }
.contact-side p { margin: 0; }
.field { display: grid; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field .label, .field legend { font-weight: 700; padding: 0; }
.field em { font-style: normal; font-size: 12px; color: var(--paper); background: var(--redpen); border-radius: 4px; padding: 0 6px; margin-left: 4px; vertical-align: 1px; }
.field .opt { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.field select, .field input[type="text"], .field textarea {
  width: 100%; border: 1px solid var(--rule); background: var(--desk); color: var(--ink); border-radius: 8px;
  padding: 10px 12px; font: inherit; font-size: 16px;
}
.field textarea { resize: vertical; min-height: 160px; line-height: 1.6; }
.field select:focus, .field input:focus, .field textarea:focus { outline: 3px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.count { justify-self: end; font-size: 12px; color: var(--muted); font-family: var(--font-en); font-variant-numeric: tabular-nums; }
.kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 6px; }
.kind { position: relative; cursor: pointer; }
.kind input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.kind span {
  display: grid; gap: 2px; text-align: center; padding: 12px 8px; border: 2px solid var(--rule); border-radius: var(--radius);
  background: var(--desk); transition: border-color .12s ease, background .12s ease;
}
.kind b { font-size: 17px; }
.kind small { font-size: 12px; color: var(--muted); }
@media (max-width: 480px) { .kind span { padding: 10px 4px; } .kind small { font-size: 11px; letter-spacing: 0; } }
.kind:hover span { border-color: var(--accent); }
.kind input:checked + span { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.kind input:checked + span small { color: inherit; opacity: .85; }
.kind input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.form-error { margin: 0; color: var(--redpen); font-weight: 700; }
.contact-form .actions, .sent .actions, .inbox-lock .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.big { padding: 10px 40px; font-size: 17px; }
a.btn { text-decoration: none; }
.sent { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: 28px 22px; display: grid; gap: 8px; justify-items: start; }
.sent p { margin: 0; }
.sent-title { font-size: 22px; font-weight: 700; }

/* 先生用一覧 */
.inbox-lock { display: grid; gap: 12px; max-width: 440px; }
.inbox { display: grid; gap: 14px; }
.inbox-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.inbox-status { margin: 0; color: var(--muted); font-size: 13px; }
.inbox-list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); align-items: start; }
.inq {
  --k: var(--accent);
  display: grid; gap: 8px; background: var(--paper); border: 1px solid var(--rule); border-left: 8px solid var(--k);
  border-radius: var(--radius); padding: 14px 16px;
}
.inq[data-kind="不具合"] { --k: var(--redpen); }
.inq[data-kind="その他"] { --k: var(--muted); }
.inq.is-done { opacity: .6; }
.inq-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inq-kind { background: var(--k); color: var(--paper); font-weight: 700; font-size: 13px; border-radius: 6px; padding: 0 8px; }
.inq-site { font-weight: 700; }
.inq-time { margin-left: auto; color: var(--muted); font-size: 13px; font-family: var(--font-en); font-variant-numeric: tabular-nums; }
.inq-msg { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.inq-meta { margin: 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.inq-acts { display: flex; gap: 8px; justify-content: flex-end; }
.btn.danger { color: var(--redpen); }
.btn.danger:hover { border-color: var(--redpen); }
.contact-link-inline { color: var(--accent); font-weight: 700; }
.form-note { margin: 0; padding: 8px 12px; border-radius: 8px; background: var(--chip); font-size: 14px; font-weight: 700; }

/* 印刷：ブラウザが自動で付けるURL・日付・タイトル・ページ番号を最初から出さない。
   上下の余白に空の欄（ページ余白ボックス）を置くと、Chrome / Edge はそこに何も入れなくなる。余白の広さは変わらない */
@page {
  @top-left { content: ""; } @top-center { content: ""; } @top-right { content: ""; }
  @bottom-left { content: ""; } @bottom-center { content: ""; } @bottom-right { content: ""; }
}

/* ゲームなど、そのサイト自身のアイコンを出すマーク（丸ではなく角丸の画像） */
.mark.mark-icon { background: none; border-radius: 22%; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.mark.mark-icon img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ===== このサイトについて・利用規約・著作権・プライバシー（about / terms / copyright / privacy.html） ===== */
.policy-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.policy-nav a {
  border: 1px solid var(--rule); background: var(--paper); border-radius: 999px; padding: 5px 14px;
  color: var(--muted); font-weight: 500; text-decoration: none; font-size: 14px;
}
.policy-nav a:hover { border-color: var(--accent); color: var(--ink); }
.policy-nav a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.policy-doc {
  display: grid; gap: 22px; max-width: 820px; background: var(--paper); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: clamp(18px, 4vw, 34px); line-height: 1.8;
  box-shadow: 0 10px 24px -18px rgba(20, 30, 60, .55); min-width: 0;
}
.policy-doc section { display: grid; gap: 8px; min-width: 0; }
.policy-doc h2 { margin: 0; font-size: 19px; line-height: 1.4; padding-bottom: 4px; border-bottom: 2px solid var(--rule); }
.policy-doc p, .policy-doc ul, .policy-doc ol { margin: 0; }
.policy-doc ul, .policy-doc ol { padding-left: 1.4em; display: grid; gap: 4px; }
.policy-doc a { color: var(--accent); font-weight: 700; }
.policy-doc code { font-family: var(--font-en); font-size: .9em; background: var(--chip); border-radius: 4px; padding: 0 4px; }
.policy-doc .note { color: var(--muted); font-size: 14px; }
.policy-summary { background: var(--chip); border-radius: var(--radius); padding: 14px 18px; }
.policy-summary h2 { border: 0; padding: 0; font-size: 16px; }
.policy-summary ul { font-weight: 700; }
.policy-date { color: var(--muted); font-size: 13px; text-align: right; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.policy-doc table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.6; min-width: 560px; }
.policy-doc th, .policy-doc td { border: 1px solid var(--rule); padding: 6px 10px; text-align: left; vertical-align: top; }
.policy-doc th { background: var(--desk); white-space: nowrap; }
.policy-links { display: flex; flex-wrap: wrap; gap: 4px 14px; }
@media print { .policy-nav, .home-link { display: none; } .policy-doc { box-shadow: none; border: 0; padding: 0; } }
