/* Shared surfaces, typography and interaction tokens for both account roles. */
:root {
  color-scheme: dark;
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  background: #0c0c0f;
  color: #f2f0f3;
  --canvas: #0c0c0f;
  --surface: #131316;
  --surface-soft: #1b1b20;
  --surface-raised: #212127;
  --ink: #f2f0f3;
  --muted: #aaa5af;
  --line: #34343d;
  --line-strong: #56505c;
  --accent: #ff5c70;
  --accent-hover: #ff7a8a;
  --accent-soft: #2c171e;
  --accent-line: #863d4a;
  --accent-ink: #21080f;
  --focus-ring: #ff5c7033;
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='m4 6 4 4 4-4' stroke='%23aaa5af' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --disclosure-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='m4 6 4 4 4-4' stroke='%23ff5c70' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --success: #8bddb0;
  --success-soft: #15251f;
  --success-line: #315d47;
  --danger: #ff95a5;
  --danger-hover: #ffb0bb;
  --danger-ink: #260910;
  --danger-soft: #2b171f;
  --danger-line: #70404b;
  --warning: #f0c87c;
  --warning-soft: #2b2418;
  --warning-line: #665334;
  --info: #9fc9f2;
  --info-soft: #18232e;
  --info-line: #354c65;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --shadow: 0 4px 24px #0003, 0 1px 3px #0004;
  --shell-offset: 256px;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 20px;
  max-width: 1100px;
  margin-top: 24px;
}
.plan-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 26px;
  background: linear-gradient(145deg, var(--surface), var(--surface));
  animation: enter 0.4s both;
}
.plan-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.plan-card h2 {
  font-size: 20px;
  margin: 0;
  overflow-wrap: anywhere;
}
.plan-price {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.8px;
  margin: 24px 0 14px;
  overflow-wrap: anywhere;
}
.plan-resources {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 26px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.plan-resources dt {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 7px;
}
.plan-resources dd {
  margin: 0;
  font-size: 15px;
  text-transform: capitalize;
}
.billing-selection {
  max-width: 600px;
  margin: 24px 0 14px;
}
#telegram-form > .field-input {
  margin-bottom: 16px;
}
#telegram-webhook-url {
  overflow-wrap: anywhere;
}
.viewer-profile {
  display: inline-flex;
  align-items: center;
  background-color: var(--surface-soft);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 7px;
  font: inherit;
  font-size: 11px;
  max-width: 100%;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(ellipse at 70% -10%, var(--surface), transparent 52%), var(--surface-soft);
  min-height: 100vh;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  color: inherit;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button,
input,
a {
  outline-offset: 4px;
}
:focus-visible {
  outline: 2px solid var(--accent);
}
a {
  color: inherit;
  text-decoration: none;
}
svg {
  display: block;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 8px;
}
.skip-link:focus {
  top: 16px;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 216px;
  display: flex;
  flex-direction: column;
  padding: 31px 16px;
  background: var(--surface-soft);
  border-right: 1px solid var(--line);
  overflow: hidden;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  font-size: 29px;
  font-weight: 650;
  letter-spacing: -1.5px;
  width: fit-content;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  color: var(--accent);
}
.brand-mark svg {
  width: 31px;
  height: 31px;
}
.brand-dot {
  color: var(--accent);
}
.sidebar nav {
  margin-top: 44px;
  position: relative;
  z-index: 1;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  transition: background 0.2s;
}
.nav-item.current {
  background: linear-gradient(90deg, var(--surface), var(--surface));
  border: 1px solid var(--line);
  color: var(--ink);
}
.nav-item:hover {
  background: var(--surface);
}
.nav-item svg {
  width: 17px;
  height: 17px;
}
.nav-count {
  background: var(--surface);
  color: var(--ink);
  padding: 2px 6px;
  margin-left: auto;
  font-size: 10px;
  border-radius: 5px;
}
.sidebar-art {
  position: absolute;
  inset: auto -140px -210px -90px;
  height: 460px;
  pointer-events: none;
  opacity: 0.5;
  transform: rotate(-35deg);
}
.sidebar-art span {
  position: absolute;
  border: 1px solid var(--line);
  border-radius: 48px;
  inset: 40px;
}
.sidebar-art span:nth-child(2) {
  inset: 70px;
}
.sidebar-art span:nth-child(3) {
  inset: 100px;
  background: radial-gradient(ellipse at center, var(--surface), transparent 70%);
}
.main-shell {
  margin-left: 216px;
}
.topbar {
  height: 74px;
  padding: 0 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}
.topbar-title {
  font-size: 12px;
  color: var(--muted);
}
.environment {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--danger-line);
  border-radius: 24px;
  padding: 7px 11px;
  font-size: 11px;
  color: var(--danger);
  background: var(--danger-soft);
  transition:
    color 0.3s,
    border-color 0.3s,
    background 0.3s;
}
.status-dot {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: currentColor;
}
.environment[data-state='online'] {
  color: var(--success);
  border-color: var(--success-line);
  background: var(--success-soft);
}
.environment[data-state='online'] .status-dot {
  box-shadow: 0 0 0 3px #96dfb613;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.language-selector-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 5px 10px;
  transition: border-color 0.2s, background 0.2s;
}
.language-selector-wrap:hover,
.language-selector-wrap:focus-within {
  border-color: var(--accent);
  background: var(--surface-soft);
}
.language-selector-wrap .language-icon {
  width: 14px;
  height: 14px;
  color: var(--muted);
  flex-shrink: 0;
}
.topbar-language-select {
  background: transparent;
  border: none;
  color: var(--foreground);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  padding: 0 4px 0 0;
}
.topbar-language-select option {
  background: #181b22;
  color: #fff;
}
main {
  max-width: 1490px;
  padding: 43px 44px 50px;
  margin: 0 auto;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
  animation: enter 0.5s both;
}
.eyebrow {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.9px;
  color: var(--accent);
}
h1 {
  font-weight: 550;
  letter-spacing: -1.7px;
  font-size: clamp(30px, 3.2vw, 40px);
  margin: 12px 0 0;
  line-height: 1.1;
}
.heading-dot {
  color: var(--accent);
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 11px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
  transition:
    background 0.2s,
    transform 0.2s,
    box-shadow 0.2s;
}
.button svg {
  width: 16px;
  height: 16px;
}
.button-primary {
  background: var(--surface);
  color: var(--accent-ink);
  border-color: var(--line);
  box-shadow:
    0 3px 16px #8770d51c,
    inset 0 1px 0 #ffffff30;
}
.button-primary:hover {
  background: var(--surface);
  transform: translateY(-2px);
  box-shadow: 0 7px 24px #8770d536;
}
.button:active {
  transform: translateY(0) scale(0.98);
}
.button-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
.button-secondary:hover {
  background: var(--surface);
}
.button-danger {
  background: var(--danger-soft);
  border-color: var(--danger-line);
  color: var(--danger);
}
.button-danger:hover {
  background: var(--danger-soft);
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 28px;
}
.stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(130deg, var(--surface), var(--surface));
  min-width: 0;
  animation: enter 0.55s both;
  animation-delay: 0.06s;
  transition:
    border-color 0.25s,
    transform 0.25s;
}
.stat:nth-child(2) {
  animation-delay: 0.12s;
}
.stat:nth-child(3) {
  animation-delay: 0.18s;
}
.stat:hover {
  border-color: var(--line);
  transform: translateY(-2px);
}
.stat-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.stat-value {
  display: block;
  margin-top: 12px;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -1px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--accent);
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
}
.stat-icon svg {
  height: 21px;
  width: 21px;
}
.stat-icon.green {
  color: var(--success);
  background: var(--success-soft);
  border-color: var(--success-line);
}
.stat-icon.violet {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}
.links-panel {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
  animation: enter 0.6s 0.16s both;
  box-shadow: 0 15px 50px #00000012;
}
.panel-heading {
  padding: 24px 24px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.panel-heading h2 {
  font-size: 14px;
  font-weight: 550;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.count-badge {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--accent);
  padding: 2px 6px;
  font-size: 10px;
  border-radius: 5px;
}
.search {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 250px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  transition: border-color 0.2s;
}
.search:focus-within {
  border-color: var(--line);
}
.search svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--muted);
}
.search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  outline: 0;
  color: var(--ink);
  font-size: 11px;
}
input::placeholder {
  color: var(--muted);
}
.search kbd {
  font-size: 10px;
  padding: 0 4px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.panel-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px 18px;
  gap: 12px;
}
.filters {
  display: flex;
  align-items: center;
  padding: 3px;
  gap: 2px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}
