/*
 * OpenArt-matched creator UI (desktop + mobile).
 *
 * Every colour here resolves through a variable so the light theme (set by
 * assets/js/theme.js via data-theme="light" on <html>) flips surfaces and text together.
 * Never hard-code a hex for a surface or a text colour in this file.
 */

:root {
  --oa-bg: #000000;
  --oa-sidebar: #050505;
  --oa-panel: #0d0d0d;
  --oa-panel-2: #161616;
  --oa-elev: #1a1a1a;
  --oa-elev-2: #222222;
  --oa-border: rgba(255, 255, 255, 0.08);
  --oa-border-strong: rgba(255, 255, 255, 0.16);
  --oa-text: #ffffff;
  --oa-text-dim: #d4d4d4;
  --oa-muted: #9a9a9a;
  --oa-faint: #6b6b6b;
  --oa-chrome: rgba(0, 0, 0, 0.72);
  --oa-pink: #ff2d8f;
  --oa-pink-2: #ff4db8;
  --oa-green: #22c55e;
  --oa-lime: #d4ff3f;
  --oa-sidebar-w: 232px;
  --oa-studio-w: 380px;
  --oa-radius: 14px;
  --oa-radius-lg: 20px;

  --sidebar-w: var(--oa-sidebar-w);
  --mobile-nav-h: 64px;
  --mobile-topbar-h: 56px;
  --bg: var(--oa-bg);
  --panel: var(--oa-panel-2);
  --panel-2: var(--oa-elev);
  --border: var(--oa-border);
  --border-strong: var(--oa-border-strong);
  --text: var(--oa-text);
  --muted: var(--oa-muted);
  --chrome: var(--oa-chrome);
  --primary: var(--oa-pink);
  --primary-2: var(--oa-pink-2);
}

:root[data-theme="light"] {
  --oa-bg: #ffffff;
  --oa-sidebar: #fbfbfc;
  --oa-panel: #ffffff;
  --oa-panel-2: #f4f4f6;
  --oa-elev: #ffffff;
  --oa-elev-2: #eeeef1;
  --oa-border: rgba(16, 16, 22, 0.10);
  --oa-border-strong: rgba(16, 16, 22, 0.20);
  --oa-text: #101014;
  --oa-text-dim: #34343e;
  --oa-muted: #5c5c68;
  --oa-faint: #86868f;
  --oa-chrome: rgba(255, 255, 255, 0.86);
}

html, body {
  background: var(--oa-bg) !important;
  color: var(--oa-text);
}

.app-shell {
  background: var(--oa-bg);
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
}

/* —— Sidebar —— */
.sidebar {
  width: var(--sidebar-w);
  background: var(--oa-sidebar) !important;
  border-right: 1px solid var(--oa-border) !important;
  padding: 0;
}

.sidebar-top {
  padding: 16px 14px 8px !important;
  border-bottom: none !important;
}

.brand {
  gap: 10px;
  padding: 0 !important;
  min-height: auto !important;
}

.brand-text small { display: none; }
.brand-text strong {
  font-size: 1.1rem;
  letter-spacing: -0.03em;
  font-weight: 700;
  color: var(--oa-text);
}

.workspace-selector {
  margin-top: 12px !important;
  padding: 8px 12px !important;
  border-radius: 999px !important;
  background: var(--oa-elev-2) !important;
  border: 1px solid var(--oa-border) !important;
  color: var(--oa-text-dim) !important;
  font-size: 12px !important;
}

.sidebar-nav {
  padding: 6px 10px 20px !important;
  overflow: auto;
}

.nav-section {
  margin: 16px 8px 6px !important;
  font-size: 10px !important;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--oa-faint) !important;
  font-weight: 700;
}

.nav-link {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 9px 12px !important;
  border-radius: 10px !important;
  color: var(--oa-text-dim) !important;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
}

.nav-link .nav-ico {
  width: 18px;
  height: 18px;
  opacity: 0.9;
  flex-shrink: 0;
}

.nav-link:hover {
  background: var(--oa-elev-2) !important;
  color: var(--oa-text) !important;
}

.nav-link.is-active {
  background: color-mix(in srgb, var(--oa-pink) 10%, transparent) !important;
  border-color: color-mix(in srgb, var(--oa-pink) 55%, transparent) !important;
  color: var(--oa-text) !important;
}

