/* deploy-console ตาม CI ของ Krabi Digital (https://brandci.krabitech.com/): Navy · Electric Blue · Cyan
   Pixel K ระบบ pixel ฟอนต์ Red Hat Display + LINE Seed Sans TH (หัวเรื่อง) Plus Jakarta Sans + IBM Plex Sans Thai (เนื้อหา)
   ฟอนต์ ไอคอน และสคริปต์อยู่ในเครื่องทั้งหมด (CSP default-src 'self' ห้าม style ในบรรทัด) */
@font-face { font-family: "IBM Plex Sans Thai"; font-style: normal; font-display: swap; font-weight: 400;
  src: url(fonts/ibm-plex-sans-thai-thai-400.woff2) format("woff2");
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "IBM Plex Sans Thai"; font-style: normal; font-display: swap; font-weight: 500;
  src: url(fonts/ibm-plex-sans-thai-thai-500.woff2) format("woff2");
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "IBM Plex Sans Thai"; font-style: normal; font-display: swap; font-weight: 600;
  src: url(fonts/ibm-plex-sans-thai-thai-600.woff2) format("woff2");
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "IBM Plex Sans Thai"; font-style: normal; font-display: swap; font-weight: 700;
  src: url(fonts/ibm-plex-sans-thai-thai-700.woff2) format("woff2");
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 400 600;
  src: url(fonts/jetbrains-mono-latin-400-600.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-display: swap; font-weight: 400 700;
  src: url(fonts/plus-jakarta-sans-latin-ext-400-700.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-display: swap; font-weight: 400 700;
  src: url(fonts/plus-jakarta-sans-latin-400-700.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Red Hat Display"; font-style: normal; font-display: swap; font-weight: 400 900;
  src: url(fonts/red-hat-display-latin-ext-400-900.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Red Hat Display"; font-style: normal; font-display: swap; font-weight: 400 900;
  src: url(fonts/red-hat-display-latin-400-900.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "LINE Seed Sans TH"; font-style: normal; font-display: swap; font-weight: 400;
  src: url(fonts/line-seed-sans-th-400.woff2) format("woff2"); }
@font-face { font-family: "LINE Seed Sans TH"; font-style: normal; font-display: swap; font-weight: 700;
  src: url(fonts/line-seed-sans-th-700.woff2) format("woff2"); }
@font-face { font-family: "LINE Seed Sans TH"; font-style: normal; font-display: swap; font-weight: 800;
  src: url(fonts/line-seed-sans-th-800.woff2) format("woff2"); }

:root {
  /* สีแบรนด์ (คงที่ทุกธีม) */
  --navy: #041A53; --blue: #0059FF; --cyan: #09FFFF; --sky: #7FAEFF; --mist: #EEF3FC; --deep: #020E30;
  --bg: #F4F7FD; --surface: #fff; --surface-2: #F7F9FE; --surface-3: #EEF3FC;
  --border: #DCE3F0; --border-strong: #C3CEE4;
  --text: #0B1633; --text-2: #2B3A5C; --muted: #56627F;
  --accent: #0059FF; --accent-hover: #0047D6; --accent-soft: #E6EEFF; --accent-text: #0047D6; --on-accent: #fff;
  --ok: #0A7D52; --ok-soft: #E3F5EC; --warn: #995A00; --warn-soft: #FFF2DC;
  --err: #C62828; --err-soft: #FDE7E6; --info: #0059FF; --info-soft: #E6EEFF; --neutral-soft: #EEF1F7;
  --side-bg: #041A53; --side-text: #C9D6F2; --side-muted: #8FA0C8; --side-hover: rgba(255, 255, 255, .07); --side-active: rgba(127, 174, 255, .16);
  --term-bg: #020E30; --term-text: #C9D6F2; --term-muted: #6B7BA6; --term-border: #1A2D63;
  --shadow-sm: 0 1px 2px rgba(4, 26, 83, .06);
  --shadow: 0 12px 28px -18px rgba(4, 26, 83, .35), 0 1px 2px rgba(4, 26, 83, .05);
  --ring: 0 0 0 2px var(--surface), 0 0 0 4px #0059FF;
  --radius: 16px; --radius-sm: 10px;
  --f-head: "Red Hat Display", "LINE Seed Sans TH", "IBM Plex Sans Thai", system-ui, sans-serif;
  --f-body: "Plus Jakarta Sans", "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1); --ease-pixel: steps(4, jump-end);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #020E30; --surface: #0A1E4F; --surface-2: #071741; --surface-3: #0F2560;
    --border: #1A2D63; --border-strong: #2A4285;
    --text: #E8EEFC; --text-2: #C9D6F2; --muted: #9AA8C7;
    --accent: #0059FF; --accent-hover: #1F6BFF; --accent-soft: rgba(127, 174, 255, .14); --accent-text: #9EC2FF; --on-accent: #fff;
    --ok: #3DDC97; --ok-soft: rgba(61, 220, 151, .12); --warn: #FFC15A; --warn-soft: rgba(255, 193, 90, .12);
    --err: #FF8A80; --err-soft: rgba(255, 138, 128, .13); --info: #7FAEFF; --info-soft: rgba(127, 174, 255, .14); --neutral-soft: rgba(154, 168, 199, .12);
    --side-bg: #010A24; --side-hover: rgba(255, 255, 255, .05); --side-active: rgba(127, 174, 255, .14);
    --term-bg: #010A24; --term-border: #1A2D63;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35); --shadow: 0 14px 30px -18px rgba(0, 0, 0, .7), 0 1px 2px rgba(0, 0, 0, .3);
    --ring: 0 0 0 2px var(--surface), 0 0 0 4px #7FAEFF;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #020E30; --surface: #0A1E4F; --surface-2: #071741; --surface-3: #0F2560;
  --border: #1A2D63; --border-strong: #2A4285;
  --text: #E8EEFC; --text-2: #C9D6F2; --muted: #9AA8C7;
  --accent: #0059FF; --accent-hover: #1F6BFF; --accent-soft: rgba(127, 174, 255, .14); --accent-text: #9EC2FF; --on-accent: #fff;
  --ok: #3DDC97; --ok-soft: rgba(61, 220, 151, .12); --warn: #FFC15A; --warn-soft: rgba(255, 193, 90, .12);
  --err: #FF8A80; --err-soft: rgba(255, 138, 128, .13); --info: #7FAEFF; --info-soft: rgba(127, 174, 255, .14); --neutral-soft: rgba(154, 168, 199, .12);
  --side-bg: #010A24; --side-hover: rgba(255, 255, 255, .05); --side-active: rgba(127, 174, 255, .14);
  --term-bg: #010A24; --term-border: #1A2D63;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35); --shadow: 0 14px 30px -18px rgba(0, 0, 0, .7), 0 1px 2px rgba(0, 0, 0, .3);
  --ring: 0 0 0 2px var(--surface), 0 0 0 4px #7FAEFF;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.62 var(--f-body); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.25; margin: 0; font-family: var(--f-head); text-wrap: balance; }
h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -.015em; }
h2 { font-size: 1.08rem; font-weight: 700; }
h3 { font-size: .98rem; font-weight: 700; }
p { margin: 0; }
code, pre, kbd { font-family: var(--mono); font-size: .86em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 0; }
.i { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.i.sm { width: 15px; height: 15px; vertical-align: -2px; }
.i.lg { width: 22px; height: 22px; }
.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; }
.muted { color: var(--muted); } .ok { color: var(--ok); } .warn { color: var(--warn); } .err { color: var(--err); } .info { color: var(--info); }
.small { font-size: .85rem; font-weight: 400; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

/* ---------- โครงหน้า ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(to right, var(--side-bg) 252px, transparent 252px); }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--side-bg); color: var(--side-text); display: flex; flex-direction: column; padding: 18px 14px; gap: 18px; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px; color: #fff; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand svg { width: 36px; height: 36px; flex: none; }
.brand b { display: block; font: 700 1.06rem/1 var(--f-head); letter-spacing: -.015em; white-space: nowrap; }
.brand small { display: block; font: 600 .6rem/1 var(--f-head); letter-spacing: .34em; color: var(--side-muted); margin-top: 6px; white-space: nowrap; }
.side-cta { display: flex; align-items: center; justify-content: center; gap: 8px; height: 42px; border-radius: 10px; background: var(--blue); color: #fff; font-weight: 600; font-size: .92rem; box-shadow: 0 10px 22px -12px rgba(0, 89, 255, .9); transition: transform .16s var(--ease), background .16s; }
.side-cta:hover { background: #1F6BFF; text-decoration: none; transform: translateY(-2px); }
.side-cta.active { outline: 2px solid var(--cyan); outline-offset: 2px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font: 600 .74rem/1 var(--f-body); color: var(--side-muted); padding: 16px 10px 8px; letter-spacing: .02em; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: var(--side-text); font-size: .93rem; position: relative; }
.nav a:hover { background: var(--side-hover); color: #fff; text-decoration: none; }
.nav a .i { color: var(--side-muted); }
.nav a.active { background: var(--side-active); color: #fff; font-weight: 600; }
.nav a.active .i { color: var(--sky); }
.nav a.active::after { content: ""; position: absolute; right: 10px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 1.5px; background: var(--cyan); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.side-job { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(127, 174, 255, .12); color: #D6E4FF; font-size: .85rem; }
.live-dot { width: 9px; height: 9px; border-radius: 2px; background: var(--cyan); animation: pixel 1.2s var(--ease-pixel) infinite; flex: none; }
.side-job:hover { background: rgba(127, 174, 255, .2); text-decoration: none; }
@keyframes pixel { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .06); }
.avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--blue); color: #fff; font: 700 .95rem/1 var(--f-head); text-transform: uppercase; flex: none; position: relative; }
.avatar::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 7px; height: 7px; border-radius: 1.5px; background: var(--cyan); box-shadow: 0 0 0 2px var(--side-bg); }
.me-name { flex: 1; min-width: 0; font-size: .9rem; color: #fff; overflow: hidden; text-overflow: ellipsis; }
.me-name small { display: block; color: var(--side-muted); font-size: .74rem; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 0; background: transparent; color: var(--side-muted); cursor: pointer; padding: 0; }
.icon-btn:hover { background: var(--side-hover); color: #fff; }
.icon-btn .i { vertical-align: 0; }
.theme-btn .i-moon { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-moon { display: inline; }

.topbar { display: none; }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.scrim { display: none; }

.content { min-width: 0; display: flex; flex-direction: column; }
.page { width: 100%; max-width: 1200px; margin: 0 auto; padding: 30px 36px 56px; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head .titles { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent-text); }
.crumbs .i { width: 14px; height: 14px; vertical-align: 0; }
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.subtitle { color: var(--muted); font-size: .92rem; display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
.subtitle .i { width: 15px; height: 15px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- การ์ด ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-title { display: flex; align-items: center; gap: 10px; font: 700 1.02rem/1.3 var(--f-head); }
.card-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.card.danger { border-color: color-mix(in srgb, var(--err) 35%, var(--border)); }
.card.danger .card-head { background: color-mix(in srgb, var(--err-soft) 55%, transparent); border-radius: var(--radius) var(--radius) 0 0; }
.tile { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.tile .i { vertical-align: 0; }
.tile.ok { background: var(--ok-soft); color: var(--ok); }
.tile.warn { background: var(--warn-soft); color: var(--warn); }
.tile.err { background: var(--err-soft); color: var(--err); }
.tile.info { background: var(--info-soft); color: var(--info); }
.tile.neutral { background: var(--neutral-soft); color: var(--text-2); }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-auto { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.span-2 { grid-column: span 2; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }

/* ตัวเลขสรุป */
.stat { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.stat .tile { width: 42px; height: 42px; border-radius: 12px; }
.stat-value { font: 800 1.7rem/1.05 var(--f-head); letter-spacing: -.02em; }
.stat .tile { position: relative; }
.stat .tile::after { content: ""; position: absolute; right: -4px; bottom: -4px; width: 8px; height: 8px; border-radius: 2px; background: var(--blue); box-shadow: 0 0 0 2px var(--surface); }
.stat .tile.ok::after, .stat .tile.warn::after, .stat .tile.neutral::after { background: var(--sky); }
.stat-label { font-size: .82rem; color: var(--muted); }

/* ป้ายสถานะ */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 1px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; line-height: 1.75; background: var(--neutral-soft); color: var(--text-2); white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 1.5px; background: currentColor; flex: none; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.accent { background: var(--accent-soft); color: var(--accent-text); }
.badge.muted { background: var(--neutral-soft); color: var(--muted); }
.badge.info::before, .badge.live::before { animation: pixel 1.2s var(--ease-pixel) infinite; }
.badge .i { width: 13px; height: 13px; vertical-align: 0; }
.badge.icon::before { display: none; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.75); } }
.sha { display: inline-block; font-family: var(--mono); font-size: .8rem; padding: 1px 7px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.sha.none { background: transparent; border-style: dashed; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 7px; font-size: .8rem; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.chip .i { width: 13px; height: 13px; vertical-align: 0; }
.kbd { font-family: var(--mono); font-size: .78rem; padding: 0 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 6px; }

/* ---------- ปุ่ม ---------- */
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
  font: 600 .9rem/1.2 inherit; font-family: inherit; background: var(--accent); color: var(--on-accent); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .16s, border-color .16s, box-shadow .16s, opacity .16s, transform .16s var(--ease); }
button:hover, .btn:hover { background: var(--accent-hover); text-decoration: none; transform: translateY(-2px); }
button:not(.secondary):not(.ghost):not(.danger-soft):not(.link):not(.icon-btn):not(.term-btn):not(.chip-btn):not(.alert-close), .btn:not(.secondary):not(.ghost):not(.danger-soft) { box-shadow: 0 10px 20px -14px rgba(0, 89, 255, .85); }
button:active, .btn:active { transform: none; }
button:focus-visible, .btn:focus-visible, a:focus-visible, summary:focus-visible { outline: none; box-shadow: var(--ring); }
button:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; }
button .i, .btn .i { vertical-align: 0; }
.btn.secondary, button.secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn.secondary:hover, button.secondary:hover { background: var(--surface-2); border-color: var(--muted); }
.btn.ghost, button.ghost { background: transparent; color: var(--text-2); }
.btn.ghost:hover, button.ghost:hover { background: var(--surface-3); }
.btn.danger, button.danger { background: var(--err); color: #fff; }
.btn.danger:hover, button.danger:hover { background: color-mix(in srgb, var(--err) 85%, #000); }
.btn.danger-soft, button.danger-soft { background: var(--err-soft); color: var(--err); }
.btn.danger-soft:hover, button.danger-soft:hover { background: color-mix(in srgb, var(--err-soft) 70%, var(--err)); color: #fff; }
.btn.sm, button.sm { min-height: 32px; padding: 0 12px; font-size: .84rem; border-radius: 8px; }
.btn.block, button.block { width: 100%; }
button.link { background: none; color: var(--accent-text); padding: 0; min-height: 0; border: 0; font-weight: 500; }
button.link:hover { text-decoration: underline; background: none; }
button.is-busy { opacity: .7; cursor: progress; }
form.inline { display: inline; }

/* ---------- ฟอร์ม ---------- */
label { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; font-weight: 500; color: var(--text-2); }
.field-hint, .hint { font-size: .8rem; font-weight: 400; color: var(--muted); }
input, select, textarea { font: inherit; font-size: .93rem; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 8px 12px; min-height: 40px; width: 100%; transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input[type="checkbox"] { width: 17px; height: 17px; min-height: 0; padding: 0; accent-color: var(--accent); flex: none; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
textarea { font: .86rem/1.55 var(--mono); padding: 12px 14px; resize: vertical; }
textarea.code { background: var(--surface-2); min-height: 380px; }
input.otp { font: 600 1.25rem/1 var(--mono); letter-spacing: .45em; text-align: center; padding-left: calc(12px + .45em); max-width: 220px; }
label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; }
label.row { flex-direction: row; align-items: center; gap: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 16px; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline-row, form.inline-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
form.inline-row input { min-height: 32px; padding: 4px 10px; width: auto; flex: 1; min-width: 140px; font-size: .85rem; }
.otp-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.otp-row label { flex: 0 1 220px; }

/* ---------- ข้อความแจ้ง ---------- */
.alerts { display: flex; flex-direction: column; gap: 10px; }
.alert, .flash { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-size: .92rem; box-shadow: var(--shadow-sm); }
.alert .i { margin-top: 2px; }
.alert .alert-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.alert.error, .flash.error { background: var(--err-soft); border-color: color-mix(in srgb, var(--err) 30%, transparent); color: var(--err); }
.alert.info, .flash.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 25%, transparent); color: var(--info); }
.alert.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--warn); }
.alert.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); color: var(--ok); }
.alert .alert-close { background: none; color: inherit; min-height: 0; padding: 2px; opacity: .6; border: 0; }
.alert .alert-close:hover { opacity: 1; background: none; }
.alert a { color: inherit; text-decoration: underline; }

/* ---------- ตาราง ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: .78rem; font-weight: 600; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.card > table:first-child th:first-child, .card > .table-wrap:first-child th:first-child { border-top-left-radius: var(--radius); }
.card > table:first-child th:last-child, .card > .table-wrap:first-child th:last-child { border-top-right-radius: var(--radius); }
td.num, th.num { text-align: right; }
td.actions-cell { text-align: right; white-space: nowrap; }
.cell-title { font-weight: 600; color: var(--text); }
.cell-title a { color: var(--text); }
.cell-title a:hover { color: var(--accent-text); }
.cell-sub { font-size: .8rem; color: var(--muted); display: flex; gap: 6px 10px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.cell-sub .i { width: 13px; height: 13px; vertical-align: -1px; }
tr.hidden-by-filter { display: none; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; font-size: .92rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
table.kv th { background: none; color: var(--muted); font-weight: 500; font-size: .88rem; }
.empty { padding: 42px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .tile { width: 46px; height: 46px; border-radius: 14px; }
td.empty-cell { text-align: center; color: var(--muted); padding: 28px 16px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.search .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.search input { padding-left: 36px; min-height: 36px; background: var(--surface-2); }

/* ---------- เวอร์ชัน ---------- */
.env-card { display: flex; flex-direction: column; gap: 14px; }
.ver { display: flex; flex-direction: column; gap: 4px; }
.ver-label { font-size: .78rem; color: var(--muted); }
.ver-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ver-main { font: 600 1.05rem/1.3 var(--mono); color: var(--text); }
.ver-main.none { color: var(--muted); font-family: inherit; font-weight: 500; font-size: .95rem; }
.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.quick a { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); font-size: .88rem; font-weight: 500; }
.quick a:hover { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); text-decoration: none; }
.quick a .i { color: var(--muted); }
.quick a:hover .i { color: var(--accent-text); }
.flow { display: flex; align-items: center; gap: 10px; color: var(--muted); }

/* ---------- เมตร ---------- */
.meter-row { display: flex; flex-direction: column; gap: 6px; }
.meter-top { display: flex; justify-content: space-between; gap: 10px; font-size: .86rem; flex-wrap: wrap; }
.meter-top .meter-name { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 500; }
.meter-top .meter-name .i { color: var(--muted); }
progress.meter { appearance: none; -webkit-appearance: none; width: 100%; height: 8px; border: 0; border-radius: 99px; background: var(--surface-3); overflow: hidden; display: block; }
progress.meter::-webkit-progress-bar { background: var(--surface-3); border-radius: 99px; }
progress.meter::-webkit-progress-value { background: var(--accent); border-radius: 99px; }
progress.meter::-moz-progress-bar { background: var(--accent); border-radius: 99px; }
progress.meter.warn::-webkit-progress-value { background: var(--warn); }
progress.meter.warn::-moz-progress-bar { background: var(--warn); }
progress.meter.err::-webkit-progress-value { background: var(--err); }
progress.meter.err::-moz-progress-bar { background: var(--err); }
progress.meter.ok::-webkit-progress-value { background: var(--ok); }
progress.meter.ok::-moz-progress-bar { background: var(--ok); }

/* ---------- บันทึก (terminal) ---------- */
.terminal-card { background: var(--term-bg); border: 1px solid var(--term-border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.term-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--term-border); color: var(--term-muted); font-size: .82rem; flex-wrap: wrap; }
.term-dots { display: flex; gap: 6px; }
.term-dots { align-items: flex-end; }
.term-dots span { width: 11px; height: 11px; border-radius: 2px; background: var(--blue); }
.term-dots span:nth-child(2) { width: 9px; height: 9px; background: #4D8BFF; } .term-dots span:nth-child(3) { width: 6px; height: 6px; background: var(--cyan); }
.term-title { flex: 1; min-width: 0; font-family: var(--mono); color: #aab3c8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.term-btn { min-height: 28px; padding: 0 10px; font-size: .78rem; border-radius: 7px; background: rgba(255, 255, 255, .06); color: #c7cede; border: 1px solid rgba(255, 255, 255, .08); font-weight: 500; }
.term-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.term-btn.on { background: rgba(0, 89, 255, .3); border-color: rgba(127, 174, 255, .55); color: #E6EEFF; }
.term-btn .i { width: 14px; height: 14px; }
pre, .terminal { margin: 0; background: var(--term-bg); color: var(--term-text); font: 12.5px/1.65 var(--mono); padding: 16px 18px; min-height: 220px; max-height: 72vh; overflow: auto; white-space: pre-wrap; word-break: break-word; tab-size: 4; }
.terminal.nowrap { white-space: pre; word-break: normal; }
pre:empty::before, .terminal:empty::before { content: "กำลังรอบันทึก…"; color: var(--term-muted); }
.terminal mark { background: rgba(250, 204, 21, .3); color: #fde68a; border-radius: 3px; }
.term-search { min-height: 28px; padding: 2px 10px; font-size: .8rem; width: 180px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); color: #e5e7eb; border-radius: 7px; }
.term-search:focus { border-color: var(--sky); box-shadow: none; }

/* ขั้นของงาน GitHub */
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 20px; border-top: 1px solid var(--border); font-size: .9rem; }
.steps li:first-child { border-top: 0; }
.step-no { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 600; background: var(--surface-3); color: var(--muted); }
.step-no.ok { background: var(--ok-soft); color: var(--ok); } .step-no.err { background: var(--err-soft); color: var(--err); } .step-no.info { background: var(--info-soft); color: var(--info); }
.step-time { font-size: .8rem; color: var(--muted); font-family: var(--mono); }
details.step { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
details.step + details.step { margin-top: 8px; }
details.step summary { cursor: pointer; padding: 12px 16px; display: flex; align-items: center; gap: 10px; list-style: none; font-weight: 500; flex-wrap: wrap; }
details.step summary::-webkit-details-marker { display: none; }
details.step summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; margin-right: 4px; flex: none; }
details.step[open] summary::before { transform: rotate(45deg); }
details.step pre { min-height: 0; max-height: 60vh; border-radius: 0; }
details.step > p { padding: 0 16px 14px; }
details.more summary { cursor: pointer; color: var(--accent-text); font-size: .88rem; font-weight: 500; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
details.more summary::-webkit-details-marker { display: none; }
details.more[open] summary { margin-bottom: 12px; }

/* ลบแบบยืนยัน (เปิดก่อนจึงเห็นช่องพิมพ์) */
details.confirm { position: relative; display: inline-block; }
details.confirm > summary { list-style: none; cursor: pointer; }
details.confirm > summary::-webkit-details-marker { display: none; }
details.confirm[open] > summary { color: var(--err); }
details.confirm .pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 300px; padding: 14px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: 0 18px 40px -12px rgba(15, 23, 42, .35); display: flex; flex-direction: column; gap: 10px; text-align: left; white-space: normal; }
details.confirm .pop p { font-size: .84rem; color: var(--text-2); }
details.confirm .pop input { min-height: 36px; }

/* ---------- หน้าเข้าสู่ระบบ: ซ้ายเป็นพื้น Soft Mesh + pixel ของแบรนด์ ขวาเป็นฟอร์ม ---------- */
body.auth { min-height: 100vh; background: var(--bg); }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(400px, .9fr); }
.auth-hero { position: relative; overflow: hidden; color: #fff; background: var(--navy) url(auth-mesh.svg) right bottom / cover no-repeat; padding: 44px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; }
.lockup { display: flex; align-items: center; gap: 12px; color: #fff; }
.lockup svg { width: 48px; height: 48px; flex: none; }
.lockup b { display: block; font: 700 1.45rem/1 var(--f-head); letter-spacing: -.015em; }
.lockup small { display: block; font: 600 .62rem/1 var(--f-head); letter-spacing: .44em; opacity: .72; margin-top: 8px; }
.eyebrow { font: 600 .7rem/1 var(--f-head); letter-spacing: .24em; text-transform: uppercase; }
.auth-hero .eyebrow { color: var(--cyan); }
.auth-hero h2 { font: 800 clamp(2.2rem, 4.2vw, 3.7rem)/1.02 var(--f-head); letter-spacing: -.03em; margin-top: 16px; max-width: 13ch; }
.auth-hero h2 em { font-style: normal; color: var(--sky); }
.auth-hero p { color: #C9D6F2; max-width: 46ch; margin-top: 18px; font-size: .98rem; line-height: 1.75; }
.auth-facts { display: flex; gap: 10px 26px; flex-wrap: wrap; font: 600 .66rem/1 var(--f-head); letter-spacing: .2em; text-transform: uppercase; color: #8FA0C8; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; }
.auth-box { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 18px; }
.auth-card { padding: 30px; display: flex; flex-direction: column; gap: 16px; }
.auth-card h1 { font-size: 1.6rem; }
.auth-foot { text-align: center; font-size: .8rem; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 6px; }
.auth input { min-height: 46px; }
.auth input.otp { max-width: none; }
.auth button[type="submit"] { min-height: 46px; }
.auth-box .mobile-lockup { display: none; }
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: minmax(0, 1fr); }
  .auth-hero { padding: 28px 20px 30px; gap: 26px; background-position: right bottom; }
  .auth-hero h2 { font-size: 2rem; max-width: 16ch; }
  .auth-hero p { display: none; }
  .auth-facts { display: none; }
  .auth-main { padding: 24px 16px 40px; place-items: start center; }
}

/* ---------- อื่น ๆ ---------- */
.lock-card .card-body { flex-direction: row; align-items: center; gap: 16px; flex-wrap: wrap; }
.lock-card .lock-text { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 2px; }
.lock-card form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.lock-card input.otp { width: 190px; }
.unlocked-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--ok-soft); color: var(--ok); font-size: .88rem; border: 1px solid color-mix(in srgb, var(--ok) 25%, transparent); flex-wrap: wrap; }
.unlocked-bar strong { font-family: var(--mono); }
.secret-mask { letter-spacing: .2em; color: var(--muted); }
.timeline { display: flex; flex-direction: column; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.list li { display: flex; gap: 12px; align-items: flex-start; font-size: .9rem; color: var(--text-2); }
.list .tile { width: 28px; height: 28px; border-radius: 8px; }
.list .tile .i { width: 15px; height: 15px; }
.person { display: flex; align-items: center; gap: 10px; padding: 8px 0; flex-wrap: wrap; }
.person + .person { border-top: 1px dashed var(--border); }
.person .avatar { width: 28px; height: 28px; font-size: .8rem; }
.repo-card .card-head { padding: 12px 18px; }
.detail-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.detail-chips .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.proxied { color: #f38020; }
.dns-type { display: inline-block; min-width: 54px; text-align: center; font: 600 .74rem/1.9 var(--mono); border-radius: 6px; background: var(--accent-soft); color: var(--accent-text); }
.dns-type.t-A, .dns-type.t-AAAA { background: var(--info-soft); color: var(--info); }
.dns-type.t-CNAME { background: var(--ok-soft); color: var(--ok); }
.dns-type.t-MX { background: var(--warn-soft); color: var(--warn); }
.dns-type.t-TXT { background: var(--neutral-soft); color: var(--text-2); }
.value-cell { font-family: var(--mono); font-size: .82rem; overflow-wrap: anywhere; max-width: 420px; }
.footer-note { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.error-page { max-width: 520px; margin: 8vh auto; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.error-code { font: 800 4rem/1 var(--f-head); color: var(--accent-text); letter-spacing: -.03em; }

/* ---------- จอเล็ก ---------- */
@media (max-width: 1100px) {
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; background: none; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 272px; transform: translateX(-102%); transition: transform .22s ease, visibility .22s; visibility: hidden; }
  .nav-toggle:checked ~ .shell .sidebar { transform: none; visibility: visible; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
  .nav-toggle:checked ~ .shell .scrim { display: block; position: fixed; inset: 0; background: rgba(2, 6, 23, .5); z-index: 25; }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; padding: 10px 14px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
  .topbar .brand { color: var(--text); padding: 0; }
  .topbar .brand svg { width: 30px; height: 30px; }
  .topbar .icon-btn { color: var(--text-2); }
  .topbar .icon-btn:hover { background: var(--surface-3); color: var(--text); }
  .topbar .spacer { flex: 1; }
  .page { padding: 20px 16px 40px; gap: 16px; }
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  h1 { font-size: 1.35rem; }
}
@media (max-width: 640px) {
  .cols-4 { grid-template-columns: 1fr 1fr; }
  .stat { padding: 12px 14px; gap: 10px; }
  .stat .tile { width: 36px; height: 36px; }
  .stat-value { font-size: 1.2rem; }
  .card-head, .card-body { padding-left: 16px; padding-right: 16px; }
  .quick { grid-template-columns: 1fr 1fr; }
  .page-head .actions { width: 100%; }
  /* ตารางกลายเป็นรายการซ้อน */
  table.responsive thead { display: none; }
  table.responsive, table.responsive tbody, table.responsive tr, table.responsive td { display: block; width: 100%; }
  table.responsive tr { padding: 12px 16px; border-bottom: 1px solid var(--border); }
  table.responsive tbody tr:last-child { border-bottom: 0; }
  table.responsive td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; }
  table.responsive td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; text-align: left; flex: none; }
  table.responsive td.lead { display: block; text-align: left; padding-bottom: 6px; }
  table.responsive td.lead::before { display: none; }
  table.responsive td.actions-cell { justify-content: flex-end; }
  table.responsive td.actions-cell::before { content: none; }
  table.responsive td.empty-cell { justify-content: center; }
  table.responsive td.empty-cell::before { display: none; }
  .value-cell { max-width: none; }
  details.confirm .pop { right: auto; left: 0; width: min(300px, calc(100vw - 48px)); }
  .steps li { grid-template-columns: 26px minmax(0, 1fr) auto; }
  .steps li .step-time { grid-column: 2; }
  .term-search { width: 120px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
a.card { color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.card:hover { border-color: var(--accent); box-shadow: var(--shadow); text-decoration: none; transform: translateY(-1px); }
/* การ์ดที่พับไว้ (ย้ายเครื่อง) */
details.more-card > summary { cursor: pointer; list-style: none; border-bottom: 0; }
details.more-card > summary::-webkit-details-marker { display: none; }
details.more-card[open] > summary { border-bottom: 1px solid var(--border); }

/* ---------- Pull request ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 11px; background: var(--surface-3); }
.tabs a { padding: 5px 14px; border-radius: 8px; color: var(--text-2); font-size: .88rem; font-weight: 500; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); font-weight: 600; }
.toolbar select { width: auto; min-height: 36px; background-color: var(--surface-2); }
.branch-flow { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.branch-flow .i { width: 14px; height: 14px; color: var(--muted); }
.md-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .92rem; color: var(--text-2); }
.md-body.empty-body { color: var(--muted); font-style: italic; }
.timeline-item { display: flex; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--border); }
.timeline-item:first-child { border-top: 0; }
.timeline-item .avatar { width: 30px; height: 30px; font-size: .8rem; }
.timeline-item .who { font-size: .85rem; color: var(--muted); margin-bottom: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.timeline-item .who b { color: var(--text); }
.file-list details { border-top: 1px solid var(--border); }
.file-list details:first-child { border-top: 0; }
.file-list summary { cursor: pointer; padding: 11px 20px; display: flex; align-items: center; gap: 10px; list-style: none; flex-wrap: wrap; }
.file-list summary::-webkit-details-marker { display: none; }
.file-list summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; flex: none; }
.file-list details[open] summary::before { transform: rotate(45deg); }
.file-name { font-family: var(--mono); font-size: .84rem; overflow-wrap: anywhere; flex: 1; min-width: 0; }
.adds { color: var(--ok); font-family: var(--mono); font-size: .8rem; }
.dels { color: var(--err); font-family: var(--mono); font-size: .8rem; }
pre.diff { min-height: 0; max-height: 70vh; padding: 0; border-radius: 0; background: var(--surface-2); color: var(--text); font-size: 12px; line-height: 1.55; white-space: pre; overflow: auto; }
pre.diff span { display: block; padding: 0 16px; min-width: max-content; }
pre.diff .add { background: color-mix(in srgb, var(--ok-soft) 85%, transparent); color: var(--text); }
pre.diff .del { background: color-mix(in srgb, var(--err-soft) 85%, transparent); color: var(--text); }
pre.diff .hunk { background: var(--info-soft); color: var(--info); }
pre.diff:empty::before { content: none; }
.merge-box { border: 1px solid color-mix(in srgb, var(--ok) 35%, var(--border)); }
.merge-box .card-head { background: color-mix(in srgb, var(--ok-soft) 60%, transparent); border-radius: var(--radius) var(--radius) 0 0; }
.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: .9rem; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; }
.check-list .i { margin-top: 3px; }
.commit-row { display: flex; gap: 10px; align-items: center; padding: 9px 20px; border-top: 1px solid var(--border); font-size: .9rem; flex-wrap: wrap; }
.commit-row:first-child { border-top: 0; }
.commit-row .msg { flex: 1; min-width: 200px; }

/* ---------- tag ---------- */
.tag-chip { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; border-radius: 999px; font: 600 .76rem/1.8 var(--mono); background: var(--accent-soft); color: var(--accent-text); white-space: nowrap; }
.tag-chip .i { width: 12px; height: 12px; vertical-align: 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
button.chip-btn { min-height: 28px; padding: 0 10px; border-radius: 999px; font: 600 .78rem/1 var(--mono); background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border); }
button.chip-btn:hover { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent); }
.radio-list { display: flex; flex-direction: column; gap: 6px; }
.radio-list label { flex-direction: row; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; font-weight: 400; cursor: pointer; flex-wrap: wrap; }
.radio-list label:hover { border-color: var(--accent); }
.radio-list input[type="radio"] { width: 16px; height: 16px; min-height: 0; accent-color: var(--accent); flex: none; }
.radio-list .grow { min-width: 120px; }
.deploy-box { border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--border)); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
[hidden] { display: none !important; }
fieldset.radio-list { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.radio-list legend { padding: 0; margin-bottom: 6px; }

/* ---------- passkey ---------- */
.otp-field { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.otp-field label { flex: 0 1 220px; }
.otp-or { font-size: .8rem; color: var(--muted); padding-bottom: 10px; }
.otp-field .otp-or { padding-bottom: 11px; }
.passkey-btn .i { color: var(--accent-text); }
.auth-alt { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.auth-alt .divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .8rem; }
.auth-alt .divider::before, .auth-alt .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
a.me-name { color: #fff; text-decoration: none; }
a.me-name:hover small { color: var(--sky); }
.key-row { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.key-row:first-child { border-top: 0; }
.key-row .grow { min-width: 200px; }
.key-row form.inline-row input { max-width: 220px; }

/* ---------- ผู้ใช้และสิทธิ์ ---------- */
.role { display: inline-flex; align-items: center; gap: 6px; font: 600 .74rem/1.8 var(--f-body); padding: 0 9px; border-radius: 7px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.role.admin { background: var(--navy); color: #fff; }
.role.admin::before { content: ""; width: 6px; height: 6px; border-radius: 1.5px; background: var(--cyan); }
.lv { display: inline-block; font: 600 .74rem/1.8 var(--f-body); padding: 0 9px; border-radius: 7px; white-space: nowrap; }
.lv.view { background: var(--neutral-soft); color: var(--text-2); }
.lv.dev { background: var(--info-soft); color: var(--info); }
.lv.manage { background: var(--accent); color: #fff; }
.lv.admin { background: var(--navy); color: #fff; }
.perm-table td { padding: 10px 16px; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-3); gap: 2px; flex-wrap: wrap; }
.seg label { flex-direction: row; gap: 0; margin: 0; font-weight: 500; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.seg span { display: inline-block; padding: 5px 11px; border-radius: 8px; font-size: .82rem; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); font-weight: 600; }
.seg input:focus-visible + span { box-shadow: var(--ring); }
.seg input[value="manage"]:checked + span { background: var(--accent); color: #fff; }
.invite-box { border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border)); background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface)); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.invite-box .link { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.invite-box .link code { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; overflow-wrap: anywhere; font-size: .82rem; }
.qr-box { background: #fff; border-radius: 14px; padding: 22px; width: 236px; max-width: 100%; border: 1px solid var(--border); }
.qr-box svg { display: block; width: 100%; height: auto; }
.secret-code { font: 600 .95rem/1.6 var(--mono); letter-spacing: .06em; background: var(--surface-3); border-radius: 10px; padding: 8px 12px; word-spacing: .3em; overflow-wrap: anywhere; }
.steps-num { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; counter-reset: s; }
.steps-num > li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; counter-increment: s; }
.steps-num > li::before { content: counter(s); width: 28px; height: 28px; border-radius: 8px; background: var(--navy); color: #fff; display: grid; place-items: center; font: 700 .85rem/1 var(--f-head); }
.user-row-name { display: flex; align-items: center; gap: 10px; }
.user-row-name .avatar { width: 30px; height: 30px; font-size: .82rem; border-radius: 9px; }
.user-row-name .avatar::after { box-shadow: 0 0 0 2px var(--surface); width: 6px; height: 6px; }
.grant-list { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.pixel-rule { height: 8px; display: flex; gap: 4px; align-items: flex-end; }
.pixel-rule i { display: block; width: 8px; height: 8px; border-radius: 2px; background: var(--blue); }
.pixel-rule i:nth-child(2) { width: 6px; height: 6px; background: var(--sky); } .pixel-rule i:nth-child(3) { width: 4px; height: 4px; background: var(--cyan); }
.card.flat { box-shadow: none; }
.stack.tight { gap: 10px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; }
