/* ==========================================================================================================
   KirinCore . V7 HUD skin for the manual page - kc_manual_v7.css                        [claude 20261031]
   ----------------------------------------------------------------------------------------------------------
   /kc-manual.html is a standalone static page: one inline <style> of ~4.4kB, light-only, no dark mode and
   no connection to the app's theme. Opened from the help button it looked like a different product.

   This sheet re-skins it in the V7 HUD language WITHOUT touching the page's markup. The page is token-driven
   (--bg, --card, --ink, --muted, --border, --primary ...), so much of the work is redefining those; the rest
   is one rule per element type the page actually contains.

   SECOND VERSION - WHAT THE FIRST ONE GOT WRONG (owner 2026-10-31: "the backgrounds swallow the text")
   ---------------------------------------------------------------------------------------------------------
   The first version styled classes by what their NAMES suggested instead of checking what they are on.
   Measured against the live page (census of every class and tag, and the original <style> read in full):
     .dot      is NOT a status dot. It is the class of the page's 3 bullet lists (<ul class="dot">). A rule
               `.dot{background:var(--primary)!important}` painted every one of them a solid violet slab -
               light text on #a78bfa, and the chips inside it violet on violet, invisible.
     .top      is NOT a card's top row. It is the 14 "back to contents" links (<a class="top">), meant to be
               small and muted; they had been forced to full ink.
     details   was not covered at all. The original gives it a hard-coded #fafaff, so in dark mode the
               7 FAQ items were near-white panels under near-white text.
     kbd       holds Thai on-screen button names ("+ สร้างหน้าใหม่", "เผยแพร่", "บันทึก"), not keys. Setting
               it in JetBrains Mono, which has no Thai glyphs, made every one fall back to a mismatched face.
               The original sets it in Prompt; so does this.
     .pill     is a filled status chip in the original (primary fill, white text - "เผยแพร่แล้ว", "Lead",
               "Purchase"); the first version turned it into a pale tint.
   Every rule below now names the element it is for, and was checked against the census.

   ELEMENT CENSUS (live, 2026-10-31): section.card 14, div.box 17 (= tip 8 + note 6 + warn 2 + danger 1),
   ol.steps 10, ul.dot 3, details/summary 7, table 2 (th 4, td 18), kbd 13, code 1, span.pill 6,
   span.num 14, p.sub 14, a.top 14, div.grp 5, span.ok 2, footer 1, header.hero 1, nav.toc 1.

   LOAD IT LAST - the <link> goes at the END of <head>, after the page's own <style>; where the original is
   more specific, `html body` is added rather than !important.

   The page follows the app's theme: a two-line script in <head> reads localStorage.theme (the key the app
   writes) and sets html.dark + data-theme before first paint, so there is no flash.

   HOUSE RULES THIS SHEET KEEPS
   - no looping animations at all (the whole site had them removed for performance on 2026-10-31)
   - Thai text never below 12px
   - text contrast at or above 4.5:1 on both themes - measured per element, see V7_DEPLOY_NOTES
   ========================================================================================================== */

