.storybook-page {
  background: #eef3f6;
}
.storybook-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
}
.storybook-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  color: #fff;
  background: linear-gradient(165deg, var(--navy-dark), var(--navy));
  overflow-y: auto;
}
.storybook-brand {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  column-gap: 11px;
  margin-bottom: 28px;
  color: #fff;
  text-decoration: none;
}
.storybook-brand > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  grid-row: 1 / 3;
  color: var(--navy);
  background: #fff;
  border-radius: 10px;
  font-weight: 800;
}
.storybook-brand strong {
  align-self: end;
  font-size: 16px;
}
.storybook-brand small {
  align-self: start;
  color: #cbd8e4;
}
.storybook-sidebar nav {
  display: grid;
  gap: 4px;
}
.storybook-sidebar nav a,
.storybook-back {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 9px 12px;
  color: #e8f0f6;
  border-radius: var(--radius-small);
  text-decoration: none;
}
.storybook-sidebar nav a:hover,
.storybook-sidebar nav a:focus-visible,
.storybook-back:hover,
.storybook-back:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}
.storybook-back {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.storybook-content {
  width: 100%;
  max-width: 1240px;
  min-width: 0;
  margin: 0 auto;
  padding: 54px clamp(24px, 4vw, 64px) 90px;
}
.storybook-hero {
  max-width: 840px;
  margin-bottom: 52px;
}
.storybook-hero h1 {
  margin: 5px 0 12px;
  color: #172d3e;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.08;
}
.storybook-hero > p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}
.storybook-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}
.storybook-meta span {
  padding: 5px 9px;
  color: #28516a;
  background: #e1edf4;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.story-section {
  min-width: 0;
  margin-top: 54px;
  scroll-margin-top: 22px;
}
.story-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}
.story-heading h2 {
  margin: 3px 0 0;
  color: #233746;
  font-size: 24px;
}
.story-heading > code {
  color: #4f6170;
  font-size: 12px;
}
.story-canvas {
  min-width: 0;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.story-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}
.story-stack > * {
  min-width: 0;
}
.story-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.token-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  gap: 12px;
}
.token-grid article {
  display: grid;
  gap: 4px;
}
.token-grid article > span {
  height: 64px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 9px;
}
.token-navy {
  background: #143b5d;
}
.token-blue {
  background: #0b65a4;
}
.token-green {
  background: #24734a;
}
.token-amber {
  background: #9a6200;
}
.token-red {
  background: #a52a2a;
}
.token-ink {
  background: #222a31;
}
.token-grid strong {
  margin-top: 3px;
}
.token-grid code {
  color: var(--muted);
  font-size: 11px;
}
.type-sample {
  margin-top: 30px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}
.type-sample h1 {
  margin: 5px 0;
  font-size: 36px;
}
.type-sample h2 {
  margin: 18px 0 5px;
}
.type-sample p:not(.eyebrow) {
  max-width: 700px;
  margin: 0 0 7px;
}
.type-sample small {
  color: var(--muted);
}
.icon-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 9px;
}
.icon-swatch {
  min-height: 96px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 13px 8px;
  color: var(--navy);
  background: #f7fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  text-align: center;
}
.icon-swatch .ui-icon {
  width: 25px;
  height: 25px;
}
.icon-swatch code {
  max-width: 100%;
  color: var(--muted);
  font-size: 10px;
  overflow-wrap: anywhere;
}
.story-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
}
.story-vehicle {
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.story-report {
  max-width: 720px;
}
.storybook-form {
  display: grid;
  gap: 17px;
  max-width: 760px;
}
.storybook-form .form-error {
  display: block;
}
.story-table {
  padding: 0;
  overflow: hidden;
}
.storybook-page .dialog {
  overflow: auto;
}
pt-icon.ui-icon > svg {
  width: 100%;
  height: 100%;
  display: block;
}

@media (max-width: 1200px) {
  .storybook-shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }
  .token-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .story-summary {
    grid-template-columns: 1fr;
  }
  .story-vehicle {
    grid-template-columns: 1fr;
  }
  .story-vehicle .vehicle-actions {
    grid-column: auto;
    padding-left: 0;
  }
}

@media (max-width: 720px) {
  .storybook-shell {
    display: block;
  }
  .storybook-sidebar {
    position: static;
    height: auto;
    padding: 14px;
  }
  .storybook-brand {
    margin-bottom: 12px;
  }
  .storybook-sidebar nav {
    display: flex;
    overflow-x: auto;
  }
  .storybook-sidebar nav a {
    flex: 0 0 auto;
  }
  .storybook-back {
    margin-top: 12px;
  }
  .storybook-content {
    padding: 34px 14px 60px;
  }
  .storybook-hero {
    margin-bottom: 34px;
  }
  .story-section {
    margin-top: 38px;
  }
  .story-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
  .story-canvas {
    padding: 16px;
  }
  .token-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .story-report {
    grid-template-columns: 46px minmax(0, 1fr);
  }
  .story-report .button {
    width: 100%;
    grid-column: 1 / -1;
    grid-row: auto;
  }
}