/* OpenArt lays the Create modes out as a two-column chip grid. */
.nav-group.is-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.nav-group.is-grid .nav-link {
  padding: 8px 9px !important;
  font-size: 12.5px;
  gap: 7px;
  margin-bottom: 0;
}
.nav-group.is-grid .nav-link .nav-ico { width: 16px; height: 16px; }
.nav-group.is-grid .nav-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-footer {
  border-top: 1px solid var(--oa-border) !important;
  padding: 12px !important;
}
.sidebar-theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 2px 10px;
  font-size: 12px;
}
.sidebar-collapsed .sidebar-theme-row { justify-content: center; }
.sidebar-collapsed .sidebar-theme-row span { display: none; }
/* Name over credits; both are inline elements, so the column has to stack them. */
.sidebar-user > div {
  display: grid;
  min-width: 0;
}
.sidebar-user strong {
  color: var(--oa-text);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-user small { font-size: 11px; }
@media (min-width: 901px) {
  .sidebar-footer .btn { border-radius: 999px !important; }
}

.app-shell.sidebar-collapsed { --sidebar-w: 72px; }
.sidebar-collapsed .nav-group.is-grid { grid-template-columns: 1fr; }

/* —— Top bars —— */
.desktop-topbar {
  height: 56px !important;
  padding: 0 20px !important;
  background: var(--oa-chrome) !important;
  border-bottom: 1px solid var(--oa-border) !important;
  backdrop-filter: blur(20px);
  justify-content: flex-end !important;
}

.desktop-topbar .topbar-left { margin-right: auto; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.oa-top-link {
  color: var(--oa-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 8px;
  white-space: nowrap;
}
.oa-top-link:hover { color: var(--oa-text); }

.btn-login-ghost {
  background: transparent;
  border: 1px solid var(--oa-border-strong);
  color: var(--oa-text);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}

.btn-start-free,
.btn.btn-primary {
  background: linear-gradient(135deg, var(--oa-pink), var(--oa-pink-2)) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 999px !important;
  font-weight: 700 !important;
}

.btn-upgrade-green {
  background: var(--oa-green) !important;
  color: #04140a !important;
  border: none !important;
  border-radius: 999px !important;
  padding: 7px 12px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  white-space: nowrap;
}

.credit-pill {
  background: color-mix(in srgb, var(--oa-green) 14%, transparent) !important;
  border: 1px solid color-mix(in srgb, var(--oa-green) 40%, transparent) !important;
  color: color-mix(in srgb, var(--oa-green) 70%, var(--oa-text)) !important;
  border-radius: 999px !important;
  font-weight: 700;
  white-space: nowrap;
}

.avatar-btn {
  width: 34px !important;
  height: 34px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, var(--oa-pink), #8b5cf6) !important;
  color: #fff !important;
  border: 1px solid var(--oa-border) !important;
  font-weight: 700;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.dropdown-menu {
  background: var(--oa-panel-2) !important;
  border: 1px solid var(--oa-border) !important;
  color: var(--oa-text);
}

.content {
  padding: 24px 28px 48px !important;
  max-width: none !important;
  background: var(--oa-bg);
}

/* —— Home —— */
.oa-home {
  max-width: 1180px;
  margin: 0 auto;
  padding-top: 44px;
}

.oa-home-title {
  text-align: center;
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--oa-muted);
  margin: 0 0 26px;
  line-height: 1.15;
}
.oa-home-title strong { color: var(--oa-text); font-weight: 700; }

.oa-mode-bar {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 0 auto 32px;
  padding: 6px;
  width: fit-content;
  max-width: 100%;
  background: var(--oa-panel-2);
  border: 1px solid var(--oa-border);
  border-radius: 999px;
  box-sizing: border-box;
}

.oa-mode-bar a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 999px;
  color: var(--oa-text-dim);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  position: relative;
  flex: 0 0 auto;
}
.oa-mode-bar a:hover,
.oa-mode-bar a.is-active {
  background: var(--oa-elev-2);
  color: var(--oa-text);
}
.oa-mode-bar .nav-ico { width: 17px; height: 17px; flex-shrink: 0; }

.oa-badge-new {
  display: inline-flex;
  align-items: center;
  margin-left: 2px;
  position: static;
  top: auto;
  right: auto;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: var(--oa-green);
  color: #04140a;
  padding: 2px 5px;
  border-radius: 999px;
  line-height: 1.1;
}

.oa-hero-sub {
  text-align: center;
  max-width: 560px;
  margin: -14px auto 24px;
  color: var(--oa-muted);
}
.oa-hero-cta { text-align: center; margin-bottom: 8px; }

/* Promo rail: scrolls horizontally instead of squeezing cards. */
.oa-promo-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(232px, 1fr);
  gap: 12px;
  margin-bottom: 34px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.oa-promo-row::-webkit-scrollbar { display: none; }

.oa-promo-card {
  position: relative;
  border-radius: var(--oa-radius-lg);
  overflow: hidden;
  min-height: 132px;
  background: var(--oa-elev-2);
  border: 1px solid var(--oa-border);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px;
  background-size: cover;
  background-position: center;
  scroll-snap-align: start;
  color: #fff;
}
.oa-promo-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 25%, rgba(0, 0, 0, 0.88));
}
.oa-promo-card.is-flat::before { display: none; }
.oa-promo-card.is-flat { color: var(--oa-text); }
.oa-promo-card > * { position: relative; z-index: 1; }
.oa-promo-card strong { font-size: 14px; display: block; }
.oa-promo-card span { font-size: 12px; color: rgba(255, 255, 255, 0.72); }
.oa-promo-card.is-flat span { color: var(--oa-muted); }
.oa-promo-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--oa-pink);
  color: #fff;
}

