/* EyeSim — ใช้ design token ชุดเดียวกับ EyeFleet CMS Admin Console (eyefleet-cms-api/docs/admin_ui.html) */
:root {
  --font: "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", "Noto Sans Thai", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --bg: #eef2f8;
  --bg-grad: radial-gradient(1200px 600px at 78% -10%, #e3ecfb 0%, transparent 60%), radial-gradient(900px 500px at -5% 110%, #e6f6ef 0%, transparent 55%);
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-inset: #f1f5fa;
  --border: #e2e8f1;
  --border-strong: #cfd9e6;
  --text: #0f1b2d;
  --text-2: #3f4f63;
  --muted: #6b7c93;
  --faint: #93a2b6;

  --accent: #2563eb;
  --accent-h: #1d4ed8;
  --accent-soft: #eaf1ff;
  --accent-line: #cadcff;
  --green: #11a861;
  --green-soft: #e6f7ef;
  --amber: #d98a00;
  --amber-soft: #fff4dc;
  --red: #e1453a;
  --red-soft: #fdeceb;
  --offline: #9aa9bd;

  --shadow-sm: 0 1px 2px rgba(16,30,54,.06), 0 1px 3px rgba(16,30,54,.05);
  --shadow-md: 0 4px 14px rgba(16,30,54,.08), 0 1px 4px rgba(16,30,54,.05);
  --shadow-lg: 0 20px 48px rgba(16,30,54,.18), 0 4px 12px rgba(16,30,54,.10);

  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-pill: 999px;
  --sidebar-w: 256px;
  --ease: cubic-bezier(.22,.61,.36,1);
}
[data-theme="dark"] {
  --bg: #070b14;
  --bg-grad: radial-gradient(1100px 600px at 80% -12%, #122443 0%, transparent 58%), radial-gradient(900px 520px at -8% 112%, #0c2a22 0%, transparent 52%);
  --surface: #0f1726;
  --surface-2: #131d30;
  --surface-inset: #0b1320;
  --border: #1e2a40;
  --border-strong: #2a3a56;
  --text: #e9f0fa;
  --text-2: #b3c2d6;
  --muted: #7e91ab;
  --faint: #5d6f8a;

  --accent: #4f8bff;
  --accent-h: #6a9dff;
  --accent-soft: #15243f;
  --accent-line: #284872;
  --green: #2bce85;
  --green-soft: #0e2a20;
  --amber: #e3a52a;
  --amber-soft: #2a2110;
  --red: #ff6457;
  --red-soft: #2c1714;
  --offline: #56657d;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 6px 18px rgba(0,0,0,.45);
  --shadow-lg: 0 24px 56px rgba(0,0,0,.6), 0 4px 14px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); background: var(--bg); background-image: var(--bg-grad); background-attachment: fixed;
  color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; letter-spacing: .1px;
}
button { font-family: inherit; cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-h); }
::selection { background: var(--accent-soft); }
svg.i { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
h1 { margin: 0; font-size: 23px; font-weight: 700; letter-spacing: .2px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
h2 { margin: 0 0 14px; font-size: 15.5px; font-weight: 700; letter-spacing: .2px; }
h3 { margin: 10px 0 8px; font-size: 14px; font-weight: 600; }
small, .small { font-size: 12px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); letter-spacing: .2px; }
.strong { font-weight: 600; color: var(--text); }
.bad { color: var(--red); }
.good { color: var(--green); }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.empty { text-align: center; color: var(--faint); padding: 40px 16px !important; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border); padding: 20px 14px; z-index: 30; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 22px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand .logo {
  width: 38px; height: 38px; border-radius: 11px; flex: none; display: grid; place-items: center; color: #fff;
  background: linear-gradient(150deg, #2f6dfb, #11a861); box-shadow: 0 6px 16px rgba(37,99,235,.35);
}
.brand .logo svg { width: 22px; height: 22px; }
.brand .name { font-weight: 700; font-size: 15.5px; letter-spacing: .2px; line-height: 1.15; }
.brand .name span { display: block; font-weight: 500; font-size: 11px; color: var(--muted); letter-spacing: .6px; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.nav-label { font-size: 11px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .8px; padding: 12px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px;
  color: var(--text-2); font-weight: 500; font-size: 14px; transition: background .16s var(--ease), color .16s var(--ease);
}
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav-item .count { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--surface-inset); padding: 1px 8px; border-radius: var(--r-pill); }
.nav-item:hover { background: var(--surface-inset); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-item.active svg { opacity: 1; }
.nav-item.active .count { background: var(--surface); color: var(--accent); }

.sidebar .foot { margin-top: auto; padding: 12px 4px 2px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; color: var(--text); }
.me:hover { background: var(--surface-inset); color: var(--text); }
.ava { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(150deg, #2f6dfb, #11a861); }
.me .who { min-width: 0; line-height: 1.25; }
.me .who b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .who small { color: var(--muted); }
.conn { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); padding: 2px 8px; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
}
.topbar .title { min-width: 0; }
.topbar .title b { display: block; font-size: 19px; font-weight: 700; letter-spacing: .2px; }
.topbar .sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; font-weight: 500; }
.topbar .spacer { flex: 1; }
.search { position: relative; flex: 0 1 400px; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--faint); pointer-events: none; }
.topbar .search input[type=search] { width: 100%; padding-left: 40px !important; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2); box-shadow: var(--shadow-sm);
  transition: background .16s, border-color .16s, transform .12s;
}
.icon-btn:hover { border-color: var(--border-strong); color: var(--text); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-toggle { display: none; }
.scrim { display: none; }

.content { padding: 24px 28px 80px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head:empty { display: none; }
.page-head .sub { margin-top: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--muted); }
.page-head > .actions:only-child { margin-left: auto; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 10px;
  font-size: 13.5px; font-weight: 600; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-sm); transition: transform .12s, background .16s, border-color .16s, box-shadow .16s; white-space: nowrap; font-family: inherit;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { border-color: var(--border-strong); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 38%, transparent); }
.btn.primary:hover { background: var(--accent-h); color: #fff; }
.btn.warn { background: var(--amber); border-color: transparent; color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--amber) 30%, transparent); }
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-inset); color: var(--text); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.btn.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn.sm svg { width: 14px; height: 14px; }
.btn.big { padding: 11px 20px; font-size: 14.5px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; pointer-events: none; }

