.container {
  width: min(calc(100% - 36px), var(--content-max));
  margin-inline: auto;
}

.container-wide {
  width: min(calc(100% - 36px), var(--page-max));
  margin-inline: auto;
}

.section {
  position: relative;
  padding-block: clamp(76px, 10vw, 148px);
}

.section-light {
  background: var(--fog-100);
  color: var(--ink-900);
}

.section-dark {
  background: var(--ink-950);
  color: var(--fog-100);
}

.section-ink {
  background: var(--ink-900);
  color: var(--fog-100);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(280px, 0.55fr);
  align-items: end;
  gap: clamp(28px, 6vw, 96px);
  margin-bottom: clamp(38px, 7vw, 78px);
}

.section-heading h2,
.page-hero h1 {
  font-size: clamp(3rem, 7.4vw, 7.3rem);
  line-height: 0.91;
  letter-spacing: -0.065em;
  text-wrap: balance;
}

.section-heading p {
  max-width: 520px;
  color: var(--fog-400);
  font-size: clamp(1rem, 1.35vw, 1.18rem);
}

.section-light .section-heading p { color: var(--ink-600); }
.section-light .eyebrow,
.section-light .mono-label { color: var(--brand-deep); }

.section-number {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--brand);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-number::before {
  content: "";
  width: 30px;
  height: 1px;
  background: currentColor;
}

.display-title {
  color: var(--fog-50);
  font-size: clamp(2.8rem, 7vw, 7.2rem);
  line-height: 0.91;
  letter-spacing: -0.065em;
}

.lede {
  max-width: 660px;
  color: var(--fog-400);
  font-size: clamp(1.04rem, 1.6vw, 1.34rem);
  line-height: 1.6;
}

.muted { color: var(--fog-500); }
.text-brand { color: var(--brand); }
.text-ink { color: var(--ink-900); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  position: relative;
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 10px 10px 5px 10px;
  font-size: 0.82rem;
  font-weight: 760;
  line-height: 1;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition:
    color var(--duration-fast) ease,
    background var(--duration-fast) ease,
    border-color var(--duration-fast) ease;
}

.button svg { width: 17px; height: 17px; }

.button-primary {
  background: var(--brand);
  color: var(--ink-950);
}

.button-primary::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: var(--fog-50);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration) var(--ease-out);
}

.button-primary:hover::before,
.button-primary:focus-visible::before { transform: scaleX(1); }

.button-secondary {
  border-color: var(--border-dark-strong);
  background: rgba(255,255,255,0.025);
  color: var(--fog-200);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  border-color: rgba(0,215,122,0.46);
  background: rgba(0,215,122,0.07);
  color: var(--fog-50);
}

.section-light .button-secondary,
.button-on-light {
  border-color: var(--border-light);
  background: rgba(255,255,255,0.5);
  color: var(--ink-900);
}

.section-light .button-secondary:hover,
.button-on-light:hover {
  border-color: rgba(0,126,73,0.42);
  background: rgba(0,215,122,0.08);
}

.button-quiet {
  background: transparent;
  color: var(--fog-400);
}

.button-quiet:hover,
.button-quiet:focus-visible { color: var(--brand-soft); }

.button-danger {
  border-color: rgba(255,111,125,0.38);
  background: rgba(255,111,125,0.08);
  color: #ffb4bc;
}

.button-sm { min-height: 38px; padding-inline: 13px; font-size: 0.75rem; }
.button-lg { min-height: 56px; padding-inline: 22px; font-size: 0.9rem; }
.button-block { width: 100%; }
.button[disabled] { opacity: 0.45; cursor: not-allowed; }

.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-size: 0.82rem;
  font-weight: 720;
}

.arrow-link svg {
  width: 16px;
  transition: transform var(--duration) var(--ease-out);
}

.arrow-link:hover svg,
.arrow-link:focus-visible svg { transform: translateX(4px); }

.tag,
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--border-dark);
  border-radius: 6px 6px 3px 6px;
  color: var(--fog-400);
  background: rgba(255,255,255,0.02);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.section-light .tag,