/* Popular tools — image-led cards. Artwork comes from Admin → AI Tools. */
.tool-cover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.tool-cover {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  min-height: 190px;
  padding: 16px;
  border-radius: var(--oa-radius-lg);
  border: 1px solid var(--oa-border);
  overflow: hidden;
  isolation: isolate;
  background-size: cover;
  background-position: center;
  color: #fff;
  text-decoration: none;
  transition: transform 200ms ease, border-color 200ms ease;
}
.tool-cover:hover {
  transform: translateY(-3px);
  border-color: var(--oa-pink);
}
/* Deterministic artwork stand-in so a tool without an upload still reads as a card. */
.tool-cover.is-flat.tone-1 { background-image: linear-gradient(150deg, #ff2d8f, #7b2ff7); }
.tool-cover.is-flat.tone-2 { background-image: linear-gradient(150deg, #0ea5e9, #2563eb); }
.tool-cover.is-flat.tone-3 { background-image: linear-gradient(150deg, #22c55e, #0f766e); }
.tool-cover.is-flat.tone-4 { background-image: linear-gradient(150deg, #f97316, #db2777); }
.tool-cover.is-flat.tone-5 { background-image: linear-gradient(150deg, #8b5cf6, #1e293b); }
.tool-cover.is-flat.tone-6 { background-image: linear-gradient(150deg, #eab308, #ef4444); }
.tool-cover__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 20%, rgba(0, 0, 0, 0.82) 100%);
}
.tool-cover__body {
  display: grid;
  gap: 3px;
}
.tool-cover__kicker {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}
.tool-cover__title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}
.tool-cover__desc {
  font-size: 12px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.78);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tool-cover__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tool-cover__cost {
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}
.tool-cover .badge {
  background: rgba(0, 0, 0, 0.45);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
}
@media (max-width: 640px) {
  .tool-cover-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tool-cover { min-height: 156px; padding: 12px; }
}

.oa-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
}
.oa-section-head h2 {
  font-size: 1.1rem;
  margin: 0;
  font-weight: 700;
  color: var(--oa-text);
}
.oa-section-head p {
  margin: 0;
  font-size: 12.5px;
  color: var(--oa-muted);
}
.oa-section-head .oa-section-more {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--oa-muted);
  font-weight: 600;
}
.oa-section-head .oa-section-more:hover { color: var(--oa-text); }
.oa-section-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--oa-pink), var(--oa-pink-2));
  color: #fff;
  flex-shrink: 0;
}

/* Feed of large cards (OpenArt "Vibe Direct Now") */
.oa-feed-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 34px;
}
.oa-feed-card {
  position: relative;
  border-radius: var(--oa-radius-lg);
  overflow: hidden;
  border: 1px solid var(--oa-border);
  background: var(--oa-elev-2);
  aspect-ratio: 16 / 10;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px;
  color: #fff;
}
.oa-feed-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.oa-feed-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.85));
}
.oa-feed-card > * { position: relative; z-index: 1; }
.oa-feed-card strong { font-size: 15px; }
.oa-feed-card span { font-size: 12px; color: rgba(255, 255, 255, 0.75); }

.oa-masonry {
  columns: 4 220px;
  column-gap: 12px;
}
.oa-masonry article {
  break-inside: avoid;
  margin-bottom: 12px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--oa-elev-2);
  border: 1px solid var(--oa-border);
}
.oa-masonry img {
  width: 100%;
  display: block;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--oa-panel-2);
}
.oa-masonry figcaption {
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--oa-text);
}

/* Home sections that still use the generic card grid */
.section-block { margin-bottom: 34px; }
.section-block .page-head h2 { font-size: 1.1rem; }
.card, .tool-card, .model-card, .prompt-card, .empty-panel {
  background: var(--oa-panel-2) !important;
  border-color: var(--oa-border) !important;
  color: var(--oa-text);
}
.card h1, .card h2, .card h3, .tool-card h3 { color: var(--oa-text); }

/* —— Studio —— */
.studio-v2.studio-layout {
  display: grid !important;
  grid-template-columns: minmax(300px, var(--oa-studio-w)) minmax(0, 1fr) !important;
  gap: 0 !important;
  min-height: calc(100vh - 120px);
  border: 1px solid var(--oa-border);
  border-radius: 18px;
  overflow: hidden;
  background: var(--oa-panel);
}

.studio-v2 .studio-panel {
  background: var(--oa-panel);
  border-right: 1px solid var(--oa-border);
  padding: 16px;
  overflow: auto;
  max-height: calc(100vh - 120px);
}

.studio-v2 .canvas-panel {
  background: var(--oa-bg);
  padding: 16px;
  overflow: auto;
  max-height: calc(100vh - 120px);
}

.studio-v2 .tool-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.studio-v2 .tool-tab {
  padding: 14px 12px;
  border-radius: 14px;
  border: 1px solid var(--oa-border);
  background: var(--oa-elev-2);
  color: var(--oa-text-dim);
  font-weight: 600;
  text-align: center;
}
.studio-v2 .tool-tab.is-active {
  border-color: color-mix(in srgb, var(--oa-pink) 70%, transparent);
  color: var(--oa-text);
  background: color-mix(in srgb, var(--oa-pink) 10%, transparent);
}

.studio-v2 .studio-actions {
  position: sticky;
  bottom: 0;
  padding-top: 12px;
  background: linear-gradient(180deg, transparent, var(--oa-panel) 30%);
}
.studio-v2 .studio-actions .btn-primary {
  width: 100%;
  min-height: 48px;
  font-size: 15px;
}

