/* Shared visual polish for the production customer-billing-ui-20260913-v1 UI.
   Load after the existing sheets. Payment dialogs and billing-specific rules
   belong to customer-layout.css; this sheet changes no content or state. */
#app :is(.public-page, .auth-page, .portal) {
  --studio-shell-height: 80px;
  --studio-gutter: clamp(20px, 2.5vw, 36px);
  font-size: 1rem;
  line-height: 1.65;
}
#app :is(.public-page, .auth-page) :is(.btn, .language-picker select),
#app .portal :is(.sidebar .btn, .topbar .btn, .page-header .btn) {
  min-block-size: 44px;
  block-size: auto;
  padding-block: 10px;
  border-radius: 9px;
  font-size: .875rem;
  line-height: 1.5;
}
#app :is(.public-page, .auth-page, .sidebar) .brand-copy { gap: 4px; line-height: 1.15; }
#app :is(.public-page, .auth-page, .sidebar) .brand-name { font-size: 1.375rem; letter-spacing: -.035em; }
#app :is(.public-page, .auth-page, .sidebar) .brand-product { margin-block-start: 0; font-size: .75rem; letter-spacing: .035em; }
#app :is(.public-page, .auth-page) .language-picker { gap: 8px; font-size: .875rem; }
#app :is(.public-page, .auth-page) .language-picker select { padding-inline: 10px; }

/* One alignment line for the hero, with the decorative spark after its label. */
#app .public-page .container { inline-size: min(1240px, calc(100% - 80px)); }
#app .public-nav__inner {
  min-block-size: var(--studio-shell-height);
  block-size: auto;
  padding-block: 12px;
  gap: 16px 24px;
  flex-wrap: wrap;
}
#app .public-nav__links .btn { padding-inline: 14px; }
#app .public-nav__actions { align-items: center; gap: 10px; }
#app .public-nav__actions > .btn { padding-inline: 16px; }
#app .hero { padding-block: 56px 64px; }
#app .hero__grid { grid-template-columns: minmax(0, 1.13fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 64px); align-items: start; }
#app .hero__copy { min-inline-size: 0; }
#app .hero .eyebrow { margin: 0; padding: 0; gap: 10px; font-size: .875rem; font-weight: 600; line-height: 1.5; }
#app .hero .eyebrow__spark { order: 1; inline-size: 18px; block-size: 18px; color: var(--primary-700); }
#app .hero .eyebrow__spark .icon { inline-size: 16px; block-size: 16px; }
#app .hero h1 { margin-block: 18px 20px; font-size: clamp(2.25rem, 3.8vw, 3.25rem); font-weight: 700; line-height: 1.2; letter-spacing: -.035em; }
#app .hero__lead { max-inline-size: 36rem; margin: 0; font-size: 1rem; line-height: 1.8; }
#app .hero__actions { margin-block-start: 26px; gap: 12px; align-items: stretch; flex-wrap: wrap; }
#app .hero__actions > .btn { min-block-size: 60px; padding: 10px 20px; }
#app .hero-app-link > span { gap: 2px; }
#app .hero-app-link strong { font-size: .875rem; line-height: 1.5; }
#app .hero-app-link small { font-size: .75rem; line-height: 1.5; }
#app .hero__meta { margin-block-start: 24px; gap: 12px 20px; flex-wrap: wrap; font-size: .875rem; line-height: 1.6; }
#app .connection-map { inline-size: 100%; max-inline-size: none; margin: 0; padding: 24px; border-radius: 16px; box-shadow: 0 12px 32px #1622380a; }
#app .connection-map__heading { margin-block-end: 20px; flex-wrap: wrap; font-size: .875rem; }
#app .connection-map__endpoint { padding: 16px; }
#app .connection-map__endpoint > span { margin-block-end: 6px; font-size: .875rem; }
#app .connection-map__endpoint code { font-size: .875rem; line-height: 1.6; }
#app .connection-map__routes { gap: 10px; padding-block-start: 20px; }
#app .connection-route { min-block-size: 72px; padding: 14px; align-items: center; }
#app .connection-route strong { font-size: .875rem; line-height: 1.5; }
#app .connection-route div > span { margin-block-start: 3px; font-size: .875rem; line-height: 1.5; }
#app .connection-map__footer { padding-block-start: 18px; font-size: .875rem; line-height: 1.5; }