.section-light .status-chip {
  border-color: var(--border-light);
  background: rgba(255,255,255,0.48);
  color: var(--ink-600);
}

.status-chip::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.status-chip[data-tone="success"] { color: var(--brand); }
.status-chip[data-tone="warning"] { color: var(--warning); }
.status-chip[data-tone="danger"] { color: var(--danger); }
.status-chip[data-tone="info"] { color: var(--info); }

.cut-panel {
  position: relative;
  border: 1px solid var(--border-dark);
  border-radius: 13px 13px 6px 13px;
  background: rgba(255,255,255,0.022);
}

.cut-panel::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 22px;
  height: 22px;
  border-right: 1px solid rgba(0,215,122,0.45);
  border-bottom: 1px solid rgba(0,215,122,0.45);
  border-radius: 0 0 6px 0;
  pointer-events: none;
}

.section-light .cut-panel,
.cut-panel-light {
  border-color: var(--border-light);
  background: rgba(255,255,255,0.62);
}

.rule {
  width: 100%;
  height: 1px;
  background: var(--border-dark);
}

.section-light .rule { background: var(--border-light); }

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--border-dark);
  border-bottom: 1px solid var(--border-dark);
}

.metric {
  padding: 18px 0;
  border-right: 1px solid var(--border-dark);
}

.metric:not(:first-child) { padding-left: 22px; }
.metric:last-child { border-right: 0; }
.metric strong { display:block; color:var(--fog-50); font-size:clamp(1.3rem,2.2vw,2rem); line-height:1; }
.metric span { display:block; margin-top:7px; color:var(--fog-500); font-family:var(--font-mono); font-size:0.75rem; letter-spacing:0.08em; text-transform:uppercase; }

.form-field {
  display: grid;
  gap: 8px;
}

.form-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--fog-300);
  font-size: 0.75rem;
  font-weight: 680;
}

.form-label small {
  color: var(--fog-600);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
}

.input,
.textarea,
.native-select,
.search-input {
  width: 100%;
  border: 1px solid var(--border-dark-strong);
  border-radius: 9px 9px 5px 9px;
  background: rgba(255,255,255,0.025);
  color: var(--fog-100);
  outline: 0;
  transition: border-color var(--duration-fast), background var(--duration-fast), box-shadow var(--duration-fast);
}

.input,
.native-select,
.search-input { min-height: 48px; padding: 0 13px; }
.textarea { min-height: 124px; padding: 12px 13px; resize: vertical; }
.input::placeholder,
.textarea::placeholder,
.search-input::placeholder { color: var(--fog-600); }

.input:hover,
.textarea:hover,
.native-select:hover,
.search-input:hover { border-color: rgba(224,248,235,0.3); }

.input:focus,
.textarea:focus,
.native-select:focus,
.search-input:focus {
  border-color: rgba(0,215,122,0.64);
  background: rgba(0,215,122,0.03);
  box-shadow: 0 0 0 3px rgba(0,215,122,0.08);
}

.section-light .input,
.section-light .textarea,
.section-light .native-select,
.section-light .search-input,
.input-light {
  border-color: var(--border-light);
  background: rgba(255,255,255,0.72);
  color: var(--ink-900);
}

.field-hint {
  color: var(--fog-600);
  font-size: 0.75rem;
}

.section-light .field-hint { color: var(--ink-600); }
.field-error { color: var(--danger); font-size:0.75rem; }

.native-select {
  appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18' fill='none'%3E%3Cpath d='m5 7 4 4 4-4' stroke='%239eafa4' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 18px;
}

.search-field {
  position: relative;
}

.search-field svg {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  transform: translateY(-50%);
  color: var(--fog-500);
  pointer-events: none;
}

.search-field .search-input { padding-left: 43px; }