.studio-v2 .dropzone {
  border: 1px dashed var(--oa-border-strong);
  border-radius: 16px;
  background: var(--oa-panel-2);
  padding: 28px 16px;
  text-align: center;
}

.studio-option-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.studio-option-chip {
  appearance: none;
  border: 1px solid var(--oa-border, #2a2a32);
  background: var(--oa-elev-2, #16161c);
  color: var(--oa-text-dim, #a1a1aa);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.2;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.studio-option-chip:hover {
  color: var(--oa-text, #f4f4f5);
  border-color: color-mix(in srgb, var(--oa-pink, #ec4899) 45%, transparent);
}

.studio-option-chip.is-active {
  color: var(--oa-text, #fff);
  border-color: color-mix(in srgb, var(--oa-pink, #ec4899) 80%, transparent);
  background: color-mix(in srgb, var(--oa-pink, #ec4899) 16%, transparent);
}

.studio-option-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.studio-v2 [data-field="prompt"] textarea,
.studio-v2 [data-structural="prompt"] textarea {
  min-height: 120px;
}

.mob-root .mob-field {
  margin-bottom: 2px;
}

.mob-root .mob-error {
  color: #b91c1c;
  font-size: 12px;
  margin-top: 4px;
}

.mob-root .mob-range {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mob-root .mob-range input[type="range"] {
  flex: 1;
}

.mob-root .mob-dropzone {
  margin-top: 4px;
}

.studio-credit-estimate strong {
  color: var(--oa-text, inherit);
}

/* Floating mode dock (desktop studio) */
.oa-mode-dock {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 55;
  display: none;
  gap: 4px;
  padding: 7px 9px;
  border-radius: 999px;
  background: var(--oa-panel-2);
  border: 1px solid var(--oa-border);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
body.is-studio .oa-mode-dock { display: flex; }
.oa-mode-dock a {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--oa-muted);
}
.oa-mode-dock a:hover,
.oa-mode-dock a.is-active {
  background: color-mix(in srgb, var(--oa-pink) 16%, transparent);
  color: var(--oa-text);
}

/* —— Pricing (OpenArt plan cards) —— */
.oa-pricing-head {
  text-align: center;
  max-width: 640px;
  margin: 8px auto 26px;
}
.oa-pricing-head h1 {
  font-size: clamp(1.6rem, 3.4vw, 2.3rem);
  letter-spacing: -0.03em;
  margin: 0 0 8px;
  color: var(--oa-text);
}
.oa-pricing-head p { color: var(--oa-muted); margin: 0; }

.oa-pricing {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(272px, 1fr)) !important;
  gap: 16px;
  align-items: stretch;
  max-width: 1140px;
  margin: 0 auto;
  width: 100%;
}

.oa-plan {
  position: relative;
  display: flex !important;
  flex-direction: column;
  gap: 16px;
  padding: 22px 20px;
  border-radius: 20px;
  border: 1px solid var(--oa-border);
  background: var(--oa-panel-2) !important;
  color: var(--oa-text);
  box-shadow: 0 10px 30px color-mix(in srgb, var(--oa-text) 6%, transparent);
}
.page-subscription .oa-plan form { margin: 0; }
.page-subscription .oa-plan ul { list-style: none; padding: 0; margin: 0; }
.oa-plan.tier-2 { border-color: color-mix(in srgb, var(--oa-lime) 45%, transparent); }
.oa-plan.tier-3 { border-color: color-mix(in srgb, var(--oa-pink) 55%, transparent); }

.oa-plan__name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--oa-text);
  margin: 0;
}
.oa-plan__badge {
  font-size: 9.5px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--oa-pink) 22%, transparent);
  color: var(--oa-pink-2);
  letter-spacing: 0.04em;
}
.oa-plan__tagline {
  margin: -10px 0 0;
  font-size: 13px;
  color: var(--oa-muted);
}

.oa-plan__credits {
  border: 1px solid var(--oa-border);
  border-radius: 14px;
  padding: 14px;
  background: var(--oa-elev-2);
}
.oa-plan.tier-3 .oa-plan__credits {
  background: linear-gradient(150deg, color-mix(in srgb, var(--oa-pink) 18%, transparent), var(--oa-elev-2));
}
.oa-plan__credits strong {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  color: var(--oa-text);
}
.oa-plan__credits ul {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 3px;
  font-size: 12px;
  color: var(--oa-muted);
}

.oa-plan__price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
}
.oa-plan__price b {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--oa-text);
}
.oa-plan__price span { font-size: 12.5px; color: var(--oa-muted); }

.oa-plan__cta {
  display: block;
  width: 100%;
  text-align: center;
  padding: 13px 16px;
  border-radius: 999px;
  border: none;
  font-weight: 700;
  font-size: 14.5px;
  background: var(--oa-text);
  color: var(--oa-bg);
}
.oa-plan.tier-2 .oa-plan__cta { background: var(--oa-lime); color: #14140a; }
.oa-plan.tier-3 .oa-plan__cta {
  background: linear-gradient(135deg, var(--oa-pink), var(--oa-pink-2));
  color: #fff;
}

.oa-plan__features {
  list-style: none;
  margin: 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--oa-border);
  display: grid;
  gap: 9px;
  font-size: 12.5px;
  color: var(--oa-text-dim);
}
.oa-plan__features li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.oa-plan__features li::before {
  content: "✓";
  color: var(--oa-green);
  font-weight: 800;
  flex-shrink: 0;
}
.oa-plan__features li.is-off { color: var(--oa-faint); }
.oa-plan__features li.is-off::before { content: "✕"; color: var(--oa-faint); }

.oa-plan__note {
  margin: 0;
  font-size: 11.5px;
  color: var(--oa-faint);
}

/* —— Mobile (iOS + Android parity) —— */
.mobile-topbar {
  box-sizing: border-box;
  height: calc(var(--mobile-topbar-h, 56px) + env(safe-area-inset-top, 0px)) !important;
  padding:
    env(safe-area-inset-top, 0px)
    max(8px, env(safe-area-inset-right, 0px))
    0
    max(8px, env(safe-area-inset-left, 0px)) !important;
  gap: 6px;
  background: var(--oa-bg) !important;
  border-bottom: 1px solid var(--oa-border) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.mobile-topbar .mobile-logo {
  min-width: 0;
  gap: 6px;
  flex: 1 1 auto;
}
.mobile-topbar .mobile-logo strong {
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--oa-text);
}
.mobile-topbar .topbar-actions {
  gap: 6px;
  flex-shrink: 0;
  align-items: center;
}
.mobile-topbar .credit-pill.compact { padding: 6px 9px !important; font-size: 11px !important; min-height: 30px; min-width: 0; }
.mobile-topbar .btn-upgrade-green { padding: 6px 10px !important; font-size: 11px !important; min-height: 30px; min-width: 0; }
.mobile-topbar .avatar-btn { width: 30px !important; height: 30px !important; min-width: 30px; min-height: 30px; font-size: 12px; }
.mobile-topbar .theme-toggle { width: 30px; height: 30px; font-size: 13px; }
.mobile-topbar .icon-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  flex-shrink: 0;
}

/* Visibility stays with creator.css; this locks a single box model for every phone. */
.mobile-nav {
  box-sizing: border-box !important;
  height: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px)) !important;
  min-height: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px)) !important;
  max-height: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px)) !important;
  padding: 4px 2px env(safe-area-inset-bottom, 0px) !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  align-items: center !important;
  background: var(--oa-chrome) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--oa-border) !important;
  overflow: visible !important;
}
.mobile-nav a {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px !important;
  min-width: 0;
  min-height: 0 !important;
  height: var(--mobile-nav-h) !important;
  max-height: var(--mobile-nav-h) !important;
  color: var(--oa-faint) !important;
  font-size: 10px !important;
  line-height: 1.15 !important;
  font-weight: 600;
  background: transparent !important;
  transform: none !important;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.mobile-nav a span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mobile-nav a .nav-ico { width: 20px; height: 20px; flex-shrink: 0; }
.mobile-nav a.is-active { color: var(--oa-pink) !important; }
.mobile-nav .nav-create { color: var(--oa-text) !important; }
.mobile-nav .nav-create .create-orb {
  margin-top: -16px;
  width: 46px !important;
  height: 46px !important;
}
.create-orb {
  width: 46px !important;
  height: 46px !important;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--oa-pink-2), var(--oa-pink)) !important;
  color: #fff;
  border: 3px solid var(--oa-bg);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--oa-pink) 50%, transparent) !important;
  flex-shrink: 0;
}
.create-orb .nav-ico { width: 22px; height: 22px; }

