:root,
:root[data-theme="dark"] {
  --ag-ok-bg: rgba(143, 190, 149, 0.14);
  --ag-ok-border: rgba(143, 190, 149, 0.35);
  --ag-warning-bg: rgba(229, 176, 110, 0.13);
  --ag-warning-border: rgba(229, 176, 110, 0.34);
  --ag-danger-bg: rgba(224, 95, 88, 0.13);
  --ag-danger-border: rgba(224, 95, 88, 0.36);
  --ag-info-bg: rgba(217, 119, 87, 0.14);
  --ag-info-border: rgba(217, 119, 87, 0.34);
}

:root[data-theme="light"] {
  --ag-ok-bg: rgba(5, 150, 105, 0.1);
  --ag-ok-border: rgba(5, 150, 105, 0.24);
  --ag-warning-bg: rgba(217, 119, 6, 0.11);
  --ag-warning-border: rgba(217, 119, 6, 0.26);
  --ag-danger-bg: rgba(220, 38, 38, 0.1);
  --ag-danger-border: rgba(220, 38, 38, 0.24);
  --ag-info-bg: rgba(2, 132, 199, 0.1);
  --ag-info-border: rgba(2, 132, 199, 0.24);
}

.ag-topbar {
  gap: 1rem;
  min-height: 64px;
  padding-inline: 1.25rem;
}

.ag-nav-left {
  flex: 1 1 auto;
  min-width: 0;
}

.ag-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.ag-brand-name {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
}

.ag-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-left: 0.5rem;
  min-width: 0;
  overflow: visible;
}

.ag-tab {
  color: var(--text-dim);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.46rem 0.68rem;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.ag-tab:hover {
  color: var(--text);
  border-color: var(--border);
  background: var(--panel-2);
}

.ag-tab.active {
  color: var(--text);
  border-color: rgba(217, 119, 87, 0.48);
  background:
    linear-gradient(180deg, rgba(217, 119, 87, 0.18), rgba(229, 176, 110, 0.09)),
    var(--panel-2);
  box-shadow: inset 0 1px 0 rgba(250, 249, 245, 0.07);
}

.ag-tab-group {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.ag-tab-group::after {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 0.45rem;
  content: "";
}

.ag-tab-parent {
  position: relative;
  cursor: pointer;
  appearance: none;
  padding-right: 1.35rem;
  font-family: inherit;
}

.ag-tab-parent::after {
  position: absolute;
  right: 0.48rem;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  content: "";
  transform: translateY(-35%);
  opacity: 0.7;
}

.ag-tab-menu {
  position: absolute;
  z-index: 50;
  top: calc(100% + 0.35rem);
  left: 0;
  display: none;
  min-width: 9.5rem;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 44px var(--shadow);
  pointer-events: auto;
}

.ag-tab-group:hover .ag-tab-menu,
.ag-tab-group:focus-within .ag-tab-menu {
  display: grid;
  gap: 0.2rem;
}

.ag-tab-menu-item {
  color: var(--text-dim);
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0.48rem 0.58rem;
  font-size: 0.76rem;
  font-weight: 850;
  text-decoration: none;
}

.ag-tab-menu-item:hover,
.ag-tab-menu-item.active {
  color: var(--text);
  border-color: rgba(217, 119, 87, 0.36);
  background: var(--panel-2);
}

.ag-nav-right {
  flex-shrink: 0;
}

.ag-page {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 1.5rem;
}

.ag-page-netscan {
  width: 100%;
  max-width: none;
  padding: 0;
}

.ag-content-shell {
  min-height: calc(100vh - 64px);
}

.ag-page-netscan .ns-dashboard,
.ag-page-netscan .ns-main {
  min-height: auto;
}

.ag-monitor-head {
  margin: 1.25rem 1.25rem 0;
}

.ag-monitor-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
}

.card,
.scan-card,
.test-progress {
  background:
    linear-gradient(180deg, rgba(250, 249, 245, 0.045), rgba(250, 249, 245, 0.015)),
    var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 18px 44px var(--shadow);
}

.card {
  padding: 1.35rem;
  margin-bottom: 1.25rem;
}

.card-header,
.scan-card-head,
.test-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 850;
  line-height: 1.25;
}

.card-header {
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
  text-transform: none;
}

label {
  display: block;
  margin-bottom: 0.42rem;
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 850;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="time"],
input[type="week"],
textarea,
select {
  width: 100%;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.62rem 0.72rem;
  font: inherit;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

select {
  min-height: 2.65rem;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%;
  background-size:
    6px 6px,
    6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.35rem;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.78;
}

textarea {
  min-height: 7.5rem;
  resize: vertical;
  line-height: 1.45;
  font-family: "SF Mono", "Cascadia Code", "Fira Code", ui-monospace, monospace;
}

input[type="checkbox"].ag-check {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 20px;
  min-width: 20px;
  height: 20px;
  color: #17130f;
  background: var(--panel-2);
  border: 2px solid var(--text-muted);
  border-radius: 5px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  vertical-align: middle;
}

input[type="checkbox"].ag-check:checked {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
}

input[type="checkbox"].ag-check:checked::after {
  width: 5px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: rotate(45deg) translate(-1px, -1px);
}

input[type="checkbox"].ag-check:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.16);
}

.form-group {
  margin-bottom: 1rem;
}

.form-row,
.form-actions,
.scan-title,
.scan-actions,
.scan-meta,
.diagnostic-row,
.runtime-strip,
.link-row,
.flex {
  display: flex;
}