.filter {
  border: 0;
  min-height: 31px;
  padding: 7px 13px;
  border-radius: 5px;
  color: var(--muted);
  background: none;
  font-size: 11px;
  transition:
    color 0.2s,
    background 0.2s,
    box-shadow 0.2s;
}
.filter:hover {
  color: var(--ink);
}
.filter.selected {
  background: var(--surface);
  color: var(--ink);
  box-shadow:
    0 1px 4px #0003,
    inset 0 1px 0 #ffffff08;
}
.table-wrap {
  width: 100%;
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
thead {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
th {
  padding: 13px 14px;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
th:first-child {
  padding-left: 24px;
}
td {
  padding: 19px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
tr:last-child td {
  border-bottom: 0;
}
tbody tr {
  transition: background 0.2s;
}
tbody tr:hover {
  background: var(--surface);
}
tbody tr.row-enter {
  animation: row-enter 0.35s both;
  animation-delay: min(var(--row-delay, 0ms), 240ms);
}
td:first-child {
  padding-left: 24px;
}
td:last-child {
  padding-right: 20px;
}
.destination {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 170px;
}
.destination-mark {
  height: 38px;
  width: 38px;
  flex-shrink: 0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.destination-mark img.destination-favicon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 4px;
}
.destination-mark svg {
  color: var(--muted);
}
.destination-detail {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.destination-name {
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
  display: block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.destination-host {
  display: block;
  font-size: 11px;
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  max-width: 210px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.path-display-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.route-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 6px;
  padding: 4px 8px;
  background: rgba(56, 189, 248, 0.07);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  font-weight: 500;
  color: #38bdf8;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.route-domain-sub {
  font-size: 10.5px;
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
  padding-left: 2px;
}
.engine-wrapper,
.engine-badge-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.engine-browser-badge,
.browser-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
}
.engine-browser-badge.chromium,
.browser-tag.chromium {
  background: rgba(14, 165, 233, 0.08);
  border-color: rgba(14, 165, 233, 0.25);
  color: #7dd3fc;
}
.engine-browser-badge.gologin,
.browser-tag.gologin {
  background: rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.28);
  color: #c084fc;
}
.stream-badge-pill,
.stream-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 0;
}
.stream-badge-pill.webrtc,
.stream-tag.webrtc {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.28);
  color: #34d399;
}
.stream-badge-pill.novnc,
.stream-tag.novnc {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
}
.status-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}
.status-toggle::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-toggle.enabled {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.25);
  color: #34d399;
}
.status-toggle.enabled::before {
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
}
.status-toggle.disabled,
.status-toggle[aria-checked='false'] {
  background: rgba(148, 163, 184, 0.06);
  border-color: rgba(148, 163, 184, 0.18);
  color: #64748b;
}
.status-toggle.disabled::before,
.status-toggle[aria-checked='false']::before {
  background: #64748b;
  box-shadow: none;
}
.status-toggle:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.15);
}
.updated-cell {
  color: #64748b;
  font-size: 11px;
  white-space: nowrap;
}
.actions-heading {
  text-align: right;
  padding-right: 20px;
}
.row-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: flex-end;
}
.row-actions select.viewer-profile {
  display: inline-flex;
  align-items: center;
  margin: 0 4px 0 0;
  height: 32px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background-color: var(--surface);
  color: #94a3b8;
  cursor: pointer;
  padding: 0 28px 0 9px;
  background-position: right 8px center;
  background-size: 14px 14px;
  transition: all 0.15s ease;
  vertical-align: middle;
}
.row-actions select.viewer-profile:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.2);
  color: #f1f5f9;
  background-color: rgba(255, 255, 255, 0.05);
}
.row-actions select.viewer-profile:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}
.row-actions select.viewer-profile:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  width: 32px;
  flex-shrink: 0;
  padding: 7px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  background: none;
  font-size: 25px;
  line-height: 1;
  transition:
    background 0.2s,
    color 0.2s,
    transform 0.2s;
}
.icon-button:hover {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
  transform: translateY(-1px);
}
.icon-button.copied {
  color: #34d399 !important;
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
}
.icon-button svg {
  width: 15px;
  height: 15px;
}
.icon-button.danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger-line);
}
.icon-button[aria-disabled='true'] {
  opacity: 0.32;
  pointer-events: none;
}
.refresh-button svg {
  width: 17px;
  height: 17px;
}
.refresh-button[aria-busy='true'] svg {
  animation: rotate 1s linear infinite;
}
.panel-footer {
  border-top: 1px solid var(--line);
  padding: 15px 24px;
  font-size: 10px;
  color: var(--muted);
}
.panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.capacity-label {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.session-stop {
  color: var(--warning);
}
.empty-state {
  text-align: center;
  padding: 38px 24px 43px;
}
.empty-illustration {
  margin: 0 auto 17px;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px solid var(--line);
  border-radius: 19px;
  color: var(--accent);
  background: var(--surface);
}
.empty-illustration svg {
  width: 43px;
  height: 43px;
}
.empty-state h3 {
  font-size: 17px;
  font-weight: 500;
  margin: 0 0 9px;
  letter-spacing: -0.3px;
}
.empty-state p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  margin: 0 auto 21px;
}
.load-error {
  color: var(--danger);
  border: 1px solid var(--danger-line);
  background: var(--danger-soft);
  padding: 12px 15px;
  margin: 0 24px 18px;
  border-radius: 8px;
  font-size: 12px;
}
dialog {
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 27px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 25px 100px #0009;
}
dialog[open] {
  animation: dialog-enter 0.23s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
dialog::backdrop {
  background: var(--surface-soft);
  backdrop-filter: blur(7px);
  animation: backdrop-enter 0.23s both;
}
.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 23px;
}
.dialog-header h2 {
  font-size: 23px;
  font-weight: 550;
  letter-spacing: -0.6px;
  margin: 0;
}
.dialog-header .icon-button {
  margin: -4px -6px -4px 0;
}
.field-label,
.browser-field legend {
  display: block;
  margin: 18px 0 8px;
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
}
.field-input {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
  color: var(--ink);
  font-size: 13px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.field-input:focus {
  outline: 0;
  border-color: var(--line);
  box-shadow: 0 0 0 3px #a58acf18;
}
.path-field {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}
.browser-field {
  padding: 0;
  margin: 0;
  border: 0;
}
.browser-field legend {
  padding: 0;
}
.browser-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.browser-choice {
  position: relative;
  cursor: pointer;
}
.browser-choice input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.browser-choice > span {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--accent);
  font-size: 12px;
  transition:
    color 0.2s,
    background 0.2s,
    border-color 0.2s;
}
.browser-choice svg {
  height: 18px;
  width: 18px;
  flex-shrink: 0;
}
.browser-choice .choice-check {
  margin-left: auto;
  height: 16px;
  width: 16px;
  opacity: 0;
}
.browser-choice input:checked + span {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}
.browser-choice input:checked + span .choice-check {
  opacity: 1;
}
.browser-choice input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.provider-note {
  display: block;
  font-size: 10px;
  color: var(--warning);
  margin-top: 9px;
}
#gologin-fields:not([hidden]) {
  animation: enter 0.2s both;
}
.enabled-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  gap: 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 14px;
  margin-top: 22px;
  cursor: pointer;
  background: var(--surface);
}
.enabled-field strong {
  font-weight: 500;
  font-size: 12px;
  color: var(--ink);
}
.enabled-field input {
  position: absolute;
  right: 14px;
  width: 35px;
  height: 22px;
  opacity: 0;
  margin: 0;
}
.checkbox-switch {
  pointer-events: none;
  display: block;
  width: 35px;
  height: 21px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  position: relative;
}
.checkbox-switch::after {
  content: '';
  position: absolute;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--surface);
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
}
.enabled-field input:checked + .checkbox-switch {
  background: var(--surface);
  border-color: var(--line);
}
.enabled-field input:checked + .checkbox-switch::after {
  background: var(--surface);
  transform: translateX(14px);
}
.enabled-field input:focus-visible + .checkbox-switch {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding-top: 22px;
  margin-top: 23px;
  border-top: 1px solid var(--line);
}
.form-error {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 12px;
  line-height: 1.6;
  margin: 16px 0 0;
}
.delete-dialog {
  width: min(410px, calc(100vw - 32px));
}
.delete-symbol {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  font-size: 27px;
  background: var(--danger-soft);
  border: 1px solid var(--danger-line);
  color: var(--danger);
  border-radius: 11px;
  margin-bottom: 18px;
}
.delete-dialog h2 {
  font-size: 23px;
  font-weight: 550;
  letter-spacing: -0.5px;
  margin: 0 0 12px;
}
.delete-dialog p {
  font-size: 12px;
  color: var(--accent);
  line-height: 1.8;
  margin: 0;
}
.delete-dialog p strong {
  color: var(--ink);
  font-weight: 500;
  overflow-wrap: anywhere;
}
.delete-dialog .form-error {
  margin-top: 14px;
}
.toast {
  position: fixed;
  z-index: 20;
  bottom: 25px;
  left: calc(50% + 108px);
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px 11px 14px;
  border: 1px solid var(--success-line);
  background: var(--success-soft);
  border-radius: 11px;
  color: var(--success);
  box-shadow: 0 7px 30px #0006;
  font-size: 12px;
  animation: toast-enter 0.23s both;
}
.toast-icon {
  color: var(--success);
}
.toast.error {
  background: var(--danger-soft);
  border-color: var(--danger-line);
  color: var(--danger);
}
.toast.error .toast-icon {
  color: var(--danger);
}
.toast .icon-button {
  height: 26px;
  width: 26px;
  padding: 3px;
  margin-left: 5px;
  font-size: 20px;
}
@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes row-enter {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes dialog-enter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes backdrop-enter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes toast-enter {
  from {
    opacity: 0;
    margin-bottom: -8px;
  }
  to {
    opacity: 1;
    margin-bottom: 0;
  }
}
@keyframes rotate {
  to {
    transform: rotate(360deg);
  }
}
@media (min-width: 1550px) {
  main {
    padding-top: 54px;
  }
  .page-heading {
    margin-bottom: 39px;
  }
  .stats {
    margin-bottom: 34px;
  }
  .stat {
    padding: 25px 28px;
  }
  td {
    padding-top: 23px;
    padding-bottom: 23px;
  }
}
@media (max-width: 1200px) {
  .sidebar {
    width: 190px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .brand {
    padding-left: 9px;
  }
  .main-shell {
    margin-left: 190px;
  }
  .topbar {
    padding: 0 27px;
  }
  main {
    padding: 35px 27px 40px;
  }
  .stat {
    padding: 20px;
  }
  .toast {
    left: calc(50% + 95px);
  }
  .updated-column,
  .updated-cell {
    display: none;
  }
  td,
  th {
    padding-left: 11px;
    padding-right: 11px;
  }
  .destination-name,
  .destination-host {
    max-width: 150px;
  }
  .route-chip {
    max-width: 135px;
  }
  .row-actions {
    gap: 0;
  }
}
@media (max-width: 950px) {
  .sidebar {
    width: 76px;
    padding: 24px 12px;
    align-items: center;
  }
  .brand {
    padding: 0;
  }
  .sidebar .brand > span:last-child,
  .nav-item > span {
    display: none;
  }
  .brand-mark {
    width: 38px;
  }
  .sidebar nav {
    margin-top: 34px;
    width: 100%;
  }
  .nav-item {
    justify-content: center;
    padding: 13px;
  }
  .nav-item svg {
    width: 18px;
    height: 18px;
  }
  .sidebar-art {
    display: none;
  }
  .main-shell {
    margin-left: 76px;
  }
  .toast {
    left: calc(50% + 38px);
  }
  .stat {
    padding: 19px;
  }
  .stat-icon {
    width: 35px;
    height: 35px;
    border-radius: 10px;
  }
  .stat-icon svg {
    width: 18px;
    height: 18px;
  }
  .table-wrap table {
    min-width: 670px;
  }
}
@media (max-width: 640px) {
  .sidebar {
    position: static;
    width: auto;
    padding: 17px 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    flex-direction: row;
    justify-content: space-between;
    gap: 16px;
  }
  .brand {
    font-size: 25px;
    gap: 7px;
  }
  .sidebar .brand > span:last-child {
    display: inline;
  }
  .brand-mark {
    width: 28px;
    height: 28px;
  }
  .brand-mark svg {
    width: 27px;
    height: 27px;
  }
  .sidebar nav {
    width: auto;
    margin: 0;
  }
  .nav-item {
    padding: 8px 10px;
    gap: 7px;
    font-size: 11px;
  }
  .nav-item > span:not(.nav-count) {
    display: inline;
  }
  .nav-item svg {
    width: 14px;
    height: 14px;
  }
  .main-shell {
    margin-left: 0;
  }
  .topbar {
    height: 54px;
    padding: 0 20px;
  }
  .topbar-title {
    font-size: 11px;
  }
  .environment {
    font-size: 10px;
    padding: 6px 9px;
  }
  main {
    padding: 29px 16px 30px;
  }
  .page-heading {
    gap: 12px;
    margin-bottom: 24px;
  }
  h1 {
    font-size: 29px;
    letter-spacing: -1.25px;
  }
  .eyebrow {
    font-size: 8px;
    letter-spacing: 1.4px;
  }
  .button {
    min-height: 40px;
    font-size: 11px;
    padding: 10px 12px;
    gap: 6px;
  }
  .stats {
    gap: 8px;
    margin-bottom: 22px;
  }
  .stat {
    padding: 15px 12px;
    border-radius: 10px;
  }
  .stat-label {
    font-size: 9px;
    white-space: nowrap;
  }
  .stat-value {
    font-size: 25px;
    margin-top: 11px;
  }
  .stat-icon {
    display: none;
  }
  .panel-heading {
    padding: 19px 16px 16px;
    flex-wrap: wrap;
    gap: 17px;
  }
  .panel-heading h2 {
    font-size: 13px;
  }
  .search {
    width: 100%;
    padding: 11px;
  }
  .panel-subbar {
    padding: 0 16px 16px;
  }
  .filter {
    padding: 8px 13px;
  }
  .links-panel {
    border-radius: 12px;
  }
  .panel-footer {
    padding: 14px 16px;
  }
  .load-error {
    margin-left: 16px;
    margin-right: 16px;
  }
  .table-wrap {
    overflow: visible;
  }
  .table-wrap table {
    min-width: 0;
    display: block;
  }
  thead {
    display: none;
  }
  tbody {
    display: block;
  }
  tbody tr {
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 16px;
    gap: 11px 14px;
    border-top: 1px solid var(--line);
  }
  tbody tr:hover {
    background: var(--surface);
  }
  td {
    display: block;
    padding: 0 !important;
    border: 0;
    min-width: 0;
  }
  td:first-child {
    grid-column: 1;
    grid-row: 1;
  }
  td:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
  }
  td:nth-child(3) {
    grid-column: 1;
    grid-row: 3;
  }
  td:nth-child(4) {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    text-align: right;
  }
  td:last-child {
    grid-column: 2;
    grid-row: 2 / 4;
    align-self: end;
  }
  .destination {
    gap: 9px;
    min-width: 0;
  }
  .destination-mark {
    height: 34px;
    width: 34px;
    border-radius: 9px;
    font-size: 14px;
  }
  .destination-name,
  .destination-host {
    max-width: min(40vw, 200px);
  }
  .destination-host {
    font-size: 9px;
  }
  .destination-name {
    font-size: 11px;
  }
  .route-chip {
    max-width: min(48vw, 205px);
    font-size: 10px;
  }
  .engine-label {
    padding-left: 1px;
    font-size: 9px;
  }
  .row-actions {
    gap: 2px;
  }
  .row-actions .icon-button {
    width: 32px;
    height: 34px;
    border-color: var(--line);
    background: var(--surface);
    padding: 8px;
  }
  .toast {
    left: 50%;
    bottom: 16px;
    width: max-content;
    font-size: 11px;
  }
  dialog {
    padding: 23px;
    max-height: calc(100dvh - 24px);
  }
  .field-input {
    font-size: 16px;
  }
  .path-field {
    font-size: 14px;
  }
}
@media (max-width: 370px) {
  .sidebar {
    padding-left: 16px;
    padding-right: 16px;
  }
  .page-heading {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 18px;
  }
  .page-heading .button {
    width: 100%;
  }
  .nav-item {
    font-size: 10px;
  }
  .destination-name,
  .destination-host {
    max-width: 120px;
  }
  .row-actions {
    gap: 1px;
  }
  .row-actions .icon-button {
    width: 29px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Account workspace surfaces keep the existing visual and form conventions. */
.sidebar {
  z-index: 5;
}
.sidebar nav {
  display: grid;
  gap: 6px;
}
.nav-symbol {
  width: 18px;
  display: grid !important;
  place-items: center;
  color: var(--accent);
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}
.nav-item.locked {
  opacity: 0.5;
}
.sidebar-account {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  position: relative;
  z-index: 1;
  padding: 15px 5px 0;
  border-top: 1px solid var(--line);
}
.sidebar-account > div {
  flex: 1;
  min-width: 0;
}
.sidebar-account strong {
  display: block;
  font-size: 11px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-account > div > span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-top: 4px;
}
.sidebar-account .icon-button {
  width: 26px;
  height: 29px;
  font-size: 21px;
  padding: 2px;
}
.account-avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  font-size: 13px;
}
.account-avatar.large {
  width: 52px;
  height: 52px;
  font-size: 23px;
  border-radius: 15px;
}
.workspace-page {
  animation: enter 0.3s both;
}
.workspace-page > .page-heading .eyebrow {
  margin-bottom: 4px;
}
#platform-error {
  margin: 0 0 24px;
}
.muted {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.settings-card {
  max-width: 730px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--surface), var(--surface));
  border-radius: 15px;
  padding: 27px;
  animation: enter 0.4s 0.08s both;
}
.text-link {
  display: inline-flex;
  color: var(--accent);
  font-size: 12px;
}
.card-heading,
.account-heading {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-bottom: 15px;
}
.card-heading h2,
.account-heading h2 {
  font-size: 20px;
  letter-spacing: -0.4px;
  font-weight: 550;
  margin: 0 0 7px;
}
.card-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.card-symbol {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 13px;
  font-size: 25px;
}
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.link-preloader-settings {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px;
}
.link-preloader-settings summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 550;
  color: var(--ink);
}
.link-viewer-settings,
.link-idle-settings,
.link-extraction-settings,
.link-completion-settings {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px;
}
.link-viewer-settings summary,
.link-idle-settings summary,
.link-extraction-settings summary,
.link-completion-settings summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 550;
  color: var(--ink);
}
.link-viewer-settings .field-grid > div,
.link-idle-settings .field-grid > div,
.session-settings-fields > div {
  min-width: 0;
}
.link-viewer-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}
.extraction-rule-list,
.extraction-results {
  display: grid;
  gap: 14px;
  min-width: 0;
  margin-top: 15px;
}
.extraction-rule {
  min-width: 0;
  margin: 0;
  padding: 10px 12px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.extraction-rule-heading {
  /* Float the legend so its controls sit inside the fieldset border. */
  float: left;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 16px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.extraction-rule-number {
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 600;
}
.extraction-rule-remove {
  padding: 5px 9px;
  font-size: 11px;
}
.extraction-rule-fields {
  clear: both;
  display: grid;
  gap: 0 12px;
  grid-template-columns: 1fr 1fr;
}
.extraction-rule-fields > div {
  min-width: 0;
}
.extraction-rule-fields .field-label {
  margin-top: 0;
}
.extraction-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 13px;
}
.extraction-editor-footer .link-viewer-note {
  margin: 0;
}
.extraction-action {
  border-color: var(--line);
  padding: 7px 9px;
  font-size: 11px;
  line-height: 1.4;
}
.extraction-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.extraction-dialog {
  width: min(640px, calc(100vw - 32px));
}
.extraction-link-name {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-weight: 550;
}
.extraction-result {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}
.extraction-result-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.extraction-result-heading h3 {
  min-width: 0;
  margin: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.extraction-result-status {
  flex-shrink: 0;
  color: var(--accent);
  font-size: 10px;
}
.extraction-result-status.success {
  color: var(--success);
}
.extraction-result-selector {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}
.extraction-values {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}
.extraction-values li + li {
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 10px;
}
.extraction-values pre {
  margin: 0;
  font: inherit;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.extraction-result-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.saved-results-list {
  display: grid;
  gap: 24px;
  min-width: 0;
  margin-top: 20px;
}
.sessions-history {
  margin-top: 24px;
  max-width: none;
  min-width: 0;
}
.sessions-history .extraction-results {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  align-items: start;
}
.sessions-history .extraction-values {
  max-height: 240px;
  overflow: auto;
  overscroll-behavior: contain;
}
.settings-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: start;
  gap: 22px;
  margin-bottom: 28px;
}
.settings-overview .settings-card {
  max-width: none;
  min-width: 0;
}
.settings-membership .muted {
  margin: 20px 0;
}
.settings-membership .button {
  white-space: normal;
}
@media (max-width: 1000px) {
  .settings-overview {
    grid-template-columns: 1fr;
  }
}
.saved-results-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}
.saved-results-pagination[hidden] {
  display: none;
}
.saved-result-record {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
}
.saved-result-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.saved-result-source {
  display: grid;
  gap: 6px;
  min-width: 0;
  flex: 1;
}
.saved-result-origin {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}
.saved-result-heading h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 550;
}
.saved-result-heading .button {
  flex-shrink: 0;
  padding: 7px 10px;
  font-size: 11px;
}
.saved-result-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.settings-footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.link-editor-mode {
  padding: 20px;
}
.link-editor-mode > .sidebar,
.link-editor-mode > .main-shell,
.link-editor-mode > .skip-link {
  display: none;
}
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 1200px;
  margin: 0 auto 18px;
}
.editor-toolbar p {
  flex: 1;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.link-editor-mode #link-dialog {
  position: static;
  width: min(1200px, 100%);
  max-height: none;
  margin: 0 auto;
  overflow: visible;
}
.link-editor-mode #link-form > .dialog-footer {
  position: sticky;
  bottom: 0;
  padding-bottom: 18px;
  background: var(--surface);
}
@media (max-width: 700px) {
  .link-editor-mode {
    padding: 12px;
  }
  .editor-toolbar {
    flex-wrap: wrap;
  }
  .editor-toolbar p {
    order: 3;
    flex-basis: 100%;
  }
}
.extraction-footer {
  position: sticky;
  bottom: -27px;
  padding-bottom: 14px;
  background: var(--surface);
}
@media (max-width: 540px) {
  .link-viewer-settings .field-grid,
  .link-idle-settings .field-grid,
  .session-settings-fields,
  .extraction-rule-fields {
    grid-template-columns: 1fr;
  }
  .extraction-result-heading {
    flex-wrap: wrap;
  }
  .extraction-footer {
    bottom: -23px;
  }
}
.session-settings-stack {
  display: grid;
  gap: 22px;
  max-width: 730px;
}
.session-settings-stack .settings-card {
  min-width: 0;
}
.session-lifecycle-note,
.session-sync-status {
  max-width: 730px;
}
.session-sync-status {
  border-left: 2px solid var(--accent);
  padding-left: 12px;
}
.link-preloader-color {
  height: 43px;
  padding: 5px 8px;
  cursor: pointer;
}
.link-preloader-preview {
  --preloader-background: #10131a;
  --preloader-accent: #8b9dff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
  min-height: 138px;
  margin-top: 18px;
  padding: 18px;
  border-radius: 8px;
  background: var(--preloader-background);
  color: var(--preloader-accent);
  text-align: center;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.link-preloader-preset-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
}
.link-preloader-code {
  min-height: 180px;
  max-height: 360px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  tab-size: 2;
}
.link-preloader-code-note {
  margin: 10px 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.link-preloader-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.link-preloader-preview[data-style='custom'] {
  position: relative;
  height: 220px;
  padding: 0;
  overflow: hidden;
}
.link-preloader-custom-preview {
  position: absolute;
  inset: 0;
}
.link-preloader-custom-preview iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.link-preloader-settings [hidden] {
  display: none !important;
}
@media (max-width: 600px) {
  .link-preloader-code {
    font-size: 16px;
    line-height: 1.5;
  }
}
.link-preloader-indicator {
  display: block;
  width: 27px;
  height: 27px;
  border: 2px solid color-mix(in srgb, var(--preloader-accent) 25%, transparent);
  border-top-color: var(--preloader-accent);
  border-radius: 50%;
  animation: link-preloader-spin 0.9s linear infinite;
}
.link-preloader-preview[data-style='pulse'] .link-preloader-indicator {
  width: 17px;
  height: 17px;
  border: 0;
  background: var(--preloader-accent);
  animation: link-preloader-pulse 1.4s ease-in-out infinite;
}
@keyframes link-preloader-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes link-preloader-pulse {
  50% {
    transform: scale(1.35);
    opacity: 0.5;
  }
}
@media (prefers-reduced-motion: reduce) {
  .link-preloader-indicator {
    animation: none;
  }
}
.settings-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-top: 27px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}
.membership-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  font-size: 10px;
  background: var(--warning-soft);
  color: var(--warning);
  border: 1px solid var(--warning-line);
  border-radius: 7px;
  white-space: nowrap;
}
.membership-badge.active {
  color: var(--success);
  border-color: var(--success-line);
  background: var(--success-soft);
}
.cell-detail {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 7px;
}
.billing-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 29px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: radial-gradient(ellipse at 95% 0%, var(--surface), transparent 60%), var(--surface);
}
.billing-card h2 {
  margin: 20px 0 9px;
  font-size: clamp(24px, 3vw, 35px);
  font-weight: 500;
  letter-spacing: -0.8px;
}
.billing-card p {
  margin: 0;
  font-size: 12px;
  color: var(--accent);
}
.inline-note {
  font-size: 12px;
  line-height: 1.65;
  color: var(--accent);
  margin: 17px 0;
}
.inline-note strong {
  color: var(--ink);
  font-weight: 500;
}
.account-details {
  margin: 29px 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.account-details dt {
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 9px;
}
.account-details dd {
  font-size: 13px;
  color: var(--ink);
  margin: 0;
}
.enrollment-qr {
  display: grid;
  place-items: center;
  padding: 18px;
}
.enrollment-qr img {
  border: 10px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  object-fit: contain;
  max-width: 100%;
  height: auto;
}
.secret-field {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  letter-spacing: 0.5px;
}
.domain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 18px;
}
.domain-card {
  min-width: 0;
  padding: 23px;
  background: linear-gradient(145deg, var(--surface), var(--surface));
  border: 1px solid var(--line);
  border-radius: 14px;
  animation: enter 0.4s both;
}
.domain-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}
.domain-heading > div {
  min-width: 0;
}
.domain-heading h2 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 550;
  letter-spacing: -0.2px;
  overflow-wrap: anywhere;
}
.domain-heading .muted {
  font-size: 11px;
}
.dns-proof {
  padding: 0 14px 14px;
  margin: 22px 0 18px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.dns-proof .field-label {
  font-size: 11px;
  margin-top: 14px;
}
.proof-label {
  display: block;
  color: var(--accent);
  font-size: 10px;
  margin: 13px 0 6px;
}
.proof-value {
  display: block;
  font-size: 11px;
  line-height: 1.6;
  color: var(--ink);
  overflow-wrap: anywhere;
  user-select: all;
}
.domain-actions {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 21px;
}
.domain-actions .button {
  font-size: 11px;
  padding: 10px 12px;
}
.domain-actions .icon-button {
  margin-left: auto;
}
.certificate-tabs {
  width: fit-content;
  margin: 20px 0 8px;
}
.pem-field {
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1.6;
  min-height: 120px;
}
select.field-input {
  color: var(--ink);
}
.field-input[readonly] {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.allocation-note {
  min-height: 38px;
  margin-bottom: 3px;
}
.preview-loading {
  color: var(--accent);
}
.recalculate-button {
  margin-top: 18px;
  min-height: 38px;
  font-size: 11px;
}
.session-entitlement {
  display: inline-block;
  min-width: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 8px;
  text-align: center;
  background: var(--surface);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.resource-settings .field-grid > div {
  min-width: 0;
}
#page-customers th,
#page-customers td {
  white-space: nowrap;
}
.invoice-table td .button {
  padding: 7px 10px;
  min-height: 33px;
  font-size: 10px;
}
@media (max-width: 950px) {
  .sidebar-account {
    flex-direction: column;
    width: 100%;
    gap: 7px;
  }
  .sidebar-account > div {
    display: none;
  }
  .sidebar-account .account-avatar {
    width: 28px;
    height: 28px;
  }
}
@media (max-width: 640px) {
  .sidebar {
    padding: 16px 16px 12px;
    flex-wrap: wrap;
    gap: 15px;
  }
  .sidebar nav {
    order: 3;
    display: flex;
    gap: 3px;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    min-width: 0;
  }
  .sidebar nav .nav-item {
    flex: 0 0 74px;
    flex-direction: column;
    border: 1px solid transparent;
    gap: 7px;
    padding: 10px 3px;
    min-width: 0;
    font-size: 9px;
    text-align: center;
  }
  .sidebar nav .nav-item > span:not(.nav-symbol) {
    max-width: 100%;
    line-height: 1.35;
    white-space: normal;
  }
  .sidebar nav .nav-item.current {
    border-color: var(--line);
  }
  .nav-symbol {
    font-size: 20px;
    width: 20px;
    height: 20px;
  }
  .sidebar .nav-count {
    display: none;
  }
  .sidebar-account {
    margin: 0;
    padding: 0;
    border: 0;
    width: auto;
    flex-direction: row;
    gap: 8px;
  }
  .sidebar-account > div {
    display: block;
  }
  .sidebar-account > div > span {
    display: none;
  }
  .sidebar-account strong {
    max-width: 100px;
  }
  .sidebar-account .account-avatar {
    display: none;
  }
  .sidebar-account .icon-button {
    height: 32px;
    width: 32px;
  }
  .settings-card,
  .billing-card {
    padding: 22px;
    border-radius: 13px;
  }
  .billing-card {
    align-items: flex-start;
    flex-direction: column;
  }
  .billing-card > .button {
    width: 100%;
  }
  .field-grid {
    gap: 11px;
  }
  .settings-footer {
    gap: 14px;
    flex-wrap: wrap;
  }
  .settings-footer .muted {
    font-size: 10px;
  }
  .account-details {
    gap: 21px 12px;
  }
  .account-details dd {
    font-size: 12px;
  }
  #page-customers tbody tr,
  #page-billing tbody tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
  }
  #page-customers td:first-child {
    grid-row: 1;
  }
  #page-customers td:nth-child(2) {
    grid-row: 2;
    grid-column: 1;
  }
  #page-customers td:nth-child(2)::before {
    content: 'Sessions · ';
    color: var(--muted);
  }
  #page-customers td:nth-child(3) {
    grid-row: 3;
    grid-column: 1;
  }
  #page-customers td:nth-child(3)::before {
    content: 'RAM · ';
    color: var(--muted);
  }
  #page-customers td:nth-child(4) {
    grid-row: 4;
    grid-column: 1;
    text-align: left;
  }
  #page-customers td:nth-child(4)::before {
    content: 'Storage · ';
    color: var(--muted);
  }
  #page-customers td:nth-child(5) {
    grid-row: 1 / 3;
    grid-column: 2;
  }
  #page-customers td:last-child {
    grid-row: 3 / 5;
    grid-column: 2;
    justify-self: end;
  }
  #page-customers .cell-detail {
    margin-top: 5px;
  }
  #page-billing td:first-child {
    grid-row: 1;
    grid-column: 1;
    color: var(--muted);
    font-size: 10px;
  }
  #page-billing td:nth-child(2) {
    grid-row: 2;
    grid-column: 1;
  }
  #page-billing td:nth-child(3) {
    grid-row: 1;
    grid-column: 2;
    justify-self: end;
  }
  #page-billing td:last-child {
    grid-row: 2;
    grid-column: 2;
    justify-self: end;
  }
  #page-customers .destination-name,
  #page-customers .destination-host {
    max-width: 140px;
  }
  .domain-card {
    padding: 20px;
  }
  .domain-heading .membership-badge {
    font-size: 9px;
  }
  .page-heading .button-secondary {
    max-width: 145px;
    white-space: normal;
  }
  .pem-field {
    font-size: 12px;
  }
}

