/* คู่มือ WastePRO — the colours of the WastePRO mark (navy, sky, green) with the amber the videos point with. */
:root {
  --paper: #f5f7f6;
  --surface: #ffffff;
  --sunk: #edf2f0;
  --ink: #142033;
  --navy: #18285b;
  --muted: #5d6b72;
  --line: #dde5e2;
  --brand: #12936f;
  --brand-ink: #0b6a50;
  --brand-soft: #e2f4ed;
  --sky: #2f8fbd;
  --amber: #f59e0b;
  --amber-soft: #fff4dc;
  --amber-ink: #8a5300;
  --done: #12936f;
  --shadow: 0 1px 2px rgba(20, 32, 51, 0.06), 0 8px 24px rgba(20, 32, 51, 0.06);
  --bezel: #10161f;
  --chrome: #e9eef0;
  --font-display: 'Prompt', 'IBM Plex Sans Thai', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans Thai', 'Prompt', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --nav-w: 330px;
  --top-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #0d1418;
    --surface: #141d23;
    --sunk: #1a252c;
    --ink: #e6edf0;
    --navy: #c8d6ff;
    --muted: #9aaab2;
    --line: #26343c;
    --brand: #3cc79e;
    --brand-ink: #7fe0c1;
    --brand-soft: #143a30;
    --sky: #6cc0e6;
    --amber: #fbbf24;
    --amber-soft: #3a2c10;
    --amber-ink: #fcd58a;
    --done: #3cc79e;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    --bezel: #05080b;
    --chrome: #1f2a31;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --paper: #0d1418;
  --surface: #141d23;
  --sunk: #1a252c;
  --ink: #e6edf0;
  --navy: #c8d6ff;
  --muted: #9aaab2;
  --line: #26343c;
  --brand: #3cc79e;
  --brand-ink: #7fe0c1;
  --brand-soft: #143a30;
  --sky: #6cc0e6;
  --amber: #fbbf24;
  --amber-soft: #3a2c10;
  --amber-ink: #fcd58a;
  --done: #3cc79e;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  --bezel: #05080b;
  --chrome: #1f2a31;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
html {
  scroll-padding-top: calc(var(--top-h) + 12px);
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--navy);
  text-wrap: balance;
  margin: 0;
}
button {
  font: inherit;
  color: inherit;
}
a {
  color: inherit;
}
:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
  border-radius: 6px;
}
.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 50;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: 8px;
}
.skip:focus {
  left: 8px;
}

/* ---------- the bar on top ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--top-h);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex: none;
  width: calc(var(--nav-w) - 40px);
}
.brand img {
  border-radius: 9px;
  box-shadow: 0 0 0 1px var(--line);
}
.brand-text {
  display: grid;
  line-height: 1.15;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--navy);
}
.brand-sub {
  font-size: 12.5px;
  color: var(--muted);
}
.search {
  flex: 1;
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.search svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  flex: none;
}
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
}
.menu-btn {
  display: none;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-family: var(--font-display);
  font-weight: 500;
}

/* ---------- the frame ---------- */
.shell {
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0, 1fr);
  min-height: calc(100vh - var(--top-h));
}
.nav {
  position: sticky;
  top: var(--top-h);
  height: calc(100vh - var(--top-h));
  overflow-y: auto;
  padding: 16px 14px 40px 16px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  overscroll-behavior: contain;
}
.main {
  min-width: 0;
  padding: 28px clamp(16px, 3vw, 44px) 64px;
  outline: none;
}

/* the roles to show */
.roles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 13px;
  cursor: pointer;
  color: var(--muted);
  white-space: nowrap;
}
.chip:hover {
  border-color: var(--brand);
  color: var(--ink);
}
.chip[aria-pressed='true'] {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--surface);
}
.progress {
  margin: 14px 2px 6px;
  font-size: 13px;
  color: var(--muted);
}
.progress-bar {
  height: 6px;
  margin-top: 6px;
  border-radius: 99px;
  background: var(--sunk);
  overflow: hidden;
}
.progress-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--sky), var(--brand));
  border-radius: 99px;
  transition: width 0.4s;
}