.form-row {
  gap: 1rem;
}

.batch-toolbar {
  align-items: flex-end;
  padding: 0.85rem;
  margin-bottom: 1rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.batch-toolbar .form-group {
  margin-bottom: 0;
}

.batch-actions {
  max-width: 180px;
}

.form-row .form-group {
  flex: 1;
}

.sort-control {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: min(320px, 100%);
}

.sort-control-inline {
  flex-shrink: 0;
}

.sort-control label {
  margin-bottom: 0;
  white-space: nowrap;
}

.sort-control select {
  min-height: 36px;
  padding-block: 0.42rem;
  font-size: 0.78rem;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.85rem 0 0;
  color: var(--text-dim);
  font-size: 0.76rem;
}

.pagination-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pagination-actions button {
  min-height: 30px;
  padding: 0.32rem 0.62rem;
  font-size: 0.74rem;
}

.pagination-actions span,
.pagination-summary {
  font-weight: 750;
}

.form-actions,
.scan-card-head {
  align-items: center;
  justify-content: space-between;
}

.scan-title,
.scan-actions,
.scan-meta,
.diagnostic-row,
.runtime-strip,
.link-row {
  align-items: center;
  flex-wrap: wrap;
}

.scan-actions {
  gap: 0.5rem;
  justify-content: flex-end;
}

.resource-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.resource-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0.28rem 0.58rem;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
}

.resource-action.icon-only {
  width: 2.1rem;
  min-width: 2.1rem;
  height: 2.1rem;
  min-height: 2.1rem;
  padding: 0;
}

.resource-action:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--panel-3);
}

.resource-action-primary {
  color: #17130f;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.resource-action.danger {
  color: var(--danger);
  border-color: var(--ag-danger-border);
  background: var(--ag-danger-bg);
}

.resource-action .ag-icon {
  width: 0.86rem;
  height: 0.86rem;
}

.proxy-list-actions {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  min-width: max-content;
}

.fast-picker-form {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0;
  margin: 0;
}

.fast-count-input {
  width: 52px;
  min-height: 34px;
  padding: 0.28rem 0.35rem;
  font-size: 0.74rem;
  font-weight: 850;
  text-align: center;
}

.fast-pick-button {
  min-width: 48px;
  min-height: 34px;
  padding: 0.28rem 0.45rem;
  font-size: 0.72rem;
  line-height: 1;
}

.proxy-row-actions {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  min-width: max-content;
}

.proxy-list-name-cell {
  font-size: 0.82rem;
}

.proxy-list-link {
  color: var(--text);
  font-weight: 850;
  text-decoration: none;
}

.proxy-list-link:hover {
  color: var(--accent-2);
}

.proxy-detail-head {
  align-items: flex-start;
}

.proxy-detail-title {
  margin-top: 0.35rem;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 850;
}

.proxy-detail-stats {
  justify-content: flex-start;
  padding: 0.2rem 0 0;
}

.proxy-raw-cell {
  max-width: 520px;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.proxy-runtime-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  color: var(--text-dim);
  font-size: 0.72rem;
}

.proxy-runtime-cell strong {
  color: var(--text);
}

.proxy-edit-grid {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) minmax(180px, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
  padding: 0.45rem 0;
}

.proxy-edit-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.proxy-list-icon-button,
.fast-preset-button {
  flex: 0 0 auto;
  border-radius: 7px;
  padding: 0;
  font-size: 0.72rem;
  line-height: 1;
}

.proxy-list-icon-button {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
}

.fast-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, 34px);
  gap: 0.25rem;
}

.fast-preset-button {
  width: 34px;
  min-width: 34px;
  min-height: 26px;
  color: var(--text);
  font-weight: 850;
}