/* Landing sections share a readable text measure and a consistent rhythm. */
#app .public-page .section { padding-block: 64px; }
#app .public-page :is(.section-heading h2, .integration-panel h2, .cta-panel h2, .product-spotlight h2) {
  font-size: clamp(1.625rem, 2.7vw, 2.25rem);
  line-height: 1.3;
  letter-spacing: -.025em;
}
#app .public-page .section-heading { margin-block-end: 28px; }
#app .public-page .section-kicker { margin-block-end: 12px; font-size: .875rem; letter-spacing: .02em; }
#app .public-page :is(.section-heading > p, .feature-card p, .integration-panel > div > p, .cta-panel p) { font-size: 1rem; line-height: 1.75; }
#app .product-spotlight { padding-block-end: 56px; }
#app .product-spotlight__panel { padding: 36px 40px; gap: 36px; border-radius: 16px; }
#app .product-spotlight h2 { margin-block: 14px 16px; }
#app .product-spotlight__summary { font-size: 1.125rem; line-height: 1.65; }
#app .product-spotlight__login { font-size: 1rem; line-height: 1.65; }
#app .product-spotlight :is(.product-spotlight__platform, .product-spotlight__availability) { font-size: .875rem; line-height: 1.6; }
#app .product-capability { min-block-size: 72px; padding: 16px 20px; gap: 16px; }
#app .product-capability strong { font-size: 1rem; line-height: 1.5; }
#app .logo-strip__inner { min-block-size: 88px; padding-block: 22px; gap: 24px; }
#app .logo-strip__label { font-size: .875rem; line-height: 1.6; }
#app .provider-list { gap: 16px 28px; }
#app .provider-list span { font-size: 1rem; line-height: 1.5; }
#app .feature-card { min-block-size: auto; padding: 28px; }
#app .feature-card__icon { margin-block-end: 18px; }
#app .feature-card h3 { margin-block-end: 12px; font-size: 1.125rem; line-height: 1.4; }
#app .feature-card p { margin-block-end: 0; }
#app .integration-panel { gap: 40px; align-items: start; }
#app .code-window { min-inline-size: 0; }
#app .code-window pre { padding: 24px; font-size: .875rem; line-height: 1.75; }
#app .cta-panel { padding: 36px 40px; }
#app .public-footer__inner { min-block-size: 104px; padding-block: 28px; gap: 20px; flex-wrap: wrap; }
#app .public-footer :is(p, .public-footer__links) { margin-block: 0; font-size: .875rem; line-height: 1.65; }
#app .public-footer__links { gap: 12px 24px; flex-wrap: wrap; }
#app .public-footer__links > a { display: inline-flex; min-block-size: 44px; align-items: center; }
#app .aidestra-privacy-link { color: var(--primary-700); font-size: .875rem; line-height: 1.6; overflow-wrap: anywhere; text-decoration: underline; text-underline-offset: 3px; }
#app .aidestra-privacy-link:focus-visible { outline: 2px solid var(--primary-600); outline-offset: 4px; }

/* Authentication remains a simple form; labels and errors get equal attention. */
#app .auth-main { padding: 28px clamp(24px, 4vw, 56px); }
#app .auth-header { gap: 16px; align-items: center; }
#app .auth-card-wrap { inline-size: min(440px, 100%); padding-block: 36px; }
#app .auth-card { inline-size: 100%; }
#app .auth-card h1 { margin-block-end: 12px; font-size: clamp(1.75rem, 2.6vw, 2rem); font-weight: 700; line-height: 1.3; }
#app .auth-card__back { margin-block-end: 24px; }
#app .auth-card__lead { margin-block-end: 28px; font-size: 1rem; line-height: 1.7; }
#app .auth-card .form-stack { gap: 20px; }
#app .auth-card .field { gap: 8px; }
#app .auth-card :is(.field label, .field__label) { font-size: .875rem; font-weight: 600; line-height: 1.5; }
#app .auth-card :is(.field__hint, .field__error, .form-alert, .auth-card__foot) { font-size: .875rem; line-height: 1.6; }
#app .auth-card .input { min-block-size: 48px; padding-block: 11px; font-size: 1rem; }
#app .auth-card .btn--primary { min-block-size: 48px; }
#app .auth-card__foot { margin-block-start: 24px; }
#app .auth-card .aidestra-privacy-note { margin-block: 20px 0; font-size: .875rem; line-height: 1.6; text-align: start; }
#app .auth-card .aidestra-privacy-note a { display: inline-flex; min-block-size: 44px; align-items: center; }
#app .auth-aside { margin: 20px; padding: clamp(28px, 4vw, 52px); border-radius: 18px; }
#app .auth-aside h2 { margin-block: 28px 20px; font-size: clamp(1.75rem, 3vw, 2.75rem); line-height: 1.3; }
#app .auth-aside__content > p { font-size: 1rem; line-height: 1.75; }
#app .auth-proof { margin-block-start: 36px; }
#app .auth-proof__item span { font-size: .875rem; line-height: 1.5; }