/* Complete production component catalog */
.storybook-sidebar {
  z-index: 1200;
}
.story-canvas-edge {
  overflow: hidden;
}
.story-label {
  margin: 0 0 9px;
  color: #405361;
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.token-surface {
  background: #fff;
}
.token-background {
  background: #f4f7f9;
}
.token-border {
  background: #d5dee5;
}
.token-control {
  background: #7f909d;
}
.spacing-scale {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.spacing-scale span {
  min-width: 48px;
  display: grid;
  justify-items: center;
  gap: 7px;
}
.spacing-scale i {
  display: block;
  height: 14px;
  background: var(--blue);
  border-radius: 3px;
}
.spacing-scale code {
  color: var(--muted);
  font-size: 11px;
}
.space-4 {
  width: 4px;
}
.space-8 {
  width: 8px;
}
.space-12 {
  width: 12px;
}
.space-16 {
  width: 16px;
}
.space-24 {
  width: 24px;
}
.space-32 {
  width: 32px;
}

.coverage-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  color: #174c34;
  background: #e9f5ee;
  border: 1px solid #afd3be;
  border-radius: var(--radius);
}
.coverage-score {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  flex: none;
  color: #fff;
  background: var(--green);
  border-radius: 50%;
  font-size: 18px;
  font-weight: 900;
}
.coverage-summary strong {
  display: block;
  font-size: 17px;
}
.coverage-summary p {
  margin: 4px 0 0;
  color: #3c6350;
  font-size: 12px;
}
.coverage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.coverage-grid li {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  color: #344754;
  background: #f7fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  font-size: 12px;
}
.coverage-grid .ui-icon {
  color: var(--green);
}
.coverage-grid li.is-missing {
  color: var(--red);
  background: var(--red-light);
  border-color: #dfaaaa;
}
.coverage-grid li.is-missing .ui-icon {
  color: var(--red);
}
.surface-inventory {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.surface-inventory article {
  min-width: 0;
  padding: 14px;
  background: #f8fafb;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
}
.surface-inventory-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.surface-inventory-heading h3 {
  margin: 0;
  color: var(--navy);
  font-size: 14px;
}
.surface-inventory-heading span {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}
.surface-inventory ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.surface-inventory li {
  min-width: 0;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  color: #3d4e5a;
  font-size: 11px;
}
.surface-inventory li .ui-icon {
  width: 15px;
  height: 15px;
  color: var(--green);
}
.surface-inventory li code {
  display: block;
  grid-column: 2;
  color: #62727e;
  font-size: 9px;
  overflow-wrap: anywhere;
}
.surface-score {
  margin: 0;
  color: #3c6350;
  font-size: 12px;
  font-weight: 700;
}

.chrome-preview {
  position: relative;
  overflow: hidden;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.chrome-preview .topbar {
  position: relative;
  z-index: 5;
  inset: auto;
  height: 68px;
}
.chrome-preview .app-shell {
  min-height: 560px;
  padding-top: 0;
}
.chrome-body {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
}
.chrome-preview .sidebar {
  position: relative;
  z-index: 4;
  inset: auto;
  width: auto;
  min-width: 0;
  height: auto;
}
.chrome-preview .sidebar nav a {
  font-size: 12px;
}
.chrome-preview .main-content {
  min-width: 0;
  margin-left: 0;
  padding: 22px;
}
.chrome-preview .page-heading {
  min-height: 72px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.chrome-preview .page-heading h1 {
  font-size: 26px;
}
.chrome-preview .user-dropdown {
  z-index: 20;
}

.auth-story-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(310px, 0.95fr);
  align-items: start;
  gap: 22px;
}
.auth-login-stage {
  min-height: 0;
  display: block;
  padding: 0;
  background: transparent;
}
.auth-login-stage .login-shell {
  width: 100%;
}
.auth-card-demo {
  width: 100%;
  padding: 30px;
}
.auth-card-demo .login-brand {
  margin-bottom: 22px;
}
.auth-card-demo .login-success,
.auth-card-demo .form-error {
  display: block;
}
.auth-form-demo {
  display: grid;
  gap: 16px;
}
.auth-form-demo > .button {
  width: 100%;
}
.auth-state-stack {
  min-width: 0;
  display: grid;
  gap: 16px;
}
.auth-stage {
  position: relative;
  min-height: 310px;
  overflow: hidden;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.auth-stage .auth-loading,
.auth-error-stage .auth-loading {
  position: absolute;
  display: grid;
  inset: 0;
  padding: 18px;
}
.auth-stage .auth-loading-card {
  padding: 22px 18px;
}
.auth-stage .auth-loading-logo {
  margin-bottom: 20px;
}
.auth-error-stage {
  min-height: 330px;
}
.activation-preview {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.activation-preview h3 {
  margin: 4px 0 5px;
}
.activation-preview > p:not(.eyebrow) {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
}

.story-empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  background: #f8fafb;
  border: 1px dashed #b9c5ce;
  border-radius: var(--radius);
}
.story-empty .ui-icon {
  width: 27px;
  height: 27px;
  margin-bottom: 3px;
  color: var(--blue);
}
.story-empty strong,
.story-empty span {
  display: block;
}
.story-empty span {
  font-size: 12px;
}
.toast-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.toast-preview .toast {
  position: static;
  max-width: none;
  animation: none;
}
.story-list-frame {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.story-two-column {
  margin-top: 0;
}
.story-empty-row {
  border-top: 1px dashed var(--border);
}
.story-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.calendar-story-scroll {
  overflow-x: auto;
}
.calendar-story-width {
  min-width: 720px;
}
.story-calendar-panel {
  box-shadow: none;
}

.map-regression-nav {
  position: sticky;
  z-index: 1001;
  top: 0;
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: #fff;
  background: var(--navy);
}
.map-regression-nav strong {
  min-width: 0;
  margin-right: auto;
}
.map-regression-nav .status {
  flex: none;
}
.map-layer-demo {
  position: relative;
  isolation: isolate;
}
.story-location-layout {
  margin: 0 20px;
}
.story-location-picker {
  margin: 0 20px 20px;
}
.story-location-picker .location-picker-layout {
  min-height: 560px;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
}
.story-location-picker .location-picker-search {
  min-width: 0;
}
.story-location-picker .coordinate-actions {
  margin: 0;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}
.picker-map-marker {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--red);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(12, 43, 69, 0.35);
}

.check-comments h3,
.check-description h3,
.check-resolution h3 {
  margin: 0;
}
.check-comment-form .small-button {
  justify-self: end;
}
.technical-item .field input,
.technical-item .field select,
.technical-item .field textarea {
  min-width: 0;
}
.story-choice-grid .permission-line {
  margin: 0;
}
.iot-state-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.iot-state-grid article {
  min-height: 90px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: #f7fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.iot-state-grid .summary-icon {
  width: 42px;
  height: 42px;
  flex: none;
}
.iot-state-grid small,
.iot-state-grid strong {
  display: block;
}
.iot-state-grid small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.story-credential {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
  background: #f7f9fa;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.story-credential .field:last-child {
  grid-column: 1 / -1;
}
.story-credential textarea {
  resize: vertical;
}
.dialog-launch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.dialog-launch-grid .button {
  width: 100%;
}
.story-dialog-picker {
  min-height: 330px;
}

.accessibility-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.accessibility-list li {
  min-height: 76px;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px;
  background: #f7fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
}
.accessibility-list .ui-icon {
  width: 21px;
  height: 21px;
  color: var(--green);
}
.accessibility-list strong,
.accessibility-list small {
  display: block;
}
.accessibility-list small {
  margin-top: 3px;
  color: var(--muted);
}
.focus-demo {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 22px;
  padding: 18px;
  border: 1px dashed #8fa5b5;
  border-radius: var(--radius);
}
.focus-demo .field {
  min-width: min(100%, 260px);
}
.focus-demo > a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.responsive-matrix {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.responsive-matrix span {
  padding: 13px;
  background: #eef4f7;
  border-radius: var(--radius-small);
}
.responsive-matrix strong,
.responsive-matrix small {
  display: block;
}
.responsive-matrix small {
  margin-top: 3px;
  color: var(--muted);
}

@media (max-width: 1200px) {
  .coverage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .chrome-body {
    grid-template-columns: 178px minmax(0, 1fr);
  }
  .chrome-preview .company-name,
  .chrome-preview .user-copy {
    display: none;
  }
  .chrome-preview .page-heading {
    display: grid;
    gap: 12px;
  }
  .auth-story-grid {
    grid-template-columns: 1fr;
  }
  .auth-card-demo {
    max-width: 620px;
  }
  .story-choice-grid {
    grid-template-columns: 1fr;
  }
  .iot-state-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .story-location-picker .location-picker-layout {
    grid-template-columns: 1fr;
  }
  .story-location-picker .location-picker-search {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 760px) {
  .coverage-grid,
  .surface-inventory,
  .toast-preview,
  .accessibility-list,
  .responsive-matrix,
  .story-credential,
  .iot-state-grid {
    grid-template-columns: 1fr;
  }
  .surface-inventory ul {
    grid-template-columns: 1fr;
  }
  .story-credential .field:last-child {
    grid-column: auto;
  }
  .chrome-preview .topbar {
    height: 62px;
  }
  .chrome-body {
    display: block;
  }
  .chrome-preview .sidebar {
    height: 72px;
    display: block;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .chrome-preview .sidebar nav {
    min-width: max-content;
    display: flex;
  }
  .chrome-preview .sidebar nav a {
    width: 104px;
    flex: 0 0 104px;
  }
  .chrome-preview .sidebar-help {
    display: none;
  }
  .chrome-preview .main-content {
    padding: 18px 14px;
  }
  .story-location-layout,
  .story-location-picker {
    margin-right: 12px;
    margin-left: 12px;
  }
  .map-regression-nav {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .dialog-launch-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .coverage-summary {
    align-items: flex-start;
  }
  .coverage-score {
    width: 50px;
    height: 50px;
    font-size: 15px;
  }
  .auth-card-demo {
    padding: 26px 18px;
  }
}