.ag-icon {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  background-color: currentColor;
  vertical-align: middle;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hero-square-2-stack,
.hero-play,
.hero-no-symbol,
.hero-trash,
.hero-pencil-square,
.hero-eye,
.hero-stop-circle,
.hero-arrow-down-tray,
.hero-server-stack,
.hero-globe-alt,
.hero-bolt,
.hero-cpu-chip,
.hero-clock,
.hero-user,
.hero-key,
.hero-arrow-path,
.hero-x-mark-solid {
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.hero-square-2-stack {
  --hero-square-2-stack: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6A2.25 2.25 0 0 0 14.25 3.75H6A2.25 2.25 0 0 0 3.75 6v8.25A2.25 2.25 0 0 0 6 16.5h2.25m8.25-8.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-7.5A2.25 2.25 0 0 1 8.25 18v-7.5a2.25 2.25 0 0 1 2.25-2.25h6Z"/></svg>');
  -webkit-mask-image: var(--hero-square-2-stack);
  mask-image: var(--hero-square-2-stack);
}

.hero-play {
  --hero-play: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M4.5 5.653c0-1.427 1.529-2.33 2.779-1.643l11.54 6.347c1.295.712 1.295 2.573 0 3.286L7.28 19.99c-1.25.687-2.779-.217-2.779-1.643V5.653Z" clip-rule="evenodd"/></svg>');
  -webkit-mask-image: var(--hero-play);
  mask-image: var(--hero-play);
}

.hero-no-symbol {
  --hero-no-symbol: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M18.364 18.364A9 9 0 0 0 5.636 5.636m12.728 12.728A9 9 0 0 1 5.636 5.636m12.728 12.728L5.636 5.636"/></svg>');
  -webkit-mask-image: var(--hero-no-symbol);
  mask-image: var(--hero-no-symbol);
}

.hero-trash {
  --hero-trash: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673A2.25 2.25 0 0 1 15.916 21.75H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"/></svg>');
  -webkit-mask-image: var(--hero-trash);
  mask-image: var(--hero-trash);
}

.hero-pencil-square {
  --hero-pencil-square: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"/></svg>');
  -webkit-mask-image: var(--hero-pencil-square);
  mask-image: var(--hero-pencil-square);
}

.hero-eye {
  --hero-eye: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"/><path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/></svg>');
  -webkit-mask-image: var(--hero-eye);
  mask-image: var(--hero-eye);
}

.hero-stop-circle {
  --hero-stop-circle: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Z" stroke="black" stroke-width="1.7"/><path d="M9 9h6v6H9z" fill="black" rx="1"/></svg>');
  -webkit-mask-image: var(--hero-stop-circle);
  mask-image: var(--hero-stop-circle);
}

.hero-arrow-down-tray {
  --hero-arrow-down-tray: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M7.5 10.5 12 15m0 0 4.5-4.5M12 15V3"/></svg>');
  -webkit-mask-image: var(--hero-arrow-down-tray);
  mask-image: var(--hero-arrow-down-tray);
}

.hero-server-stack {
  --hero-server-stack: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M3.75 7.5A2.25 2.25 0 0 1 6 5.25h12a2.25 2.25 0 0 1 2.25 2.25v1.5A2.25 2.25 0 0 1 18 11.25H6A2.25 2.25 0 0 1 3.75 9V7.5Zm0 7.5A2.25 2.25 0 0 1 6 12.75h12A2.25 2.25 0 0 1 20.25 15v1.5A2.25 2.25 0 0 1 18 18.75H6a2.25 2.25 0 0 1-2.25-2.25V15Zm3-7.125h.008v.008H6.75v-.008Zm0 7.5h.008v.008H6.75v-.008Z"/></svg>');
  -webkit-mask-image: var(--hero-server-stack);
  mask-image: var(--hero-server-stack);
}

.hero-globe-alt {
  --hero-globe-alt: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M12 21a9 9 0 1 0 0-18m0 18a9 9 0 1 1 0-18m0 18c2.25-2.45 3.375-5.45 3.375-9S14.25 5.45 12 3m0 18c-2.25-2.45-3.375-5.45-3.375-9S9.75 5.45 12 3M3.75 12h16.5"/></svg>');
  -webkit-mask-image: var(--hero-globe-alt);
  mask-image: var(--hero-globe-alt);
}

.hero-bolt {
  --hero-bolt: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="m13.5 2.25-9 11.25h7.5l-1.5 8.25 9-11.25H12l1.5-8.25Z"/></svg>');
  -webkit-mask-image: var(--hero-bolt);
  mask-image: var(--hero-bolt);
}

.hero-cpu-chip {
  --hero-cpu-chip: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M8.25 3v2.25M12 3v2.25M15.75 3v2.25M8.25 18.75V21M12 18.75V21m3.75-2.25V21M3 8.25h2.25M3 12h2.25M3 15.75h2.25m13.5-7.5H21M18.75 12H21m-2.25 3.75H21M7.5 5.25h9A2.25 2.25 0 0 1 18.75 7.5v9A2.25 2.25 0 0 1 16.5 18.75h-9A2.25 2.25 0 0 1 5.25 16.5v-9A2.25 2.25 0 0 1 7.5 5.25Zm2.25 4.5h4.5v4.5h-4.5v-4.5Z"/></svg>');
  -webkit-mask-image: var(--hero-cpu-chip);
  mask-image: var(--hero-cpu-chip);
}

.hero-clock {
  --hero-clock: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M12 6v6l3.75 2.25M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>');
  -webkit-mask-image: var(--hero-clock);
  mask-image: var(--hero-clock);
}

.hero-user {
  --hero-user: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M15.75 7.5a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.5 20.25a8.25 8.25 0 0 1 15 0"/></svg>');
  -webkit-mask-image: var(--hero-user);
  mask-image: var(--hero-user);
}

.hero-key {
  --hero-key: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M15.75 6.75a5.25 5.25 0 1 0-4.95 6.986L9 15.536V18h2.464l1.8-1.8h2.486v-2.486l1.05-1.05a5.232 5.232 0 0 0-1.05-5.914ZM17.25 6.75h.008v.008h-.008V6.75Z"/></svg>');
  -webkit-mask-image: var(--hero-key);
  mask-image: var(--hero-key);
}

.hero-arrow-path {
  --hero-arrow-path: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M16.023 9.348h4.992V4.356M2.985 19.644v-4.992h4.992m12.008-5.304A8.96 8.96 0 0 0 12 4.5a8.96 8.96 0 0 0-7.997 4.85m-.018 5.302A8.96 8.96 0 0 0 12 19.5a8.96 8.96 0 0 0 7.997-4.85"/></svg>');
  -webkit-mask-image: var(--hero-arrow-path);
  mask-image: var(--hero-arrow-path);
}

.hero-x-mark-solid {
  --hero-x-mark-solid: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd"/></svg>');
  -webkit-mask-image: var(--hero-x-mark-solid);
  mask-image: var(--hero-x-mark-solid);
}

@media (max-width: 900px) {
  .proxy-edit-grid {
    grid-template-columns: 1fr;
  }

  .proxy-edit-actions {
    justify-content: flex-start;
  }
}

.scan-meta,
.diagnostic-row {
  gap: 0.8rem;
  margin-top: 0.7rem;
  color: var(--text-dim);
  font-size: 0.72rem;
}

.diagnostic-row strong {
  color: var(--text);
}

button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 36px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.48rem 0.78rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

button:hover,
.btn:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--panel-3);
}

