/* deploy-console ตาม CI ของ Andaman Web Studio (Brand Book ฉบับธันวาคม 2026)
   น้ำเงินทะเลนำ ปะการังแค่จุดเดียว: พื้นขาวและฟองคลื่น 60% น้ำเงินทะเลและเทอร์ควอยซ์ 30% ปะการัง 10% (ปุ่มที่อยากให้กดหนึ่งปุ่มต่อจอ และคลื่นสัญญาณ)
   ไม่ใช้สีไล่ระดับและเงา ใช้เส้นขอบแทน ฟอนต์ Sora (ชื่อแบรนด์ อังกฤษสั้น ๆ) Anuphan (หัวข้อ) 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: 400;
  src: url(fonts/ibm-plex-sans-thai-latin-400.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: "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: 500;
  src: url(fonts/ibm-plex-sans-thai-latin-500.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: "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: 600;
  src: url(fonts/ibm-plex-sans-thai-latin-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: "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: "IBM Plex Sans Thai"; font-style: normal; font-display: swap; font-weight: 700;
  src: url(fonts/ibm-plex-sans-thai-latin-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: "Anuphan"; font-style: normal; font-display: swap; font-weight: 500 700;
  src: url(fonts/anuphan-thai-500-700.woff2) format("woff2");
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Anuphan"; font-style: normal; font-display: swap; font-weight: 500 700;
  src: url(fonts/anuphan-latin-500-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: "Sora"; font-style: normal; font-display: swap; font-weight: 600 700;
  src: url(fonts/sora-latin-600-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: "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; }

:root {
  /* สีแบรนด์ (คงที่ทุกธีม) ชื่อตัวแปรเดิมคงไว้ให้กฎเดิมใช้ต่อได้ */
  --deep: #0B2C55; --navy: #0B2C55; --blue: #0B66A6; --emerald: #16B5C4; --turquoise: #16B5C4; --ocean: #0B66A6; --sky: #16B5C4; --cyan: #7EDFE8; --lagoon: #7EDFE8;
  --mist: #E4F6F9; --foam: #E4F6F9; --sand: #F4EBDD; --coral: #FF7A59;
  --bg: #F6FAFC; --surface: #fff; --surface-2: #EEF6FA; --surface-3: #E4F6F9;
  --border: #D5E8F1; --border-strong: #BFDDEB;
  --text: #0B2C55; --text-2: #1E4470; --muted: #3B5672;
  --accent: #0B66A6; --accent-hover: #09578D; --accent-soft: #E4F6F9; --accent-text: #0B66A6; --on-accent: #fff;
  --ok: #0A7D52; --ok-soft: #E3F5EC; --warn: #995A00; --warn-soft: #FFF2DC;
  --err: #C62828; --err-soft: #FDE7E6; --info: #0B66A6; --info-soft: #E4F6F9; --neutral-soft: #EDF2F7;
  --side-bg: #0B2C55; --side-text: #CFE3F0; --side-muted: #93B4CF; --side-hover: rgba(255, 255, 255, .07); --side-active: rgba(126, 223, 232, .16);
  --term-bg: #051530; --term-text: #CFE3F0; --term-muted: #6F8FAF; --term-border: #1B3C63;
  --shadow-sm: none;
  --shadow: none;
  --ring: 0 0 0 2px var(--surface), 0 0 0 4px #0B66A6;
  --radius: 16px; --radius-sm: 10px;
  --f-brand: "Sora", "Anuphan", system-ui, sans-serif;
  --f-head: "Anuphan", "IBM Plex Sans Thai", system-ui, sans-serif;
  --f-body: "IBM Plex Sans Thai", "Noto 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: ease-in-out;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #051530; --surface: #0B2343; --surface-2: #071C3A; --surface-3: #0F2A4D;
    --border: #1B3C63; --border-strong: #26497A;
    --text: #E4F6F9; --text-2: #C6DCEC; --muted: #A8C6DE;
    --accent: #0B66A6; --accent-hover: #0D74BC; --accent-soft: rgba(126, 223, 232, .14); --accent-text: #7EDFE8; --on-accent: #fff;
    --ok: #4ADE9B; --ok-soft: rgba(74, 222, 155, .12); --warn: #FFC15A; --warn-soft: rgba(255, 193, 90, .12);
    --err: #FF8A80; --err-soft: rgba(255, 138, 128, .13); --info: #7EDFE8; --info-soft: rgba(126, 223, 232, .14); --neutral-soft: rgba(163, 205, 199, .12);
    --side-bg: #03102A; --side-hover: rgba(255, 255, 255, .05); --side-active: rgba(126, 223, 232, .14);
    --term-bg: #03102A; --term-border: #1B3C63;
    --shadow-sm: none; --shadow: none;
    --ring: 0 0 0 2px var(--surface), 0 0 0 4px #7EDFE8;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #051530; --surface: #0B2343; --surface-2: #071C3A; --surface-3: #0F2A4D;
  --border: #1B3C63; --border-strong: #26497A;
  --text: #E4F6F9; --text-2: #C6DCEC; --muted: #A8C6DE;
  --accent: #0B66A6; --accent-hover: #0D74BC; --accent-soft: rgba(126, 223, 232, .14); --accent-text: #7EDFE8; --on-accent: #fff;
  --ok: #4ADE9B; --ok-soft: rgba(74, 222, 155, .12); --warn: #FFC15A; --warn-soft: rgba(255, 193, 90, .12);
  --err: #FF8A80; --err-soft: rgba(255, 138, 128, .13); --info: #7EDFE8; --info-soft: rgba(126, 223, 232, .14); --neutral-soft: rgba(163, 205, 199, .12);
  --side-bg: #03102A; --side-hover: rgba(255, 255, 255, .05); --side-active: rgba(126, 223, 232, .14);
  --term-bg: #03102A; --term-border: #1B3C63;
  --shadow-sm: none; --shadow: none;
  --ring: 0 0 0 2px var(--surface), 0 0 0 4px #7EDFE8;
  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: 700; 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-brand); letter-spacing: -.015em; white-space: nowrap; }
