/* Palette follows honeyme_website (style-v3.css) so the SOP site feels like the same brand. */
:root {
  --paper: #f5e6d3;
  --card: #fffaf3;
  --card-2: #efe0cc;
  --ink: #5a4234;
  --ink-soft: #8a715f;
  --accent: #c9880a;
  --accent-ink: #fff;
  --line: #e2cdb3;
  --ok: #3f7d4e;
  --ok-bg: #e3f1e4;
  --warn: #9a6400;
  --warn-bg: #fff1cf;
  --bad: #b3372b;
  --bad-bg: #fbe3df;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(90, 66, 52, .08), 0 4px 16px rgba(90, 66, 52, .06);
  --font: "Poppins", "Noto Sans SC", -apple-system, "PingFang SC", sans-serif;
  --serif: "Fraunces", "Noto Sans SC", serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1f1814; --card: #2a211c; --card-2: #342924; --ink: #f1e4d4; --ink-soft: #bba792;
    --accent: #e0a534; --accent-ink: #1f1814; --line: #43362e;
    --ok: #8fd09e; --ok-bg: #1f3325; --warn: #f0c46a; --warn-bg: #3a2f14; --bad: #f09a8f; --bad-bg: #3d211d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; overflow-x: hidden; background: var(--paper); color: var(--ink); font: 16px/1.6 var(--font); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
img { max-width: 100%; display: block; }
.boot { padding: 40vh 0; text-align: center; color: var(--ink-soft); }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 10; background: var(--paper); border-bottom: 1px solid var(--line); padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); }
.top-row { display: flex; align-items: center; gap: 10px; max-width: 980px; margin: 0 auto; }
.top-row .chip:last-child { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; }
.brand { font-family: var(--serif); font-size: 20px; font-weight: 600; text-decoration: none; color: var(--ink); white-space: nowrap; }
.brand small { font-family: var(--font); font-size: 12px; color: var(--accent); margin-left: 4px; letter-spacing: .08em; }
.spacer { flex: 1; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 14px; white-space: nowrap; }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.nav { display: flex; gap: 6px; max-width: 980px; margin: 10px auto 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { text-decoration: none; }
.search { width: 100%; max-width: 980px; margin: 10px auto 0; display: block; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); }

main { max-width: 980px; margin: 0 auto; padding: 16px 16px 80px; }
h1, h2, h3 { line-height: 1.3; }
h1 { font-family: var(--serif); font-size: 26px; margin: 8px 0 4px; }
.muted { color: var(--ink-soft); font-size: 14px; }
.section-title { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin: 28px 0 10px; font-weight: 600; }

/* ---------- cards / lists ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr)); }
.cat { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; }
.cat .emoji { font-size: 26px; }
.cat b { font-size: 17px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--card); border-radius: 12px; text-decoration: none; color: inherit; box-shadow: var(--shadow); }
.row .t { flex: 1; min-width: 0; }
.row .t b { display: block; font-weight: 500; }
.row .t span { display: block; font-size: 13px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code { font: 600 12px var(--font); background: var(--card-2); border-radius: 6px; padding: 2px 6px; white-space: nowrap; }
.badge { font-size: 12px; border-radius: 999px; padding: 2px 8px; white-space: nowrap; font-weight: 500; }
.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); }
.badge.plain { background: var(--card-2); color: var(--ink-soft); }

.progress { height: 8px; background: var(--card-2); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; background: var(--accent); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 12px; padding: 12px 18px; background: var(--accent); color: var(--accent-ink); font-weight: 600; cursor: pointer; text-decoration: none; min-height: 46px; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.small { padding: 6px 12px; min-height: 34px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- doc body ---------- */
.doc-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.md { font-size: 17px; }
.md h2 { font-size: 19px; margin: 26px 0 8px; padding-bottom: 4px; border-bottom: 2px solid var(--line); }
.md h3 { font-size: 17px; margin: 18px 0 6px; }
.md ul, .md ol { padding-left: 22px; }
.md li { margin: 4px 0; }
.md strong { color: var(--ink); background: linear-gradient(transparent 62%, rgba(201, 136, 10, .22) 62%); }
.md blockquote { margin: 12px 0; padding: 10px 14px; border-left: 4px solid var(--accent); background: var(--warn-bg); border-radius: 0 10px 10px 0; }
.md blockquote p { margin: 0; }
.table-wrap { overflow-x: auto; margin: 12px 0; -webkit-overflow-scrolling: touch; }
.md table { border-collapse: collapse; min-width: 100%; font-size: 15px; background: var(--card); border-radius: 10px; overflow: hidden; }
.md th, .md td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.md th { background: var(--card-2); font-weight: 600; white-space: nowrap; }
.gallery { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-top: 12px; }
.gallery figure { margin: 0; cursor: zoom-in; }
.gallery img { border-radius: 10px; aspect-ratio: 4/3; object-fit: cover; width: 100%; background: var(--card-2); }
.gallery figcaption { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }
.pdf { display: flex; align-items: center; justify-content: center; aspect-ratio: 4/3; border-radius: 10px; background: var(--card-2); font-weight: 600; text-decoration: none; color: var(--ink); }

