:root {
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --bg: #ffffff;
  --bg-side: #f7f7f8;
  --bg-sunken: #f2f3f5;
  --bg-hover: #eceef1;
  --bg-active: #e3e8f0;
  --line: #e2e4e8;
  --line-strong: #cfd3d9;
  --text: #1d2127;
  --text-2: #4b525c;
  --muted: #7d848e;
  --accent: #d9480f;
  --accent-hover: #c2410c;
  --accent-soft: #fdf0e9;
  --focus: #3b82f6;
  --danger: #c92a2a;
  --top: #1b1e23;
  --top-text: #e6e8eb;
  --top-muted: #9aa1ab;
  --top-line: #2c3138;

  --get: #2b8a3e; --post: #c77700; --put: #1864ab; --patch: #7048e8; --delete: #c92a2a; --other: #5c6773;
  --ok: #2b8a3e; --redir: #1864ab; --warn: #c77700; --err: #c92a2a;
  --j-key: #a3400e; --j-str: #2b8a3e; --j-num: #1864ab; --j-bool: #7048e8; --j-null: #868e96;
  --shadow: 0 6px 24px rgba(16, 20, 26, .12), 0 1px 3px rgba(16, 20, 26, .08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16191d; --bg-side: #1b1e23; --bg-sunken: #121417; --bg-hover: #23272d; --bg-active: #2a3038;
    --line: #2a2f36; --line-strong: #3a4049; --text: #e4e6e9; --text-2: #b7bcc3; --muted: #858c96;
    --accent: #f76707; --accent-hover: #fd7e14; --accent-soft: #2e2119; --danger: #ff6b6b;
    --top: #111315; --top-line: #24282e;
    --get: #51cf66; --post: #fcc419; --put: #4dabf7; --patch: #9775fa; --delete: #ff6b6b; --other: #adb5bd;
    --ok: #51cf66; --redir: #4dabf7; --warn: #fcc419; --err: #ff6b6b;
    --j-key: #ffa94d; --j-str: #8ce99a; --j-num: #74c0fc; --j-bool: #b197fc; --j-null: #868e96;
    --shadow: 0 8px 28px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  --bg: #16191d; --bg-side: #1b1e23; --bg-sunken: #121417; --bg-hover: #23272d; --bg-active: #2a3038;
  --line: #2a2f36; --line-strong: #3a4049; --text: #e4e6e9; --text-2: #b7bcc3; --muted: #858c96;
  --accent: #f76707; --accent-hover: #fd7e14; --accent-soft: #2e2119; --danger: #ff6b6b;
  --top: #111315; --top-line: #24282e;
  --get: #51cf66; --post: #fcc419; --put: #4dabf7; --patch: #9775fa; --delete: #ff6b6b; --other: #adb5bd;
  --ok: #51cf66; --redir: #4dabf7; --warn: #fcc419; --err: #ff6b6b;
  --j-key: #ffa94d; --j-str: #8ce99a; --j-num: #74c0fc; --j-bool: #b197fc; --j-null: #868e96;
  --shadow: 0 8px 28px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 13px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
svg.i { width: 15px; height: 15px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
svg.i.sm { width: 13px; height: 13px; }

input, select, textarea {
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 8px; height: 30px; outline: none; min-width: 0;
}
textarea { height: auto; padding: 8px; font-family: var(--mono); font-size: 12.5px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 2px color-mix(in srgb, var(--focus) 20%, transparent); }
input[type=checkbox], input[type=radio] { height: auto; accent-color: var(--accent); margin: 0; }
input:disabled, select:disabled, textarea:disabled { background: var(--bg-sunken); color: var(--text-2); }

.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 4px; cursor: pointer; white-space: nowrap;
  background: var(--bg); border: 1px solid var(--line-strong); color: var(--text); font-weight: 500;
}
.btn:hover { background: var(--bg-hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--danger); }
.btn.quiet { border-color: transparent; background: transparent; }
.btn.quiet:hover { background: var(--bg-hover); }
.btn.icon { width: 30px; padding: 0; justify-content: center; }
.btn.sm { height: 26px; padding: 0 8px; font-size: 12px; }
.btn.sm.icon { width: 26px; padding: 0; }
.btn:disabled { opacity: .45; cursor: default; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.row { display: flex; gap: 8px; align-items: center; }
.grow { flex: 1; min-width: 0; }
.err { color: var(--danger); }
.boot { padding: 40px; text-align: center; color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 18px; padding: 0 6px; border-radius: 3px; font-size: 11px; font-weight: 500; background: var(--bg-sunken); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }
.tag.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.kbd { font-family: var(--mono); font-size: 11px; padding: 1px 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 3px; color: var(--text-2); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--bg-side); }
.login-card { width: 100%; max-width: 340px; }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; font-size: 18px; margin-bottom: 22px; }
.login form { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 22px; display: grid; gap: 14px; }
.login h2 { margin: 0; font-size: 15px; }
.field { display: grid; gap: 5px; }
.field > span { font-size: 12px; font-weight: 500; color: var(--text-2); }
.login .btn { justify-content: center; height: 34px; }
.login-foot { margin-top: 14px; font-size: 12px; color: var(--muted); text-align: center; }
.logo { width: 24px; height: 24px; border-radius: 5px; background: #e03131; display: grid; place-items: center; color: #fff; flex: none; }
.logo svg { width: 15px; height: 15px; stroke: #fff; stroke-width: 2.4; }

/* ---------- shell ---------- */
.shell { height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 42px minmax(0, 1fr) 24px; }
.topbar { display: flex; align-items: center; gap: 4px; padding: 0 10px; background: var(--top); color: var(--top-text); border-bottom: 1px solid var(--top-line); }
.topbar .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-right: 14px; letter-spacing: .1px; }
.topbar .brand .logo { width: 22px; height: 22px; }
.topbar .sep { width: 1px; height: 20px; background: var(--top-line); margin: 0 8px; }
.topbar .spacer { flex: 1; }
.top-select { display: flex; align-items: center; gap: 7px; height: 28px; padding: 0 8px; border-radius: 4px; color: var(--top-text); position: relative; min-width: 0; border: 0; background: transparent; cursor: pointer; font: inherit; max-width: 300px; }
.top-select .val { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-select .caret { position: static; color: var(--top-muted); }
.top-select[aria-expanded="true"], .top-select:focus-visible { background: rgba(255,255,255,.1); outline: none; }
.top-select:hover { background: rgba(255,255,255,.07); }
.top-select .lbl { font-size: 11px; color: var(--top-muted); text-transform: uppercase; letter-spacing: .4px; }
.top-select select { appearance: none; background: transparent; border: 0; color: var(--top-text); height: 28px; padding: 0 16px 0 0; font-weight: 600; cursor: pointer; max-width: 220px; box-shadow: none; }
.top-select select option, .top-select select optgroup { color: #1d2127; background: #fff; }
.top-select .caret { position: absolute; right: 6px; pointer-events: none; color: var(--top-muted); }
.top-btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; border: 0; border-radius: 4px; background: transparent; color: var(--top-text); cursor: pointer; }
.top-btn:hover { background: rgba(255,255,255,.08); }
.top-btn:disabled { opacity: .4; cursor: default; }
.avatar { width: 24px; height: 24px; border-radius: 50%; background: #3a4049; color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 700; }

.main { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 0; }
.sidebar { background: var(--bg-side); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side-head { display: flex; align-items: center; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.seg { display: flex; flex: 1; gap: 2px; }
.seg button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 28px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 500; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--bg); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.side-tools { display: flex; gap: 6px; padding: 8px; }
.search { position: relative; flex: 1; }
.search svg { position: absolute; left: 8px; top: 8px; color: var(--muted); }
.search input { width: 100%; padding-left: 28px; background: var(--bg); }
.tree { overflow: auto; flex: 1; padding-bottom: 16px; }
.node { display: flex; align-items: center; gap: 5px; height: 27px; padding-right: 4px; cursor: pointer; user-select: none; color: var(--text-2); position: relative; }
.node:hover { background: var(--bg-hover); color: var(--text); }
.node.sel { background: var(--bg-active); color: var(--text); }
.node.sel::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--accent); }
.node .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node .act { visibility: hidden; }
.node:hover .act, .node.sel .act { visibility: visible; }
.node .chev, .node .fold { color: var(--muted); }
.node.col { color: var(--text); font-weight: 600; height: 30px; }
.node.empty-row { color: var(--muted); font-style: italic; cursor: default; }
.node.empty-row:hover { background: transparent; }
.mt { font-family: var(--mono); font-size: 10px; font-weight: 700; width: 38px; flex: none; letter-spacing: .2px; }
.mt-GET { color: var(--get); } .mt-POST { color: var(--post); } .mt-PUT { color: var(--put); } .mt-PATCH { color: var(--patch); } .mt-DELETE { color: var(--delete); } .mt-HEAD, .mt-OPTIONS { color: var(--other); }
.side-empty { padding: 28px 18px; color: var(--muted); text-align: center; line-height: 1.6; }
.hist-day { padding: 10px 12px 4px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.hist .node { height: auto; padding-top: 5px; padding-bottom: 5px; padding-left: 12px; align-items: flex-start; }
.hist .url { font-family: var(--mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist .meta { font-size: 11px; color: var(--muted); display: flex; gap: 8px; }
.sc { font-family: var(--mono); font-weight: 600; }
.sc-2 { color: var(--ok); } .sc-3 { color: var(--redir); } .sc-4 { color: var(--warn); } .sc-5, .sc-x { color: var(--err); }

/* ---------- work ---------- */
.work { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.tabs { display: flex; height: 36px; background: var(--bg-side); border-bottom: 1px solid var(--line); overflow-x: auto; flex: none; }
.tab { display: flex; align-items: center; gap: 6px; padding: 0 6px 0 12px; border-right: 1px solid var(--line); cursor: pointer; max-width: 210px; flex: none; color: var(--muted); position: relative; }
.tab:hover { color: var(--text); }
.tab.on { background: var(--bg); color: var(--text); }
.tab.on::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--accent); }
.tab .mt { width: auto; }
.tab .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.tab .x { display: grid; place-items: center; width: 20px; height: 20px; border: 0; border-radius: 3px; background: transparent; color: var(--muted); cursor: pointer; padding: 0; }
.tab .x:hover { background: var(--bg-hover); color: var(--text); }
.tab-add { display: grid; place-items: center; width: 36px; border: 0; background: transparent; color: var(--muted); cursor: pointer; flex: none; }
.tab-add:hover { color: var(--text); background: var(--bg-hover); }

.editor { flex: 1; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.panes { flex: 1; display: flex; min-height: 0; min-width: 0; border-top: 1px solid var(--line); }
.panes.v { flex-direction: column; }
.panes.h { flex-direction: row; }
.panes > .pane { border-top: 0; min-width: 0; min-height: 0; }
.panes > .pane.req { flex: 0 0 45%; }
.panes > .pane.res { flex: 1 1 0; }
.panes.v > .pane.req { min-height: 90px; }
.panes.h > .pane.req { min-width: 260px; }
.panes.h > .pane.res { min-width: 260px; }
.splitter { flex: none; position: relative; background: var(--line); z-index: 2; touch-action: none; }
.splitter.v { height: 1px; cursor: row-resize; }
.splitter.h { width: 1px; cursor: col-resize; }
.splitter::after { content: ""; position: absolute; inset: -4px; }
.splitter.v::after { inset: -4px 0; }
.splitter.h::after { inset: 0 -4px; }
.splitter:hover, .splitter.drag { background: var(--accent); }
.splitter.v:hover, .splitter.v.drag { box-shadow: 0 0 0 1px var(--accent); }
.splitter.h:hover, .splitter.h.drag { box-shadow: 0 0 0 1px var(--accent); }
body.resizing-h, body.resizing-h * { cursor: col-resize !important; user-select: none !important; }
body.resizing-v, body.resizing-v * { cursor: row-resize !important; user-select: none !important; }
.main { position: relative; }
.side-resizer { position: absolute; top: 0; bottom: 0; width: 7px; margin-left: -4px; cursor: col-resize; z-index: 5; touch-action: none; grid-row: 1; grid-column: 2; justify-self: start; }
.side-resizer:hover { background: linear-gradient(90deg, transparent 3px, var(--accent) 3px, var(--accent) 4px, transparent 4px); }
.req-head { display: flex; align-items: center; gap: 4px; padding: 10px 16px 0; min-width: 0; }
.crumb { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }
.name-input { border: 1px solid transparent; background: transparent; font-weight: 600; font-size: 14px; padding: 0 6px; height: 28px; min-width: 60px; flex: 1; max-width: 420px; }
.name-input:hover { border-color: var(--line); }
.req-line { display: flex; gap: 8px; padding: 8px 16px 12px; }
.url-group { flex: 1; display: flex; border: 1px solid var(--line-strong); border-radius: 4px; min-width: 0; background: var(--bg); }
.url-group:focus-within { border-color: var(--focus); box-shadow: 0 0 0 2px color-mix(in srgb, var(--focus) 20%, transparent); }
.url-group select { border: 0; border-right: 1px solid var(--line); border-radius: 4px 0 0 4px; width: 104px; height: 34px; font-family: var(--mono); font-weight: 700; font-size: 12px; background: var(--bg-sunken); box-shadow: none; cursor: pointer; }
.url-group select:focus { box-shadow: none; }
.url-group input { border: 0; flex: 1; height: 34px; font-family: var(--mono); font-size: 12.5px; box-shadow: none; background: transparent; }
.url-group input:focus { box-shadow: none; }
.req-line .btn { height: 36px; }
.req-line .send { min-width: 84px; justify-content: center; }

.pane { display: flex; flex-direction: column; min-height: 0; border-top: 1px solid var(--line); }
.subtabs { display: flex; align-items: stretch; padding: 0 10px; border-bottom: 1px solid var(--line); flex: none; height: 34px; overflow-x: auto; }
.subtabs > button { border: 0; background: transparent; padding: 0 10px; color: var(--muted); cursor: pointer; position: relative; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-weight: 500; }
.subtabs > button:hover { color: var(--text); }
.subtabs > button.on { color: var(--text); }
.subtabs > button.on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--accent); }
.subtabs .n { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.subtabs .on .n { color: var(--accent); }
.subtabs .title { display: flex; align-items: center; padding: 0 8px 0 4px; font-weight: 600; color: var(--text); }
.subtabs .meta { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--muted); padding-left: 12px; white-space: nowrap; }
.subtabs .meta b { color: var(--text); font-weight: 600; }
.status-chip { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 3px; font-family: var(--mono); font-size: 11.5px; font-weight: 700; }
.status-chip.s2 { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.status-chip.s3 { background: color-mix(in srgb, var(--redir) 14%, transparent); color: var(--redir); }
.status-chip.s4 { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.status-chip.s5, .status-chip.sx { background: color-mix(in srgb, var(--err) 14%, transparent); color: var(--err); }
.pane-body { flex: 1; overflow: auto; padding: 10px 16px; min-height: 0; }
.pane-body textarea.code { width: 100%; min-height: 160px; height: calc(100% - 38px); }
.toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; flex-wrap: wrap; min-height: 26px; }
.toolbar label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; color: var(--text-2); }
.seg-sm { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 4px; overflow: hidden; }
.seg-sm button { border: 0; background: transparent; padding: 0 10px; height: 24px; cursor: pointer; color: var(--muted); font-size: 12px; }
.seg-sm button + button { border-left: 1px solid var(--line-strong); }
.seg-sm button.on { background: var(--bg-active); color: var(--text); font-weight: 600; }

.kv { width: 100%; border-collapse: collapse; table-layout: fixed; }
.kv th { text-align: left; font-weight: 500; color: var(--muted); font-size: 11.5px; padding: 0 8px 5px; }
.kv td { border: 1px solid var(--line); padding: 0; height: 30px; }
.kv td.chk, .kv th.chk { width: 32px; text-align: center; }
.kv td.del, .kv th.del { width: 32px; text-align: center; }
.kv td.flag, .kv th.flag { width: 64px; text-align: center; }
.kv td.ro { padding: 0 8px; font-family: var(--mono); font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv tr.off input[type=text] { color: var(--muted); }
.kv input[type=text], .kv input[type=password] { width: 100%; border: 0; border-radius: 0; background: transparent; font-family: var(--mono); font-size: 12.5px; height: 29px; box-shadow: none; }
.kv input[type=text]:focus, .kv input[type=password]:focus { background: var(--bg-sunken); box-shadow: none; }
.kv input:disabled { background: transparent; }
.kv .rm { visibility: hidden; }
.kv tr:hover .rm { visibility: visible; }
.form { display: grid; grid-template-columns: 150px minmax(0, 420px); gap: 10px 14px; align-items: center; }
.form > label { color: var(--text-2); font-size: 12.5px; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.hint { font-size: 12px; color: var(--muted); margin: 8px 0 0; line-height: 1.5; }

.resp-empty { height: 100%; display: grid; place-items: center; color: var(--muted); text-align: center; }
.pre { font-family: var(--mono); font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; margin: 0; tab-size: 2; }
.j-k { color: var(--j-key); } .j-s { color: var(--j-str); } .j-n { color: var(--j-num); } .j-b { color: var(--j-bool); } .j-z { color: var(--j-null); }
.notice { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 4px; margin-bottom: 10px; border: 1px solid var(--line); background: var(--bg-sunken); color: var(--text-2); }
.notice svg { margin-top: 2px; }
.notice.warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 8%, transparent); }
.notice.err { border-color: color-mix(in srgb, var(--err) 45%, transparent); background: color-mix(in srgb, var(--err) 7%, transparent); color: var(--text); }
.hdrs { border-collapse: collapse; font-family: var(--mono); font-size: 12px; width: 100%; }
.hdrs td { padding: 4px 16px 4px 0; vertical-align: top; word-break: break-all; border-bottom: 1px solid var(--line); }
.hdrs td:first-child { color: var(--text-2); white-space: nowrap; width: 1%; font-weight: 600; }
iframe.preview { width: 100%; height: calc(100% - 40px); min-height: 280px; border: 1px solid var(--line); background: #fff; border-radius: 4px; }
img.preview { max-width: 100%; }
.agent-box { max-width: 520px; margin: 8px auto; }
.agent-box h4 { margin: 0 0 6px; font-size: 13.5px; }
.welcome { display: grid; place-items: center; height: 100%; padding: 20px; }
.welcome-in { max-width: 340px; width: 100%; }
.welcome h3 { margin: 0 0 12px; font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.act-list { display: grid; gap: 2px; margin-bottom: 22px; }
.act-list button { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border: 0; border-radius: 4px; background: transparent; cursor: pointer; color: var(--text-2); text-align: left; }
.act-list button:hover { background: var(--bg-hover); color: var(--text); }
.act-list button svg { color: var(--muted); }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; font-size: 12px; color: var(--muted); align-items: center; }

/* ---------- statusbar ---------- */
.statusbar { display: flex; align-items: center; gap: 2px; padding: 0 8px; background: var(--bg-side); border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); min-width: 0; overflow: hidden; }
.statusbar .it { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 7px; border-radius: 3px; border: 0; background: transparent; color: inherit; font-size: 11.5px; white-space: nowrap; }
.statusbar button.it { cursor: pointer; }
.statusbar button.it:hover { background: var(--bg-hover); color: var(--text); }
.statusbar .spacer { flex: 1; }
.led { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); flex: none; }
.led.on { background: var(--ok); }
.led.off { background: var(--err); }

/* ---------- menu, modal, toast ---------- */
.modal .body.flush > .right { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.modal .body.flush > .right > .scroll { flex: 1; overflow: auto; padding: 14px 18px; }
.menu { position: fixed; z-index: 50; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 5px; box-shadow: var(--shadow); padding: 4px; min-width: 190px; }
.menu button { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; border: 0; background: transparent; height: 28px; padding: 0 9px; border-radius: 3px; cursor: pointer; color: var(--text); }
.menu button svg { color: var(--muted); }
.menu button:hover { background: var(--bg-hover); }
.menu button.danger, .menu button.danger svg { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.menu .head { padding: 6px 9px 6px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu .head b { display: block; color: var(--text); font-size: 13px; }
.overlay { position: fixed; inset: 0; background: rgba(12, 14, 17, .45); z-index: 40; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--bg); border: 1px solid var(--line-strong); border-radius: 6px; width: 100%; max-width: 440px; max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.modal.wide { max-width: 960px; height: 80vh; }
.modal.mid { max-width: 600px; }
.modal > header { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 10px 0 18px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 14px; flex: none; }
.modal > header .x { margin-left: auto; }
.modal > .body { padding: 16px 18px; overflow: auto; flex: 1; min-height: 0; }
.modal > .body.flush { padding: 0; display: flex; flex-direction: column; }
.modal > footer { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); flex: none; }
.modal .field { margin-bottom: 12px; }
.modal .field input, .modal .field select, .modal .field textarea { width: 100%; }
.split { display: grid; grid-template-columns: 220px minmax(0, 1fr); flex: 1; min-height: 0; }
.split > .left { border-right: 1px solid var(--line); background: var(--bg-side); display: flex; flex-direction: column; min-height: 0; }
.split > .left .list { flex: 1; overflow: auto; padding: 4px 0; }
.split > .left .foot { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
.split > .right { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.split > .right .scroll { flex: 1; overflow: auto; padding: 14px 18px; }
.split > .right .bar { display: flex; gap: 8px; align-items: center; padding: 10px 18px; border-top: 1px solid var(--line); }
.split > .right .subtabs { padding: 0 8px; }
.group-lbl { padding: 10px 12px 4px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.li { display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; cursor: pointer; color: var(--text-2); position: relative; }
.li:hover { background: var(--bg-hover); color: var(--text); }
.li.sel { background: var(--bg-active); color: var(--text); font-weight: 600; }
.li.sel::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--accent); }
.li .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li svg { color: var(--muted); }
.env-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.env-head input { font-weight: 600; font-size: 14px; max-width: 280px; }
.env-head .ttl { font-weight: 600; font-size: 14px; }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data th, table.data td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th { color: var(--muted); font-weight: 500; font-size: 11.5px; position: sticky; top: 0; background: var(--bg); z-index: 1; }
table.data tr:hover td { background: var(--bg-side); }
.members { border: 1px solid var(--line); border-radius: 4px; max-height: 340px; overflow: auto; }
.members label { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.members label:last-child { border-bottom: 0; }
.members .who { flex: 1; }
.members .sub { color: var(--muted); font-size: 12px; }
.radio-list { display: grid; gap: 10px; margin-bottom: 14px; }
.radio-list label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.radio-list label input { margin-top: 3px; }
.radio-list .sub { display: block; color: var(--muted); font-size: 12px; }
.steps { margin: 0 0 14px; padding-left: 18px; color: var(--text-2); line-height: 1.9; }
code, .code-inline { font-family: var(--mono); font-size: 12px; background: var(--bg-sunken); border: 1px solid var(--line); padding: 1px 5px; border-radius: 3px; }
.toast { position: fixed; bottom: 34px; left: 50%; transform: translateX(-50%); background: var(--top); color: var(--top-text); padding: 8px 14px; border-radius: 4px; z-index: 60; max-width: 90vw; box-shadow: var(--shadow); font-size: 12.5px; }
.toast.error { background: var(--danger); color: #fff; }

@media (max-width: 760px) {
  .main { grid-template-columns: minmax(0, 1fr) !important; }
  .sidebar { display: none; }
  .main.side-open .sidebar { display: flex; position: fixed; top: 42px; bottom: 24px; left: 0; width: 86vw; z-index: 30; box-shadow: var(--shadow); }
  .topbar .brand span, .top-select .lbl, .topbar .sep, .hide-m { display: none !important; }
  .topbar .brand { margin-right: 4px; }
  .top-select select { max-width: 96px; }
  .req-line { flex-wrap: wrap; }
  .url-group { flex: 1 1 100%; }
  .req-line .send { flex: 1; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .split > .left { max-height: 170px; border-right: 0; border-bottom: 1px solid var(--line); }
  .form { grid-template-columns: minmax(0, 1fr); }
  .subtabs .meta { gap: 8px; }
}
@media (min-width: 761px) { .only-m { display: none !important; } }
a.btn { text-decoration: none; }

/* scrollbar tipis (Chromium / Electron) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 35%, transparent); border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--muted) 60%, transparent); background-clip: content-box; }
::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; height: 0; width: 0; }

/* ---------- ITMAN v3 ---------- */
.url-group select.mt-GET { color: var(--get); } .url-group select.mt-POST { color: var(--post); } .url-group select.mt-PUT { color: var(--put); }
.url-group select.mt-PATCH { color: var(--patch); } .url-group select.mt-DELETE { color: var(--delete); } .url-group select.mt-HEAD, .url-group select.mt-OPTIONS { color: var(--other); }
.url-group select option { background: var(--bg); font-weight: 700; }
.url-group select option.mt-GET { color: var(--get); } .url-group select option.mt-POST { color: var(--post); } .url-group select option.mt-PUT { color: var(--put); }
.url-group select option.mt-PATCH { color: var(--patch); } .url-group select option.mt-DELETE { color: var(--delete); } .url-group select option.mt-HEAD, .url-group select option.mt-OPTIONS { color: var(--other); }

.menu-group { padding: 8px 9px 3px; font-size: 10.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.menu-check { width: 15px; display: inline-grid; place-items: center; color: var(--accent); flex: none; }
.menu button.on { font-weight: 600; }
.menu-hint { font-size: 11px; color: var(--muted); }

.file-cell { display: flex; align-items: center; gap: 8px; padding: 0 6px; height: 29px; min-width: 0; }
.file-cell .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 12px; }
.file-cell .fname.warn { color: var(--warn); }
.kv td.ftype, .kv th.ftype { width: 78px; }
.kv td.ftype select { width: 100%; height: 29px; border: 0; border-radius: 0; background: transparent; font-size: 12px; box-shadow: none; }

.script-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 14px; height: 100%; min-height: 220px; }
.script-main { display: flex; flex-direction: column; min-height: 0; }
.script-main textarea.script { flex: 1; width: 100%; min-height: 160px; resize: none; }
.snippets { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.snippets button { text-align: left; border: 0; background: transparent; color: var(--accent); padding: 4px 6px; border-radius: 3px; cursor: pointer; font-size: 12.5px; }
.snippets button:hover { background: var(--bg-hover); }
.snippets .hint { margin-top: 10px; }
.snip-title { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; padding: 2px 6px 6px; }
.modal .right > .scroll .script-wrap { min-height: 320px; }

.test-chip { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 3px; border: 0; font-size: 11.5px; font-weight: 600; cursor: pointer; }
.test-chip.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.test-chip.bad { background: color-mix(in srgb, var(--err) 14%, transparent); color: var(--err); }
.tests { display: grid; gap: 2px; }
.test-row { display: flex; gap: 10px; align-items: flex-start; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.test-row .badge { font-family: var(--mono); font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 3px; flex: none; margin-top: 1px; }
.test-row.ok .badge { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.test-row.bad .badge { background: color-mix(in srgb, var(--err) 15%, transparent); color: var(--err); }
.test-row.skip .badge { background: var(--bg-sunken); color: var(--muted); }
.test-err { color: var(--err); font-family: var(--mono); font-size: 12px; margin-top: 2px; }
.console { font-family: var(--mono); font-size: 12px; }
.console .log { display: flex; gap: 10px; padding: 4px 2px; border-bottom: 1px solid var(--line); }
.console .log .phase { color: var(--muted); font-size: 10.5px; width: 30px; flex: none; padding-top: 2px; }
.console .log.warn { color: var(--warn); } .console .log.error { color: var(--err); } .console .log.info { color: var(--redir); }
.console .pre { flex: 1; }

.modal.code { max-width: 820px; }
.code-view { margin: 0; padding: 12px 14px; background: var(--bg-sunken); border: 1px solid var(--line); border-radius: 4px; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; white-space: pre; overflow: auto; max-height: 55vh; user-select: text; }

.layout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 6px; }
.layout-opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line-strong); border-radius: 5px; cursor: pointer; }
.layout-opt.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.layout-opt input { display: none; }
.layout-opt svg { width: 22px; height: 22px; color: var(--muted); }
.layout-opt.on svg { color: var(--accent); }
.layout-opt .sub { display: block; font-size: 12px; color: var(--muted); }
td.trunc { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar.is-desktop { padding-left: 6px; }

@media (max-width: 760px) {
  .side-resizer { display: none; }
  .script-wrap { grid-template-columns: minmax(0, 1fr); }
  .layout-grid { grid-template-columns: 1fr; }
}

/* banner pembaruan desktop */
.update-banner { position: fixed; right: 16px; bottom: 36px; z-index: 45; display: flex; align-items: center; gap: 12px; width: 520px; max-width: calc(100vw - 32px);
  padding: 12px 14px; background: var(--bg); border: 1px solid var(--line-strong); border-left: 3px solid #e03131; border-radius: 6px; box-shadow: var(--shadow); }
.update-banner > svg { color: #e03131; width: 18px; height: 18px; }
.update-banner .muted { font-size: 12px; }
.statusbar .upd-ready { color: #e03131; font-weight: 600; }

/* konfirmasi keluar (desktop) */
.leave p { margin: 0 0 10px; }
.leave-list { border: 1px solid var(--line); border-radius: 4px; margin-bottom: 12px; max-height: 220px; overflow: auto; }
.leave-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.leave-item:last-child { border-bottom: 0; }
.leave-item .name { flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leave-item .muted { font-size: 12px; }
.modal footer .btn.danger { border-color: color-mix(in srgb, var(--danger) 40%, var(--line-strong)); }

/* ---------- pengaturan ---------- */
:root { --code-fs: 12.5px; }
.pre, textarea.code, .code-view, .url-group input, .kv input[type=text], .kv input[type=password], .kv td.ro, .hdrs, .console, textarea.script { font-size: var(--code-fs) !important; }
body.nowrap-resp .pane.res .pre { white-space: pre; word-break: normal; overflow-wrap: normal; }
.settings h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 18px 0 10px; font-weight: 600; }
.settings h3:first-child { margin-top: 2px; }
.settings > p { margin: 0 0 10px; }
.set-row { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-title { font-weight: 500; }
.set-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.set-actions { margin-top: 14px; }
.layout-grid.three { grid-template-columns: repeat(3, 1fr); }
.switch { position: relative; display: inline-block; width: 36px; height: 20px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track { position: absolute; inset: 0; border-radius: 20px; background: var(--line-strong); transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 2px color-mix(in srgb, var(--focus) 40%, transparent); }
.switch.disabled { opacity: .45; cursor: default; }
.sessions { border: 1px solid var(--line); border-radius: 5px; }
.session { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.session:last-child { border-bottom: 0; }
.session > svg { width: 18px; height: 18px; color: var(--muted); }
.session.current { background: var(--bg-side); }
.session .tag { margin-left: 8px; }
.session .muted { font-size: 12px; margin-top: 2px; }
.about-head { display: flex; align-items: center; gap: 14px; margin: 4px 0 18px; }
.logo.big { width: 48px; height: 48px; border-radius: 11px; }
.logo.big svg { width: 28px; height: 28px; }
.about-name { font-size: 20px; font-weight: 700; }
table.data.about td:first-child { width: 200px; }
.keys-inline { display: inline-flex; gap: 4px; }
table.data.shortcuts td:first-child { width: 190px; }
.cl-ver { padding: 10px 0 12px; border-bottom: 1px solid var(--line); }
.cl-ver:last-child { border-bottom: 0; }
.cl-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.cl-head .tag { margin-left: 6px; }
.cl-ver ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 5px; }
.cl-ver li { display: flex; gap: 10px; align-items: baseline; }
.cl-type { flex: none; width: 96px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.cl-type.new { color: var(--ok); } .cl-type.fix { color: var(--err); } .cl-type.improve { color: var(--redir); }
.whats-new { position: fixed; left: 16px; bottom: 36px; z-index: 44; display: flex; align-items: center; gap: 10px; width: 460px; max-width: calc(100vw - 32px);
  padding: 12px 14px; background: var(--bg); border: 1px solid var(--line-strong); border-left: 3px solid #e03131; border-radius: 6px; box-shadow: var(--shadow); }
.whats-new .muted { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-btn { position: relative; }
.avatar-dot { position: absolute; top: 3px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: #e03131; border: 2px solid var(--top); }
@media (max-width: 760px) { .layout-grid.three { grid-template-columns: 1fr; } .set-row { flex-wrap: wrap; } }