/* Sticky flow prevents translated topbar content from covering the page. */
#app .portal { font-size: .875rem; }
#app .portal .sidebar { overflow-y: auto; overscroll-behavior-y: contain; }
#app .portal .sidebar__brand { block-size: auto; min-block-size: var(--studio-shell-height); flex-shrink: 0; padding: 18px 22px; }
#app .portal .sidebar__nav { flex: 0 0 auto; overflow: visible; padding: 22px 14px; gap: 6px; }
#app .portal .sidebar__bottom { flex: 0 0 auto; margin-block-start: auto; padding: 16px; }
#app .portal .sidebar__label { margin: 0 12px 12px; font-size: .75rem; line-height: 1.5; letter-spacing: .04em; }
#app .portal .nav-item { min-block-size: 44px; padding: 11px 12px; gap: 12px; text-align: start; font-size: .875rem; line-height: 1.5; }
#app .portal .nav-item > span:first-of-type { flex: 1; min-inline-size: 0; }
#app .portal .nav-item__pill { flex: 0 0 auto; margin: 0; margin-inline-start: auto; font-size: .75rem; }
#app .portal .sidebar__home { min-block-size: 44px; margin-block-end: 12px; font-size: .875rem; }
#app .portal .support-card { padding: 16px; }
#app .portal .support-card :is(strong, p) { font-size: .875rem; line-height: 1.6; }
#app .portal .aidestra-privacy-link--sidebar { display: flex; min-block-size: 44px; margin-block-start: 8px; padding-inline: 4px; align-items: center; color: #c7d2e4; text-align: start; }
#app .portal .topbar {
  position: sticky;
  inset-block-start: 0;
  inset-inline: auto;
  inline-size: calc(100% - var(--sidebar-width));
  margin-inline: var(--sidebar-width) 0;
  block-size: auto;
  min-block-size: var(--studio-shell-height);
  padding: 12px var(--studio-gutter);
  gap: 12px 20px;
  flex-wrap: wrap;
}
#app .portal :is(.topbar__left, .topbar__right) { min-inline-size: 0; flex-wrap: wrap; gap: 10px 16px; }
#app .portal .topbar__right { margin-inline-start: auto; }
#app .portal :is(.topbar__breadcrumb, .server-status) { font-size: .875rem; line-height: 1.5; }
#app .portal .topbar__breadcrumb { overflow: visible; white-space: normal; text-overflow: clip; overflow-wrap: anywhere; }
#app .portal .topbar .language-picker { font-size: .875rem; }
#app .portal .topbar .language-picker select { min-block-size: 44px; font-size: .875rem; }
#app .portal .user-button { min-block-size: 44px; padding: 4px 8px; gap: 10px; text-align: start; }
#app .portal .user-button__copy { max-inline-size: 15rem; text-align: start; }
#app .portal .user-button__copy :is(strong, span) { overflow: visible; white-space: normal; text-overflow: clip; overflow-wrap: anywhere; font-size: .875rem; line-height: 1.5; }
#app .portal .portal-main { margin-inline: var(--sidebar-width) 0; min-block-size: calc(100vh - 80px); padding: 28px var(--studio-gutter) 48px; }
#app .portal .page-wrap { inline-size: 100%; max-inline-size: 1440px; }
#app .portal .page-header { gap: 16px 24px; margin-block-end: 24px; }
#app .portal .page-header h1 { margin-block-end: 8px; font-size: clamp(1.5rem, 1.1rem + 1vw, 1.875rem); font-weight: 700; line-height: 1.35; }
#app .portal .page-header p { max-inline-size: 50rem; font-size: .875rem; line-height: 1.7; }
#app .portal .page-header__actions { gap: 10px; align-items: center; }
#app .portal :is(.stats-grid, .dashboard-grid, .usage-breakdown) { gap: 20px; }
#app .portal .stats-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
#app .portal .dashboard-grid { margin-block-start: 20px; }
#app .portal .card { border-radius: 12px; }
#app .portal .card > .card__head { padding: 20px 24px; gap: 16px; align-items: center; }
#app .portal .card > .card__body:not(.card__body--flush) { padding: 24px; }
#app .portal :is(.card__head h2, .card__head h3) { margin-block-end: 0; font-size: 1rem; font-weight: 650; line-height: 1.5; }
#app .portal :is(.card__head-copy p, .stat-card__label, .stat-card__meta, .health-row, .quick-action__copy > span) { font-size: .875rem; line-height: 1.6; }
#app .portal .card__head-copy p { margin-block: 5px 0; }
#app .portal .quick-action { min-block-size: 64px; padding-block: 14px; gap: 12px; }
#app .portal .quick-action__copy strong { font-size: .875rem; line-height: 1.5; }
#app .portal :is(.chart-summary, .bar-chart__label, .legend, .empty-state p) { font-size: .875rem; line-height: 1.6; }