button.primary,
.btn.primary {
  color: #17130f;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

button.danger,
.btn.danger {
  color: var(--danger);
  border-color: var(--ag-danger-border);
  background: var(--ag-danger-bg);
}

button:disabled,
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

th {
  color: var(--text-dim);
  padding: 0.58rem 0.65rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.68rem;
  font-weight: 850;
  text-align: left;
}

td {
  padding: 0.62rem 0.65rem;
  border-bottom: 1px solid var(--border);
}

tr:hover td {
  background: var(--panel-2);
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.15rem 0.52rem;
  font-size: 0.7rem;
  font-weight: 850;
}

.pill.green {
  color: var(--cpa);
  background: var(--ag-ok-bg);
  border: 1px solid var(--ag-ok-border);
}

.pill.red {
  color: var(--danger);
  background: var(--ag-danger-bg);
  border: 1px solid var(--ag-danger-border);
}

.pill.yellow {
  color: var(--accent-2);
  background: var(--ag-warning-bg);
  border: 1px solid var(--ag-warning-border);
}

.pill.blue,
.pill.gray {
  color: var(--accent);
  background: var(--ag-info-bg);
  border: 1px solid var(--ag-info-border);
}

.stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.05rem 1.25rem;
  padding: 0.15rem 0 0.95rem;
}

.stat {
  min-width: 88px;
}

.stat .num {
  color: var(--text);
  font-size: 1.55rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.stat .label {
  color: var(--text-dim);
  font-size: 0.68rem;
  font-weight: 850;
}

.stat.cracked .num,
.text-green {
  color: var(--cpa);
}

.stat.banned .num,
.text-red {
  color: var(--danger);
}

.stat.remaining .num,
.text-yellow {
  color: var(--accent-2);
}

.stat.progress .num,
.text-blue {
  color: var(--accent);
}

.text-muted {
  color: var(--text-dim);
}

.progress-bar {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-2);
}

.progress-bar .fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 260ms ease;
}

.stage-progress-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.7rem;
}

.stage-progress-lane {
  min-width: 0;
  padding: 0.54rem 0.62rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(250, 249, 245, 0.025);
}

.stage-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
  color: var(--text-dim);
  font-size: 0.68rem;
  font-weight: 850;
}

.stage-progress-head span {
  min-width: 0;
}

.stage-progress-title {
  display: grid;
  gap: 0.18rem;
}

.stage-progress-title small {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 0.24rem;
  color: var(--text-muted);
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.2;
}

.stage-progress-title small .ag-icon {
  width: 0.72rem;
  height: 0.72rem;
  flex: 0 0 auto;
}

.stage-progress-head strong {
  color: var(--text);
  font-size: 0.72rem;
}

.stage-progress-head em {
  margin-left: 0.32rem;
  color: var(--text-muted);
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0;
}

.stage-progress-bar {
  position: relative;
  height: 10px;
  overflow: hidden;
  border: 1px solid rgba(250, 249, 245, 0.08);
  border-radius: 999px;
  background: rgba(250, 249, 245, 0.16);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.18),
    inset 0 1px 2px rgba(0, 0, 0, 0.22);
}

.stage-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent, #d97757), var(--accent-2, #e5b06e));
  box-shadow:
    0 0 14px rgba(230, 126, 86, 0.42),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: width 260ms ease;
  will-change: width;
}

.stage-progress-fill.has-progress {
  min-width: 6px;
}

.stage-progress-lane.is-running {
  border-color: var(--ag-ok-border);
  background: rgba(143, 190, 149, 0.06);
}