/* Create radial sheet (OpenArt mobile) */
#createSheet.bottom-sheet {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  max-height: none !important;
}
#createSheet .bottom-sheet__head,
#createSheet .bottom-sheet__handle { display: none !important; }
#createSheet .bottom-sheet__body {
  padding: 0 !important;
  overflow: visible !important;
}
/*
 * The five create modes sit on a semicircle. Positions are polar (radius × cos/sin of a
 * fixed angle) instead of hand-tuned percentages, so the spacing scales with the arc and
 * neighbours can never collide on any screen width.
 */
.oa-create-arc {
  --arc-w: min(340px, 92vw);
  --arc-r: calc(var(--arc-w) * 0.365);
  position: relative;
  width: var(--arc-w);
  height: calc(var(--arc-r) + 92px);
  margin: 0 auto 20px;
  border-radius: 200px 200px 0 0;
  background: var(--oa-chrome);
  backdrop-filter: blur(18px);
  border: 1px solid var(--oa-border);
  border-bottom: 0;
}
.oa-create-arc__center {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--oa-border);
  background: var(--oa-elev-2);
  color: var(--oa-text);
  font-size: 20px;
  z-index: 2;
}
.oa-create-arc a {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translate(calc(-50% + var(--ax, 0px)), calc(var(--ay, 0px) * -1));
  width: 64px;
  display: grid;
  place-items: center;
  gap: 4px;
  color: var(--oa-text);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}