/* chapters and lessons */
.chapters {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.chapter > button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.chapter > button:hover {
  background: var(--sunk);
}
.ch-num {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font: 600 13px var(--font-display);
  background: var(--brand-soft);
  color: var(--brand-ink);
}
.ch-title {
  flex: 1;
  font: 600 14.5px/1.3 var(--font-display);
  color: var(--navy);
}
.ch-count {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.chapter ol {
  list-style: none;
  margin: 2px 0 8px 22px;
  padding: 0 0 0 12px;
  border-left: 1px solid var(--line);
  display: grid;
  gap: 1px;
}
.chapter[data-open='false'] ol {
  display: none;
}
.lesson-link {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.35;
  color: var(--ink);
}
.lesson-link:hover {
  background: var(--sunk);
}
.lesson-link[aria-current='page'] {
  background: var(--amber-soft);
  color: var(--amber-ink);
  font-weight: 600;
}
.lesson-link .dur {
  font: 500 11.5px var(--font-mono);
  color: var(--muted);
}
.lesson-link svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  opacity: 0.6;
}
.lesson-link.watched svg.dev {
  display: none;
}
.lesson-link .tick {
  display: none;
  color: var(--done);
  opacity: 1;
  stroke-width: 2.6;
}
.lesson-link.watched .tick {
  display: block;
}
.empty-note {
  padding: 18px 8px;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- home ---------- */
.home {
  max-width: 1080px;
}
.kicker {
  margin: 0 0 6px;
  font: 600 13px var(--font-display);
  letter-spacing: 0.06em;
  color: var(--brand-ink);
}
.home h1 {
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.2;
}
.lead {
  max-width: 68ch;
  color: var(--muted);
  font-size: 17px;
  margin: 12px 0 18px;
}
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: 0 0 30px;
}
.stat {
  display: grid;
}
.stat b {
  font: 700 26px/1.1 var(--font-display);
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.stat span {
  font-size: 13px;
  color: var(--muted);
}
.flow-title {
  font-size: 18px;
  margin: 10px 0 12px;
}
.flow {
  list-style: none;
  margin: 0 0 30px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 10px;
  counter-reset: flow;
}
.flow li {
  display: contents;
}
.flow a {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 14px 16px 14px 56px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, transform 0.2s;
}
.flow a:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
}
.flow .n {
  position: absolute;
  left: 14px;
  top: 14px;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font: 700 14px var(--font-display);
  color: #fff;
  background: linear-gradient(135deg, var(--navy), var(--sky) 70%, var(--brand));
}
:root[data-theme='dark'] .flow .n {
  color: #0d1418;
}
.flow .t {
  font: 600 15.5px/1.3 var(--font-display);
  color: var(--navy);
}
.flow .s {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.45;
}
.flow .m {
  font-size: 12px;
  color: var(--brand-ink);
  font-weight: 500;
}
.role-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.role-cards .chip {
  font-size: 14px;
  padding: 7px 14px;
}

/* ---------- a lesson ---------- */
.crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 6px;
}
.crumb a {
  text-decoration: none;
}
.crumb a:hover {
  color: var(--brand-ink);
  text-decoration: underline;
}
.lesson h1 {
  font-size: clamp(24px, 2.6vw, 32px);
  line-height: 1.25;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 10px 0 6px;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  background: var(--sunk);
  color: var(--muted);
}
.tag.role {
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-weight: 500;
}
.tag svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}
.summary {
  max-width: 75ch;
  color: var(--muted);
  margin: 0 0 18px;
}
.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 22px;
  align-items: start;
}
.stage.phone {
  grid-template-columns: auto minmax(280px, 1fr);
  justify-content: start;
}
.player {
  min-width: 0;
}

/* a computer: a browser window */
.screen {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line), var(--shadow);
}
.screen-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 36px;
  padding: 0 14px;
  background: var(--chrome);
  border-bottom: 1px solid var(--line);
}
.dots {
  display: flex;
  gap: 6px;
}
.dots i {
  width: 10px;
  height: 10px;
  border-radius: 99px;
  background: #ff5f57;
}
.dots i:nth-child(2) {
  background: #febc2e;
}
.dots i:nth-child(3) {
  background: #28c840;
}
.url {
  flex: 1;
  max-width: 520px;
  height: 22px;
  margin: 0 auto;
  border-radius: 6px;
  background: var(--surface);
  font: 500 12px/22px var(--font-mono);
  color: var(--muted);
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 0 10px;
}
.screen video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #0b1014;
  cursor: pointer;
}

/* a phone */
.handset {
  position: relative;
  width: min(330px, 78vw);
  padding: 12px;
  border-radius: 46px;
  background: var(--bezel);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06) inset, var(--shadow);
}
.handset::before {
  content: '';
  position: absolute;
  z-index: 2;
  top: 20px;
  left: 50%;
  width: 92px;
  height: 24px;
  margin-left: -46px;
  border-radius: 99px;
  background: var(--bezel);
}
.handset video {
  display: block;
  width: 100%;
  aspect-ratio: 390 / 844;
  border-radius: 34px;
  background: #0b1014;
  cursor: pointer;
}

/* the play button over a video that has not started */
.big-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.big-play span {
  width: 76px;
  height: 76px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(24, 40, 91, 0.86);
  box-shadow: 0 10px 30px rgba(20, 32, 51, 0.35);
  transition: transform 0.2s;
}
.big-play:hover span {
  transform: scale(1.06);
}
.big-play svg {
  width: 30px;
  height: 30px;
  margin-left: 4px;
  fill: #fff;
}
.big-play[hidden] {
  display: none;
}