.toggle {
  display: inline-grid;
  grid-template-columns: 42px auto;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-track {
  position: relative;
  width: 42px;
  height: 23px;
  border: 1px solid var(--border-dark-strong);
  border-radius: 8px 8px 4px 8px;
  background: rgba(255,255,255,0.04);
  transition: border-color var(--duration-fast), background var(--duration-fast);
}

.toggle-track::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 13px;
  height: 13px;
  border-radius: 4px 4px 2px 4px;
  background: var(--fog-500);
  transition: transform var(--duration) var(--ease-spring), background var(--duration-fast);
}

.toggle input:checked + .toggle-track {
  border-color: rgba(0,215,122,0.55);
  background: rgba(0,215,122,0.11);
}

.toggle input:checked + .toggle-track::after {
  transform: translateX(19px);
  background: var(--brand);
}

.toggle input:focus-visible + .toggle-track {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.toggle-copy { color: var(--fog-300); font-size:0.76rem; }

.segmented-control {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--border-dark);
  border-radius: 10px 10px 5px 10px;
  background: rgba(255,255,255,0.025);
}

.segmented-control button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 7px 7px 3px 7px;
  background: transparent;
  color: var(--fog-500);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.segmented-control button:hover,
.segmented-control button:focus-visible { color: var(--fog-200); }
.segmented-control button[aria-pressed="true"],
.segmented-control button[aria-selected="true"] {
  border-color: rgba(0,215,122,0.28);
  background: rgba(0,215,122,0.1);
  color: var(--brand-soft);
}

.section-light .segmented-control { border-color:var(--border-light); background:rgba(255,255,255,0.55); }
.section-light .segmented-control button { color:var(--ink-600); }
.section-light .segmented-control button[aria-pressed="true"],
.section-light .segmented-control button[aria-selected="true"] { color:var(--ink-900); background:rgba(0,215,122,0.13); }

.alert {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border-dark);
  border-left-color: currentColor;
  border-radius: 9px 9px 4px 9px;
  background: rgba(255,255,255,0.025);
  color: var(--fog-300);
}