/* Workspace composition. Existing structural hooks also serve the React views. */
body {
  background: var(--canvas);
  line-height: 1.5;
}
.portal-workspace {
  background-image:
    radial-gradient(ellipse at 100% 0, #ff5c700b, transparent 45%),
    linear-gradient(#ffffff03 1px, transparent 1px),
    linear-gradient(90deg, #ffffff03 1px, transparent 1px);
  background-size:
    auto,
    48px 48px,
    48px 48px;
}
.brand,
.nav-item,
.topbar-title,
.environment,
.eyebrow,
h1,
h2,
h3,
.stat-value,
.plan-price,
.panel-footer,
.count-badge,
.route-chip,
.session-entitlement {
  font-family: var(--mono);
}
::selection {
  color: var(--ink);
  background: var(--accent-line);
}
#panel-root {
  display: contents;
}
.panel-loading {
  display: grid;
  place-items: center;
  min-height: calc(100dvh - 40px);
  padding: 24px;
  color: var(--muted);
  font-size: 13px;
}
.ui-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.sidebar {
  inset: 16px auto 16px 16px;
  width: 224px;
  padding: 26px 14px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 8px 32px #0004;
}
.brand {
  gap: 11px;
  padding: 0 10px;
  color: var(--ink);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -1.2px;
}
.brand-mark {
  width: 37px;
  height: 37px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
}
.brand-mark svg {
  width: 27px;
  height: 27px;
}
.brand-dot {
  color: var(--accent);
}
.sidebar nav {
  margin-top: 42px;
  gap: 7px;
}
.nav-item {
  gap: 12px;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
}
.nav-item:hover {
  color: var(--ink);
  background: var(--surface-raised);
}
.nav-item.current {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
  box-shadow: inset 3px 0 var(--accent);
}
.nav-item:focus-visible {
  outline-color: var(--accent);
}
.nav-symbol {
  width: 20px;
  color: inherit;
}
.nav-symbol svg,
.nav-item svg {
  width: 19px;
  height: 19px;
}
.nav-count {
  color: var(--muted);
  background: var(--surface-raised);
  border-radius: 6px;
}
.nav-item.current .nav-count {
  color: var(--accent);
  background: var(--surface);
}
.sidebar-art {
  display: none;
}
.sidebar-account {
  gap: 10px;
  padding: 20px 7px 2px;
  border-color: var(--surface-raised);
}
.sidebar-account strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.sidebar-account > div > span {
  color: var(--muted);
  font-size: 10px;
  text-transform: capitalize;
}
.sidebar-account .icon-button {
  width: 32px;
  height: 36px;
  padding: 7px;
  color: var(--muted);
}
.sidebar-account .icon-button:hover {
  background: var(--surface-raised);
  border-color: transparent;
  color: var(--ink);
}
.account-avatar {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--surface-raised);
  border-color: var(--line);
  color: var(--ink);
}
.account-avatar.large {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent);
}
.main-shell {
  margin-left: var(--shell-offset);
}
.topbar {
  min-height: 84px;
  height: auto;
  padding: 0 40px;
  background: #131316ed;
  backdrop-filter: blur(8px);
}
.topbar-location {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.topbar-icon {
  display: grid;
  place-items: center;
  color: var(--muted);
}
.topbar-icon svg {
  width: 17px;
  height: 17px;
}
.topbar-title {
  color: var(--muted);
  font-weight: 500;
}
.environment {
  font-weight: 500;
  padding: 6px 11px;
}
main {
  max-width: 1470px;
  min-width: 0;
  padding: 36px 40px 56px;
}
.page-heading {
  margin-bottom: 28px;
  animation: none;
}
.workspace-page {
  animation: enter 0.35s both;
}
.eyebrow {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 1.6px;
}
h1 {
  margin-top: 8px;
  font-size: clamp(28px, 2.7vw, 35px);
  font-weight: 550;
  letter-spacing: -1.1px;
  line-height: 1.2;
}
.button {
  min-height: 44px;
  padding: 11px 17px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--surface);
}
.button:hover {
  background: var(--surface-raised);
  border-color: var(--line-strong);
}
.button-primary {
  border-color: var(--accent);
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 0 3px 8px #ff5c7012;
}
.button-primary:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
  box-shadow: 0 5px 14px #ff5c7024;
  transform: translateY(-1px);
}
.button-secondary {
  border-color: var(--line);
  color: var(--ink);
  background: var(--surface);
}
.button-secondary:hover {
  background: var(--surface-soft);
}
.button-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--danger-ink);
}
.button-danger:hover {
  background: var(--danger-hover);
  border-color: var(--danger-hover);
}
.button:disabled:hover {
  transform: none;
  box-shadow: none;
}
button:disabled {
  cursor: not-allowed;
}
.button:active {
  transform: translateY(0);
}
.button svg {
  width: 17px;
  height: 17px;
}
.icon-button {
  width: 36px;
  height: 36px;
  padding: 8px;
  border-radius: 9px;
  color: var(--muted);
}
.icon-button svg {
  width: 17px;
  height: 17px;
}
.icon-button:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-line);
  transform: none;
}
.icon-button.danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger-line);
}
.stats {
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.stat {
  padding: 24px;
  border-radius: 12px;
  border-top-color: var(--accent-line);
  background: linear-gradient(135deg, var(--surface-raised), var(--surface));
  box-shadow: var(--shadow);
}
.stat:hover {
  transform: none;
  border-color: var(--line-strong);
  box-shadow: 0 5px 20px #0004;
}
.stat-label {
  color: var(--muted);
  font-size: 12px;
}
.stat-value {
  font-size: 32px;
  font-weight: 500;
  color: var(--ink);
}
.stat-icon {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
}
.stat-icon.green {
  color: var(--success);
  background: var(--success-soft);
}
.stat-icon.violet {
  color: var(--info);
  background: var(--info-soft);
}
.links-panel {
  min-width: 0;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: none;
}
.panel-heading {
  padding: 24px;
}
.panel-heading h2 {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.2px;
}
.panel-heading h2::before {
  content: '';
  width: 3px;
  height: 16px;
  background: var(--accent);
  border-radius: 1px;
  flex-shrink: 0;
}
.count-badge {
  padding: 2px 8px;
  color: var(--muted);
  background: var(--surface-soft);
  border-color: var(--line);
  border-radius: 6px;
}
.search {
  min-height: 40px;
  width: 265px;
  border-radius: 9px;
  background: var(--surface-soft);
}
.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.search input {
  font-size: 12px;
  color: var(--ink);
}
.search svg {
  color: var(--muted);
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
.panel-subbar {
  padding-bottom: 22px;
}
.filters {
  padding: 4px;
  gap: 3px;
  border-radius: 10px;
  background: var(--surface-soft);
}
.filter {
  min-height: 32px;
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
}
.filter:hover {
  color: var(--accent);
}
.filter.selected {
  border-color: var(--accent-line);
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 4px #0002;
}
thead {
  background: var(--surface-soft);
}
th {
  padding: 14px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.3px;
}
td {
  padding: 20px 14px;
  border-bottom-color: var(--line);
}
tbody tr:hover {
  background: var(--surface-soft);
}
.destination-mark {
  width: 39px;
  height: 39px;
  border-radius: 12px;
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 15px;
}
.destination-mark.tone-1 {
  background: var(--success-soft);
  border-color: var(--success-line);
  color: var(--success);
}
.destination-mark.tone-2 {
  background: var(--info-soft);
  border-color: var(--info-line);
  color: var(--info);
}
.destination-mark.tone-3 {
  background: var(--warning-soft);
  border-color: var(--warning-line);
  color: var(--warning);
}
.destination-name {
  color: var(--ink);
  font-weight: 600;
}
.destination-host,
.updated-cell {
  color: var(--muted);
}
.route-chip {
  color: var(--muted);
  border-color: var(--line);
  background: var(--surface-soft);
}
.viewer-profile {
  color: var(--muted);
  background: var(--surface);
  border-radius: 6px;
}
.engine-label {
  font-size: 11px;
  color: var(--muted);
}
.engine-label::before {
  background: var(--muted);
}
.engine-label.gologin::before {
  background: var(--success);
}
.status-toggle {
  background: var(--success-soft);
  color: var(--success);
  border-color: var(--success-line);
  font-weight: 500;
}
.status-toggle::before {
  background: currentColor;
}
.status-toggle[aria-checked='false'] {
  background: var(--surface-soft);
  color: var(--muted);
  border-color: var(--line);
}
.status-toggle[aria-checked='false']::before {
  background: currentColor;
}
.panel-footer {
  color: var(--muted);
  font-size: 11px;
}
.capacity-label {
  color: var(--muted);
}
.empty-state {
  padding: 48px 24px 52px;
}
.empty-illustration {
  border-radius: 12px;
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}
.empty-illustration svg {
  width: 37px;
  height: 37px;
}
.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
}
.empty-state p {
  color: var(--muted);
}
.settings-card,
.domain-card,
.plan-card {
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.settings-card {
  max-width: 760px;
  padding: 28px;
  animation: none;
}
.settings-overview .settings-card,
.sessions-history {
  max-width: none;
}
.card-heading,
.account-heading {
  margin-bottom: 20px;
}
.card-heading h2,
.account-heading h2 {
  font-weight: 650;
  letter-spacing: -0.5px;
}
.card-symbol {
  border: 0;
  background: var(--accent-soft);
  color: var(--accent);
}
.card-symbol svg {
  width: 23px;
  height: 23px;
}
.settings-overview {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
}
.session-settings-stack,
.session-lifecycle-note,
.session-sync-status {
  max-width: 760px;
}
.field-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
}
.field-grid > div {
  min-width: 0;
}
.field-label,
.browser-field legend {
  color: var(--muted);
  font-weight: 600;
  margin-top: 19px;
}
.field-input {
  min-width: 0;
  padding: 12px 13px;
  border-color: var(--line-strong);
  background: var(--canvas);
  color: var(--ink);
  line-height: 1.5;
  border-radius: 9px;
}
.field-input:hover {
  border-color: var(--line-strong);
}
.field-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.field-input:disabled {
  color: var(--muted);
  background-color: var(--surface-soft);
  cursor: not-allowed;
}
.field-input[readonly] {
  border-color: var(--line);
  background-color: var(--surface-soft);
  color: var(--muted);
}
select.field-input {
  color: var(--ink);
}
select.field-input,
select.viewer-profile {
  -webkit-appearance: none;
  appearance: none;
  padding-inline-end: 44px;
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
}
select.viewer-profile {
  padding-inline-end: 30px;
  background-position: right 9px center;
  background-size: 14px 14px;
}
select[multiple],
select[size]:not([size='1']) {
  -webkit-appearance: auto;
  appearance: auto;
  padding-inline-end: 13px;
  background-image: none;
}
.browser-choice > span {
  min-height: 48px;
  background: var(--surface-soft);
  color: var(--muted);
}
.browser-choice input:checked + span {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent);
}
.enabled-field {
  padding: 15px 16px;
  border-color: var(--line);
  background: var(--surface-soft);
  border-radius: 11px;
}
.enabled-field strong {
  color: var(--ink);
  font-weight: 600;
}
.checkbox-switch {
  width: 38px;
  height: 23px;
  background: var(--surface-raised);
  border-color: var(--line-strong);
}
.checkbox-switch::after {
  width: 17px;
  height: 17px;
  background: var(--muted);
  box-shadow: 0 1px 3px #0004;
}
.enabled-field input:checked + .checkbox-switch {
  background: var(--accent);
  border-color: var(--accent);
}
.enabled-field input:checked + .checkbox-switch::after {
  background: var(--accent-ink);
  transform: translateX(15px);
}
dialog {
  width: min(500px, calc(100vw - 32px));
  padding: 28px;
  border-color: var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 32px 120px #0009;
  overscroll-behavior: contain;
}
dialog::backdrop {
  background: #000a;
  backdrop-filter: blur(5px);
}
.dialog-header h2,
.delete-dialog h2 {
  font-weight: 650;
}
.telegram-reauth-code {
  min-height: 52px;
  font-family: var(--mono);
  font-size: 24px;
  letter-spacing: 0.3em;
  text-align: center;
}
#telegram-reauth-dialog .dialog-footer {
  flex-wrap: wrap;
}
.dialog-header .icon-button {
  background: var(--surface-soft);
}
.dialog-footer {
  margin-top: 26px;
  padding-top: 22px;
}
.delete-symbol {
  width: 46px;
  height: 46px;
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger-line);
  border-radius: 14px;
}
.delete-symbol svg {
  width: 23px;
  height: 23px;
}
.delete-dialog p strong {
  color: var(--ink);
  font-weight: 600;
}
.toast {
  left: calc(50% + var(--shell-offset) / 2);
  padding: 12px 12px 12px 16px;
  background: var(--surface);
  color: var(--success);
  border-color: var(--success-line);
  border-radius: 13px;
  box-shadow: 0 12px 48px #0008;
}
.toast.error {
  background: var(--surface);
  color: var(--danger);
  border-color: var(--danger-line);
}
.plan-grid {
  max-width: 1160px;
  gap: 22px;
}
.plan-card {
  padding: 28px;
}
.plan-card h2,
.domain-heading h2 {
  font-weight: 650;
}
.plan-price {
  margin: 28px 0 16px;
  color: var(--accent);
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -1px;
}
.plan-resources dd {
  font-size: 14px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.billing-card {
  padding: 30px;
  border-color: var(--accent-line);
  border-radius: 12px;
  background: linear-gradient(120deg, var(--surface) 30%, var(--accent-soft));
  box-shadow: var(--shadow);
}
.billing-card h2 {
  font-weight: 650;
  letter-spacing: -1px;
}
.billing-card p {
  color: var(--muted);
}
.inline-note strong {
  color: var(--ink);
  font-weight: 600;
}
.inline-note {
  color: var(--muted);
}
.eyebrow,
th,
.count-badge,
.destination-host,
.updated-cell,
.engine-label,
.panel-footer,
.capacity-label,
.account-details dt,
.proof-label,
.extraction-result-selector,
.saved-result-heading h3 {
  color: var(--muted);
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
}
.account-details dt {
  color: var(--muted);
}
.account-details dd {
  color: var(--ink);
  overflow-wrap: anywhere;
}
.domain-card {
  padding: 26px;
}
.dns-proof {
  border-radius: 11px;
  background: var(--surface-soft);
}
.proof-value {
  color: var(--muted);
}
.session-entitlement {
  min-width: 32px;
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-line);
  font-weight: 600;
}
.link-preloader-settings,
.link-viewer-settings,
.link-idle-settings,
.link-extraction-settings,
.link-completion-settings {
  min-width: 0;
  padding: 16px;
  background: var(--surface);
  border-radius: 12px;
}
.link-preloader-settings summary,
.link-viewer-settings summary,
.link-idle-settings summary,
.link-extraction-settings summary,
.link-completion-settings summary {
  color: var(--ink);
  font-weight: 600;
  line-height: 1.6;
}
summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 28px;
  list-style: none;
}
summary::-webkit-details-marker {
  display: none;
}
summary::marker {
  content: '';
}
summary::after {
  content: '';
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin-inline-start: auto;
  background: var(--disclosure-chevron) center / 16px 16px no-repeat;
  transition: transform 0.18s ease;
}
details[open] > summary {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
details[open] > summary::after {
  transform: rotate(180deg);
}
@media (forced-colors: active) {
  select.field-input,
  select.viewer-profile {
    -webkit-appearance: auto;
    appearance: auto;
    background-image: none;
  }
  summary::after {
    flex-basis: 8px;
    width: 8px;
    height: 8px;
    margin-inline-end: 4px;
    background: none;
    border-right: 2px solid CanvasText;
    border-bottom: 2px solid CanvasText;
    transform: rotate(45deg);
  }
  details[open] > summary::after {
    transform: rotate(225deg);
  }
}
.extraction-rule {
  background: var(--surface-soft);
  padding: 16px;
}
.extraction-result {
  padding: 17px;
  border-radius: 12px;
  background: var(--surface-soft);
}
.extraction-result-heading h3 {
  color: var(--ink);
  font-weight: 600;
}
.extraction-result-selector {
  color: var(--muted);
}
.saved-results-list {
  gap: 20px;
}
.saved-result-record {
  padding: 20px;
  border-radius: 13px;
  background: var(--surface);
}
.saved-result-origin {
  color: var(--ink);
}
.saved-result-heading h3 {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}
.saved-result-heading .button {
  min-height: 34px;
}
.link-editor-mode {
  padding: 28px;
}
.link-editor-mode .sidebar,
.link-editor-mode .main-shell,
.link-editor-mode .skip-link {
  display: none;
}
.link-editor-mode #link-dialog {
  box-shadow: var(--shadow);
}
.link-editor-mode #link-form > .dialog-footer {
  z-index: 2;
  background: #131316f5;
  backdrop-filter: blur(8px);
}
.extraction-footer {
  background: var(--surface);
}