/* ---------- inputs ---------- */
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font-size: 13.5px; font-family: inherit; transition: border-color .15s, box-shadow .15s, background .15s; min-width: 0;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3.5px var(--accent-soft); }
input:disabled { opacity: .6; cursor: not-allowed; }
input.mono { font-family: var(--mono); letter-spacing: .3px; }
input.big { font-size: 18px; padding: 11px 14px; }
input.w4 { width: 5rem; }
select {
  appearance: none; padding-right: 34px; background-repeat: no-repeat; background-position: right 11px center;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7c93' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
}
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 17px; height: 17px; margin: 0; }
input[type=file] { font-family: inherit; color: var(--text-2); }
input[type=date] { color-scheme: light; }
[data-theme="dark"] input[type=date] { color-scheme: dark; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
label small { font-weight: 400; color: var(--muted); }
label em { color: var(--red); font-style: normal; }
label.check { flex-direction: row; align-items: center; gap: 9px; font-weight: 500; cursor: pointer; }
label.inline { flex-direction: row; align-items: center; gap: 8px; }
label.inline input { width: auto; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.form-grid .span2 { grid-column: 1 / -1; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin: 18px 0 8px; }
.field-label em { color: var(--red); font-style: normal; }
.step { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 12.5px; margin-right: 6px; }
.form-actions { display: flex; gap: 10px; align-items: center; padding: 14px 0; }
.form-actions.sticky { position: sticky; bottom: 0; z-index: 5; background: linear-gradient(transparent, var(--bg) 35%); padding-top: 24px; }
.hint { display: block; font-size: 12px; margin-top: 2px; font-weight: 500; }
.hint.warn { color: var(--amber); }
.hint.good { color: var(--green); }
.hint.bad { color: var(--red); }
.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.drop input[type=file] { padding: 22px; border: 2px dashed var(--accent-line); background: var(--accent-soft); border-radius: var(--r-md); width: 100%; }

.switch { position: relative; display: inline-flex; width: 42px; height: 24px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.switch .track { position: absolute; inset: 0; background: var(--border-strong); border-radius: var(--r-pill); transition: background .2s var(--ease); }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s var(--ease); }
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(18px); }

.radio-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.radio-cards.small { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.radio-card {
  position: relative; border: 1.5px solid var(--border); border-radius: var(--r-md); padding: 12px 14px 12px 40px; cursor: pointer; gap: 3px;
  background: var(--surface); color: var(--text); font-weight: 400; transition: border-color .15s, box-shadow .15s, background .15s;
}
.radio-card:hover { border-color: var(--border-strong); }
.radio-card input { position: absolute; left: 14px; top: 14px; accent-color: var(--c); }
.radio-card b { font-size: 14px; font-weight: 600; }
.radio-card small { color: var(--muted); line-height: 1.4; }
.radio-card:has(input:checked) { border-color: var(--c); background: color-mix(in srgb, var(--c) 7%, var(--surface)); box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--c) 16%, transparent); }
.radio-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-chip { flex-direction: row; cursor: pointer; position: relative; }
.radio-chip input { position: absolute; opacity: 0; pointer-events: none; }
.radio-chip span { border: 1.5px solid var(--border); background: var(--surface); border-radius: var(--r-pill); padding: 6px 14px; color: var(--text-2); font-weight: 500; font-size: 13px; transition: all .15s; }
.radio-chip span:hover { border-color: var(--border-strong); }
.radio-chip input:checked + span { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--surface)); color: var(--c); font-weight: 600; }
.radio-chip input:focus-visible + span { box-shadow: 0 0 0 3.5px var(--accent-soft); }
.radio-chip.current { cursor: default; }
.radio-chip.current span { display: inline-flex; align-items: center; gap: 5px; border-color: var(--c); background: var(--c); color: #fff; font-weight: 600; }
.radio-chip.current span:hover { border-color: var(--c); }
.radio-chip.current svg { width: 14px; height: 14px; }
.radio-chip.current small { font-size: 11px; font-weight: 500; opacity: .85; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--shadow-sm); margin-bottom: 16px; position: relative; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.card-head.pad { padding: 16px 20px 4px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.two-col.wide-left { grid-template-columns: 1.6fr 1fr; }
.two-col > * { min-width: 0; }

/* ---------- badges / status ---------- */
.badge, .tag, .chip, .op { display: inline-flex; align-items: center; gap: 6px; border-radius: var(--r-pill); white-space: nowrap; letter-spacing: .2px; font-family: var(--font); }
.badge { font-size: 11.5px; font-weight: 600; padding: 3px 10px; background: color-mix(in srgb, var(--c) 13%, transparent); color: color-mix(in srgb, var(--c) 88%, var(--text)); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
h1 .badge { font-size: 12px; }
.tag { font-size: 11.5px; font-weight: 600; padding: 2px 9px; background: var(--surface-inset); color: var(--text-2); border: 1px solid var(--border); }
.tag::before { content: ""; width: 3px; height: 11px; border-radius: 2px; background: var(--c); }
.op { font-size: 11px; font-weight: 700; color: var(--c); padding: 0; letter-spacing: .5px; }
.chip-key { font-family: var(--mono); font-size: 12px; font-weight: 500; background: var(--surface-inset); color: var(--text-2); padding: 2px 8px; border-radius: 6px; border: 1px solid var(--border); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); padding: 5px 12px; font-size: 13px; font-weight: 500; }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.sel { --c: var(--accent); border-color: var(--accent); color: var(--text); background: var(--accent-soft); }

/* เคลียร์ MID ชน: ช่องที่ไม่ตรงกับระบบเดิม */
.grid.cmp tbody td.chg { background: var(--amber-soft); color: var(--text); font-weight: 600; }
.card.conflict { scroll-margin-top: 80px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.dot.on { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 22%, transparent); }
.dot.off { background: var(--offline); box-shadow: 0 0 0 3px color-mix(in srgb, var(--offline) 22%, transparent); }
.exp { font-size: 11.5px; font-weight: 600; border-radius: 6px; padding: 1px 7px; }
.exp.warn { background: var(--amber-soft); color: var(--amber); }
.exp.bad { background: var(--red-soft); color: var(--red); }
.act { font-size: 11.5px; font-weight: 600; border-radius: 6px; padding: 1px 8px; background: var(--surface-inset); color: var(--text-2); white-space: nowrap; }
.act-create, .act-CREATE, .act-INSTALL { background: var(--green-soft); color: var(--green); }
.act-update, .act-UPDATE { background: var(--accent-soft); color: var(--accent); }
.act-error, .act-CANCEL { background: var(--red-soft); color: var(--red); }
.act-REMOVE, .act-STATUS { background: var(--amber-soft); color: var(--amber); }

/* ---------- alerts / toast ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; border-radius: var(--r-md); padding: 11px 14px; font-size: 13px; margin-bottom: 16px; border: 1px solid; }
.alert svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.alert.ok { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 30%, transparent); color: var(--text-2); }
.alert.ok svg { color: var(--green); }
.alert.err { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 30%, transparent); color: var(--text-2); }
.alert.err svg { color: var(--red); }
.alert.warn { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 30%, transparent); color: var(--text-2); }
.alert.warn svg { color: var(--amber); }
.alert.info { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text-2); }
.alert.info svg { color: var(--accent); }

.toasts { position: fixed; top: 18px; right: 18px; z-index: 80; display: flex; flex-direction: column; gap: 10px; width: 360px; max-width: calc(100vw - 36px); }
.toast {
  display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-left-width: 3px;
  border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 13px 14px; animation: toastIn .34s var(--ease);
}
@keyframes toastIn { from { transform: translateX(120%); opacity: 0; } to { transform: none; opacity: 1; } }
.toast.hide { transform: translateX(120%); opacity: 0; transition: transform .34s var(--ease), opacity .3s; }
.toast.ok { border-left-color: var(--green); }
.toast.err { border-left-color: var(--red); }
.toast .ti { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 50%; margin-top: 1px; }
.toast.ok .ti { background: var(--green-soft); color: var(--green); }
.toast.err .ti { background: var(--red-soft); color: var(--red); }
.toast .ti svg { width: 14px; height: 14px; }
.toast .tx { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 500; color: var(--text); word-break: break-word; }
.toast .tc { border: none; background: none; color: var(--faint); padding: 2px; flex: none; }
.toast .tc svg { width: 15px; height: 15px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
#sim-results .table-wrap, .card.flush .table-wrap { border: 0; }
table.grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.grid thead th {
  position: sticky; top: 0; z-index: 2; background: var(--surface-2); text-align: left; font-weight: 600; font-size: 11.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .6px; padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.grid tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: middle; }
.grid tbody tr:last-child td { border-bottom: none; }
.grid tbody tr:nth-child(even) { background: var(--surface-2); }
.grid tbody tr { transition: background .12s; }
.grid tbody tr.click { cursor: pointer; }
.grid tbody tr.click:hover, .grid tbody tr:hover { background: var(--accent-soft); }
.grid tbody tr.current td { background: var(--green-soft); }
.grid.compact thead th { padding: 9px 10px; }
.grid.compact tbody td { padding: 9px 10px; }
.grid td.clip { max-width: 260px; }
/* ปุ่มท้ายแถว (เฉพาะคนที่แก้ได้) + หน้าต่างติดตั้ง / ย้าย MID (ปฏิทินอยู่ z-index 200 จึงโผล่เหนือหน้าต่างได้) */
.grid .act-col { display: none; }
.can-edit .grid .act-col { display: table-cell; white-space: nowrap; text-align: right; }
.modal-back { position: fixed; inset: 0; z-index: 70; background: rgba(8,15,28,.45); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; overflow-y: auto; }
.modal-back[hidden] { display: none; }
.modal-box { width: 100%; max-width: 720px; margin: 0; box-shadow: var(--shadow-lg); }
.modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.modal-head h2 { margin: 0; flex: 1; display: flex; align-items: center; gap: 8px; }
.modal-head h2 svg { width: 18px; height: 18px; color: var(--accent); }
.modal-loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 28px 4px; }
.modal-loading .spin { width: 18px; height: 18px; border: 2px solid var(--accent-line); border-top-color: var(--accent); border-radius: 50%; animation: modal-spin .7s linear infinite; }
@keyframes modal-spin { to { transform: rotate(360deg); } }
.modal-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; font-size: 13px; }
.grid input, .grid select { padding: 6px 9px; }
.grid input[type=checkbox] { width: 17px; }
.result-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; color: var(--muted); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.result-bar b { color: var(--text); }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 14px; color: var(--muted); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters .grow { flex: 1 1 280px; }
/* ช่อง MID / ลำดับซิม (ตรงทั้งค่า) กว้างคงที่ — !important เพราะกฎ input ทั่วไปตั้ง width: 100% ไว้ */
.filters input.exact { width: 140px !important; flex: none; }
.filters select { width: auto; min-width: 130px; }
.filters input[type=date] { width: auto; }
#sim-results { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; transition: opacity .2s; }
#sim-results.htmx-request { opacity: .55; }

