/* ==========================================================================
   Member workspace — shell, dashboard, model creator (see DESIGN.md)
   Loaded after voiceiq-ui.css on every private page. Only tokens; no hex.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Gate + private-page shell
   -------------------------------------------------------------------------- */
[hidden] { display: none !important; }
html[data-private-page]:not([data-authenticated]) body > :not(.member-gate):not(script) { display: none !important; }

html[data-private-page] .ambient, html[data-private-page] .footer { display: none; }
html[data-private-page] .container { width: min(1180px, calc(100% - 48px)); }
html[data-private-page] .page-hero { padding: 32px 0 24px; }
html[data-private-page] .page-hero h1 { max-width: 900px; font-size: clamp(36px, 4.5vw, 56px); line-height: 1; letter-spacing: -.04em; }
html[data-private-page] .page-hero p { max-width: 640px; margin-top: 16px; font-size: 15px; }
html[data-private-page] .page-hero .reveal { opacity: 1; transform: none; }
html[data-private-page] .section.compact { padding-top: 0; padding-bottom: 64px; }

/* Generic member shell (profile / billing) */
.member-shell { max-width: 1180px; padding-top: 44px; padding-bottom: 72px; }
.member-shell h1 { margin: 12px 0 16px; font-size: clamp(36px, 4.5vw, 56px); line-height: 1; letter-spacing: -.04em; }
.member-intro { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.6; }
.accent-text { color: var(--accent-text); }
.member-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 16px; margin-top: 28px; }
.member-card { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; min-height: 280px; padding: 26px; }
.member-card h2 { margin: 20px 0 0; font-size: 22px; letter-spacing: -.03em; }
.member-card p { margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.member-card a { z-index: 1; margin-top: auto; padding-top: 16px; color: var(--accent-text); font-size: 14px; font-weight: 600; }
.card-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--radius-s); background: var(--accent-soft); color: var(--accent-text); font-size: 20px; }
.member-card .credit-value { margin: 6px 0 0; font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -.04em; color: var(--text); }
.featured-card { min-height: 320px; border-color: transparent; background: var(--ink); color: var(--ink-text); }
.featured-card::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 85% 15%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 42%), radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px); background-size: 100% 100%, 18px 18px; }
.featured-card > * { position: relative; z-index: 1; }
.featured-card .card-icon { display: none; }
.featured-card .kicker { color: color-mix(in srgb, currentColor 60%, transparent); }
.featured-card h2 { font-size: 30px; }
.featured-card p { max-width: 280px; color: color-mix(in srgb, currentColor 68%, transparent); }
.featured-card a { color: inherit; }
.decor-wave { position: absolute; right: -20px; bottom: 14px; color: var(--accent); opacity: .5; font-size: 45px; letter-spacing: 4px; transform: rotate(-12deg); pointer-events: none; }
.workspace-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 36px; }
.workspace-bottom { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 24px; padding: 26px 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.workspace-bottom h2 { font-size: 20px; letter-spacing: -.03em; }
.workspace-bottom p { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.member-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 32px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 14px; }
.member-toolbar a { color: var(--accent-text); font-weight: 600; }
.member-toolbar button { margin-left: auto; border: 0; background: none; color: var(--muted); font: inherit; cursor: pointer; }
.member-toolbar button:hover { color: var(--text); }
#memberMessage { color: var(--muted); font-size: 14px; line-height: 1.6; }

/* --------------------------------------------------------------------------
   Dashboard
   -------------------------------------------------------------------------- */
.dashboard-shell { max-width: 1180px; padding-top: 40px; padding-bottom: 56px; }

/* Hero */
.dashboard-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; padding: 8px 0 32px; }
.dashboard-hero-copy { max-width: 720px; }
.dashboard-kicker { display: inline-flex; align-items: center; gap: 8px; }
.dashboard-kicker::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.dashboard-hero h1 { margin: 14px 0 12px; font-size: clamp(36px, 4.5vw, 56px); line-height: 1; letter-spacing: -.04em; }
.dashboard-hero h1 span { color: var(--accent-text); }
.dashboard-hero p { max-width: 620px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.dashboard-hero-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

/* Buttons (pills) */
.dashboard-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border: 1px solid transparent; border-radius: 999px; font-size: 14px; font-weight: 600; line-height: 1; letter-spacing: -.005em; transition: background .15s ease, border-color .15s ease, color .15s ease, opacity .15s ease; }
.dashboard-button-primary { background: var(--ink); color: var(--ink-text); }
.dashboard-button-primary:hover { opacity: .86; }
.dashboard-button-secondary { background: transparent; border-color: var(--line-strong); color: var(--text); }
.dashboard-button-secondary:hover { background: var(--surface-2); }
.dashboard-button-light { background: var(--panel-btn-bg, var(--ink-text)); color: var(--panel-btn-fg, var(--ink)); }
.dashboard-button-light:hover { opacity: .88; }