.review { background: var(--warn-bg); color: var(--warn); border-radius: 12px; padding: 12px 14px; margin: 14px 0; font-size: 14px; }
.review b { display: block; margin-bottom: 4px; }
.review ul { margin: 0; padding-left: 18px; }
.why { border-left: 4px solid var(--bad); }
.why h4 { margin: 0 0 4px; font-size: 15px; }
.why p { margin: 4px 0; font-size: 15px; }
.why .lesson { font-weight: 600; color: var(--bad); }

.train { margin-top: 28px; border: 2px solid var(--accent); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.step { text-align: center; padding: 10px 4px; border-radius: 10px; background: var(--card-2); font-size: 14px; }
.step.done { background: var(--ok-bg); color: var(--ok); font-weight: 600; }

/* ---------- login ---------- */
.login { max-width: 460px; margin: 0 auto; padding: 48px 16px; text-align: center; }
.login h1 { font-size: 32px; }
.names { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 24px; }
.names button { padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); font-size: 18px; cursor: pointer; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 24px 0; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink); }
.pin-dots i.on { background: var(--ink); }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 300px; margin: 0 auto; }
.pad button { height: 64px; border-radius: 50%; aspect-ratio: 1; margin: 0 auto; border: 1px solid var(--line); background: var(--card); font-size: 24px; cursor: pointer; }
.pad button.blank { visibility: hidden; }
.err { color: var(--bad); min-height: 24px; margin-top: 12px; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal[hidden] { display: none; }
.sheet { background: var(--paper); width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; border-radius: 20px 20px 0 0; padding: 20px 16px calc(24px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .modal { align-items: center; } .sheet { border-radius: 20px; } }
.q { margin: 18px 0; }
.q p { font-weight: 600; margin: 0 0 8px; }
.opt { display: block; width: 100%; text-align: left; padding: 12px 14px; margin: 6px 0; border-radius: 12px; border: 2px solid var(--line); background: var(--card); cursor: pointer; }
.opt.sel { border-color: var(--accent); }
.opt.right { border-color: var(--ok); background: var(--ok-bg); }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); }
.zoom { position: fixed; inset: 0; background: rgba(0, 0, 0, .9); z-index: 60; display: flex; align-items: center; justify-content: center; }
.zoom img { max-width: 100vw; max-height: 100vh; object-fit: contain; }

/* ---------- forms / admin ---------- */
label.f { display: block; margin: 12px 0; font-size: 14px; color: var(--ink-soft); }
label.f > input, label.f > select, label.f > textarea { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); }
textarea { min-height: 280px; font: 14px/1.5 ui-monospace, Menlo, monospace; }
.two { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .two { grid-template-columns: 1fr 1fr; } }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.matrix-wrap { overflow-x: auto; }
table.matrix { border-collapse: collapse; font-size: 13px; }
table.matrix th, table.matrix td { border: 1px solid var(--line); padding: 4px 6px; text-align: center; white-space: nowrap; }
table.matrix th.doc { writing-mode: vertical-rl; max-height: 180px; font-weight: 500; }
table.matrix td.name { text-align: left; font-weight: 600; position: sticky; left: 0; background: var(--paper); }
.cell-ok { background: var(--ok-bg); color: var(--ok); }
.cell-part { background: var(--warn-bg); color: var(--warn); }
.cell-old { background: var(--bad-bg); color: var(--bad); }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }
.checks label { color: var(--ink); }
.qedit { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 10px 0; background: var(--card); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 999px; z-index: 70; font-size: 14px; }
a.chip { text-decoration: none; color: var(--ink); }
a.chip.on { color: var(--paper); }