/* ---------- dashboard ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat {
  --c: var(--accent); position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 14px 16px 14px 19px; color: var(--text); display: flex; flex-direction: column; box-shadow: var(--shadow-sm); transition: box-shadow .18s, border-color .18s;
}
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c); }
.stat:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); color: var(--text); }
.stat span { font-size: 11px; color: var(--faint); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.stat b { font-size: 26px; line-height: 1.25; font-weight: 700; margin-top: 2px; }
.stat.total { --c: var(--text); }
.stat.sel { border-color: var(--c); box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--c) 16%, transparent); }
.bar { display: block; height: 4px; background: var(--surface-inset); border-radius: 4px; margin-top: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--c); border-radius: 4px; }
.type-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.type-card { position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 14px 12px 17px; color: var(--text); display: flex; flex-direction: column; background: var(--surface-2); }
.type-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c); }
.type-card:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface); }
.type-card b { font-size: 22px; font-weight: 700; }
.type-card span { font-weight: 600; }
.type-card small { color: var(--muted); line-height: 1.35; margin-top: 2px; }
.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.check-list a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); font-weight: 500; }
.check-list a::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--lc); flex: none; }
.check-list a span { flex: 1; }
.check-list a:hover { border-color: var(--border-strong); color: var(--text); }
.check-list b { color: var(--lc); font-size: 14px; }
.check-list li.zero a { opacity: .5; }
.lvl-danger { --lc: var(--red); } .lvl-warn { --lc: var(--amber); } .lvl-info { --lc: var(--accent); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 16px; }
.check-card { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 16px 14px 19px; color: var(--text); display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow-sm); }
.check-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--lc); }
.check-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); color: var(--text); }
.check-card b { font-size: 24px; color: var(--lc); font-weight: 700; }
.check-card span { font-weight: 600; }
.check-card small { color: var(--muted); }
.check-card.zero { opacity: .55; }
.check-card.sel { border-color: var(--lc); box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--lc) 16%, transparent); }
.mid-cloud { display: flex; flex-wrap: wrap; gap: 6px; max-height: 360px; overflow: auto; }
.mid-cloud span { font-family: var(--mono); font-size: 12px; background: var(--surface-inset); border: 1px solid var(--border); border-radius: 6px; padding: 1px 7px; }
.tips { padding-left: 18px; margin: 0; color: var(--text-2); }
.tips li { margin-bottom: 8px; }
.confirm-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.confirm-bar form { margin: 0; }

/* ---------- sim detail ---------- */
.install-card { overflow: hidden; }
.install-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--offline); }
.install-card.on::before { background: var(--green); }
.install-main { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.install-main > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.install-main .muted { font-size: 11px; color: var(--faint); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.install-main .huge { font-size: 22px; font-weight: 700; }
.install-empty { color: var(--muted); display: flex; align-items: center; gap: 10px; }
.actions-card { padding: 10px; }
.actions-card details { border: 1px solid var(--border); border-radius: var(--r-md); margin: 0 0 8px; background: var(--surface); }
.actions-card details:last-child { margin-bottom: 0; }
.actions-card summary { cursor: pointer; padding: 12px 14px; font-weight: 600; display: flex; align-items: center; gap: 9px; list-style: none; }
.actions-card summary::-webkit-details-marker { display: none; }
.actions-card summary svg { width: 17px; height: 17px; color: var(--accent); }
.actions-card summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint); transform: rotate(45deg); transition: transform .2s; }
.actions-card details[open] summary::after { transform: rotate(-135deg); }
.actions-card details[open] summary { border-bottom: 1px solid var(--border); }
.actions-card form { padding: 16px 14px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 9px 14px; margin: 0; }
.kv dt { font-size: 11px; color: var(--faint); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; padding-top: 2px; }
.kv dd { margin: 0; min-height: 1.2em; overflow-wrap: anywhere; color: var(--text-2); font-weight: 500; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { border-left: 2px solid var(--border); padding: 0 0 16px 18px; position: relative; margin-left: 5px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--offline); box-shadow: 0 0 0 3px var(--surface); }
.timeline li.empty::before { display: none; }
.timeline .ev-INSTALL::before, .timeline .ev-CREATE::before { background: var(--green); }
.timeline .ev-UPDATE::before, .timeline .ev-MIGRATE::before { background: var(--accent); }
.timeline .ev-REMOVE::before, .timeline .ev-STATUS::before, .timeline .ev-PASSWORD::before { background: var(--amber); }
.timeline .ev-CANCEL::before { background: var(--red); }
.ev-head { color: var(--text); }
.ev-head b { font-weight: 600; }
.ev-head .muted { font-size: 12px; }
.ev-note { background: var(--amber-soft); border-radius: 8px; padding: 5px 10px; margin: 6px 0; font-size: 12.5px; color: var(--text-2); }
table.changes { border-collapse: collapse; margin-top: 6px; font-size: 12.5px; background: var(--surface-2); border-radius: 8px; overflow: hidden; }
table.changes th { text-align: left; color: var(--muted); font-weight: 500; padding: 4px 12px 4px 10px; white-space: nowrap; }
table.changes td { padding: 4px 6px; color: var(--text-2); }
table.changes s { color: var(--faint); }
.legacy { opacity: .9; }
.row-error td { background: color-mix(in srgb, var(--red-soft) 60%, transparent); }
.row-same td { color: var(--faint); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; padding: 34px 30px 30px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 14px; }
.login-card .logo { width: 46px; height: 46px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin: 0 auto; }
.login-card .logo svg { width: 24px; height: 24px; }
.login-card h1 { font-size: 19px; justify-content: center; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 13px; margin: -8px 0 8px; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: var(--sidebar-w); transform: translateX(-100%); transition: transform .26s var(--ease); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .menu-toggle { display: grid; }
  .scrim.show { display: block; position: fixed; inset: 0; background: rgba(8,15,28,.4); z-index: 25; }
  .two-col, .two-col.wide-left { grid-template-columns: 1fr; }
  .topbar .sub { display: none; }
}
@media (max-width: 560px) {
  .content { padding: 18px 16px 90px; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; }
  .search { flex-basis: 100%; order: 5; }
  .kv { grid-template-columns: 1fr; }
}