/* Model and credential selectors are scoped away from wallet and plan tables. */
#app .page-wrap:has(#model-search) > section > .card__head.section-head { padding-inline: 0; }
#app .portal :is(.model-grid, .model-featured) { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 16px; align-items: start; }
#app .portal .model-grid > article { min-inline-size: 0; }
#app .portal .model-featured .model-profile-card:last-child { grid-column: auto; }
#app .portal :is(.model-card, .model-profile-card) { inline-size: 100%; min-inline-size: 0; padding: 20px; text-align: start; border-radius: 12px; }
#app .portal .model-card { min-block-size: 0; gap: 12px; }
#app .portal .model-card__head { align-items: flex-start; gap: 12px; }
#app .portal :is(.model-card__copy strong, .model-profile-card h3) { font-size: 1rem; line-height: 1.45; }
#app .portal :is(.model-card__copy span, .model-card__description, .model-profile-card__id, .model-profile-card p, .model-card__stat span, .model-card__stat strong) { font-size: .875rem; line-height: 1.6; }
#app .portal .model-card__description { margin-block: 0; }
#app .portal .model-card__stats { gap: 8px; }
#app .portal .model-card__stat { padding: 10px; }
#app .portal .model-profile-card__meta { gap: 8px; flex-wrap: wrap; }
#app .portal .mini-tag { font-size: .75rem; line-height: 1.5; }
#app .portal .toolbar:has(#model-search) { margin-block: 24px 20px; gap: 16px; flex-wrap: wrap; }
#app .portal .toolbar:has(#model-search) .toolbar__filters { flex: 1 1 24rem; gap: 12px; flex-wrap: wrap; }
#app .portal .toolbar:has(#model-search) .search-box { flex: 1 1 18rem; inline-size: auto; }
#app .portal .toolbar:has(#model-search) .select { flex: 0 1 13rem; inline-size: auto; }
#app .portal .toolbar:has(#model-search) .result-count { font-size: .875rem; white-space: normal; }
#app .portal .selection-dock { padding: 16px 20px; gap: 16px; flex-wrap: wrap; }
#app .portal .selection-dock__model { min-inline-size: 0; }
#app .portal .selection-dock__copy :is(span, strong) { font-size: .875rem; line-height: 1.5; overflow: visible; white-space: normal; text-overflow: clip; overflow-wrap: anywhere; }
#app .portal .request-log-table,
#app .page-wrap:has(#cross-model-failover) .data-table { font-size: .875rem; }
#app .portal .request-log-table :is(th, td),
#app .page-wrap:has(#cross-model-failover) .data-table :is(th, td) { padding: 16px 20px; font-size: .875rem; line-height: 1.6; }
#app .portal .request-log-table th,
#app .page-wrap:has(#cross-model-failover) .data-table th { letter-spacing: normal; text-transform: none; }
#app .portal .request-log-table .table-secondary,
#app .page-wrap:has(#cross-model-failover) .table-secondary { font-size: .875rem; line-height: 1.5; }
#app .page-wrap:has(#cross-model-failover) .key-cell { align-items: flex-start; gap: 12px; min-inline-size: 0; }
#app .page-wrap:has(#cross-model-failover) .key-cell > span:last-child { min-inline-size: 0; overflow-wrap: anywhere; }