/* Stats */
.dashboard-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.dashboard-stat { display: flex; align-items: center; gap: 16px; min-height: 112px; padding: 22px 24px; color: var(--text); transition: border-color .15s ease; }
a.dashboard-stat:hover { border-color: var(--line-strong); }
.dashboard-stat-icon { flex: 0 0 auto; display: grid; place-items: center; width: 46px; height: 46px; border-radius: var(--radius-s); background: var(--accent-soft); color: var(--accent-text); font-size: 18px; }
.dashboard-stat > div:last-child { display: flex; flex-direction: column; min-width: 0; }
.dashboard-stat span { font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.dashboard-stat strong { margin-top: 6px; font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1; letter-spacing: -.04em; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dashboard-stat small { margin-top: 8px; color: var(--faint); font-size: 12px; line-height: 1.45; }

/* Main grid */
.dashboard-grid-modern { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); gap: 14px; margin-top: 14px; }

/* Voice creation — the primary action: an --ink feature panel */
.dashboard-create-card {
  --panel-bg: var(--ink); --panel-fg: var(--ink-text); --panel-btn-bg: var(--ink-text); --panel-btn-fg: var(--ink);
  position: relative; overflow: hidden; min-height: 390px; padding: 28px; border: 1px solid transparent; border-radius: var(--radius-l);
  background: var(--panel-bg); color: var(--panel-fg);
}
html[data-theme="dark"] .dashboard-create-card { --panel-bg: var(--surface-2); --panel-fg: var(--text); --panel-btn-bg: var(--ink); --panel-btn-fg: var(--ink-text); border-color: var(--line); }
.dashboard-create-card::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 88% 12%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 42%), radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px); background-size: 100% 100%, 18px 18px; opacity: .9; }
.dashboard-create-card > * { position: relative; z-index: 1; }
.dashboard-card-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: color-mix(in srgb, currentColor 62%, transparent); }
.dashboard-live-dot { display: inline-flex; align-items: center; gap: 8px; }
.dashboard-live-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 28%, transparent); }
.dashboard-create-content { display: flex; flex-direction: column; justify-content: space-between; min-height: 300px; padding-top: 40px; }
.dashboard-create-content h2 { max-width: 520px; margin: 0; font-size: clamp(30px, 3.6vw, 44px); line-height: 1.02; letter-spacing: -.04em; color: inherit; }
.dashboard-create-content p { max-width: 520px; margin: 18px 0 0; color: color-mix(in srgb, currentColor 68%, transparent); font-size: 15px; line-height: 1.6; }
.dashboard-card-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.dashboard-text-link { display: inline-flex; align-items: center; min-height: 46px; padding: 0 20px; border: 1px solid color-mix(in srgb, currentColor 22%, transparent); border-radius: 999px; color: inherit; font-size: 14px; font-weight: 600; transition: background .15s ease, border-color .15s ease; }
.dashboard-text-link:hover { background: color-mix(in srgb, currentColor 8%, transparent); border-color: color-mix(in srgb, currentColor 40%, transparent); }
.dashboard-wave { position: absolute; right: -10px; bottom: -6px; display: flex; align-items: center; gap: 5px; width: 44%; height: 92px; opacity: .7; transform: rotate(-4deg); transform-origin: right bottom; pointer-events: none; }
.dashboard-wave span { width: 6px; border-radius: 999px; background: var(--accent); animation: dashboardWave 2.8s ease-in-out infinite; }
.dashboard-wave span:nth-child(1), .dashboard-wave span:nth-child(6), .dashboard-wave span:nth-child(12), .dashboard-wave span:nth-child(18) { height: 18px; }
.dashboard-wave span:nth-child(2), .dashboard-wave span:nth-child(8), .dashboard-wave span:nth-child(14) { height: 48px; animation-delay: .12s; }
.dashboard-wave span:nth-child(3), .dashboard-wave span:nth-child(9), .dashboard-wave span:nth-child(15) { height: 74px; animation-delay: .24s; }
.dashboard-wave span:nth-child(4), .dashboard-wave span:nth-child(10), .dashboard-wave span:nth-child(16) { height: 34px; animation-delay: .36s; }
.dashboard-wave span:nth-child(5), .dashboard-wave span:nth-child(11), .dashboard-wave span:nth-child(17) { height: 60px; animation-delay: .48s; }
.dashboard-wave span:nth-child(7), .dashboard-wave span:nth-child(13) { height: 84px; animation-delay: .6s; }
@keyframes dashboardWave { 0%, 100% { transform: scaleY(.72); opacity: .58; } 50% { transform: scaleY(1.08); opacity: 1; } }

