:root {
  --ecmis-navy: #0a2647;
  --ecmis-navy-2: #123b63;
  --ecmis-navy-dark: #051425;
  --ecmis-gold: #c9a227;
  --ecmis-gold-light: #e6c765;
  --ecmis-red: #a5322a;
  --ecmis-bg: #f7f6f2;
  --ecmis-ink: #20262e;
  --ink: var(--ecmis-ink);
  --muted: #687586;
  --paper: var(--ecmis-bg);
  --surface: #fff;
  --line: #dfe3ea;
  --brand: var(--ecmis-navy);
  --brand-2: var(--ecmis-navy-2);
  --brand-dark: var(--ecmis-navy-dark);
  --accent: var(--ecmis-gold);
  --accent-light: var(--ecmis-gold-light);
  --danger: var(--ecmis-red);
  --ok: #176b50;
  --radius: 16px;
  --control-radius: 10px;
  --shadow: 0 14px 34px -14px rgba(15, 35, 65, 0.22);
  --display: "Sarabun", sans-serif;
  --body: "Sarabun", sans-serif;
  --measure: 1320px;
  --header-h: 84px;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.65;
}
a {
  color: var(--brand);
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  cursor: pointer;
}
.skip {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 999;
  background: #fff;
  color: #000;
  padding: 0.7rem 1rem;
}
.skip:focus {
  top: 1rem;
}
*:focus-visible {
  outline: 3px solid #ffbf47;
  outline-offset: 3px;
}
.shell {
  width: min(calc(100% - 2rem), var(--measure));
  margin-inline: auto;
}
.site-head {
  min-height: var(--header-h);
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  border-bottom: 2px solid var(--accent);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
}
.brand-logo {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}
.brand small {
  display: block;
  font-weight: 400;
  opacity: 0.78;
  font-size: 0.72rem;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}
