.nt-design-toggle {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.nt-design-toggle:hover { background: var(--blue-l); }
.nt-design-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  flex: none;
}
.nt-login-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .nt-top-actions:has(.nt-design-toggle) { gap: 8px; }
}

html[data-neurotag-design="studio"] {
  --bg: #f7f5fc;
  --card: #ffffff;
  --line: #e5dff0;
  --ink: #261c36;
  --muted: #655a74;
  --blue: #6340b1;
  --blue-h: #4b2b93;
  --blue-l: #f1eafe;
  --sky: #9c7cde;
  --ok: #6842b3;
  --warn: #925710;
  --bad: #ac3840;
  --r1: 9px;
  --r2: 17px;
  --studio-dark: #241936;
  --studio-dark-line: #443455;
  --studio-mint: #e2d3ff;
  --studio-yellow: #eadfff;

  & body {
    filter: none;
    background: var(--bg);
    font-size: 14px;
    line-height: 1.55;
  }
  & :is(a, button, summary):focus-visible { outline: 2px solid #805ac9; outline-offset: 3px; }
  & .nt-app { grid-template-columns: 238px minmax(0, 1fr); }
  & .nt-content { min-width: 0; background: var(--bg); }
  & .nt-content main { max-width: 1480px; padding-inline: clamp(24px, 3.2vw, 56px); margin-inline: auto; }
  & .nt-sidebar {
    padding: 25px 15px 0;
    background: var(--studio-dark);
    color: #f8f4ff;
    border-color: var(--studio-dark-line);
    scrollbar-color: #8c78a8 var(--studio-dark);
  }
  & .nt-sidebar :is(.nt-brand, .nt-sidebar-profile) { color: #f8f4ff; }
  & .nt-sidebar .nt-brand:hover { background: transparent; color: var(--studio-mint); }
  & .nt-mark { background: var(--studio-mint); box-shadow: none; }
  & .nt-mark i { background: var(--studio-dark); }
  & .nt-sidebar :is(.nt-reg, .nt-nav-label, .nt-sidebar-profile small, .nt-workspace small) { color: #c5b6db; }
  & .nt-sidebar .nt-nav-label { margin-bottom: 10px; }
  & .nt-sidebar .nt-workspace {
    margin: 30px 0 23px;
    padding: 11px;
    background: #302243;
    border-color: var(--studio-dark-line);
    border-radius: 12px;
    color: #f8f4ff;
  }
  & .nt-sidebar .nt-workspace:is(:hover, [aria-current="page"]) { background: #3b2a52; border-color: #6d568c; }
  & .nt-sidebar .nt-workspace-symbol { background: var(--studio-mint); border-color: transparent; color: var(--studio-dark); }
  & .nt-sidebar :is(nav a, .nt-task-navigation summary, .nt-task-navigation > div > a) { color: #e0d6ef; }
  & .nt-sidebar :is(nav a, .nt-task-navigation summary, .nt-task-navigation > div > a):hover,
  & .nt-sidebar .nt-sidebar-profile:hover { color: #fff; background: #3a294f; }
  & .nt-sidebar :is(nav a.on, .nt-task-navigation summary.on, .nt-task-navigation > div > a.on) { color: #f8f4ff; background: #493461; }
  & .nt-sidebar nav a.on::after { background: var(--studio-yellow); }
  & .nt-sidebar :is(.nt-divider, .nt-sidebar-profile, .nt-task-navigation > div) { border-color: var(--studio-dark-line); }
  & .nt-sidebar .nt-divider { background: var(--studio-dark-line); }
  & .nt-sidebar :is(a, summary):focus-visible { outline-color: var(--studio-mint); outline-offset: -2px; }
  & .nt-topbar {
    min-height: 66px;
    height: auto;
    padding: 11px clamp(24px, 3.2vw, 56px);
    background: #fbf9ff;
    border-color: var(--line);
  }
  & .nt-top-actions { gap: 13px; }
  & .nt-breadcrumb { gap: 10px; }
  & .nt-breadcrumb b { color: var(--ink); font-weight: 650; }
  & .nt-breadcrumb > span, & .nt-account-role, & .nt-footer { color: var(--muted); }
  & body[data-avatar-color="blue"] .nt-avatar { background: var(--blue-l); border-color: #daccf1; color: var(--blue); }
  & .nt-design-toggle { color: var(--blue-h); }
  & .nt-content .head { margin-bottom: 25px; }
  & .nt-content .head :is(h1, h2) {
    font-size: clamp(27px, 3.8vw, 43px);
    line-height: 1.1;
    letter-spacing: -.045em;
    font-weight: 720;
  }
  & .nt-content .head .sub { color: var(--muted); max-width: 64ch; }
  & .nt-content .card, & .nt-content .nt-menu-tile.card, & .nt-content .nt-overview .stat {
    border-color: var(--line);
    box-shadow: 0 2px 4px #261c3609, 0 12px 26px -24px #261c3654;
  }
  & .nt-content .card h3 { color: var(--ink); }
  & .btn { min-height: 36px; height: auto; border-radius: var(--r1); }
  & .btn.lg { min-height: 43px; }
  & .btn.line { background: var(--card); border-color: var(--line); color: var(--ink); }
  & .btn.line:hover, & .btn.quiet:hover { background: var(--blue-l); }
  & :is(.inp, select.inp, textarea.inp) { background: #fff; border-color: #d8cde8; }
  & :is(.inp, select.inp, textarea.inp):focus { border-color: #7e55c6; box-shadow: 0 0 0 3px #805ac926; }
  & .card.flush, & .modal { scrollbar-color: #baaad3 transparent; }
  & .modal { max-height: calc(100dvh - 36px); overflow-y: auto; }
  & th { background: #f2edf8; color: var(--muted); }
  & tr:hover td { background: #f8f4fd; }
  & :is(.tabs, .nt-profile-tabs, .nt-compose-steps) { border-color: var(--line); }
  & :is(.nt-profile-tabs a.on, .nt-compose-types a.on, .nt-compose-steps button.on, .nt-compose-back) { color: var(--blue); }
  & :is(.nt-compose-types, .nt-compose-panel-heading > span, .nt-compose-summary-icon, .nt-workspace-symbol) {
    background: var(--blue-l);
    color: var(--blue-h);
    border-color: var(--line);
  }
  & :is(.nt-compose-description, .nt-compose-panel-heading p, .nt-compose-aside-note, .nt-field-hint, .nt-key-note, .nt-key-label) { color: var(--muted); }
  & :is(.nt-profile-cover, .nt-profile-note) { background: linear-gradient(110deg, #e9defb, #f2eafa); }
  & .nt-profile-cover::after { background-image: radial-gradient(#987ac3 1px, transparent 1px); }
  & :is(.nt-profile-note svg, .nt-section-heading > svg) { color: var(--blue); }
  & :is(.nt-badge, .nt-draft-status.approved) { background: var(--blue-l); color: var(--blue-h); border-color: #daccf1; }
  & .nt-switch[aria-checked="true"] { background: var(--blue); }
  & .state { color: var(--muted); }
  & .state.okk { color: #603ca3; }
  & .state.pau { color: #865010; }
  & .state.err { color: #a3343c; }
  & .state.run { color: #665394; }
  & .log { background: #f6f1fb; color: var(--ink); }
  & .nt-content .log .ln { grid-template-columns: minmax(72px, 13ch) minmax(58px, 11ch) minmax(0, 1fr); }
  & .nt-content .log .ln > span { overflow-wrap: anywhere; }
  & .note { color: #805017; }

  & #content:has(> .nt-overview) > .head {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    align-items: center;
    min-height: 166px;
    padding: clamp(20px, 3.5vw, 42px);
    border-radius: 20px;
    background: linear-gradient(116deg, #271741 22%, #55387e);
    color: #fdfaff;
  }
  & #content:has(> .nt-overview) > .head::after {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: repeating-radial-gradient(ellipse at 95% 135%, transparent 0 15px, #e2ccff32 16px 17px, transparent 18px 27px);
    mask-image: linear-gradient(90deg, transparent 43%, #000);
    content: "";
  }
  & #content:has(> .nt-overview) > .head .sub { color: #e8dbfa; }
  & #content:has(> .nt-overview) > .head .btn { color: var(--studio-dark); background: var(--studio-yellow); }
  & #content:has(> .nt-overview) > .head .btn:hover { background: #f4ebff; }
  & .nt-menu-layout { gap: clamp(15px, 2vw, 26px); }
  & .nt-menu-column > h3 { color: var(--ink); font-size: 17px; }
  & .nt-menu-column > .note { display: block; padding: 10px 13px; border-radius: 9px; background: #fbf0d9; font-size: 12px; }
  & .nt-menu-column > .note::before { display: inline-block; margin: 0 7px 2px 0; }
  & .nt-menu-column > .note a { margin-inline-start: 8px; color: #805017; text-decoration: underline; }
  & .nt-menu-tile-link:hover { background: #f5effb; }
  & .nt-menu-tile-icon { background: var(--blue-l); color: var(--blue); }
  & .nt-content .nt-overview .stat > b { font-size: clamp(21px, 2.25vw, 32px); color: var(--ink); letter-spacing: -.035em; }
  & .nt-content .nt-overview .stat:has(.traffic-track) { background: #f1e9fa; }
  & .nt-overview .traffic-track { background: #e2d8ef; height: 6px; }
  & .nt-overview .traffic-track > div { background: var(--blue); }
  & .metric-help > summary { border-color: #d8cde8; background: var(--card); color: var(--blue); }
  & .metric-help > summary:hover, & .metric-help[open] > summary, & .metric-help-text { background: var(--blue-l); color: var(--blue-h); }
  & .bars .b i { background: #eae0f2; }
  & .bars .b i.p { background: var(--blue); }

  & .nt-collector-results > p, & .nt-collector-content small, & .nt-collector-meta, & .nt-collector-number { color: var(--muted); }
  & .nt-collector-list, & .nt-collector-row { border-color: var(--line); }
  & .nt-collector-row { background: var(--card); }
  & .nt-collector-content p { color: var(--ink); }
  & .nt-collector-link { color: var(--blue); }
  & .nt-collector-link:hover { text-decoration: underline; }
  & .nt-collector-count, & .collector-progress-track { background: var(--blue-l); color: var(--blue-h); }
  & .collector-progress-track div { background: var(--blue); }
  & :is(.collector-progress-label, #collector-progress small, .collector-cost) { color: var(--muted); }
  & #collector-form { display: grid; gap: 9px; }
  & #collector-form > p:has(> label) { display: grid; gap: 5px; }
  & #collector-form label { font-weight: 650; }
  & #collector-form > button { justify-self: start; }
  & .collector-cost { margin: 5px 0; background: #f4ecfa; border-color: #e7ddf2; }
  & .nt-collector-results > p[role="status"] { margin: 12px 0; padding: 10px 12px; border-radius: 9px; background: #f4ecfa; }
  & .nt-collector-results > .btn { margin: 4px 4px 4px 0; white-space: normal; text-align: center; }
  & #task-create-error { background: #f9e9e8; border-color: #dbb7b7; color: var(--bad); }
  & .login {
    min-height: 100dvh;
    background: repeating-radial-gradient(ellipse at 88% 104%, transparent 0 20px, #e2d3ff28 21px 22px, transparent 23px 38px),
      linear-gradient(135deg, #251936, #4f386e);
    padding: 22px 15px;
  }
  & .login .box { width: min(460px, 100%); padding: clamp(20px, 5vw, 42px); border: 1px solid #c7b6dd; border-radius: 22px; background: #ffffff; box-shadow: 0 28px 85px #23143173; }
  & .login h1 { margin-top: 29px; font-size: clamp(28px, 5vw, 39px); letter-spacing: -.045em; }
  & .nt-login-hint { color: var(--muted); }
}

@media (min-width: 1180px) {
  html[data-neurotag-design="studio"] .nt-menu-column[aria-labelledby="menu-statistics"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  html[data-neurotag-design="studio"] .nt-menu-column[aria-labelledby="menu-statistics"] > :is(h3, .card:first-of-type, .card:last-of-type, .stat:has(.metric-help[open])) {
    grid-column: 1 / -1;
  }
  html[data-neurotag-design="studio"] .nt-menu-column[aria-labelledby="menu-statistics"] > .stat:not(:first-of-type) {
    padding-inline: 12px;
  }
  html[data-neurotag-design="studio"] .nt-menu-column[aria-labelledby="menu-statistics"] > .stat:not(:first-of-type) .metric-help > summary {
    inset-inline-end: 9px;
    width: 25px;
    height: 25px;
  }
}

@media (max-width: 760px) {
  html[data-neurotag-design="studio"] {
    & .nt-app { grid-template-columns: minmax(0, 1fr); }
    & .nt-sidebar { padding: 12px 13px 8px; }
    & .nt-sidebar .nt-workspace { margin: 10px 0 0; padding: 7px 9px; }
    & .nt-sidebar nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; padding-top: 9px; }
    & .nt-sidebar nav a { min-height: 38px; padding: 5px 6px; font-size: 11px; line-height: 1.2; white-space: normal; }
    & .nt-topbar { min-height: 55px; padding: 7px 13px; }
    & .nt-top-actions { gap: 8px; }
    & .nt-content main { padding: 22px 14px 30px; }
    & #content:has(> .nt-overview) > .head { flex-wrap: wrap; min-height: 0; gap: 15px; }
    & .nt-content .card:not(.flush) { padding-inline: 16px; }
    & .nt-content .nt-menu-tile.card { padding: 0; }
    & .nt-collector-row { padding: 12px; gap: 7px; }
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-neurotag-design="studio"] :is(.rise, .bars .b i, .modal-bg) { animation: none; }
  html[data-neurotag-design="studio"] .collector-progress-track div { transition: none; }
}