.stage-progress-lane.is-running .stage-progress-fill {
  background: linear-gradient(90deg, var(--cpa, #8fbe95), var(--accent-2, #e5b06e));
}

.stage-progress-lane.is-waiting-retry,
.stage-progress-lane.is-stopped {
  border-color: var(--ag-warning-border);
  background: rgba(229, 176, 110, 0.06);
}

.stage-progress-lane.is-done .stage-progress-fill {
  background: linear-gradient(90deg, var(--cpa, #8fbe95), var(--accent, #d97757));
  box-shadow: 0 0 14px rgba(143, 190, 149, 0.34);
}

.stage-progress-lane.is-failed {
  border-color: var(--ag-danger-border);
}

.stage-progress-lane.is-failed .stage-progress-fill {
  background: linear-gradient(90deg, var(--danger), var(--accent));
}

.test-progress {
  padding: 0.85rem;
  margin-top: 1rem;
}

.test-progress-mini {
  display: grid;
  grid-template-columns: auto minmax(80px, 1fr);
  gap: 0.55rem;
  align-items: center;
  margin-top: 0.55rem;
  color: var(--text-dim);
  font-size: 0.72rem;
}

.scroll-list {
  max-height: 500px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.empty-state {
  padding: 2.2rem;
  color: var(--text-dim);
  text-align: center;
}

.empty-state.compact {
  padding: 0.8rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: rgba(250, 249, 245, 0.025);
  font-size: 0.76rem;
}

.cracked-control-bar {
  display: grid;
  grid-template-columns: minmax(280px, 1.2fr) minmax(0, 2fr);
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.cracked-control-search {
  min-width: 0;
}

.cracked-control-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 0.5rem;
}

.cracked-control-bar .launch-inline-control input,
.cracked-control-bar .launch-inline-control select {
  width: 100%;
  min-height: 2.26rem;
  padding: 0.34rem 0.52rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.cracked-control-bar .launch-inline-control input[type="search"]::-webkit-search-cancel-button {
  filter: invert(1) opacity(0.65);
}

.cracked-status-cell {
  min-width: 7.5rem;
  white-space: nowrap;
}

.cracked-table-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0;
  min-height: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  box-shadow: none;
}

.cracked-table-sort:hover,
.cracked-table-sort.is-active {
  color: var(--cpa);
}

.cracked-table-sort .ag-icon {
  width: 0.72rem;
  height: 0.72rem;
  opacity: 0.74;
}

.cracked-found-time {
  display: inline-flex;
  white-space: nowrap;
  cursor: help;
}

.cracked-badge-stack {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.cracked-icon-badge,
.cracked-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.32rem;
  min-height: 1.72rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
}

.cracked-icon-badge {
  min-width: 2.5rem;
  padding: 0 0.55rem;
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--panel-2);
}

.cracked-status-badge {
  max-width: 9.5rem;
  padding: 0 0.62rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cracked-status-badge span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cracked-icon-badge .ag-icon,
.cracked-status-badge .ag-icon {
  width: 0.86rem;
  height: 0.86rem;
  flex: 0 0 auto;
}

.cracked-status-badge.green {
  color: var(--cpa);
  background: var(--ag-ok-bg);
  border: 1px solid var(--ag-ok-border);
}

.cracked-status-badge.red {
  color: var(--danger);
  background: var(--ag-danger-bg);
  border: 1px solid var(--ag-danger-border);
}

.cracked-status-badge.yellow {
  color: var(--accent-2);
  background: var(--ag-warning-bg);
  border: 1px solid var(--ag-warning-border);
}

.cracked-status-badge.blue,
.cracked-status-badge.gray {
  color: var(--accent);
  background: var(--ag-info-bg);
  border: 1px solid var(--ag-info-border);
}

.cracked-show-card {
  max-width: 1180px;
  margin: 0 auto;
}

.cracked-show-hero {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(11rem, 0.85fr) minmax(12rem, 0.9fr);
  gap: 0.55rem;
  margin-bottom: 0.8rem;
}

.cracked-show-field {
  min-width: 0;
  padding: 0.74rem 0.82rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
}

.cracked-show-field span {
  display: block;
  margin-bottom: 0.28rem;
  color: var(--text-dim);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0;
}

.cracked-show-field strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.35;
}

.cracked-detail-panel {
  display: grid;
  gap: 0.8rem;
  padding: 0.85rem;
  border: 1px solid rgba(217, 119, 87, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(217, 119, 87, 0.08), rgba(250, 249, 245, 0.025)),
    var(--panel);
}

.cracked-detail-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.45rem;
}

.cracked-model-section,
.cracked-api-section {
  padding: 0.78rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
}

.cracked-model-head,
.cracked-api-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.cracked-model-head h3,
.cracked-api-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 900;
}

.cracked-model-head p,
.cracked-model-note,
.cracked-api-head span {
  margin: 0.18rem 0 0;
  color: var(--text-dim);
  font-size: 0.7rem;
  line-height: 1.35;
}

.cracked-model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr));
  gap: 0.42rem;
}

.cracked-model-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.42rem;
  min-width: 0;
  padding: 0.48rem 0.56rem;
  color: var(--text);
  border: 1px solid rgba(217, 119, 87, 0.24);
  border-radius: 8px;
  background: rgba(217, 119, 87, 0.08);
  font-family: "SF Mono", "Cascadia Code", "Fira Code", ui-monospace, monospace;
  font-size: 0.68rem;
  font-weight: 750;
}

.cracked-model-chip .ag-icon {
  width: 0.86rem;
  height: 0.86rem;
  color: var(--accent);
}

.cracked-model-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cracked-api-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

@media (max-width: 900px) {
  .cracked-show-hero {
    grid-template-columns: 1fr;
  }
}

.mono {
  font-family: "SF Mono", "Cascadia Code", "Fira Code", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

.mb-0 {
  margin-bottom: 0;
}

.mt-2 {
  margin-top: 0.5rem;
}

.items-center {
  align-items: center;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-4 {
  gap: 1rem;
}

.ag-flash-stack {
  margin-bottom: 1rem;
}

.ag-flash-stack:empty {
  display: none;
}

.flash-info,
.flash-error {
  border-radius: 8px;
  padding: 0.72rem 0.85rem;
  margin-bottom: 1rem;
  font-size: 0.82rem;
  font-weight: 750;
}

.flash-info {
  color: var(--accent);
  background: var(--ag-info-bg);
  border: 1px solid var(--ag-info-border);
}

.flash-error {
  color: var(--danger);
  background: var(--ag-danger-bg);
  border: 1px solid var(--ag-danger-border);
}

.helper-text {
  color: var(--text-dim);
  font-size: 0.76rem;
  margin-top: 0.42rem;
}

.helper-text.warning {
  color: var(--accent);
}

.scanner-launch-panel {
  margin-bottom: 1rem;
  padding: 0.62rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01)), var(--panel);
  box-shadow: var(--shadow);
}

