:root {
  --shell-border: #e2e8ef;
  --shell-muted: #526174;
  --shell-blue: #175cad;
  --shell-ink: #182d46;
  --shell-surface: #f4f7fa;
  --shell-width: 1320px;
  --shell-gutter: clamp(14px, 3vw, 36px);
}

.v2-app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--shell-surface);
}

.shell-work-area, #v2TopNavRoot, #v2StatusBarRoot { min-width: 0; }
#v2StatusBarRoot:empty { display: none; }

.shell-skip {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 240;
  padding: 8px 16px;
  border: 1px solid var(--shell-blue);
  border-radius: 8px;
  background: #fff;
  color: var(--shell-blue);
  transform: translateY(-160%);
}
.shell-skip:focus { transform: none; }
.shell-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.shell-chrome {
  position: sticky;
  z-index: 140;
  top: 0;
  background: #fff;
  box-shadow: 0 1px 0 var(--shell-border);
}

.shell-global-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  max-width: var(--shell-width);
  margin-inline: auto;
  padding: 8px var(--shell-gutter);
}
.shell-global-header.can-switch { grid-template-columns: auto minmax(0, 1fr) auto; }

.shell-brand {
  display: flex;
  align-items: center;
  justify-self: start;
  gap: 9px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--shell-ink);
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.shell-brand-mark {
  display: grid;
  flex: 0 0 33px;
  height: 33px;
  place-items: center;
  border-radius: 9px;
  background: var(--shell-blue);
  color: #fff;
  font-size: 15px;
  font-weight: 750;
}
.shell-brand-copy { min-width: 0; line-height: 1.25; }
.shell-brand-name { display: block; font-size: 15px; font-weight: 750; }
.shell-brand-domain { display: block; margin-top: 2px; color: var(--shell-muted); font-size: 10px; }

.shell-global-scenes {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}
.shell-scene-tab {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 4px 8px;
  min-height: 28px;
  border: 1px solid var(--shell-border);
  border-radius: 999px;
  background: #fff;
  color: var(--shell-ink);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}
.shell-scene-tab:hover, .shell-scene-tab[aria-current="page"] {
  border-color: #b7d1ef;
  background: #eef5fe;
  color: #153f74;
}

.shell-global-actions { display: flex; min-width: 0; align-items: center; gap: 10px; justify-self: end; }

.shell-demo-account {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
  font-size: 12px;
  color: var(--shell-muted);
}