/* ---------- เลือกหลายเบอร์ / แถบคำสั่ง (แบบ selbar ของ EyeFleet CMS) ---------- */
.sel-col { display: none; width: 34px; }
.can-edit .sel-col { display: table-cell; }
.grid td.sel-col, .grid th.sel-col { padding-right: 0; }
.grid tr.selected td { background: color-mix(in srgb, var(--accent-soft) 75%, var(--surface)); }
.row-note { font-size: 11.5px; color: var(--amber); margin-top: 2px; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.right { text-align: right !important; }
.selbar {
  position: fixed; left: calc(var(--sidebar-w) + 28px); right: 28px; bottom: 0; z-index: 25; margin: 0 auto 18px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 12px 16px;
  transform: translateY(140%); opacity: 0; pointer-events: none; transition: transform .32s var(--ease), opacity .26s;
}
.selbar.show { transform: none; opacity: 1; pointer-events: auto; }
.selbar .cnt .badge { font-size: 13px; }
.selbar .sep { width: 1px; height: 26px; background: var(--border); }
.selbar select { width: auto !important; min-width: 160px; }
.selbar .dp { width: 150px; }
.selbar input.grow { width: auto !important; flex: 1 1 180px; }
.merge-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; }
.merge-group { border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 12px; background: var(--surface-2); }
.merge-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-weight: 500; }
.merge-row label.check { font-size: 12px; color: var(--muted); gap: 5px; }
.merge-row .grow { flex: 1; min-width: 0; color: var(--text); }
.merge-foot { display: flex; justify-content: flex-end; margin-top: 6px; }
label.check.small { font-size: 12.5px; }
@media (max-width: 1000px) { .selbar { left: 12px; right: 12px; } }
.three-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.three-col > * { min-width: 0; }

