@font-face { font-family: Itim; src: url(../assets/fonts/itim-thai-400-normal.woff2) format('woff2');
  unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; font-display: swap; }
@font-face { font-family: Itim; src: url(../assets/fonts/itim-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; font-display: swap; }

:root {
  --bg: #eef4fb; --panel: #fff; --soft: #f4f6fa; --line: #e4e8f0; --ink: #23263a; --muted: #6b7385;
  --accent: #ff9f1c; --accent-deep: #e9860a; --accent-soft: #fff1dc; --blue: #2f6de0; --blue-soft: #e6efff;
  --green: #1fb46a; --green-soft: #e3f8ec; --red: #e5484d; --red-soft: #ffe8e8;
  --shadow: 0 6px 24px rgba(35, 45, 80, .10), 0 1px 3px rgba(35, 45, 80, .06);
  font-family: Itim, "Noto Sans Thai", "Leelawadee UI", Thonburi, sans-serif; color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body { font-size: 15px; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--blue); }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
h1, h2, h3 { font-weight: normal; margin: 0; }

.center { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
#boot { color: var(--muted); font-size: 18px; }
.card { background: var(--panel); border-radius: 22px; box-shadow: var(--shadow); padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.narrow { width: min(400px, 100%); }
.wizard { width: min(620px, 100%); }
.brand { display: flex; gap: 14px; align-items: center; }
.brand .logo { width: 52px; height: 52px; border-radius: 15px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 18px; flex: none; }
.brand h1 { font-size: 25px; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.brand.small .logo { width: 38px; height: 38px; border-radius: 11px; font-size: 14px; }
.brand.small div { display: flex; flex-direction: column; line-height: 1.2; }
.brand.small small { color: var(--muted); font-size: 12px; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.field input, .field select, .field textarea { border: 1px solid var(--line); background: var(--soft); border-radius: 12px; padding: 10px 13px; outline: none; font-size: 16px; color: var(--ink); width: 100%; }
.field input:focus, .field select:focus { border-color: var(--accent); background: #fff; }
.field small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.primary, .secondary, .danger { border-radius: 12px; padding: 10px 16px; display: inline-flex; gap: 8px; align-items: center; justify-content: center; text-decoration: none; font-size: 15px; white-space: nowrap; }
.primary { background: var(--accent); color: #fff; }
.primary:hover { background: var(--accent-deep); }
.primary:disabled { opacity: .55; cursor: default; }
.primary.big { width: 100%; padding: 13px; font-size: 17px; }
.secondary { background: var(--soft); color: var(--ink); }
.secondary:hover { background: var(--line); }
.danger { background: var(--red-soft); color: var(--red); }
.danger:hover { background: #ffd6d6; }
.mini { padding: 5px 11px; border-radius: 999px; font-size: 13px; background: var(--soft); display: inline-flex; gap: 5px; align-items: center; white-space: nowrap; }
.mini:hover { background: var(--line); }
.mini.red { color: var(--red); }
.mini svg { width: 15px; height: 15px; }
select.mini { border: 1px solid var(--line); background: #fff; }
.icon-btn { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; }
.icon-btn:hover { background: var(--soft); }
.quiet { align-self: center; color: var(--muted); font-size: 14px; }
.msg { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--red-soft); color: var(--red); font-size: 14px; }
.msg.ok { background: var(--green-soft); color: #137a46; }
.hint { color: var(--muted); font-size: 13.5px; line-height: 1.6; margin: 0; }
code { background: var(--soft); border-radius: 6px; padding: 1px 6px; font-size: 13px; overflow-wrap: anywhere; }

/* Setup steps */
.steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0; }
.steps li { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.steps li.done, .steps li.now { background: var(--accent); }
.step-title { font-size: 19px; }
.choice { display: flex; gap: 12px; align-items: flex-start; border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; cursor: pointer; }
.choice input { margin-top: 4px; accent-color: var(--accent); }
.choice.sel { border-color: var(--accent); background: var(--accent-soft); }
.choice b { font-weight: normal; font-size: 16px; display: block; }
.choice small { color: var(--muted); font-size: 13px; line-height: 1.5; }
.summary { background: var(--soft); border-radius: 14px; padding: 12px 14px; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.summary span:nth-child(odd) { color: var(--muted); }

/* Console */
#console { display: grid; grid-template-columns: 230px minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 100vh; }
.top { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; background: var(--panel); box-shadow: 0 1px 0 var(--line); position: sticky; top: 0; z-index: 5; }
.top-right { display: flex; gap: 8px; align-items: center; }
.top-right .secondary { padding: 8px 12px; }
.me { color: var(--muted); font-size: 14px; }
.side { padding: 16px 10px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 63px; align-self: start; }
.nav-item { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 12px; color: var(--ink); text-align: left; }
.nav-item:hover { background: rgba(255, 255, 255, .7); }
.nav-item.sel { background: var(--panel); box-shadow: var(--shadow); color: var(--accent-deep); }
.nav-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-left: auto; }
.content { padding: 22px 24px 60px; max-width: 1100px; width: 100%; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.page-title { font-size: 24px; }
.page-sub { color: var(--muted); margin: -8px 0 4px; font-size: 14px; }
.box { background: var(--panel); border-radius: 18px; box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.box h3 { font-size: 18px; display: flex; gap: 8px; align-items: center; }
.box h3 svg { color: var(--accent-deep); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.stat { background: var(--panel); border-radius: 16px; box-shadow: var(--shadow); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 30px; font-weight: normal; color: var(--accent-deep); line-height: 1.1; }
.stat span { color: var(--muted); font-size: 13.5px; }
.todo { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); color: #8a4f00; }
.todo.ok { background: var(--green-soft); color: #137a46; }
.todo button { margin-left: auto; }
.pill { font-size: 12px; border-radius: 999px; padding: 1px 9px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.pill.on { background: var(--green-soft); color: #137a46; }
.pill.off { background: var(--red-soft); color: var(--red); }
.pill.admin { background: var(--accent-soft); color: var(--accent-deep); }
.pill.guest { background: #efe7ff; color: #6d3fe0; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-weight: normal; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table td.nowrap { white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table .acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.table small { color: var(--muted); display: block; font-size: 12px; }
.scroll { overflow-x: auto; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab { padding: 6px 12px; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: 14px; }
.tab.sel { background: var(--ink); color: #fff; }
.search { border: 1px solid var(--line); background: var(--soft); border-radius: 12px; padding: 8px 12px; outline: none; min-width: 200px; }
.rename { border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 4px 6px; width: 100%; min-width: 120px; }
.rename:hover { border-color: var(--line); }
.rename:focus { border-color: var(--accent); background: #fff; outline: none; }
.copybox { display: flex; gap: 6px; align-items: center; background: var(--soft); border-radius: 12px; padding: 6px 6px 6px 12px; }
.copybox code { background: none; flex: 1; padding: 0; }
.steps-list { margin: 0; padding-left: 20px; line-height: 1.8; color: var(--ink); font-size: 14.5px; }
.gtest { min-height: 44px; }
.switch { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--accent); margin-top: 3px; flex: none; }
.switch span { display: flex; flex-direction: column; }
.switch small { color: var(--muted); font-size: 13px; }

#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; z-index: 30; pointer-events: none; }
.toast { background: rgba(28, 32, 50, .92); color: #fff; border-radius: 14px; padding: 10px 16px; max-width: min(560px, 92vw); text-align: center; line-height: 1.45; animation: toast .2s ease-out; }
.toast.bad { background: var(--red); }
@keyframes toast { from { opacity: 0; transform: translateY(6px); } }

@media (max-width: 860px) {
  #console { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; flex-direction: row; overflow-x: auto; padding: 8px 12px; gap: 4px; scrollbar-width: none; }
  .nav-item { flex: none; padding: 8px 12px; }
  .nav-item span { white-space: nowrap; }
  .content { padding: 14px 16px 60px; }
  .top { padding: 10px 14px; position: static; }
  .top-right .secondary span, .me { display: none; }
  .grid2 { grid-template-columns: 1fr; }
  .table .hide-s { display: none; }
}
#step-body { display: flex; flex-direction: column; gap: 14px; }
#step-body .hint { margin-top: -6px; }
#s-google { display: flex; flex-direction: column; gap: 12px; padding: 4px 0 0 30px; }
.field textarea { border: 1px solid var(--line); background: var(--soft); border-radius: 12px; padding: 10px 13px; outline: none; font: inherit; font-size: 15px; color: var(--ink); width: 100%; resize: vertical; }
.field textarea:focus { border-color: var(--accent); background: #fff; }
.logo-prev { width: 200px; height: 80px; border-radius: 14px; background: repeating-conic-gradient(#f1f3f7 0 25%, #fff 0 50%) 0 0 / 16px 16px; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.logo-prev img { max-width: 92%; max-height: 72px; object-fit: contain; }
.logo-prev span { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.4; }
.file-btn { cursor: pointer; }