.nav-links a {
  color: #fff;
  text-decoration: none;
  padding: 0.55rem 0.75rem;
  border-radius: var(--control-radius);
}
.nav-links a:hover {
  background: rgba(255, 255, 255, 0.12);
}
.menu-btn {
  display: none;
  margin-left: auto;
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 0.5rem 0.7rem;
}
.profile-switch {
  position: relative;
  flex: 0 0 auto;
}
.profile-button {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 190px;
  padding: 0.45rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: var(--control-radius);
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  text-align: left;
}
.profile-button span:nth-child(2) {
  display: grid;
  flex: 1;
}
.profile-button small {
  color: rgba(255, 255, 255, 0.75);
}
.profile-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #111820;
  font-weight: 800;
}
.profile-menu {
  position: absolute;
  top: calc(100% + 0.65rem);
  right: 0;
  z-index: 80;
  width: min(340px, calc(100vw - 2rem));
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.profile-menu > button {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid transparent;
  border-radius: var(--control-radius);
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.profile-menu > button:hover,
.profile-menu > button:focus-visible,
.profile-menu > button[aria-checked="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
}
.hero {
  padding: clamp(3rem, 5vw, 4.75rem) 0;
  background: linear-gradient(
    140deg,
    var(--brand-dark) 0%,
    var(--brand) 45%,
    var(--brand-2) 100%
  );
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero:after {
  content: "";
  position: absolute;
  inset: 8% 5% auto auto;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  transform: rotate(12deg);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.kicker {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--accent);
}
h1,
h2,
h3 {
  font-family: var(--display);
  line-height: 1.25;
}
h1 {
  font-size: clamp(2rem, 3.5vw, 3.25rem);
  margin: 0.6rem 0 1rem;
  max-width: 900px;
}
h2 {
  font-size: clamp(1.55rem, 3vw, 2.5rem);
  margin: 0 0 0.75rem;
}
h3 {
  font-size: 1.1rem;
}
.lede {
  font-size: clamp(1rem, 1.7vw, 1.22rem);
  max-width: 680px;
  opacity: 0.9;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.button,
button.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 2px solid var(--brand);
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  padding: 0.72rem 1.05rem;
  border-radius: var(--control-radius);
  font-weight: 700;
}
.button.accent,
button.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #121820;
}
.button.ghost,
button.ghost {
  background: transparent;
  border-color: currentColor;
  color: inherit;
}
.button.secondary,
button.secondary {
  background: var(--surface);
  color: var(--brand);
}
.button.danger,
button.danger {
  background: var(--danger);
  border-color: var(--danger);
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1rem, 2.5vw, 2rem);
  box-shadow: var(--shadow);
}
.hero .panel {
  color: var(--ink);
}
.section {
  padding: clamp(3rem, 6vw, 6rem) 0;
}
.section.alt {
  background: color-mix(in srgb, var(--brand) 5%, var(--paper));
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 2rem;
  margin-bottom: 1.5rem;
}
.section-head p {
  max-width: 620px;
  color: var(--muted);
  margin: 0;
}
.grid {
  display: grid;
  gap: 1rem;
}
.grid.three {
  grid-template-columns: repeat(3, 1fr);
}
.grid.two {
  grid-template-columns: repeat(2, 1fr);
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem;
  position: relative;
}
.card .number {
  font: 800 2.5rem/1 var(--display);
  color: var(--accent);
}
.meta,
.hint {
  font-size: 0.85rem;
  color: var(--muted);
}
.notice {
  padding: 1rem;
  border-left: 5px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  margin: 1rem 0;
}
.notice.danger {
  border-color: var(--danger);
}
.notice.ok {
  border-color: var(--ok);
}
label,
legend {
  font-weight: 700;
}
.field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1rem;
}
input,
select,
textarea {
  width: 100%;
  padding: 0.72rem 0.8rem;
  border: 1px solid #8796a8;
  border-radius: 8px;
  background: #fff;
  color: #17253a;
}
textarea {
  min-height: 120px;
  resize: vertical;
}
.inline {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.inline > * {
  flex: 1;
}
.check {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}
.check input {
  width: auto;
  margin-top: 0.35rem;
}
.status-chip {
  display: inline-block;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  background: #e7edf4;
  color: #233d59;
  font-size: 0.78rem;
  font-weight: 800;
}
.status-chip.public {
  background: #e5f2ec;
  color: #145a43;
}
.status-chip.internal {
  background: #f6e8ce;
  color: #64420c;
}
.timeline {
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
}
.timeline li {
  position: relative;
  padding: 0 0 1.6rem 2rem;
  border-left: 2px solid var(--line);
  margin-left: 0.45rem;
}
.timeline li:before {
  content: "";
  position: absolute;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  left: -7px;
  top: 0.35rem;
}
.timeline li:last-child {
  border-left-color: transparent;
}
.timeline time {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}
.site-foot {
  background: var(--brand-dark);
  color: #d8e0e8;
  padding: 2.5rem 0 1.25rem;
  border-top: 4px solid var(--accent);
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 2rem;
}
.site-foot a {
  color: #fff;
}
.version {
  border: 0;
  background: transparent;
  color: #aeb9c6;
  padding: 0.4rem;
  user-select: none;
}
.mock {
  font-weight: 800;
  color: #744b06;
  background: #fff1c7;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}
th,
td {
  text-align: left;
  padding: 0.8rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  background: #e8eef4;
  font-size: 0.8rem;
}
.tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.tabs button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 0.6rem 0.8rem;
  border-radius: var(--control-radius);
}
.tabs button[aria-selected="true"] {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
[hidden] {
  display: none !important;
}
.workflow-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1rem;
}
.case-list {
  display: grid;
  gap: 0.5rem;
}
.case-button {
  text-align: left;
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0.8rem;
  border-radius: var(--control-radius);
}
.case-button.active {
  border: 3px solid var(--accent);
}
fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 1rem 0;
}
dialog {
  width: min(690px, calc(100% - 2rem));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0;
}
dialog::backdrop {
  background: rgba(5, 16, 28, 0.72);
}
.dialog-body {
  padding: 1.5rem;
}
.dialog-actions {
  justify-content: flex-end;
}
.dialog-actions > .button,
.dialog-actions > button {
  min-width: 112px;
  min-height: 46px;
}
.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.7rem;
}
.theme-choice {
  padding: 1rem;
  text-align: left;
  border: 2px solid var(--line);
  border-radius: var(--control-radius);
  background: #fff;
  color: #17253a;
}
.theme-choice.active {
  border-color: #b66d00;
  background: #fff5db;
}
.step-nav {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
}
.step-dot {
  height: 7px;
  flex: 1;
  background: var(--line);
}
.step-dot.active {
  background: var(--accent);
}
.receipt {
  border: 2px dashed var(--brand);
  padding: 1.5rem;
  background: #fff;
}
.token {
  font: 700 1rem/1.5 var(--body);
  letter-spacing: 0.04em;
  word-break: break-all;
}
.qr {
  width: 150px;
  height: 150px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 8px solid #fff;
  box-shadow: 0 0 0 1px #aaa;
}
.qr svg {
  width: 100%;
  height: 100%;
  display: block;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html[data-theme="02"] {
  --ecmis-navy: #5b1720;
  --ecmis-navy-2: #832331;
  --ecmis-navy-dark: #2b0a10;
  --ecmis-gold: #e09a2f;
  --ecmis-gold-light: #f1c66c;
  --ecmis-red: #b52932;
  --ecmis-bg: #fff7f2;
}
html[data-theme="03"] {
  --ecmis-navy: #0f4c4c;
  --ecmis-navy-2: #176b67;
  --ecmis-navy-dark: #072d2d;
  --ecmis-gold: #d3a52e;
  --ecmis-gold-light: #f0cf70;
  --ecmis-red: #a33a32;
  --ecmis-bg: #f1f8f5;
}
html[data-theme="04"] {
  --ecmis-navy: #35235f;
  --ecmis-navy-2: #554083;
  --ecmis-navy-dark: #1d1238;
  --ecmis-gold: #b88931;
  --ecmis-gold-light: #dfbd6f;
  --ecmis-red: #a13b4f;
  --ecmis-bg: #f7f4fb;
}
html[data-theme="05"] {
  --ecmis-navy: #304739;
  --ecmis-navy-2: #4d6855;
  --ecmis-navy-dark: #18261e;
  --ecmis-gold: #a77b2d;
  --ecmis-gold-light: #d4b56b;
  --ecmis-red: #923c32;
  --ecmis-bg: #f4f0e5;
}
html[data-theme="06"] {
  --ecmis-navy: #202a36;
  --ecmis-navy-2: #354556;
  --ecmis-navy-dark: #0f151c;
  --ecmis-gold: #cb963e;
  --ecmis-gold-light: #e2bd76;
  --ecmis-red: #a33a35;
  --ecmis-bg: #eef1f4;
}
.staff-page h1 {
  font-size: clamp(2rem, 3.5vw, 3.25rem);
}

@media (max-width: 1399.98px) {
  .nav-links {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: var(--header-h);
    background: var(--brand);
    padding: 1rem;
    flex-direction: column;
    align-items: stretch;
  }
  .nav-links.open {
    display: flex;
  }
  .menu-btn {
    display: block;
  }
  .profile-button {
    min-width: 0;
  }
  .profile-button span:nth-child(2),
  .profile-button > span:last-child {
    display: none;
  }
}

@media (max-width: 800px) {
  .hero-grid,
  .grid.three,
  .grid.two,
  .foot-grid,
  .workflow-layout {
    grid-template-columns: 1fr;
  }
  .section-head {
    display: block;
  }
  .inline {
    display: grid;
  }
  .hero:after {
    opacity: 0.35;
  }
  .theme-grid {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