.scanner-launch-head,
.launch-health,
.launch-forecast,
.stage-row,
.stage-toggle {
  display: flex;
  align-items: center;
}

.scanner-launch-head {
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.62rem;
  border-bottom: 1px solid var(--border);
}

.scanner-launch-head h1 {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 900;
}

.scanner-launch-head p {
  display: none;
  margin: 0.22rem 0 0;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.launch-health {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.launch-summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  margin-top: 0.62rem;
}

.launch-summary-strip span {
  color: var(--text-dim);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.3rem 0.48rem;
  font-size: 0.68rem;
}

.launch-summary-strip strong {
  color: var(--text);
  margin-left: 0.2rem;
}

.runtime-strip {
  gap: 0.65rem;
  margin-bottom: 1.15rem;
}

.runtime-strip span {
  color: var(--text-dim);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.62rem;
  font-size: 0.76rem;
}

.runtime-strip strong {
  color: var(--text);
  margin-left: 0.24rem;
}

.scanner-form-section {
  border-top: 0;
  padding-top: 0;
  margin-top: 0.48rem;
}

.scanner-form-section:first-of-type {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.scanner-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.56rem;
}

.scanner-section-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 900;
}

.scanner-section-head p {
  display: none;
  margin: 0.18rem 0 0;
  color: var(--text-dim);
  font-size: 0.78rem;
}

.scanner-launch-panel .form-group {
  margin-bottom: 0;
}

.scanner-launch-panel label {
  margin-bottom: 0.28rem;
  font-size: 0.68rem;
}

.scanner-launch-panel label.sr-only {
  margin: -1px !important;
  font-size: inherit;
}

.scanner-launch-panel .helper-text:not(.warning) {
  display: none;
}

.scanner-launch-panel input[type="text"],
.scanner-launch-panel input[type="number"],
.scanner-launch-panel textarea,
.scanner-launch-panel select {
  padding: 0.42rem 0.54rem;
}

.scanner-launch-panel select {
  min-height: 2.2rem;
}

.scanner-custom-grid,
.launch-control-grid,
.scanner-run-grid,
.scan-source-strip {
  display: grid;
  gap: 1.1rem;
}

.launch-control-grid {
  grid-template-columns:
    minmax(220px, 1.35fr)
    minmax(180px, 1fr)
    minmax(92px, 0.42fr)
    minmax(112px, 0.5fr)
    minmax(96px, 0.42fr);
  align-items: end;
  gap: 0.65rem;
}

.launch-control-item {
  min-width: 0;
}

.launch-inline-control {
  display: grid;
  grid-template-columns: 2.15rem minmax(0, 1fr);
  min-height: 2.28rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.launch-inline-control:focus-within {
  border-color: var(--accent);
  background: var(--panel-3);
  box-shadow: 0 0 0 2px rgba(230, 126, 86, 0.12);
}

.proxy-select-control {
  grid-template-columns: 2.15rem auto minmax(0, 1fr);
}

.proxy-enable-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  min-height: 2.26rem;
  margin: 0 !important;
  padding: 0 0.48rem;
  color: var(--accent);
  background: rgba(230, 126, 86, 0.08);
  border-right: 1px solid var(--border);
  cursor: pointer;
  font-size: 0.62rem !important;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.proxy-enable-toggle input[type="checkbox"] {
  width: 0.82rem;
  height: 0.82rem;
  margin: 0;
  accent-color: var(--accent);
}

.proxy-select-control.proxy-disabled .proxy-enable-toggle {
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.025);
}

.proxy-select-control.proxy-disabled select,
.launch-inline-control.proxy-disabled input[name="proxy_limit"] {
  color: var(--text-dim);
  opacity: 0.68;
}

.launch-control-icon {
  display: grid;
  place-items: center;
  color: var(--accent);
  background: rgba(230, 126, 86, 0.08);
  border-right: 1px solid var(--border);
}

.launch-control-icon .ag-icon {
  width: 0.92rem;
  height: 0.92rem;
}

.scanner-launch-panel .launch-inline-control input[type="text"],
.scanner-launch-panel .launch-inline-control input[type="number"],
.scanner-launch-panel .launch-inline-control select {
  width: 100%;
  min-height: 2.26rem;
  padding: 0.34rem 0.52rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.scanner-custom-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.scanner-custom-grid.single {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 0.55rem;
}

.scanner-run-grid {
  grid-template-columns: minmax(220px, 1.25fr) minmax(220px, 1.1fr) minmax(150px, 0.75fr) minmax(170px, 0.75fr) minmax(150px, 0.65fr);
  align-items: start;
}

.scanner-run-grid.staged {
  grid-template-columns: minmax(240px, 1.4fr) minmax(150px, 0.7fr) minmax(180px, 0.8fr) minmax(150px, 0.65fr);
}

.stage-plan {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.34rem;
}

.stage-launch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(4.8rem, auto);
  gap: 0.5rem;
  align-items: stretch;
}

.stage-start-button {
  min-height: 100%;
  padding-inline: 1rem;
  white-space: nowrap;
}

.stage-start-button.icon-command {
  display: inline-grid;
  min-width: 3.1rem;
  place-items: center;
  padding-inline: 0.85rem;
}

.stage-start-button.icon-command .ag-icon {
  width: 1.08rem;
  height: 1.08rem;
}

