@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700;800&display=swap');

/* Public client only. The editor and CMS use their own stylesheets. */
:root {
  color-scheme: light;
  --bg: #f7f4ec;
  --surface: #fffdf7;
  --surface-soft: #eee9dc;
  --ink: #34372f;
  --ink-soft: #5f6155;
  --muted: #7c7c6d;
  --line: #e2ddce;
  --line-strong: #c8c1ab;
  --brand-blue: #3d6874;
  --brand-royal: #3d6874;
  --brand-cyan: #577a78;
  --action: #355f64;
  --action-hover: #284c51;
  --danger: #ac4d43;
  --shadow-sm: 0 2px 5px #51462e07;
  --shadow-card: 0 5px 20px #51462e08;
  --font-sans: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

:root[data-theme=dark] {
  color-scheme: dark;
  --bg: #1d211e;
  --surface: #262c27;
  --surface-soft: #303830;
  --ink: #f1eddf;
  --ink-soft: #cfcebf;
  --muted: #aaaf9e;
  --line: #3b453c;
  --line-strong: #5b695a;
  --brand-blue: #a6c4bd;
  --brand-royal: #a6c4bd;
  --action: #426d65;
  --action-hover: #507f75;
  --danger: #eea494;
  --shadow-card: none;
}

* { box-sizing: border-box; }
html { scrollbar-gutter: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.6 var(--font-sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
[hidden] { display: none !important; }
button { color: inherit; }
button, a, input, textarea, select, summary { outline-offset: 3px; }
:focus-visible { outline: 2px solid var(--brand-royal); }
button, a { transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease; }
img { max-width: 100%; }
svg.icon, .icon { display: block; width: 18px; height: 18px; flex-shrink: 0; vertical-align: middle; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--ink); line-height: 1.3; }
h1 { font-size: 32px; font-weight: 600; letter-spacing: -.7px; }
h2 { font-size: 22px; font-weight: 600; letter-spacing: -.4px; }
h3 { font-size: 15px; font-weight: 600; }

/* Shell, Topbar & Floating Navigation Rail */
.shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 15px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.wordmark { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.brand-mark { display: block; width: 40px; height: 36px; flex-shrink: 0; background: url('/portal-assets/media/adforge-jade-icon-v1.png') center / contain no-repeat; }
.wordmark-text { font-size: 22px; font-weight: 800; letter-spacing: -1px; color: var(--action); }
:root[data-theme=dark] .wordmark-text,
:root[data-theme=dark] .brand-mark { color: var(--brand-royal); }

.header-context {
  display: block;
  margin-right: auto;
  padding-left: 20px;
  border-left: 1px solid var(--line);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--muted);
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.credit-balance,
.header-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 1.3;
  white-space: nowrap;
}

.credit-balance {
  gap: 7px;
  padding: 0 12px;
  background: var(--surface-soft);
}
.credit-balance:hover { border-color: var(--line-strong); }
.credit-balance .account-plan {
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-soft);
}
.credit-balance .credit-amount {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.credit-balance .icon { width: 14px; height: 14px; color: var(--action); }

.theme-button {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-soft);
}
.theme-button:hover { background: var(--surface-soft); border-color: var(--line-strong); color: var(--ink); }
.theme-button .icon { width: 16px; height: 16px; }

.header-pill {
  gap: 6px;
  padding: 0 13px;
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
}
.header-pill:hover { background: var(--surface-soft); border-color: var(--line-strong); }

.avatar-menu-wrap { position: relative; display: flex; align-items: center; }
.avatar-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}
.avatar-button:hover { border-color: var(--line-strong); }

body:is([data-page=login],[data-page=register]) .top-actions .header-pill { display: none; }

/* Desktop/Tablet Floating Icon Rail (uniform 6px spacing, 36x36 square buttons) */
.client-sidebar {
  position: fixed;
  inset: 91px auto auto 16px;
  z-index: 95;
  width: 50px;
  height: auto;
  max-height: calc(100svh - 113px);
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: visible;
}

#rail-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin: 0;
}

#rail-nav > a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 8px;
  color: var(--ink-soft);
}
#rail-nav > a:hover { background: var(--surface-soft); color: var(--ink); }
#rail-nav > a.active { background: var(--surface-soft); color: var(--action); font-weight: 600; }
#rail-nav > a > .icon { display: block; width: 18px; height: 18px; flex: 0 0 18px; }
#rail-nav > a > span {
  position: absolute;
  left: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease;
}
#rail-nav > a:hover > span,
#rail-nav > a:focus-visible > span { opacity: 1; }

/* Continuous Horizontal Container (never overlaps rail, zero breakpoint jump) */
main,
footer {
  width: min(1160px, calc(100% - 122px));
  max-width: 1160px;
  margin-left: max(94px, calc((100% - min(1160px, calc(100% - 122px))) / 2));
  margin-right: auto;
}

main {
  flex: 1;
  min-width: 0;
  padding: 44px 0 72px;
}
main:focus { outline: none; }

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}
.footer-links { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
footer button { padding: 0; border: 0; background: none; color: var(--muted); font-size: 11px; }
footer a:hover, footer button:hover { color: var(--ink); }
.rail-help .icon { display: none; }

/* User Account Popover */
.user-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 120;
  width: 296px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 40px #10182820;
}
.pop-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 0 12px;
  border-bottom: 1px solid var(--line);
}
.pop-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--brand-royal);
  font-size: 13px;
  font-weight: 600;
}
.pop-header strong { display: block; font-size: 12px; line-height: 1.4; }
.pop-header p { font-size: 11px; color: var(--muted); margin: 2px 0 0; word-break: break-word; line-height: 1.4; }
.pop-signin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 38px;
  margin: 12px 0 8px;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--action);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}