.oa-create-arc a .oa-arc-ico {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--oa-elev-2);
  border: 1px solid var(--oa-border);
}
/* Angles: 174° 132° 90° 48° 6° — a 42° gap keeps ~89px between 64px-wide items. */
.oa-create-arc a:nth-of-type(1) { --ax: calc(var(--arc-r) * -0.995); --ay: calc(var(--arc-r) * 0.105); }
.oa-create-arc a:nth-of-type(2) { --ax: calc(var(--arc-r) * -0.669); --ay: calc(var(--arc-r) * 0.743); }
.oa-create-arc a:nth-of-type(3) { --ax: 0px; --ay: var(--arc-r); }
.oa-create-arc a:nth-of-type(4) { --ax: calc(var(--arc-r) * 0.669); --ay: calc(var(--arc-r) * 0.743); }
.oa-create-arc a:nth-of-type(5) { --ax: calc(var(--arc-r) * 0.995); --ay: calc(var(--arc-r) * 0.105); }

.bottom-sheet {
  background: var(--oa-panel-2) !important;
  border-color: var(--oa-border) !important;
  color: var(--oa-text);
}

/* Tools 2-col cards */
.tools-2col,
.tool-catalog.tools-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
}
.tool-touch-card,
.create-hub-card {
  border-radius: 16px !important;
  overflow: hidden;
  background: var(--oa-elev-2) !important;
  border: 1px solid var(--oa-border) !important;
  min-height: 118px;
  padding: 12px !important;
  color: var(--oa-text);
}

/* Assets */
.asset-empty { text-align: center; padding: 60px 20px; }
.asset-empty-icon {
  width: 84px;
  height: 84px;
  margin: 0 auto 16px;
  border-radius: 22px;
  background: linear-gradient(145deg, var(--oa-pink-2), #c2185b);
  display: grid;
  place-items: center;
  font-size: 34px;
}
.asset-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--oa-border);
  margin-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}
.asset-tab {
  padding: 12px 14px;
  white-space: nowrap;
  color: var(--oa-muted);
  font-weight: 600;
  font-size: 13px;
  border-bottom: 2px solid transparent;
}
.asset-tab.is-active {
  color: var(--oa-text);
  border-bottom-color: var(--oa-pink);
}

.site-footer { display: none; }

@media (max-width: 1200px) {
  .oa-feed-row { grid-template-columns: 1fr 1fr 1fr; }
  .oa-feed-row > :nth-child(4) { display: none; }
}

