/* คู่มือการใช้งาน TGO Audit Platform — shared stylesheet (plain CSS, no build step) */
:root {
  --bg: #f4f7f3; --surface: #ffffff; --surface-2: #eef4ef;
  --ink: #132118; --ink-2: #3b4c42; --ink-3: #6c7d73; --line: #dde5df; --line-2: #c9d6cd;
  --brand: #1f6b35; --brand-2: #2e8b45; --brand-deep: #174f28; --brand-soft: #e6f2e8; --lime: #8fd15f;
  --amber: #9a5b00; --amber-soft: #fff4dc; --red: #b3261e; --red-soft: #fdecea; --blue: #1d4ed8; --blue-soft: #e7eefc;
  --radius: 14px; --radius-s: 8px; --max: 1180px; --shadow: 0 10px 30px rgba(19,33,24,.08);
  --font-head: 'Prompt', 'Sarabun', -apple-system, 'Segoe UI', 'Noto Sans Thai', sans-serif;
  --font-body: 'Sarabun', 'Prompt', -apple-system, 'Segoe UI', 'Noto Sans Thai', sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 17px; line-height: 1.75; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.3; margin: 0 0 .5rem; color: var(--ink); text-wrap: balance; }
h1 { font-size: 2rem; font-weight: 600; }
h2 { font-size: 1.5rem; font-weight: 600; }
h3 { font-size: 1.12rem; font-weight: 600; color: var(--ink-2); }
h4 { font-size: 1rem; font-weight: 600; color: var(--ink-2); }
p { margin: 0 0 .9rem; }
b, strong { font-weight: 600; }
code, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 0 .35em; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .in { max-width: var(--max); margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); font-family: var(--font-head); font-weight: 600; line-height: 1.2; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, var(--brand-2), var(--brand-deep)); display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.brand small { display: block; font-weight: 400; color: var(--ink-3); font-size: .8rem; }
.rolenav { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.rolenav a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); font-size: .95rem; background: var(--surface); }
.rolenav a:hover { border-color: var(--brand-2); color: var(--brand); text-decoration: none; }
.rolenav a.on { border-color: var(--brand); color: #fff; background: var(--brand); }

/* ---------- layout ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 28px 20px 80px; }
.pagehead { display: flex; gap: 24px; align-items: flex-end; flex-wrap: wrap; margin: 6px 0 26px; }
.pagehead .kicker { color: var(--brand); font-family: var(--font-head); font-weight: 600; font-size: .95rem; letter-spacing: .02em; }
.pagehead p.lead { color: var(--ink-2); font-size: 1.08rem; max-width: 720px; margin: .2rem 0 0; }
.pagehead .badge { margin-left: auto; align-self: center; color: var(--ink-3); font-size: .9rem; text-align: right; }
.page { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 36px; align-items: start; }

/* ---------- task list (left) ---------- */
.tasklist { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 10px; }
.tasklist h4 { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 6px 10px 8px; }
.tasklist ol { list-style: none; margin: 0 0 8px; padding: 0; }
.tasklist li a { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; padding: 9px 10px; border-radius: 10px; color: var(--ink-2); line-height: 1.4; }
.tasklist li a .n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); color: var(--ink-2); font-family: var(--font-head); font-weight: 600; font-size: .85rem; }
.tasklist li a small { display: block; color: var(--ink-3); font-size: .82rem; }
.tasklist li a:hover { background: var(--brand-soft); text-decoration: none; }
.tasklist li a.on { background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; }
.tasklist li a.on .n { background: var(--brand); color: #fff; }
.tasklist .allbtn { display: block; width: 100%; margin: 8px 0 0; padding: 8px 10px; border: 1px dashed var(--line-2); border-radius: 10px; background: transparent; color: var(--ink-3); font: inherit; font-size: .9rem; cursor: pointer; }
.tasklist .allbtn:hover { color: var(--brand); border-color: var(--brand-2); }

@media (max-width: 920px) { .page { grid-template-columns: 1fr; gap: 20px; } .tasklist { position: static; max-height: none; } .tasklist ol { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2px; } }

/* ---------- task sections ---------- */
main { min-width: 0; }
.task { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 28px 22px; margin-bottom: 24px; }
.task[hidden] { display: none; }
.task header { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 8px; }
.task header .n { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--brand); color: #fff; font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; }
.task header h2 { margin: 2px 0 0; }
.task header .who { display: block; color: var(--ink-3); font-size: .9rem; font-weight: 400; margin-top: 2px; }
.task .anchor { margin-left: auto; align-self: center; font-size: .82rem; color: var(--ink-3); white-space: nowrap; }
.goal { color: var(--ink-2); font-size: 1.04rem; margin: 6px 0 14px; padding-left: 54px; }
.goal b { color: var(--brand-deep); }
@media (max-width: 640px) { .task { padding: 20px 16px; } .goal { padding-left: 0; } }
.before { display: flex; gap: 12px; align-items: flex-start; background: var(--surface-2); border-radius: var(--radius-s); padding: 12px 16px; margin: 0 0 18px; }
.before .ic { flex: none; width: 22px; height: 22px; margin-top: 4px; color: var(--brand); }
.before h4 { margin: 0 0 .15rem; font-size: .95rem; }
.before ul { margin: 0; padding-left: 1.1rem; }
ol.steps { counter-reset: step; list-style: none; padding: 0; margin: 10px 0 8px; }
ol.steps > li { position: relative; padding-left: 50px; margin: 0 0 18px; }
ol.steps > li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand-2); display: grid; place-items: center; font-family: var(--font-head); font-weight: 600; color: var(--brand-deep); font-size: .95rem; }
ol.steps > li > p { margin: 0 0 .4rem; }
ol.steps > li > p:first-child { font-size: 1.02rem; }
.ui { display: inline-block; padding: 0 .5em; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 7px; background: var(--surface); font-size: .93em; white-space: nowrap; color: var(--ink); }
.ui.primary { background: var(--brand); border-color: var(--brand-deep); color: #fff; }
.ui.danger { border-color: #e2a9a4; color: var(--red); }
.menu { font-weight: 600; color: var(--brand-deep); }
.pill { display: inline-block; padding: 0 .6em; border-radius: 999px; font-size: .88em; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.pill.draft { background: #eef1ee; color: #4a5a50; }
.pill.submitted { background: var(--blue-soft); color: var(--blue); }
.pill.review { background: #ece9fb; color: #5b3fc4; }
.pill.fix { background: var(--amber-soft); color: var(--amber); }
.pill.pass { background: var(--brand-soft); color: var(--brand-deep); }
.pill.cancel { background: #eef1ee; color: #6c7d73; }
.sev { display: inline-block; padding: 0 .55em; border-radius: 999px; font-size: .88em; font-weight: 600; border: 1px solid; }
.sev.error { color: var(--red); border-color: #efb9b4; background: var(--red-soft); }
.sev.warn { color: var(--amber); border-color: #f1d39a; background: var(--amber-soft); }
.sev.info { color: var(--blue); border-color: #b9c9f5; background: var(--blue-soft); }

/* ---------- media ---------- */
figure.screen, figure.clip { margin: 14px 0 20px; }
figure.screen .frame { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
figure.screen .frame .bar { height: 30px; background: var(--surface-2); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 6px; padding: 0 12px; }
figure.screen .frame .bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); display: inline-block; }
figure.screen .frame img { display: block; width: 100%; }
figure.screen.sm { max-width: 720px; }
figcaption { color: var(--ink-3); font-size: .9rem; margin-top: 8px; line-height: 1.5; }
figure.clip { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
figure.clip .cliphead { display: flex; align-items: center; gap: 10px; margin: 0 2px 10px; font-family: var(--font-head); font-weight: 600; color: var(--ink-2); }
figure.clip .cliphead .play { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; }
figure.clip .cliphead .len { margin-left: auto; color: var(--ink-3); font-weight: 400; font-size: .9rem; font-family: var(--font-body); }
figure.clip video { display: block; width: 100%; border-radius: 10px; background: #0f1a13; aspect-ratio: 16 / 10; }
.shots2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.shots2 figure { margin: 0; }

/* ---------- notes ---------- */
.note { display: flex; gap: 12px; border-radius: var(--radius-s); padding: 12px 16px; margin: 14px 0; background: var(--brand-soft); border-left: 4px solid var(--brand); }
.note .ic { flex: none; width: 22px; height: 22px; margin-top: 3px; }
.note h4 { margin: 0 0 .2rem; font-size: .95rem; }
.note p:last-child, .note ul:last-child { margin-bottom: 0; }
.note ul { margin: 0; padding-left: 1.1rem; }
.note.warn { background: var(--amber-soft); border-color: var(--amber); }
.note.fail { background: var(--red-soft); border-color: var(--red); }
.note.info { background: var(--blue-soft); border-color: var(--blue); }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; margin: 10px 0 18px; }
table { width: 100%; border-collapse: collapse; font-size: .96rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); font-family: var(--font-head); font-weight: 600; color: var(--ink-2); font-size: .9rem; }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; }

details { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 16px; margin: 10px 0; background: var(--surface); }
details summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
details[open] summary { margin-bottom: .5rem; }

/* ---------- pager / footer ---------- */
.pager { display: flex; justify-content: space-between; gap: 12px; margin: 8px 0 0; }
.pager a { flex: 1; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-s); color: var(--ink-2); background: var(--surface); }
.pager a.next { text-align: right; }
.pager a:hover { border-color: var(--brand-2); color: var(--brand); text-decoration: none; }
.pager small { display: block; color: var(--ink-3); font-size: .8rem; }
.pager a[hidden] { visibility: hidden; }
.foot { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: .9rem; display: flex; gap: 18px; flex-wrap: wrap; }
.foot a { color: var(--ink-3); }

/* ---------- index ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 28px; align-items: stretch; margin: 6px 0 34px; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }
.hero .panel { position: relative; overflow: hidden; border-radius: 22px; padding: 38px 36px; color: #fff; background: radial-gradient(120% 90% at 100% 0%, #3aa051 0%, #2a7f3f 40%, #1b5c2c 100%); box-shadow: var(--shadow); }
.hero .panel .tag { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.16); font-size: .9rem; }
.hero .panel h1 { color: #fff; font-size: 2.3rem; margin: 18px 0 10px; }
.hero .panel p { color: rgba(255,255,255,.88); font-size: 1.08rem; max-width: 34ch; }
.hero .panel .rings { position: absolute; right: -80px; top: -80px; width: 380px; height: 380px; opacity: .22; pointer-events: none; }
.hero .side { display: grid; gap: 14px; align-content: start; }
.hero .side .kv { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.hero .side .kv h4 { margin: 0 0 .3rem; font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.hero .side .kv p { margin: 0; color: var(--ink-2); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin: 16px 0 36px; }
.card { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 20px 18px; background: var(--surface); color: inherit; transition: transform .15s, box-shadow .15s, border-color .15s; }
.card:hover { text-decoration: none; border-color: var(--brand-2); box-shadow: var(--shadow); transform: translateY(-2px); }
.card .icon { width: 46px; height: 46px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-deep); display: grid; place-items: center; }
.card .role { color: var(--brand); font-family: var(--font-head); font-weight: 600; font-size: .85rem; }
.card h3 { margin: 0; color: var(--ink); font-size: 1.15rem; }
.card p { color: var(--ink-2); font-size: .97rem; margin: 0; flex: 1; }
.card .n { color: var(--ink-3); font-size: .86rem; }
.card.quiet .icon { background: var(--surface-2); color: var(--ink-2); }
.section { margin: 36px 0; }
.section > h2 { margin-bottom: .3rem; }
.section > p.sub { color: var(--ink-2); margin-bottom: 18px; }
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.flow a { position: relative; display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 14px 14px 12px; color: inherit; }
.flow a:hover { border-color: var(--brand-2); text-decoration: none; }
.flow a .k { font-family: var(--font-head); font-weight: 600; color: var(--brand); font-size: .8rem; }
.flow a b { display: block; color: var(--ink); font-family: var(--font-head); font-weight: 600; margin: 2px 0; }
.flow a small { color: var(--ink-3); }
.flow a::after { content: '→'; position: absolute; right: -13px; top: 50%; transform: translateY(-50%); color: var(--line-2); font-size: 1.1rem; }
.flow a:last-child::after { content: none; }
@media (max-width: 640px) { .flow a::after { content: none; } }
.changelog td:first-child { white-space: nowrap; color: var(--ink-3); }
@media print { .topbar, .tasklist, .pager, .anchor { display: none !important; } .page { grid-template-columns: 1fr; } .task[hidden] { display: block !important; } figure.clip { display: none; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .card { transition: none; } }
