/* Shared presentation layer. Business state and content remain server-owned. */
:root {
  --ui-radius: 18px;
  --ui-shadow: 0 10px 32px rgb(16 28 56 / 4%);
}
@media screen {
  /* Keep text fully readable during entrances; movement provides the transition. */
  #main .reveal {
    opacity: 1;
    transition: transform 0.45s ease;
  }
  .admin-header > div {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
  }
  .admin-header .admin-theme {
    flex-shrink: 0;
  }
  .admin-user-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .print-only {
    display: none;
  }
  .site-header {
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    backdrop-filter: blur(16px);
  }
  .nav-inner {
    min-height: 84px;
    padding-block: 16px;
  }
  #main-nav {
    gap: clamp(12px, 1.25vw, 22px);
  }
  #main-nav a {
    font-size: 0.8125rem;
  }
  .nav-tools {
    flex-wrap: nowrap;
  }
  .nav-tools select,
  .theme-toggle,
  .menu-toggle {
    min-height: 44px;
    min-width: 44px;
    border-radius: 10px;
  }
  .nav-tools select {
    width: 58px;
  }
  .theme-toggle:hover,
  .menu-toggle:hover {
    background: var(--tint);
  }
  .nav-cta,
  .button {
    border-radius: 10px;
    min-height: 48px;
  }
  .nav-cta {
    font-size: 0.8125rem;
  }
  #main
    :where(
      .hero,
      .split-section,
      .statement-layout,
      .contact-layout,
      .faq-layout
    )
    > * {
    min-width: 0;
  }
  #main h1 {
    letter-spacing: -0.05em;
    text-wrap: balance;
  }
  #main :where(h2, h3) {
    text-wrap: balance;
  }
  #main .hero-description {
    text-wrap: balance;
    max-width: 34em;
    font-size: 1.0625rem;
    line-height: 1.8;
  }
  .page-home .hero {
    padding-block: 48px;
    gap: clamp(32px, 4vw, 64px);
  }
  .page-home .hero h1 {
    font-size: clamp(3rem, calc(4.5vw * var(--kite-font-scale, 1)), 4.75rem);
    line-height: 1.1;
  }
  #main .hero-art {
    border-radius: 24px;
    box-shadow: var(--shadow);
  }
  #main :where(.service-card, .article-card, .public-plan) {
    border-radius: 20px;
  }
  #main .service-card {
    transition:
      border-color 0.2s,
      box-shadow 0.2s,
      transform 0.2s;
  }
  #main .service-card:hover {
    box-shadow: var(--shadow);
  }
  #main :where(.button, .text-link) {
    font-size: 0.875rem;
  }
  #main
    :where(.contact-form input, .contact-form textarea, .contact-form select) {
    border-radius: 10px;
  }
  .public-plan {
    box-shadow: var(--ui-shadow);
  }
  .public-plan .plan-price {
    font-variant-numeric: tabular-nums;
  }

  .admin-main,
  .workspace-main {
    min-width: 0;
  }
  .admin-content,
  .workspace-content {
    min-width: 0;
  }
  .admin-content {
    max-width: 1680px;
    margin-inline: auto;
    width: 100%;
  }
  .admin-header,
  .workspace-header {
    gap: 16px;
  }
  .admin-header > div,
  .workspace-tools {
    min-width: 0;
  }
  .admin-panel,
  .workspace-panel {
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-shadow);
  }
  .admin-panel > :last-child,
  .workspace-panel > :last-child {
    margin-bottom: 0;
  }
  .admin-body .btn,
  .workspace-body .btn {
    font-size: 0.8125rem;
    min-height: 44px;
    border-radius: 10px;
  }
  :where(.admin-content, .workspace-content)
    :where(.form-control, .form-select) {
    min-height: 44px;
    border-radius: 9px;
  }
  :where(.admin-content, .workspace-content) :where(input, textarea, select) {
    max-width: 100%;
  }
  :where(.admin-content, .workspace-content)
    :where(.table, .stat-card strong, .workspace-balance) {
    font-variant-numeric: tabular-nums;
  }
  :where(.admin-content, .workspace-content) .table {
    --bs-table-bg: transparent;
  }
  :where(.admin-content, .workspace-content) .table th {
    font-size: 0.75rem;
    letter-spacing: 0.035em;
    padding-block: 14px;
  }
  :where(.admin-content, .workspace-content) .table td {
    padding-block: 15px;
    vertical-align: middle;
  }
  .table-responsive {
    border-radius: 12px;
    scrollbar-width: thin;
  }
  .admin-sidebar nav a,
  .workspace-sidebar nav a {
    min-height: 42px;
  }
  .sidebar-toggle,
  .workspace-menu,
  .workspace-signout {
    min-height: 44px;
    min-width: 44px;
  }
  .admin-nav-scrim {
    display: none;
  }
  .workspace-body {
    font-size: 0.875rem;
  }
  .workspace-page-heading h1 {
    font-size: clamp(1.625rem, 2.2vw, 2.125rem);
    letter-spacing: -0.04em;
  }
  .workspace-panel-heading {
    flex-wrap: wrap;
    gap: 12px;
  }
  .workspace-body
    :where(
      .workspace-grid,
      .workspace-form,
      .workspace-stats,
      .workspace-plan-grid
    )
    > * {
    min-width: 0;
  }
  .workspace-result,
  .workspace-list,
  .workspace-detail-meta {
    overflow-wrap: anywhere;
  }
  .auth-card {
    border-radius: 24px;
    box-shadow: var(--ui-shadow);
  }
  .auth-form :where(input:not([type="checkbox"]), select, textarea) {
    min-height: 48px;
  }
}