.brand b span, .lockup b span { color: var(--cyan); }
.topbar .brand b span { color: var(--accent-text); }
.brand small { display: block; font: 600 .6rem/1 var(--f-brand); letter-spacing: .3em; 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(--coral); color: var(--deep); font-weight: 600; font-size: .92rem; transition: transform .16s var(--ease), background .16s; }
.side-cta:hover { background: #FF8F73; 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(--cyan); }
.nav a.active::after { content: ""; position: absolute; right: 10px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; 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(126, 223, 232, .12); color: #E4F6F9; font-size: .85rem; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--coral); animation: pixel 1.2s var(--ease-pixel) infinite; flex: none; }
.side-job:hover { background: rgba(126, 223, 232, .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: 50%; display: grid; place-items: center; background: var(--blue); color: #fff; font: 700 .95rem/1 var(--f-brand); text-transform: uppercase; flex: none; position: relative; }
.avatar::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 8px; height: 8px; border-radius: 50%; 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: 700 1.6rem/1.05 var(--f-brand); letter-spacing: -.02em; }
.stat .tile { position: relative; }
.stat .tile::after { content: ""; position: absolute; right: -4px; bottom: -4px; width: 8px; height: 8px; border-radius: 50%; 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: 50%; 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: none; }
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-wrap:has(details.confirm[open]) { overflow: visible; }
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: 50%; background: var(--coral); }
.term-dots span:nth-child(2) { background: var(--emerald); } .term-dots span:nth-child(3) { background: var(--cyan); }
.term-title { flex: 1; min-width: 0; font-family: var(--mono); color: #93B4CF; 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: #CFE3F0; 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(22, 181, 196, .3); border-color: rgba(126, 223, 232, .55); color: #E4F6F9; }
.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: #E4F6F9; border-radius: 7px; }
.term-search:focus { border-color: var(--cyan); 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(11, 44, 85, .25); 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; }

/* ---------- หน้าเข้าสู่ระบบ: ซ้ายเป็นพื้นทะเลลึก + ลายคลื่นของแบรนด์ (ไม่ทับตัวหนังสือ) ขวาเป็นฟอร์ม ---------- */
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: url(auth-waves.svg) left bottom / 80px 120px repeat-x var(--deep); padding: 44px 56px 168px; 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-brand); letter-spacing: -.015em; }
.lockup small { display: block; font: 600 .62rem/1 var(--f-brand); letter-spacing: .36em; opacity: .72; margin-top: 8px; }
.eyebrow { font: 600 .7rem/1 var(--f-brand); letter-spacing: .24em; text-transform: uppercase; }
.auth-hero .eyebrow { color: var(--cyan); }
.auth-hero h2 { font: 700 clamp(2rem, 3.6vw, 3.1rem)/1.3 var(--f-head); letter-spacing: -.01em; margin-top: 16px; max-width: 16ch; color: var(--foam); }
.auth-hero h2 em { font-style: normal; color: var(--cyan); }
.auth-hero p { color: #A8C6DE; 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-brand); letter-spacing: .2em; text-transform: uppercase; color: #A8C6DE; }
.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 96px; gap: 26px; background-size: 54px 81px; }
  .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: 700 4rem/1 var(--f-brand); 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(5, 21, 48, .55); 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: 32px; height: 32px; }
  .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(--cyan); }