/* Create and edit share one in-panel form; only its fields scroll. */
#link-dialog.link-editor-dialog {
  width: min(1180px, calc(100vw - 48px));
  max-width: calc(100vw - 48px);
  max-height: min(920px, calc(100dvh - 48px));
  padding: 0;
  overflow: hidden;
}
#link-form.link-editor-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: inherit;
  min-width: 0;
}
.link-editor-form > .dialog-header,
.link-editor-form > .dialog-footer {
  flex: 0 0 auto;
  padding: 22px 28px;
  margin: 0;
  background: var(--surface);
}
.link-editor-form > .dialog-header {
  border-bottom: 1px solid var(--line);
}
.link-editor-form > .dialog-header .icon-button {
  margin: 0;
  width: 40px;
  height: 40px;
}
.link-editor-form > .dialog-footer {
  border-top: 1px solid var(--line);
}
.link-editor-form > .form-error {
  flex: 0 0 auto;
  margin: 12px 28px;
}
.link-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: start;
  gap: 24px;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scroll-padding: 24px;
  padding: 28px;
  background: var(--surface-soft);
}
.link-editor-grid > *,
.link-editor-advanced-grid > * {
  min-width: 0;
}
.link-editor-basics,
.link-editor-settings {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.link-editor-grid h3 {
  margin: 0 0 20px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.2px;
}
.link-editor-basics > .field-label:first-of-type {
  margin-top: 0;
}
.link-editor-grid .field-input {
  min-height: 46px;
}
.link-editor-path-note {
  margin-top: 8px;
}
.link-editor-basics .enabled-field {
  margin-top: 24px;
  background: var(--surface-soft);
}
.link-editor-settings .browser-field legend {
  margin-top: 0;
  margin-bottom: 16px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
}
.link-editor-preferences {
  display: grid;
  gap: 14px;
}
.link-editor-grid details {
  margin-top: 0;
  padding: 18px 20px;
  border-radius: 12px;
  background: var(--surface);
}
.link-editor-grid summary {
  line-height: 1.5;
}
.link-editor-grid summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
  border-radius: 3px;
}
.link-editor-automation,
.link-editor-grid > #link-preloader-settings {
  grid-column: 1 / -1;
}
.link-editor-automation > h3 {
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--muted);
}
.link-editor-advanced-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}
/* Keep previously bookmarked editor URLs usable in the same tab. */
.link-editor-mode #link-dialog.link-editor-dialog {
  width: min(1180px, 100%);
  max-width: 100%;
  max-height: none;
  overflow: visible;
}
.link-editor-mode #link-form.link-editor-form {
  display: flex;
}
.link-editor-mode .link-editor-grid {
  overflow: visible;
}

