@font-face { font-family: "Bai Jamjuree"; font-weight: 400; font-display: swap; src: url(/fonts/BaiJamjuree-Regular.ttf) format("truetype"); }
@font-face { font-family: "Bai Jamjuree"; font-weight: 500; font-display: swap; src: url(/fonts/BaiJamjuree-Medium.ttf) format("truetype"); }
@font-face { font-family: "Bai Jamjuree"; font-weight: 600; font-display: swap; src: url(/fonts/BaiJamjuree-SemiBold.ttf) format("truetype"); }
@font-face { font-family: "Bai Jamjuree"; font-weight: 700; font-display: swap; src: url(/fonts/BaiJamjuree-Bold.ttf) format("truetype"); }

:root {
  --bg: #F3F5EE;
  --surface: #FFFFFF;
  --surface-2: #F7F9F2;
  --line: #E1E7D8;
  --ink: #0F2A1E;
  --ink-2: #4E5F55;
  --green: #0E4B33;
  --green-2: #0A3A27;
  --lime: #C9EE6B;
  --lime-2: #A6D930;
  --lime-soft: #EAF7C9;
  --orange: #E8701F;
  --orange-soft: #FDE3CF;
  --amber: #B7791F;
  --amber-soft: #FBEFC9;
  --ok: #2E7D4F;
  --ok-soft: #DDF1E3;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(15, 42, 30, .05), 0 8px 28px rgba(15, 42, 30, .06);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Bai Jamjuree", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  font-size: 16px; line-height: 1.45;
  background-image: radial-gradient(1200px 300px at 0% 105%, #E6F4C9 0%, transparent 60%);
  background-attachment: fixed; min-height: 100vh;
}
h1, h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.08; }
h1 { font-size: clamp(32px, 5.4vw, 60px); font-weight: 700; color: var(--green-2); }
h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 700; color: var(--green-2); }
h3 { font-size: 18px; font-weight: 600; }
p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
.i { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.i.big { width: 40px; height: 40px; }
.warn { color: var(--orange); }

.top { display: flex; align-items: center; gap: 28px; padding: 18px clamp(16px, 4vw, 56px); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--green-2); font-weight: 700; font-size: 26px; letter-spacing: -.02em; }
nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav-link { border: 0; background: none; padding: 7px 16px; border-radius: 999px; font-weight: 600; color: var(--green-2); cursor: pointer; }
.nav-link.active { background: var(--lime); }
.nav-link:hover:not(.active) { background: var(--lime-soft); }

