:root {
  --bg: #f4f6fa; --panel: #ffffff; --panel2: #f0f3f8; --text: #1b2330; --muted: #667388; --line: #dde3ec;
  --accent: #2563eb; --accent-text: #ffffff; --ok: #15803d; --warn: #b45309; --bad: #dc2626;
  --ok-bg: #dcfce7; --warn-bg: #fef3c7; --bad-bg: #fee2e2; --code: #0f172a; --code-text: #e2e8f0;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 14px rgba(15, 23, 42, .05);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e131b; --panel: #161c27; --panel2: #1d2533; --text: #e6ebf3; --muted: #8e9bb0; --line: #2a3445;
    --accent: #4f8cff; --accent-text: #08111f; --ok: #4ade80; --warn: #fbbf24; --bad: #f87171;
    --ok-bg: #12301f; --warn-bg: #3a2c0b; --bad-bg: #3b1818; --code: #0a0e14; --code-text: #d5dce8;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #0e131b; --panel: #161c27; --panel2: #1d2533; --text: #e6ebf3; --muted: #8e9bb0; --line: #2a3445;
  --accent: #4f8cff; --accent-text: #08111f; --ok: #4ade80; --warn: #fbbf24; --bad: #f87171;
  --ok-bg: #12301f; --warn-bg: #3a2c0b; --bad-bg: #3b1818; --code: #0a0e14; --code-text: #d5dce8; --shadow: none;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
h1, h2, h3 { margin: 0; font-weight: 650; }
h1 { font-size: 20px; } h2 { font-size: 15px; }
a { color: var(--accent); }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* layout */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 16px 10px 10px; position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex; flex-direction: column; gap: 2px; }
/* only the menu scrolls: the brand and server picker stay on top, the account links stay at the bottom */
.side > nav.nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: 2px; scrollbar-width: thin; }
.side > .nav:last-child { flex: none; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 16px; font-weight: 700; font-size: 16px; }
.brand .logo { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; }
.brand .logo i { display: block; width: 14px; height: 4px; background: var(--accent-text); border-radius: 2px; box-shadow: 0 6px 0 var(--accent-text); transform: translateY(-3px); opacity: .95; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.nav a:hover { background: var(--panel2); }
.nav a.active { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.nav .ico { flex: none; opacity: .85; } .nav a.active .ico { opacity: 1; }
.nav-group { margin-top: 10px; }
.nav-title { display: flex; align-items: center; justify-content: space-between; width: 100%; background: none; border: 0; padding: 4px 10px; margin: 0 0 2px; color: var(--muted); font: inherit; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; cursor: pointer; border-radius: 6px; }
.nav-title:hover { color: var(--text); background: none; }
.nav-title .ico { transition: transform .15s; }
.nav-group.collapsed .nav-title .ico { transform: rotate(-90deg); }
.nav-group.collapsed .nav-items { display: none; }
.nav-items { display: grid; gap: 1px; }
.side .spacer { display: none; }
.main { padding: 22px 26px 60px; min-width: 0; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.top .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.menu-btn { display: none; }

/* cards */
.grid { display: grid; gap: 14px; }
.g4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.g2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card h2 { margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stat .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 26px; font-weight: 700; margin: 2px 0 6px; font-variant-numeric: tabular-nums; }
.stat .detail { color: var(--muted); font-size: 12px; }
.bar { height: 7px; background: var(--panel2); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .4s; }
.bar.warn > span { background: var(--warn); } .bar.bad > span { background: var(--bad); }
.chart { width: 100%; height: 150px; display: block; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .area { opacity: .15; }
.chart text { fill: var(--muted); font-size: 10px; }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: 12px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }
.cores { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px; }
.core { font-size: 11px; color: var(--muted); }

/* tables */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12px; cursor: default; user-select: none; position: sticky; top: 0; background: var(--panel); }
th.sortable { cursor: pointer; } th.sortable:hover { color: var(--text); }
td.wrap { white-space: normal; word-break: break-all; max-width: 420px; }
tr:hover td { background: var(--panel2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.clickable { cursor: pointer; }

/* controls */
button, .btn { font: inherit; border: 1px solid var(--line); background: var(--panel); color: var(--text); padding: 6px 12px; border-radius: 8px; cursor: pointer; }
button:hover { background: var(--panel2); }
button.primary { background: var(--accent); color: var(--accent-text); border-color: transparent; font-weight: 600; }
button.primary:hover { filter: brightness(1.08); }
button.danger { color: var(--bad); border-color: var(--bad); }
button.danger:hover { background: var(--bad-bg); }
button.sm { padding: 3px 9px; font-size: 12px; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input, select, textarea { font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); }
textarea { width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.grow > input { flex: 1; min-width: 160px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .grow { flex: 1; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 600; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--panel2); color: var(--muted); }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); } .badge.bad { background: var(--bad-bg); color: var(--bad); }
.alert { padding: 9px 12px; border-radius: 8px; margin-bottom: 8px; background: var(--warn-bg); color: var(--warn); font-weight: 500; }
.alert.crit { background: var(--bad-bg); color: var(--bad); }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.notice { padding: 12px 14px; border-radius: 10px; background: var(--panel2); border: 1px dashed var(--line); color: var(--muted); }

pre.out, .terminal-out { background: var(--code); color: var(--code-text); padding: 12px; border-radius: 10px; overflow: auto; max-height: 62vh; white-space: pre-wrap; word-break: break-all; margin: 0; }
.terminal-out .cmd { color: #7dd3fc; } .terminal-out .err { color: #fca5a5; } .terminal-out .meta { color: #94a3b8; }
.editor { min-height: 55vh; tab-size: 4; white-space: pre; }
.crumbs { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; }
.crumbs a { cursor: pointer; padding: 2px 6px; border-radius: 6px; text-decoration: none; }
.crumbs a:hover { background: var(--panel2); }
.dropzone { border: 2px dashed var(--accent); border-radius: 12px; padding: 20px; text-align: center; color: var(--accent); }

/* modal & toasts */
.modal-bg { position: fixed; inset: 0; background: rgba(8, 12, 20, .55); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--panel); border-radius: 14px; padding: 20px; width: min(520px, 100%); max-height: 90vh; overflow: auto; border: 1px solid var(--line); }
.modal.wide { width: min(1000px, 100%); }
.modal h2 { font-size: 17px; margin-bottom: 14px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 80; }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 10px; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); max-width: 360px; }
.toast.bad { background: var(--bad); color: #fff; }

/* auth screen */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth .card { width: min(400px, 100%); padding: 26px; }
.auth h1 { margin-bottom: 4px; }
.auth .err { color: var(--bad); min-height: 20px; margin-bottom: 8px; }
.auth input { width: 100%; }
.auth button.primary { width: 100%; padding: 9px; }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; z-index: 40; width: 240px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .4); }
  .menu-btn { display: inline-block; }
  .main { padding: 16px 14px 60px; }
}