.inline-edit { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inline-edit[hidden], [data-inline-form][hidden] { display: none !important; }
.kv dd .inline-form { margin-top: 2px; }

.pkg-row { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 700px) { .pkg-row { grid-template-columns: repeat(2, 1fr); } }
.card-head h2 svg { width: 17px; height: 17px; color: var(--accent); }

/* ---------- ปุ่มสลับเว็บ (บัญชีกลาง EyeFleet) ---------- */
.app-switch { position: relative; }
.app-switch > summary { list-style: none; cursor: pointer; }
.app-switch > summary::-webkit-details-marker { display: none; }
.app-switch[open] > summary { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
.app-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 280px; padding: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
}
.app-menu-head { font-size: 12px; font-weight: 600; color: var(--muted); padding: 4px 8px 8px; }
.app-tile { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r-md); color: var(--text); text-decoration: none; }
.app-tile:hover { background: var(--surface-inset); }
.app-tile.current { background: var(--accent-soft); }
.app-tile b { display: block; font-size: 14px; }
.app-tile small { display: block; font-size: 12px; color: var(--muted); }
.app-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; color: #fff; }
.app-ico svg { width: 20px; height: 20px; }
.app-ico.app-eyesim { background: #2563eb; }
.app-ico.app-cms { background: #0891b2; }

/* ---------- ปฏิทินเลือกวันที่ (static/datepicker.js) ---------- */
.dp { position: relative; display: block; width: 100%; min-width: 0; }
label.inline .dp, .filters .dp { width: 150px; flex: none; }
.dp .dp-input { padding-right: 38px !important; font-variant-numeric: tabular-nums; letter-spacing: .2px; }
.dp .dp-input.dp-bad { border-color: var(--red) !important; box-shadow: 0 0 0 3.5px var(--red-soft) !important; }
.dp-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px;
  display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
}
.dp-btn svg { width: 17px; height: 17px; }
.dp-btn:hover, .dp.dp-open .dp-btn { color: var(--accent); background: var(--accent-soft); }
.dp-pop {
  position: fixed; z-index: 200; width: 300px; padding: 12px; font-family: var(--font);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  animation: dp-in .14s var(--ease);
}
@keyframes dp-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.dp-pop button { font-family: inherit; cursor: pointer; }
.dp-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.dp-nav { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text-2); }
.dp-nav svg { width: 16px; height: 16px; }
.dp-nav:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface-inset); }
.dp-title { flex: 1; border: 0; background: transparent; border-radius: 9px; padding: 4px 6px; color: var(--text); font-size: 15px; font-weight: 700; line-height: 1.2; }
.dp-title small { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.dp-title:hover { background: var(--surface-inset); }
.dp-week, .dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-week span { text-align: center; font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 4px 0 6px; }
.dp-week span:first-child, .dp-week span:last-child { color: var(--red); opacity: .75; }
.dp-day {
  height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--text);
  font-size: 13.5px; font-weight: 500; font-variant-numeric: tabular-nums; position: relative;
}
.dp-day:hover { background: var(--surface-inset); }
.dp-day.out { color: var(--faint); }
.dp-day.wknd:not(.out):not(.sel) { color: color-mix(in srgb, var(--red) 75%, var(--text)); }
.dp-day.today { box-shadow: inset 0 0 0 1.5px var(--accent-line); color: var(--accent); font-weight: 700; }
.dp-day.cur:not(.sel) { background: var(--accent-soft); }
.dp-day.sel { background: var(--accent); color: #fff; font-weight: 700; box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 40%, transparent); }
.dp-day:disabled { opacity: .3; cursor: not-allowed; background: transparent; }
.dp-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px 0; }
.dp-months button { height: 44px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font-size: 13.5px; font-weight: 500; }
.dp-months button:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.dp-months button.today { color: var(--accent); font-weight: 700; }
.dp-months button.sel { background: var(--accent); border-color: var(--accent); color: #fff; }
.dp-sum { margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-inset); font-size: 12.5px; color: var(--text-2); text-align: center; }
.dp-foot { display: flex; align-items: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.dp-sp { flex: 1; }
.dp-chip { border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 5px 11px; font-size: 12.5px; font-weight: 600; }
.dp-chip:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.dp-clear { border: 0; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 600; padding: 5px 8px; border-radius: 8px; }
.dp-clear:hover { color: var(--red); background: var(--red-soft); }
@media (max-width: 560px) {
  .dp-pop { width: calc(100vw - 16px); }
  .dp-day { height: 42px; font-size: 14.5px; }
}

/* ---------- สิทธิ์แต่ละโปรแกรม (หน้าผู้ใช้) ---------- */
.app-access { display: grid; gap: 8px; }
.app-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 12px;
  border: 1px solid var(--border); border-left: 4px solid var(--c); border-radius: var(--r-md); background: var(--surface-2);
}
.app-row.off { opacity: .6; }
.app-row-head { display: flex; align-items: baseline; gap: 8px; flex: 1 1 200px; min-width: 0; }
.app-row-head b { font-size: 14px; color: var(--text); white-space: nowrap; }
.app-row-head small { color: var(--muted); font-size: 12px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; align-self: center; }
.role-pills { display: flex; flex-wrap: wrap; gap: 6px; }
label.role-pill { display: inline-flex; flex-direction: row; gap: 0; cursor: pointer; font-weight: 500; }
.role-pill input { position: absolute; opacity: 0; pointer-events: none; }
.role-pill span {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  font-size: 12.5px; color: var(--text-2); transition: background .15s, border-color .15s, color .15s;
}
.role-pill:hover span { border-color: var(--border-strong); color: var(--text); }
.role-pill input:checked + span { background: var(--c); border-color: var(--c); color: #fff; font-weight: 600; }
.role-pill.none input:checked + span { background: var(--surface-inset); border-color: var(--border-strong); color: var(--muted); }
.role-pill input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
.small-note { font-size: 12px; margin: 8px 0 0; }

/* ---------- ปุ่มสลับโปรแกรม: ตารางไอคอน ---------- */
.app-menu { width: 320px; }
.app-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.app-grid .app-tile { flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 12px 6px; }
.app-grid .app-tile b { font-size: 12.5px; line-height: 1.25; }
.app-grid .app-tile small { font-size: 11px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.app-grid .app-ico { width: 44px; height: 44px; border-radius: 13px; font-weight: 700; font-size: 18px; }
.app-menu-note { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-inset); color: var(--muted); font-size: 12px; text-align: center; }
.app-menu-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 9px 10px; border-top: 1px solid var(--border); color: var(--accent); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.app-menu-foot svg { width: 16px; height: 16px; }

/* ---------- ตั้งค่า → โปรแกรม ---------- */
.app-edit { border: 1px solid var(--border); border-left: 4px solid var(--c, var(--accent)); border-radius: var(--r-md); margin-top: 8px; background: var(--surface-2); }
.app-edit.new { border-style: dashed; border-left-width: 1px; }
.app-edit > summary { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.app-edit > summary::-webkit-details-marker { display: none; }
.app-edit > summary svg { width: 16px; height: 16px; color: var(--accent); }
.app-edit .grow-r { margin-left: auto; }
.app-edit[open] > summary { border-bottom: 1px solid var(--border); }
.app-form { padding: 12px; }
.app-form input[type=color] { padding: 3px; height: 38px; }