.pop-signin-btn:hover { background: var(--action-hover); }
.pop-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  margin-bottom: 4px;
  border-radius: 7px;
  background: var(--surface-soft);
  font-size: 11px;
  color: var(--muted);
}
.pop-balance-box {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.pop-balance-box strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.pop-balance-box .icon { width: 15px; height: 15px; color: var(--action); }
.pop-links { display: grid; gap: 2px; }
.pop-row-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--ink-soft);
  font-size: 12px;
  text-align: left;
}
.pop-row-btn:hover { background: var(--surface-soft); color: var(--ink); }
.pop-row-btn b { font-weight: 400; color: var(--muted); }
.pop-row-btn.is-danger { color: var(--danger); }
.pop-row-btn.is-danger:hover { color: var(--danger); }

/* Unified Buttons & Links */
.primary,
.secondary,
.auth-submit,
.bundle-buy-btn,
.tier-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}
.primary .icon,
.secondary .icon { width: 16px; height: 16px; }
.primary > span,
.secondary > span { display: block; line-height: 1.4; }

.primary,
.auth-submit,
.tier-cta.is-dark {
  background: var(--action);
  border-color: var(--action);
  color: #fff;
}
.primary:hover,
.auth-submit:hover,
.tier-cta.is-dark:hover {
  background: var(--action-hover);
  border-color: var(--action-hover);
  color: #fff;
}

.secondary,
.tier-cta,
.bundle-buy-btn {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}
.secondary:hover,
.tier-cta:hover,
.bundle-buy-btn:hover {
  background: var(--surface-soft);
  border-color: var(--muted);
  color: var(--ink);
}

.text-link,
.read-more { color: var(--brand-royal); font-size: 12px; font-weight: 600; }
.text-link:hover,
.read-more:hover { text-decoration: underline; text-underline-offset: 4px; }
button.text-link { padding: 0; border: 0; background: none; }

.hero-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  line-height: 1.5;
  margin-bottom: 10px;
}
.muted { color: var(--muted); }

/* Unified Page Headers & Section Headers Across All Pages */
.page-title {
  position: relative;
  margin-bottom: 28px;
  max-width: 900px;
}
.page-title > .eyebrow { display: none; }
.page-title h1,
.projects-heading h1 {
  margin: 0 0 8px;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.7px;
}
.page-title p,
.projects-heading p {
  margin: 0;
  color: var(--muted);
  max-width: 620px;
  font-size: 13px;
  line-height: 1.65;
}
.page-title > .primary { margin-top: 20px; }

.projects-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.projects-heading > .primary { flex-shrink: 0; }

@media (min-width: 1200px) {
  .page-title:has(> .primary) { max-width: none; padding-right: 210px; }
  .page-title > .primary { position: absolute; right: 0; bottom: 0; margin: 0; }
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 22px;
}
.section-header h2 { margin: 0 0 4px; }
.section-header span { font-size: 12px; color: var(--muted); }
.section-header .eyebrow { font-size: 10px; }

/* Unified Form Inputs & Selects */
input:not([type=checkbox]):not([type=radio]),
textarea,
select {
  width: 100%;
  min-width: 0;
  min-height: 43px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
}
select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237c7c6d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 14px 14px;
  cursor: pointer;
}
:root[data-theme=dark] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23aaaf9e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
input::placeholder,
textarea::placeholder { color: var(--muted); opacity: .8; }
input:focus,
textarea:focus,
select:focus { border-color: var(--brand-royal); }
textarea { min-height: 120px; resize: vertical; }
label { display: block; font-size: 12px; font-weight: 600; margin: 16px 0 7px; }
input[type=checkbox],
input[type=radio] { accent-color: var(--action); }

/* Unified Segmented Tab Switches (.pricing-tabs, .library-switch, .help-tabs) */
.pricing-tabs,
.library-switch,
.help-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  padding: 4px;
  margin: 0 0 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}
.pricing-tabs button,
.library-switch > button,
.help-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}
.pricing-tabs button:hover,
.library-switch > button:hover,
.help-tabs a:hover { color: var(--ink); }
.pricing-tabs button.active,
.library-switch > button.active,
.help-tabs a[aria-current] {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.library-switch .icon { width: 14px; height: 14px; }
.saved-count {
  display: grid;
  place-items: center;
  min-width: 19px;
  height: 18px;
  padding: 0 5px;
  background: var(--surface-soft);
  border-radius: 5px;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

/* Unified Filter & Search Toolbars (/projects, /gallery, /history) */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-right: auto;
}
.filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}
.filter:hover { background: var(--surface-soft); color: var(--ink); }
.filter.active {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
  font-weight: 600;
}
.toolbar input { width: 240px !important; }
.toolbar select { width: auto; min-width: 140px; }
.toolbar > .secondary { margin-left: auto; }

.project-toolbar input { flex: 0 1 320px; width: auto !important; }
.project-toolbar select { min-width: 150px; }
.project-toolbar #project-results { margin-left: auto; color: var(--muted); font-size: 12px; }
.project-view-switch {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}
.project-view-switch button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 33px;
  padding: 6px 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.project-view-switch button:hover { color: var(--ink); }
.project-view-switch button[aria-pressed=true] {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.project-view-switch .icon { width: 15px; height: 15px; }

/* Home Page */
body[data-page=home] main { padding-top: 0; }
.home-hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 56px;
  align-items: center;
  padding: 44px 0 48px;
}
.home-intro > .eyebrow { font-size: 10px; letter-spacing: 1.3px; margin-bottom: 18px; }
.home-intro h1 {
  font-family: var(--font-sans);
  font-size: clamp(35px, 3.5vw, 48px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.9px;
  margin: 0 0 20px;
}
.home-intro h1 span { color: var(--ink-soft); }
.home-intro > p {
  font-size: 14px;
  line-height: 1.85;
  color: var(--muted);
  max-width: 460px;
  margin: 0 0 26px;
}
.home-tools { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 24px; }
.home-tools span,
.home-tools a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  transition: color .15s ease;
}
.home-tools a:hover { color: var(--brand-royal); text-decoration: underline; text-underline-offset: 4px; }
.home-tools .icon { width: 14px; height: 14px; }