/* servers */
.server-pick { padding: 0 6px 12px; }
.server-pick label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 4px 4px; font-weight: 600; }
.server-select { width: 100%; }
.fp { background: var(--panel2); padding: 6px 10px; border-radius: 8px; word-break: break-all; user-select: all; }
.modal input[type="file"] { padding: 4px; }
.modal select, .modal input:not([type="checkbox"]):not([type="file"]) { width: 100%; }

/* deploy + domains */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 14px 0; flex-wrap: wrap; }
.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 8px 14px; color: var(--muted); font-weight: 600; }
.tabs button:hover { background: var(--panel2); }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(--panel2); font-size: 12.5px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.bad { background: var(--bad-bg); color: var(--bad); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; align-items: baseline; }
.kv .k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.kv .v { word-break: break-word; min-width: 0; }
.step-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.step-list li { display: flex; gap: 10px; align-items: flex-start; }
.step-list .dot { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--panel2); color: var(--muted); }
.step-list .dot.ok { background: var(--ok-bg); color: var(--ok); } .step-list .dot.bad { background: var(--bad-bg); color: var(--bad); } .step-list .dot.warn { background: var(--warn-bg); color: var(--warn); }
.note-list { margin: 8px 0 0; padding-left: 18px; color: var(--warn); }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input { flex: 1; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
details.adv { margin: 4px 0 12px; } details.adv summary { cursor: pointer; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 600px) { .grid2, .kv { grid-template-columns: 1fr; } }
.spin { display: inline-block; width: 10px; height: 10px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -1px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* framework picker */
.fw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin: 6px 0 12px; }
.fw-group { grid-column: 1 / -1; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin-top: 6px; }
.fw-card { text-align: left; display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--panel); }
.fw-card .ic { font-size: 22px; line-height: 1; }
.fw-card .t { font-weight: 650; font-size: 13px; }
.fw-card .m { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.fw-card.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; background: var(--panel2); }
.req { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 12px; }