/* the controls under the video */
.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.ctl {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.ctl:hover {
  border-color: var(--brand);
}
.ctl svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.ctl.stroke svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.time {
  flex: none;
  font: 500 12.5px var(--font-mono);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 92px;
  text-align: center;
}
.track {
  position: relative;
  flex: 1;
  height: 38px;
  cursor: pointer;
  touch-action: none;
}
.track-bg,
.track-fill {
  position: absolute;
  left: 0;
  top: 17px;
  height: 5px;
  border-radius: 99px;
}
.track-bg {
  right: 0;
  background: var(--sunk);
}
.track-fill {
  width: 0;
  background: var(--brand);
}
.track-knob {
  position: absolute;
  top: 12px;
  width: 15px;
  height: 15px;
  margin-left: -7.5px;
  border-radius: 99px;
  background: var(--surface);
  border: 3px solid var(--brand);
  left: 0;
}
.tick-mark {
  position: absolute;
  top: 13px;
  width: 3px;
  height: 13px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--muted);
  opacity: 0.45;
}
.speed {
  flex: none;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 0 8px;
  font: 500 13px var(--font-mono);
  cursor: pointer;
}

/* the steps beside the video */
.steps {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}
.steps-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.steps-head h2 {
  font-size: 15px;
}
.steps-head span {
  font-size: 12.5px;
  color: var(--muted);
}
.steps ol {
  list-style: none;
  margin: 0;
  padding: 6px;
  display: grid;
  gap: 2px;
  max-height: min(62vh, 560px);
  overflow-y: auto;
}
.stage.phone .steps ol {
  max-height: min(70vh, 640px);
}
.step {
  width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.step:hover {
  background: var(--sunk);
}
.step .no {
  width: 26px;
  height: 26px;
  border-radius: 99px;
  display: grid;
  place-items: center;
  font: 600 12.5px var(--font-display);
  border: 1.5px solid var(--line);
  color: var(--muted);
}
.step .tt {
  display: grid;
  gap: 1px;
}
.step .tt b {
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1.4;
  color: var(--ink);
}
.step .tt small {
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}
.step .at {
  font: 500 11.5px var(--font-mono);
  color: var(--muted);
  padding-top: 4px;
}
.step.past .no {
  border-color: var(--brand);
  color: var(--brand-ink);
}
.step.now {
  background: var(--amber-soft);
}
.step.now .no {
  background: var(--amber);
  border-color: var(--amber);
  color: #1c1917;
}
.step.now .tt b {
  color: var(--amber-ink);
}

/* tips and the way on */
.below {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: start;
  margin-top: 22px;
}
.tips {
  max-width: 75ch;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--brand-soft);
}
.tips h2 {
  font-size: 15px;
  color: var(--brand-ink);
  margin-bottom: 4px;
}
.tips ul {
  margin: 0;
  padding-left: 20px;
}
.tips li {
  margin: 3px 0;
  font-size: 14.5px;
}
.pager {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.pager a {
  display: grid;
  gap: 1px;
  min-width: 200px;
  max-width: 280px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-decoration: none;
}
.pager a:hover {
  border-color: var(--brand);
}
.pager small {
  font-size: 12px;
  color: var(--muted);
}
.pager b {
  font: 600 14px/1.35 var(--font-display);
  color: var(--navy);
}
.pager a.next {
  text-align: right;
}
.keys {
  margin-top: 26px;
  font-size: 12.5px;
  color: var(--muted);
}
kbd {
  font: 500 11px var(--font-mono);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 5px;
  background: var(--surface);
}

/* ---------- narrower screens ---------- */
@media (max-width: 1280px) {
  .stage:not(.phone) {
    grid-template-columns: minmax(0, 1fr);
  }
  .stage:not(.phone) .steps ol {
    max-height: none;
  }
}
@media (max-width: 1023px) {
  :root {
    --nav-w: min(360px, 88vw);
  }
  .brand {
    width: auto;
  }
  .menu-btn {
    display: block;
  }
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .nav {
    position: fixed;
    z-index: 40;
    left: 0;
    top: var(--top-h);
    width: var(--nav-w);
    transform: translateX(-100%);
    transition: transform 0.25s;
    box-shadow: var(--shadow);
  }
  .nav.open {
    transform: none;
  }
}
@media (max-width: 760px) {
  .top {
    gap: 10px;
    padding: 0 12px;
  }
  .brand-sub {
    display: none;
  }
  .search {
    height: 38px;
  }
  .main {
    padding: 20px 16px 48px;
  }
  .stage.phone {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
  }
  .stage.phone .steps {
    width: 100%;
  }
  .below {
    grid-template-columns: minmax(0, 1fr);
  }
  .pager a {
    min-width: 0;
    flex: 1;
  }
  .time {
    min-width: 0;
  }
  .keys {
    display: none;
  }
}
@media (max-width: 560px) {
  .brand-name {
    font-size: 15px;
  }
  .search input::placeholder {
    font-size: 13px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