/* Quick actions */
.dashboard-side-card { padding: 26px; }
.dashboard-card-heading h2 { margin: 10px 0 0; font-size: 22px; letter-spacing: -.03em; }
.dashboard-action-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 15px 0; border-top: 1px solid var(--line); color: var(--text); transition: color .15s ease; }
.dashboard-action-row:first-of-type { margin-top: 20px; }
.dashboard-action-row:last-child { padding-bottom: 4px; }
.dashboard-action-row:hover { color: var(--accent-text); }
.dashboard-action-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-s); background: var(--surface-2); color: var(--accent-text); font-size: 14px; transition: background .15s ease; }
.dashboard-action-row:hover .dashboard-action-icon { background: var(--accent-soft); }
.dashboard-action-row strong { display: block; font-size: 14px; font-weight: 600; }
.dashboard-action-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.dashboard-action-row b { font-size: 16px; font-weight: 400; color: var(--faint); transition: color .15s ease; }
.dashboard-action-row:hover b { color: currentColor; }
.admin-action .dashboard-action-icon { background: var(--ink); color: var(--ink-text); }

/* Recent models */
.dashboard-recent-card { margin-top: 14px; padding: 26px; }
.dashboard-card-heading-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.dashboard-card-heading-row > a { color: var(--accent-text); font-size: 13px; font-weight: 600; }
.dashboard-card-heading-row > a:hover { color: var(--accent-ink); }
.dashboard-recent-list { display: grid; gap: 8px; }
.dashboard-model-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); color: var(--text); transition: border-color .15s ease, background .15s ease; }
.dashboard-model-row:hover { border-color: var(--line-strong); background: var(--surface-2); }
.dashboard-model-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-family: var(--font-mono); font-size: 13px; font-weight: 700; }
.dashboard-model-copy { display: flex; flex-direction: column; min-width: 0; }
.dashboard-model-copy strong { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-model-copy small { margin-top: 3px; color: var(--faint); font-size: 12px; }
.dashboard-model-row b { font-size: 16px; font-weight: 400; color: var(--faint); }
.dashboard-empty-state { display: flex; align-items: center; gap: 14px; min-height: 84px; padding: 18px 20px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.dashboard-empty-state > div:nth-child(2) { display: flex; flex-direction: column; }
.dashboard-empty-state strong { color: var(--text); font-size: 14px; font-weight: 600; }
.dashboard-empty-state span { margin-top: 3px; font-size: 12px; }
.dashboard-empty-state > a { margin-left: auto; color: var(--accent-text); font-size: 13px; font-weight: 600; white-space: nowrap; }
.dashboard-empty-icon { display: grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; border-radius: var(--radius-s); background: var(--accent-soft); color: var(--accent-text); font-size: 16px; }

/* Footer row */
.dashboard-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 28px; padding: 22px 0 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.5; }
.dashboard-footer > div { display: flex; align-items: center; gap: 8px; }
.dashboard-footer a, .dashboard-footer button { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s ease, color .15s ease; }
.dashboard-footer button { border-color: transparent; background: transparent; color: var(--muted); }
.dashboard-footer a:hover, .dashboard-footer button:hover { background: var(--surface-2); color: var(--text); }

/* --------------------------------------------------------------------------
   Model creator page layout (component rules live in create-model.html)
   -------------------------------------------------------------------------- */
body[data-page="create-model"] .creator-layout { grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); gap: 16px; }
body[data-page="create-model"] .creator-main { grid-column: 1; grid-row: 1; }
body[data-page="create-model"] .creator-side { grid-column: 2; grid-row: 1; top: 92px; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .member-grid { grid-template-columns: 1fr 1fr; }
  .featured-card { grid-column: 1 / -1; min-height: 260px; }
  .workspace-heading, .workspace-bottom { align-items: flex-start; flex-direction: column; }
  .dashboard-hero { align-items: flex-start; flex-direction: column; }
  .dashboard-hero-actions { width: 100%; }
  .dashboard-stats { grid-template-columns: 1fr; }
  .dashboard-grid-modern { grid-template-columns: 1fr; }
  .dashboard-create-card { min-height: 360px; }
  body[data-page="create-model"] .creator-layout { grid-template-columns: 1fr; }
  body[data-page="create-model"] .creator-main { grid-column: 1; grid-row: 1; }
  body[data-page="create-model"] .creator-side { grid-column: 1; grid-row: 2; position: static; }
}
@media (max-width: 620px) {
  html[data-private-page] .container { width: calc(100% - 32px); }
  .member-grid { grid-template-columns: 1fr; }
  .featured-card { grid-column: auto; }
  .member-card { min-height: 240px; }
  .member-shell { padding-top: 32px; }
  .dashboard-shell { padding-top: 28px; }
  .dashboard-hero { padding-bottom: 24px; }
  .dashboard-hero-actions { flex-direction: column; align-items: stretch; }
  .dashboard-button { width: 100%; }
  .dashboard-stat { min-height: 0; padding: 18px 20px; }
  .dashboard-stat strong { font-size: 26px; }
  .dashboard-create-card { padding: 22px; min-height: 0; }
  .dashboard-create-content { min-height: 0; padding-top: 32px; padding-bottom: 110px; }
  .dashboard-wave { width: 72%; opacity: .55; }
  .dashboard-card-actions { align-items: stretch; flex-direction: column; }
  .dashboard-card-actions .dashboard-button, .dashboard-text-link { width: 100%; justify-content: center; }
  .dashboard-side-card, .dashboard-recent-card { padding: 20px; }
  .dashboard-model-row { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .dashboard-model-row b { display: none; }
  .dashboard-card-heading-row { align-items: flex-start; flex-direction: column; gap: 8px; }
  .dashboard-empty-state { flex-wrap: wrap; }
  .dashboard-empty-state > a { margin-left: 52px; }
  .dashboard-footer { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .dashboard-wave span { animation: none; }
  .dashboard-button, .dashboard-action-row, .dashboard-model-row { transition: none; }
}
