/* キズ図鑑の見た目。CRSの新しい見た目(明=白地に青・暗=黒地に黄)に合わせ、端末の明暗に従う。スマホ優先(幅360px〜)。 */
:root {
  color-scheme: light dark;
  --bg: #f3f5f9; --card: #ffffff; --line: #dfe5ee; --text: #111827; --sub: #5f6b7e; --accent: #2563eb; --err: #dc2626; --ok: #15803d;
  --surface: #ffffff; --surface2: #eef2f8; --accent-ink: #ffffff; --accent-soft: #e0eaff; --err-soft: #fee2e2; --ok-wash: #dcfce7;
  --veil: rgba(255, 255, 255, .55); --img-bg: #e5e9f0; --sel: #2563eb; --other: #8b93a1;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0c0f; --card: #16181d; --line: #2b2f37; --text: #f3f4f6; --sub: #8b93a1; --accent: #ffd51f; --err: #f87171; --ok: #4ade80;
    --surface: #16181d; --surface2: #1f2229; --accent-ink: #141414; --accent-soft: #2c2710; --err-soft: #3a1616; --ok-wash: #10301c;
    --veil: rgba(11, 12, 15, .6); --img-bg: #1f2229; --sel: #74b9ff; --other: #8b93a1;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: system-ui, "Noto Sans JP", sans-serif; font-size: 16px; line-height: 1.5; }
main { max-width: 760px; margin: 0 auto; padding: 16px; }
header.bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px; background: var(--surface); color: var(--text); border-bottom: 1px solid var(--line); }
header.bar a { color: var(--accent); text-decoration: none; white-space: nowrap; }
header.bar .title { font-weight: 700; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; }
header.bar button { min-height: 40px; padding: 6px 12px; font-size: 14px; }
a { color: var(--accent); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 12px 0; }
button, .button { display: inline-block; min-height: 44px; padding: 10px 16px; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: 16px; text-decoration: none; cursor: pointer; }
button.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
button:disabled { opacity: .5; }
input { width: 100%; min-height: 44px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 16px; background: var(--surface); color: var(--text); }
label { display: block; margin: 10px 0 4px; font-weight: 600; }
.message { padding: 12px 16px; margin: 12px; border-radius: 8px; }
.message.error { background: var(--err-soft); color: var(--err); }
.message.ok { background: var(--ok-wash); color: var(--ok); }
.muted { color: var(--sub); font-size: 14px; }
img { max-width: 100%; }
h1 { font-size: 20px; margin: 8px 0; }
h2 { font-size: 18px; margin: 4px 0 8px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row > .grow { flex: 1 1 140px; min-width: 0; }
.full { width: 100%; margin-top: 12px; }
.code-input { font-size: 28px; letter-spacing: 8px; text-align: center; }
.hint { background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
[hidden] { display: none !important; }

/* 図鑑: 10種のタイル・種類ページ・表裏の地図・写真・拡大 */
.zk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.zk-tile { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 120px; padding: 12px 8px; text-align: center; text-decoration: none; color: var(--text); background: var(--card); border: 1px solid var(--accent); border-radius: 12px; }
.zk-tile--off { opacity: .55; border-color: var(--line); border-style: dashed; }
.zk-sym { font-size: 32px; line-height: 1.2; }
.zk-name { font-weight: 700; overflow-wrap: anywhere; }
.zk-total { font-size: 13px; color: var(--sub); }
.zk-status { font-size: 13px; font-weight: 700; color: var(--accent); }
.zk-tile--off .zk-status { color: var(--sub); font-weight: 400; }
.zk-head { display: flex; align-items: center; gap: 12px; }
.zk-head .zk-sym { font-size: 40px; }
.zk-map { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.zk-frame-wrap { margin: 0; text-align: center; font-size: 14px; color: var(--sub); }
.zk-frame { position: relative; width: 100%; background: var(--surface2); border: 1px solid var(--line); border-radius: 6px; }
.zk-dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; border: 1px solid var(--surface); opacity: .85; }
.zk-dot--mine { background: var(--accent); z-index: 1; }
.zk-dot--other { background: var(--other); }
.zk-dot--static { position: static; display: inline-block; margin: 0 6px 0 0; vertical-align: middle; }
.zk-legend { display: flex; gap: 16px; justify-content: center; margin-top: 8px; font-size: 14px; }
.zk-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.zk-photo { position: relative; display: block; width: 100%; aspect-ratio: 1; min-height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--img-bg); }
.zk-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.zk-photo--mine { border-color: var(--accent); }
.zk-badge { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 0; font-size: 11px; text-align: center; background: var(--accent); color: var(--accent-ink); }
.zk-more { width: 100%; margin-top: 12px; }
.zk-viewer { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; background: var(--veil); backdrop-filter: blur(6px); }
.zk-viewer img { max-width: 100%; max-height: 75vh; border-radius: 8px; background: var(--img-bg); }