.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: 50%; 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: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font: 700 .85rem/1 var(--f-brand); }
.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: 50%; 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; }

/* ---------- พร็อกซี NPM (CO-28) ---------- */
button.stat-btn { all: unset; box-sizing: border-box; cursor: pointer; }
.card.stat.stat-btn { display: flex; align-items: center; gap: 14px; padding: 16px 18px; text-align: left; white-space: normal; color: var(--text); font-family: var(--f-body); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s, transform .15s var(--ease); }
.card.stat.stat-btn:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); }
.card.stat.stat-btn:focus-visible { box-shadow: var(--ring); }
.card.stat.stat-btn.on { border-color: var(--accent); background: var(--accent-soft); }
.stat-value small { font-size: .9rem; font-weight: 700; color: var(--muted); margin-left: 2px; }
button.chip-btn { font-family: var(--f-body); gap: 6px; display: inline-flex; align-items: center; }
button.chip-btn b { font-family: var(--mono); font-size: .74rem; padding: 0 6px; border-radius: 999px; background: var(--surface); color: var(--muted); }
button.chip-btn.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
button.chip-btn.on b { background: rgba(255, 255, 255, .22); color: var(--on-accent); }
.px-list .toolbar .chips { flex: 1; }
.px-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; padding: 16px; }
.px-card { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); overflow: visible;
  transition: border-color .15s, box-shadow .2s, transform .2s var(--ease); animation: px-in .35s var(--ease) both; }
