:root {
  --navy-900: #0e1c46;
  --navy: #16255c;
  --navy-700: #1d2f6e;
  --gold: #b8912f;
  --gold-2: #caa445;
  --gold-soft: #e7d9b0;
  --ink: #20262f;
  --muted: #647084;
  --line: #dfe5f0;
  --paper: #f5f7fb;
  --serif: 'Bai Jamjuree', 'Sarabun', sans-serif;
  --sans: 'Sarabun', system-ui, sans-serif;
}

* { box-sizing: border-box; }
.downloads-page {
  min-height: 100vh; margin: 0; color: var(--ink); font-family: var(--sans); line-height: 1.6;
  background: radial-gradient(circle at 88% 9%, rgba(184,145,47,.09), transparent 28rem), var(--paper);
}
.downloads-page a { text-decoration: none; }
.downloads-page svg { display: block; }
.downloads-page .nav .wrap, .downloads-page .ubar .wrap { max-width: 1180px; }
.downloads-main { max-width: 1120px; margin: 0 auto; padding: 30px 20px 64px; }

.head {
  position: relative; overflow: hidden; min-height: 230px; padding: 40px 44px;
  display: flex; align-items: center; justify-content: space-between; gap: 34px;
  border: 1px solid rgba(184,145,47,.42); border-radius: 24px;
  background: linear-gradient(118deg, #0e1c46 0%, #183477 72%, #24438a 100%);
  box-shadow: 0 18px 44px rgba(14,28,70,.16); color: #fff;
}
.head::before {
  content: ""; position: absolute; width: 280px; height: 280px; right: -70px; top: -110px;
  border: 56px solid rgba(202,164,69,.12); border-radius: 50%; pointer-events: none;
}
.head-copy, .head-visual { position: relative; z-index: 1; }
.head-copy { max-width: 650px; }
.head .kk {
  display: inline-flex; align-items: center; gap: 9px; color: #e4c978;
  font-size: 13px; font-weight: 700; letter-spacing: .04em;
}
.head .kk::before { content: ""; width: 28px; height: 2px; background: var(--gold-2); }
.head h1 { margin: 9px 0 8px; color: #fff; font: 800 clamp(29px,4vw,43px)/1.16 var(--serif); }
.head p { max-width: 620px; margin: 0; color: rgba(255,255,255,.76); font-size: 15px; font-weight: 400; }
.head-visual { width: 190px; height: 136px; flex: 0 0 190px; }
.visual-doc {
  position: absolute; width: 98px; height: 124px; display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.35); border-radius: 12px; box-shadow: 0 18px 30px rgba(0,0,0,.14);
}
.visual-doc.back { left: 8px; top: 9px; transform: rotate(-8deg); background: rgba(255,255,255,.12); color: #e4c978; }
.visual-doc.back b { margin-top: 65px; font-size: 13px; letter-spacing: .08em; }
.visual-doc.front { right: 8px; top: 0; transform: rotate(7deg); background: #fff; color: var(--navy-700); }
.visual-doc.front svg { width: 43px; height: 43px; }

.download-workspace { margin-top: 20px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 8px 26px rgba(15,32,74,.05); }
.note {
  margin: 0 0 16px; padding: 13px 15px; display: flex; align-items: center; gap: 10px;
  border: 1px solid #ead9a8; border-left: 4px solid var(--gold); border-radius: 10px;
  background: #fffaf0; color: #705b1a; font-size: 14px;
}
.note .ic { width: 20px; height: 20px; flex: none; }
.download-tools { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; }
.searchbox {
  min-height: 54px; margin: 0; padding: 0 14px; display: flex; align-items: center; gap: 11px;
  border: 1px solid var(--line); border-radius: 13px; background: #fff; transition: .16s;
}
.searchbox:focus-within { border-color: var(--navy-700); box-shadow: 0 0 0 4px rgba(29,47,110,.12); }
.searchbox svg { width: 20px; height: 20px; flex: none; color: #667287; }
.searchbox input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 14.5px var(--sans); }
.searchbox input::placeholder { color: #95a0b1; }
.search-hint { padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; color: #8a95a7; font-size: 11px; }
.result-count {
  min-width: 100px; min-height: 54px; padding: 8px 17px; display: flex; align-items: baseline; justify-content: center; gap: 6px;
  border-radius: 13px; background: #eef3ff; color: var(--navy-700);
}
.result-count span { font: 800 23px/1 var(--serif); }
.result-count small { font-size: 12px; font-weight: 700; }
.category-row { margin: 17px 0 18px; padding-bottom: 16px; display: flex; align-items: flex-start; gap: 15px; border-bottom: 1px solid #e8ecf3; }
.category-row > span { padding-top: 7px; color: #6d788b; font-size: 12.5px; font-weight: 700; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; color: #536075; font: 700 13px var(--sans); cursor: pointer; transition: .15s;
}
.chip:hover { border-color: var(--gold); color: var(--navy-700); }
.chip.active { border-color: var(--navy-700); background: var(--navy-700); color: #fff; }

.dlist { display: grid; gap: 12px; }
.doc {
  display: flex; align-items: center; gap: 18px; padding: 18px;
  border: 1px solid var(--line); border-radius: 14px; background: #fff;
  transition: border-color .16s, box-shadow .16s, transform .16s;
}
.doc:hover { border-color: rgba(184,145,47,.56); box-shadow: 0 10px 26px rgba(15,32,74,.08); transform: translateY(-1px); }
.doc .fi {
  position: relative; overflow: hidden; width: 58px; height: 68px; flex: none;
  display: flex; align-items: flex-end; justify-content: center;
  border: 1px solid #d8e0ed; border-radius: 8px; background: linear-gradient(160deg,#f8faff,#edf2fb);
}
.doc .fi::before { content: ""; position: absolute; top: 0; right: 0; border-width: 0 16px 16px 0; border-style: solid; border-color: #fff #cfd9e9; }
.doc .fi .x { margin-bottom: 9px; color: var(--navy-700); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.doc .di { flex: 1; min-width: 0; }
.doc .dt { color: var(--navy-900); font: 700 17px/1.4 var(--serif); }
.doc .dd { margin-top: 3px; color: var(--muted); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.doc .dm { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; color: #8792a4; font-size: 12px; }
.doc .dm .tag { padding: 3px 9px; border-radius: 999px; background: #eef3ff; color: var(--navy-700); font-weight: 700; }
.doc .da { flex: none; }
.btn {
  min-height: 42px; padding: 0 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px; font: 700 13.5px var(--sans); cursor: pointer;
}
.btn .ic { width: 17px; height: 17px; }
.btn.gold { border-color: var(--gold-2); background: var(--gold-2); color: var(--navy-900); }
.btn.gold:hover { background: #d6b65d; }
.btn.outline { border-color: #cbd5e5; background: #fff; color: var(--navy-700); }
.btn.outline:hover { border-color: var(--navy-700); background: #f4f7fd; }

.empty {
  min-height: 300px; padding: 48px 24px; display: grid; place-items: center; align-content: center; text-align: center;
  border: 1px solid var(--line); border-radius: 14px; background: #fbfcfe; color: var(--muted);
}
.empty-icon { width: 66px; height: 66px; display: grid; place-items: center; border: 1px solid #dbe5fb; border-radius: 19px; background: #eef3ff; color: var(--navy-700); }
.empty-icon svg { width: 31px; height: 31px; }
.empty h2 { margin: 17px 0 5px; color: var(--navy-900); font: 800 21px/1.35 var(--serif); }
.empty p { max-width: 470px; margin: 0; color: var(--muted); font-size: 14px; }
.empty .clear-search { margin-top: 18px; }
.sk { height: 100px; border-radius: 12px; background: linear-gradient(90deg,#eef1f7 25%,#e3e8f2 37%,#eef1f7 63%); background-size: 400% 100%; animation: sh 1.3s infinite; }
@keyframes sh { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

footer.ft {
  margin: 0; padding: 23px max(24px, calc((100vw - 1080px) / 2)); display: flex; justify-content: space-between; gap: 20px;
  background: var(--navy-900); color: rgba(255,255,255,.64); font-size: 13px;
}
.ft-links { display: flex; gap: 18px; }
.ft a { color: inherit; }
.ft a:hover { color: var(--gold-2); }

@media (max-width: 760px) {
  .downloads-main { padding: 16px 12px 48px; }
  .head { min-height: 0; padding: 28px 24px; border-radius: 18px; }
  .head-visual { display: none; }
  .head p { font-size: 14px; }
  .download-workspace { padding: 13px; border-radius: 16px; }
  .download-tools { grid-template-columns: 1fr; }
  .result-count { justify-content: flex-start; }
  .category-row { flex-direction: column; gap: 8px; }
  .category-row > span { padding-top: 0; }
  .doc { align-items: flex-start; flex-wrap: wrap; padding: 15px; }
  .doc .fi { width: 50px; height: 60px; }
  .doc .da { width: 100%; }
  .doc .da .btn { width: 100%; }
  footer.ft { align-items: center; flex-direction: column; text-align: center; }
}

@media (max-width: 420px) {
  .head { padding: 25px 21px; }
  .head h1 { font-size: 29px; }
  .search-hint { display: none; }
  .note { align-items: flex-start; }
}