.stage-row {
  display: grid;
  grid-template-columns: 1.38rem minmax(0, 0.9fr) minmax(5.8rem, 1.15fr) auto;
  min-height: 0;
  align-items: center;
  gap: 0.3rem;
  padding: 0.34rem 0.42rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
}

.stage-row.has-toggle {
  grid-template-columns:
    1.38rem minmax(0, 0.8fr) minmax(3.75rem, auto) minmax(5.8rem, 1.15fr)
    auto;
}

.stage-row.disabled {
  opacity: 0.62;
}

.stage-number {
  display: grid;
  width: 1.42rem;
  height: 1.42rem;
  place-items: center;
  border: 1px solid var(--ag-orange-border);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(230, 126, 86, 0.11);
  font-size: 0.7rem;
  font-weight: 900;
}

.stage-copy {
  min-width: 0;
}

.stage-title-line {
  display: flex;
  align-items: center;
  gap: 0.34rem;
  min-width: 0;
}

.stage-title-line strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-title-line small {
  display: none;
}

.stage-copy span {
  display: none;
  margin-top: 0.18rem;
  color: var(--text-dim);
  font-size: 0.74rem;
  line-height: 1.35;
}

.stage-mode,
.stage-toggle {
  display: inline-flex;
  align-items: center;
  min-width: 3.75rem;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.24rem 0.38rem;
  font-size: 0.6rem;
  font-weight: 900;
  text-transform: uppercase;
}

.stage-mode {
  display: none;
}

.stage-mode.direct {
  color: var(--cpa);
  background: rgba(126, 184, 139, 0.1);
  border-color: rgba(126, 184, 139, 0.3);
}

.stage-mode.proxy,
.stage-toggle {
  color: var(--accent);
  background: rgba(230, 126, 86, 0.09);
  border-color: var(--ag-orange-border);
}

.stage-toggle {
  gap: 0.3rem;
  cursor: pointer;
  text-transform: none;
}

.stage-toggle input[type="checkbox"] {
  width: 0.82rem;
  height: 0.82rem;
  accent-color: var(--accent);
}

.form-group.compact {
  grid-column: 3;
  min-width: 0;
}

.stage-row .form-group.compact label {
  display: none;
}

.stage-row .form-group.compact select {
  min-height: 1.75rem;
  padding: 0.2rem 1.55rem 0.2rem 0.42rem;
  font-size: 0.72rem;
}

.stage-estimate {
  grid-column: 4;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.18rem;
  white-space: nowrap;
}

.stage-estimate strong,
.stage-estimate span {
  display: inline;
}

.stage-estimate strong {
  color: var(--text);
  font-size: 0.74rem;
}

.stage-estimate span {
  color: var(--text-dim);
  font-size: 0.52rem;
  font-weight: 850;
}

.stage-row.disabled .stage-toggle {
  grid-column: 3;
}

.stage-row.has-toggle .stage-toggle {
  grid-column: 3;
  justify-self: start;
}

.stage-row.has-toggle .form-group.compact {
  grid-column: 4;
}

.stage-row.has-toggle .stage-estimate {
  grid-column: 5;
}

.stage-custom {
  padding-left: 0;
}

.stage-custom textarea {
  min-height: 84px;
}

.ssh-credential-section {
  margin-top: 0.5rem;
}

.ssh-credential-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(4.8rem, auto);
  gap: 0.5rem;
  align-items: stretch;
}

.ssh-credential-fields {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(7.2rem, auto) minmax(220px, 1fr);
  gap: 0.5rem;
  align-items: stretch;
}

.scanner-launch-panel .launch-inline-control textarea {
  width: 100%;
  min-height: 2.26rem;
  max-height: 7rem;
  padding: 0.48rem 0.52rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  resize: vertical;
  line-height: 1.25;
}

.ssh-inline-toggle {
  min-height: 2.28rem;
  width: 100%;
  border-radius: 8px;
  justify-self: stretch;
  text-transform: none;
}

.ssh-custom-passwords {
  margin-top: 0.55rem;
}

.ssh-custom-passwords textarea {
  min-height: 84px;
}

.ssh-scan-launch-grid {
  grid-template-columns:
    minmax(150px, 0.75fr)
    minmax(260px, 1.3fr)
    minmax(120px, 0.48fr)
    minmax(116px, 0.48fr)
    minmax(106px, 0.44fr)
    minmax(4.8rem, auto);
}

.ssh-scan-three-col {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(0, 0.9fr) minmax(0, 0.9fr);
  gap: 0.65rem;
  align-items: stretch;
}

.ssh-scan-config-column {
  grid-column: 2 / 4;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.55rem;
  min-width: 0;
}

.ssh-scan-config-grid {
  display: grid;
  grid-template-columns:
    minmax(160px, 1fr)
    minmax(90px, 0.48fr)
    minmax(110px, 0.52fr)
    minmax(96px, 0.48fr);
  gap: 0.55rem;
  align-items: stretch;
}

.ssh-scan-three-col .launch-control-item {
  margin: 0;
}

.ssh-ranges-control {
  height: 100%;
  min-height: 5.8rem;
}

.ssh-scan-launch-grid .launch-inline-control textarea {
  min-height: 2.26rem;
  max-height: 5rem;
}

.ssh-ranges-control textarea {
  min-height: 5.8rem;
  max-height: none;
}

.ssh-scan-summary-strip {
  align-items: center;
  align-content: start;
  justify-content: space-between;
  margin-top: 0;
}

.ssh-scan-summary-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.42rem;
  min-width: 0;
}