main { padding: 8px clamp(16px, 4vw, 56px) 40px; max-width: 1360px; margin: 0 auto; }
.view.center { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding-top: 20px; }
.lead { font-size: clamp(17px, 2vw, 22px); color: var(--ink-2); margin-top: 10px; }
.fine { font-size: 13.5px; color: var(--ink-2); display: flex; gap: 8px; align-items: center; justify-content: center; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pill { display: inline-flex; align-items: center; gap: 8px; background: var(--lime-soft); color: var(--green-2); padding: 8px 16px; border-radius: 999px; font-weight: 600; margin-top: 22px; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, .7fr); gap: 32px; align-items: center; }
.hero-copy h1 { font-size: clamp(34px, 3.9vw, 58px); }
.check-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 4px; gap: 4px; }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 0; background: none; padding: 9px 4px; border-radius: 11px; font-weight: 600; font-size: 14.5px; line-height: 1.15; cursor: pointer; color: var(--green-2); min-width: 0; }
.tab span { overflow-wrap: anywhere; text-align: center; }
.tab.active { background: var(--green); color: #fff; }
.drop { display: block; border: 2px dashed #C9D3BD; border-radius: 14px; min-height: 190px; cursor: pointer; position: relative; background: var(--surface-2); transition: background .15s, border-color .15s; }
.drop.over { background: var(--lime-soft); border-color: var(--lime-2); }
.drop-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 186px; padding: 16px; text-align: center; color: var(--green-2); }
.drop-empty strong { font-size: 19px; }
.drop-empty span { color: var(--ink-2); font-size: 14.5px; }
.drop-preview { padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.drop-preview img { max-width: 100%; max-height: 300px; border-radius: 10px; box-shadow: var(--shadow); }
.chip-btn { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line); background: var(--surface); padding: 6px 12px; border-radius: 999px; cursor: pointer; font-size: 14px; }
.field-label { font-weight: 600; font-size: 18px; color: var(--green-2); display: block; margin-bottom: 8px; }
textarea, input[type=url], input:not([type]) { width: 100%; border: 1.5px solid #CBD6C0; border-radius: 12px; padding: 13px 14px; background: var(--surface); outline: none; }
textarea { resize: vertical; min-height: 140px; }
textarea:focus, input:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--lime-soft); }
.context summary { cursor: pointer; color: var(--ink-2); font-weight: 500; padding: 2px 0; }
.context input { margin-top: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 12px; padding: 15px 22px; font-weight: 600; font-size: 18px; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-2); }
.btn.primary:disabled { opacity: .6; cursor: wait; }
.btn.ghost { background: var(--surface); color: var(--green-2); border: 1.5px solid var(--line); }
.form-error { color: #B3401A; background: var(--orange-soft); border-radius: 10px; padding: 10px 12px; font-size: 15px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

.hero-art { display: flex; justify-content: center; }
.radar { width: min(300px, 100%); aspect-ratio: 1; border-radius: 50%; position: relative; overflow: hidden;
  background: radial-gradient(circle, #7BBF2A 0 2%, transparent 2.5%), repeating-radial-gradient(circle, transparent 0 15%, rgba(214, 245, 140, .55) 15.4% 16%), radial-gradient(circle at 40% 35%, #8FD13A, #3E8A22 70%);
  box-shadow: 0 0 0 10px #D8F09E, 0 18px 40px rgba(62, 138, 34, .35); }
.radar.small { width: 150px; margin-bottom: 8px; }
.sweep { position: absolute; inset: 0; background: conic-gradient(from 0deg, rgba(230, 255, 160, .85), transparent 18%); animation: spin 3.2s linear infinite; }
.blip { position: absolute; width: 4%; height: 4%; border-radius: 50%; background: #F0FF9C; box-shadow: 0 0 10px #F0FF9C; }
.b1 { left: 30%; top: 46%; } .b2 { left: 68%; top: 62%; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sweep { animation: none; } }

.side-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 36px; }
.mini { display: flex; gap: 16px; padding: 20px; align-items: flex-start; }
.mini p { color: var(--ink-2); margin-top: 6px; }
.mini-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--lime-soft); display: grid; place-items: center; color: var(--green); flex: none; }

.steps { list-style: none; margin: 18px 0 6px; padding: 12px; width: min(520px, 100%); text-align: start; display: flex; flex-direction: column; gap: 8px; }
.steps li { display: flex; align-items: center; gap: 14px; padding: 13px 14px; border-radius: 12px; font-weight: 600; color: #8B988F; background: var(--surface-2); }
.steps li .dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #C7CFC2; display: grid; place-items: center; flex: none; }
.steps li.active { color: var(--ink); background: var(--surface); border: 1px solid var(--line); }
.steps li.active .dot { border: 3px solid var(--lime-2); border-top-color: transparent; animation: spin 1s linear infinite; }
.steps li.done { color: var(--ink); background: var(--lime-soft); }
.steps li.done .dot { background: var(--lime-2); border-color: var(--lime-2); color: var(--green-2); }
.steps li.failed .dot { border-color: var(--orange); }

/* Report */
.report-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-bottom: 22px; }
.badge { display: inline-flex; align-items: center; gap: 10px; padding: 10px 20px; border-radius: 999px; font-weight: 700; font-size: 20px; }
.badge.very_high { background: #C2410C; color: #fff; }
.badge.high { background: var(--orange); color: #fff; }
.badge.medium { background: var(--amber-soft); color: #7A4E0E; }
.badge.low { background: #EEF5DC; color: #4D6B12; }
.badge.none { background: var(--ok-soft); color: var(--ok); }
.badge.unknown { background: #E8ECE4; color: var(--ink-2); }
.report-title { flex: 1 1 360px; }
.report-title h2 { font-size: clamp(24px, 3vw, 34px); }
.report-title p { color: var(--ink-2); margin-top: 6px; font-size: 17px; }
.report-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.signals { padding: 6px 20px; }
.signal { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.signal:last-child { border-bottom: 0; }
.sig-icon { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--lime-soft); color: var(--green); }
.sig-icon.high { background: var(--orange-soft); color: #C2561A; }
.sig-icon.medium { background: var(--amber-soft); color: #A16207; }
.signal h3 { font-size: 18px; }
.signal p { color: var(--ink-2); margin-top: 3px; }
.evidence { margin-top: 8px; font-size: 14px; background: var(--surface-2); border-inline-start: 3px solid var(--lime-2); padding: 6px 10px; border-radius: 6px; color: var(--ink); overflow-wrap: anywhere; }
.origin { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--lime-soft); color: var(--green-2); margin-top: 8px; }
.origin.o-ai { background: #E7EDF8; color: #2B4A7E; }
.origin.o-source { background: #E3F1EA; color: var(--ok); }
.next { padding: 20px; background: linear-gradient(180deg, #FBFEF4, var(--surface)); }
.next ol { list-style: none; padding: 0; margin: 14px 0 0; counter-reset: n; }
.next li { counter-increment: n; display: flex; gap: 14px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.next li:last-child { border-bottom: 0; }
.next li::before { content: counter(n); width: 34px; height: 34px; border-radius: 10px; background: var(--lime-soft); display: grid; place-items: center; flex: none; color: var(--green-2); }
.empty-signals { padding: 22px 0; color: var(--ink-2); }
.section-title { margin: 30px 0 14px; }
.sources { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.source { display: flex; gap: 14px; padding: 16px; text-decoration: none; color: inherit; align-items: flex-start; }
a.source:hover { border-color: var(--lime-2); }
.source h3 { font-size: 16px; overflow-wrap: anywhere; }
.source p { color: var(--ink-2); font-size: 14px; margin-top: 4px; overflow-wrap: anywhere; }
.source .meta { font-size: 12.5px; color: #7C8A80; margin-top: 6px; }
.gaps { padding: 16px 20px; margin-top: 14px; background: var(--surface-2); }
.gaps ul { margin: 8px 0 0; padding-inline-start: 20px; color: var(--ink-2); }
.report-actions { display: flex; gap: 12px; justify-content: center; margin-top: 30px; flex-wrap: wrap; }
.ai-note { margin-top: 14px; font-size: 14px; color: var(--ink-2); }

.list { display: flex; flex-direction: column; gap: 10px; margin: 20px 0; }
.hist { display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer; text-align: start; width: 100%; border: 1px solid var(--line); }
.hist .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.hist .when { font-size: 13px; color: var(--ink-2); }
.level-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.level-dot.very_high { background: #C2410C; } .level-dot.none { background: var(--ok); } .level-dot.high { background: var(--orange); } .level-dot.medium { background: #E3B341; } .level-dot.low { background: var(--ok); } .level-dot.unknown { background: #A9B3AC; }
.how { padding: 24px 24px 24px 48px; margin-top: 20px; font-size: 18px; display: flex; flex-direction: column; gap: 12px; }
.error-card { padding: 30px; display: flex; flex-direction: column; align-items: center; gap: 16px; max-width: 520px; }
.error-card p { font-size: 18px; }

.foot { text-align: center; color: var(--ink-2); font-size: 14px; padding: 18px 16px 30px; display: flex; align-items: center; gap: 16px; justify-content: center; }
.foot::before, .foot::after { content: ""; height: 1px; background: #CBD4C4; flex: 0 1 380px; }

[dir=rtl] .i use[href="#i-arrow"] { transform: scaleX(-1); transform-origin: center; }

@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: 1fr 1fr; }
  .hero-art { display: none; }
}
@media (max-width: 760px) {
  .top { gap: 10px; padding-top: 12px; }
  .brand { font-size: 23px; }
  nav { width: 100%; }
  .nav-link { padding: 6px 12px; font-size: 15px; }
  .hero-grid, .report-grid, .side-cards { grid-template-columns: 1fr; }
  .hero-grid { gap: 20px; }
  .pill { margin-top: 14px; }
  .check-card { padding: 14px; }
  .btn { width: 100%; }
  .sources { grid-template-columns: 1fr; }
  .foot::before, .foot::after { flex-basis: 40px; }
}
@media (max-width: 560px) { .tab .i { width: 18px; height: 18px; } .tab { font-size: 13px; padding: 8px 2px; } }

/* Spec 2.0: documents, rule matrix, share */
.small-label { display: block; margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.context input + .small-label + input { margin-top: 4px; }
.fine.left { justify-content: flex-start; text-align: start; margin-top: 8px; }
.doc-chosen { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 186px; padding: 16px; text-align: center; color: var(--green-2); overflow-wrap: anywhere; }
.coverage { font-size: 14px !important; color: var(--ink-2); margin-top: 8px !important; }
.partial-note { background: var(--amber-soft); color: #7A4E0E; border-radius: 12px; padding: 10px 14px; margin: -8px 0 18px; font-weight: 500; }
.card-title { font-size: 19px; padding: 14px 0 2px; }
.card-title.sub { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 16px; }
.signal.review .sig-icon { background: #EEF1F6; color: #51607A; }
.sig-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sig-meta .origin { margin-top: 0; }
.rule { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: #F0F2EC; color: var(--ink-2); }
.src-link { display: inline-block; margin-top: 6px; font-size: 14px; color: var(--green); overflow-wrap: anywhere; }
.notes { padding: 16px 20px; margin-top: 14px; }
.notes ul { margin: 8px 0 0; padding-inline-start: 20px; color: var(--ink-2); }
.notes strong { color: var(--ink); font-weight: 600; }
.all-checks { padding: 14px 20px; margin-top: 14px; }
.all-checks summary { cursor: pointer; font-weight: 600; color: var(--green-2); }
.all-checks table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14.5px; }
.all-checks td { padding: 7px 6px; border-top: 1px solid var(--line); vertical-align: top; }
.all-checks .cid { font-weight: 600; color: var(--ink-2); width: 44px; }
.all-checks .st { white-space: nowrap; font-weight: 600; }
.all-checks .pts { text-align: end; width: 36px; font-weight: 700; color: #C2561A; }
.st-FLAG .st { color: #C2561A; } .st-PASS .st { color: var(--ok); } .st-REVIEW .st { color: #51607A; }
.st-UNKNOWN .st, .st-NOT_APPLICABLE .st { color: #8B988F; font-weight: 500; }
.all-checks .meta { font-size: 12px; color: #8B988F; margin-top: 10px; }
.modal { position: fixed; inset: 0; background: rgba(15, 42, 30, .45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 20; }
.modal-card { width: min(560px, 100%); max-height: 90vh; overflow: auto; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.modal-card h2 { font-size: 24px; }
.share-preview { border: 1.5px dashed #C9D3BD; border-radius: 14px; padding: 14px 16px; background: var(--surface-2); }
.share-preview .badge { font-size: 15px; padding: 6px 14px; }
.share-preview h3 { margin: 10px 0 4px; }
.share-preview h4 { margin: 12px 0 4px; font-size: 15px; }
.share-preview ul { margin: 0; padding-inline-start: 20px; color: var(--ink-2); }
.share-url { width: 100%; border: 1.5px solid #CBD6C0; border-radius: 12px; padding: 12px; font-size: 15px; background: var(--surface-2); }
@media (max-width: 760px) { .modal-card .btn { width: 100%; } }