@media (max-width: 760px) {
  #link-dialog.link-editor-dialog {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 16px;
  }
  .link-editor-form > .dialog-header,
  .link-editor-form > .dialog-footer {
    padding: 14px 18px;
  }
  .link-editor-form > .dialog-header h2 {
    font-size: 21px;
  }
  .link-editor-form > .form-error {
    margin: 10px 18px;
  }
  .link-editor-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 16px;
    scroll-padding: 16px;
  }
  .link-editor-advanced-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .link-editor-basics,
  .link-editor-settings {
    padding: 18px;
  }
  .link-editor-grid details {
    padding: 16px;
  }
  .link-editor-form .field-input {
    font-size: 16px;
  }
  .link-editor-form > .dialog-footer .button {
    flex: 1;
    min-height: 44px;
  }
}
@media (max-width: 420px) {
  .link-editor-grid .browser-choices {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 1250px) {
  :root {
    --shell-offset: 236px;
  }
  .sidebar {
    width: 204px;
    padding-left: 11px;
    padding-right: 11px;
  }
  .brand {
    font-size: 25px;
  }
  .nav-item {
    padding-left: 12px;
    padding-right: 12px;
    font-size: 12px;
  }
  .topbar {
    padding: 0 28px;
  }
  main {
    padding: 32px 28px 44px;
  }
  .stat {
    padding: 20px;
  }
}
@media (max-width: 1050px) {
  :root {
    --shell-offset: 108px;
  }
  .sidebar {
    width: 76px;
    padding: 24px 10px 16px;
    align-items: center;
    border-radius: 12px;
  }
  .brand {
    padding: 0;
  }
  .sidebar .brand > span:last-child {
    display: none;
  }
  .sidebar nav {
    width: 100%;
    margin-top: 32px;
  }
  .nav-item {
    justify-content: center;
    padding: 12px;
  }
  .nav-item > span:not(.nav-symbol) {
    display: none;
  }
  .sidebar-account {
    flex-direction: column;
    gap: 10px;
    width: 100%;
    padding-top: 16px;
  }
  .sidebar-account > div {
    display: none;
  }
  .settings-overview {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  :root {
    --shell-offset: 0px;
  }
  .sidebar {
    position: static;
    width: auto;
    margin: 0;
    padding: 18px 18px 12px;
    border: 0;
    border-radius: 0;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px;
    box-shadow: none;
    overflow: visible;
  }
  .brand {
    gap: 9px;
    font-size: 24px;
  }
  .sidebar .brand > span:last-child {
    display: inline;
  }
  .brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }
  .brand-mark svg {
    width: 24px;
    height: 24px;
  }
  .sidebar nav {
    order: 3;
    display: flex;
    gap: 6px;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding-bottom: 3px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
  }
  .sidebar nav .nav-item {
    flex: 0 0 auto;
    flex-direction: row;
    gap: 8px;
    min-height: 42px;
    padding: 10px 12px;
    font-size: 11px;
    border-radius: 9px;
  }
  .nav-item > span:not(.nav-count) {
    display: inline;
  }
  .sidebar .nav-count {
    display: none;
  }
  .sidebar-account {
    flex-direction: row;
    gap: 8px;
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
  }
  .sidebar-account > div {
    display: block;
  }
  .sidebar-account > div > span,
  .sidebar-account .account-avatar {
    display: none;
  }
  .sidebar-account strong {
    max-width: 100px;
    font-size: 11px;
  }
  .sidebar-account .icon-button {
    width: 36px;
    height: 36px;
  }
  .main-shell {
    margin-left: 0;
  }
  .topbar {
    min-height: 52px;
    padding: 0 20px;
  }
  main {
    padding: 26px 18px 36px;
  }
  .page-heading {
    gap: 14px;
    margin-bottom: 24px;
    flex-wrap: wrap;
  }
  h1 {
    font-size: 29px;
    letter-spacing: -1px;
  }
  .eyebrow {
    font-size: 9px;
    letter-spacing: 1.3px;
  }
  .button {
    min-height: 44px;
    padding: 10px 13px;
    font-size: 11px;
  }
  .stats {
    gap: 10px;
    margin-bottom: 24px;
  }
  .stat {
    padding: 17px 14px;
    border-radius: 13px;
  }
  .stat-label {
    font-size: 10px;
  }
  .stat-value {
    margin-top: 10px;
    font-size: 27px;
  }
  .stat-icon {
    display: none;
  }
  .panel-heading {
    padding: 20px;
    flex-wrap: wrap;
    gap: 16px;
  }
  .search {
    width: 100%;
    min-height: 44px;
  }
  .search input {
    font-size: 16px;
  }
  .panel-subbar {
    padding: 0 20px 18px;
  }
  .filter {
    min-height: 36px;
  }
  .links-panel {
    border-radius: 10px;
  }
  .settings-card,
  .billing-card,
  .domain-card,
  .plan-card {
    padding: 22px;
    border-radius: 10px;
  }
  .field-input {
    min-height: 46px;
    font-size: 16px;
  }
  .viewer-profile {
    min-height: 34px;
    font-size: 12px;
  }
  .pem-field {
    font-size: 12px;
  }
  .toast {
    left: 50%;
  }
  dialog {
    padding: 24px;
    max-height: calc(100dvh - 24px);
    border-radius: 12px;
  }
  .extraction-footer {
    bottom: -24px;
  }
  .link-editor-mode {
    padding: 16px;
  }
  .editor-toolbar {
    flex-wrap: wrap;
  }
  .editor-toolbar p {
    order: 3;
    flex-basis: 100%;
  }
}
@media (max-width: 640px) {
  tbody {
    padding: 0 12px 12px;
  }
  tbody tr {
    grid-template-columns: minmax(0, 1fr) auto;
    margin: 0 0 12px;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
  }
  tbody tr:last-child {
    margin-bottom: 0;
  }
  td:last-child {
    grid-column: 1 / -1;
    grid-row: 4;
    padding-top: 12px !important;
    border-top: 1px solid var(--line);
  }
  .row-actions {
    gap: 4px;
  }
  .row-actions .icon-button {
    width: 38px;
    height: 40px;
    padding: 10px;
    border-color: var(--line);
    background: var(--surface-soft);
  }
  .status-toggle {
    min-height: 34px;
  }
  #page-customers td:last-child {
    grid-column: 1 / -1;
    grid-row: 5;
    justify-self: stretch;
  }
  #page-billing td:last-child {
    grid-column: 2;
    grid-row: 2;
    padding-top: 0 !important;
    border: 0;
  }
}
@media (max-width: 540px) {
  .field-grid,
  .session-settings-fields,
  .extraction-rule-fields {
    grid-template-columns: minmax(0, 1fr);
  }
  .saved-result-record {
    padding: 15px;
  }
  .saved-results-pagination {
    flex-wrap: wrap;
    justify-content: center;
  }
  .extraction-editor-footer {
    flex-wrap: wrap;
  }
}
@media (max-width: 370px) {
  .sidebar {
    padding-left: 14px;
    padding-right: 14px;
  }
  main {
    padding-left: 14px;
    padding-right: 14px;
  }
  .row-actions .icon-button {
    width: 35px;
    height: 38px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Live Visitor Analytics Dashboard & Protection Styles
   ========================================================================== */

#page-analytics .panel-heading h2::before {
  display: none !important;
}

.analytics-heading-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--success);
  background: var(--success-soft);
  border: 1px solid var(--success-line);
  border-radius: 999px;
  padding: 4px 12px;
  letter-spacing: 0.2px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: live-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes live-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.35;
    transform: scale(0.85);
  }
}

