/* Logistra 2.0 documentation
   Route navigation (chapters are stops), a truck that follows the reading progress,
   chapter heads styled like shipment cards. Sarabun = the theme's own font. */
@font-face { font-family: "Sarabun"; font-weight: 400; font-style: normal; font-display: swap; src: url(fonts/sarabun-400-normal-latin.woff2) format("woff2"); }
@font-face { font-family: "Sarabun"; font-weight: 600; font-style: normal; font-display: swap; src: url(fonts/sarabun-600-normal-latin.woff2) format("woff2"); }
@font-face { font-family: "Sarabun"; font-weight: 700; font-style: normal; font-display: swap; src: url(fonts/sarabun-700-normal-latin.woff2) format("woff2"); }
@font-face { font-family: "Sarabun"; font-weight: 800; font-style: normal; font-display: swap; src: url(fonts/sarabun-800-normal-latin.woff2) format("woff2"); }

:root {
  --red: #d70006;
  --red-dark: #b00005;
  --red-tint: #fdeced;
  --navy: #00002f;
  --navy-2: #0e104b;
  --ink: #151515;
  --text: #45475a;
  --muted: #6c7084;
  --line: #e3e6ee;
  --bg: #f5f6fa;
  --paper: #ffffff;
  --blue: #1f5fbf;
  --blue-tint: #e9f0fb;
  --amber: #8a5300;
  --amber-tint: #fff3df;
  --green: #1a7f37;
  --green-tint: #e8f5ec;
  --top: 64px;
  --rail: 290px;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top) + 20px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16.5px/1.7 "Sarabun", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
img { max-width: 100%; height: auto; }
a { color: var(--red); text-underline-offset: 3px; }
a:hover { color: var(--red-dark); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; margin: 0; }
.d-skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 6px; }
.d-skip:focus { left: 12px; }

