/* Coral Web Tester dashboard (shares tokens with app.css) */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(90deg, #1f3656 248px, var(--page) 248px); }

/* ---------- sidebar ---------- */
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #1b2f4c 0%, #213a5c 100%); color: #dfe7f2; padding: 18px 14px;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; font-weight: 700; font-size: 15.5px; color: #fff; }
.logo-tile.sm { width: 34px; height: 34px; border-radius: 8px; }
.logo-tile.sm img { width: 24px; height: 24px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px;
  color: #c9d5e5; font-weight: 600; font-size: 14px; text-decoration: none; border: 1px solid transparent;
}
.side-nav a svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.side-nav a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; text-decoration: none; }
.side-nav a.active { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.18); color: #fff; }
.side-nav a.active svg { color: var(--accent); }
.side-foot { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid rgba(255, 255, 255, 0.12); display: grid; gap: 8px; }
.side-org { font-weight: 600; color: #fff; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-badge { justify-self: start; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: rgba(185, 228, 176, 0.16); color: var(--accent); }
.plan-badge:empty { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(15, 25, 40, 0.45); z-index: 40; }

/* ---------- top bar ---------- */
.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; min-height: 66px; padding: 10px 24px; display: flex; align-items: center; gap: 16px;
  background: #fff; border-bottom: 1px solid var(--card-line);
}
.icon-btn.menu-btn { display: none; }
.ctx { display: flex; align-items: flex-end; gap: 12px; flex: 1; min-width: 0; flex-wrap: wrap; }
.ctx-field { display: grid; gap: 3px; min-width: 0; }
.ctx-field > span { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--label); }
.ctx-field select { width: 220px; max-width: 100%; }
.ctx-url select { width: 330px; }
select, .input {
  font: inherit; font-size: 14px; color: var(--ink); background-color: #fff; border: 1px solid var(--field-line); border-radius: 8px;
  height: 38px; padding: 0 12px; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
select {
  padding-right: 32px; appearance: none; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237d8aa0' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 16px;
}
select:disabled { background-color: var(--info-bg); color: var(--muted); }
select:focus, .input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input { width: 100%; }
.input.narrow { width: 120px; }
.input.code { font: 12.5px/1.55 ui-monospace, "Cascadia Code", Consolas, monospace; min-height: 380px; white-space: pre; tab-size: 2; }

.user-menu { position: relative; margin-left: auto; }
.user-btn { display: flex; align-items: center; gap: 9px; border: 1px solid transparent; background: none; border-radius: 10px; padding: 5px 8px; font: inherit; font-weight: 600; font-size: 14px; color: var(--ink); cursor: pointer; }
.user-btn:hover { background: var(--info-bg); }
.chev { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #2f5bd3, #5b7ee0); color: #fff; font-size: 13px; font-weight: 700; flex: none; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; background: #fff; border: 1px solid var(--card-line); border-radius: 10px; box-shadow: 0 12px 32px rgba(18, 33, 59, 0.14); padding: 6px; display: grid; }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--card-line); margin-bottom: 4px; display: grid; }
.menu-head span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.menu a, .menu button { display: block; text-align: left; padding: 8px 10px; border-radius: 7px; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--info-bg); text-decoration: none; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--card-line); background: #fff; border-radius: 8px; cursor: pointer; flex: none; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-linecap: round; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 8px;
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; border: 1px solid transparent; white-space: nowrap; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn svg .solid { fill: currentColor; stroke: none; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.btn-primary { width: auto; margin: 0; height: 38px; background: var(--primary); color: #fff; }
.btn.btn-primary:hover { background: var(--primary-hover); }
.btn.btn-secondary { background: #fff; color: var(--ink); border-color: var(--field-line); }
.btn.btn-secondary:hover { background: var(--info-bg); }
.btn.btn-danger { background: var(--danger); color: #fff; }
.btn.btn-danger:hover { background: #a92832; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.loading { cursor: progress; }
.btn.loading::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: spin 0.8s linear infinite; }
.btn-link { border: 0; background: none; padding: 0; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--primary); cursor: pointer; }
.btn-link:hover { text-decoration: underline; }
.danger-text { color: var(--danger) !important; }
.ok-text { color: var(--ok); }
.bad-text { color: var(--danger); }
.run-text { color: #b7791f; }

/* ---------- page ---------- */
.content { padding: 28px 28px 48px; outline: none; }
.page { max-width: 1240px; margin: 0 auto; display: grid; gap: 18px; }
.narrow-page { max-width: 860px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.3px; }
.page-head p { margin: 4px 0 0; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { display: flex; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: -6px; min-width: 0; }
.crumbs a { font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; }
code { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; background: var(--info-bg); padding: 1px 5px; border-radius: 4px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pad { padding: 16px 18px; }
.pad-x { padding: 12px 18px 0; margin: 0; }
.pad-b { padding-bottom: 16px; }
.pad-m { margin: 12px 18px 16px; }

.panel { background: #fff; border: 1px solid var(--card-line); border-radius: 12px; box-shadow: 0 1px 2px rgba(18, 33, 59, 0.04); min-width: 0; }
.panel-title { display: flex; align-items: center; gap: 9px; margin: 0; padding: 14px 18px; border-bottom: 1px solid var(--card-line); font-size: 14.5px; font-weight: 700; }
.panel-title svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.panel-title .btn-link { margin-left: auto; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.bad { background: var(--danger-bg); color: var(--danger); }
.badge.warn, .badge.run { background: #fdf4e3; color: #9a6510; }
.badge.muted { background: var(--info-bg); color: var(--muted); }

/* ---------- apps ---------- */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.app-card {
  display: flex; flex-direction: column; gap: 8px; padding: 18px; background: #fff; border: 1px solid var(--card-line); border-radius: 12px;
  color: var(--ink); font-weight: 400; text-decoration: none; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.app-card:hover { border-color: #b9c6dc; box-shadow: 0 8px 24px rgba(18, 33, 59, 0.08); text-decoration: none; transform: translateY(-1px); }
.app-card h3 { margin: 4px 0 0; font-size: 16px; }
.app-card-top { display: flex; justify-content: space-between; align-items: center; }
.app-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, #1b2f4c, #2f5bd3); color: #fff; font-weight: 700; flex: none; }
.app-icon.lg { width: 50px; height: 50px; font-size: 20px; border-radius: 12px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; min-height: 2.9em; font-size: 13.5px; }
.app-meta { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.app-meta span { display: inline-flex; align-items: center; gap: 5px; }
.app-meta svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.app-foot { display: flex; align-items: center; gap: 8px; padding-top: 10px; margin-top: auto; border-top: 1px solid var(--card-line); font-size: 12.5px; }
.app-title { display: flex; gap: 14px; align-items: center; min-width: 0; }
.app-title h1 { overflow-wrap: anywhere; }

.empty { text-align: center; padding: 56px 24px; background: #fff; border: 1px dashed var(--field-line); border-radius: 14px; display: grid; justify-items: center; gap: 6px; }
.empty h2 { margin: 6px 0 0; font-size: 18px; }
.empty p { margin: 0 0 12px; max-width: 460px; color: var(--muted); }
.empty-icon { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; background: var(--info-bg); }
.empty-icon svg { width: 26px; height: 26px; fill: none; stroke: var(--primary); stroke-width: 1.6; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--card-line); overflow-x: auto; }
.tab { padding: 10px 14px; font-size: 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
#tabBody { display: grid; gap: 18px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat { background: #fff; border: 1px solid var(--card-line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 4px; align-content: start; }
.stat-label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--label); }
.stat-value { font-size: 24px; font-weight: 700; }
.stat-value .badge { font-size: 13px; }
.callout { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 12px; background: #eaf0fd; border: 1px solid #cbd8f6; flex-wrap: wrap; }
.callout p { margin: 4px 0 0; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--label); padding: 10px 18px; background: #f8fafc; border-bottom: 1px solid var(--card-line); white-space: nowrap; }
.table td { padding: 11px 18px; border-bottom: 1px solid var(--card-line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table.small td, .table.small th { padding: 8px 14px; font-size: 12.5px; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: #f8fafc; }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions .btn-link + .btn-link { margin-left: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { border: 1px solid var(--field-line); background: #fff; border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer; }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip.static { cursor: default; background: var(--info-bg); border-color: transparent; }

.dropzone {
  display: grid; justify-items: center; gap: 6px; text-align: center; padding: 28px 18px; border: 2px dashed #c3cede; border-radius: 12px;
  background: #fafbfd; cursor: pointer; transition: border-color 0.15s, background 0.15s; font-size: 14px;
}
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: #f2f6fe; }
.dropzone .link { color: var(--primary); font-weight: 600; }
.dropzone .small { max-width: 620px; }
.dz-icon svg { width: 30px; height: 30px; fill: none; stroke: var(--primary); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.result { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--info-bg); font-size: 13.5px; display: grid; gap: 8px; }
.result.ok { background: #f1f9f4; border: 1px solid #cde9d7; }
.result.bad { background: var(--danger-bg); border: 1px solid #f4c7cc; color: #7d1d25; }
.result.warn { background: #fdf6e7; border: 1px solid #f1dcae; color: #7a5410; }
.result.run { background: #fdf6e7; display: flex; align-items: center; gap: 10px; margin-top: 0; }
.result p { margin: 0; }
.result details summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.pre { white-space: pre-wrap; word-break: break-word; background: #0f1a2b; color: #dbe5f3; border-radius: 8px; padding: 12px; margin: 8px 0 0; font: 12px/1.5 ui-monospace, Consolas, monospace; max-height: 340px; overflow: auto; }
.code-block { margin: 16px 18px; }
.file-list { margin: 6px 0 0; padding-left: 18px; max-height: 200px; overflow: auto; }
.spinner { display: inline-block; width: 15px; height: 15px; border-radius: 50%; border: 2px solid #c3cede; border-top-color: var(--primary); animation: spin 0.8s linear infinite; vertical-align: -2px; flex: none; }

/* ---------- forms in panels / modals ---------- */
.form { margin-top: 0; display: grid; }
.form .label { margin: 12px 0 6px; }
.form .label:first-child { margin-top: 0; }
.form > .btn { justify-self: start; margin-top: 14px; }
.form > p.small { margin: 12px 0 0; }
.form-error { margin: 8px 0 0; font-size: 13px; color: var(--danger); }
.form-error:empty { display: none; }
.optional { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 20px; }
.form-grid .label { margin-top: 10px; }
.readonly { height: 38px; display: flex; align-items: center; padding: 0 12px; border-radius: 8px; background: var(--info-bg); color: var(--ink-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-grid .muted.small { margin: 5px 0 0; }
.profile-head { display: flex; gap: 14px; align-items: center; padding: 18px; border-bottom: 1px solid var(--card-line); }
.profile-head h2 { margin: 0; font-size: 18px; }
.profile-head p { margin: 2px 0 0; }
#profileForm .row { margin-top: 16px; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(15, 25, 40, 0.5); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.modal-box { width: 100%; max-width: 520px; background: #fff; border-radius: 14px; padding: 22px 24px; box-shadow: 0 24px 64px rgba(10, 20, 35, 0.3); }
.modal-box.wide { max-width: 980px; }
.modal-box > p { font-size: 14px; }
.modal-box > .label { margin: 14px 0 6px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.modal-head h2 { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

/* ---------- run view ---------- */
.run-status { padding: 16px 18px; display: grid; gap: 14px; }
.progress { height: 9px; background: var(--info-bg); border-radius: 999px; overflow: hidden; display: flex; }
.progress span { display: block; height: 100%; width: 0; transition: width 0.3s; }
.p-pass { background: #2e9e5b; }
.p-fail { background: var(--danger); }
.p-skip { background: #a3adbb; }
.counts { display: flex; gap: 28px; flex-wrap: wrap; }
.counts div { display: grid; }
.counts b { font-size: 22px; line-height: 1.15; }
.counts span { font-size: 12.5px; color: var(--muted); }
.run-grid { display: grid; grid-template-columns: minmax(260px, 400px) minmax(0, 1fr); gap: 18px; align-items: start; }
.test-list { max-height: 640px; overflow: auto; }
.test-row { display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--card-line); cursor: pointer; font-size: 13.5px; }
.test-row:hover, .test-row.sel { background: #f5f8fd; }
.dot { width: 11px; height: 11px; border-radius: 50%; margin-top: 4px; background: #cdd5e1; }
.dot.running { background: #e0a948; animation: pulse 1s infinite; }
.dot.passed { background: #2e9e5b; }
.dot.failed { background: var(--danger); }
.dot.skipped { background: #a3adbb; }
@keyframes pulse { 50% { opacity: 0.35; } }
.live { display: grid; gap: 12px; }
.activity { font-weight: 600; font-size: 14px; }
.shot { border: 1px solid var(--card-line); border-radius: 10px; background: var(--info-bg); min-height: 240px; display: grid; place-items: center; overflow: hidden; }
.shot img { width: 100%; display: block; }
.steps { list-style: none; margin: 0; padding: 0; max-height: 340px; overflow: auto; }
.steps li { display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--card-line); font-size: 13px; }
.steps li[data-shot] { cursor: pointer; }
.steps li.err { color: var(--danger); }
.log { margin: 0; border-radius: 0 0 12px 12px; max-height: 300px; }
.failure { border: 1px solid var(--card-line); border-left: 4px solid var(--danger); border-radius: 8px; padding: 10px 14px; margin-bottom: 10px; font-size: 13.5px; display: grid; gap: 3px; }

/* ---------- billing ---------- */
.current-plan .plan-name { font-size: 22px; font-weight: 700; }
.current-plan p { margin: 6px 0 0; }
.meters { display: grid; gap: 16px; }
.meter { display: grid; gap: 6px; }
.meter-top { display: flex; justify-content: space-between; font-size: 13.5px; }
.meter-bar { height: 8px; border-radius: 999px; background: var(--info-bg); overflow: hidden; }
.meter-bar span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.meter-bar span.hot { background: #e0802d; }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.plan { position: relative; border: 1px solid var(--card-line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.plan.current { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.plan h3 { margin: 0; font-size: 16px; }
.plan-flag { position: absolute; top: 16px; right: 16px; }
.price-row { display: flex; align-items: baseline; gap: 4px; }
.price { font-size: 26px; font-weight: 800; }
.plan ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13.5px; display: grid; gap: 4px; flex: 1; align-content: start; }
.plan .btn { margin-top: 6px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .run-grid, .grid-2 { grid-template-columns: 1fr; }
  .plans { grid-template-columns: 1fr; }
  .ctx-url select { width: 260px; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; width: 260px; transform: translateX(-100%); transition: transform 0.2s; }
  .sidebar.open { transform: none; }
  .icon-btn.menu-btn { display: grid; }
  .shell { background: var(--page); }
  .topbar { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .ctx { order: 3; flex-basis: 100%; }
  .ctx-field { flex: 1 1 160px; }
  .ctx-field select, .ctx-url select { width: 100%; }
  .ctx .btn { flex: 1 1 100%; }
  .user-name { display: none; }
  .content { padding: 20px 16px 40px; }
  .form-grid { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 21px; }
  .counts { gap: 18px; }
  .stats { grid-template-columns: 1fr 1fr; }
}

/* ---------- API tests ---------- */
.method { display: inline-block; min-width: 54px; text-align: center; font: 700 11px/1 ui-monospace, Consolas, monospace; padding: 4px 6px; border-radius: 5px; background: var(--info-bg); color: var(--ink); }
.method.m-get { background: #e7f5ec; color: #1e7a46; }
.method.m-post { background: #fdf4e3; color: #9a6510; }
.method.m-put, .method.m-patch { background: #eaf0fd; color: #2449b8; }
.method.m-delete { background: var(--danger-bg); color: var(--danger); }
.code-tag { font: 700 12px/1 ui-monospace, Consolas, monospace; padding: 3px 7px; border-radius: 5px; }
.code-tag.ok { background: var(--ok-bg); color: var(--ok); }
.code-tag.warn { background: #fdf4e3; color: #9a6510; }
.code-tag.bad { background: var(--danger-bg); color: var(--danger); }
.wrap { word-break: break-all; }
.run-bar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.run-bar .grow { flex: 1 1 320px; display: grid; gap: 6px; }
.run-bar .grow span { font-size: 12px; font-weight: 600; color: var(--label); }
.api-progress { height: 6px; background: var(--info-bg); border-radius: 99px; overflow: hidden; margin-top: 12px; }
.api-progress span { display: block; height: 100%; background: var(--primary); transition: width 0.4s; }
.stats.stats-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.api-results { overflow: hidden; }
.api-req { border-bottom: 1px solid var(--card-line); }
.api-req:last-child { border-bottom: 0; }
.api-req > summary { display: flex; align-items: center; gap: 12px; padding: 12px 18px; cursor: pointer; list-style: none; }
.api-req > summary::-webkit-details-marker { display: none; }
.api-req > summary:hover { background: #f8fafc; }
.api-req[open] > summary { background: #f8fafc; border-bottom: 1px solid var(--card-line); }
.api-name { flex: 1; min-width: 0; }
.api-meta { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.api-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.api-dot.pass { background: var(--ok); }
.api-dot.fail { background: var(--danger); }
.tests { list-style: none; margin: 0; padding: 10px 18px 4px 58px; display: grid; gap: 6px; font-size: 13px; }
.api-req:not([open]) .tests { padding-bottom: 12px; margin-top: -6px; }
.tests li { display: flex; gap: 10px; align-items: flex-start; }
.t-tag { font: 700 10.5px/1 ui-monospace, Consolas, monospace; padding: 3px 6px; border-radius: 4px; flex: none; min-width: 38px; text-align: center; }
.t-pass .t-tag { background: var(--ok-bg); color: var(--ok); }
.t-fail .t-tag { background: var(--danger-bg); color: var(--danger); }
.t-skip .t-tag { background: #fdf4e3; color: #9a6510; }
.api-io { padding: 8px 18px 16px; }
.api-io h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--label); margin: 8px 0; }
.api-io .kv td { padding: 4px 8px; }
@media (max-width: 760px) {
  .stats.stats-5 { grid-template-columns: 1fr 1fr; }
  .api-req > summary { flex-wrap: wrap; }
  .api-meta { width: 100%; padding-left: 21px; }
  .tests { padding-left: 18px; }
}
.detected { gap: 10px; }
.detect-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; }
.preview-table { margin-top: 12px; max-height: 320px; overflow: auto; border: 1px solid var(--card-line); border-radius: 10px; }
.preview-table th { position: sticky; top: 0; }
#auDrop { margin-bottom: 4px; }
.need-form { display: grid; grid-template-columns: minmax(160px, 1fr) auto; gap: 8px; align-items: center; min-width: 280px; margin: 0; }
.need-form .input { height: 34px; }
.need-form .btn { height: 34px; }
.need-form .form-error { grid-column: 1 / -1; margin: 0; }
.need-form .form-error:empty { display: none; }
.need-cell { width: 45%; }
.secrets { margin-top: 18px; }
@media (max-width: 760px) { .need-form { min-width: 0; grid-template-columns: 1fr; } .need-cell { width: auto; } }
.btn.btn-sm { height: 30px; padding: 0 11px; font-size: 13px; gap: 5px; }
.btn.btn-sm svg { width: 13px; height: 13px; }
.panel-title .ml-auto { margin-left: auto; }
.need-cell .need-form { margin-top: 6px; }
.api-req .pad-x.row { padding-top: 10px; }
details.inline { display: inline; }
details.inline summary { display: inline; cursor: pointer; color: var(--primary); }

/* ---------- API workspace (Postman-style) ---------- */
.page.ws-page { max-width: none; }
.ws-top { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.ws-title { flex: 1 1 260px; min-width: 0; }
.ws-title h1 { margin: 0; font-size: 22px; }
.ws-rename { border: 0; background: none; font: inherit; color: inherit; padding: 0; cursor: text; text-align: left; }
.ws-rename:hover { text-decoration: underline dotted; }
.ws-target { display: grid; gap: 4px; min-width: 260px; }
.ws-target span { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--label); }
.ws-custom { width: 280px; }
.ws-body { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 14px; align-items: start; }
.ws-side { position: sticky; top: 12px; max-height: calc(100vh - 140px); display: flex; flex-direction: column; }
.ws-side-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--card-line); }
.ws-list { overflow: auto; padding: 6px; display: grid; gap: 2px; }
.ws-folder { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--label); padding: 8px 8px 2px; }
.ws-item { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 7px 8px; border-radius: 7px; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; text-align: left; }
.ws-item:hover { background: var(--info-bg); }
.ws-item.on { background: #eaf0fd; box-shadow: inset 3px 0 0 var(--primary); }
.ws-item .method { min-width: 50px; font-size: 10px; }
.ws-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-dirty { width: 7px; height: 7px; border-radius: 50%; background: #e0a948; flex: none; }
.ws-main { display: grid; gap: 14px; min-width: 0; }
.ws-editor { padding: 14px 16px; display: grid; gap: 10px; }
.ws-namebar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ws-name { flex: 1 1 220px; font-weight: 600; }
.ws-folder-in { flex: 0 1 200px; }
.ws-namebar-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ws-urlbar { display: flex; gap: 0; }
.ws-urlbar .ws-method { width: 120px; border-radius: 8px 0 0 8px; font-weight: 700; font-family: ui-monospace, Consolas, monospace; }
.ws-urlbar .ws-url { flex: 1; border-radius: 0; border-left: 0; min-width: 0; }
.ws-urlbar .ws-send { border-radius: 0 8px 8px 0; padding: 0 22px; }
.ws-method.m-get { color: #1e7a46; } .ws-method.m-post { color: #9a6510; } .ws-method.m-put, .ws-method.m-patch { color: #2449b8; } .ws-method.m-delete { color: var(--danger); }
.ws-resolved { line-height: 1.6; word-break: break-all; }
.ws-var { background: var(--info-bg); border-radius: 4px; padding: 0 3px; }
.ws-var.ok { background: #e7f5ec; color: #1e5b37; }
.ws-var.missing { background: var(--danger-bg); color: var(--danger); }
.ws-needs { background: #fdf6e7; border-radius: 8px; padding: 6px 10px; }
.ws-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--card-line); flex-wrap: wrap; }
.ws-tab { border: 0; background: none; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted); padding: 8px 12px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.ws-tab.on { color: var(--ink); border-bottom-color: var(--primary); }
.ws-count { font-size: 11px; background: var(--info-bg); border-radius: 99px; padding: 1px 6px; color: var(--label); }
.ws-count.ok { background: var(--ok-bg); color: var(--ok); } .ws-count.bad { background: var(--danger-bg); color: var(--danger); }
.ws-tabbody { display: grid; gap: 10px; min-height: 120px; }
.kv-table { width: 100%; border-collapse: collapse; }
.kv-table td, .kv-table th { padding: 3px 4px; text-align: left; font-size: 12px; color: var(--label); }
.kv-table .input { height: 32px; font-size: 12.5px; }
.kv-table td:last-child { width: 36px; }
.icon-btn.sm { width: 28px; height: 28px; font-size: 16px; line-height: 1; color: var(--muted); }
.ws-auth { max-width: 520px; }
.ws-bodytext { min-height: 220px; }
.ws-ctype { max-width: 300px; }
.ws-test { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ws-test .input { height: 32px; font-size: 12.5px; width: auto; min-width: 110px; flex: 1 1 140px; }
.ws-test select.input { flex: 0 0 auto; }
.ws-test.unsupported { background: #fdf6e7; border-radius: 8px; padding: 6px 8px; }
.ws-response { min-height: 120px; }
.ws-empty { padding: 36px; text-align: center; }
.ws-reshead { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; padding: 6px 14px 0; flex-wrap: wrap; border-bottom: 1px solid var(--card-line); }
.ws-reshead .ws-tabs { border-bottom: 0; }
.ws-reshead .api-meta { padding-bottom: 8px; }
.ws-saved { padding: 8px 14px 0; color: var(--ok); }
.ws-resbody { padding: 10px 14px 16px; max-height: 60vh; overflow: auto; }
.ws-resbody .tests { padding-left: 0; }
.jtree { font: 12.5px/1.6 ui-monospace, Consolas, monospace; }
.jtree details > summary { cursor: pointer; list-style: none; }
.jtree details > summary::before { content: "▾ "; color: var(--muted); }
.jtree details:not([open]) > summary::before { content: "▸ "; }
.jkids { padding-left: 18px; border-left: 1px dashed var(--card-line); margin-left: 4px; }
.jk { color: #7a3e9d; }
.jp { color: var(--muted); }
.jv { border: 0; background: none; font: inherit; padding: 0 2px; border-radius: 3px; cursor: pointer; text-align: left; word-break: break-all; }
.jv:hover { background: #fdf4e3; outline: 1px dashed #e0a948; }
.jv.js { color: #1e7a46; } .jv.jnum { color: #2449b8; } .jv.jb, .jv.jn { color: #9a6510; }
.ws-h3 { font-size: 14px; margin: 18px 0 6px; }
.ws-more { display: grid; gap: 8px; }
@media (max-width: 900px) {
  .ws-body { grid-template-columns: 1fr; }
  .ws-side { position: static; max-height: 260px; }
  .ws-urlbar { flex-wrap: wrap; }
  .ws-urlbar .ws-method { border-radius: 8px 0 0 0; }
  .ws-urlbar .ws-url { flex-basis: calc(100% - 120px); border-radius: 0 8px 0 0; border-left: 1px solid var(--field-line); }
  .ws-urlbar .ws-send { width: 100%; border-radius: 0 0 8px 8px; }
}