html[dir="rtl"] #app :is(.hero h1, .section-heading h2, .integration-panel h2, .cta-panel h2, .product-spotlight h2) { letter-spacing: normal; }
@media (max-height: 820px) {
  #app .portal .sidebar__nav { padding-block: 12px; gap: 4px; }
  #app .portal .sidebar__label { margin-block-end: 8px; }
  #app .portal .sidebar__bottom { padding: 12px 16px; }
  #app .portal .sidebar__home { margin-block-end: 8px; }
  #app .portal .support-card { padding: 12px; }
  #app .portal .support-card p { margin-block-end: 8px; }
}
@media (max-width: 1100px) {
  #app .hero__grid { gap: 32px; }
  #app .portal .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  #app .portal .model-card__stats { grid-template-columns: 1fr; }
}
@media (max-width: 920px) {
  #app .public-page .container { inline-size: calc(100% - 48px); }
  #app .hero { padding-block: 40px 48px; }
  #app .hero__grid { grid-template-columns: 1fr; gap: 32px; }
  #app .hero__copy { max-inline-size: 44rem; }
  #app .connection-map { max-inline-size: 44rem; }
  #app .product-spotlight__panel { grid-template-columns: 1fr; padding: 28px; gap: 28px; }
  #app .product-capabilities { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #app .product-capability { align-items: flex-start; flex-direction: column; }
  #app .integration-panel { grid-template-columns: 1fr; gap: 28px; }
  #app .auth-main { min-block-size: 100dvh; padding: 24px; }
}
@media (max-width: 760px) {
  #app .public-nav__inner { gap: 12px; }
  #app .public-page .section { padding-block: 44px; }
  #app .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #app .feature-card { padding: 24px; }
  #app .portal .topbar { inline-size: 100%; margin-inline: 0; padding: 10px 20px; min-block-size: 64px; }
  #app .portal .portal-main { margin-inline: 0; padding: 24px 20px 36px; }
  #app .portal .page-header__actions { justify-content: flex-start; }
  #app .portal .card > .card__head { padding: 18px 20px; }
  #app .portal .card > .card__body:not(.card__body--flush) { padding: 20px; }
  #app .portal .toolbar:has(#model-search) .toolbar__filters { flex-basis: auto; inline-size: 100%; }
  #app .portal .toolbar:has(#model-search) :is(.search-box, .select) { flex: 1 1 auto; inline-size: 100%; }
}
@media (max-width: 520px) {
  #app .public-page .container { inline-size: calc(100% - 32px); }
  #app .public-nav__actions { inline-size: 100%; gap: 8px; }
  #app .public-nav__actions > .btn { padding-inline: 12px; }
  #app .public-nav__actions .language-picker select { inline-size: 112px; }
  #app .hero { padding-block: 32px 40px; }
  #app .hero h1 { font-size: clamp(2rem, 8.5vw, 2.75rem); }
  #app .hero__actions { flex-direction: column; }
  #app .hero__actions > .btn { min-block-size: 56px; }
  #app .connection-map { padding: 18px; }
  #app .connection-route { padding: 12px; gap: 10px; }
  #app .product-spotlight__panel { padding: 24px; }
  #app .product-capabilities, #app .feature-grid { grid-template-columns: 1fr; }
  #app .product-capability { flex-direction: row; align-items: center; min-block-size: 60px; }
  #app .cta-panel { padding: 24px; }
  #app .code-window pre { padding: 18px; }
  #app .auth-main { padding: 20px; }
  #app .auth-card-wrap { padding-block: 28px; }
  #app .auth-card .field-row { grid-template-columns: 1fr; }
  #app .portal .topbar { padding-inline: 16px; }
  #app .portal .portal-main { padding-inline: 16px; }
  #app .portal :is(.model-grid, .model-featured) { grid-template-columns: 1fr; }
  #app .portal .selection-dock { position: static; }
  #app .portal .request-log-table td,
  #app .page-wrap:has(#cross-model-failover) .data-table td { padding: 12px 16px; }
}