/* ---------- 1 . tokens ---------- */
:root{
  color-scheme:light;
  --primary:#6d28d9;
  --primary-d:#5b21b6;
  --ink:#17223a;
  --muted:#51618a;
  --bg:#eef3fc;
  --card:rgba(255,255,255,.72);
  --border:rgba(109,40,217,.16);
  /* the -800 steps, not -700: the bold headline of a warning box measured 4.38:1 with #b45309 on its own
     amber tint - under the line. These read 6.2:1 and up on their tints. */
  --ok:#065f46;
  --warn:#92400e;
  --danger:#991b1b;
  --tip-bg:rgba(4,120,87,.08);
  --warn-bg:rgba(180,83,9,.08);
  --danger-bg:rgba(185,28,28,.07);
  --note-bg:rgba(109,40,217,.07);
  /* Prompt last: JetBrains Mono and the system monos carry no Thai, so Thai inside code falls to Prompt */
  --mn-mono:'JetBrains Mono',ui-monospace,SFMono-Regular,Menlo,Consolas,'Prompt',monospace;
  --mn-kicker:#6d28d9;
  --mn-rule:rgba(109,40,217,.22);
  --mn-glass:rgba(255,255,255,.72);
  --mn-shadow:0 18px 44px -28px rgba(31,41,95,.45);
  --mn-page:linear-gradient(160deg,#eef3fc,#f5f0ff);
  --mn-sunk:rgba(109,40,217,.04);
  --mn-key-bg:rgba(109,40,217,.09);
  --mn-key-bd:rgba(109,40,217,.3);
  --mn-key-fg:#4c1d95;
  --mn-pill-bg:#6d28d9;
  --mn-pill-fg:#ffffff;
}
html:is(.dark,[data-theme="dark"]){
  color-scheme:dark;
  --primary:#a78bfa;
  --primary-d:#c4b5fd;
  --ink:#e9eefc;
  --muted:#9aa6cf;
  --bg:#05060d;
  --card:rgba(17,22,48,.64);
  --border:rgba(124,92,255,.3);
  --ok:#6ee7b7;
  --warn:#fcd34d;
  --danger:#fca5a5;
  --tip-bg:rgba(16,185,129,.1);
  --warn-bg:rgba(217,119,6,.12);
  --danger-bg:rgba(185,28,28,.14);
  --note-bg:rgba(124,92,255,.12);
  --mn-kicker:#c4b5fd;
  --mn-rule:rgba(124,92,255,.3);
  --mn-glass:rgba(17,22,48,.64);
  --mn-shadow:0 20px 50px -30px #000;
  --mn-page:linear-gradient(160deg,#05060d,#0a0f1f);
  --mn-sunk:rgba(255,255,255,.035);
  --mn-key-bg:rgba(124,92,255,.16);
  --mn-key-bd:rgba(124,92,255,.42);
  --mn-key-fg:#ddd6fe;
  --mn-pill-bg:#a78bfa;
  --mn-pill-fg:#0a0f1f;
}

/* ---------- 2 . the page ---------- */
html{background:var(--mn-page);min-height:100%}
html body{
  background:transparent;
  color:var(--ink);
  /* The grid wash the rest of V7 uses - but much fainter than on the app screens, and deliberately so.
     This is a page you READ, not a dashboard you scan: at the app's strength the ruling showed through
     every paragraph. */
  background-image:
    linear-gradient(to right,rgba(124,92,255,.055) 1px,transparent 1px),
    linear-gradient(to bottom,rgba(124,92,255,.055) 1px,transparent 1px);
  background-size:64px 64px;
  background-attachment:fixed;
}
html:not(.dark):not([data-theme="dark"]) body{
  background-image:
    linear-gradient(to right,rgba(109,40,217,.05) 1px,transparent 1px),
    linear-gradient(to bottom,rgba(109,40,217,.05) 1px,transparent 1px);
}
html body::before{content:none}

html body .wrap{max-width:980px}

/* ---------- 3 . header.hero, as a HUD banner ---------- */
html body header.hero{
  position:relative;
  background:var(--mn-glass)!important;
  border:1px solid var(--border);
  border-radius:20px;
  box-shadow:var(--mn-shadow);
  color:var(--ink)!important;
  overflow:hidden;
  -webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);
}
/* the lock-on corners. Static - drawn once, never animated. */
html body header.hero::before,
html body header.hero::after{
  content:'';position:absolute;width:26px;height:26px;pointer-events:none;
  border:1.6px solid var(--primary);opacity:.6;
}
html body header.hero::before{top:9px;left:9px;border-right:0;border-bottom:0;border-top-left-radius:12px}
html body header.hero::after{bottom:9px;right:9px;border-left:0;border-top:0;border-bottom-right-radius:12px}
html body header.hero h1{color:var(--ink)!important;letter-spacing:.2px}
html body header.hero p{color:var(--muted)!important;opacity:1}

/* span.badge over the title reads "คู่มือฉบับสมบูรณ์" - THAI. The uppercase-mono kicker the brief exempts
   from the 12px floor is for Latin, so this keeps the kicker's frame (violet, outlined, quiet) at a size
   and tracking that suit the script it actually holds. */
html body header.hero .badge{
  background:transparent!important;
  border:1px solid var(--mn-rule);
  border-radius:8px;
  color:var(--mn-kicker)!important;
  font-size:.78rem;
  font-weight:600;
  letter-spacing:.3px;
  text-transform:none;
  padding:4px 10px;
}

/* ---------- 4 . section.card and nav.toc: the glass panels ---------- */
html body section.card,
html body nav.toc{
  background:var(--mn-glass)!important;
  border:1px solid var(--border)!important;
  border-radius:16px;
  box-shadow:var(--mn-shadow);
  color:var(--ink);
  -webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);
}
html body section.card{position:relative}
/* one corner mark per card rather than four: 4 arcs x 14 cards is the kind of thing that makes a long
   page stutter. */