@media (max-width: 1100px) {
  .oa-masonry { columns: 3 180px; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .oa-home { padding-top: 12px; }
  .oa-home-title {
    font-size: 1.45rem;
    margin-bottom: 16px;
    text-align: left;
  }
  .oa-mode-bar {
    width: 100%;
    max-width: 100%;
    margin-bottom: 18px;
    padding: 5px;
    gap: 2px;
    border-radius: 16px;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: none;
  }
  .oa-mode-bar::-webkit-scrollbar { display: none; }
  .oa-mode-bar a {
    scroll-snap-align: start;
    padding: 8px 11px;
    gap: 5px;
    font-size: 12px;
  }
  .oa-mode-bar .nav-ico { width: 15px; height: 15px; }
  .oa-badge-new {
    font-size: 7px;
    padding: 1px 4px;
  }
  .oa-promo-row { grid-auto-columns: minmax(76%, 1fr); }
  .oa-feed-row {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(76%, 1fr);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .oa-feed-row::-webkit-scrollbar { display: none; }
  .oa-feed-row > * { scroll-snap-align: start; display: flex !important; }
  .oa-masonry { columns: 2 140px; }
  .oa-pricing { grid-template-columns: minmax(0, 1fr); }
  .studio-v2.studio-layout {
    grid-template-columns: minmax(0, 1fr) !important;
    border: 0;
    border-radius: 0;
    min-height: 0 !important;
  }
  .studio-v2 .studio-panel,
  .studio-v2 .canvas-panel {
    max-height: none;
    min-height: 0 !important;
  }
  .studio-v2 .studio-panel { border-right: 0; }
  .mob-root .mob-field { margin-bottom: 10px; }
  .mob-root .mob-field[hidden] { display: none !important; margin: 0 !important; padding: 0 !important; }
  body.is-studio .oa-mode-dock { display: none; }
  .content {
    padding:
      14px
      max(12px, env(safe-area-inset-right, 0px))
      calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px) + 20px)
      max(12px, env(safe-area-inset-left, 0px)) !important;
  }
  .section-block { margin-bottom: 24px; }

  .char-studio__grid { grid-template-columns: 1fr !important; }
  .char-studio__form { position: static; }
  .char-studio__split { grid-template-columns: 1fr !important; }
  .page-subscription .oa-pricing,
  .oa-pricing { grid-template-columns: 1fr !important; }
  .oa-pricing-head { text-align: left; }
  .sidebar-theme-row .theme-toggle { width: 32px; height: 32px; }
  .card-grid,
  .promo-grid,
  .models-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* Character studio */
.char-studio { max-width: 1120px; margin: 0 auto; }
.char-studio__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.char-studio__head h1 {
  margin: 0 0 4px;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-family: var(--display);
}
.char-studio__grid {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.char-studio__form {
  padding: 18px;
  border-radius: 18px;
  position: sticky;
  top: 72px;
}
.char-studio__form h2,
.char-studio__list-head h2 {
  margin: 0 0 14px;
  font-size: 1rem;
}
.char-studio__split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.char-studio__list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.char-studio__empty {
  padding: 28px 20px;
  text-align: center;
  border-radius: 16px;
}
.char-studio__empty strong { display: block; margin-bottom: 6px; }
.char-studio__result { margin-top: 14px; }
.btn-block { width: 100%; justify-content: center; }
.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.char-card {
  display: flex;
  gap: 12px;
  padding: 14px !important;
  border-radius: 16px !important;
}
.char-card__avatar {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: linear-gradient(135deg, var(--oa-pink), #8b5cf6);
  color: #fff;
}
.char-card__body { min-width: 0; flex: 1; }
.char-card__body strong { display: block; margin-bottom: 4px; }
.char-card__body p { margin: 0 0 10px; font-size: 13px; }
.char-card__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.char-studio .dropzone {
  border: 1px dashed var(--oa-border-strong);
  border-radius: 14px;
  padding: 18px 14px;
  text-align: center;
  background: var(--oa-elev);
  color: var(--oa-text);
}
.char-studio .dropzone p { margin: 0 0 4px; font-weight: 600; }
.char-studio .dropzone input[type="file"] {
  margin-top: 10px;
  width: 100%;
  font-size: 12px;
}

@media (min-width: 901px) {
  #createSheet.bottom-sheet {
    background: var(--oa-panel-2) !important;
    border: 1px solid var(--oa-border) !important;
  }
  #createSheet .bottom-sheet__head { display: flex !important; }
  /* The arc is a thumb-reach affordance for phones. Desktop uses the full grid below it,
     which is the only place that still lists every mode. */
  .oa-create-arc { display: none !important; }
}

/* —— Cross-phone layout lock (iOS Safari + Android Chrome) —— */
@media (max-width: 900px) {
  html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
    overscroll-behavior-y: none;
  }
  .app-shell,
  .main,
  .content {
    min-width: 0;
    max-width: 100%;
  }
  img, video, canvas, svg {
    max-width: 100%;
    height: auto;
  }
  button, a, input, select, textarea {
    -webkit-tap-highlight-color: transparent;
  }
  /* Prevent iOS from inflating text differently than Android. */
  .oa-mode-bar,
  .mobile-nav,
  .mobile-topbar,
  .oa-home-title,
  .promo-card,
  .oa-plan {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
  /* Same sticky chrome math on every device. */
  .mobile-topbar {
    width: 100%;
    max-width: 100vw;
  }
  .mobile-nav {
    width: 100%;
    max-width: 100vw;
    left: 0;
    right: 0;
  }
}

/* ————————————————————————— Brand wordmark —————————————————————————— */
/* The front-end shows the platform name only; the square symbol was overpowering the
   top bar and the drawer on phones. */
.brand.is-wordmark {
  padding: 4px 2px !important;
  gap: 0;
}
.brand.is-wordmark .brand-text strong { font-size: 1.15rem; }
.mobile-logo.is-wordmark strong {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
/* A blanket `img { height: auto }` follows in the mobile block below, which would let an
   uploaded logo render at its natural size. Anywhere a logo image is still used, cap it. */
.brand-logo {
  height: 32px !important;
  width: auto !important;
  max-width: 132px !important;
  object-fit: contain;
}
.brand-logo.sm { height: 26px !important; max-width: 104px !important; }

/* ——————————————————— Chrome layout hardening ———————————————————— */
/*
 * `.topbar` is sticky inside `.main`, so any page that overflows horizontally drags the
 * bar's right edge past the viewport and the profile avatar becomes unreachable. Clipping
 * the shell keeps the bar the same width as the screen on every page.
 */
.app-shell,
.main {
  min-width: 0;
  max-width: 100%;
}
.main { overflow-x: clip; }
.content { max-width: 100%; }

.topbar-actions {
  flex-wrap: nowrap;
  flex-shrink: 0;
}
.topbar-actions > * { flex-shrink: 0; }

/* A single round sun/moon switch. Never let it collapse into a sliver. */
.theme-toggle {
  flex: 0 0 auto !important;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  background: var(--oa-elev-2) !important;
  border: 1px solid var(--oa-border) !important;
  color: var(--oa-text) !important;
}
.theme-toggle:hover {
  border-color: var(--oa-pink) !important;
  color: var(--oa-pink) !important;
}
.theme-toggle__icon { width: 18px; height: 18px; flex: 0 0 auto; }
.theme-toggle__sun,
.theme-toggle__moon { width: 18px; height: 18px; }

/* Keep the avatar and its menu above the sidebar (z-index 40) and page content. */
.profile-dropdown { position: relative; z-index: 60; }
.profile-dropdown .dropdown-menu { z-index: 61; }

/* Last resort before the row would overflow on the narrowest desktop widths. */
@media (max-width: 980px) {
  .desktop-topbar .oa-top-link { display: none; }
}

@media (max-width: 900px) {
  /* The drawer has to sit above its own backdrop (z-index 70). */
  .app-shell .sidebar { z-index: 75; }
  .mobile-topbar { z-index: 50; }

  /* Chrome height tracks the screen so 5" phones and 7" tablets both get a bar that is
     proportional instead of a fixed 56px strip. */
  :root {
    --mobile-topbar-h: clamp(52px, 13vw, 64px);
    --mobile-nav-h: clamp(58px, 15vw, 72px);
  }
  .mobile-topbar .mobile-logo strong { font-size: clamp(0.9rem, 3.6vw, 1.1rem); }
  .mobile-nav a { font-size: clamp(9px, 2.6vw, 11px); }
  .create-orb {
    width: clamp(42px, 11vw, 52px);
    height: clamp(42px, 11vw, 52px);
  }
}

/* —————————————————————— Billing / manage subscription —————————————————————— */
.billing-page { max-width: 1140px; margin: 0 auto; }
.billing-page .oa-plan form { margin: 0; }
.billing-page .oa-plan { gap: 14px; }
.billing-page .oa-plan__cta { margin-top: auto; }
.billing-page .oa-plan.is-current { border-color: color-mix(in srgb, var(--oa-lime) 60%, transparent); }
.billing-page .oa-plan__cta[disabled] {
  background: var(--oa-elev-2);
  color: var(--oa-muted);
  border: 1px solid var(--oa-border);
  cursor: default;
}

.billing-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.billing-head h1 {
  margin: 0 0 6px;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  letter-spacing: -0.03em;
  color: var(--oa-text);
}
.billing-head p { margin: 0; max-width: 640px; font-size: 13.5px; }
.billing-head > .btn { flex-shrink: 0; white-space: nowrap; }

.billing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding: 22px;
  border-radius: 20px;
  border: 1px solid var(--oa-border);
  background:
    radial-gradient(600px 240px at 0% 0%, color-mix(in srgb, var(--oa-pink) 14%, transparent), transparent 70%),
    var(--oa-panel-2);
  margin-bottom: 34px;
}
.billing-kicker {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--oa-muted);
  margin-bottom: 6px;
}
.billing-hero__main h2 {
  margin: 0 0 10px;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--oa-text);
}
.billing-hero__price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0 0 12px;
}
.billing-hero__price b {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--oa-text);
}

