:root {
  --bg: #f5f5f7;
  --ink: #1d1d1f;
  --ink2: #424245;
  --mute: #6e6e73;
  --line: #d2d2d7;
  --hair: #e8e8ed;
  --link: #0066cc;
  --red: #c4001a;
  --red-bg: #ffe9ec;
  --red-bar: #e0102b;
  --org: #9a4a00;
  --org-bg: #fff1e0;
  --org-bar: #d96f00;
  --grn: #146c2e;
  --grn-bg: #e6f4ea;
  --grn-bar: #1f9d47;
  --gry-bg: #ececf0;
  --gry-bar: #8e8e93;
  --cols: minmax(0, 300px) minmax(0, 1fr) 200px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'IBM Plex Sans Thai Looped', -apple-system, 'Sukhumvit Set', Thonburi, 'Noto Sans Thai', sans-serif;
  font-size: 18px;
  line-height: 1.6;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid #0071e3; outline-offset: 2px; border-radius: 6px; }
main:focus { outline: none; }
h1, h2, h3, p { margin: 0; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.num { font-variant-numeric: tabular-nums; }
.loading { padding: 80px 0; font-size: 22px; color: var(--mute); }

/* top bar */
.nav { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.nav__in { display: flex; flex-wrap: wrap; align-items: center; gap: 0 24px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 12px; min-height: 48px; color: var(--ink); font-size: 20px; font-weight: 700; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.nav__links { display: flex; gap: 0 20px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav__links::-webkit-scrollbar { display: none; }
.nav__links a { display: flex; align-items: center; min-height: 48px; padding: 0 4px; color: var(--ink2); font-weight: 500; white-space: nowrap; border-bottom: 3px solid transparent; }
.nav__links a:hover { text-decoration: none; color: var(--ink); }
.nav__links a[aria-current="page"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--ink); }

/* page head */
.head { padding-top: 56px; }
.eyebrow { color: var(--mute); font-weight: 500; }
h1 { margin-top: 4px; font-size: 56px; line-height: 1.25; font-weight: 700; overflow-wrap: anywhere; }
.lede { margin-top: 4px; font-size: 22px; color: var(--ink2); }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; margin-top: 24px; font-weight: 600; }
.hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 40px; margin-top: 8px; }
.hero h1 { font-size: 64px; }
.hero__num { display: flex; align-items: baseline; gap: 12px; }
.big { font-size: 104px; line-height: 1; font-weight: 700; letter-spacing: -0.02em; }
.hero__num span:last-child { font-size: 20px; color: var(--mute); }

.banner { margin-top: 24px; padding: 16px 20px; border-radius: 16px; background: var(--org-bg); color: var(--org); font-weight: 600; }
.banner--info { background: var(--gry-bg); color: var(--ink2); font-weight: 500; }

/* status pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; font-size: 17px; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.pill svg { flex: none; }
.s-late { background: var(--red-bg); color: var(--red); }
.s-behind { background: var(--org-bg); color: var(--org); }
.s-ahead, .s-ontrack, .s-done { background: var(--grn-bg); color: var(--grn); }
.s-upcoming, .s-starting, .s-none, .s-doing { background: var(--gry-bg); color: var(--ink2); }
.s-doing { background: var(--ink); color: #fff; }
.s-nodata { background: #fff; color: var(--ink2); border: 2px dashed var(--gry-bar); padding: 4px 12px; }

/* project tiles on the first page */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 32px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 24px; border-radius: 24px; background: #fff; color: var(--ink); }
.tile:hover { text-decoration: none; }
.tile__name { font-size: 26px; line-height: 1.3; font-weight: 700; }
.tile__count { font-size: 17px; color: var(--mute); }

/* cards */
.card { margin-top: 24px; padding: 36px; border-radius: 28px; background: #fff; }
.card--first { margin-top: 40px; }
.card__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 24px; }
h2 { font-size: 36px; line-height: 1.3; font-weight: 700; }
.sub { margin-top: 2px; font-size: 19px; color: var(--mute); }
.more { display: inline-flex; align-items: center; min-height: 48px; font-weight: 600; white-space: nowrap; }
.note { margin-top: 16px; padding: 14px 20px; border-radius: 16px; background: var(--bg); color: var(--ink2); font-size: 17px; }
.sect { margin-top: 64px; }
.sect > h2 { font-size: 40px; }
.sect h3 { margin: 32px 0 0; font-size: 22px; line-height: 1.4; font-weight: 600; color: var(--mute); }
.sect h3 + .card { margin-top: 12px; }

/* timeline */
.tl { margin-top: 20px; }
.tl--wide { min-width: 780px; margin-top: 0; }
.tl__axis { display: grid; grid-template-columns: var(--cols); gap: 16px; align-items: end; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 16px; font-weight: 600; color: var(--mute); }
.tl__axis > :last-child { text-align: right; }
.ticks { position: relative; height: 26px; font-weight: 400; }
.ticks span { position: absolute; bottom: 0; white-space: nowrap; }
.ticks .now { color: var(--link); font-weight: 700; }
.ticks .end { right: 0; }
.tasks { list-style: none; margin: 0; padding: 0; }
.task { display: grid; grid-template-columns: var(--cols); gap: 16px; align-items: center; min-height: 76px; padding: 10px 0; border-bottom: 1px solid var(--hair); overflow: hidden; }
.task:last-child { border-bottom: 0; }
.task__icon { display: none; }
.task__name { font-size: 20px; line-height: 1.4; font-weight: 600; overflow-wrap: anywhere; }
.task__meta { font-size: 16px; color: var(--mute); }
.task__lane { position: relative; height: 32px; border-radius: 8px; background: var(--bg); }
.task__state { justify-self: end; text-align: right; }
.bar { position: absolute; top: 4px; height: 24px; min-width: 8px; border-radius: 7px; background: var(--gry-bar); }
.bar--stub { left: 0; width: 28px; }
.bar--late { background: var(--red-bar); }
.bar--behind { background: var(--org-bar); }
.bar--ahead, .bar--ontrack, .bar--done { background: var(--grn-bar); }
.bar--nodata { background: transparent; border: 2px dashed var(--gry-bar); }
.bar--plan { background: var(--line); overflow: hidden; }
.bar--plan.is-late { background: var(--red-bg); box-shadow: inset 0 0 0 2px var(--red); }
.bar--plan.is-nodata { background: transparent; border: 2px dashed var(--gry-bar); }
.fill { display: block; height: 100%; background: var(--gry-bar); }
.fill--late { background: var(--red-bar); }
.fill--behind { background: var(--org-bar); }
.fill--ahead, .fill--ontrack, .fill--done { background: var(--grn-bar); }
.todayline { position: absolute; top: -200px; bottom: -200px; width: 2px; margin-left: -1px; background: #0071e3; }
.older { margin-top: 8px; border-top: 1px solid var(--hair); }
.older summary { display: flex; align-items: center; min-height: 52px; color: var(--link); font-weight: 600; cursor: pointer; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--hair); font-size: 17px; color: var(--ink2); }
.legend span { display: inline-flex; align-items: center; gap: 10px; }
.legend i { display: inline-block; width: 36px; height: 14px; border-radius: 5px; background: var(--line); }
.legend .l-done { background: var(--grn-bar); }
.legend .l-late { background: var(--red-bg); box-shadow: inset 0 0 0 2px var(--red); }
.legend .l-now { width: 2px; height: 20px; border-radius: 0; background: #0071e3; }

/* step cards */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-top: 36px; }
.stat { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 28px; border-radius: 24px; background: #fff; }
.stat__no { font-size: 17px; font-weight: 600; color: var(--mute); }
.stat__name { font-size: 28px; line-height: 1.3; font-weight: 700; }
.stat__pct { font-size: 56px; line-height: 1.1; font-weight: 700; }
.stat__cap { font-size: 17px; color: var(--mute); }
.meter { align-self: stretch; height: 12px; border-radius: 6px; background: var(--hair); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 6px; background: var(--ink); }
.meter--done i { background: var(--grn-bar); }
.coats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px 28px; }
.coat { display: flex; flex-direction: column; gap: 6px; font-size: 17px; }
.coat b { display: flex; justify-content: space-between; font-weight: 600; }

/* list rows (sub-jobs, activity) */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { border-bottom: 1px solid var(--hair); }
.rows > li:last-child { border-bottom: 0; }
.row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 84px 22px; gap: 12px 24px; align-items: center; padding: 20px 0; color: var(--ink); }
.row:hover { text-decoration: none; }
.row .meter { align-self: center; }
.row__name { font-size: 24px; line-height: 1.4; font-weight: 600; overflow-wrap: anywhere; }
.row__meta { font-size: 18px; color: var(--mute); }
.row__pct { text-align: right; font-size: 30px; font-weight: 700; }
.row svg { color: var(--mute); }
.act { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 24px; padding: 18px 0; }
.act b { font-size: 22px; font-weight: 600; }
.act span { font-size: 20px; color: var(--ink2); }
.card--list { padding-top: 8px; padding-bottom: 8px; }

/* piece table */
.chips { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.chip { min-height: 48px; padding: 0 22px; border-radius: 999px; border: 2px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.scroll { overflow-x: auto; }
.tbl { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 19px; }
.tbl th, .tbl td { padding: 15px 12px; text-align: left; border-bottom: 1px solid var(--hair); white-space: nowrap; }
.tbl th { font-size: 16px; font-weight: 600; color: var(--mute); }
.tbl td:first-child { font-weight: 600; }
.tbl .ok { color: var(--grn); font-weight: 600; }
.tbl .wait { color: var(--mute); }
.btn { min-height: 52px; padding: 0 28px; border: 0; border-radius: 999px; background: var(--gry-bg); color: var(--link); font: inherit; font-weight: 600; cursor: pointer; }
.center { padding-top: 20px; text-align: center; }
.plain { margin: 12px 0 0; padding-left: 22px; }
.plain li { margin-top: 6px; }

/* footer */
.foot { margin-top: 64px; padding-bottom: 72px; }
.foot__in { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; padding-top: 28px; border-top: 1px solid var(--line); }
.foot__in b { font-weight: 600; }
.foot p { margin-top: 20px; font-size: 16px; color: var(--mute); }

@media (max-width: 760px) {
  body { font-size: 17px; }
  .wrap { padding: 0 16px; }
  .nav { position: static; }
  .nav__in { min-height: 0; }
  .brand { font-size: 18px; }
  .nav__links { margin-left: 0; width: 100%; gap: 0 18px; }
  .head { padding-top: 28px; }
  h1, .hero h1 { font-size: 34px; }
  .lede { font-size: 18px; }
  .big { font-size: 64px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
  .tile { padding: 16px; border-radius: 20px; gap: 6px; }
  .tile__name { font-size: 20px; }
  .tile .pill { padding: 0; border: 0; background: none; font-size: 16px; white-space: normal; }
  .tile .pill svg { display: none; }
  .tile__count { font-size: 15px; }
  .card { margin-top: 16px; padding: 20px; border-radius: 24px; }
  .card--first { margin-top: 28px; }
  .card--list { padding-top: 4px; padding-bottom: 4px; }
  h2 { font-size: 26px; }
  .sub { font-size: 17px; }
  .sect { margin-top: 44px; }
  .sect > h2 { font-size: 28px; }
  .tl { margin-top: 8px; }
  .tl__axis { display: none; }
  .task { grid-template-columns: 36px minmax(0, 1fr); grid-template-areas: "icon text" "icon state"; gap: 2px 12px; align-items: start; min-height: 0; padding: 14px 0; }
  .task__icon { grid-area: icon; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border-radius: 18px; }
  .task__text { grid-area: text; }
  .task__name { font-size: 18px; }
  .task__lane { display: none; }
  .task__state { grid-area: state; justify-self: start; }
  .task__state .pill { padding: 0; border: 0; background: none; font-size: 16px; white-space: normal; }
  .task__state .pill svg { display: none; }
  .legend { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
  .stat { padding: 18px; border-radius: 20px; }
  .stat__name { font-size: 22px; }
  .stat__pct { font-size: 40px; }
  .stat__cap { font-size: 15px; }
  .row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "text pct" "meter meter"; gap: 10px 16px; padding: 16px 0; }
  .row > div:first-child { grid-area: text; }
  .row .meter { grid-area: meter; }
  .row__pct { grid-area: pct; font-size: 26px; }
  .row > svg { display: none; }
  .row__name { font-size: 20px; }
  .row__meta { font-size: 16px; }
  .act b { font-size: 19px; }
  .act span { font-size: 17px; }
  .tl--wide { min-width: 0; }
  .tbl, .tbl tbody { display: block; min-width: 0; font-size: 17px; }
  .tbl thead { display: none; }
  .tbl tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 12px; padding: 14px 0; border-bottom: 1px solid var(--hair); }
  .tbl tr:last-child { border-bottom: 0; }
  .tbl td { display: block; padding: 0; border: 0; white-space: normal; overflow-wrap: anywhere; }
  .tbl td[data-th]::before { content: attr(data-th); display: block; font-size: 14px; font-weight: 400; color: var(--mute); }
  .tbl td[colspan] { grid-column: 1 / -1; }
  .foot { margin-top: 44px; padding-bottom: 48px; }
}