.ssh-scan-card {
  border-left: 2px solid rgba(217, 119, 87, 0.42);
}

.ssh-scan-card.completed {
  border-left-color: rgba(126, 184, 139, 0.44);
}

.ssh-open-preview {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.ssh-open-preview .scroll-list {
  max-height: 220px;
}

.launch-forecast {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.launch-forecast span {
  color: var(--text-dim);
  font-size: 0.76rem;
}

.launch-forecast strong {
  color: var(--text);
  margin-right: 0.2rem;
}

.scan-source-strip {
  grid-template-columns: minmax(140px, 0.72fr) minmax(260px, 1.56fr) minmax(140px, 0.72fr);
  margin: 1.1rem 0 1.25rem;
}

.scan-source-strip > span,
.scanner-stage-batch {
  min-width: 0;
  color: var(--text-dim);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.72rem 0.8rem;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.28;
}

.scan-source-item,
.scanner-stage-batch {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.48rem;
}

.scan-source-item.compact-source {
  display: inline-grid;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
}

.scan-source-item .ag-icon,
.scanner-stage-batch .ag-icon {
  width: 0.92rem;
  height: 0.92rem;
  color: var(--accent);
}

.scanner-stage-batches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.42rem;
  min-width: 0;
}

.scanner-stage-batch {
  padding: 0.58rem 0.62rem;
}

.scanner-stage-batch.is-stage_1 .ag-icon {
  color: var(--cpa);
}

.scanner-stage-batch.is-muted {
  opacity: 0.68;
}

.scanner-stage-batch-copy {
  display: grid;
  min-width: 0;
  gap: 0.1rem;
}

.scanner-stage-batch em {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.58rem;
  font-style: normal;
  font-weight: 900;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.scanner-stage-batch small {
  overflow: hidden;
  color: var(--text-dim);
  font-size: 0.58rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scan-source-strip > span strong,
.scanner-stage-batch strong {
  display: block;
  overflow: hidden;
  margin-top: 0.22rem;
  color: var(--text);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scan-source-item strong {
  margin-top: 0;
}

.scan-card {
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.scan-card-head {
  align-items: flex-start;
  padding-bottom: 0.95rem;
  border-bottom: 1px solid var(--border);
}

.scan-title {
  gap: 0.55rem;
  row-gap: 0.45rem;
  min-width: 0;
}

.scan-title .mono {
  max-width: min(100%, 18rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diagnostic-row {
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.form-actions {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.launch-grid,
.run-controls {
  display: grid;
  gap: 1rem;
}

.launch-grid {
  grid-template-columns: minmax(260px, 1.15fr) minmax(220px, 0.85fr);
}

.run-controls {
  grid-template-columns: minmax(220px, 1fr) minmax(120px, 160px) minmax(120px, 160px);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.auth-card {
  width: min(380px, 100%);
  margin-bottom: 0;
}

.auth-card button {
  width: 100%;
}

@media (max-width: 1100px) {
  .ag-topbar,
  .ag-nav-left,
  .ag-nav-right {
    align-items: flex-start;
  }

  .ag-topbar {
    flex-direction: column;
  }

  .ag-nav-left,
  .ag-nav-right {
    width: 100%;
  }

  .ag-tabs {
    width: 100%;
    margin-left: 0;
  }

  .cracked-control-bar {
    grid-template-columns: 1fr;
  }

  .cracked-control-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}

@media (max-width: 900px) {
  .ag-page {
    padding: 1rem;
  }

  .ag-page-netscan {
    padding: 0;
  }

  .grid-2,
  .launch-grid,
  .launch-control-grid,
  .run-controls,
  .scanner-custom-grid,
  .scanner-run-grid,
  .scanner-run-grid.staged,
  .stage-plan,
  .stage-launch-row,
  .ssh-scan-three-col,
  .ssh-scan-config-grid,
  .ssh-credential-row,
  .ssh-credential-fields,
  .stage-progress-pair,
  .scan-source-strip {
    grid-template-columns: 1fr;
  }

  .ssh-scan-config-column {
    grid-column: auto;
  }

  .form-row,
  .card-header,
  .scan-card-head,
  .form-actions,
  .ag-monitor-title,
  .scanner-launch-head,
  .stage-row,
  .launch-forecast {
    align-items: stretch;
    flex-direction: column;
  }

  .stage-mode,
  .stage-toggle,
  .stage-estimate,
  .form-group.compact {
    flex-basis: auto;
    min-width: 0;
    width: 100%;
    text-align: left;
  }

  .stage-row {
    grid-template-columns: 1.42rem minmax(0, 1fr) auto;
  }

  .stage-row.has-toggle {
    grid-template-columns: 1.42rem minmax(0, 1fr) auto;
  }

  .stage-mode,
  .stage-toggle {
    width: auto;
    justify-self: end;
  }

  .form-group.compact {
    grid-column: 1 / -1;
  }

  .stage-row.has-toggle .form-group.compact {
    grid-column: 1 / -1;
  }

  .stage-estimate {
    grid-column: 1 / -1;
    width: auto;
    justify-content: flex-start;
  }

  .stage-row.has-toggle .stage-estimate {
    grid-column: 1 / -1;
  }

  .stage-custom {
    padding-left: 0;
  }

  .stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scan-actions {
    justify-content: stretch;
  }
}

@media (max-width: 680px) {
  .cracked-control-grid {
    grid-template-columns: 1fr;
  }
}