.alert[data-tone="success"] { color: var(--brand-soft); background:rgba(0,215,122,0.055); }
.alert[data-tone="warning"] { color: #ffe3a8; background:rgba(255,198,92,0.055); }
.alert[data-tone="danger"] { color: #ffc1c7; background:rgba(255,111,125,0.055); }
.alert[data-tone="info"] { color: #bcecff; background:rgba(116,215,255,0.055); }
.alert-icon { color:currentColor; }
.alert-icon svg { width:20px; }
.alert-copy strong { display:block; color:var(--fog-50); font-size:0.79rem; }
.alert-copy p { margin-top:4px; color:var(--fog-400); font-size:0.75rem; }
.alert-dismiss { border:0; background:transparent; color:var(--fog-500); cursor:pointer; }

.tabs {
  display: grid;
  gap: 18px;
}

.tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-dark);
}

.tab-button {
  position: relative;
  min-height: 38px;
  padding: 0 13px;
  border: 0;
  background: transparent;
  color: var(--fog-500);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.tab-button::after {
  content:"";
  position:absolute;
  left:10px;
  right:10px;
  bottom:-11px;
  height:1px;
  background:var(--brand);
  transform:scaleX(0);
  transition:transform var(--duration) var(--ease-out);
}

.tab-button[aria-selected="true"] { color:var(--fog-50); }
.tab-button[aria-selected="true"]::after { transform:scaleX(1); }
.tab-panel { color:var(--fog-300); }

.accordion {
  border-top: 1px solid var(--border-dark);
}

.accordion-item { border-bottom: 1px solid var(--border-dark); }
.accordion-trigger {
  display:grid;
  grid-template-columns:1fr auto;
  align-items:center;
  gap:16px;
  width:100%;
  padding:18px 0;
  border:0;
  background:transparent;
  color:var(--fog-200);
  text-align:left;
  cursor:pointer;
}
.accordion-trigger svg { width:16px; transition:transform var(--duration) var(--ease-out); }
.accordion-trigger[aria-expanded="true"] svg { transform:rotate(45deg); }
.accordion-panel { padding:0 0 20px; color:var(--fog-400); font-size:0.85rem; }

.progress-track {
  position:relative;
  height:7px;
  border:1px solid var(--border-dark);
  border-radius:3px;
  background:rgba(255,255,255,0.025);
  overflow:hidden;
}
.progress-value {
  height:100%;
  background:var(--brand);
  transform-origin:left;
}

.data-table-wrap {
  width:100%;
  overflow:auto;
  border:1px solid var(--border-dark);
  border-radius:10px 10px 5px 10px;
}
.data-table { width:100%; min-width:680px; border-collapse:collapse; }
.data-table th,
.data-table td { padding:13px 14px; border-bottom:1px solid var(--border-dark); text-align:left; }
.data-table th { color:var(--fog-500); background:rgba(255,255,255,0.018); font-family:var(--font-mono); font-size:0.75rem; letter-spacing:0.08em; text-transform:uppercase; }
.data-table td { color:var(--fog-300); font-size:0.76rem; }
.data-table tr:last-child td { border-bottom:0; }
.data-table tbody tr:hover { background:rgba(0,215,122,0.035); }
.sort-button { display:inline-flex; align-items:center; gap:6px; padding:0; border:0; background:transparent; color:inherit; cursor:pointer; }
.sort-button svg { width:12px; }

.custom-select { position:relative; }
.custom-select-button {
  display:grid;
  grid-template-columns:1fr auto;
  align-items:center;
  gap:12px;
  width:100%;
  min-height:48px;
  padding:0 13px;
  border:1px solid var(--border-dark-strong);
  border-radius:9px 9px 5px 9px;
  background:rgba(255,255,255,0.025);
  color:var(--fog-200);
  text-align:left;
  cursor:pointer;
}
.custom-select-button svg { width:15px; transition:transform var(--duration); }
.custom-select-button[aria-expanded="true"] { border-color:rgba(0,215,122,0.55); }
.custom-select-button[aria-expanded="true"] svg { transform:rotate(180deg); }
.custom-select-list {
  position:absolute;
  z-index:80;
  left:0;
  right:0;
  top:calc(100% + 7px);
  display:grid;
  gap:3px;
  max-height:260px;
  padding:6px;
  border:1px solid var(--border-dark-strong);
  border-radius:9px 9px 5px 9px;
  background:rgba(5,14,9,0.98);
  box-shadow:var(--shadow-float);
  overflow:auto;
}
.custom-option {
  display:grid;
  grid-template-columns:1fr auto;
  align-items:center;
  gap:10px;
  min-height:40px;
  padding:8px 10px;
  border:1px solid transparent;
  border-radius:7px 7px 3px 7px;
  color:var(--fog-400);
  cursor:pointer;
}
.custom-option:hover,
.custom-option:focus,
.custom-option[aria-selected="true"] { border-color:rgba(0,215,122,0.22); background:rgba(0,215,122,0.06); color:var(--fog-50); outline:0; }
.custom-option[aria-selected="true"]::after { content:"✓"; color:var(--brand); }

.tooltip-trigger { position:relative; }
.tooltip {
  position:fixed;
  z-index:1500;
  max-width:240px;
  padding:7px 9px;
  border:1px solid var(--border-dark-strong);
  border-radius:6px 6px 3px 6px;
  background:var(--ink-800);
  color:var(--fog-300);
  box-shadow:0 10px 30px rgba(0,0,0,0.22);
  font-size:0.75rem;
  pointer-events:none;
}

.ui-dialog-shell { padding:20px; }
.ui-dialog-head { display:grid; grid-template-columns:1fr auto; align-items:start; gap:16px; padding-bottom:16px; border-bottom:1px solid var(--border-dark); }
.ui-dialog-head h2 { color:var(--fog-50); font-size:1.35rem; }
.ui-dialog-head p { margin-top:6px; color:var(--fog-500); font-size:0.78rem; }
.ui-dialog-body { padding:20px 0; color:var(--fog-300); }
.ui-dialog-actions { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:8px; padding-top:16px; border-top:1px solid var(--border-dark); }

.drawer-dialog {
  width:min(520px, calc(100vw - 14px));
  height:calc(100dvh - 14px);
  max-height:none;
  margin:7px 7px 7px auto;
  border-radius:14px 14px 7px 14px;
}
.drawer-dialog[open] { animation:drawer-in 380ms var(--ease-spring); }
@keyframes drawer-in { from { transform:translateX(28px); opacity:0; } }

.pagination { display:flex; align-items:center; flex-wrap:wrap; gap:5px; }
.page-button { display:grid; place-items:center; min-width:38px; height:38px; padding:0 10px; border:1px solid var(--border-dark); border-radius:7px 7px 3px 7px; background:rgba(255,255,255,0.02); color:var(--fog-400); cursor:pointer; }
.page-button:hover,
.page-button:focus-visible,
.page-button[aria-current="page"] { border-color:rgba(0,215,122,0.38); background:rgba(0,215,122,0.08); color:var(--fog-50); }

.skeleton { position:relative; overflow:hidden; border-radius:6px; background:rgba(255,255,255,0.055); }
.skeleton::after { content:""; position:absolute; inset:0; background:linear-gradient(100deg, transparent 20%, rgba(255,255,255,0.08) 45%, transparent 70%); transform:translateX(-100%); animation:skeleton 1.8s infinite; }
@keyframes skeleton { to { transform:translateX(100%); } }

.empty-state { display:grid; place-items:center; min-height:300px; padding:32px; border:1px dashed var(--border-dark-strong); border-radius:11px 11px 5px 11px; text-align:center; }
.empty-state-icon { display:grid; place-items:center; width:66px; height:66px; border:1px solid rgba(0,215,122,0.28); border-radius:50%; color:var(--brand); }
.empty-state h3 { margin-top:18px; color:var(--fog-50); font-size:1.15rem; }
.empty-state p { max-width:420px; margin-top:8px; color:var(--fog-500); font-size:0.8rem; }

.page-hero {
  min-height: 540px;
  padding: calc(var(--header-height) + 90px) 0 clamp(70px, 9vw, 120px);
  background:
    radial-gradient(circle at 82% 20%, rgba(0,215,122,0.09), transparent 27%),
    var(--ink-950);
}

.page-hero-grid {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(300px,0.46fr);
  align-items:end;
  gap:clamp(36px,8vw,120px);
}

.page-hero h1 { margin-top:16px; color:var(--fog-50); }
.page-hero .lede { margin-top:24px; }
.page-hero-aside { padding:22px; }
.page-hero-aside dl { display:grid; gap:16px; }
.page-hero-aside div { display:grid; grid-template-columns:120px 1fr; gap:18px; padding-bottom:13px; border-bottom:1px solid var(--border-dark); }
.page-hero-aside div:last-child { border-bottom:0; padding-bottom:0; }
.page-hero-aside dt { color:var(--fog-600); font-family:var(--font-mono); font-size:0.75rem; letter-spacing:0.08em; text-transform:uppercase; }
.page-hero-aside dd { color:var(--fog-300); font-size:0.78rem; }

@media (max-width: 900px) {
  .section-heading,
  .page-hero-grid { grid-template-columns:1fr; }
  .section-heading { align-items:start; gap:24px; }
  .page-hero { min-height:auto; padding-top:120px; }
  .page-hero-aside { max-width:620px; }
}

@media (max-width: 640px) {
  .container,
  .container-wide { width:min(calc(100% - 24px), var(--content-max)); }
  .section { padding-block:72px; }
  .section-heading h2,
  .page-hero h1 { font-size:clamp(2.75rem,15vw,4.4rem); }
  .metric-strip { grid-template-columns:1fr; }
  .metric { border-right:0; border-bottom:1px solid var(--border-dark); padding:15px 0 !important; }
  .metric:last-child { border-bottom:0; }
  .page-hero-aside div { grid-template-columns:1fr; gap:5px; }
}