html body section.card::after{
  content:'';position:absolute;top:8px;right:8px;width:20px;height:20px;pointer-events:none;
  border-top:1.4px solid var(--primary);border-right:1.4px solid var(--primary);
  border-top-right-radius:10px;opacity:.45;
}
html body h2{color:var(--primary-d)}
html body h2 .num{
  background:linear-gradient(135deg,var(--primary),var(--primary-d))!important;
  color:#0a0f1f!important;
  font-family:var(--mn-mono);
  font-weight:700;
  border-radius:10px;
}
html:not(.dark):not([data-theme="dark"]) body h2 .num{color:#fff!important}
/* p.sub: the one-line explanation under each section title, Thai. .88rem, not .82rem: at 13.1px it was
   the smallest running text on a page whose whole job is to be read. */
html body p.sub{color:var(--muted)!important;font-size:.88rem;line-height:1.6}

html body nav.toc{padding:18px 20px}
html body nav.toc a{color:var(--primary)!important;text-decoration:none}
html body nav.toc a:hover{text-decoration:underline}
/* div.grp: the group labels inside the contents ("เริ่มต้น", "แต่งหน้าเพจ", "ขายของ") - Thai again, so the
   colour and weight carry the kicker role; mono/uppercase/wide tracking does not apply. */
html body nav.toc .grp{
  color:var(--mn-kicker)!important;
  font-size:.8rem;
  font-weight:700;
  letter-spacing:.3px;
  text-transform:none;
}

/* a.top: "↑ กลับสารบัญ" at the foot of every card. Small and quiet, as in the original - it is a way
   back, not content. 13px Thai, over the floor. */
html body a.top{color:var(--muted)!important;font-size:.82rem;text-decoration:none}
html body a.top:hover{color:var(--primary)!important}

/* ---------- 5 . div.box callouts: tinted panels set into the card ---------- */
html body div.box{
  border:1px solid var(--border);
  border-radius:12px;
  background:transparent;
  color:var(--ink);
  font-size:.92rem;
  line-height:1.7;
}
html body div.box.tip{background:var(--tip-bg)!important;border-color:color-mix(in srgb,var(--ok) 32%,transparent)}
html body div.box.note{background:var(--note-bg)!important;border-color:var(--mn-rule)}
html body div.box.warn{background:var(--warn-bg)!important;border-color:color-mix(in srgb,var(--warn) 34%,transparent)}
html body div.box.danger{background:var(--danger-bg)!important;border-color:color-mix(in srgb,var(--danger) 34%,transparent)}
html body div.box.tip b{color:var(--ok)}
html body div.box.warn b{color:var(--warn)}
html body div.box.danger b{color:var(--danger)}

/* ---------- 6 . lists ---------- */
/* ol.steps: the numbered walk-throughs. Thai needs more leading than Latin at the same size - tone
   marks and vowels stack above and below the line. */
html body ol.steps > li{color:var(--ink);font-size:1rem;line-height:1.85;border-bottom-color:var(--border)}
html body ol.steps > li::before{background:var(--note-bg);color:var(--primary-d);border:1px solid var(--mn-rule)}
/* ul.dot: a plain bullet list. Nothing but a coloured marker - it sits on the card like body copy. */
html body ul.dot{background:none!important}
html body ul.dot > li{color:var(--ink);line-height:1.8}
html body ul.dot > li::marker{color:var(--primary)}

/* ---------- 7 . details/summary: the FAQ ---------- */
html body details{
  background:var(--mn-sunk)!important;
  border:1px solid var(--border);
  border-radius:12px;
  color:var(--ink);
}
html body summary{color:var(--ink);font-weight:600}
html body summary:hover{color:var(--primary)}
html body details[open] summary{color:var(--primary-d);border-bottom-color:var(--mn-rule)}

/* ---------- 8 . tables ---------- */
html body table{color:var(--ink)}
html body th,
html body td{border-color:var(--border)}
html body th{background:var(--note-bg);color:var(--primary-d)}

/* ---------- 9 . inline chips ---------- */
/* kbd: an on-screen BUTTON named in the text ("+ สร้างหน้าใหม่", "เผยแพร่", "🌐 ดูหน้า", "บันทึก"), plus
   three "Ctrl + Shift + R". Drawn as a small key, in Prompt like the original, so the Thai renders in
   the same face as the rest of the page. */
html body kbd{
  font-family:'Prompt',sans-serif;
  font-size:.875rem;
  font-weight:500;
  color:var(--mn-key-fg);
  background:var(--mn-key-bg);
  border:1px solid var(--mn-key-bd);
  border-bottom-width:2px;
  border-radius:6px;
  padding:1px 7px;
  white-space:nowrap;
}
/* code: one instance, "ชื่อหน้า.kir-in.com" - a URL pattern, so mono (Thai falls through to Prompt). */
html body code{
  font-family:var(--mn-mono);
  font-size:.86em;
  color:var(--mn-key-fg);
  background:var(--mn-key-bg);
  border:1px solid var(--mn-key-bd);
  border-radius:6px;
  padding:1px 6px;
}
/* span.pill: a filled status chip, as in the original ("เผยแพร่แล้ว", "Lead", "Purchase"). */
html body span.pill{
  background:var(--mn-pill-bg)!important;
  color:var(--mn-pill-fg)!important;
  border:0;
  border-radius:999px;
  font-size:.8rem;
  font-weight:600;
}
html body .ok{color:var(--ok)}
html body .x{color:var(--danger)}

/* ---------- 10 . links, rules, footer ---------- */
html body a{color:var(--primary)}
html body hr{border:0;border-top:1px solid var(--mn-rule)}
html body footer{color:var(--muted)}

/* ---------- 11 . nothing on this page loops ---------- */
html body *,
html body *::before,
html body *::after{animation:none!important}

@media (max-width:600px){
  html body .wrap{padding-left:14px;padding-right:14px}
  html body header.hero::before,html body header.hero::after{display:none}
}