.px-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; border-radius: 14px 14px 0 0; background: var(--accent); }
.px-card.is-off::before { background: var(--border-strong); }
.px-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.px-card:target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.px-card.is-off { background: var(--surface-2); }
.px-card.is-off .px-domain, .px-card.is-off .px-flow { opacity: .6; }
.px-card.hidden-by-filter { display: none; }
.px-card:has(details[open]) { z-index: 5; }
@keyframes px-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.px-grid .px-card:nth-child(2) { animation-delay: .03s; } .px-grid .px-card:nth-child(3) { animation-delay: .06s; }
.px-grid .px-card:nth-child(4) { animation-delay: .09s; } .px-grid .px-card:nth-child(n+5) { animation-delay: .12s; }
.px-head { display: flex; align-items: flex-start; gap: 10px; }
.px-owner { display: flex; align-items: center; gap: 5px; margin-top: 3px; font-size: .8rem; color: var(--muted); }
.px-owner a { font-weight: 600; }
.px-card.is-editing { border-color: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.px-name { flex: 1; min-width: 0; }
.px-domain { display: inline-flex; align-items: center; gap: 6px; font: 700 1.05rem/1.3 var(--f-head); color: var(--text); overflow-wrap: anywhere; }
.px-domain .i { color: var(--muted); opacity: 0; transition: opacity .15s; }
.px-card:hover .px-domain .i, .px-domain:focus-visible .i { opacity: 1; }
.px-domain:hover { color: var(--accent-text); text-decoration: none; }
.px-alias { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.px-alias .chip { font-size: .74rem; }
.px-dot { position: relative; flex: none; width: 10px; height: 10px; margin-top: 7px; border-radius: 3px; background: var(--muted); }
.px-dot.on { background: var(--ok); }
.px-dot.on::after { content: ""; position: absolute; inset: -4px; border-radius: 5px; border: 2px solid var(--ok); opacity: 0; animation: px-ping 2.4s var(--ease) infinite; }
@keyframes px-ping { 0% { transform: scale(.6); opacity: .7; } 80%, 100% { transform: scale(1.5); opacity: 0; } }
.px-flow { display: flex; align-items: center; gap: 8px; min-width: 0; }
.px-node { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 8px; font: 500 .8rem/1.5 var(--mono); background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.px-node.target { min-width: 0; white-space: normal; overflow-wrap: anywhere; background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.px-arrow { position: relative; flex: 1; min-width: 28px; height: 2px; border-radius: 2px;
  background: repeating-linear-gradient(90deg, var(--sky) 0 6px, transparent 6px 11px); background-size: 22px 2px; animation: px-flow 1s linear infinite; }
.px-arrow::after { content: ""; position: absolute; right: -2px; top: -4px; border: 5px solid transparent; border-left: 7px solid var(--sky); border-right: 0; }
.px-card.is-off .px-arrow { animation: none; background: repeating-linear-gradient(90deg, var(--border-strong) 0 6px, transparent 6px 11px); }
.px-card.is-off .px-arrow::after { border-left-color: var(--border-strong); }
@keyframes px-flow { from { background-position: 0 0; } to { background-position: 22px 0; } }
.px-flow.big { padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--border-strong); }
.px-flow.big .px-node { font-size: .86rem; padding: 6px 12px; }
.px-ssl { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.px-ssl-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: .84rem; color: var(--text-2); }
.px-ssl-top .badge { margin-left: auto; }
.px-ssl.ok .px-ssl-top > .i { color: var(--ok); }
.px-ssl.warn { border-color: color-mix(in srgb, var(--warn) 40%, var(--border)); }
.px-ssl.err { border-color: color-mix(in srgb, var(--err) 45%, var(--border)); background: var(--err-soft); }
.px-ssl.none { background: var(--warn-soft); border-color: transparent; }
.px-ssl.none .px-ssl-top { color: var(--warn); font-weight: 600; }
.px-ssl progress.meter { height: 6px; }
.px-warn { display: flex; align-items: center; gap: 6px; margin: -4px 0 0; font-size: .8rem; color: var(--warn); }
.px-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.px-feat { font-size: .74rem; }
.px-feat.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.px-ping .badge { font-family: var(--mono); font-size: .74rem; }
.px-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 12px; margin-top: auto; border-top: 1px dashed var(--border); }
.px-foot .grow { flex: 1; }
.px-foot details.confirm .pop { width: min(320px, calc(100vw - 48px)); left: 0; right: auto; }
.px-foot .grow ~ details.confirm .pop { left: auto; right: 0; }
.px-empty, .px-none { grid-column: 1 / -1; padding: 24px; }
.px-cert-exp { min-width: 180px; }
/* การเปลี่ยนเส้นทาง (redirect) */
.rd-list .cell-title { display: flex; align-items: center; gap: 8px; overflow-wrap: break-word; min-width: 0; }
.rd-list td.lead { min-width: 170px; }
.rd-list .cell-title .px-dot { margin-top: 0; }
.rd-list .cell-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.rd-list tr.is-off td:not(.actions-cell) { opacity: .6; }
.rd-list tr:target td, .rd-list tr.is-editing td { background: var(--accent-soft); }
.rd-list .chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.rd-list td.actions-cell { white-space: normal; min-width: 220px; }
.rd-list td.actions-cell > * { margin: 2px 0; }
/* ปุ่มสีหลักที่เปิดกล่องยืนยันอยู่ ตัวอักษรคงสีขาว (สีแดงของ summary อ่านไม่ออกบนพื้นน้ำเงิน) */
details.confirm[open] > summary.btn:not(.secondary):not(.ghost):not(.danger-soft) { color: var(--on-accent); }
.rd-check { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.rd-check .badge { font-family: var(--mono); font-size: .74rem; }
.px-cert-exp .row { gap: 8px; margin-bottom: 4px; }
.px-cert-exp progress.meter { height: 5px; }
/* ฟอร์มเพิ่มหรือแก้พร็อกซี */
.px-form .card-body { display: flex; flex-direction: column; gap: 18px; }
.px-step { display: flex; gap: 14px; align-items: flex-start; }
.px-step .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.px-step-no { flex: none; display: grid; place-items: center; width: 28px; height: 28px; margin-top: 2px; border-radius: 50%; font: 700 .85rem/1 var(--f-brand); background: var(--navy); color: var(--cyan); }
.px-sub { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font: 700 .92rem/1.3 var(--f-head); color: var(--text); }
.px-sub .hint { font-family: var(--f-body); }
.px-target { grid-template-columns: 120px minmax(0, 1fr) 110px; align-items: end; }
.radio-text { display: flex; flex-direction: column; gap: 1px; }
.radio-text b { font-weight: 600; color: var(--text); font-size: .9rem; }
.radio-text small { font-size: .78rem; color: var(--muted); }
.switch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
label.switch { flex-direction: row; align-items: flex-start; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; font-weight: 400; transition: border-color .15s, background .15s; }
label.switch:hover { border-color: var(--accent); }
label.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
label.switch .track { position: relative; flex: none; width: 38px; height: 22px; margin-top: 1px; border-radius: 999px; background: var(--border-strong); transition: background .18s; }
label.switch .track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 5px; background: #fff; box-shadow: 0 1px 2px rgba(11, 44, 85, .3); transition: transform .2s var(--ease); }
label.switch input:checked + .track { background: var(--accent); }
label.switch input:checked + .track::after { transform: translateX(16px); }
label.switch input:focus-visible + .track { box-shadow: var(--ring); }
label.switch:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: var(--accent-soft); }
label.switch.is-disabled { cursor: not-allowed; opacity: .55; }
label.switch.is-disabled:hover { border-color: var(--border); }
.switch-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.switch-text b { font-weight: 600; color: var(--text); font-size: .88rem; }
.switch-text small { font-size: .78rem; color: var(--muted); }
.radio-list.compact label { padding: 6px 10px; font-size: .84rem; }
@media (min-width: 641px) {
  #redirect-form .px-target { grid-template-columns: 120px minmax(0, 1fr) 150px; }
}
@media (max-width: 640px) {
  .px-grid { grid-template-columns: 1fr; padding: 12px; }
  .px-target { grid-template-columns: 1fr 1fr; }
  .px-target label:nth-child(2) { grid-column: 1 / -1; order: -1; }
  .px-step { gap: 10px; }
  .px-list .toolbar .chips { order: 3; flex-basis: 100%; }
}
@media (max-width: 640px) { .card.stat.stat-btn { padding: 12px 14px; gap: 10px; } }
@media (max-width: 640px) {
  table.responsive td.px-cert-exp { flex-wrap: wrap; min-width: 0; }
  .px-cert-exp .row { margin-left: auto; flex-wrap: nowrap; }
  .px-cert-exp progress.meter { flex-basis: 100%; }
}
