:root {
  --ink: #14213d;
  --muted: #67738a;
  --line: #dce3e8;
  --paper: #f4f1ea;
  --white: #fffdfa;
  --orange: #f26a2e;
  --navy: #0e234a;
  --green: #176c52;
  --amber: #a86615;
  font-family: "IBM Plex Sans Thai", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
button, input, select { font: inherit; }
button { cursor: pointer; }

.topbar {
  height: 76px; padding: 0 5vw; display: flex; align-items: center; justify-content: space-between;
  background: var(--navy); color: white; border-bottom: 4px solid var(--orange);
}
.brand { color: inherit; text-decoration: none; display: flex; gap: 12px; align-items: center; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border: 2px solid var(--orange); border-radius: 50%; color: var(--orange); font: 700 25px Manrope; }
.brand strong { display: block; font: 700 17px Manrope; }
.brand small { display: block; color: #a9b6ce; letter-spacing: .14em; font-size: 9px; margin-top: 2px; }
.source-state { display: flex; align-items: center; gap: 9px; font-size: 13px; color: #d5ddec; }
.source-state button { color: white; border: 1px solid #71809d; border-radius: 999px; background: transparent; padding: 7px 12px; }
.source-state button:hover { border-color: white; }
.source-state button:disabled { opacity: .5; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #8190a8; box-shadow: 0 0 0 4px #ffffff12; }
.status-dot.ok { background: #45d69a; }.status-dot.warn { background: #ffb84d; }.status-dot.bad { background: #ff6b6b; }

main { width: min(1180px, 90vw); margin: 0 auto; }
.hero { min-height: 350px; display: grid; grid-template-columns: 1.5fr .7fr; gap: 7vw; align-items: center; border-bottom: 1px solid #cdd5dc; }
.eyebrow { color: var(--orange); letter-spacing: .18em; font: 700 11px Manrope; margin: 0 0 14px; }
.hero h1 { margin: 0; font-size: clamp(42px, 6vw, 72px); line-height: .98; letter-spacing: -.045em; font-weight: 600; }
.hero h1 em { color: var(--orange); font-style: normal; }
.hero-copy { max-width: 660px; color: var(--muted); font-size: 17px; line-height: 1.65; margin: 24px 0 0; }
.hero-card { background: var(--navy); color: white; padding: 28px; border-radius: 3px; box-shadow: 12px 12px 0 #f26a2e22; }
.hero-card > span, .hero-card small { display: block; color: #aebbd1; font-size: 12px; }
.hero-card > strong { display: block; font: 700 68px/1 Manrope; margin: 12px 0 6px; }
.hero-meter { height: 5px; background: #ffffff1f; margin: 26px 0 12px; overflow: hidden; }
.hero-meter span { display: block; height: 100%; background: var(--orange); }
.hero-card p { margin: 0; color: #c7d0df; font-size: 13px; }.hero-card p b { color: white; }

.toolbar { display: grid; grid-template-columns: 1fr 170px 190px auto; gap: 10px; padding: 28px 0 18px; }
.search-box { height: 48px; display: flex; align-items: center; gap: 10px; background: var(--white); border: 1px solid var(--line); padding: 0 15px; }
.search-box span { font-size: 24px; color: var(--orange); }.search-box input { width: 100%; border: 0; outline: 0; background: transparent; }
select, .clear-button { border: 1px solid var(--line); background: var(--white); color: var(--ink); padding: 0 12px; border-radius: 0; }
.clear-button { background: transparent; }

.summary-strip { display: grid; grid-template-columns: 130px 130px 130px 1fr; gap: 18px; align-items: center; padding: 12px 0 30px; }
.summary-strip > div { display: flex; gap: 8px; align-items: baseline; }.summary-strip small { color: var(--muted); }
.summary-number { font: 700 25px Manrope; }.summary-number.high { color: var(--green); }.summary-number.review { color: var(--amber); }
.summary-strip p { justify-self: end; color: var(--muted); font-size: 12px; margin: 0; }

.results-head { display: flex; justify-content: space-between; align-items: end; margin: 20px 0 16px; }
.results-head h2 { margin: 0; font-size: 28px; }.results-head > span { color: var(--muted); font-size: 12px; }
.project-list { display: grid; gap: 10px; }
.project-card { display: grid; grid-template-columns: 86px 1fr 170px; background: var(--white); border: 1px solid var(--line); min-height: 166px; transition: transform .15s, border-color .15s; outline: none; }
.project-card:hover, .project-card:focus { transform: translateY(-2px); border-color: #9ca9b6; }
.score { display: grid; place-content: center; text-align: center; color: white; background: #526176; }
.score strong { font: 700 26px Manrope; }.score span { font: 700 9px Manrope; letter-spacing: .18em; opacity: .65; }
.score-high { background: var(--green); }.score-review { background: var(--amber); }
.project-main { padding: 23px 26px; border-right: 1px solid var(--line); }
.project-meta { display: flex; gap: 7px; align-items: center; margin-bottom: 10px; }
.project-meta > span { color: var(--muted); font-size: 10px; border: 1px solid var(--line); padding: 3px 7px; }
.fit-pill { color: white !important; border: 0 !important; font-weight: 600; }.fit-pill.high { background: var(--green); }.fit-pill.review { background: var(--amber); }.fit-pill.low { background: #68778b; }
.project-main h3 { margin: 0; font-size: 18px; line-height: 1.45; }.project-main > p { color: var(--muted); margin: 6px 0 12px; font-size: 13px; }
.project-note { border-left: 2px solid var(--orange); padding-left: 9px; color: #606b7d; font-size: 12px; }
.project-aside { display: flex; flex-direction: column; align-items: end; padding: 24px 20px; }
.project-aside > span, .project-aside small { color: var(--muted); font-size: 11px; }.project-aside strong { font: 700 22px Manrope; margin-top: 8px; }
.deadline { margin-top: auto; color: #a9451a; font-size: 12px; background: #f26a2e12; padding: 6px 9px; }
.empty { padding: 60px; border: 1px dashed #adb7c1; text-align: center; color: var(--muted); }.empty strong, .empty span { display: block; }.empty strong { color: var(--ink); font-size: 20px; margin-bottom: 5px; }

dialog { width: min(760px, 92vw); border: 0; padding: 38px 42px; color: var(--ink); background: var(--white); box-shadow: 0 30px 90px #07132c66; }
dialog::backdrop { background: #07132cb8; backdrop-filter: blur(3px); }
.dialog-close { position: absolute; right: 18px; top: 14px; border: 0; background: transparent; font-size: 30px; color: var(--muted); }
.dialog-fit { display: flex; align-items: center; gap: 10px; }.dialog-fit span { padding: 5px 9px; font-size: 11px; }.dialog-fit b { font: 700 13px Manrope; }
dialog h2 { font-size: 28px; line-height: 1.35; margin: 18px 0 4px; }.dialog-agency { color: var(--muted); margin-top: 0; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin: 24px 0; }
.detail-grid div { background: var(--white); padding: 15px; }.detail-grid span, .decision-box > span { display: block; color: var(--muted); font-size: 11px; }.detail-grid strong { display: block; margin-top: 4px; }
.decision-box { background: #f2ede3; padding: 20px; border-left: 4px solid var(--orange); }.decision-box p { margin: 8px 0 0; line-height: 1.65; }
.checklist h3 { font-size: 15px; margin: 24px 0 8px; }.checklist ul { color: var(--muted); line-height: 1.8; padding-left: 21px; }
.source-link { display: inline-block; color: white; background: var(--navy); text-decoration: none; padding: 11px 16px; margin-top: 5px; }
footer { width: min(1180px, 90vw); margin: 50px auto 0; border-top: 1px solid #ccd3d8; padding: 25px 0 40px; color: var(--muted); font-size: 11px; }

@media (max-width: 800px) {
  .topbar { padding: 0 4vw; }.source-state span:nth-child(2) { display: none; }
  main { width: 92vw; }.hero { grid-template-columns: 1fr; padding: 50px 0; }.hero-card { display: none; }
  .toolbar { grid-template-columns: 1fr 1fr; }.search-box { grid-column: 1 / -1; }
  .summary-strip { grid-template-columns: repeat(3, 1fr); }.summary-strip p { display: none; }
  .results-head > span { display: none; }
  .project-card { grid-template-columns: 58px 1fr; }.project-aside { grid-column: 2; flex-direction: row; align-items: baseline; gap: 6px; border-top: 1px solid var(--line); padding: 12px 18px; }.project-aside .deadline { margin: 0 0 0 auto; }
  .project-main { border-right: 0; padding: 18px; }.project-note { display: none; }
  dialog { padding: 32px 24px; }.detail-grid { grid-template-columns: 1fr; }
}