/* Top bar */
.d-top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px;
  height: var(--top); padding: 0 24px;
  background: var(--paper); border-bottom: 1px solid var(--line);
}
.d-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); flex: none; }
.d-brand svg { width: 112px; height: auto; display: block; }
.d-brand__tag { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--red); background: var(--red-tint); border-radius: 100px; padding: 3px 10px; }
.d-search { position: relative; flex: 1; max-width: 520px; margin-left: auto; }
.d-search input {
  width: 100%; height: 42px; padding: 0 74px 0 40px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
  font: inherit; font-size: 15px; color: var(--ink); outline: none;
}
.d-search input:focus { border-color: var(--red); background: #fff; }
.d-search > svg { position: absolute; left: 13px; top: 12px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.d-search kbd { position: absolute; right: 10px; top: 10px; font: 600 11px/20px var(--mono); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; background: #fff; }
.d-results {
  position: absolute; left: 0; right: 0; top: 48px; z-index: 50;
  max-height: 60vh; overflow: auto; margin: 0; padding: 6px; list-style: none;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 50px rgba(0, 0, 47, .14);
}
.d-results[hidden] { display: none; }
.d-results a { display: block; padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 600; line-height: 1.35; }
.d-results a small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }
.d-results a:hover, .d-results a[aria-selected="true"] { background: var(--red-tint); }
.d-results__none { padding: 10px 12px; color: var(--muted); }
.d-links { display: flex; gap: 6px; flex: none; }
.d-links a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 15px; }
.d-links a:hover { background: var(--bg); color: var(--red); }
.d-links a.d-links__cta { background: var(--red); color: #fff; }
.d-links a.d-links__cta:hover { background: var(--red-dark); color: #fff; }
.d-menu-btn { display: none; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; }
.d-menu-btn svg { width: 18px; height: 18px; }

/* Reading progress: a truck on the route */
/* the truck drives on the line: wheels on the bar, body over the header's bottom edge */
.d-progress { position: sticky; top: var(--top); z-index: 45; height: 3px; background: #eceef4; }
.d-progress__bar { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--red); }
.d-progress__truck { position: absolute; left: 0; bottom: 1px; width: 30px; height: 18px; color: var(--red); pointer-events: none; }
.d-progress__truck svg { display: block; width: 30px; height: 18px; }

/* Shell */
.d-shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); max-width: 1440px; margin: 0 auto; }
.d-route {
  position: sticky; top: calc(var(--top) + 4px); align-self: start;
  height: calc(100vh - var(--top) - 4px); overflow-y: auto;
  padding: 28px 18px 40px 26px; border-right: 1px solid var(--line); background: var(--paper);
}
.d-route__title { margin: 0 0 16px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.d-route ol { list-style: none; margin: 0; padding: 0; }
.d-stop { position: relative; padding-bottom: 4px; }
.d-stop::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: -4px; border-left: 2px dashed #d6d9e3; }
.d-stop:last-child::before { display: none; }
.d-stop > a { position: relative; display: flex; align-items: center; gap: 12px; padding: 4px 0; text-decoration: none; color: var(--ink); font-weight: 700; line-height: 1.3; }
.d-stop__dot { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 2px solid #d6d9e3; color: var(--muted); font: 700 11px/1 var(--mono); }
.d-stop.is-done .d-stop__dot { border-color: var(--red); color: var(--red); }
.d-stop.is-done::before { border-left-style: solid; border-left-color: var(--red); }
.d-stop.is-active .d-stop__dot { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 0 0 5px var(--red-tint); }
.d-stop.is-active > a { color: var(--red); }
.d-sub { display: none; margin: 4px 0 10px 40px !important; }
.d-stop.is-active .d-sub, .d-route.is-searching .d-sub { display: block; }
.d-sub a { display: block; padding: 3px 0 3px 12px; border-left: 2px solid var(--line); text-decoration: none; color: var(--muted); font-size: 14.5px; line-height: 1.4; }
.d-sub a:hover { color: var(--ink); }
.d-sub a.is-current { color: var(--red); border-left-color: var(--red); font-weight: 600; }

/* Main */
.d-main { min-width: 0; padding: 36px 48px 80px; }
.d-wrap { max-width: 920px; }

/* Hero: a split box like the theme's Track & Trace card */
.d-hero { display: grid; grid-template-columns: 1.15fr 1fr; overflow: hidden; border-radius: 16px; box-shadow: 0 22px 50px -30px rgba(0, 0, 47, .45); margin-bottom: 56px; }
.d-hero__info { background: var(--red-tint); padding: 34px 34px 30px; }
.d-hero__eyebrow { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.d-hero__badge { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 10px; background: var(--red); color: #fff; font: 800 15px/1 "Sarabun"; text-align: center; }
.d-hero__badge small { display: block; font-size: 8px; letter-spacing: .06em; font-weight: 700; }
.d-hero__eyebrow b { color: var(--red); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.d-hero h1 { font-size: 36px; font-weight: 800; letter-spacing: -.01em; }
.d-hero__info p { margin: 12px 0 18px; }
.d-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.d-chips li { padding: 4px 12px; border-radius: 100px; background: #fff; border: 1px solid #f3cfd1; color: var(--ink); font-size: 14px; font-weight: 600; }
.d-hero__go { background: var(--red); color: #fff; padding: 34px 32px 30px; }
.d-hero__go h2 { color: #fff; font-size: 22px; display: flex; align-items: center; gap: 10px; }
.d-hero__go h2 svg { width: 22px; height: 22px; }
.d-hero__go ol { list-style: none; margin: 16px 0 0; padding: 0; counter-reset: go; }
.d-hero__go li { counter-increment: go; }
.d-hero__go a { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid rgba(255, 255, 255, .22); color: #fff; text-decoration: none; font-weight: 600; }
.d-hero__go li:last-child a { border-bottom: 0; }
.d-hero__go a::before { content: counter(go, decimal-leading-zero); font: 700 12px/1 var(--mono); opacity: .75; }
.d-hero__go a::after { content: "→"; margin-left: auto; transition: transform .2s; }
.d-hero__go a:hover::after { transform: translateX(4px); }

/* Chapters */
.d-chapter { margin-bottom: 72px; }
.d-chapter__head {
  position: relative; margin-bottom: 30px; padding: 26px 30px 24px 30px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  border-left: 6px solid var(--red);
}
.d-chapter__stop { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 6px; font: 700 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--red); }
.d-chapter__stop::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px var(--red-tint); }
.d-chapter__head h2 { font-size: 32px; font-weight: 800; letter-spacing: -.01em; }
.d-chapter__head p { margin: 8px 0 0; font-size: 17px; }
.d-chapter h3 { margin: 40px 0 12px; font-size: 23px; font-weight: 800; }
.d-chapter h4 { margin: 26px 0 8px; font-size: 18px; font-weight: 700; }
.d-chapter p { margin: 0 0 14px; }
.d-chapter ul, .d-chapter ol { margin: 0 0 16px; padding-left: 22px; }
.d-chapter li { margin-bottom: 6px; }
.d-chapter li > ul { margin: 6px 0 0; }
.d-anchor { margin-left: 8px; color: #c3c7d4; text-decoration: none; font-weight: 400; opacity: 0; transition: opacity .2s; }
h3:hover .d-anchor, h3:focus-within .d-anchor { opacity: 1; }

/* Steps */
ol.d-steps { list-style: none; padding: 0; counter-reset: step; }
ol.d-steps > li { position: relative; counter-increment: step; padding: 0 0 18px 48px; margin: 0; }
ol.d-steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--red); color: #fff; font: 700 14px/1 "Sarabun"; }
ol.d-steps > li::after { content: ""; position: absolute; left: 14px; top: 34px; bottom: 4px; border-left: 2px dashed #f0b3b5; }
ol.d-steps > li:last-child::after { display: none; }
ol.d-steps > li > b:first-child { color: var(--ink); }

/* Inline UI paths, keys and code */
.d-path { display: inline; padding: 1px 8px; border-radius: 6px; background: #fff; border: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: .94em; white-space: normal; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.d-path i { font-style: normal; color: var(--red); padding: 0 3px; }
code { font: 600 .86em var(--mono); background: #eef0f6; color: #2a2d3e; border-radius: 5px; padding: 1px 6px; overflow-wrap: anywhere; }
.d-ui { font-weight: 700; color: var(--ink); }
pre { position: relative; margin: 0 0 18px; padding: 16px 18px; overflow-x: auto; background: var(--navy); color: #e7e9ff; border-radius: 12px; font: 500 14px/1.6 var(--mono); }
pre code { background: none; color: inherit; padding: 0; font: inherit; overflow-wrap: normal; }
.d-copy { position: absolute; top: 8px; right: 8px; padding: 4px 10px; border: 1px solid rgba(255, 255, 255, .25); border-radius: 6px; background: rgba(255, 255, 255, .08); color: #fff; font: 600 12px/1.4 "Sarabun"; cursor: pointer; }
.d-copy:hover { background: rgba(255, 255, 255, .18); }

/* Callouts */
.d-note { margin: 0 0 18px; padding: 14px 18px 14px 18px; border-radius: 12px; border: 1px solid; }
.d-note > b:first-child { display: block; margin-bottom: 2px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.d-note p:last-child, .d-note ul:last-child, .d-note ol:last-child { margin-bottom: 0; }
.d-note--tip { background: var(--blue-tint); border-color: #c9d9f3; }
.d-note--tip > b:first-child { color: var(--blue); }
.d-note--warn { background: var(--amber-tint); border-color: #f2d9ad; }
.d-note--warn > b:first-child { color: var(--amber); }
.d-note--stop { background: var(--red-tint); border-color: #f3c3c6; }
.d-note--stop > b:first-child { color: var(--red); }
.d-note--ok { background: var(--green-tint); border-color: #c4e5cf; }
.d-note--ok > b:first-child { color: var(--green); }

/* Tables */
.d-table { margin: 0 0 20px; overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.d-table table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.d-table th, .d-table td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.d-table tr:last-child td { border-bottom: 0; }
.d-table thead th { background: #f8f9fc; color: var(--ink); font-size: 13px; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.d-table td:first-child { color: var(--ink); font-weight: 700; }
.d-table td.d-def { color: var(--muted); white-space: nowrap; }

/* Screenshots */
.d-shot { margin: 6px 0 24px; }
.d-shot__frame { overflow: hidden; border-radius: 12px; border: 1px solid var(--line); background: #fff; box-shadow: 0 16px 40px -24px rgba(0, 0, 47, .35); cursor: zoom-in; }
.d-shot__frame img { display: block; width: 100%; }
.d-shot figcaption { margin-top: 8px; font-size: 14px; color: var(--muted); }
.d-shot--narrow { max-width: 520px; }
.d-shot--small { max-width: 380px; }
.d-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.d-lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: rgba(0, 0, 25, .82); cursor: zoom-out; }
.d-lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; background: #fff; }

/* Cards */
.d-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 0 0 20px; }
.d-card { padding: 16px 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.d-card h4 { margin: 0 0 4px; font-size: 16px; }
.d-card p { margin: 0; font-size: 14.5px; line-height: 1.55; }
.d-card .d-tag { float: right; margin-left: 8px; }
.d-tag { display: inline-block; padding: 1px 8px; border-radius: 100px; font-size: 12px; font-weight: 700; line-height: 1.6; background: var(--bg); color: var(--muted); }
.d-tag--req { background: var(--red-tint); color: var(--red); }
.d-tag--rec { background: var(--blue-tint); color: var(--blue); }

/* Status pills (same tones as the tracking pages) */
.d-pill { display: inline-block; padding: 1px 10px; border-radius: 100px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.d-pill--pending { background: #eef0f4; color: #4f5566; }
.d-pill--transit { background: #fbe6e7; color: var(--red); }
.d-pill--out { background: var(--blue-tint); color: var(--blue); }
.d-pill--done { background: var(--green-tint); color: var(--green); }
.d-pill--hold { background: var(--amber-tint); color: #a46200; }

/* Flow diagram for tracking */
.d-flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 6px 0 24px; padding: 0; list-style: none; counter-reset: flow; }
.d-flow li { position: relative; counter-increment: flow; padding: 16px 16px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; font-size: 14.5px; line-height: 1.5; }
.d-flow li::before { content: counter(flow); display: grid; place-items: center; width: 26px; height: 26px; margin-bottom: 8px; border-radius: 50%; background: var(--navy); color: #fff; font: 700 13px/1 "Sarabun"; }
.d-flow li b { display: block; color: var(--ink); }

.d-foot { margin-top: 30px; padding: 26px 30px; border-radius: 14px; background: var(--navy); color: #c9cbea; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.d-foot a { color: #fff; }
.d-foot strong { color: #fff; }
.d-backdrop { display: none; }

/* Responsive */
@media (max-width: 1100px) {
  .d-main { padding: 30px 30px 70px; }
  .d-links a:not(.d-links__cta) { display: none; }
}
@media (max-width: 960px) {
  :root { --top: 60px; }
  .d-shell { grid-template-columns: 1fr; }
  .d-menu-btn { display: inline-flex; }
  .d-route {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 60; width: min(340px, 88vw); height: 100vh;
    transform: translateX(-102%); transition: transform .25s ease; box-shadow: 0 0 40px rgba(0, 0, 47, .25);
  }
  .d-route.is-open { transform: none; }
  .d-backdrop.is-open { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 25, .45); }
  .d-hero { grid-template-columns: 1fr; }
  .d-cards { grid-template-columns: 1fr 1fr; }
  .d-flow { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .d-top { gap: 10px; padding: 0 12px; }
  .d-brand svg { width: 92px; }
  .d-brand__tag, .d-links { display: none; }
  .d-search kbd { display: none; }
  .d-search input { padding-right: 12px; }
  .d-menu-btn span { display: none; }
  .d-main { padding: 22px 16px 60px; }
  .d-hero__info, .d-hero__go { padding: 24px 20px; }
  .d-hero h1 { font-size: 28px; }
  .d-chapter__head { padding: 20px 18px; }
  .d-chapter__head h2 { font-size: 26px; }
  .d-chapter h3 { font-size: 20px; }
  .d-cards, .d-grid2, .d-flow { grid-template-columns: 1fr; }
  .d-table th, .d-table td { padding: 9px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .d-route, .d-hero__go a::after { transition: none; }
}
@media print {
  .d-top, .d-progress, .d-route, .d-backdrop { display: none !important; }
  .d-shell { display: block; }
  .d-main { padding: 0; }
}