.analytics-two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 20px;
  margin-top: 20px;
  margin-bottom: 20px;
}

.analytics-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg, 10px);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.analytics-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
}

.analytics-card-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.analytics-card-icon {
  font-size: 20px;
  line-height: 1;
}

.analytics-card-header h2 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
  letter-spacing: -0.1px;
}

.analytics-card-sub {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.analytics-card-content {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.analytics-metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13px;
}

.analytics-metric-row:last-child {
  border-bottom: none;
}

.analytics-metric-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.analytics-flag-emoji {
  font-size: 18px;
  line-height: 1;
  display: inline-block;
}

.analytics-country-code {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 6px;
  letter-spacing: 0.5px;
}

.analytics-country-name {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analytics-browser-icon {
  font-size: 16px;
  line-height: 1;
}

.analytics-metric-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.analytics-metric-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.analytics-progress-track {
  width: 130px;
  height: 6px;
  background: var(--surface-soft);
  border-radius: 999px;
  overflow: hidden;
}

.analytics-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.analytics-progress-fill.green {
  background: linear-gradient(90deg, #059669, #34d399);
}

.analytics-progress-fill.blue {
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}

.analytics-progress-fill.violet {
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
}

.analytics-metric-val {
  width: 85px;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* Device Segmented Graph */
.analytics-segmented-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 6px;
}

.analytics-segmented-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  display: flex;
  overflow: hidden;
}

.analytics-segment.desktop {
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  transition: width 0.4s ease;
}

.analytics-segment.mobile {
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
  transition: width 0.4s ease;
}

.analytics-segmented-legend {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 12px;
  color: var(--muted);
}

.analytics-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.desktop {
  background: #3b82f6;
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.4);
}

.legend-dot.mobile {
  background: #8b5cf6;
  box-shadow: 0 0 6px rgba(139, 92, 246, 0.4);
}

.analytics-subhead {
  margin-top: 14px;
  margin-bottom: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.analytics-subhead-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
}

/* Recent Activity Feed Table */
.analytics-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.analytics-table th {
  text-align: left;
  padding: 12px 18px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.01);
}