.billing-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid var(--oa-border);
  color: var(--oa-muted);
  text-transform: capitalize;
}
.billing-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.billing-pill.is-active {
  color: var(--oa-green);
  border-color: color-mix(in srgb, var(--oa-green) 45%, transparent);
  background: color-mix(in srgb, var(--oa-green) 12%, transparent);
}
.billing-pill.is-trial {
  color: var(--oa-lime);
  border-color: color-mix(in srgb, var(--oa-lime) 45%, transparent);
  background: color-mix(in srgb, var(--oa-lime) 12%, transparent);
}
.billing-pill.is-warn {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.12);
}
.billing-pill.is-ended {
  color: var(--oa-faint);
  background: var(--oa-elev-2);
}

.billing-facts {
  display: grid;
  gap: 12px;
  margin: 0;
}
.billing-facts dt {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--oa-faint);
  margin-bottom: 2px;
}
.billing-facts dd {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--oa-text);
}

.billing-hero__actions {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--oa-border);
  background: var(--oa-elev-2);
}
.billing-cycle__label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--oa-faint);
  margin-bottom: 6px;
}
.billing-cycle__row {
  display: flex;
  gap: 8px;
}
.billing-cycle__row select {
  flex: 1;
  min-width: 0;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--oa-border);
  background: var(--oa-panel-2);
  color: var(--oa-text);
}
.billing-hero__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.billing-hero__buttons form { margin: 0; flex: 1 1 130px; }
.billing-hero__buttons .btn { width: 100%; }
.billing-danger { color: #ef4444 !important; }
.billing-danger:hover { border-color: rgba(239, 68, 68, 0.5) !important; }

.billing-empty {
  padding: 26px 22px;
  border-radius: 20px;
  border: 1px dashed var(--oa-border-strong);
  background: var(--oa-panel-2);
  text-align: center;
  margin-bottom: 34px;
}
.billing-empty strong { display: block; margin-bottom: 6px; font-size: 1.05rem; color: var(--oa-text); }
.billing-empty p { margin: 0 0 14px; }

.billing-section { margin-bottom: 34px; }
.billing-section__head { margin-bottom: 16px; }
.billing-section__head h2 {
  margin: 0 0 4px;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--oa-text);
}
.billing-section__head p { margin: 0; font-size: 13px; }
.billing-invoices { padding: 0 !important; overflow: hidden; }
.billing-invoices .table-wrap { border: 0; border-radius: 0; background: transparent; }

@media (max-width: 900px) {
  .billing-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  .billing-head { flex-direction: column; }
}

/* Tablets and 7" phones: the phone chrome stays, but stop stretching content edge to edge. */
@media (min-width: 601px) and (max-width: 900px) {
  .content { max-width: 720px; margin-inline: auto; }
  .oa-create-arc { --arc-w: 400px; }
  .mobile-nav { padding-inline: max(12px, calc((100vw - 560px) / 2)) !important; }
  .page-subscription .oa-pricing,
  .billing-page .oa-pricing { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .card-grid,
  .promo-grid,
  .models-grid,
  .tool-cover-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