.shell-demo-account .v2-select { max-width: 12rem; min-height: 28px; padding-block: 3px; }
.shell-login.v2-btn-primary {
  display: inline-grid;
  justify-items: center;
  gap: 1px;
  min-height: 36px;
  padding: 4px 13px;
  border: 0;
  border-radius: 9px;
  background: var(--shell-blue);
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
  white-space: nowrap;
}
.shell-login.v2-btn-primary:hover { background: #124783; }
.shell-login-view { font-size: 9px; }
.shell-icon-btn {
  position: relative;
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  flex: none;
  padding: 0;
  border: 1px solid var(--shell-border);
  border-radius: 8px;
  background: #fff;
  color: var(--shell-ink);
  cursor: pointer;
  font: inherit;
  font-size: 18px;
  line-height: 1;
}
.shell-icon-btn:hover { background: #f0f5fb; color: var(--shell-blue); }
.shell-icon-btn.shell-download-button {
  display: inline-flex;
  width: auto;
  gap: 5px;
  justify-content: center;
  padding-inline: 9px;
  font-size: 12px;
  white-space: nowrap;
}
.shell-download-button .downloads-count-badge {
  position: absolute;
  inset: -5px -5px auto auto;
  min-width: 15px;
  min-height: 15px;
  height: auto;
  margin: 0;
  padding: 2px 3px;
  font-size: 9px;
  line-height: 1;
}

.shell-account { position: relative; min-width: 0; }
.shell-account summary { list-style: none; }
.shell-account summary::-webkit-details-marker { display: none; }
.shell-account-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 4px 6px;
  border-radius: 8px;
  cursor: pointer;
}
.shell-account-trigger:hover { background: #f0f5fb; }
.shell-avatar {
  display: grid;
  flex: 0 0 27px;
  height: 27px;
  place-items: center;
  border-radius: 50%;
  background: #e9f1fc;
  color: #204e84;
  font-size: 13px;
  font-weight: 750;
}
.shell-account-name {
  min-width: 0;
  max-width: 16rem;
  overflow: hidden;
  color: var(--shell-ink);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shell-account-name span {
  display: block;
  overflow: hidden;
  color: var(--shell-muted);
  font-size: 10px;
  font-weight: 500;
  text-overflow: ellipsis;
}
.shell-disclosure { color: var(--shell-muted); font-size: 11px; }
.shell-account[open] .shell-disclosure { transform: rotate(180deg); }
.shell-account-options {
  position: absolute;
  z-index: 5;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  min-width: 172px;
  gap: 3px;
  padding: 5px;
  border: 1px solid var(--shell-border);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 8px 20px #223b5524;
}
.shell-account-options button {
  width: 100%;
  min-height: 34px;
  padding: 5px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--shell-ink);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
}
.shell-account-options button:hover { background: #eef5fc; }

.shell-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: var(--shell-width);
  margin-inline: auto;
  padding: 5px var(--shell-gutter);
  border-top: 1px solid #eaf0f5;
  border-bottom: 1px solid #eaf0f5;
  color: var(--shell-ink);
}
.shell-status-lights {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: clamp(4px, 1vw, 14px);
  min-width: 0;
}
.shell-light-stat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 5px;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--shell-muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  white-space: nowrap;
}
.shell-light-stat:hover { border-color: var(--shell-border); background: #f7f9fb; }
.shell-light-stat strong { color: var(--shell-ink); font-size: 14px; font-variant-numeric: tabular-nums; }
.shell-light-stat .v2-dot { width: 8px; height: 8px; flex: 0 0 8px; margin: 0; }
.shell-light-stat .v2-dot.gray { background: #8794a4; }
.shell-status-delivery {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.5vw, 20px);
  color: var(--shell-muted);
  font-size: 12px;
  white-space: nowrap;
}
.shell-status-delivery strong { color: var(--shell-ink); font-variant-numeric: tabular-nums; }
.shell-score-progress {
  display: flex;
  align-items: center;
  gap: 7px;
}
.shell-score-progress progress {
  width: clamp(50px, 8vw, 126px);
  height: 6px;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: #e8edf2;
  accent-color: #187756;
}
.shell-score-progress progress::-webkit-progress-bar { border-radius: 999px; background: #e8edf2; }
.shell-score-progress progress::-webkit-progress-value { border-radius: 999px; background: #187756; }
.shell-score-progress progress::-moz-progress-bar { border-radius: 999px; background: #187756; }

.shell-step-row {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: var(--shell-width);
  margin-inline: auto;
  padding: 6px var(--shell-gutter);
}
.shell-step-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  flex: 0 1 880px;
  width: 100%;
  min-width: 0;
  gap: 6px;
}
.shell-nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 37px;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #40516a;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 670;
  line-height: 1.27;
  text-align: center;
}
.shell-nav-item:hover { border-color: var(--shell-border); background: #f3f6f9; }
.shell-nav-item.is-current { border-color: #bfd7f2; background: #edf5ff; color: #16477e; }
.shell-nav-number { flex: none; color: #53657c; font-size: 15px; }
.shell-nav-item.is-current .shell-nav-number { color: var(--shell-blue); }
.shell-step-utilities { display: flex; flex: none; gap: 8px; margin-left: auto; }
.shell-step-utilities:empty { display: none; }
.shell-step-utility {
  min-height: 31px;
  padding: 4px 7px;
  border: 1px solid var(--shell-border);
  border-radius: 6px;
  background: transparent;
  color: #385576;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}
.shell-step-utility:hover { background: #edf4fc; }

.shell-teaching-entry { max-width: 1160px; margin: 0 auto; color: var(--shell-ink); }
.shell-teaching-entry h1 {
  margin: 0 0 clamp(16px, 3vw, 28px);
  font-size: clamp(29px, 4vw, 46px);
  font-weight: 770;
  letter-spacing: -.03em;
  line-height: 1.15;
}
.shell-teaching-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 2vw, 24px); }
.shell-channel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  min-height: 240px;
  padding: clamp(16px, 2.5vw, 32px);
  border: 1px solid #dce5ef;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 10px 20px #27476908;
}
.shell-channel-full { border-color: #bcd4ef; background: #f8fbff; }
.shell-channel h2 { margin: 0; font-size: clamp(19px, 2vw, 26px); line-height: 1.3; font-weight: 730; text-wrap: balance; }
.shell-channel-links { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; margin-top: auto; }
.shell-scene-card {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 37px;
  padding: 4px 9px;
  border: 1px solid #c9dbef;
  border-radius: 7px;
  background: #fff;
  color: #174c83;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
}
.shell-scene-card:hover { border-color: #7eaad8; background: #eef6ff; }
.shell-scene-card::after { content: '›'; color: var(--shell-blue); font-size: 17px; }
.shell-channel-demo { display: grid; gap: 7px; }
.shell-channel-meter {
  display: grid;
  grid-template-columns: 48fr 23fr 16fr 13fr;
  gap: 2px;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
}
.shell-channel-legend { display: flex; flex-wrap: wrap; gap: 5px 10px; color: var(--shell-muted); font-size: 11px; }
.shell-channel-legend span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.shell-channel-legend span::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.shell-channel-meter i:nth-child(1), .shell-channel-legend span:nth-child(1)::before { background: #20835d; }
.shell-channel-meter i:nth-child(2), .shell-channel-legend span:nth-child(2)::before { background: #e6a41f; }
.shell-channel-meter i:nth-child(3), .shell-channel-legend span:nth-child(3)::before { background: #d44f59; }
.shell-channel-meter i:nth-child(4), .shell-channel-legend span:nth-child(4)::before { background: #8696aa; }

.v2-app-shell .v2-main {
  width: 100%;
  max-width: var(--shell-width);
  min-width: 0;
  padding: clamp(16px, 2vw, 28px) var(--shell-gutter) 60px;
}
.v2-app-shell[data-layout="landing"] .v2-main { padding-block: clamp(30px, 8vw, 96px) 32px; }
.v2-app-shell[data-layout="landing"] .v2-guest-footer { margin: 0; padding: 14px var(--shell-gutter) 26px; }

.shell-plan-warning {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  width: min(calc(100% - 2 * var(--shell-gutter)), calc(var(--shell-width) - 2 * var(--shell-gutter)));
  margin: 10px auto 0;
  padding: 10px 14px;
  border: 1px solid #f2b6b6;
  border-radius: 9px;
  background: #fff1f1;
  color: #8c2222;
  font-size: 13px;
}
.shell-plan-warning strong { margin-inline-end: 8px; }
.shell-plan-lag-dialog {
  width: min(520px, calc(100vw - 28px));
  max-height: calc(100dvh - 40px);
  padding: 20px;
  border: 1px solid #f2b6b6;
  border-top: 5px solid #b83232;
  border-radius: 12px;
  color: var(--shell-ink);
}
.shell-plan-lag-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.shell-plan-lag-dialog h2 { margin-top: 0; color: #8c2222; }
.shell-plan-lag-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.shell-settings {
  max-width: min(480px, calc(100vw - 28px));
  width: 100%;
  max-height: min(620px, calc(100dvh - 36px));
  padding: 0;
  border: 1px solid var(--shell-border);
  border-radius: 16px;
  background: #fff;
  color: var(--shell-ink);
  box-shadow: 0 14px 42px rgba(15, 23, 42, .2);
}
.shell-settings::backdrop { background: rgba(15, 23, 42, .42); }
.shell-settings-form { padding: 21px; }
.shell-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.shell-panel-head h2 { margin: 0; font-size: 19px; }
.shell-settings-section { margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--shell-border); }
.shell-settings-section h3 { margin: 0 0 9px; font-size: 15px; }
.shell-settings-section p { margin: 8px 0 0; color: var(--shell-muted); font-size: 13px; }
.shell-setting-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.shell-setting-fields input { min-width: 0; }
.shell-settings-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 18px; }

.shell-chrome :is(a, button, summary):focus-visible,
.v2-app-shell :is(button, summary, select):focus-visible,
.shell-scene-card:focus-visible { outline: 2px solid var(--shell-blue); outline-offset: 2px; }

@media (max-width: 800px) {
  .shell-global-header.can-switch {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 5px;
  }
  .shell-global-scenes { grid-row: 2; grid-column: 1 / -1; justify-content: start; }
  .shell-global-header.can-switch .shell-global-actions { grid-row: 1; grid-column: 2; }
  .shell-status { gap: 4px; }
  .shell-status-lights { gap: 1px; }
  .shell-light-stat { font-size: 11px; gap: 3px; }
  .shell-status-delivery { font-size: 11px; }
  .shell-score-progress progress { width: 45px; }
  .shell-step-row { gap: 8px; }
  .shell-teaching-grid { grid-template-columns: 1fr; }
  .shell-channel { gap: 10px; min-height: auto; }
}

@media (max-width: 620px) {
  .shell-status { display: grid; grid-template-columns: 1fr; }
  .shell-status-lights { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .shell-status-delivery { justify-content: space-between; padding: 0 4px 2px; }
  .shell-score-progress progress { width: min(14vw, 88px); }
  .shell-step-row { flex-wrap: wrap; gap: 3px; padding-block: 5px; }
  .shell-step-nav { flex-basis: 100%; gap: 2px; }
  .shell-step-utility { min-height: 22px; padding-block: 1px; }
  .shell-nav-item { flex-direction: column; gap: 1px; padding: 3px 2px; font-size: 11px; }
  .shell-nav-number { font-size: 14px; line-height: 1; }
}

@media (max-width: 430px) {
  :root { --shell-gutter: 10px; }
  .shell-global-header { min-height: 56px; gap: 5px; }
  .shell-brand { gap: 5px; }
  .shell-brand-mark { flex-basis: 25px; height: 25px; font-size: 13px; }
  .shell-brand-name { font-size: 13px; }
  .shell-brand-domain { font-size: 8px; }
  .shell-global-actions { gap: 4px; }
  .shell-icon-btn.shell-download-button { height: 30px; padding-inline: 4px; gap: 2px; font-size: 10px; }
  .shell-login.v2-btn-primary { min-height: 30px; padding-inline: 7px; font-size: 11px; }
  .shell-account-trigger { gap: 4px; padding-inline: 3px; }
  .shell-account-name { max-width: 88px; }
  .shell-avatar { flex-basis: 23px; height: 23px; }
  .shell-light-stat { flex-wrap: wrap; align-content: center; padding: 1px 1px; font-size: 10px; }
  .shell-light-stat strong { font-size: 12px; }
  .shell-light-stat .v2-dot { width: 6px; height: 6px; flex-basis: 6px; }
}

@media print {
  .v2-app-shell, .shell-settings { display: none !important; }
}