.analytics-table td {
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.analytics-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.analytics-cell-time {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.analytics-country-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.seed-badge-pill {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  user-select: none;
}

.seed-badge-pill:hover {
  border-color: var(--primary, #3b82f6);
  color: var(--text);
  background: var(--surface-raised);
}

.seed-badge-pill.copied {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
}

/* ==========================================================================
   Streaming Engine Selection Cards (WebRTC vs noVNC)
   ========================================================================== */

.link-editor-streaming {
  margin-top: 18px;
  margin-bottom: 18px;
}

.streaming-field {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: var(--radius-md, 8px);
  padding: 14px 16px 16px;
  margin: 0;
}

.streaming-field legend {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  padding: 0 6px;
}

.stream-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.stream-choice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.stream-choice:hover {
  border-color: var(--line-strong, #3a4254);
  background: var(--surface-raised, #1c212d);
}

.stream-choice:has(input:checked) {
  border-color: var(--primary, #3b82f6);
  background: rgba(59, 130, 246, 0.08);
  box-shadow: 0 0 0 1px var(--primary, #3b82f6);
}

.stream-choice input[type='radio'] {
  margin-top: 3px;
  accent-color: var(--primary, #3b82f6);
}

.stream-choice span {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.stream-choice strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.stream-choice small {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

.stream-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  width: fit-content;
  margin-bottom: 2px;
}

.stream-badge-pill.webrtc {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.stream-badge-pill.novnc {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

/* ==========================================================================
   Anti-Bot & Anti-DDoS Protection Controls
   ========================================================================== */

.link-editor-antibot {
  margin-bottom: 18px;
}

.antibot-card {
  border: 1px solid rgba(99, 102, 241, 0.25);
  background: rgba(99, 102, 241, 0.06);
  border-radius: var(--radius-md, 8px);
  padding: 14px 16px;
}

.antibot-card .enabled-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  cursor: pointer;
}

.antibot-card strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.antibot-card .field-note {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.antibot-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  margin-top: 6px;
  width: fit-content;
}

.antibot-status-pill.active {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.antibot-status-pill.disabled {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.2px;
  user-select: none;
}

.status-pill.success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.status-pill.pending {
  background: rgba(148, 163, 184, 0.1);
  color: var(--muted);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.stat-sub {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 400;
  letter-spacing: 0.1px;
}

/* ==========================================================================
   Captured Sessions & Credentials Page (Modern Redesign)
   ========================================================================== */

.sessions-heading-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sessions-stats {
  margin-top: 24px;
  margin-bottom: 24px;
}

.sessions-vault-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.sessions-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 16px;
}

.sessions-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  max-width: 440px;
  position: relative;
}

.sessions-search-wrap .search-icon {
  color: var(--muted);
  flex-shrink: 0;
}

.sessions-search-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  font-size: 13px;
  width: 100%;
  font-family: inherit;
}

.sessions-search-input::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.sessions-toolbar-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sessions-count-pill {
  font-size: 12px;
  color: var(--muted);
  background: var(--surface-soft);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--line);
  white-space: nowrap;
}

/* Session Feed Card */
.session-feed-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.session-feed-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.session-feed-card.session-failed {
  border-color: rgba(239, 68, 68, 0.3);
}

/* Card Header */
.session-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.session-card-source {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.session-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.session-link-row .link-globe-icon {
  color: var(--accent);
  flex-shrink: 0;
}

.session-link-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.2px;
}

.session-link-path-badge {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 6px;
}

.session-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.session-time-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}

.session-time-pill .time-relative {
  color: #d1d5db;
  font-weight: 500;
}

.session-time-pill .time-exact {
  color: var(--muted);
  opacity: 0.75;
}

.session-id-pill {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 1px 6px;
  border-radius: 4px;
}

/* Card Actions */
.session-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.session-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.session-btn.open-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(255, 92, 112, 0.25);
}

.session-btn.open-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(255, 92, 112, 0.4);
}

.session-btn.export-btn {
  display: none !important;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--ink);
}

.session-btn.export-btn:hover {
  border-color: var(--line-strong);
  background: var(--surface-raised);
}

.session-btn.delete-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
}

.session-btn.delete-btn:hover {
  border-color: var(--danger-line);
  color: var(--danger);
  background: var(--danger-soft);
}

/* Extracted Fields Grid */
.session-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 12px;
  min-width: 0;
}

/* Modern Field Card */
.modern-field-card {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.field-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.field-title-group {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.field-type-icon {
  color: var(--accent);
  flex-shrink: 0;
}

.field-card-label {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  user-select: none;
  flex-shrink: 0;
}

.field-status-pill.success {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.field-status-pill.warning {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.field-status-pill.blocked {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.status-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.field-selector-row {
  display: flex;
  align-items: center;
}

.field-selector-pill {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Values Container */
.field-values-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-value-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #0f1013;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 7px 10px 7px 12px;
  min-width: 0;
}

.field-value-row.empty {
  color: var(--muted);
  font-style: italic;
  font-size: 12px;
}

.field-value-text {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  letter-spacing: 0.2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  user-select: all;
}

/* Copy Button */
.field-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.field-copy-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.field-copy-btn.copied {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
  color: #4ade80;
}

/* Empty State */
.sessions-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.sessions-empty-state .empty-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  margin-bottom: 16px;
}

.sessions-empty-state h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.sessions-empty-state p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  max-width: 380px;
  line-height: 1.5;
}

/* Keep the PhantomVNC wordmark inside the desktop sidebar and mobile header. */
.sidebar .brand {
  gap: 9px;
  padding: 0 8px;
  font-size: 20px;
  letter-spacing: -0.8px;
}
.brand-mark {
  flex-shrink: 0;
}
.brand-wordmark {
  white-space: nowrap;
}

/* Capacity Limit Alert Banner */
.capacity-alert-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 8px;
  color: #fbbf24;
  font-size: 13.5px;
  line-height: 1.4;
}

.capacity-alert-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.capacity-alert-message {
  flex: 1;
}

.capacity-alert-message code {
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 6px;
  border-radius: 4px;
  color: #fef3c7;
}

.capacity-alert-dismiss {
  background: none;
  border: none;
  color: #fbbf24;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.capacity-alert-dismiss:hover {
  opacity: 1;
  background: rgba(245, 158, 11, 0.2);
}