@media screen and (max-width: 1250px) {
  #main-nav {
    max-height: calc(100dvh - 84px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 18px max(20px, 4vw) 24px;
  }
  #main-nav a {
    padding: 14px 12px;
    border-radius: 6px;
    font-size: 0.9375rem;
  }
  #main-nav a:hover {
    background: var(--tint);
  }
}
@media screen and (min-width: 701px) and (max-width: 1000px) {
  .hero {
    grid-template-columns: 1.05fr 0.95fr;
  }
  .page-home .hero h1 {
    font-size: clamp(2.7rem, calc(5vw * var(--kite-font-scale, 1)), 3.5rem);
  }
  .hero-capability-path {
    grid-template-columns: 1fr;
  }
  .hero-capability-node {
    min-height: 52px;
  }
  .hero-capability-path:before {
    display: none;
  }
}
@media screen and (max-width: 800px) {
  .admin-sidebar {
    z-index: 70;
    width: min(300px, calc(100vw - 48px));
    box-shadow: none;
  }
  .admin-nav-scrim {
    position: fixed;
    inset: 0;
    z-index: 65;
    background: #0c183c66;
    backdrop-filter: blur(3px);
  }
  .admin-nav-open .admin-nav-scrim {
    display: block;
  }
  .admin-nav-open {
    overflow: hidden;
  }
  .admin-header {
    min-height: 76px;
    padding: 12px 20px;
  }
  .admin-header > span {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .admin-header > div {
    max-width: 48%;
    text-align: right;
  }
  .admin-header .role-pill {
    display: none;
  }
  .admin-content {
    padding: 28px 20px;
  }
  .admin-panel,
  .workspace-panel {
    padding: 22px;
  }
  .page-heading {
    align-items: stretch;
  }
  .page-heading > .btn {
    align-self: flex-start;
  }
  .admin-content :where(.form-grid, .saas-form) {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media screen and (max-width: 700px) {
  .nav-inner {
    min-height: 76px;
    padding: 12px 20px;
    gap: 8px;
  }
  .wordmark .brand-images {
    max-width: 142px;
  }
  .nav-tools {
    gap: 4px;
  }
  .menu-toggle {
    margin-left: 0;
    padding: 6px;
  }
  #main .container-wide {
    width: calc(100% - 40px);
  }
  #main :where(.hero, .split-section) {
    gap: 24px;
  }
  .page-home .hero {
    padding-block: 32px;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .page-home .hero-copy {
    display: contents;
  }
  .page-home .hero-copy > .eyebrow {
    order: 0;
    margin: 0;
  }
  .page-home .hero-copy > h1 {
    order: 1;
    margin: 0;
    font-size: clamp(
      2.25rem,
      calc(10.8vw * var(--kite-font-scale, 1)),
      3.125rem
    );
    line-height: 1.1;
  }
  .page-home .hero-description {
    order: 2;
    margin: 0;
    font-size: 1rem;
  }
  .page-home .hero-copy > .button-row {
    order: 3;
  }
  .page-home .hero-art {
    order: 4;
    min-height: 0;
    aspect-ratio: 1.15;
    margin-top: 4px;
  }
  .page-home .hero-capability-path {
    order: 5;
    margin: 0;
  }
  .page-home .hero-foot {
    order: 6;
    margin: 0;
  }
  #main .button-row {
    gap: 12px 20px;
  }
  #main .button-row .button {
    justify-content: space-between;
    width: 100%;
  }
  #main .button-row .text-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .hero-capability-node {
    min-height: 90px;
    padding: 12px 10px;
  }
  #main h2 {
    font-size: clamp(1.75rem, calc(7.4vw * var(--kite-font-scale, 1)), 2.25rem);
    line-height: 1.2;
  }
  #main .section-heading p {
    font-size: 0.9375rem;
  }
  #main .split-copy p {
    font-size: 0.9375rem;
  }
  #main :where(.services-grid, .gallery-grid, .public-plan-grid) {
    gap: 18px;
  }
  .public-plan {
    padding: 26px;
  }
  :where(.contact-layout, .faq-layout, .footer-grid) > * {
    min-width: 0;
  }
  .workspace-content {
    padding: 26px 18px;
  }
  .workspace-page-heading {
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
  }
  .workspace-heading-actions {
    max-width: 100%;
  }
  .workspace-page-heading p {
    font-size: 0.8125rem;
  }
  .workspace-panel {
    padding: 20px;
  }
  .workspace-banner,
  .workspace-detail-meta,
  .workspace-footer {
    flex-wrap: wrap;
  }
  .workspace-footer {
    gap: 12px;
    padding-inline: 18px;
  }
  .workspace-footer div {
    flex-wrap: wrap;
    gap: 12px 18px;
  }
  .workspace-hero {
    min-height: 0;
  }
  .workspace-form
    :where(input:not([type="checkbox"]):not([type="radio"]), textarea, select),
  .admin-content :where(.form-control, .form-select),
  .auth-form :where(input:not([type="checkbox"]), textarea, select) {
    font-size: max(1rem, 16px);
  }
  .filter-form,
  .led-filters {
    gap: 12px;
  }
  .filter-form > *,
  .led-filters > * {
    min-width: 0;
  }
  .auth-layout {
    margin-block: 24px;
    padding-inline: 20px;
  }
  .auth-header {
    padding: 16px 20px;
    flex-wrap: wrap;
    gap: 12px;
  }
}
@media screen and (max-width: 374px) {
  .nav-inner {
    padding-inline: 14px;
    gap: 3px;
  }
  .wordmark .brand-images {
    max-width: 122px;
  }
  .nav-tools select {
    min-width: 42px;
    width: 42px;
  }
  #main .container-wide {
    width: calc(100% - 32px);
  }
  .hero-capability-path {
    gap: 6px;
  }
  .hero-capability-node {
    padding-inline: 8px;
  }
  .admin-content,
  .workspace-content {
    padding-inline: 16px;
  }
  .admin-panel,
  .workspace-panel {
    padding: 18px;
  }
}
@media screen and (max-width: 800px) {
  .led-module .led-section-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding: 8px;
    gap: 4px;
    scrollbar-width: thin;
  }
  .led-module .led-section-nav a {
    flex-shrink: 0;
    white-space: nowrap;
  }
  .led-module .led-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .led-module .led-metric {
    min-height: 125px;
    padding: 18px;
  }
  .led-module .led-metric strong {
    font-size: 1.75rem;
  }
  html:not([data-a11y-size="100"]) .admin-header {
    flex-wrap: wrap;
  }
  html:not([data-a11y-size="100"]) .admin-header > span {
    flex-basis: calc(100% - 70px);
  }
  html:not([data-a11y-size="100"]) .admin-header > div {
    flex-basis: 100%;
    max-width: 100%;
  }
  html:not([data-a11y-size="100"])
    :where(.stat-grid, .led-module .led-metrics) {
    grid-template-columns: minmax(0, 1fr);
  }
}