.home-artboard {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 16px;
  box-shadow: var(--shadow-card);
}
.home-board-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 2px 14px;
  font-size: 12px;
}
.home-board-heading > span { display: flex; gap: 7px; align-items: center; font-weight: 600; }
.home-board-heading .icon { width: 15px; height: 15px; }
.home-board-heading small { font-size: 10px; color: var(--muted); }
.home-board-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.home-art-tile {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  justify-items: center;
  gap: 6px;
  width: 100%;
  height: 185px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--surface-soft);
}
.home-art-tile img { width: 100%; height: 140px; object-fit: contain; image-rendering: auto; }
.home-art-tile > span { font-size: 10px; color: var(--muted); }
.home-art-tile:hover { border-color: var(--line-strong); }
.tile-1 { background: color-mix(in srgb, #d4dbbe 19%, var(--surface-soft)); }
.tile-2 { background: color-mix(in srgb, #ced6cf 18%, var(--surface-soft)); }
.tile-3 { background: color-mix(in srgb, #e3d3ba 20%, var(--surface-soft)); }
.home-slide-controls { display: none; }

/* Recent Workspace Card (Home) */
.recent-projects-section { margin-bottom: 48px; }
.recent-workspace {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.recent-workspace .section-header { margin-bottom: 18px; }
.recent-workspace h2 { font-size: 20px; }
.recent-workspace .section-header span { font-size: 12px; }
.recent-project-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.recent-project-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}
.recent-project-row:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.recent-project-icon {
  display: grid;
  place-items: center;
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: var(--surface-soft);
  overflow: hidden;
}
.recent-project-icon img { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.recent-project-icon > span { font-size: 18px; font-weight: 600; color: var(--brand-royal); letter-spacing: -.6px; }
.recent-project-icon.is-map .icon { width: 22px; height: 22px; color: var(--brand-royal); }
.recent-workspace-links { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.recent-project-copy { min-width: 0; display: grid; gap: 4px; }
.recent-project-copy strong { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-project-copy small { font-size: 11px; color: var(--muted); }
.recent-resume {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  margin-left: auto;
  border-radius: 50%;
  color: var(--muted);
  font-size: 15px;
}
.recent-empty { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.recent-empty > span { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.recent-empty-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.create-mode-switch { margin: 14px 0 4px; }

/* Home Studio Launcher Cards */
.home-studios {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 36px;
}
.home-studio-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.home-studio-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-card); }
.home-studio-head { display: flex; align-items: center; gap: 14px; }
.home-studio-glyph {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--brand-royal);
}
.home-studio-glyph .icon { width: 20px; height: 20px; }
.home-studio-head .eyebrow { margin: 0 0 3px; font-size: 9px; letter-spacing: 1.1px; }
.home-studio-head h2 { font-size: 17px; font-weight: 600; letter-spacing: -.3px; margin: 0; }
.home-studio-head h2 a:hover { color: var(--brand-royal); }
.home-studio-card > p { font-size: 12.5px; color: var(--muted); line-height: 1.75; margin: 0; }
.home-studio-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 6px;
}

/* Home Sections: Capabilities, News, Showcase, Help */
.home-capabilities {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  padding: 36px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.home-capabilities > div { display: flex; align-items: flex-start; gap: 12px; }
.home-capabilities > .icon,
.home-capabilities > div > .icon { margin-top: 2px; color: var(--brand-royal); width: 20px; height: 20px; }
.home-capabilities h2 { font-size: 14px; letter-spacing: 0; margin: 0 0 6px; }
.home-capabilities p { font-size: 12px; color: var(--muted); line-height: 1.75; margin: 0; }

.home-news,
.home-showcase { padding-top: 48px; }
.home-news h2,
.home-showcase h2,
.home-help h2 {
  font-family: var(--font-sans);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -.6px;
}

.home-news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.home-news-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  min-width: 0;
  padding: 0;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.home-news-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-card); }
.home-news-art {
  flex-shrink: 0;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  height: 210px;
  padding: 14px;
  background: var(--surface-soft);
  overflow: hidden;
}
.home-news-art img { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; }
.home-news-copy { display: flex; flex-direction: column; align-items: flex-start; flex: 1; padding: 20px; }
.home-news-copy h3 { font-size: 16px; line-height: 1.5; margin: 6px 0 8px; }
.home-news-copy p { font-size: 12px; color: var(--muted); line-height: 1.75; margin: 0 0 16px; }
.home-news-copy .text-link { font-size: 12px; margin-top: auto; }

.home-sample-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.home-sample-card { min-width: 0; border: 0; background: none; padding: 0; text-align: left; }
.home-sample-card > div {
  height: 170px;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  overflow: hidden;
}
.home-sample-card:hover > div { border-color: var(--line-strong); box-shadow: var(--shadow-card); }
.home-sample-card img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; max-width: 100%; max-height: 100%; object-fit: contain; }
.home-sample-card h3 { font-size: 12px; line-height: 1.5; margin: 3px 0 0; font-weight: 600; }
.home-sample-card .category { font-size: 10px; }

.home-help {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 64px;
  margin-top: 48px;
  padding: 48px 0 0;
  border-top: 1px solid var(--line);
}
.home-help h2 { margin-bottom: 12px; }
.home-help > div > p { color: var(--muted); font-size: 13px; line-height: 1.8; margin: 0 0 18px; }
.home-help-questions details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.home-help-questions details:first-child { padding-top: 2px; }
.home-help-questions summary { font-size: 13px; font-weight: 600; line-height: 1.6; }
.home-help-questions p { color: var(--muted); font-size: 12px; line-height: 1.85; margin: 10px 0 0; }
.home-help-questions a { color: var(--brand-royal); text-decoration: underline; text-underline-offset: 3px; }

/* Projects Grid & List Views */
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.project-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.project-item:hover { border-color: var(--line-strong); box-shadow: var(--shadow-card); }
.project-item > a { display: flex; flex-direction: column; height: 100%; }
.project-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 168px;
  min-width: 0;
  padding: 20px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.project-preview img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; image-rendering: pixelated; }
.project-monogram {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -1px;
  color: var(--brand-royal);
  background: var(--surface);
}
.project-preview > small { font-size: 10px; color: var(--muted); }
.project-item-copy { display: flex; flex-direction: column; flex: 1; padding: 18px; min-width: 0; }
.project-item-copy h2 { font-size: 16px; font-weight: 600; letter-spacing: -.3px; margin: 0 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-item-copy p { font-size: 11px; color: var(--muted); margin: 0 0 16px; }
.project-open {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-royal);
}
.project-open .icon { width: 14px; height: 14px; }
#project-load-note { font-size: 12px; margin-top: 20px; }

.project-grid[data-view=list] { grid-template-columns: 1fr; gap: 10px; }
.project-grid[data-view=list] .project-item > a { display: grid; grid-template-columns: 82px minmax(0, 1fr); align-items: stretch; }
.project-grid[data-view=list] .project-preview { height: 82px; min-height: 82px; padding: 12px; border-bottom: 0; border-right: 1px solid var(--line); }
.project-grid[data-view=list] .project-preview img { width: 100%; height: 58px; }
.project-grid[data-view=list] .project-preview > small { display: none; }
.project-grid[data-view=list] .project-monogram { width: 44px; height: 44px; border-radius: 10px; font-size: 20px; }
.project-grid[data-view=list] .project-item-copy { display: grid; grid-template-columns: minmax(0, 1fr) 150px 120px; align-items: center; gap: 20px; padding: 16px 22px; }
.project-grid[data-view=list] .project-item-copy h2,
.project-grid[data-view=list] .project-item-copy p { margin: 0; }
.project-grid[data-view=list] .project-open { margin-top: 0; border: 0; padding: 0; justify-content: flex-end; gap: 8px; }

/* Showcase / Gallery */
.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.work {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.work:hover { border-color: var(--line-strong); box-shadow: var(--shadow-card); }
.work .preview {
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  width: 100%;
  height: 216px;
  padding: 20px;
  border: 0;
  background: var(--surface-soft);
  overflow: hidden;
}
.work .preview img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; max-width: 100%; max-height: 100%; object-fit: contain; image-rendering: auto; }
.work .preview > svg { width: 65%; height: 65%; }
.work .copy { padding: 16px; }
.work h3 { margin: 5px 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category { font-size: 10px; color: var(--muted); font-weight: 500; }
.work small { font-size: 11px; color: var(--muted); }
.favorite {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
}
.favorite:hover { border-color: var(--line-strong); color: var(--ink); }
.favorite .icon { width: 15px; height: 15px; }
.favorite.saved { color: #d99100; }
.favorite.saved .icon { fill: #d9910020; }

/* Empty States */
.empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  padding: 44px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  text-align: center;
}
.empty > .icon { width: 30px; height: 30px; color: var(--muted); margin-bottom: 18px; }
.empty h2 { font-size: 21px; margin-bottom: 8px; }
.empty p { font-size: 13px; color: var(--muted); max-width: 420px; margin: 0 0 22px; }
.empty .text-link { margin-top: 14px; }
.account-empty { min-height: 360px; }

/* Pricing Page */
.tiers-grid,
.bundles-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.tier-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 24px 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.tier-card:hover,
.bundle-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-card); }
.tier-card.is-popular { border-color: var(--brand-royal); }
.tier-card h2 { font-size: 20px; margin: 0 0 16px; }
.tier-price { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.tier-price strong { font-size: 26px; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.tier-price span { font-size: 11px; color: var(--muted); }
.tier-card small { font-size: 11px; color: var(--muted); }
.tier-features {
  padding: 18px 0 20px 18px;
  margin: 18px 0 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.75;
}
.tier-features li { margin-bottom: 8px; }
.tier-cta { width: 100%; margin-top: auto; }
.popular-ribbon {
  position: absolute;
  top: -11px;
  right: 16px;
  padding: 3px 10px;
  background: var(--action);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  border-radius: 6px;
}

.bundles-section { margin-top: 48px; }
.bundle-card {
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.bundle-tokens { font-size: 13px; color: var(--muted); }
.bundle-tokens strong { font-size: 24px; color: var(--ink); font-variant-numeric: tabular-nums; }
.bundle-price { display: block; font-size: 18px; font-weight: 600; margin: 8px 0 18px; font-variant-numeric: tabular-nums; }
.bundle-buy-btn { width: 100%; margin-top: auto; }

/* Unified Bottom Support / CTA Cards (.pricing-help & .faq-contact) */
.pricing-help,
.faq-contact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  margin: 36px 0 0;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.pricing-help h2,
.faq-contact h2 { font-size: 17px; margin: 0 0 4px; }
.pricing-help p,
.faq-contact p { font-size: 12px; color: var(--muted); margin: 0; line-height: 1.7; }
.pricing-help-actions,
.faq-contact > div:last-child { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.faq-contact > a:last-child { flex-shrink: 0; }

/* FAQ Sections (Left-aligned across Pricing & Help) */
.faq { width: 100%; max-width: none; margin: 48px 0 0; }
.faq h2 { font-size: 22px; margin-bottom: 16px; }
.faq details,
.faq-group details { padding: 17px 0; border-bottom: 1px solid var(--line); }
.faq summary,
.faq-group summary { font-size: 13px; font-weight: 600; line-height: 1.6; }
.faq details p,
.faq-group details p {
  max-width: 780px;
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.85;
}

/* Guides & History */
.faq-page { width: 100%; max-width: none; margin: 0; }
.guides-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.guide {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.guide h2 { font-size: 17px; margin: 10px 0; }
.guide p { font-size: 12px; color: var(--ink-soft); line-height: 1.8; margin: 0; }
.guide .eyebrow { color: var(--brand-royal); margin-bottom: 8px; }
.guide small { font-size: 11px; }
.tutorials-actions { margin-top: 24px; }

.positive { color: #16845d; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.negative { color: var(--ink); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.history-section { width: 100%; max-width: none; }
#transactions { display: grid; gap: 10px; }
.history-section .guide {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
}
.history-section .guide p { margin: 0; }

.faq-group { margin: 28px 0; }
.faq-group > h2 { margin: 0 0 4px; font-size: 18px; }
.legal-note { margin: 22px 0 0; color: var(--muted); font-size: 11px; line-height: 1.8; }

/* Feed / News Page & News Reader Modal */
.feed-feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, .72fr);
  align-items: center;
  gap: 28px;
  padding: 26px;
  margin-bottom: 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.feed-feature h2 { font-size: 23px; margin: 0 0 10px; }
.feed-feature p { max-width: 540px; color: var(--ink-soft); font-size: 13px; line-height: 1.8; margin: 0 0 18px; }
.feed-feature > img {
  display: block;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 260px;
  max-height: 260px;
  object-fit: contain;
  border-radius: 10px;
  background: var(--surface-soft);
}

.news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.news-card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.news-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-card); }
.news-open { display: flex; flex-direction: column; align-items: stretch; width: 100%; height: 100%; padding: 0; border: 0; text-align: left; background: transparent; }
.news-poster-frame {
  flex-shrink: 0;
  height: 220px;
  background: var(--surface-soft);
  padding: 16px;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  overflow: hidden;
}
.news-poster-frame img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; max-width: 100%; max-height: 100%; object-fit: contain; }
.news-copy { display: flex; flex-direction: column; align-items: flex-start; flex: 1; padding: 22px; }
.news-copy h3 { font-size: 17px; line-height: 1.5; margin: 2px 0 8px; }
.news-copy p { color: var(--muted); font-size: 12px; line-height: 1.8; margin: 0 0 16px; }
.news-copy .read-more { margin-top: auto; }

/* Terms Page */
.terms-container { width: 100%; max-width: none; margin: 0; }
.terms-container > .eyebrow { margin-bottom: 14px; }
.terms-container h1 { font-size: 32px; font-weight: 600; letter-spacing: -.7px; margin: 0 0 20px; }
.terms-container .terms-lead { color: var(--ink-soft); font-size: 14px; line-height: 1.9; margin: 0 0 30px; max-width: 820px; }
.terms-container h2 { margin: 28px 0 10px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 18px; letter-spacing: -.25px; }
.terms-container p { color: var(--ink-soft); font-size: 13px; line-height: 1.9; max-width: 820px; margin: 0 0 14px; }
.terms-container strong { color: var(--ink); }
.terms-container small { display: block; margin-top: 28px; font-size: 11px; line-height: 1.8; }
.terms-container a { color: var(--brand-royal); text-decoration: underline; }
.terms-container a.secondary { color: var(--ink); text-decoration: none; }
.terms-actions { margin: 24px 0 0; }

/* Sign In / Sign Up */
.auth-shell { width: 100%; max-width: 430px; margin: 6px auto 30px; }
.auth-back { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 20px; }
.auth-back:hover { color: var(--ink); }
.auth-card {
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
}
.auth-header { margin-bottom: 24px; }
.auth-header h1 { font-size: 27px; letter-spacing: -.7px; margin: 0 0 8px; }
.auth-header p { font-size: 13px; color: var(--muted); margin: 0; }
.auth-field { margin-bottom: 16px; }
.auth-field label { margin: 0 0 7px; }
.auth-form input:not([type=checkbox]) { min-height: 44px; }
.auth-submit { width: 100%; margin-top: 14px; }
.auth-submit i { font-style: normal; }
.auth-check { display: flex; align-items: flex-start; gap: 9px; font-size: 12px; font-weight: 400; line-height: 1.65; margin: 14px 0 4px; }
.auth-check input { width: 16px; height: 16px; margin: 2px 0 0; flex-shrink: 0; }
.auth-check a,
.auth-switch a { color: var(--brand-royal); font-weight: 600; }
.auth-switch { text-align: center; font-size: 12px; color: var(--muted); margin: 22px 0 0; }
.auth-error { font-size: 12px; color: var(--danger); padding: 10px 12px; margin: 12px 0 0; background: var(--surface-soft); border-radius: 8px; }
.password-control { position: relative; }
.password-control input { padding-right: 64px !important; }
.password-control button {
  position: absolute;
  right: 6px;
  top: 6px;
  bottom: 6px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}
.password-control button:hover { background: var(--surface-soft); color: var(--ink); }

/* Dialogs, News Reader, Consent Gate & Toast */
dialog {
  position: fixed;
  width: calc(100% - 32px);
  max-width: 510px;
  max-height: calc(100svh - 48px);
  padding: 28px 30px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 80px #10182830;
  overflow-y: auto;
}
dialog::backdrop { background: #10182866; }
dialog h2 { font-size: 24px; margin: 0 32px 8px 0; }
dialog p.muted { font-size: 12px; line-height: 1.7; margin: 0 0 4px; }
dialog small { display: block; margin-top: 8px; font-size: 11px; }
dialog .preview { background: var(--surface-soft); border-radius: 10px; padding: 10px; }
dialog .eyebrow { margin: 0 0 8px; }
dialog .preview + .eyebrow { margin-top: 16px; }
.close {
  position: absolute;
  right: 14px;
  top: 14px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}
.close:hover { border-color: var(--line-strong); color: var(--ink); }
.modal-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 22px; }
#create-error { font-size: 12px; color: var(--danger); margin: 10px 0 0; }

dialog.news-modal {
  width: calc(100% - 48px);
  max-width: 1040px;
  max-height: calc(100svh - 48px);
  padding: 0;
  overflow: hidden;
  border-radius: 15px;
}
.news-modal > #modal-body { max-height: calc(100svh - 50px); padding: 32px; overflow-y: auto; overscroll-behavior: contain; }
.news-modal > .close { right: 16px; top: 16px; z-index: 3; background: var(--surface); }
.news-reader-header { padding-right: 40px; margin-bottom: 24px; }
.news-reader-header .eyebrow { margin: 0 0 10px; font-size: 10px; letter-spacing: 1px; color: var(--brand-royal); }
.news-reader-header h2 { margin: 0 0 10px; font-size: 26px; font-weight: 600; line-height: 1.4; letter-spacing: -.5px; }
.news-reader-header > p { max-width: 800px; margin: 0; font-size: 13px; line-height: 1.8; color: var(--muted); }
.news-reader-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.news-reader-poster { margin: 0; min-width: 0; }
.news-reader-poster > img { display: block; width: 100%; height: auto; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; }
.news-reader-poster figcaption { padding-top: 10px; font-size: 11px; color: var(--brand-royal); text-align: center; }
.news-reader-poster figcaption a:hover { text-decoration: underline; }
.news-reader-content p { font-size: 13px; line-height: 1.9; color: var(--ink-soft); margin: 0 0 16px; }
.news-reader-content > .secondary { margin-top: 6px; }

dialog.consent-modal {
  width: min(760px, calc(100% - 28px));
  max-width: none;
  max-height: calc(100svh - 28px);
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
}
.consent-copy { display: flex; flex-direction: column; max-height: calc(100svh - 30px); padding: 28px 30px 22px; overflow: hidden; }
.consent-copy > .eyebrow,
.consent-copy > h2,
.consent-lead,
.consent-copy > form { flex: 0 0 auto; }
.consent-copy > .eyebrow { margin: 0 0 10px; color: var(--brand-royal); }
.consent-copy > h2 { font-size: 24px; line-height: 1.35; margin: 0 0 10px; }
.consent-lead { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 0 0 16px; }
.consent-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 14px 5px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.consent-scroll section { padding: 13px 0 5px; }
.consent-scroll h3 { font-size: 12px; margin: 0 0 5px; }
.consent-scroll p { color: var(--ink-soft); font-size: 11px; line-height: 1.75; margin: 0 0 8px; }
.consent-scroll a { color: var(--brand-royal); text-decoration: underline; text-underline-offset: 2px; }
.consent-copy form { padding-top: 14px; }
.consent-check { display: flex; align-items: flex-start; gap: 10px; margin: 0; color: var(--ink-soft); font-size: 11px; font-weight: 500; line-height: 1.65; }
.consent-check input { flex: 0 0 auto; width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--action); }
.consent-copy .modal-actions { align-items: center; justify-content: space-between; margin-top: 14px; }
.consent-copy .modal-actions button { min-height: 40px; font-size: 12px; }
.consent-copy #consent-error { margin: 8px 0 0; color: var(--danger); font-size: 11px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  z-index: 1000;
  background: var(--ink);
  color: var(--surface);
  border-radius: 9px;
  font-size: 12px;
  box-shadow: var(--shadow-card);
}

/* Skip Link, Custom Scrollbar & Boot Screen */
.forge-skip { position: fixed; left: 16px; top: -80px; z-index: 1001; padding: 10px 15px; background: var(--action); color: #fff; border-radius: 8px; font-size: 12px; }
.forge-skip:focus { top: 10px; }

html.portal-scroll-ready,
html.portal-scroll-ready body { scrollbar-width: none; }
html.portal-scroll-ready::-webkit-scrollbar,
html.portal-scroll-ready body::-webkit-scrollbar { display: none; }
.portal-scroll {
  position: fixed;
  right: 2px;
  top: 12px;
  bottom: 12px;
  width: 12px;
  z-index: 800;
  opacity: 0;
  transition: opacity .18s;
  touch-action: none;
  cursor: pointer;
}
.portal-scroll.is-scrolling,
.portal-scroll:hover,
.portal-scroll:focus-visible,
.portal-scroll.is-dragging { opacity: 1; }
.portal-scroll-thumb { position: absolute; top: 0; right: 3px; width: 4px; min-height: 44px; border-radius: 8px; background: #a1987b; }
.portal-scroll:hover .portal-scroll-thumb,
.portal-scroll.is-dragging .portal-scroll-thumb { width: 6px; right: 2px; }

.portal-client * { scrollbar-width: thin; scrollbar-color: #a1987b80 transparent; }
.portal-client *::-webkit-scrollbar { width: 5px; height: 5px; }
.portal-client *::-webkit-scrollbar-thumb { background: #a1987b80; border-radius: 8px; }
.portal-client *::-webkit-scrollbar-track { background: transparent; }

.portal-boot {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  background: var(--bg);
  transition: opacity .2s, visibility .2s;
}
.portal-boot.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.portal-boot-logo { display: grid; place-items: center; width: 48px; height: 48px; }
.portal-boot-message { font-size: 11px; color: var(--muted); }
.skeleton-shimmer { background: var(--surface-soft); animation: skeleton 1.4s ease-in-out infinite alternate; }
@keyframes skeleton { to { opacity: .45; } }

/* Mobile Bottom Navigation (desktop hidden) */
.mobile-bottom-nav { display: none; }

/* Responsive Breakpoints */
@media (max-width: 1100px) {
  .header-context { display: none; }
  .home-hero { gap: 36px; }
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tiers-grid,
  .bundles-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-sample-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-sample-card > div { height: 195px; }
}

@media (max-width: 1000px) {
  .recent-project-list { grid-template-columns: 1fr; gap: 10px; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feed-news .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 761px) and (max-width: 900px) {
  .topbar { padding: 14px 20px; gap: 12px; }
  .topbar .wordmark-text { font-size: 21px; }
  .client-sidebar { left: 12px; }
  main,
  footer {
    width: min(1160px, calc(100% - 106px));
    margin-left: max(82px, calc((100% - min(1160px, calc(100% - 106px))) / 2));
  }
}

@media (max-width: 900px) {
  .home-hero { grid-template-columns: 1fr; gap: 32px; }
  .home-artboard { max-width: none; }
  .home-studios { grid-template-columns: 1fr; gap: 14px; }
  .home-capabilities { grid-template-columns: 1fr; gap: 20px; }
  .home-news-grid,
  .news-grid,
  .guides-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .home-help { grid-template-columns: 1fr; gap: 28px; }
  .toolbar input { flex: 1; }
  .filter-group { width: 100%; }
  .history-section .guide { grid-template-columns: 120px 1fr; }
  .history-section .guide small { grid-column: 2; }
  .news-reader-layout { grid-template-columns: 1fr; gap: 22px; }
  .news-reader-poster { max-width: 450px; margin: 0 auto; width: 100%; }
}

@media (max-width: 760px) {
  body { font-size: 13px; }
  .client-sidebar { display: none !important; }

  .topbar {
    padding: 12px 18px;
    min-height: 58px;
    gap: 10px;
    flex-wrap: nowrap;
  }
  .topbar .wordmark { gap: 6px; margin-right: auto; }
  .topbar .brand-mark { width: 32px; height: 30px; }
  .topbar .wordmark-text { font-size: 20px; }
  .header-context { display: none; }
  .top-actions { gap: 6px; margin-left: auto; width: auto; }
  .credit-balance,
  .header-pill { height: 32px; min-height: 32px; padding: 0 9px; font-size: 11px; gap: 5px; }
  .credit-balance .account-plan { font-size: 10px; max-width: 68px; }
  .theme-button,
  .topbar .avatar-button { width: 32px; height: 32px; min-height: 32px; }
  .user-popover { right: 0; width: min(296px, calc(100vw - 36px)); }

  main,
  footer { width: calc(100% - 36px); margin-left: auto; margin-right: auto; }
  main { padding: 28px 0 48px; }
  footer { padding: 22px 0 calc(103px + env(safe-area-inset-bottom)); font-size: 11px; gap: 14px; }
  .footer-links { gap: 12px 18px; }

  .mobile-bottom-nav {
    position: fixed;
    left: 50%;
    bottom: calc(10px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 150;
    display: flex;
    align-items: stretch;
    gap: 4px;
    width: calc(100% - 24px);
    max-width: 440px;
    padding: 5px;
    border: 1px solid var(--line-strong);
    border-radius: 13px;
    background: var(--surface);
    box-shadow: 0 5px 24px #34372f14;
  }
  .mobile-bottom-nav > a,
  .bottom-more { flex: 1; min-width: 0; }
  .mobile-bottom-nav > a,
  .bottom-more > summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 49px;
    padding: 5px 2px;
    border: 0;
    border-radius: 8px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.25;
    font-weight: 500;
    list-style: none;
    white-space: nowrap;
  }
  .mobile-bottom-nav > a .icon,
  .bottom-more > summary .icon { width: 18px; height: 18px; display: block; }
  .mobile-bottom-nav > a.active,
  .bottom-more > summary.active { background: var(--surface-soft); color: var(--action); font-weight: 600; }
  .bottom-more { position: relative; }
  .bottom-more > summary::-webkit-details-marker { display: none; }
  .bottom-more-menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 12px);
    display: grid;
    gap: 3px;
    width: 196px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface);
    box-shadow: 0 8px 30px #34372f21;
  }
  .bottom-more-menu > a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 9px 10px;
    border-radius: 7px;
    color: var(--ink-soft);
    font-size: 12px;
    line-height: 1.4;
  }
  .bottom-more-menu > a .icon { width: 17px; height: 17px; }
  .bottom-more-menu > a.active,
  .bottom-more-menu > a:hover { color: var(--action); background: var(--surface-soft); }

  .toast { bottom: calc(88px + env(safe-area-inset-bottom)); }

  .page-title,
  .projects-heading { margin-bottom: 22px; }
  .page-title h1,
  .projects-heading h1 { font-size: 28px; }
  .projects-heading { align-items: flex-start; flex-direction: column; gap: 16px; }
  .section-header { align-items: center; gap: 12px; margin-bottom: 18px; }
  .section-header h2 { font-size: 20px; }

  .home-hero { padding: 28px 0 32px; gap: 28px; }
  .home-intro h1 { font-size: 36px; }
  .home-artboard { padding: 12px; border-radius: 14px; }
  .home-board-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    border-radius: 10px;
  }
  .home-board-grid::-webkit-scrollbar { display: none; }
  .home-board-grid > .home-art-tile {
    flex: 0 0 100%;
    width: 100%;
    height: 240px;
    padding: 16px;
    scroll-snap-align: start;
    scroll-snap-stop: normal;
  }
  .home-board-grid > .home-art-tile img { width: 100%; height: 190px; max-height: 100%; object-fit: contain; }
  .home-slide-controls { display: flex; align-items: center; justify-content: center; gap: 12px; padding-top: 12px; }
  .home-slide-dots { display: flex; align-items: center; justify-content: center; gap: 8px; flex: 1; }
  .home-slide-dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 10px; background: var(--line-strong); }
  .home-slide-dots button[aria-pressed=true] { width: 20px; background: var(--action); }
  [data-carousel-pause] {
    display: grid;
    place-items: center;
    width: 28px;
    height: 26px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--muted);
  }
  [data-carousel-pause] .icon { width: 13px; height: 13px; }

  .recent-workspace { padding: 18px; margin-bottom: 32px; }
  .recent-empty { align-items: flex-start; flex-direction: column; gap: 14px; }
  .home-capabilities { padding: 28px 0; }
  .home-news,
  .home-showcase { padding-top: 36px; }
  .home-news h2,
  .home-showcase h2,
  .home-help h2 { font-size: 23px; }
  .home-news-grid { grid-template-columns: 1fr; gap: 14px; }
  .home-news-card { display: grid; grid-template-columns: 108px minmax(0, 1fr); align-items: stretch; }
  .home-news-art { height: 100%; min-height: 156px; padding: 10px; }
  .home-news-art img { max-height: 130px; }
  .home-news-copy { padding: 15px; }
  .home-news-copy h3 { font-size: 14px; margin: 4px 0 6px; }
  .home-news-copy p { font-size: 11px; margin-bottom: 10px; }
  .home-sample-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  .home-help { margin-top: 36px; padding-top: 32px; gap: 24px; }

  .project-toolbar input { flex: 1 0 100%; }
  .project-toolbar #project-results { margin-left: 0; margin-right: auto; }
  .project-view-switch button { padding: 6px 9px; font-size: 11px; }
  .project-grid[data-view=grid] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .project-grid[data-view=grid] .project-preview { height: 140px; min-height: 140px; padding: 14px; }
  .project-grid[data-view=grid] .project-preview img { height: 110px; }
  .project-grid[data-view=grid] .project-item-copy { padding: 14px; }
  .project-grid[data-view=grid] .project-item-copy h2 { font-size: 14px; }
  .project-grid[data-view=list] .project-item-copy { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 14px; }
  .project-grid[data-view=list] .project-item-copy h2 { grid-column: 1; font-size: 14px; }
  .project-grid[data-view=list] .project-item-copy p { grid-column: 1; }
  .project-grid[data-view=list] .project-open { grid-column: 2; grid-row: 1 / 3; font-size: 0; }
  .project-grid[data-view=list] .project-open .icon { width: 17px; height: 17px; }

  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .work .preview { height: 165px; padding: 16px; }
  .work .copy { padding: 13px; }
  .work h3 { font-size: 13px; }
  .favorite { width: 28px; height: 28px; right: 8px; top: 8px; }
  .toolbar input { width: 100% !important; flex: 1 0 100%; }
  .filter { min-height: 34px; padding: 6px 10px; font-size: 11px; }

  .feed-feature { grid-template-columns: 1fr; gap: 16px; padding: 18px; }
  .feed-feature > img { height: 220px; max-height: 220px; }
  .feed-news .news-grid,
  .news-grid,
  .guides-grid { grid-template-columns: 1fr; gap: 14px; }

  .tiers-grid,
  .bundles-grid { gap: 14px; }
  .tier-card,
  .bundle-card { padding: 20px 16px; }
  .pricing-help,
  .faq-contact { align-items: flex-start; flex-direction: column; padding: 18px; gap: 16px; }
  .pricing-help-actions,
  .faq-contact > div:last-child { flex-wrap: wrap; }

  .history-section .guide { grid-template-columns: 1fr; gap: 6px; padding: 16px; }
  .history-section .guide small { grid-column: auto; }

  .auth-card { padding: 24px 20px; }
  dialog { padding: 24px 20px; }
  dialog h2 { font-size: 22px; }
  dialog.news-modal { width: calc(100% - 24px); max-height: calc(100svh - 24px); border-radius: 12px; }
  .news-modal > #modal-body { padding: 24px 18px; max-height: calc(100svh - 26px); }
  .news-modal > .close { right: 12px; top: 12px; }
  .news-reader-header h2 { font-size: 21px; }

  dialog.consent-modal { width: calc(100% - 20px); max-height: calc(100svh - 20px); }
  .consent-copy { max-height: calc(100svh - 22px); padding: 20px 18px 16px; }
  .consent-copy > h2 { font-size: 20px; }
  .consent-copy .modal-actions { gap: 8px; flex-wrap: wrap; }
  .consent-copy .modal-actions button { flex: 1 1 140px; padding: 9px 10px; font-size: 11px; }
}

@media (max-width: 380px) {
  .topbar { padding-left: 14px; padding-right: 14px; }
  .topbar .wordmark-text { font-size: 19px; }
  .home-intro h1 { font-size: 32px; }
  .home-hero .hero-actions { align-items: stretch; flex-direction: column; }
  .tiers-grid,
  .bundles-grid { grid-template-columns: 1fr; }
}

@media (max-height: 520px) {
  .consent-copy { padding: 14px 18px; }
  .consent-copy > .eyebrow { margin-bottom: 6px; font-size: 8px; }
  .consent-copy > h2 { font-size: 18px; margin-bottom: 8px; }
  .consent-lead { display: none; }
  .consent-copy form { padding-top: 8px; }
  .consent-check { font-size: 10px; }
  .consent-copy .modal-actions { margin-top: 8px; }
  .consent-copy .modal-actions button { min-height: 34px; padding: 7px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