/* command tooltips */
.cmdtip { position: fixed; z-index: 1000; max-width: min(460px, calc(100vw - 16px)); background: #0f172a; color: #e2e8f0; border-radius: 8px; padding: 8px 11px; box-shadow: 0 8px 24px rgba(0,0,0,.35); pointer-events: none; }
.cmdtip-head { font: 600 11px/1.3 system-ui, sans-serif; color: #94a3b8; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.cmdtip-body { font: 12.5px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
[data-cmd] { cursor: pointer; }

/* cheat sheet */
.cs-row { display: grid; grid-template-columns: minmax(240px, 1.2fr) 1.4fr 118px; gap: 10px 16px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line); }
.cs-cmd code { display: block; background: var(--panel2); border-radius: 6px; padding: 6px 9px; font-size: 12.5px; white-space: pre-wrap; word-break: break-word; }
.cs-desc { font-size: 13.5px; padding-top: 4px; }
.cs-actions { display: flex; gap: 6px; padding-top: 2px; justify-content: flex-end; }
@media (max-width: 800px) { .cs-row { grid-template-columns: 1fr; } }

/* mysql panel */
.sqlgrid-wrap { overflow: auto; max-height: 62vh; border: 1px solid var(--border, #e5e7eb); border-radius: 8px; }
.sqlgrid { border-collapse: collapse; font-size: 12.5px; min-width: 100%; }
.sqlgrid th { position: sticky; top: 0; background: var(--panel2); text-align: left; padding: 6px 10px; white-space: nowrap; cursor: default; border-bottom: 1px solid var(--border, #e5e7eb); }
.sqlgrid th.sortable { cursor: pointer; }
.sqlgrid td { padding: 5px 10px; border-bottom: 1px solid var(--border, #eef0f3); max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.sqlgrid td.num { text-align: right; }
.sqlgrid td.null { color: var(--muted, #94a3b8); font-style: italic; }
.sqlgrid tr:hover td { background: var(--panel2); }
.dbsplit { display: grid; grid-template-columns: 240px 1fr; gap: 14px; align-items: start; }
.dbtree { max-height: 70vh; overflow: auto; }
.dbtree button { display: block; width: 100%; text-align: left; margin: 2px 0; }
@media (max-width: 800px) { .dbsplit { grid-template-columns: 1fr; } }
.sqlarea { width: 100%; min-height: 150px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

/* slim status strip: a one-line health summary above a list (nginx on Domains, missing tools on Deploy) */
.strip { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); margin-bottom: 14px; min-height: 44px; }
.strip .grow { flex: 1; }
.strip .chips { gap: 6px; }
.strip .label { font-weight: 650; margin-right: 2px; }
.strip.warn { background: var(--warn-bg); border-color: transparent; } .strip.bad { background: var(--bad-bg); border-color: transparent; }
.strip pre { width: 100%; margin: 4px 0 0; }
.strip.hidden { display: none; }

/* narrow screens: table rows become cards instead of scrolling sideways (the title column on top, other cells labelled, actions last) */
@media (max-width: 640px) {
  .tablewrap { overflow-x: visible; }
  table.stack, table.stack tbody { display: block; }
  table.stack thead { display: none; }
  table.stack tr { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 0 0 10px; background: var(--panel); }
  table.stack td { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; border: 0; padding: 4px 0; text-align: right; white-space: normal; max-width: none; word-break: break-word; order: 1; }
  table.stack td::before { content: attr(data-label); flex: none; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; text-align: left; }
  table.stack td.st-title { order: 0; font-weight: 600; font-size: 14.5px; justify-content: flex-start; text-align: left; padding-bottom: 6px; }
  table.stack td.st-title::before { display: none; }
  table.stack td.st-hide, table.stack th.st-hide { display: none; }
  table.stack td.cell-actions { order: 2; justify-content: flex-end; padding-top: 8px; }
  table.stack td.cell-actions::before { display: none; }
  table.stack td > * { min-width: 0; }
}
}

/* segmented filter (counts per state), status dots, check rows */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--panel); flex-wrap: wrap; }
.seg button { border: 0; border-radius: 0; background: transparent; padding: 6px 12px; color: var(--text); font-weight: 500; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { background: var(--panel2); }
.seg button.active { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.seg .cnt { margin-left: 6px; font-size: 11.5px; opacity: .75; font-variant-numeric: tabular-nums; }
.seg button.has-failed:not(.active) { color: var(--bad); font-weight: 650; }
.sdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-left: 7px; background: var(--muted); vertical-align: middle; }
.sdot.ok { background: var(--ok); } .sdot.warn { background: var(--warn); } .sdot.bad { background: var(--bad); }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.check-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.check-row:first-of-type { border-top: 0; }
.check-row .t { min-width: 0; }
@media (max-width: 640px) { .check-row { align-items: flex-start; flex-wrap: wrap; } .check-row .t { flex: 1 1 100%; } .seg button { padding: 6px 10px; } }

/* "⋯" action menu */
details.menu { position: relative; display: inline-block; }
details.menu > summary { list-style: none; cursor: pointer; user-select: none; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu[open] > summary { background: var(--panel2); }
.menu-list { z-index: 60; min-width: 200px; max-width: 86vw; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .28); padding: 4px; display: grid; gap: 1px; }
details.menu:not([open]) > .menu-list { display: none; }
.menu-item { text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 7px; white-space: nowrap; }
.menu-item:hover { background: var(--panel2); }
.menu-item.danger { color: var(--bad); border: 0; } .menu-item.danger:hover { background: var(--bad-bg); }

/* list entries as cards */
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.item { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; box-shadow: var(--shadow); }
.item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.item-title { font-weight: 650; font-size: 15px; min-width: 0; overflow-wrap: anywhere; }
.item-sub { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.item-meta { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; font-size: 12.5px; align-items: baseline; }
.item-meta .k { color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
.item-meta .v { min-width: 0; overflow-wrap: anywhere; }
.item-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: auto; padding-top: 4px; }
@media (max-width: 640px) { .items { grid-template-columns: 1fr; } }

.btn.sm { padding: 3px 9px; font-size: 12px; }

/* collapsible form sections + a bar that keeps the main button in reach on long forms */
details.sec { border-top: 1px solid var(--line); }
details.sec:first-of-type { border-top: 0; }
details.sec > summary { cursor: pointer; padding: 12px 2px; font-weight: 650; font-size: 15px; list-style: none; display: flex; align-items: center; }
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary::before { content: '▸'; display: inline-block; width: 18px; color: var(--muted); transition: transform .12s; }
details.sec[open] > summary::before { transform: rotate(90deg); }
.sec-body { padding: 2px 2px 8px 18px; }
.sticky-bar { position: sticky; bottom: 0; background: var(--panel); border-top: 1px solid var(--line); margin: 8px -16px -16px; padding: 12px 16px; border-radius: 0 0 12px 12px; display: flex; gap: 8px; align-items: center; z-index: 5; }
.card > .row:first-child { margin-bottom: 10px; }

/* process list: one clamped line for the command, click to expand */
.proc { display: flex; flex-direction: column; gap: 1px; min-width: 0; max-width: 560px; }
.clamp { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); cursor: pointer; }
.clamp.open { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 640px) { .proc { max-width: none; } .clamp { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; } .clamp.open { -webkit-line-clamp: unset; } }
.fname { display: inline-flex; align-items: center; gap: 8px; } .fname .ico { color: var(--muted); flex: none; }

/* category pills */
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { border-radius: 999px; padding: 4px 12px; font-size: 12.5px; }
.pill .cnt { margin-left: 6px; opacity: .65; font-size: 11.5px; }
.pill.active { background: var(--accent); color: var(--accent-text); border-color: transparent; font-weight: 600; }
.pill:disabled { opacity: .55; }

/* log viewer: dark panel, one div per line, level colours, dimmed time/host, search matches highlighted */
.logview { background: var(--code); color: var(--code-text); border-radius: 10px; padding: 8px 0; overflow: auto; height: calc(100vh - 310px); min-height: 320px; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.ll { padding: 1px 14px; white-space: pre-wrap; overflow-wrap: anywhere; border-left: 3px solid transparent; }
.ll.err { background: rgba(248, 113, 113, .13); border-left-color: #f87171; color: #fecaca; }
.ll.warn { background: rgba(251, 191, 36, .10); border-left-color: #fbbf24; color: #fde68a; }
.ll .t { color: #7d8aa0; } .ll .u { color: #8ab4ff; }
.ll mark { background: rgba(250, 204, 21, .45); color: inherit; border-radius: 2px; padding: 0 1px; }
.ll.muted { color: #8b97ab; }
@media (max-width: 640px) { .logview { height: 60vh; } }
/* on/off switch (a checkbox) */
input.switch { appearance: none; -webkit-appearance: none; width: 34px; height: 20px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; border: 0; padding: 0; flex: none; transition: background .15s; vertical-align: middle; }
input.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
input.switch:checked { background: var(--ok); } input.switch:checked::after { transform: translateX(14px); }
input.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.clamp.plain { color: var(--text); }

/* ---- Files: pinned items */
.pinned-wrap { margin-bottom: 12px; }
.pin-hint { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 2px; }
.card.pinned { display: grid; gap: 10px; }
.pgroup { border: 1px dashed var(--border, #3a3f4b); border-radius: 10px; padding: 8px 10px; }
.pgroup.over { border-color: var(--accent, #4f8cff); background: color-mix(in srgb, var(--accent, #4f8cff) 8%, transparent); }
.pghead { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.pghead .cnt { color: var(--muted, #8a91a0); font-weight: 400; font-size: 12px; }
.pghead .menu { margin-left: auto; }
.pchips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; align-items: center; }
.pempty { color: var(--muted, #8a91a0); font-size: 12px; }
.pin { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--border, #3a3f4b); border-radius: 8px; padding: 0 2px 0 0; background: var(--panel2, transparent); max-width: 100%; }
.pin.active { border-color: var(--accent, #4f8cff); }
.pin.off { opacity: .55; }
.pin.dragging { opacity: .4; }
.pin-open { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 6px 8px; cursor: pointer; color: inherit; max-width: 240px; }
.pin-open span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.star.on svg, .star.on svg { fill: #f5b301; stroke: #f5b301; }

.dbtree button.sysdb { opacity: .6; }

/* Terminal: one block per command */
.tsession { display: grid; gap: 8px; align-content: start; }
.tblock { background: var(--code); color: var(--code-text); border-radius: 10px; padding: 8px 12px; }
.tblock.err { outline: 1px solid rgba(248, 113, 113, .5); }
.thead { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.tcmd { font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere; }
.tout { margin: 6px 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 12.5px; max-height: 60vh; overflow: auto; }
.tmeta { font-size: 12px; margin-top: 4px; }
.termbar select { max-width: 150px; }
.logview.nowrap .ll { white-space: pre; overflow-wrap: normal; }

.bad-text { color: #f87171; }
.warn-text { color: #fbbf24; }

/* Laravel log entries */
.lvlog { display: grid; gap: 4px; grid-template-columns: minmax(0, 1fr); }
.lvrow { min-width: 0; border: 1px solid var(--line, #2a2f3a); border-radius: 8px; background: var(--panel, transparent); }
.lvrow > summary { display: flex; gap: 10px; align-items: baseline; padding: 6px 10px; cursor: pointer; list-style: none; }
.lvrow > summary::-webkit-details-marker { display: none; }
.lvrow .t { color: var(--muted, #8a91a0); font-size: 12px; white-space: nowrap; }
.lvrow .msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; min-width: 0; }
.lvrow[open] .msg { white-space: normal; overflow-wrap: anywhere; }
.lvbody { padding: 4px 10px 10px; }
