/* ============================================================
   PortalApp — Design System
   Direction : Clean & Neutral
   Accent    : Portal Blue  #2563EB
   Dark mode : prefers-color-scheme: dark
   Font      : Inter (Google Fonts)
   ============================================================ */

/* ── 1. Design tokens — light mode ──────────────────────────── */
:root {
  /* Accent */
  --accent:         #2563EB;
  --accent-hover:   #1d4ed8;
  --accent-light:   #eff6ff;
  --accent-muted:   #dbeafe;
  --accent-fg:      #ffffff;

  /* Surface */
  --bg:             #ffffff;
  --bg-subtle:      #f8fafc;
  --bg-elevated:    #f1f5f9;

  /* Border */
  --border:         #e2e8f0;
  --border-strong:  #cbd5e1;

  /* Text */
  --text:           #0f172a;
  --text-muted:     #475569;
  --text-faint:     #94a3b8;

  /* Status */
  --error:          #dc2626;
  --error-bg:       #fef2f2;
  --error-text:     #991b1b;
  --success:        #16a34a;
  --success-bg:     #f0fdf4;
  --warning:        #d97706;
  --warning-bg:     #fffbeb;

  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(15,23,42,.05);
  --shadow-sm: 0 1px 3px rgba(15,23,42,.07), 0 1px 2px rgba(15,23,42,.04);
  --shadow:    0 4px 16px rgba(15,23,42,.08), 0 1px 3px rgba(15,23,42,.04);
  --shadow-lg: 0 16px 48px rgba(15,23,42,.10), 0 4px 12px rgba(15,23,42,.05);

  /* Shape */
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 20px;
  --site-shell-width: 1200px;
  --site-hero-width: 860px;
  --site-section-spacing: 64px;

  /* Gradient */
  --accent-gradient-to: #818cf8;

  /* Motion */
  --transition: .16s ease;

  /* Typography */
  --font:      'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Code', 'Fira Code', monospace;

  /* ── Compatibility aliases (used by taskflow-board.css) ── */
  --ink:              #0f172a;
  --ink-muted:        #475569;
  --ink-faint:        #94a3b8;
  --parchment:        #f8fafc;
  --parchment-dark:   #f1f5f9;
  --parchment-border: #e2e8f0;
  --surface:          #ffffff;
  --rust:             #2563EB;
  --rust-dark:        #1d4ed8;
  --rust-light:       #eff6ff;
  --gold:             #d97706;
  --gold-light:       #fffbeb;
  --sage:             #16a34a;
  --sage-light:       #f0fdf4;
}

/* ── 2. Design tokens — dark mode ────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --accent:         #3b82f6;
    --accent-hover:   #60a5fa;
    --accent-light:   #1e3a5f;
    --accent-muted:   #1e3a6e;
    --accent-fg:      #ffffff;

    --bg:             #0d1117;
    --bg-subtle:      #161b27;
    --bg-elevated:    #1c2333;

    --border:         #2a3445;
    --border-strong:  #3d4f6a;

    --text:           #e4ecfb;
    --text-muted:     #8799be;
    --text-faint:     #4a5878;

    --error:          #f87171;
    --error-bg:       #2d1616;
    --error-text:     #fca5a5;
    --success:        #4ade80;
    --success-bg:     #14291a;
    --warning:        #fbbf24;
    --warning-bg:     #291e08;

    --shadow-xs: 0 1px 2px rgba(0,0,0,.3);
    --shadow-sm: 0 1px 3px rgba(0,0,0,.35);
    --shadow:    0 4px 16px rgba(0,0,0,.45);
    --shadow-lg: 0 16px 48px rgba(0,0,0,.55);

    --accent-gradient-to: #a78bfa;

    /* Compatibility aliases — dark */
    --ink:              #e4ecfb;
    --ink-muted:        #8799be;
    --ink-faint:        #4a5878;
    --parchment:        #161b27;
    --parchment-dark:   #1c2333;
    --parchment-border: #2a3445;
    --surface:          #0d1117;
    --rust:             #3b82f6;
    --rust-dark:        #60a5fa;
    --rust-light:       #1e3a5f;
    --gold:             #fbbf24;
    --gold-light:       #291e08;
    --sage:             #4ade80;
    --sage-light:       #14291a;
  }
  body {
    background:
      radial-gradient(circle at 15% 8%,  rgba(59, 130, 246, 0.18), transparent 34rem),
      radial-gradient(circle at 83% 12%, rgba(99, 102, 241, 0.12), transparent 30rem),
      radial-gradient(circle at 55% 82%, rgba(37,  99, 235, 0.08), transparent 28rem),
      var(--bg);
  }
}

/* ── 3. Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  color-scheme: light dark;
}

body {
  font-family: var(--font);
  font-size: calc(1rem * var(--font-scale, 1));
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 10%, rgba(37,  99, 235, 0.05), transparent 32rem),
    radial-gradient(circle at 83% 14%, rgba(99, 102, 241, 0.04), transparent 28rem),
    radial-gradient(circle at 55% 85%, rgba(37,  99, 235, 0.03), transparent 26rem),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }
img  { max-width: 100%; display: block; }
a    { color: var(--accent); }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff;
  padding: .5rem 1rem; z-index: 200;
  border-radius: 0 0 var(--radius-sm) 0;
  font-size: .875rem; font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ── 4. Navigation ───────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition), border-color var(--transition);
}
.nav.is-scrolled {
  box-shadow: var(--shadow-sm);
  border-color: transparent;
}
.nav__inner {
  max-width: var(--site-shell-width); margin: 0 auto; padding: 0 1.5rem;
  display: flex; align-items: center; height: 60px; gap: 1rem;
}

.nav-brand {
  display: inline-flex; align-items: center; gap: .5rem;
  text-decoration: none; color: var(--text);
  font-weight: 700; font-size: .95rem; letter-spacing: -.01em;
  flex-shrink: 0;
}
.nav-brand__mark {
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--accent-gradient-to)); color: #fff;
  font-weight: 700; font-size: .875rem;
}
.nav-brand__text { color: var(--text); }
.nav-brand__text span { color: var(--accent); }

.nav__right { display: flex; align-items: center; gap: .65rem; margin-left: auto; }
.nav-links  { display: flex; align-items: center; gap: .1rem; }
.nav__secondary { display: flex; align-items: center; gap: .65rem; }

.nav-link {
  color: var(--text-muted); text-decoration: none;
  font-size: .875rem; font-weight: 500;
  padding: .45rem .75rem; border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: var(--bg-subtle);
}
.nav-link--cta {
  background: var(--accent); color: var(--accent-fg) !important;
  padding: .45rem 1rem;
  box-shadow: 0 1px 3px rgba(37,99,235,.25);
}
.nav-link--cta:hover {
  background: var(--accent-hover);
  box-shadow: 0 3px 10px rgba(37,99,235,.3);
}

.nav__toggle {
  display: none; background: none; border: 0;
  padding: .35rem; cursor: pointer;
}
.nav__toggle span {
  display: block; width: 20px; height: 1.5px;
  background: var(--text); margin: 4.5px 0;
  border-radius: 2px; transition: var(--transition);
}
.nav__toggle.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav__toggle.is-open span:nth-child(2) { opacity: 0; }
.nav__toggle.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ── 5. Language switch ──────────────────────────────────────── */
.lang-switch {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 3px; border-radius: 999px;
  background: var(--bg-subtle); border: 1px solid var(--border);
}
.lang-switch__btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; padding: .26rem .55rem;
  border-radius: 999px; font-size: .73rem; font-weight: 700;
  letter-spacing: .06em; text-decoration: none;
  color: var(--text-muted); transition: var(--transition);
}
.lang-switch__btn:hover { color: var(--text); background: var(--bg-elevated); }
.lang-switch__btn.is-active {
  color: var(--accent); background: var(--accent-light);
  box-shadow: var(--shadow-xs);
}
.lang-switch__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── 6. Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .45rem; padding: .65rem 1.35rem;
  border-radius: var(--radius); font-weight: 600; font-size: .9rem;
  text-decoration: none; border: 1px solid transparent;
  cursor: pointer; font-family: var(--font);
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.btn--primary {
  background: var(--accent); color: var(--accent-fg);
  box-shadow: 0 1px 3px rgba(37,99,235,.3);
}
.btn--primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 14px rgba(37,99,235,.35);
  transform: translateY(-1px);
}
.btn--ghost {
  background: transparent; color: var(--text);
  border-color: var(--border);
}
.btn--ghost:hover {
  background: var(--bg-subtle); border-color: var(--border-strong);
  transform: translateY(-1px);
}

/* Aliases used throughout pages */
.btn-primary, .btn-rust {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .4rem; padding: .575rem 1.15rem;
  background: var(--accent); color: var(--accent-fg);
  border: none; border-radius: var(--radius);
  font-weight: 600; font-size: .875rem;
  cursor: pointer; font-family: var(--font);
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  white-space: nowrap;
}
.btn-primary:hover, .btn-rust:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(37,99,235,.3);
  transform: translateY(-1px);
}
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .4rem; padding: .575rem 1.15rem;
  background: var(--bg-subtle); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-weight: 500; font-size: .875rem;
  cursor: pointer; font-family: var(--font);
  transition: var(--transition);
}
.btn-secondary:hover { background: var(--bg-elevated); border-color: var(--border-strong); }

.w-full { width: 100%; }

/* ── 7. Hero ─────────────────────────────────────────────────── */
.portal-hero {
  position: relative; overflow: hidden;
  padding: 6rem 1.5rem 5rem;
}
.portal-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(180deg, rgba(255,255,255,.82), rgba(255,255,255,.94)),
    var(--portal-hero-bg);
  background-size: cover;
  background-position: center;
  opacity: var(--portal-hero-bg-opacity, 1);
}
@media (prefers-color-scheme: dark) {
  .portal-hero::before {
    background-image:
      linear-gradient(180deg, rgba(13,17,23,.78), rgba(13,17,23,.92)),
      var(--portal-hero-bg);
  }
}
.portal-hero__inner {
  max-width: var(--site-hero-width); margin: 0 auto;
  text-align: center; position: relative; z-index: 1;
}
.portal-hero__eyebrow {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .72rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent); background: var(--accent-light);
  padding: .3rem .9rem; border-radius: 999px;
  border: 1px solid var(--accent-muted);
  margin-bottom: 1.5rem;
}
.portal-hero__title {
  font-size: clamp(2.5rem, 5.5vw, 4.25rem);
  font-weight: 700; color: var(--text);
  letter-spacing: -.04em; line-height: 1.08;
  margin-bottom: 1.25rem;
}
.portal-hero__title-accent {
  display: block;
  color: var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-gradient-to));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.portal-hero__subtitle {
  font-size: clamp(1rem, 1.4vw, 1.1rem);
  color: var(--text-muted); max-width: 540px;
  margin: 0 auto 2rem; line-height: 1.7;
}
.portal-hero__actions {
  display: flex; flex-wrap: wrap; gap: .75rem;
  justify-content: center; margin-bottom: 3rem;
}
.portal-hero__stats {
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 1rem; max-width: 480px; margin: 0 auto;
}
.portal-hero__stats > div {
  background: var(--bg-subtle); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem .75rem;
}
.portal-hero__stats dt {
  font-size: 1.55rem; font-weight: 700; color: var(--text); letter-spacing: -.02em;
}
.portal-hero__stats dd {
  font-size: .72rem; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: .07em; margin-top: .15rem;
}
.portal-hero__glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(65% 60% at 50% -5%, rgba(37,99,235,.13), transparent 70%);
}

/* ── 7b. Hero CTA overrides — pill shape + gradient primary ─── */
.portal-hero .btn              { border-radius: 999px; }
.portal-hero .btn--primary     {
  background: linear-gradient(135deg, var(--accent), var(--accent-gradient-to));
  box-shadow: 0 4px 20px rgba(37,99,235,.35);
}
.portal-hero .btn--primary:hover {
  background: linear-gradient(135deg, var(--accent-hover), var(--accent));
  box-shadow: 0 6px 28px rgba(37,99,235,.45);
  transform: translateY(-2px);
}

/* ── 8. Portal sections ──────────────────────────────────────── */
.portal-section { max-width: var(--site-shell-width); margin: 0 auto; padding: var(--site-section-spacing) 1.5rem; }
.portal-section--alt {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  margin: 0; max-width: 100%; padding: var(--site-section-spacing) 0;
}
.portal-section--alt > * { max-width: var(--site-shell-width); margin: 0 auto; padding-left: 1.5rem; padding-right: 1.5rem; }
.portal-section__head { text-align: center; margin-bottom: 2.5rem; }
.portal-section__eyebrow {
  display: inline-flex;
  margin-bottom: .75rem;
  padding: .3rem .85rem;
  border-radius: 999px;
  background: var(--accent-light);
  border: 1px solid var(--accent-muted);
  color: var(--accent);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.portal-section__title {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 700; color: var(--text); letter-spacing: -.02em;
}
.portal-section__subtitle { color: var(--text-muted); margin-top: .4rem; font-size: .95rem; }

/* ── 9. Portal cards (app gallery + dashboard panels) ────────── */
.portal-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

/* Per-tag accent tokens — cascade into icon, bar, tag label, CTA */
.portal-card[data-tag="game"]    { --c1: #f43f5e; --c2: #c026d3; }
.portal-card[data-tag="craft"]   { --c1: #f97316; --c2: #f59e0b; }
.portal-card[data-tag="info"]    { --c1: #0ea5e9; --c2: #6366f1; }
.portal-card[data-tag="starter"] { --c1: #22c55e; --c2: #06b6d4; }
/* fallback when no tag matches */
.portal-card { --c1: var(--accent); --c2: var(--accent-gradient-to, var(--primary)); }

.portal-card {
  position: relative; display: flex; flex-direction: column;
  align-items: flex-start; text-align: left;
  text-decoration: none; color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition),
              transform var(--transition), background var(--transition);
  overflow: hidden;
}

/* Colored accent bar — always visible, thicker on hover */
.portal-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--c1), var(--c2));
  opacity: .5;
  transition: height var(--transition), opacity var(--transition);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* Subtle corner glow — matches accent */
.portal-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 80% 55% at 50% -10%, color-mix(in srgb, var(--c1) 10%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity var(--transition);
  border-radius: inherit;
}

.portal-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), 0 0 0 1px color-mix(in srgb, var(--c1) 30%, transparent);
  border-color: color-mix(in srgb, var(--c1) 40%, var(--border));
}
.portal-card:hover::before { height: 4px; opacity: 1; }
.portal-card:hover::after  { opacity: 1; }
.portal-card:hover .portal-card__cta { gap: .6rem; }

/* Icon — accent-tinted background + matching ring on hover */
.portal-card__icon {
  display: grid; place-items: center;
  width: 50px; height: 50px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--c1) 14%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--c1) 28%, transparent);
  font-size: 1.5rem; margin-bottom: 1rem;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.portal-card:hover .portal-card__icon {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c1) 18%, transparent);
  border-color: color-mix(in srgb, var(--c1) 55%, transparent);
}

/* Tag label — uses card accent */
.portal-card__tag {
  font-size: .68rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--c1);
}
.portal-card > .portal-card__tag { margin-bottom: .3rem; }

.portal-card__meta-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; width: 100%; margin-bottom: .3rem;
}
.portal-card__health {
  display: inline-flex; align-items: center; gap: .3rem;
  margin-left: auto; padding: .12rem .48rem;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg-subtle); color: var(--text-muted);
  font-size: .66rem; font-weight: 800; line-height: 1.35;
}
.portal-card__health span {
  width: 6px; height: 6px; border-radius: 999px;
  background: currentColor;
}
.portal-card__health.is-online {
  color: var(--success); background: var(--success-bg);
  border-color: color-mix(in srgb, var(--success) 28%, transparent);
}
.portal-card__health.is-offline {
  color: var(--error); background: var(--error-bg);
  border-color: color-mix(in srgb, var(--error) 28%, transparent);
}
.portal-card__title {
  font-size: 1.05rem; font-weight: 700; color: var(--text);
  margin-bottom: .4rem; letter-spacing: -.015em;
}
.portal-card__description {
  font-size: .875rem; color: var(--text-muted);
  line-height: 1.65; flex-grow: 1; margin-bottom: 1.1rem;
}

/* CTA arrow — accent-tinted */
.portal-card__cta {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .875rem; font-weight: 600;
  color: var(--c1);
  transition: gap var(--transition), color var(--transition);
}

/* ── Featured card variant ─────────────────────────────────── */
.portal-card--featured {
  background: linear-gradient(145deg,
    color-mix(in srgb, var(--c1) 12%, var(--bg)),
    color-mix(in srgb, var(--c2) 8%, var(--bg)));
  border-color: color-mix(in srgb, var(--c1) 35%, var(--border));
}
.portal-card--featured::before { opacity: 1; height: 4px; }
.portal-card--featured .portal-card__title { font-size: 1.15rem; }
.portal-card--featured .portal-card__icon  { width: 56px; height: 56px; font-size: 1.65rem; }

/* ── Outlined / ghost card variant ────────────────────────── */
.portal-card--ghost {
  background: transparent;
  border-style: dashed;
  border-color: color-mix(in srgb, var(--c1) 30%, var(--border));
  box-shadow: none;
}
.portal-card--ghost:hover {
  background: color-mix(in srgb, var(--c1) 6%, var(--bg));
}

/* ── 10. Features ────────────────────────────────────────────── */
.portal-features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem; max-width: 1100px; margin: 0 auto;
}
.portal-feature {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-xs);
}
.portal-feature__icon {
  width: 52px; height: 52px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-light), var(--accent-muted));
  border: 1px solid var(--accent-muted);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: .85rem; color: var(--accent); flex-shrink: 0;
}
.portal-feature h3 { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: .3rem; }
.portal-feature p   { color: var(--text-muted); font-size: .875rem; }

/* ── 11. Footer ──────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-subtle); border-top: 1px solid var(--border);
  color: var(--text-muted); font-size: .85rem; padding: 2rem 1.5rem;
}
.site-footer a { color: var(--text-muted); text-decoration: none; transition: color var(--transition); }
.site-footer a:hover { color: var(--text); }
.site-footer__inner {
  max-width: var(--site-shell-width); margin: 0 auto;
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 1rem 2rem; align-items: center;
}
.site-footer__brand { display: flex; flex-direction: column; gap: .2rem; }
.site-footer__title { color: var(--text); font-weight: 600; font-size: .9rem; }
.site-footer__tagline { font-size: .8rem; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; justify-content: center; }
.site-footer__copy { text-align: right; font-size: .8rem; }

/* ── 12. Legal pages ─────────────────────────────────────────── */
.legal-page { max-width: 720px; margin: 3rem auto; padding: 0 1.5rem; }
.legal-page h1 {
  font-size: 1.9rem; font-weight: 700; color: var(--text);
  margin-bottom: .4rem; letter-spacing: -.02em;
}
.legal-page h2 {
  font-size: 1.05rem; font-weight: 700;
  margin-top: 2rem; margin-bottom: .5rem;
  color: var(--accent); border-bottom: 1px solid var(--border); padding-bottom: .35rem;
}
.legal-page h3 {
  font-size: .95rem; font-weight: 600;
  margin-top: 1rem; margin-bottom: .25rem; color: var(--text-muted);
}
.legal-page p, .legal-page address, .legal-page li {
  color: var(--text-muted); font-size: .95rem; margin-bottom: .75rem;
}
.legal-page ul { padding-left: 1.25rem; }
.legal-page .lead-text { font-size: 1.05rem; color: var(--text); margin-bottom: 0; }
.legal-page a { color: var(--accent); }
.legal-page a:hover { color: var(--accent-hover); }

.content-expand-list {
  display: grid;
  gap: .75rem;
  margin: 1.25rem 0;
}

.content-expand-card {
  display: block;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}

.content-expand-card > summary {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .9rem 1rem;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.content-expand-card > summary::-webkit-details-marker {
  display: none;
}

.content-expand-card > summary::after {
  content: "+";
  margin-left: auto;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.content-expand-card[open] > summary::after {
  content: "-";
}

.content-expand-card__body {
  padding: 0 1rem 1rem;
  color: var(--text-muted);
}

.content-expand-card__body > :last-child {
  margin-bottom: 0;
}

.software-showcase {
  margin-top: 2rem;
}

.software-showcase .portal-cards {
  margin-top: 1rem;
}

.software-showcase__card {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--bg-subtle)) 0%, var(--bg) 100%);
}

.software-showcase__icon svg {
  width: 24px;
  height: 24px;
}

.legal-hero {
  display: flex; align-items: flex-start; gap: 1.1rem;
  padding: 1.75rem 1.5rem; margin-bottom: 2rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong, var(--border)); border-radius: var(--radius-lg);
}
.legal-hero__icon {
  flex-shrink: 0; width: 52px; height: 52px; border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--accent); display: flex; align-items: center; justify-content: center;
}

.legal-summary {
  background: var(--bg-subtle); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: var(--radius);
  padding: 1rem 1.25rem; margin-bottom: 2rem;
}
.legal-summary__label {
  font-size: .7rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .5rem;
}
.legal-summary ul { padding-left: 1.1rem; margin: 0; }
.legal-summary li { font-size: .9rem; color: var(--text-muted); margin-bottom: .3rem; }

/* ── 13. Auth pages ──────────────────────────────────────────── */
.auth-wrap {
  min-height: calc(100vh - 60px); display: grid; place-items: center;
  padding: 3rem 1.25rem; background: var(--bg-subtle);
}
.auth-box {
  width: 100%; max-width: 420px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem 1.75rem 1.75rem;
  box-shadow: var(--shadow);
}
.auth-box--wide { max-width: 500px; }
.auth-logo { font-size: 1.4rem; font-weight: 700; color: var(--text); text-align: center; letter-spacing: -.02em; }
.auth-logo span { color: var(--accent); }
.auth-tagline { text-align: center; color: var(--text-muted); font-size: .875rem; margin: .3rem 0 1.5rem; }
.auth-divider { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }
.auth-footer-link { text-align: center; font-size: .875rem; color: var(--text-muted); margin-top: 1.1rem; }
.auth-footer-link a { color: var(--accent); font-weight: 600; text-decoration: none; }
.auth-footer-link a:hover { text-decoration: underline; }

/* ── 14. Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.form-label {
  display: block; font-size: .82rem; font-weight: 600;
  color: var(--text); margin-bottom: .35rem;
}
.form-label span { color: var(--error); }
.form-control {
  display: block; width: 100%; padding: .575rem .825rem;
  font-family: var(--font); font-size: .9rem; line-height: 1.5;
  color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-control::placeholder { color: var(--text-faint); }
.form-check { display: inline-flex; align-items: center; gap: .5rem; font-size: .875rem; color: var(--text-muted); cursor: pointer; }
.form-help { display: block; color: var(--text-faint); font-size: .8rem; margin-top: .3rem; }
.text-danger { color: var(--error); font-size: .8rem; margin-top: .25rem; display: block; }

/* ── 15. Alerts & badges ─────────────────────────────────────── */
.alert {
  padding: .75rem 1rem; border-radius: var(--radius-sm);
  font-size: .875rem; margin-bottom: 1rem;
}
.alert-error,
.alert-danger  { background: var(--error-bg);   color: var(--error-text); border: 1px solid rgba(220,38,38,.2); }
.alert-success { background: var(--success-bg); color: var(--success);    border: 1px solid rgba(22,163,74,.2); }
.alert-info    { background: var(--accent-light); color: var(--accent);   border: 1px solid var(--accent-muted); }

.badge {
  padding: .2rem .65rem; border-radius: 999px; display: inline-block;
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}
.badge-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(22,163,74,.2); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(217,119,6,.2); }

/* ── 16. Page container ──────────────────────────────────────── */
.page-container { max-width: var(--site-shell-width); margin: 0 auto; padding: 2.5rem 1.5rem; }
.page-header    { margin-bottom: 2rem; }
.page-header h1 {
  font-size: 1.6rem; font-weight: 700; color: var(--text);
  letter-spacing: -.02em; margin-bottom: .35rem;
}
.page-header p { color: var(--text-muted); font-size: .95rem; }

/* Dashboard task board */
.dashboard-section-title {
  display: flex; align-items: center; gap: .5rem;
  font-size: 1.05rem; font-weight: 700; color: var(--text);
  letter-spacing: -.01em; margin: 0;
}
.dashboard-board-shell__header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: .9rem;
}
.dashboard-board-shell {
  margin-top: 1.5rem; padding: 1rem;
  background: color-mix(in srgb, var(--bg-subtle) 72%, transparent);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.dashboard-board-shell__header p {
  margin-top: .25rem; color: var(--text-muted); font-size: .9rem;
}
.dashboard-board-shell__actions {
  display: flex; align-items: center; gap: .55rem; flex-wrap: wrap;
}
.dashboard-board-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: .75rem; padding: .65rem .75rem;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted); font-size: .82rem;
}
.dashboard-board-toolbar > span:first-child {
  color: var(--text); font-weight: 700;
}
.dashboard-board-toolbar__hint { color: var(--text-faint); }
.dashboard-icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; min-height: 30px; padding: .25rem .45rem;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg); color: var(--text-muted);
  font-size: .72rem; font-weight: 700; cursor: pointer;
  transition: var(--transition);
}
.dashboard-icon-button:hover {
  border-color: var(--accent); color: var(--accent);
  background: var(--accent-light);
}
.dashboard-icon-button--danger:hover {
  border-color: var(--error); color: var(--error);
  background: var(--error-bg);
}
/* Compact project dashboard */
.portal-project-dashboard {
  --dashboard-accent: #ad4e3d;
  --dashboard-accent-hover: #923e31;
  --dashboard-accent-soft: #fbf2ef;
  display: grid;
  gap: 2.35rem;
  padding: clamp(1.35rem, 3vw, 2.5rem) 0 3.5rem;
}

.portal-project-dashboard__header {
  position: static;
  display: flex;
  grid-template-columns: none;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  overflow: visible;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.portal-project-dashboard__header::before {
  display: none;
}

.portal-project-dashboard__heading {
  min-width: 0;
}

.portal-project-dashboard__title {
  margin: 0;
  color: var(--text);
  font-size: clamp(2rem, 3.2vw, 2.65rem);
  font-weight: 760;
  letter-spacing: -.045em;
  line-height: 1.05;
}

.portal-project-dashboard__intro {
  margin: .55rem 0 0;
  color: var(--text-muted);
  font-size: .98rem;
  line-height: 1.55;
}

.portal-project-dashboard__count {
  margin: .42rem 0 0;
  color: var(--text-faint);
  font-size: .82rem;
  font-weight: 650;
}

.portal-project-dashboard__new-project {
  min-height: 46px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .72rem 1.05rem;
  border-color: var(--dashboard-accent);
  background: var(--dashboard-accent);
  box-shadow: 0 5px 14px color-mix(in srgb, var(--dashboard-accent) 18%, transparent);
}

.portal-project-dashboard__new-project:hover {
  border-color: var(--dashboard-accent-hover);
  background: var(--dashboard-accent-hover);
}

.portal-project-dashboard__new-project[hidden] {
  display: none;
}

.portal-project-dashboard__grid {
  display: grid;
  gap: 2.25rem;
}

.portal-project-collection {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.portal-project-collection__heading {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: .65rem;
  min-height: 32px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: none;
}

.portal-project-collection__heading .portal-project-collection__title {
  margin: 0;
  padding-bottom: .7rem;
  color: var(--text);
  font-size: 1rem;
  font-weight: 730;
  letter-spacing: -.015em;
  white-space: nowrap;
}

.portal-project-collection__heading > .portal-project-collection__count {
  min-width: 1.55rem;
  height: 1.55rem;
  display: inline-grid;
  place-items: center;
  margin-bottom: .7rem;
  padding: 0 .42rem;
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 750;
}

.portal-project-collection__cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.portal-project-collection__empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 2.75rem 1rem;
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  color: var(--text-muted);
  text-align: center;
}

.portal-project-card {
  position: relative;
  min-width: 0;
  min-height: 254px;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 1.35rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.portal-project-card:hover {
  border-color: color-mix(in srgb, var(--dashboard-accent) 48%, var(--border));
  box-shadow: 0 9px 24px rgba(15, 23, 42, .07);
  transform: translateY(-1px);
}

.portal-project-card__header {
  display: block;
  grid-template-columns: none;
  min-width: 0;
}

.portal-project-card__title {
  overflow: hidden;
  margin: 0;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 740;
  letter-spacing: -.022em;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-project-card__description {
  overflow: hidden;
  margin: .42rem 0 0;
  color: var(--text-muted);
  font-size: .82rem;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-project-card__progress-row {
  display: grid;
  grid-template-columns: auto minmax(52px, 1fr) auto;
  align-items: center;
  gap: .7rem;
  margin-top: 1.35rem;
}

.portal-project-card__progress-value {
  color: var(--dashboard-accent);
  font-size: .78rem;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
}

.portal-project-card__progress {
  overflow: hidden;
  height: 4px;
  border-radius: 999px;
  background: var(--bg-elevated);
}

.portal-project-card__progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--dashboard-accent);
  transition: width .25s ease;
}

.portal-project-card__task-count {
  color: var(--text-faint);
  font-size: .72rem;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.portal-project-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin-top: 1.2rem;
  min-height: 32px;
}

.portal-project-card__facts {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .8rem;
}

.portal-project-card__fact {
  display: inline-flex;
  align-items: center;
  gap: .33rem;
  color: var(--text-muted);
  font-size: .73rem;
  font-weight: 620;
  white-space: nowrap;
}

.portal-project-card__fact svg {
  width: 15px;
  height: 15px;
  color: var(--text-faint);
}

.portal-project-card__avatars {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  padding-left: .4rem;
}

.portal-project-card__avatar {
  width: 29px;
  height: 29px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  margin-left: -.4rem;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: var(--dashboard-accent-soft);
  color: var(--dashboard-accent);
  font-size: .62rem;
  font-weight: 780;
  line-height: 1;
}

.portal-project-card__avatar:first-child {
  margin-left: 0;
}

.portal-project-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portal-project-card__avatar--more {
  background: var(--bg-elevated);
  color: var(--text-muted);
}

.portal-project-card__actions {
  display: grid;
  grid-template-columns: minmax(0, 170px) 44px;
  justify-content: space-between;
  gap: .55rem;
  margin-top: auto;
  padding-top: 1.25rem;
}

.portal-project-card__open,
.portal-project-card__menu-trigger {
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg);
  color: var(--text);
}

.portal-project-card__open {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  padding: .65rem .85rem;
  border-color: var(--dashboard-accent);
  background: var(--dashboard-accent);
  color: #fff;
  text-decoration: none;
  font-size: .8rem;
  font-weight: 720;
}

.portal-project-card__open svg {
  width: 16px;
  height: 16px;
  color: currentColor;
}

.portal-project-card__open:hover,
.portal-project-card__open:focus-visible {
  border-color: var(--dashboard-accent-hover);
  background: var(--dashboard-accent-hover);
  color: #fff;
}

.portal-project-card__menu-wrap {
  position: relative;
}

.portal-project-card__menu-trigger {
  width: 44px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
}

.portal-project-card__menu-trigger svg {
  width: 19px;
  height: 19px;
}

.portal-project-card__menu-trigger:hover,
.portal-project-card__menu-trigger:focus-visible,
.portal-project-card__menu-trigger[aria-expanded="true"] {
  border-color: var(--dashboard-accent);
  background: var(--dashboard-accent-soft);
  color: var(--dashboard-accent);
}

.portal-project-card__menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + .45rem);
  z-index: 12;
  min-width: 175px;
  padding: .35rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  box-shadow: var(--shadow);
}

.portal-project-card__menu button {
  width: 100%;
  min-height: 40px;
  padding: .55rem .7rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: .8rem;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

.portal-project-card__menu button:hover,
.portal-project-card__menu button:focus-visible {
  background: var(--dashboard-accent-soft);
  color: var(--dashboard-accent-hover);
  outline: none;
}

.portal-project-card :focus-visible,
.portal-project-dashboard__new-project:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--dashboard-accent) 38%, transparent);
  outline-offset: 2px;
}

.portal-project-drawer {
  --drawer-accent: #ad4e3d;
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  grid-template-columns: 1fr minmax(360px, 490px);
  visibility: hidden;
  pointer-events: none;
}

.portal-project-drawer.is-open {
  visibility: visible;
  pointer-events: auto;
}

.portal-project-drawer__backdrop {
  grid-column: 1 / -1;
  grid-row: 1;
  border: 0;
  background: rgba(15, 23, 42, .38);
  opacity: 0;
  cursor: default;
  transition: opacity .2s ease;
}

.portal-project-drawer.is-open .portal-project-drawer__backdrop {
  opacity: 1;
}

.portal-project-drawer__panel {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  height: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  box-shadow: -18px 0 45px rgba(15, 23, 42, .15);
  transform: translateX(100%);
  transition: transform .24s ease;
}

.portal-project-drawer.is-open .portal-project-drawer__panel {
  transform: translateX(0);
}

.portal-project-drawer__header {
  min-height: 92px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 1.5rem 1.15rem;
  border-bottom: 1px solid var(--border);
}

.portal-project-drawer__eyebrow {
  display: block;
  margin-bottom: .3rem;
  color: var(--drawer-accent);
  font-size: .7rem;
  font-weight: 780;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.portal-project-drawer__header h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.25rem;
  letter-spacing: -.025em;
}

.portal-project-drawer__close {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.portal-project-drawer__content {
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  align-content: start;
  gap: 1.35rem;
  padding: 1.35rem 1.5rem 2.5rem;
}

.portal-project-drawer__section {
  display: grid;
  gap: .75rem;
}

.portal-project-drawer__section h3,
.portal-project-assignment__heading h3 {
  margin: 0;
  color: var(--text);
  font-size: .84rem;
  font-weight: 760;
  letter-spacing: .01em;
}

.portal-project-drawer__board-list,
.portal-project-drawer__member-list {
  display: grid;
  gap: .55rem;
}

.portal-project-drawer__board {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .65rem .75rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  font-size: .82rem;
  font-weight: 650;
}

.portal-project-drawer__board svg {
  width: 16px;
  height: 16px;
  color: var(--drawer-accent);
}

.portal-project-drawer__member {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: .65rem;
  padding: .65rem 0;
  border-bottom: 1px solid var(--border);
}

.portal-project-drawer__member:last-child {
  border-bottom: 0;
}

.portal-project-drawer__member .portal-project-card__avatar {
  width: 34px;
  height: 34px;
  margin: 0;
}

.portal-project-drawer__member > span:last-child,
.portal-project-assignment__access-info {
  min-width: 0;
  display: grid;
  gap: .1rem;
}

.portal-project-drawer__member strong,
.portal-project-drawer__member small,
.portal-project-assignment__access-info strong,
.portal-project-assignment__access-info small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-project-drawer__member strong,
.portal-project-assignment__access-info strong {
  color: var(--text);
  font-size: .8rem;
}

.portal-project-drawer__member small,
.portal-project-assignment__access-info small {
  color: var(--text-muted);
  font-size: .7rem;
}

.portal-project-drawer__empty {
  margin: 0;
  padding: .8rem 0;
  color: var(--text-muted);
  font-size: .8rem;
}

.portal-project-drawer__invite {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-subtle);
}

.portal-project-drawer__invite span {
  color: var(--text-muted);
  font-size: .76rem;
}

.portal-project-drawer .btn-rust {
  border-color: var(--drawer-accent);
  background: var(--drawer-accent);
}

.portal-project-drawer .btn-rust:hover {
  background: #923e31;
}

.portal-project-assignment {
  display: grid;
  gap: .9rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.portal-project-assignment__heading {
  display: grid;
  gap: .25rem;
}

.portal-project-assignment__heading p,
.portal-project-assignment__empty {
  margin: 0;
  color: var(--text-muted);
  font-size: .75rem;
  line-height: 1.45;
}

.portal-project-assignment__label,
.portal-project-assignment__boards > p {
  margin: 0;
  color: var(--text-muted);
  font-size: .7rem;
  font-weight: 760;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.portal-project-assignment__boards,
.portal-project-assignment__users {
  display: grid;
  gap: .45rem;
}

.portal-project-assignment__board-item,
.portal-project-assignment__add-panel {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}

.portal-project-assignment__board-header {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .65rem .75rem;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: .78rem;
  text-align: left;
  cursor: pointer;
}

.portal-project-assignment__board-header:hover,
.portal-project-assignment__board-header:focus-visible {
  background: var(--bg-subtle);
}

.portal-project-assignment__chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform var(--transition);
}

.portal-project-assignment__board-item.is-expanded .portal-project-assignment__chevron {
  transform: rotate(225deg);
}

.portal-project-assignment__board-users {
  display: grid;
  gap: .25rem;
  padding: .35rem .7rem .7rem;
  border-top: 1px solid var(--border);
}

.portal-project-assignment__access-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 92px;
  align-items: center;
  gap: .55rem;
  padding: .45rem 0;
}

.portal-project-assignment__access-row .portal-project-card__avatar {
  width: 30px;
  height: 30px;
  margin: 0;
}

.portal-project-assignment__access {
  min-height: 36px;
  padding: .35rem .45rem;
  font-size: .72rem;
}

.portal-project-assignment__add-toggle {
  min-height: 42px;
  padding: .6rem .75rem;
  border: 1px dashed var(--border-strong);
  border-radius: 9px;
  background: transparent;
  color: var(--drawer-accent);
  font: inherit;
  font-size: .78rem;
  font-weight: 720;
  text-align: left;
  cursor: pointer;
}

.portal-project-assignment__add-toggle:hover,
.portal-project-assignment__add-toggle:focus-visible {
  border-color: var(--drawer-accent);
  background: color-mix(in srgb, var(--drawer-accent) 7%, var(--bg));
}

.portal-project-assignment__add-panel {
  display: grid;
  gap: .75rem;
  padding: .8rem;
}

.portal-project-assignment__users {
  max-height: 180px;
  overflow-y: auto;
}

.portal-project-assignment__user {
  min-height: 42px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: .55rem;
  padding: .4rem .5rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.portal-project-assignment__user:hover,
.portal-project-assignment__user:focus-visible,
.portal-project-assignment__user.is-selected {
  border-color: var(--drawer-accent);
  background: color-mix(in srgb, var(--drawer-accent) 7%, var(--bg));
}

.portal-project-assignment__user .portal-project-card__avatar {
  width: 30px;
  height: 30px;
  margin: 0;
}

.portal-project-assignment__field {
  display: grid;
  gap: .35rem;
}

.portal-project-assignment__field label {
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 700;
}

.portal-project-assignment__board {
  min-width: 0;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 84px;
  align-items: center;
  gap: .55rem;
  padding: .55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.portal-project-assignment__board-name {
  min-width: 0;
  display: grid;
  gap: .05rem;
}

.portal-project-assignment__board-name strong,
.portal-project-assignment__board-name small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-project-assignment__board-name strong {
  color: var(--text);
  font-size: .75rem;
}

.portal-project-assignment__board-name small {
  color: var(--text-faint);
  font-size: .66rem;
}

.portal-project-assignment__submit {
  width: 100%;
  min-height: 42px;
}

.has-project-drawer {
  overflow: hidden;
}

@media (max-width: 1100px) {
  .portal-project-collection__cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .portal-project-dashboard {
    gap: 1.65rem;
    padding-top: 1rem;
  }

  .portal-project-dashboard__header {
    align-items: stretch;
    flex-direction: column;
    gap: 1rem;
  }

  .portal-project-dashboard__title {
    font-size: 2rem;
  }

  .portal-project-dashboard__new-project {
    align-self: flex-start;
  }

  .portal-project-collection__cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .portal-project-card {
    min-height: 246px;
  }

  .portal-project-drawer {
    grid-template-columns: minmax(0, 1fr);
  }

  .portal-project-drawer__panel {
    grid-column: 1;
  }

  .portal-project-drawer__backdrop {
    display: none;
  }

  .portal-project-drawer__header,
  .portal-project-drawer__content {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portal-project-card,
  .portal-project-card__progress > span,
  .portal-project-drawer__backdrop,
  .portal-project-drawer__panel,
  .portal-project-assignment__chevron {
    transition: none;
  }
}

.dashboard-modal {
  position: fixed; inset: 0; z-index: 220; display: none;
  align-items: center; justify-content: center; padding: 1rem;
}
.dashboard-modal.is-open { display: flex; }
.dashboard-modal__backdrop {
  position: absolute; inset: 0; background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(6px);
}
.dashboard-modal__panel {
  position: relative; z-index: 1; width: min(100%, 680px);
  max-height: min(92vh, 760px); overflow-y: auto;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 1rem;
}
.dashboard-modal__panel--small { width: min(100%, 420px); padding: .8rem; }
.dashboard-modal__panel--task { width: min(100%, 760px); }
.dashboard-modal__header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; padding-bottom: .6rem; margin-bottom: .65rem;
  border-bottom: 1px solid var(--border);
}
.dashboard-modal__header h2 {
  margin: 0; color: var(--text); font-size: 1.05rem; font-weight: 800;
}
.dashboard-modal__header p {
  margin-top: .18rem; color: var(--text-muted); font-size: .84rem;
}
.task-modal-dirty {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  margin-top: .35rem;
  color: var(--warning-text, #92400e);
  font-size: .72rem;
  font-weight: 750;
}
.task-modal-dirty[hidden] { display: none; }
.task-modal-dirty::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--warning, #f59e0b);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--warning, #f59e0b) 18%, transparent);
}
.dashboard-task-form {
  display: flex; flex-direction: column; gap: .9rem;
}
.task-form-section-heading {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding-top: .15rem;
}
.task-form-section-heading > span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: .76rem;
  font-weight: 800;
}
.task-form-section-heading div { display: grid; gap: .05rem; }
.task-form-section-heading strong { color: var(--text); font-size: .86rem; }
.task-form-section-heading small { color: var(--text-muted); font-size: .75rem; }
.task-form-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
}
.task-form-label-row > span {
  color: var(--text-faint);
  font-size: .68rem;
  font-variant-numeric: tabular-nums;
}
.task-form-help {
  display: block;
  margin-top: .3rem;
  color: var(--text-faint);
  font-size: .72rem;
  line-height: 1.35;
}
.dashboard-task-form__grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem;
}

.dashboard-task-location {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .72rem .8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}

.dashboard-task-location__label {
  display: block;
  color: var(--text-faint);
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.dashboard-task-location strong {
  display: block;
  color: var(--text);
  font-size: .9rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.dashboard-task-location__change {
  flex-shrink: 0;
}
.task-workflow-hint {
  grid-column: 1 / -1;
  padding: .7rem .8rem;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent-light) 70%, var(--bg));
  color: var(--text-muted);
  font-size: .76rem;
  line-height: 1.45;
}
.task-workflow-hint::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: .45rem;
  border-radius: 999px;
  background: var(--success);
  vertical-align: .05em;
}
.task-workflow-hint.is-disabled::before { background: var(--text-faint); }
.task-workflow-hint.is-warning {
  border-color: color-mix(in srgb, var(--warning) 35%, var(--border));
  background: color-mix(in srgb, var(--warning-bg) 78%, var(--bg));
  color: var(--warning);
}
.task-workflow-hint.is-warning::before { background: var(--warning); }
.dashboard-color-input {
  height: 44px; padding: .25rem;
}
.dashboard-modal__actions {
  display: flex; justify-content: flex-end; gap: .6rem;
  padding-top: .4rem;
}

/* TaskFlow-style dashboard board */
.dashboard-page-container {
  max-width: none;
  padding-top: 1rem;
}
.dashboard-taskflow {
  --tf-bg: var(--bg);
  --tf-surface: var(--surface);
  --tf-surface-2: var(--bg-subtle);
  --tf-surface-3: var(--bg-elevated);
  --tf-border: var(--border);
  --tf-border-strong: var(--border-strong);
  --tf-text: var(--text);
  --tf-text-muted: var(--text-muted);
  --tf-text-faint: var(--text-faint);
  --tf-accent: var(--accent);
  --tf-accent-soft: var(--accent-light);
  --tf-success-soft: var(--success-bg);
  --tf-radius-card: var(--radius);
  --tf-radius-col: var(--radius-lg);
  min-height: 600px;
  margin-top: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--tf-bg);
  border: 1px solid var(--tf-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  color: var(--tf-text);
}
.dashboard-taskflow__topbar {
  margin: 0;
  padding: .7rem 1.1rem .65rem;
  align-items: center;
  background: color-mix(in srgb, var(--tf-surface) 88%, var(--tf-bg));
  border-bottom: 1px solid var(--tf-border);
}
.dashboard-taskflow__brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-width: 0;
}
.dashboard-taskflow__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: var(--radius);
  background: var(--tf-accent);
  color: var(--accent-fg);
  font-weight: 900;
}
.dashboard-taskflow__eyebrow {
  margin: 0 0 .05rem;
  color: var(--tf-text-faint);
  font-size: .72rem;
  font-weight: 700;
}
.dashboard-taskflow .dashboard-section-title {
  margin: 0;
  color: var(--tf-text);
  font-size: 1.24rem;
  line-height: 1.1;
  letter-spacing: -.02em;
}

.dashboard-taskflow__lede {
  max-width: 58ch;
  margin: .34rem 0 0;
  color: var(--tf-text-muted);
  font-size: .8rem;
  line-height: 1.52;
}

.dashboard-taskflow__workspace-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .55rem;
  padding: .6rem 1.1rem;
  border-bottom: 1px solid var(--tf-border);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--tf-surface-3) 88%, transparent), color-mix(in srgb, var(--tf-surface) 82%, transparent));
}

.dashboard-taskflow__workspace-stat {
  display: grid;
  gap: .14rem;
  min-width: 0;
  min-height: 0;
  align-content: start;
  padding: .52rem .65rem;
  border: 1px solid var(--tf-border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--tf-surface) 84%, var(--tf-bg));
  box-shadow: var(--shadow-sm);
}

.dashboard-taskflow__workspace-stat span,
.dashboard-taskflow__workspace-stat small {
  color: var(--tf-text-faint);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.dashboard-taskflow__workspace-stat strong {
  min-width: 0;
  color: var(--tf-text);
  font-size: 1.2rem;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -.03em;
}

.dashboard-taskflow__workspace-stat small {
  text-transform: none;
  letter-spacing: 0;
  font-size: .73rem;
  line-height: 1.35;
}

.dashboard-taskflow__workspace-stat--scope {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--tf-accent-soft) 82%, transparent), color-mix(in srgb, var(--tf-surface) 88%, transparent));
}
.dashboard-taskflow .dashboard-board-shell__actions {
  gap: .45rem;
}
.dashboard-taskflow__button {
  min-height: 34px;
  border-radius: var(--radius-sm);
  font-size: .78rem;
}
.dashboard-taskflow__button[data-dashboard-manage-access] {
  border-color: color-mix(in srgb, var(--tf-accent) 34%, var(--tf-border));
  background: color-mix(in srgb, var(--tf-accent-soft) 70%, var(--tf-surface));
  color: var(--tf-accent);
  font-weight: 800;
}
.dashboard-taskflow__button--primary {
  background: var(--tf-accent);
  border-color: var(--tf-accent);
}
.dashboard-taskflow .dashboard-board-toolbar {
  margin: 0;
  padding: .4rem 1.1rem;
  border: 0;
  border-bottom: 1px solid var(--tf-border);
  border-radius: 0;
  background: color-mix(in srgb, var(--tf-surface-2) 76%, var(--tf-surface));
  color: var(--tf-text-muted);
  font-size: .72rem;
}
.dashboard-taskflow .dashboard-board-toolbar > span:first-child {
  color: var(--tf-text);
}
.dashboard-taskflow .dashboard-board-toolbar__hint {
  color: var(--tf-text-faint);
}
.dashboard-taskflow__main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--tf-bg);
}
/* ── 17b. Project member badge & member list modal ───────────── */
/* Member list inside the modal */
.member-management-shell {
  display: grid;
  gap: .55rem;
}

.member-list-wrap {
  margin-bottom: .6rem;
}
.member-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .32rem;
  margin-bottom: .35rem;
}
.member-list__item {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .48rem .6rem;
  background: var(--bg-subtle);
  border: 1px solid color-mix(in srgb, var(--accent) 8%, var(--border));
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.member-list__avatar {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  overflow: hidden;
  border-radius: 999px;
  color: var(--accent-fg);
  font-size: .78rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-gradient-to));
}
.member-list__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .08rem;
}
.member-list__name {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.member-list__role {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .1rem .42rem;
  border-radius: 999px;
  width: fit-content;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid var(--accent-muted);
}
.member-list__role--manager {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 28%, transparent);
}

.member-list__role--neutral {
  background: color-mix(in srgb, var(--bg) 82%, var(--bg-subtle));
  color: var(--text-muted);
  border-color: var(--border);
}

.member-list__select {
  min-height: 36px;
}

.member-list__item--board-member {
  margin-top: .4rem;
  margin-left: 1rem;
}

.member-board-access {
  display: grid;
  gap: .8rem;
  padding: .9rem;
  border: 1px solid color-mix(in srgb, var(--accent) 10%, var(--border));
  border-radius: var(--radius);
  background: var(--bg);
}

.member-board-access__summary {
  display: grid;
  gap: .25rem;
}

.member-board-access__controls {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
}

.member-board-access__select {
  min-height: 36px;
}
.member-list-empty {
  color: var(--text-faint);
  font-size: .875rem;
  padding: .5rem 0;
}
.member-add-section__label {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-faint);
  margin-bottom: .5rem;
  padding-top: .5rem;
  border-top: 1px solid var(--border);
}

.member-add-section--composer {
  margin-top: .2rem;
  padding-top: .6rem;
  border-top: 1px solid var(--border);
}

.member-add-section--composer .dashboard-task-form {
  gap: .55rem;
}

.member-add-section--composer .dashboard-task-form .form-group {
  margin: 0;
}

.member-add-section--composer .dashboard-task-form > .form-group:nth-of-type(1),
.member-add-section--composer .dashboard-task-form > .form-group:nth-of-type(2) {
  display: inline-grid;
}

@media (min-width: 460px) {
  .member-add-section--composer .dashboard-task-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .55rem .6rem;
  }
  .member-add-section--composer .dashboard-task-form .dashboard-modal__actions {
    grid-column: 1 / -1;
  }
}

/* ── Assignee expandable picker ────────────────────────────── */
.assignee-picker {
  position: relative;
}
.assignee-picker__trigger {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; min-height: 40px;
  padding: .45rem .75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: inherit; font-size: .9rem;
  cursor: pointer; text-align: left;
  gap: .5rem;
  transition: border-color .15s;
}
.assignee-picker__trigger:hover,
.assignee-picker.is-open .assignee-picker__trigger {
  border-color: var(--accent);
  outline: none;
}
.assignee-picker__trigger:disabled {
  opacity: .5; cursor: not-allowed;
}
.assignee-picker__preview {
  display: flex; align-items: center; gap: .3rem; flex: 1; flex-wrap: wrap;
}
.assignee-picker__placeholder {
  color: var(--text-muted); font-size: .88rem;
}
.assignee-picker__summary-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: var(--accent-fg);
  font-size: .7rem; font-weight: 600; letter-spacing: .02em;
  flex-shrink: 0;
}
.assignee-picker__more {
  font-size: .78rem; color: var(--text-muted);
  padding: 0 .2rem;
}
.assignee-picker__chevron {
  flex-shrink: 0; color: var(--text-muted);
  transition: transform .2s;
}
.assignee-picker.is-open .assignee-picker__chevron {
  transform: rotate(180deg);
}
.assignee-picker__dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 200;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 220px; overflow-y: auto;
  padding: .35rem 0;
}
.assignee-picker__divider {
  height: 1px; background: var(--border);
  margin: .3rem 0;
}
.assignee-picker__item {
  display: flex; align-items: center; gap: .6rem;
  padding: .45rem .75rem;
  cursor: pointer; user-select: none;
  border-radius: 4px; margin: 0 .25rem;
  transition: background .12s;
}
.assignee-picker__item:hover {
  background: var(--bg-subtle);
}
.assignee-picker__item--all {
  font-weight: 600;
}
.assignee-picker__checkbox {
  width: 15px; height: 15px; flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.assignee-picker__avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: var(--accent-fg);
  font-size: .68rem; font-weight: 600; flex-shrink: 0;
  overflow: hidden;
}
.assignee-picker__item--all .assignee-picker__avatar {
  display: none;
}
.assignee-picker__item-name {
  font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.assignee-picker__empty {
  padding: .6rem .75rem; font-size: .88rem; color: var(--text-muted);
}

/* ── 17c. Task detail modal ─────────────────────────────────── */
.task-progress-readonly {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-height: 40px;
  padding: .45rem .65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: .84rem;
  font-weight: 700;
}
.task-progress-readonly__bar {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  overflow: hidden;
}
.task-progress-readonly__bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width .2s ease;
}
.task-subtask-editor {
  display: grid;
  gap: .55rem;
  margin-top: .9rem;
  padding-top: .9rem;
  border-top: 1px solid var(--border);
}
.task-subtask-editor__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.task-subtask-editor__add {
  min-height: 30px;
  padding: .35rem .7rem;
  font-size: .76rem;
}
.task-subtask-editor__new,
.task-subtask-editor__list {
  display: grid;
}
.task-subtask-editor__list {
  gap: .4rem;
}
.task-subtask-editor__row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 30px;
  align-items: center;
  gap: .45rem;
}
.task-subtask-editor__title {
  min-width: 0;
}
.task-subtask-editor__empty {
  margin: 0;
  padding: .6rem .7rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-faint);
  font-size: .84rem;
}
.task-status-button {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  cursor: pointer;
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.task-status-button:hover,
.task-status-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  outline: none;
}
.task-status-button span {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
}
.task-status-button--not-started span { background: var(--bg); }
.task-status-button--in-progress span { background: var(--warning-bg); border-color: var(--warning); }
.task-status-button--done span { background: var(--success-bg); border-color: var(--success); }
.task-status-button--review-needed span { background: var(--error-bg); border-color: var(--error); }

.dashboard-modal__panel--wide { max-width: 860px; }

.task-detail {
  display: grid;
  grid-template-columns: 1fr 300px;
  min-height: 460px;
  max-height: calc(100vh - 8rem);
}

.task-detail__main {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .9rem;
  overflow-y: auto;
  border-right: 1px solid var(--border);
}

.task-detail__topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
}

.task-detail__tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
}

.task-detail__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin: 0;
}

.task-detail__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.task-detail__chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .73rem;
  font-weight: 600;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.task-detail__chip--priority-high { background: var(--error-bg); border-color: color-mix(in srgb, var(--error) 30%, var(--border)); color: var(--error); }
.task-detail__chip--priority-med  { background: var(--warning-bg); border-color: color-mix(in srgb, var(--warning) 35%, var(--border)); color: var(--warning); }
.task-detail__chip--priority-low  { background: var(--success-bg); border-color: color-mix(in srgb, var(--success) 30%, var(--border)); color: var(--success); }
.task-detail__chip--due     { background: var(--accent-light); border-color: var(--accent-muted); color: var(--accent); }
.task-detail__chip--assignee { background: var(--bg-elevated); }
.task-detail__chip--locked { background: var(--accent-light); border-color: var(--accent-muted); color: var(--accent-hover); }

.task-detail__description {
  color: var(--text-muted);
  font-size: .925rem;
  line-height: 1.65;
  white-space: pre-wrap;
  margin: 0;
}

.task-detail__progress-wrap {
  display: flex;
  align-items: center;
  gap: .65rem;
}

.task-detail__progress-bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  overflow: hidden;
}
.task-detail__progress-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .3s ease;
}

.task-detail__progress-label {
  font-size: .78rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.task-detail__footer {
  margin-top: auto;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
}

/* Comments panel */
.task-detail__comments-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-subtle);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  overflow: hidden;
}

.task-detail__tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}
.task-detail__tab {
  min-height: 46px;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.task-detail__tab:last-child {
  border-right: 0;
}
.task-detail__tab:hover,
.task-detail__tab.is-active {
  color: var(--accent);
  background: var(--accent-light);
}
.task-detail__tab-panel {
  display: none;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}
.task-detail__tab-panel.is-active {
  display: flex;
}

.task-detail__comments-heading {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  padding: 1rem 1.1rem .6rem;
  border-bottom: 1px solid var(--border);
  margin: 0;
  flex-shrink: 0;
}

.task-comments-list {
  flex: 1;
  overflow-y: auto;
  padding: .5rem .9rem;
  display: flex;
  flex-direction: column;
  gap: .1rem;
  min-height: 120px;
}

.task-comments-empty {
  font-size: .85rem;
  color: var(--text-faint);
  text-align: center;
  padding: 1.5rem 0;
}

.task-comment {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--border);
}
.task-comment:last-child { border-bottom: none; }

.task-comment__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.task-comment__body { flex: 1; min-width: 0; }

.task-comment__header {
  display: flex;
  align-items: baseline;
  gap: .4rem;
  margin-bottom: .2rem;
  flex-wrap: wrap;
}

.task-comment__author {
  font-size: .8rem;
  font-weight: 700;
  color: var(--text);
}

.task-comment__time {
  font-size: .72rem;
  color: var(--text-faint);
}

.task-comment__text {
  font-size: .83rem;
  color: var(--text-muted);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

.task-comment__delete {
  flex-shrink: 0;
  opacity: 0;
  transition: opacity .15s;
}
.task-comment:hover .task-comment__delete { opacity: 1; }

/* ── Comment actions (like row) ─────────────────────────────────────────── */
.task-comment__actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .3rem;
}

.task-comment__like {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: .75rem;
  color: var(--text-faint);
  padding: 2px 6px;
  border-radius: 999px;
  transition: color .15s, background .15s;
  line-height: 1;
}
.task-comment__like:hover {
  color: #e74c7a;
  background: rgba(231,76,122,.08);
}
.task-comment__like.is-liked {
  color: #e74c7a;
}
.task-comment__like.is-liked .task-comment__like-heart {
  animation: like-pop .2s ease-out;
}
.task-comment__like-heart {
  font-size: .8rem;
  line-height: 1;
}
.task-comment__like-count {
  min-width: .6rem;
}

@keyframes like-pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.4); }
  100% { transform: scale(1); }
}

.task-comment-form {
  padding: .75rem .9rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: .5rem;
  flex-shrink: 0;
}

.task-comment-form__input {
  font-size: .85rem;
  resize: vertical;
  min-height: 5.5rem;
}

.task-comment-form__actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  justify-content: flex-end;
}

.task-comment-form__counter {
  margin-right: auto;
  font-size: .78rem;
  color: var(--text-faint);
}

.task-comment-form__counter.is-near-limit {
  color: var(--warning);
  font-weight: 700;
}

.task-detail__subtasks {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  padding: .85rem;
  overflow-y: auto;
}
.task-detail__subtask-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: .55rem;
  padding: .58rem .65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.task-detail__subtask-title {
  min-width: 0;
  color: var(--text);
  font-size: .85rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.task-detail__subtask-status {
  color: var(--text-faint);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.task-detail__subtasks-empty {
  margin: 0;
  padding: 1.5rem .5rem;
  color: var(--text-faint);
  font-size: .85rem;
  text-align: center;
}

/* Responsive: stack on mobile */
@media (max-width: 640px) {
  .task-detail { grid-template-columns: 1fr; }
  .task-detail__main { border-right: none; border-bottom: 1px solid var(--border); }
  .task-detail__comments-panel { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
  .task-detail { max-height: none; }
}

/* ── 18. User menu ───────────────────────────────────────────── */
.user-menu { position: relative; }
.user-menu__trigger {
  display: flex; align-items: center; gap: .4rem;
  padding: .35rem .65rem .35rem .4rem;
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; font-family: var(--font);
  color: var(--text); transition: var(--transition);
}
.user-menu__trigger:hover,
.user-menu__trigger[aria-expanded="true"] {
  background: var(--bg-subtle); border-color: var(--border-strong);
}
.user-menu__avatar {
  display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 999px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: .8rem;
}
.user-menu__name   { font-weight: 500; font-size: .875rem; }
.user-menu__avatar-img {
  object-fit: cover;
  background: var(--bg-subtle);
}
.settings-avatar {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
}
.settings-avatar__preview {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 1.5rem;
}
.settings-avatar__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.settings-avatar__field {
  min-width: 0;
}
.settings-avatar__remove-form {
  margin-top: .4rem;
}
.btn-link-danger {
  background: none; border: none; padding: 0;
  color: var(--danger, #dc2626); font-size: .82rem;
  cursor: pointer; text-decoration: underline;
}
.btn-link-danger:hover { color: #b91c1c; }
.user-menu__icon   { transition: transform var(--transition); flex-shrink: 0; }
.user-menu__trigger[aria-expanded="true"] .user-menu__icon { transform: rotate(180deg); }

.user-menu__dropdown {
  position: absolute; top: calc(100% + .4rem); right: 0;
  min-width: 210px; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: .4rem;
  display: none; z-index: 200;
}
.user-menu__dropdown.is-open { display: block; animation: fadeIn .15s ease; }
.user-menu__summary {
  padding: .25rem .75rem .15rem;
}
.user-menu__summary-label {
  display: block;
  margin-bottom: .35rem;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.user-menu__summary-list {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.user-menu__summary-pill {
  display: inline-flex;
  align-items: center;
  padding: .18rem .5rem;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid var(--accent-muted);
  font-size: .72rem;
  font-weight: 600;
}
.user-menu__summary-pill--owner {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 24%, transparent);
}
.user-menu__item {
  display: flex; align-items: center; gap: .65rem;
  width: 100%; padding: .6rem .75rem;
  background: transparent; border: none; border-radius: var(--radius-sm);
  cursor: pointer; text-decoration: none; color: var(--text);
  font-family: var(--font); font-size: .875rem;
  transition: var(--transition); text-align: left;
}
.user-menu__item:hover { background: var(--bg-subtle); }
.user-menu__item--danger { color: var(--error); }
.user-menu__item--danger:hover { background: var(--error-bg); color: var(--error); }
.user-menu__item svg { width: 15px; height: 15px; stroke-width: 2; flex-shrink: 0; }
.user-menu__divider { height: 1px; background: var(--border); margin: .35rem 0; }

/* ── 19. Settings page ───────────────────────────────────────── */
.settings-container { display: grid; grid-template-columns: 190px 1fr; gap: 2rem; max-width: 860px; }
.settings-tabs { display: flex; flex-direction: column; gap: .3rem; }
.settings-tab {
  display: flex; align-items: center; gap: .65rem;
  padding: .7rem .85rem; background: transparent;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  cursor: pointer; font-family: var(--font); font-size: .875rem;
  color: var(--text-muted); transition: var(--transition); text-align: left; font-weight: 500;
}
.settings-tab:hover { background: var(--bg-subtle); color: var(--text); }
.settings-tab--active { background: var(--accent-light); border-color: var(--accent-muted); color: var(--accent); }
.settings-tab svg { width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; }
.settings-content { position: relative; }
.settings-panel { display: none; }
.settings-panel--active { display: block; animation: fadeIn .2s ease; }
.settings-panel__title { font-size: 1.2rem; font-weight: 700; color: var(--text); margin-bottom: .35rem; letter-spacing: -.01em; }
.settings-panel__description { color: var(--text-muted); font-size: .9rem; margin-bottom: 1.75rem; line-height: 1.6; }
.settings-form { display: flex; flex-direction: column; gap: 1.25rem; }
.settings-info { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1.1rem; margin-bottom: 1.75rem; }
.settings-info__item { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.settings-info__label { font-weight: 600; color: var(--text); min-width: 110px; font-size: .875rem; }
.settings-info__value { color: var(--text-muted); flex: 1; font-family: var(--font-mono); font-size: .85rem; word-break: break-all; }
.settings-verify { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.settings-verify h3 { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: .35rem; }
.settings-verify p  { color: var(--text-muted); font-size: .875rem; margin-bottom: 1.25rem; }

/* ── Avatar drop-zone ────────────────────────────────────────── */
.avatar-drop-zone {
  position: relative;
  display: flex; align-items: stretch;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  cursor: pointer;
  transition: border-color .18s, background .18s;
  overflow: hidden;
  min-height: 88px;
}
.avatar-drop-zone:hover,
.avatar-drop-zone:focus-visible {
  border-color: var(--accent);
  background: var(--accent-light);
  outline: none;
}
.avatar-drop-zone.is-dragging {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: 0 0 0 3px var(--accent-muted);
}
.avatar-drop-zone__input {
  position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%;
  cursor: pointer; z-index: 1;
}
.avatar-drop-zone__content {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .35rem; width: 100%; padding: 1.1rem 1.2rem;
  pointer-events: none;
}
.avatar-drop-zone__icon {
  color: var(--text-faint);
  flex-shrink: 0;
}
.avatar-drop-zone__label {
  font-size: .875rem; color: var(--text-muted); text-align: center; line-height: 1.45;
}
.avatar-drop-zone__hint {
  font-size: .75rem; color: var(--text-faint); text-align: center;
}
.avatar-drop-zone__chosen {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .75rem; font-size: .82rem; color: var(--accent);
  font-weight: 600; background: var(--accent-light);
  border-top: 1px solid var(--accent-muted); width: 100%;
}

/* ── Avatar image inside preview and across the board ────────── */
.settings-avatar__preview img,
.member-list__avatar img,
.assignee-picker__avatar img,
.assignee-picker__summary-avatar img,
.task-comment__avatar img {
  width: 100%; height: 100%;
  object-fit: cover; border-radius: 50%;
  display: block;
}

/* ── 20. Owner / Admin pages ─────────────────────────────────── */
.owner-section { max-width: 960px; margin: 0 auto; padding: 2.5rem 1.5rem; }

.admin-studio-page {
  --owner-bg: #0c1020;
  --owner-surface: #151a31;
  --owner-card: rgba(255,255,255,.06);
  --owner-card-hover: rgba(255,255,255,.10);
  --owner-border: rgba(255,255,255,.12);
  --owner-text: #fff;
  --owner-muted: #8892b0;
  --owner-primary: #7c3aed;
  --owner-secondary: #06b6d4;
  --owner-danger: #ef4444;
  --owner-warn: #f59e0b;
  --owner-success: #22c55e;
  max-width: 1420px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  color: var(--owner-text);
}

.admin-studio-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 18% 8%, rgba(124,58,237,.28), transparent 30rem),
    radial-gradient(circle at 86% 12%, rgba(6,182,212,.14), transparent 28rem),
    linear-gradient(180deg, #0c1020 0%, #11162a 54%, #0c1020 100%);
}

.admin-studio-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: end;
  margin-bottom: 1.5rem;
}

.admin-studio-hero h1 {
  margin: .55rem 0 .4rem;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -.055em;
}

.admin-studio-hero p {
  max-width: 690px;
  color: rgba(255,255,255,.68);
  font-size: .98rem;
  line-height: 1.7;
}

.owner-panel-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: .22rem .55rem;
  border-radius: 4px;
  background: rgba(124,58,237,.22);
  color: rgba(167,139,250,.95);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.owner-summary-bar {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}

.owner-summary-stat {
  min-width: 112px;
  padding: .9rem 1.25rem;
  border: 1px solid var(--owner-border);
  border-radius: 12px;
  background: var(--owner-card);
  backdrop-filter: blur(18px);
}

.owner-summary-value {
  display: block;
  font-size: 1.8rem;
  line-height: 1;
  font-weight: 800;
  background: linear-gradient(135deg, var(--owner-primary), var(--owner-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.owner-summary-label {
  display: block;
  margin-top: .25rem;
  color: var(--owner-muted);
  font-size: .74rem;
  font-weight: 600;
}

.owner-card {
  position: relative;
  border: 1px solid var(--owner-border);
  border-radius: 14px;
  background: var(--owner-card);
  padding: 1.25rem 1.45rem;
  box-shadow: 0 18px 48px rgba(0,0,0,.22);
  backdrop-filter: blur(18px);
}

.owner-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .8rem;
}

.owner-card__title {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0;
  color: rgba(255,255,255,.92);
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: -.01em;
}

.owner-card__title::before {
  content: "";
  display: block;
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--owner-primary), var(--owner-secondary));
  flex-shrink: 0;
}

.owner-text-block {
  margin: 0 0 1rem;
  color: rgba(255,255,255,.64);
  font-size: .88rem;
  line-height: 1.65;
}

.owner-key-badge {
  display: inline-block;
  padding: .13rem .48rem;
  border-radius: 4px;
  background: rgba(6,182,212,.14);
  color: rgba(103,232,249,.92);
  font-family: var(--font-mono);
  font-size: .69rem;
  font-weight: 700;
  white-space: nowrap;
}
/* Informational tag (e.g. which placement a banner shows in) rather than a status flag - same
   shape as .owner-key-badge, quieter color so it doesn't compete with "Aktiv" for attention. */
.owner-key-badge--muted {
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.6);
}

.owner-status {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  color: rgba(255,255,255,.72);
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
}

.owner-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.owner-status--ok::before { background: var(--owner-success); box-shadow: 0 0 7px var(--owner-success); }
.owner-status--warn::before { background: var(--owner-warn); box-shadow: 0 0 7px var(--owner-warn); }
.owner-status--danger::before { background: #fb7185; box-shadow: 0 0 7px rgba(251,113,133,.7); }
.owner-status--off::before { background: var(--owner-muted); }

.owner-alert {
  padding: .75rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  border: 1px solid var(--owner-border);
  background: var(--owner-card);
}

.owner-alert--ok {
  background: rgba(34,197,94,.1);
  border-color: rgba(34,197,94,.24);
}

.owner-alert--danger {
  background: rgba(244,63,94,.1);
  border-color: rgba(251,113,133,.3);
}

.owner-field-hint {
  margin-top: .45rem;
  color: var(--owner-muted);
  font-size: .72rem;
}

.owner-field-hint code {
  padding: .08rem .32rem;
  border-radius: 4px;
  background: rgba(255,255,255,.07);
  color: rgba(167,139,250,.92);
  font-size: .68rem;
  white-space: normal;
}

.owner-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .68rem 1.15rem;
  border-radius: 9px;
  border: 1px solid transparent;
  font-family: var(--font);
  font-size: .875rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: filter var(--transition), transform var(--transition), border-color var(--transition), background var(--transition);
}

.owner-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.owner-btn--primary { color: #fff; background: linear-gradient(135deg, var(--owner-primary), var(--owner-secondary)); }
.owner-btn--ghost { color: rgba(255,255,255,.78); background: rgba(255,255,255,.05); border-color: var(--owner-border); }
.owner-btn--secondary {
  color: rgba(255,255,255,.88);
  background: rgba(255,255,255,.075);
  border-color: rgba(255,255,255,.14);
}
.owner-btn--secondary:hover {
  border-color: rgba(124,58,237,.45);
  background: rgba(124,58,237,.16);
}

.owner-help {
  margin: .9rem 0 0;
  color: var(--owner-muted);
  font-size: .85rem;
}

.owner-help--muted {
  color: rgba(255,255,255,.58);
}

.site-content-sections-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-bottom: 1rem;
}

.site-content-nav-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .45rem .8rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.8);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .01em;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
}

.site-content-nav-pill:hover {
  color: #fff;
  border-color: rgba(124,58,237,.4);
  background: rgba(124,58,237,.16);
  transform: translateY(-1px);
}

.site-content-nav-pill--action {
  background: rgba(6,182,212,.12);
  color: rgba(103,232,249,.95);
}

.site-content-language-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-bottom: 1rem;
}

.site-content-language-pill {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 36px;
  padding: .38rem .7rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.86);
  cursor: pointer;
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
  transition: transform var(--transition), border-color var(--transition), background var(--transition), color var(--transition);
}

.site-content-language-pill:hover {
  transform: translateY(-1px);
  border-color: rgba(124,58,237,.42);
  background: rgba(124,58,237,.15);
}

.site-content-language-pill.is-active {
  border-color: rgba(6,182,212,.5);
  background: rgba(6,182,212,.18);
  color: #fff;
}

.site-content-language-pill.is-inactive {
  opacity: .72;
}

.site-content-language-pill__flag {
  font-size: 1rem;
  line-height: 1;
}

.site-content-language-pill__code {
  font-size: .66rem;
  letter-spacing: .08em;
  color: rgba(255,255,255,.62);
}

.site-content-language-pill__state {
  padding: .08rem .38rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  font-size: .62rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.58);
}

.site-content-empty {
  margin-top: .4rem;
  padding: .75rem .9rem;
  border: 1px dashed rgba(255,255,255,.2);
  border-radius: 10px;
  color: rgba(255,255,255,.72);
  font-size: .85rem;
}

.site-content-language-settings__rows {
  display: grid;
  gap: .75rem;
}

.site-content-language-settings__row {
  display: grid;
  grid-template-columns: minmax(0, 90px) minmax(0, 1fr) 120px auto;
  gap: .65rem;
  align-items: end;
  padding: .65rem;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  background: rgba(255,255,255,.03);
}

.site-content-language-settings__toggle {
  align-items: center;
  gap: .45rem;
  margin-bottom: .55rem;
  color: rgba(255,255,255,.8);
}

@media (max-width: 900px) {
  .site-content-language-settings__row {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-content-language-settings__toggle {
    margin-bottom: 0;
  }
}

.site-content-sections {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.site-content-section {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap: 1rem;
  align-items: start;
}

.site-content-section--single {
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
}

.site-content-section__editor,
.site-content-section__preview {
  min-width: 0;
}

.site-content-section__intro {
  margin-bottom: 1rem;
}

.admin-edit-card .form-control {
  border-color: rgba(255,255,255,.12);
  background: rgba(255,255,255,.055);
  color: #fff;
}

.admin-edit-card .form-control:focus {
  border-color: rgba(124,58,237,.8);
  box-shadow: 0 0 0 3px rgba(124,58,237,.18);
}

.admin-edit-card .form-control::placeholder { color: rgba(255,255,255,.32); }
.admin-edit-card .form-label { color: rgba(255,255,255,.86); margin-bottom: 0; }
.admin-edit-card .form-help { color: var(--owner-muted); }

.content-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.content-field {
  min-width: 0;
  padding: .85rem;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 10px;
  background: rgba(255,255,255,.035);
}

.content-field--wide { grid-column: 1 / -1; }

.content-field--split {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(180px, .8fr);
  gap: .9rem;
  align-items: start;
}

.content-field__control,
.content-field__preview {
  min-width: 0;
}

.content-field__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .65rem;
  margin-bottom: .45rem;
}

/* dirty-field indicator: orange dot appears in the header when a field is edited */
.content-field.is-dirty .content-field__head::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f97316;
  box-shadow: 0 0 0 2px rgba(249, 115, 22, .25);
  flex-shrink: 0;
  animation: dirty-pulse 1.6s ease-in-out infinite;
}
@keyframes dirty-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(249, 115, 22, .25); }
  50%       { box-shadow: 0 0 0 5px rgba(249, 115, 22, 0);   }
}

/* save button glows when any field is dirty */
.owner-btn--primary.has-dirty {
  box-shadow: 0 0 0 3px rgba(249, 115, 22, .35), 0 4px 14px rgba(249, 115, 22, .2);
  animation: dirty-btn-pulse 2s ease-in-out infinite;
}
@keyframes dirty-btn-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(249, 115, 22, .35), 0 4px 14px rgba(249, 115, 22, .2); }
  50%       { box-shadow: 0 0 0 6px rgba(249, 115, 22, .15), 0 4px 18px rgba(249, 115, 22, .3); }
}

.content-field__preview {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.theme-control-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: .75rem;
  align-items: center;
}

.theme-color-picker {
  width: 56px;
  height: 44px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  padding: .2rem;
}

.content-field__preview-label {
  color: rgba(255,255,255,.5);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.inline-preview-card {
  min-height: 100%;
  padding: .8rem .9rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.02)),
    rgba(12,16,32,.6);
  color: rgba(255,255,255,.86);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

.inline-preview-card span {
  display: block;
  line-height: 1.55;
  word-break: break-word;
}

.inline-preview-card--hero-title {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: -.03em;
}

.inline-preview-card--button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  background: linear-gradient(135deg, var(--owner-primary), var(--owner-secondary));
  color: #fff;
  font-size: .82rem;
  font-weight: 800;
}

.inline-preview-card--button-alt {
  background: rgba(255,255,255,.05);
  border-color: var(--owner-border);
  color: rgba(255,255,255,.82);
}

.inline-preview-card--stat-value {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: -.04em;
}

.inline-preview-card--stat-label,
.inline-preview-card--eyebrow {
  color: #c4b5fd;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.inline-preview-card--section-title {
  font-size: .98rem;
  font-weight: 800;
  color: #fff;
}

.inline-preview-card--feature,
.inline-preview-card--contact {
  font-size: .86rem;
}

.field-group-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field-group-panel {
  padding: 1rem;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  background:
    radial-gradient(circle at top right, rgba(124,58,237,.14), transparent 14rem),
    rgba(255,255,255,.025);
}

.field-group-panel__head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: .9rem;
  margin-bottom: .9rem;
}

.field-group-panel__head h3 {
  margin: 0;
  color: #fff;
  font-size: .98rem;
  letter-spacing: -.02em;
}

.field-group-panel__head p {
  margin: .18rem 0 0;
  color: rgba(255,255,255,.6);
  font-size: .78rem;
  line-height: 1.5;
}

.field-group-chip {
  display: inline-flex;
  align-items: center;
  padding: .32rem .6rem;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.74);
  font-size: .7rem;
  font-weight: 800;
  white-space: nowrap;
}

.site-content-section__preview {
  display: flex;
  flex-direction: column;
  gap: .9rem;
  overflow: hidden;
}

.theme-studio-preview {
  position: sticky;
  top: 1rem;
  align-self: start;
  max-height: calc(100vh - 2rem);
  overflow: auto;
}

.site-content-preview-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: .75rem;
}

.site-content-preview-head h3 {
  margin: .15rem 0 0;
  color: rgba(255,255,255,.92);
  font-size: 1rem;
  letter-spacing: -.02em;
}

.site-content-preview-kicker {
  display: inline-flex;
  color: #c4b5fd;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.site-content-actions {
  display: flex;
  gap: .65rem;
  flex-wrap: wrap;
  padding: .25rem 0 0;
}

.background-upload-preview {
  min-height: 150px;
  margin-bottom: 1rem;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: end;
  padding: .85rem;
  overflow: hidden;
  box-shadow: inset 0 -80px 90px rgba(12,16,32,.7);
}

.background-upload-preview span {
  display: inline-flex;
  padding: .25rem .55rem;
  border-radius: 999px;
  background: rgba(12,16,32,.72);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.82);
  font-size: .72rem;
  font-weight: 800;
}

.background-upload-card input[type="file"] {
  padding: .52rem;
}

.background-upload-card input[type="file"]::file-selector-button {
  margin-right: .75rem;
  border: 0;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--owner-primary), var(--owner-secondary));
  color: #fff;
  padding: .45rem .75rem;
  font-family: var(--font);
  font-weight: 800;
  cursor: pointer;
}

.preview-window {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--owner-border);
  border-radius: 18px;
  background: rgba(12,16,32,.94);
  box-shadow: 0 28px 80px rgba(0,0,0,.34);
}

.preview-window--section {
  min-height: 100%;
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: .42rem;
  height: 38px;
  padding: 0 .9rem;
  border-bottom: 1px solid var(--owner-border);
  background: rgba(255,255,255,.045);
}

.dot {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot.red { background: #ef4444; }
.dot.yellow { background: #f59e0b; }
.dot.green { background: #22c55e; }

.preview-window__content {
  position: relative;
  padding: 1.1rem;
  background:
    linear-gradient(180deg, rgba(12,16,32,.76), rgba(12,16,32,.94)),
    var(--preview-bg);
  background-size: cover;
  background-position: center;
}

.window-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 1rem;
}

.window-title {
  color: rgba(255,255,255,.9);
  font-weight: 800;
  letter-spacing: -.02em;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .2rem .48rem;
  border-radius: 999px;
  background: rgba(34,197,94,.12);
  color: #86efac;
  border: 1px solid rgba(34,197,94,.24);
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .07em;
}

.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

.status-pill--warn {
  background: rgba(245,158,11,.12);
  color: #fde68a;
  border-color: rgba(245,158,11,.28);
}

.status-pill--warn::before {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
}

.preview-hero-card {
  padding: 1.15rem;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  background:
    radial-gradient(circle at 20% 0%, rgba(124,58,237,.28), transparent 14rem),
    rgba(255,255,255,.045);
}

.site-home-editor {
  display: block;
}

.site-home-editor__form {
  overflow: hidden;
  border: 1px solid rgba(96,165,250,.22);
  border-radius: 26px;
  background: rgba(6,10,30,.96);
  box-shadow: 0 30px 90px rgba(0,0,0,.34);
}

.site-home-editor__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid rgba(126,168,255,.2);
  background: rgba(255,255,255,.035);
}

.site-home-editor__bar h2 {
  margin: .2rem 0 0;
  color: #fff;
  font-size: 1rem;
}

.site-home-editor__actions,
.site-home-editor__links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .65rem;
}

.site-home-editor__surface {
  position: relative;
  min-height: 680px;
  padding: 0 1.4rem 2rem;
  background:
    radial-gradient(circle at 50% 22%, rgba(69,93,238,.24), transparent 18rem),
    linear-gradient(180deg, rgba(6,10,30,.9), rgba(6,10,30,.98)),
    var(--preview-bg);
  background-size: cover;
  background-position: center;
}

.site-home-editor__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(.9rem, 2.2vw, 2rem);
  min-height: 76px;
  border-bottom: 1px solid rgba(126,168,255,.24);
  color: rgba(230,238,255,.9);
  font-size: .95rem;
}

.site-home-editor__brand {
  margin-right: auto;
  color: #fff;
  font-weight: 900;
  letter-spacing: -.04em;
}

.site-home-editor__brand span {
  color: #2f6cf6;
}

.site-home-editor__hero {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 1rem;
  min-height: 560px;
  max-width: 920px;
  margin: 0 auto;
  text-align: center;
}

.site-home-editor__field {
  position: relative;
  display: grid;
  justify-items: center;
  gap: .3rem;
  width: min(100%, 720px);
}

.site-home-editor__field > span {
  color: rgba(191,219,254,.76);
  font-size: .64rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity var(--transition);
}

.site-home-editor__field:focus-within > span,
.site-home-editor__field:hover > span {
  opacity: 1;
}

.site-home-editor__field input,
.site-home-editor__field textarea {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: #fff;
  font: inherit;
  text-align: center;
  resize: vertical;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.site-home-editor__field input:focus,
.site-home-editor__field textarea:focus {
  outline: none;
  border-color: rgba(96,165,250,.5);
  background: rgba(15,23,42,.72);
  box-shadow: 0 0 0 4px rgba(59,130,246,.12);
}

.site-home-editor__field input::placeholder,
.site-home-editor__field textarea::placeholder {
  color: rgba(255,255,255,.68);
  opacity: 1;
}

.site-home-editor__field--eyebrow {
  width: fit-content;
}

.site-home-editor__field--eyebrow input {
  width: 240px;
  padding: .55rem .95rem;
  border-radius: 999px;
  background: rgba(59,130,246,.28);
  color: #5d8cff;
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.site-home-editor__headline {
  display: grid;
  justify-items: center;
  width: min(100%, 760px);
}

.site-home-editor__field--title input {
  padding: .15rem .5rem;
  font-size: clamp(3rem, 8vw, 5.4rem);
  line-height: .95;
  font-weight: 900;
  letter-spacing: -.075em;
}

.site-home-editor__field--accent input {
  color: #5759df;
}

.site-home-editor__field--subtitle textarea {
  max-width: 540px;
  min-height: 3.4rem;
  padding: .65rem .85rem;
  border-radius: 14px;
  color: rgba(219,234,254,.92);
  font-size: 1.25rem;
  line-height: 1.45;
}

.site-home-editor__button-row {
  display: flex;
  justify-content: center;
  gap: .9rem;
  flex-wrap: wrap;
  margin-top: .5rem;
}

.site-home-editor__field--button {
  width: auto;
}

.site-home-editor__field--button input {
  width: 190px;
  min-height: 50px;
  padding: 0 1rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--owner-primary), var(--owner-secondary));
  color: #fff;
  font-size: .95rem;
  font-weight: 900;
}

.site-home-editor__field--button-ghost input {
  background: rgba(255,255,255,.04);
  border-color: rgba(148,163,184,.42);
}

.site-home-editor__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  width: min(100%, 620px);
  margin-top: 1.2rem;
}

.site-home-editor__stat-card {
  display: grid;
  gap: .2rem;
  padding: 1rem .9rem;
  border: 1px solid rgba(96,165,250,.4);
  border-radius: 14px;
  background: rgba(55,0,92,.66);
}

.site-home-editor__field--stat-value input {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -.04em;
}

.site-home-editor__field--stat-label input {
  color: rgba(255,255,255,.78);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.site-home-editor__links {
  justify-content: center;
  padding: 1rem 1.2rem 1.2rem;
  background: rgba(255,255,255,.025);
}

.site-home-editor__links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: .55rem .85rem;
  border: 1px solid rgba(96,165,250,.34);
  border-radius: 999px;
  background: rgba(6,10,30,.72);
  color: rgba(219,234,254,.92);
  font-size: .76rem;
  font-weight: 900;
  text-decoration: none;
}

.site-home-editor__links a:hover {
  border-color: rgba(96,165,250,.72);
  color: #fff;
}

.site-content-fragment {
  padding: 1rem;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  background:
    radial-gradient(circle at top right, rgba(124,58,237,.18), transparent 12rem),
    rgba(255,255,255,.03);
}

.portal-theme-preview {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border-radius: 18px;
  background: var(--preview-bg);
  color: var(--preview-text);
  border: 1px solid var(--preview-border);
  box-shadow: var(--preview-shadow);
  font-family: var(--preview-font);
  font-size: calc(1rem * var(--preview-font-scale));
}

.portal-theme-preview__nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  padding: .9rem 1rem;
  border-radius: var(--preview-radius);
  background: var(--preview-surface);
  border: 1px solid var(--preview-border);
}

.portal-theme-preview__nav span,
.portal-theme-preview__hero p,
.portal-theme-preview__hero > div > span,
.portal-theme-preview__card span {
  color: var(--preview-muted);
}

.portal-theme-preview__hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(200px, .7fr);
  gap: 1rem;
  padding: 1rem;
  border-radius: calc(var(--preview-radius) + 6px);
  background: linear-gradient(145deg, var(--preview-surface), var(--preview-surface-muted));
  border: 1px solid var(--preview-border);
}

.portal-theme-preview__hero h3 {
  margin: .4rem 0 .65rem;
  font-size: 1.55rem;
  line-height: 1.05;
  letter-spacing: -.04em;
}

.portal-theme-preview__hero h3 span {
  display: block;
  background: linear-gradient(135deg, var(--preview-primary), var(--preview-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.portal-theme-preview__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: 1rem;
}

.portal-theme-preview__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 .95rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--preview-primary), var(--preview-accent));
  color: var(--preview-accent-fg);
  font-size: .82rem;
  font-weight: 700;
}

.portal-theme-preview__button--ghost {
  background: transparent;
  color: var(--preview-text);
  border: 1px solid var(--preview-border);
}

.portal-theme-preview__card {
  display: grid;
  gap: .55rem;
  align-content: start;
  padding: 1rem;
  border-radius: var(--preview-radius);
  background: var(--preview-surface);
  border: 1px solid var(--preview-border);
  box-shadow: var(--preview-shadow);
}

.portal-theme-preview__card--surface-muted {
  background: var(--preview-surface-muted);
}

.portal-theme-preview__card-kicker {
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--preview-primary);
}

.portal-theme-preview__card strong {
  display: block;
  font-size: .88rem;
  font-weight: 700;
  color: var(--preview-text);
}

.portal-theme-preview__card span {
  font-size: .75rem;
  color: var(--preview-muted);
}

/* Nav enhancements */
.portal-theme-preview__nav-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 700;
  color: var(--preview-text);
  font-size: .88rem;
}

.portal-theme-preview__dot {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  flex-shrink: 0;
}

.portal-theme-preview__nav-links {
  display: flex;
  align-items: center;
  gap: .85rem;
  font-size: .75rem;
  color: var(--preview-muted);
}

.portal-theme-preview__nav-cta {
  padding: .28rem .75rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--preview-primary), var(--preview-accent));
  color: var(--preview-accent-fg) !important;
  font-weight: 700;
  font-size: .72rem;
}

/* Badge row in hero card */
.portal-theme-preview__badge-row {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  margin-top: .2rem;
}

.portal-theme-preview__badge {
  display: inline-flex;
  align-items: center;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 700;
  background: var(--preview-surface-muted);
  color: var(--preview-muted);
  border: 1px solid var(--preview-border);
}

.portal-theme-preview__badge--primary {
  background: color-mix(in srgb, var(--preview-primary) 15%, transparent);
  color: var(--preview-primary);
  border-color: color-mix(in srgb, var(--preview-primary) 30%, transparent);
}

.portal-theme-preview__badge--green {
  background: color-mix(in srgb, var(--preview-success) 14%, transparent);
  color: var(--preview-success);
  border-color: color-mix(in srgb, var(--preview-success) 30%, transparent);
}

.portal-theme-preview__badge--warning {
  background: color-mix(in srgb, var(--preview-warning) 14%, transparent);
  color: var(--preview-warning);
  border-color: color-mix(in srgb, var(--preview-warning) 30%, transparent);
}

.portal-theme-preview__badge--error {
  background: color-mix(in srgb, var(--preview-error) 12%, transparent);
  color: var(--preview-error);
  border-color: color-mix(in srgb, var(--preview-error) 28%, transparent);
}

.portal-theme-preview__badge--muted {
  background: var(--preview-surface-muted);
  color: var(--preview-muted);
}

/* Muted button variant */
.portal-theme-preview__button--muted {
  background: var(--preview-surface-muted);
  color: var(--preview-muted);
  border: 1px solid var(--preview-border);
}

/* Component strip */
.portal-theme-preview__components {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: .65rem;
  padding: .85rem;
  background: var(--preview-surface-muted);
  border: 1px solid var(--preview-border);
  border-radius: var(--preview-radius);
}

.portal-theme-preview__comp-label {
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--preview-muted);
  margin-bottom: .45rem;
}

.portal-theme-preview__comp-row {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  align-items: center;
}

.portal-theme-preview__fake-input {
  padding: .35rem .6rem;
  border-radius: var(--preview-control-radius);
  background: var(--preview-bg);
  border: 1px solid var(--preview-border);
  font-size: .72rem;
  color: var(--preview-muted);
  width: 100%;
  box-sizing: border-box;
}

/* Card grid */
.portal-theme-preview__card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: .65rem;
}

/* Palette strip */
.portal-theme-preview__palette {
  display: flex;
  gap: .3rem;
  flex-wrap: wrap;
  padding: .6rem .75rem;
  background: var(--preview-surface);
  border: 1px solid var(--preview-border);
  border-radius: var(--preview-radius);
}

.portal-theme-preview__swatch {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  flex-shrink: 0;
}

/* Theme field groups */
.theme-field-group {
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 16px;
  padding: 1rem;
  background: rgba(255,255,255,.02);
}

.theme-field-group + .theme-field-group {
  margin-top: .75rem;
}

.theme-field-group__head {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .85rem;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
}

.theme-field-group__head svg {
  opacity: .6;
  flex-shrink: 0;
}

/* Compact color grid: 3 columns */
.content-field-grid--compact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: .75rem;
}

.content-field--color-compact .content-field__head {
  flex-wrap: wrap;
  gap: .25rem;
}

.content-field--color-compact .form-label {
  font-size: .78rem;
}

.content-field--color-compact .form-help {
  font-size: .68rem;
}

.permission-layout-portal {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(320px, 1.05fr);
  gap: 1.2rem;
  margin-bottom: 1.2rem;
}

.permission-panel,
.permission-user-card {
  min-width: 0;
}

.permission-user-list-section {
  display: grid;
  gap: 1rem;
}

.permission-user-list-section__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.permission-user-list-section__header h2 {
  margin: .35rem 0 .25rem;
  color: var(--text);
  font-size: 1.15rem;
}

.permission-user-list-section__header p {
  margin: 0;
  color: var(--text-muted);
  max-width: 720px;
}

.permission-form-grid,
.permission-definition-list,
.permission-user-list {
  display: grid;
  gap: 1rem;
}

.permission-definition-card {
  display: grid;
  gap: .5rem;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--accent) 10%, var(--border));
  background: color-mix(in srgb, var(--bg) 88%, #fff);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16);
}

.permission-definition-card--choice {
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.permission-definition-card--choice:hover {
  border-color: var(--accent-muted);
  background: color-mix(in srgb, var(--accent-light) 20%, var(--bg));
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.permission-definition-card > span:first-child {
  display: flex;
  align-items: center;
  gap: .65rem;
}

.permission-definition-card input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

.permission-definition-card strong,
.permission-user-card__head h3 {
  font-size: .95rem;
  color: var(--text);
}

.permission-definition-card p,
.permission-owner-note,
.permission-empty-portal,
.permission-user-card__head p,
.permission-pill-portal span {
  color: var(--text-muted);
}

.permission-user-card {
  display: grid;
  gap: 1rem;
}

.permission-user-card__head,
.permission-user-card__roles {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}

.permission-pill-list-portal {
  display: grid;
  gap: .75rem;
}

.permission-pill-portal {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: .95rem 1rem;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--accent) 10%, var(--border));
  background: color-mix(in srgb, var(--bg) 88%, #fff);
}

.permission-pill-portal div {
  display: grid;
  gap: .35rem;
}

.permission-pill-portal .owner-key-badge {
  align-self: flex-start;
}

.permission-pill-portal button {
  border: 1px solid rgba(239,68,68,.28);
  border-radius: 999px;
  background: rgba(239,68,68,.12);
  color: #fecaca;
  font: inherit;
  font-size: .8rem;
  font-weight: 700;
  padding: .45rem .8rem;
  cursor: pointer;
}

.permission-pill-portal button:hover {
  background: rgba(239,68,68,.2);
}

.preview-eyebrow {
  display: inline-flex;
  margin-bottom: .7rem;
  padding: .2rem .58rem;
  border-radius: 999px;
  background: rgba(124,58,237,.20);
  color: #c4b5fd;
  border: 1px solid rgba(124,58,237,.32);
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.preview-hero-card h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.55rem, 4vw, 2.2rem);
  line-height: 1.05;
  letter-spacing: -.055em;
}

.preview-hero-card h2 span,
.preview-hero-card h2 strong {
  display: block;
}

.preview-hero-card h2 strong {
  background: linear-gradient(135deg, var(--owner-primary), var(--owner-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.preview-hero-card p {
  margin: .85rem 0 1rem;
  color: rgba(255,255,255,.66);
  font-size: .88rem;
  line-height: 1.6;
}

.preview-actions {
  display: flex;
  gap: .55rem;
  flex-wrap: wrap;
}

.preview-actions span {
  display: inline-flex;
  padding: .42rem .72rem;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--owner-primary), var(--owner-secondary));
  font-size: .74rem;
  font-weight: 800;
}

.preview-actions span + span {
  color: rgba(255,255,255,.74);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--owner-border);
}

.preview-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
  margin-top: .9rem;
}

.preview-hero-stats div {
  padding: .65rem .55rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
}

.preview-hero-stats strong,
.preview-hero-stats span {
  display: block;
}

.preview-hero-stats strong {
  color: #fff;
  font-size: 1rem;
  letter-spacing: -.03em;
}

.preview-hero-stats span {
  margin-top: .15rem;
  color: rgba(255,255,255,.58);
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.preview-section-copy {
  margin-top: .95rem;
}

.preview-section-copy span,
.preview-section-copy strong {
  display: block;
  color: #fff;
}

.preview-section-copy span {
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: -.02em;
}

.preview-section-copy strong {
  font-size: .92rem;
  line-height: 1.35;
}

.preview-section-copy p {
  margin-top: .2rem;
  color: rgba(255,255,255,.6);
  font-size: .74rem;
  line-height: 1.5;
}

.preview-section-copy--features span {
  color: #c4b5fd;
  font-size: .62rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.preview-feature-grid {
  display: grid;
  gap: .65rem;
  margin-top: .7rem;
}

.preview-feature-card {
  padding: .75rem .8rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.035);
}

.preview-feature-card strong {
  display: block;
  color: #fff;
  font-size: .82rem;
}

.preview-feature-card p {
  margin-top: .22rem;
  color: rgba(255,255,255,.58);
  font-size: .73rem;
  line-height: 1.45;
}

.preview-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  margin-top: .85rem;
}

.mini-app {
  padding: .85rem;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 12px;
  background: rgba(255,255,255,.055);
}

.mini-app .emoji {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: .55rem;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--owner-primary), var(--owner-secondary));
  color: #fff;
  font-weight: 900;
}

.mini-app strong {
  display: block;
  color: #fff;
  font-size: .86rem;
}

.mini-app span {
  display: block;
  margin-top: .2rem;
  color: rgba(255,255,255,.55);
  font-size: .74rem;
  line-height: 1.45;
}

.preview-contact-list {
  display: grid;
  gap: .65rem;
  margin: 0;
}

.preview-contact-list div {
  padding: .75rem .85rem;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  background: rgba(255,255,255,.04);
}

.preview-contact-list dt {
  color: var(--owner-muted);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.preview-contact-list dd {
  margin: .22rem 0 0;
  color: rgba(255,255,255,.86);
  font-size: .9rem;
  word-break: break-word;
}

.preview-contact-card {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.preview-background-meta {
  padding: .95rem 1rem 1rem;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  background: rgba(255,255,255,.03);
}

.preview-background-meta strong {
  display: block;
  color: #fff;
  font-size: .86rem;
}

.preview-background-meta p {
  margin: .3rem 0 0;
  color: rgba(255,255,255,.62);
  font-size: .77rem;
  line-height: 1.55;
}

/* ── 20b. Apps admin page ────────────────────────────────────── */
.apps-live-admin {
  --apps-editor-ring: color-mix(in srgb, var(--accent) 18%, transparent);
}
.apps-live-admin__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}
.apps-live-add {
  display: flex;
  gap: .65rem;
  padding: .55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}
.apps-live-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: .75rem;
  z-index: 8;
  margin: 1rem 0 1.25rem;
  padding: .55rem .7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
}
.apps-live-locale {
  display: inline-flex;
  gap: .25rem;
  padding: .25rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-subtle);
}
.apps-live-locale__button,
.apps-icon-button,
.apps-edit-pen {
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), opacity var(--transition);
}
.apps-live-locale__button {
  min-width: 42px;
  min-height: 32px;
  padding: .25rem .75rem;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 800;
}
.apps-live-locale__button.is-active {
  color: var(--accent);
  background: var(--accent-light);
  border-color: var(--accent-muted);
}
.apps-live-save-state {
  min-width: 90px;
  text-align: right;
  color: var(--text-faint);
  font-size: .78rem;
  font-weight: 700;
}
.apps-live-save-state[data-mode="saving"] { color: var(--warning); }
.apps-live-save-state[data-mode="saved"] { color: var(--success); }
.apps-live-save-state[data-mode="error"] { color: var(--error); }
.apps-live-grid {
  align-items: stretch;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.apps-live-card {
  min-height: 292px;
  padding-top: 3.35rem;
  cursor: default;
}
.apps-live-card.is-hidden {
  opacity: .58;
  border-style: dashed;
}
.apps-live-card.is-hidden::after {
  content: "Hidden from homepage";
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  padding: .18rem .55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  background: var(--bg-subtle);
  font-size: .68rem;
  font-weight: 800;
}
.apps-live-card__tools {
  position: absolute;
  top: .8rem;
  right: .8rem;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-elevated) 90%, transparent);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}
.apps-icon-button {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: transparent;
  border-color: transparent;
}
.apps-icon-button:hover,
.apps-icon-button:focus-visible,
.apps-edit-pen:hover,
.apps-edit-pen:focus-visible {
  color: var(--accent);
  background: var(--accent-light);
  border-color: var(--accent-muted);
  outline: none;
}
.apps-icon-button:disabled {
  opacity: .35;
  cursor: not-allowed;
}
.apps-visibility-toggle {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 30px;
  padding: .2rem .55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  background: transparent;
  font-size: .68rem;
  font-weight: 800;
  cursor: pointer;
}
.apps-visibility-toggle span:first-child {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}
.apps-visibility-toggle.is-on {
  color: var(--success);
  background: color-mix(in srgb, var(--success-bg) 68%, transparent);
  border-color: color-mix(in srgb, var(--success) 28%, transparent);
}
.apps-editable {
  position: relative;
  max-width: 100%;
}
.apps-editable.is-locale-hidden {
  display: none;
}
.apps-editable--icon {
  width: max-content;
}
.apps-editable--description {
  width: 100%;
  flex-grow: 1;
}
.apps-edit-pen {
  position: absolute;
  top: 50%;
  right: -.25rem;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border-color: var(--border);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translate(100%, -50%);
}
.apps-editable--icon .apps-edit-pen {
  right: -.4rem;
  top: -.25rem;
  transform: translate(55%, -25%);
}
.apps-editable:hover .apps-edit-pen,
.apps-editable:focus-within .apps-edit-pen,
.apps-edit-pen:focus-visible {
  opacity: 1;
}
.apps-editable.is-editing .apps-edit-pen {
  display: none;
}
.apps-inline-editor {
  position: absolute;
  left: 0;
  top: calc(100% + .35rem);
  z-index: 20;
  width: min(360px, calc(100vw - 2rem));
  padding: .8rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-lg);
}
.apps-editable--url .apps-inline-editor {
  left: auto;
  right: 0;
  top: auto;
  bottom: calc(100% + .45rem);
}
.apps-inline-editor__label {
  display: block;
  margin-bottom: .45rem;
  color: var(--text-faint);
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.apps-inline-editor__control {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--bg);
  padding: .58rem .7rem;
  font: inherit;
}
.apps-inline-editor__control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--apps-editor-ring);
}
.apps-inline-editor__control--textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.6;
}
.apps-inline-editor__actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  margin-top: .65rem;
}
.apps-live-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  width: 100%;
  margin-top: auto;
}
.apps-url-button {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  padding: .32rem .7rem;
  font-size: .72rem;
  font-weight: 800;
  cursor: pointer;
}
.apps-url-button:hover,
.apps-url-button:focus-visible {
  color: var(--accent);
  border-color: var(--accent-muted);
  outline: none;
}
.apps-editable--url.is-editing .apps-url-button {
  color: var(--accent);
  border-color: var(--accent-muted);
}
.apps-live-delete {
  width: 100%;
  margin-top: .9rem;
  padding-top: .9rem;
  border-top: 1px solid var(--border);
}
.apps-live-delete .btn-secondary {
  width: 100%;
  justify-content: center;
}
.portal-card__tag.is-empty {
  display: none;
}

@media (max-width: 1100px) {
  .apps-live-admin__header {
    grid-template-columns: 1fr;
  }
  .admin-studio-hero,
  .site-content-section,
  .permission-layout-portal,
  .portal-theme-preview__hero {
    grid-template-columns: 1fr;
  }
  .theme-studio-preview {
    position: static;
    top: auto;
    max-height: none;
    overflow: hidden;
  }
}
@media (max-width: 600px) {
  .apps-live-add,
  .apps-live-toolbar,
  .apps-live-card__footer {
    flex-direction: column;
    align-items: stretch;
  }
  .apps-live-locale {
    width: 100%;
    justify-content: center;
  }
  .apps-live-save-state {
    text-align: left;
  }
  .apps-live-card__tools {
    position: static;
    align-self: stretch;
    justify-content: flex-end;
    margin: -.25rem 0 .75rem;
  }
  .apps-edit-pen {
    opacity: 1;
    transform: none;
    top: -.25rem;
    right: -.25rem;
  }
  .apps-inline-editor,
  .apps-editable--url .apps-inline-editor {
    position: fixed;
    inset: auto 1rem 1rem 1rem;
    width: auto;
  }
  .admin-studio-page {
    padding: 1.25rem 1rem 2.25rem;
  }
  .admin-studio-summary,
  .content-field-grid,
  .preview-mini-grid,
  .preview-hero-stats {
    grid-template-columns: 1fr;
  }
  .site-content-preview-head,
  .site-content-actions {
    align-items: stretch;
  }
  .site-content-preview-head {
    flex-direction: column;
  }
  .owner-summary-stat {
    flex: 1 1 130px;
  }
  .owner-card {
    padding: 1rem;
  }
  .content-field--wide {
    grid-column: auto;
  }
  .content-field--split,
  .field-group-panel__head {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
  .theme-control-row,
  .permission-pill-portal {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
  .permission-pill-portal button {
    width: 100%;
  }
}
.owner-section h1 { font-size: 1.5rem; font-weight: 700; color: var(--text); letter-spacing: -.02em; margin-bottom: 1rem; }
.invite-list { list-style: none; margin-top: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.invite-list li {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .75rem 1rem;
  font-size: .875rem; display: flex; gap: 1rem;
  align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.invite-list code {
  background: var(--bg-subtle); border: 1px solid var(--border);
  padding: .15rem .45rem; border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: .775rem; word-break: break-all;
}

/* ── 21. Utility ─────────────────────────────────────────────── */
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.text-sm { font-size: .875rem; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── 22. Responsive — tablet ─────────────────────────────────── */
@media (max-width: 960px) {
  .portal-section { padding: min(var(--site-section-spacing), 3rem) 1.25rem; }
  .portal-hero    { padding: 4.5rem 1.25rem 3.5rem; }
  .settings-container { grid-template-columns: 1fr; }
  .settings-tabs { flex-direction: row; overflow-x: auto; gap: .35rem; padding-bottom: .5rem; }
  .settings-tab  { white-space: nowrap; }
  .site-footer__inner { grid-template-columns: 1fr auto; }
  .site-footer__copy  { display: none; }
}

/* ── 23. Responsive — mobile ─────────────────────────────────── */
@media (max-width: 760px) {
  .nav__inner  { padding: 0 1rem; height: 56px; }
  .nav__toggle { display: block; margin-left: auto; }
  .nav__right  {
    position: absolute; top: 56px; left: 0; right: 0;
    max-height: calc(100dvh - 56px); overflow-y: auto;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: .5rem 1rem 1rem; display: none;
    flex-direction: column; align-items: stretch; gap: 0;
    box-shadow: var(--shadow);
  }
  .nav__right.is-open { display: flex; }
  .nav-links { flex-direction: column; align-items: stretch; gap: .1rem; width: 100%; }
  .nav-link  { min-height: 44px; padding: .7rem .85rem; font-size: .9rem; }
  .nav-link--cta { text-align: center; margin-top: .25rem; }

  /* All nav content (language + account) lives inside the same panel as the
     links now, so every option is reachable in one scroll instead of
     floating in the cramped 56px top bar like on desktop. */
  .nav__secondary {
    flex-direction: column; align-items: stretch; gap: .6rem;
    width: 100%; margin-top: .6rem; padding-top: .75rem;
    border-top: 1px solid var(--border);
  }
  .lang-switch { align-self: flex-start; }

  /* Sub-menus (Admin, account) expand inline in the panel instead of as a
     floating desktop-style popover. */
  .nav__right .user-menu { width: 100%; }
  .nav__right #admin-menu-trigger,
  .nav__right .user-menu__trigger { width: 100%; min-height: 44px; justify-content: space-between; }
  .nav__right .user-menu__name { display: inline; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav__right .user-menu__dropdown {
    position: static; width: 100%; min-width: 0;
    margin-top: .2rem; padding: 0 0 0 .5rem; border: 0;
    border-left: 2px solid var(--border);
    border-radius: 0; background: transparent; box-shadow: none;
  }
  .nav__right .user-menu__item { min-height: 44px; }

  .portal-hero           { padding: 3.5rem 1rem 3rem; }
  .portal-hero__stats    { grid-template-columns: repeat(3, minmax(0,1fr)); gap: .5rem; }
  .portal-hero__stats > div { padding: .75rem .4rem; }
  .portal-hero__stats dt { font-size: 1.2rem; }
  .portal-hero__actions  { flex-direction: column; align-items: stretch; }
  .portal-hero__actions .btn { width: 100%; }

  .portal-section   { padding: min(var(--site-section-spacing), 2.5rem) 1rem; }
  .portal-cards     { grid-template-columns: 1fr; }
  .portal-features  { grid-template-columns: 1fr; }

  .site-footer       { padding: 1.5rem 1rem; }
  .site-footer__inner { grid-template-columns: 1fr; text-align: center; }
  .site-footer__links { gap: .3rem .75rem; }

  .legal-page  { margin: 2rem auto; padding: 0 1rem; }
  .legal-page h1 { font-size: 1.5rem; }

  .auth-wrap  { padding: 2rem 1rem; align-items: flex-start; padding-top: 2.5rem; }
  .auth-box   { padding: 1.5rem 1.25rem 1.25rem; }

  .page-container { padding: 1.5rem 1rem; }
  .page-header h1 { font-size: 1.35rem; }

  .dashboard-board-shell__header,
  .dashboard-board-toolbar {
    flex-direction: column; align-items: stretch;
  }
  .dashboard-board-shell { padding: .75rem; }
  .dashboard-taskflow { padding: 0; }
  .dashboard-taskflow__topbar { padding: .7rem; }
  .dashboard-taskflow__workspace-summary { grid-template-columns: 1fr 1fr; padding: .7rem; }
  .dashboard-taskflow .dashboard-board-toolbar { padding: .55rem .7rem; }
  .dashboard-board-shell__actions { width: 100%; }
  .dashboard-board-shell__actions > button { flex: 1; }
  .dashboard-task-form__grid { grid-template-columns: 1fr; }
  .task-workflow-hint { grid-column: 1; }
  .member-board-access__controls { flex-direction: column; align-items: stretch; }
  .member-list__item--board-member { margin-left: 0; }
  .dashboard-modal { align-items: flex-end; padding: 0; }
  .dashboard-modal__panel {
    width: 100%; max-height: 92dvh; border-radius: 18px 18px 0 0;
  }
  .dashboard-modal__panel--task { padding-bottom: 0; }
  .dashboard-modal__panel--task .dashboard-modal__actions {
    position: sticky;
    bottom: 0;
    z-index: 3;
    margin: .2rem -1rem 0;
    padding: .75rem 1rem max(.75rem, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    backdrop-filter: blur(12px);
  }
  .dashboard-modal__panel--task .dashboard-modal__actions > button { flex: 1; }
}

.theme-preset-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .9rem;
  padding: .9rem 1rem;
  border: 1px solid rgba(124,58,237,.24);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(124,58,237,.12), rgba(59,130,246,.06));
}

.theme-preset-bar > div:first-child {
  display: grid;
  gap: .18rem;
}

.theme-preset-bar strong {
  color: rgba(255,255,255,.94);
  font-size: .82rem;
}

.theme-preset-bar span {
  color: rgba(255,255,255,.58);
  font-size: .72rem;
  line-height: 1.45;
}

.theme-preset-bar__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .45rem;
}

.theme-preset-bar__actions .owner-btn {
  min-height: 34px;
  padding: .42rem .7rem;
  font-size: .72rem;
}

.theme-number-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .55rem;
}

.theme-number-control > span {
  min-width: 1.6rem;
  color: rgba(255,255,255,.55);
  font-size: .75rem;
  font-weight: 800;
}

.theme-preview-quality {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-height: 34px;
  padding: .45rem .65rem;
  border: 1px solid rgba(34,197,94,.24);
  border-radius: 10px;
  background: rgba(34,197,94,.08);
  color: rgba(220,252,231,.9);
  font-size: .7rem;
}

.theme-preview-quality__dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74,222,128,.12);
}

.theme-preview-quality > span:last-child {
  margin-left: auto;
  color: rgba(255,255,255,.58);
  font-variant-numeric: tabular-nums;
}

.theme-preview-quality.is-warning {
  border-color: rgba(251,191,36,.3);
  background: rgba(251,191,36,.08);
  color: #fde68a;
}

.theme-preview-quality.is-warning .theme-preview-quality__dot {
  background: #fbbf24;
  box-shadow: 0 0 0 3px rgba(251,191,36,.12);
}

@media (max-width: 900px) {
  .content-field-grid--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .theme-preset-bar {
    align-items: stretch;
    flex-direction: column;
  }
  .theme-preset-bar__actions { justify-content: flex-start; }
  .theme-preset-bar__actions .owner-btn { flex: 1 1 120px; }
  .content-field-grid--compact,
  .portal-theme-preview__components,
  .portal-theme-preview__card-grid { grid-template-columns: 1fr; }
  .theme-control-row { grid-template-columns: 48px minmax(0, 1fr); }
  .theme-color-picker { width: 48px; }
  .theme-preview-quality { flex-wrap: wrap; }
  .theme-preview-quality > span:last-child { width: 100%; margin-left: 1.2rem; }
}

/* ── 24. Small phones ────────────────────────────────────────── */
@media (max-width: 380px) {
  .portal-hero__stats { grid-template-columns: 1fr; max-width: 240px; }
  .portal-hero__title { letter-spacing: -.02em; }
  .nav-brand__text    { display: none; }
}

/* ── 25. Admin bar ───────────────────────────────────────────── */
.admin-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 900;
  background: rgba(12,16,32,.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,.12);
  color: #fff;
  font-size: .78rem;
  font-family: var(--font);
  box-shadow: 0 12px 34px rgba(0,0,0,.24);
}

.admin-bar__inner {
  display: flex;
  align-items: center;
  gap: .5rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 40px;
}

.admin-bar__brand {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-weight: 600;
  color: #67e8f9;
  white-space: nowrap;
  flex-shrink: 0;
  padding-right: .75rem;
  border-right: 1px solid rgba(255,255,255,.12);
  margin-right: .25rem;
}

.admin-bar__role-badge {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: rgba(124,58,237,.22);
  color: #c4b5fd;
  border-radius: 4px;
  padding: .1rem .35rem;
  line-height: 1.4;
}

.admin-bar__actions {
  display: flex;
  align-items: center;
  gap: .15rem;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.admin-bar__actions::-webkit-scrollbar { display: none; }

.admin-bar__action {
  display: flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .55rem;
  border-radius: 6px;
  color: rgba(255,255,255,.74);
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.admin-bar__action:hover,
.admin-bar__action:focus-visible {
  background: rgba(255,255,255,.10);
  color: #fff;
  outline: none;
}
.admin-bar__action:focus-visible {
  outline: 2px solid #06b6d4;
  outline-offset: 1px;
}

.admin-bar__sep {
  display: block;
  width: 1px;
  height: 18px;
  background: rgba(255,255,255,.12);
  margin: 0 .35rem;
  flex-shrink: 0;
}

.admin-bar__collapse {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #8892b0;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}
.admin-bar__collapse:hover {
  background: rgba(255,255,255,.10);
  color: #fff;
}

.admin-bar__restore {
  position: fixed;
  top: .5rem; right: .75rem;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(12,16,32,.90);
  color: #06b6d4;
  backdrop-filter: blur(12px);
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}
.admin-bar__restore:hover {
  background: rgba(255,255,255,.10);
  color: #fff;
  box-shadow: 0 14px 34px rgba(0,0,0,.45);
}
.admin-bar__restore:focus-visible {
  outline: 2px solid #06b6d4;
  outline-offset: 2px;
}

/* Give the page top padding so the admin bar doesn't overlap content */
body:has(.admin-bar:not([hidden])) {
  padding-top: 40px;
}

@media (max-width: 760px) {
  /* Move restore button to bottom-right on mobile to avoid overlapping the nav bar */
  .admin-bar__restore {
    top: auto;
    bottom: 1rem;
    right: 1rem;
  }
}

@media (max-width: 600px) {
  .admin-bar__action span { display: none; }
  .admin-bar__brand span:not(.admin-bar__role-badge) { display: none; }
}

/* ── 26. Reduced motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr);
  gap: 1.25rem;
  align-items: start;
  margin-top: 1.5rem;
}

.contact-form-card,
.contact-info-card,
.contact-faq-section {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.contact-form-card,
.contact-info-card {
  padding: 1.25rem;
}

.contact-form-card__header {
  margin-bottom: 1rem;
}

.contact-form-card__eyebrow,
.contact-faq-section__intro,
.contact-sidebar__text,
.contact-method__value {
  color: var(--text-muted);
}

.contact-form-card__eyebrow {
  margin: 0 0 .35rem;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.contact-form-card__title,
.contact-info-card__title,
.contact-faq-section__title {
  margin: 0;
}

.contact-form-card__intro {
  margin: .4rem 0 0;
  color: var(--text-muted);
}

.contact-form,
.contact-sidebar {
  display: grid;
  gap: 1rem;
}

.contact-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.contact-message-input {
  min-height: 11rem;
  resize: vertical;
}

.contact-method {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  padding-top: .85rem;
  margin-top: .85rem;
  border-top: 1px solid var(--border);
}

.contact-method__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2rem;
  border-radius: 6px;
  background: var(--bg-subtle);
  color: var(--accent);
  font-size: .7rem;
  font-weight: 800;
}

.contact-method__label {
  font-weight: 700;
}

.contact-faq-section {
  margin-top: 1.5rem;
  padding: 1.25rem;
}

.contact-faq-section__intro {
  margin: .35rem 0 1rem;
}

.faq-list {
  display: grid;
  gap: .55rem;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-subtle);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.faq-item.is-open {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: .95rem 1.1rem;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: .97rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.faq-question:hover {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  color: var(--accent);
}

.faq-item.is-open .faq-question {
  color: var(--accent);
  border-bottom: 1px solid var(--border);
}

.faq-question__chevron {
  flex-shrink: 0;
  opacity: .55;
  transition: transform .25s ease, opacity .2s ease;
}

.faq-item.is-open .faq-question__chevron {
  transform: rotate(180deg);
  opacity: 1;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  padding: 0 1.1rem;
  color: var(--text-muted);
  line-height: 1.7;
  font-size: .93rem;
  transition: max-height .3s ease, padding .3s ease;
}

.faq-item.is-open .faq-answer {
  max-height: 600px;
  padding: .9rem 1.1rem 1.1rem;
}

.apps-live-delete--hint {
  color: var(--text-muted);
  font-size: .82rem;
  text-align: center;
}

@media (max-width: 800px) {
  .contact-grid,
  .contact-details-grid {
    grid-template-columns: 1fr;
  }
}
.task-comment-form__attachment {
    align-items: center;
    display: flex;
    gap: .65rem;
    padding: .55rem;
    border: 1px solid var(--border);
    border-radius: .6rem;
}
.task-comment-form__attachment[hidden] { display: none; }
.task-comment-form__attachment img {
    width: 72px;
    height: 54px;
    object-fit: cover;
    border-radius: .4rem;
}
.task-comment-form__attachment span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.task-comment-form__attach { cursor: pointer; }
.task-comment-form__hint { color: var(--muted); }
.task-comment-form.is-dragging .task-comment-form__input {
    outline: 2px dashed var(--accent);
    outline-offset: 2px;
}
.task-comment__attachment {
    display: block;
    width: min(100%, 520px);
    margin-top: .55rem;
}
.task-comment__attachment img {
    display: block;
    width: 100%;
    max-height: 360px;
    object-fit: contain;
    border-radius: .55rem;
    background: rgba(0, 0, 0, .06);
}

/* ============================================================
   2026 portal refresh — craft operations workspace
   ============================================================ */
:root {
  --portal-ink: #0b1f3a;
  --portal-blue: #0b4dcc;
  --portal-blue-dark: #073a9c;
  --portal-signal: #d99016;
  --portal-paper: color-mix(in srgb, var(--bg) 96%, #f2e8d8);
  --portal-line: color-mix(in srgb, var(--portal-ink) 22%, var(--border));
  --portal-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --portal-ink: #edf4ff;
    --portal-blue: #6f9fff;
    --portal-blue-dark: #9bbaff;
    --portal-signal: #f0ad3b;
    --portal-paper: color-mix(in srgb, var(--bg) 94%, #10213a);
    --portal-line: color-mix(in srgb, var(--portal-ink) 22%, var(--border));
  }
}

body {
  background: var(--portal-paper);
}

.nav {
  background: color-mix(in srgb, var(--portal-paper) 94%, transparent);
  border-bottom-color: var(--portal-line);
  backdrop-filter: blur(14px);
}

.nav__inner {
  min-height: 72px;
  height: auto;
}

.nav-brand {
  gap: .75rem;
  color: var(--portal-ink);
  font-size: 1.03rem;
  font-weight: 760;
}

.nav-brand__mark {
  width: 38px;
  height: 38px;
  color: var(--portal-blue);
  background: transparent;
  border: 1px solid var(--portal-blue);
  border-radius: 1px;
  font-family: var(--portal-display);
  font-size: 1.5rem;
  font-weight: 500;
  box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--portal-blue) 7%, transparent);
}

.nav-brand__text span { color: var(--portal-blue); }

.nav-link {
  padding: .55rem .8rem;
  color: color-mix(in srgb, var(--portal-ink) 72%, var(--text-muted));
  font-size: .82rem;
  font-weight: 650;
}

.nav-link:hover,
.nav-link.active {
  color: var(--portal-blue);
  background: color-mix(in srgb, var(--portal-blue) 7%, transparent);
}

.nav-link--cta {
  color: #fff !important;
  background: var(--portal-blue);
  border-radius: 7px;
  box-shadow: none;
}

.nav-link--cta:hover { background: var(--portal-blue-dark); }

.lang-switch {
  padding: 0;
  gap: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.lang-switch__btn {
  min-width: 36px;
  border-radius: 0;
  border-left: 1px solid var(--portal-line);
  color: var(--text-muted);
}

.lang-switch__btn.is-active {
  color: var(--portal-blue);
  background: transparent;
  box-shadow: none;
}

.portal-hero {
  padding: clamp(3.25rem, 6vw, 6.5rem) 1.5rem clamp(2.75rem, 5vw, 4.75rem);
  background: var(--portal-paper);
}

.portal-hero::before {
  background-image:
    linear-gradient(color-mix(in srgb, var(--portal-blue) 5%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--portal-blue) 5%, transparent) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center top;
  opacity: .68;
  mask-image: linear-gradient(90deg, #000, transparent 38%, transparent 68%, #000);
}

.portal-hero__inner {
  max-width: var(--site-shell-width);
  display: grid;
  grid-template-columns: minmax(300px, .78fr) minmax(520px, 1.22fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5.5rem);
  text-align: left;
}

.portal-hero__copy {
  position: relative;
  z-index: 1;
}

.portal-hero__copy::before {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  left: -64px;
  top: -38px;
  border: 1px solid color-mix(in srgb, var(--portal-blue) 10%, transparent);
  border-radius: 50%;
  box-shadow:
    0 0 0 28px color-mix(in srgb, var(--portal-blue) 2.5%, transparent),
    0 0 0 56px color-mix(in srgb, var(--portal-blue) 1.8%, transparent);
  pointer-events: none;
}

.portal-hero__eyebrow,
.portal-section__eyebrow,
.portal-section__kicker {
  display: inline-flex;
  margin: 0 0 1.25rem;
  padding: 0 0 .55rem;
  color: var(--portal-blue);
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--portal-blue);
  border-radius: 0;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .13em;
  line-height: 1;
  text-transform: uppercase;
}

.portal-hero__title {
  max-width: 650px;
  margin: 0 0 1.25rem;
  color: var(--portal-ink);
  font-family: var(--portal-display);
  font-size: clamp(3rem, 5.25vw, 5.3rem);
  font-weight: 500;
  letter-spacing: -.052em;
  line-height: .98;
}

.portal-hero__title-accent {
  margin-top: .12em;
  color: var(--portal-ink);
  background: none;
  -webkit-text-fill-color: currentColor;
}

.portal-hero__subtitle {
  max-width: 520px;
  margin: 0 0 2rem;
  color: color-mix(in srgb, var(--portal-ink) 76%, var(--text-muted));
  font-size: clamp(1rem, 1.35vw, 1.12rem);
  line-height: 1.65;
}

.portal-hero__actions {
  justify-content: flex-start;
  margin: 0;
}

.portal-hero .btn {
  min-height: 48px;
  padding: .72rem 1.45rem;
  border-radius: 7px;
  font-size: .88rem;
  font-weight: 720;
}

.portal-hero .btn--primary {
  background: var(--portal-blue);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--portal-blue) 23%, transparent);
}

.portal-hero .btn--primary:hover {
  background: var(--portal-blue-dark);
  box-shadow: 0 10px 25px color-mix(in srgb, var(--portal-blue) 27%, transparent);
}

.portal-hero .btn--ghost {
  color: var(--portal-blue);
  background: transparent;
  border-color: var(--portal-blue);
}

.portal-hero .btn--ghost:hover {
  background: color-mix(in srgb, var(--portal-blue) 7%, transparent);
}

.portal-hero__glow { display: none; }

.portal-preview {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  color: var(--portal-ink);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border: 2px solid var(--portal-ink);
  border-radius: 14px;
  box-shadow: 0 24px 60px color-mix(in srgb, var(--portal-ink) 12%, transparent);
}

.portal-preview__rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .7rem;
  padding: 1rem .65rem;
  color: #fff;
  background: #08243f;
}

.portal-preview__rail-item {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  color: #fff;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  font: 750 .85rem/1 var(--portal-body);
  cursor: pointer;
  opacity: .8;
}

.portal-preview__rail-item.is-active {
  background: #0d4f91;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
  opacity: 1;
}

.portal-preview__rail-item:hover { border-color: rgba(255,255,255,.45); opacity: 1; }
.portal-preview__rail-item:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.portal-preview svg,
.portal-app svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.portal-preview__rail-item svg { width: 22px; height: 22px; }

.portal-preview__body { min-width: 0; }

.portal-preview__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 1.6rem;
  border-bottom: 1px solid var(--portal-line);
}

.portal-preview__head strong { font-size: .95rem; }
.portal-preview__health {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.portal-preview__health > span { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.portal-preview__health.is-online { color: var(--success); }
.portal-preview__health.is-offline { color: var(--portal-signal); }
.portal-preview__health.is-unknown { color: var(--text-muted); }

.portal-preview__apps { display: grid; min-height: 286px; padding: 1.35rem; }

.portal-preview__slide {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  gap: 1rem 1.25rem;
  min-width: 0;
  padding: clamp(1.15rem, 3vw, 2rem);
  border: 1px solid var(--portal-line);
  background: color-mix(in srgb, var(--portal-blue) 5%, var(--bg));
}

.portal-preview__slide-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  color: #fff;
  background: #0d4f91;
  border-radius: 12px;
  font: 800 1.35rem/1 var(--portal-body);
  overflow: hidden;
}

.portal-preview__slide-copy { align-self: center; min-width: 0; }
.portal-preview__slide-tag { display: block; min-height: 1em; color: var(--portal-blue); font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.portal-preview__slide h3 { margin: .3rem 0 .45rem; font-family: var(--portal-display); font-size: clamp(1.35rem, 3vw, 2rem); }
.portal-preview__slide p { display: -webkit-box; margin: 0; overflow: hidden; color: var(--text-muted); font-size: .82rem; line-height: 1.6; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.portal-preview__open { grid-column: 2; display: inline-flex; align-items: center; justify-self: start; gap: .45rem; color: var(--portal-blue); font-size: .74rem; font-weight: 800; }
.portal-preview__open svg { width: 16px; height: 16px; }

.portal-preview__app {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: .9rem;
  min-height: 66px;
  padding: .55rem .85rem;
  border-bottom: 1px solid var(--portal-line);
}

.portal-preview__app:last-child { border-bottom: 0; }

.portal-preview__app-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--portal-blue);
}

.portal-preview__app-icon svg { width: 30px; height: 30px; }
.portal-preview__app strong { overflow: hidden; font-size: .9rem; text-overflow: ellipsis; white-space: nowrap; }

.portal-preview__status,
.portal-app__health {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--text-muted);
  font-size: .7rem;
  font-weight: 650;
}

.portal-preview__status > span,
.portal-app__health > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.portal-preview__status.is-online,
.portal-app__health.is-online { color: var(--success); }
.portal-preview__status.is-offline,
.portal-app__health.is-offline { color: var(--portal-signal); }
.portal-preview__arrow { width: 17px; height: 17px; }

.portal-preview__foot {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--portal-line);
}

.portal-preview__foot span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 62px;
  padding: .6rem;
  border-right: 1px solid var(--portal-line);
  font-size: .65rem;
  font-weight: 650;
  text-align: center;
}

.portal-preview__foot span:last-child { border-right: 0; }
.portal-preview__foot svg { width: 17px; height: 17px; flex: 0 0 auto; }

.portal-hero__stats {
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  max-width: none;
  width: 100%;
  margin: clamp(.5rem, 2vw, 1.25rem) 0 0;
  border: 1px solid var(--portal-line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
}

.portal-hero__stats > div {
  display: grid;
  grid-template-columns: 42px auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 1rem;
  min-height: 98px;
  padding: 1rem clamp(1rem, 2.5vw, 2.2rem);
  background: transparent;
  border: 0;
  border-right: 1px solid var(--portal-line);
  border-radius: 0;
}

.portal-hero__stats > div:last-child { border-right: 0; }
.portal-hero__stat-icon { grid-row: 1 / -1; display: grid; place-items: center; width: 42px; height: 42px; color: var(--portal-blue); background: color-mix(in srgb, var(--portal-blue) 8%, transparent); border-radius: 50%; }
.portal-hero__stat-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.portal-hero__stats dt { align-self: end; color: var(--portal-blue); font-family: var(--portal-display); font-size: 1.85rem; font-weight: 500; line-height: 1; }
.portal-hero__stats dd { align-self: start; margin-top: .25rem; color: var(--text-muted); font-size: .7rem; font-weight: 650; letter-spacing: .02em; text-transform: none; }

.portal-hero + .portal-section,
.portal-section--alt {
  max-width: none;
  margin: 0;
  padding: clamp(4rem, 7vw, 7rem) max(1.5rem, calc((100vw - var(--site-shell-width)) / 2));
}

.portal-hero + .portal-section {
  padding-top: clamp(3rem, 4vw, 4rem);
  padding-bottom: clamp(3rem, 4vw, 4rem);
  background: var(--portal-paper);
  border-top: 1px solid var(--portal-line);
}

.portal-hero + .portal-section .portal-section__head,
.portal-section--alt .portal-section__head {
  max-width: var(--site-shell-width);
  margin: 0 auto 2.75rem;
  text-align: left;
}

.portal-section__kicker { margin-bottom: 1rem; }

.portal-hero + .portal-section .portal-section__title,
.portal-section--alt .portal-section__title {
  color: var(--portal-ink);
  font-family: var(--portal-display);
  font-size: clamp(2.35rem, 4.4vw, 4.25rem);
  font-weight: 500;
  letter-spacing: -.04em;
  line-height: 1.05;
}

.portal-hero + .portal-section .portal-section__subtitle,
.portal-section--alt .portal-section__subtitle {
  max-width: 760px;
  margin-top: .65rem;
  color: color-mix(in srgb, var(--portal-ink) 72%, var(--text-muted));
  font-size: .98rem;
}

.portal-app-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: var(--site-shell-width);
  margin: 0 auto;
  border-top: 1px solid var(--portal-line);
}

.portal-app {
  --app-accent: var(--portal-blue);
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.2rem;
  min-height: 178px;
  padding: 1.55rem 1.9rem 1.55rem 0;
  color: var(--portal-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--portal-line);
  transition: background .2s ease, color .2s ease;
}

.portal-app:nth-child(odd) { padding-right: 2rem; border-right: 1px solid var(--portal-line); }
.portal-app:nth-child(even) { padding-left: 2rem; }
.portal-app[data-tag="spiel"], .portal-app[data-tag="game"] { --app-accent: #b45309; }
.portal-app[data-tag="info"] { --app-accent: #087f8c; }
.portal-app[data-tag="starter"] { --app-accent: #47744c; }

.portal-app:hover { background: color-mix(in srgb, var(--app-accent) 5%, transparent); }

.portal-app__icon {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  color: var(--app-accent);
  border: 1px solid var(--portal-line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  transition: transform .2s ease, border-color .2s ease;
}

.portal-app:hover .portal-app__icon { transform: translateY(-3px); border-color: var(--app-accent); }
.portal-app__icon svg { width: 40px; height: 40px; }
.portal-app__body { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.portal-app__topline { display: flex; align-items: center; justify-content: space-between; gap: .75rem; width: 100%; }
.portal-app__title { font-size: 1rem; font-weight: 760; }
.portal-app__description { max-width: 34rem; margin-top: .35rem; color: var(--text-muted); font-size: .79rem; line-height: 1.55; }
.portal-app__tag { display: inline-flex; margin-top: .7rem; padding: .12rem .45rem; color: var(--app-accent); border: 1px solid currentColor; border-radius: 4px; font-size: .66rem; font-weight: 680; line-height: 1.35; }
.portal-app__cta { display: inline-flex; align-items: center; align-self: end; gap: .42rem; color: var(--app-accent); font-size: .78rem; font-weight: 740; white-space: nowrap; }
.portal-app__cta svg { width: 16px; height: 16px; transition: transform .2s ease; }
.portal-app:hover .portal-app__cta svg { transform: translate(2px, -2px); }

.portal-section--alt {
  padding-top: clamp(3rem, 4vw, 4rem);
  background: color-mix(in srgb, var(--portal-paper) 88%, var(--bg-subtle));
  border-top: 1px solid var(--portal-line);
  border-bottom: 1px solid var(--portal-line);
}

.portal-section--alt > * { max-width: none; padding: 0; }
.portal-section--alt .portal-section__eyebrow { margin-bottom: 1.25rem; }

.portal-features {
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  max-width: var(--site-shell-width);
}

.portal-feature {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 1rem;
  min-height: 150px;
  padding: 1.25rem 2rem;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--portal-line);
  border-radius: 0;
  box-shadow: none;
}

.portal-feature:first-child { padding-left: 0; }
.portal-feature:last-child { padding-right: 0; border-right: 0; }

.portal-feature__icon {
  width: 52px;
  height: 52px;
  margin: 0;
  color: var(--portal-blue);
  background: transparent;
  border: 0;
  border-radius: 0;
}

.portal-feature__icon svg { width: 44px; height: 44px; stroke-width: 1.55; }
.portal-feature h3 { margin: .15rem 0 .45rem; color: var(--portal-ink); font-size: .98rem; font-weight: 760; }
.portal-feature p { color: var(--text-muted); font-size: .79rem; line-height: 1.58; }

.site-footer {
  padding: 2.25rem 1.5rem;
  color: var(--text-muted);
  background: var(--portal-paper);
  border-top: 1px solid var(--portal-ink);
}

.site-footer__inner { max-width: var(--site-shell-width); }
.site-footer__title { color: var(--portal-ink); font-size: .95rem; font-weight: 760; }
.site-footer__links { gap: .4rem 1.35rem; }
.site-footer a:hover { color: var(--portal-blue); }

@media (max-width: 1040px) {
  .portal-hero__inner { grid-template-columns: minmax(280px, .8fr) minmax(460px, 1.2fr); gap: 2rem; }
  .portal-preview { grid-template-columns: 62px minmax(0, 1fr); }
  .portal-preview__rail { padding-inline: .45rem; }
  .portal-preview__app { grid-template-columns: 40px minmax(0, 1fr) 16px; }
  .portal-preview__status { display: none; }
  .portal-preview__foot span { font-size: .58rem; }
  .portal-app { grid-template-columns: 70px minmax(0, 1fr); }
  .portal-app__icon { width: 64px; height: 64px; }
  .portal-app__cta { grid-column: 2; justify-self: start; margin-top: -.25rem; }
  .portal-feature { grid-template-columns: 48px minmax(0, 1fr); padding-inline: 1.35rem; }
}

@media (max-width: 800px) {
  .nav__inner { min-height: 64px; }
  .portal-hero { padding: 3.5rem 1.25rem 3rem; }
  .portal-hero__inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .portal-hero__title { max-width: 650px; font-size: clamp(3rem, 11vw, 4.7rem); }
  .portal-preview { width: 100%; }
  .portal-hero__stats { margin-top: 0; }
  .portal-app-list { grid-template-columns: 1fr; }
  .portal-app,
  .portal-app:nth-child(odd),
  .portal-app:nth-child(even) { padding: 1.4rem 0; border-right: 0; }
  .portal-features { grid-template-columns: 1fr; }
  .portal-feature,
  .portal-feature:first-child,
  .portal-feature:last-child { min-height: 0; padding: 1.5rem 0; border-right: 0; border-bottom: 1px solid var(--portal-line); }
  .portal-feature:last-child { border-bottom: 0; }
}

@media (max-width: 600px) {
  .portal-hero { padding-inline: 1rem; }
  .portal-hero__actions { display: grid; grid-template-columns: 1fr; }
  .portal-preview { grid-template-columns: 1fr; border-width: 1px; }
  .portal-preview__rail { flex-direction: row; justify-content: center; padding: .65rem; overflow-x: auto; }
  .portal-preview__head { min-height: 58px; padding-inline: 1rem; }
  .portal-preview__apps { min-height: 250px; padding: .65rem; }
  .portal-preview__slide { grid-template-columns: 52px minmax(0, 1fr); padding: 1rem; }
  .portal-preview__slide-icon { width: 52px; height: 52px; font-size: 1rem; }
  .portal-preview__app { grid-template-columns: 36px minmax(0, 1fr) 15px; min-height: 56px; padding-inline: .35rem; gap: .6rem; }
  .portal-preview__app-icon { width: 34px; height: 34px; }
  .portal-preview__app-icon svg { width: 25px; height: 25px; }
  .portal-preview__foot { grid-template-columns: 1fr; }
  .portal-preview__foot span { display: none; }
  .portal-preview__foot span:first-child { display: flex; min-height: 48px; border-right: 0; }
  .portal-hero__stats { grid-template-columns: 1fr; }
  .portal-hero__stats > div { min-height: 76px; border-right: 0; border-bottom: 1px solid var(--portal-line); }
  .portal-hero__stats > div:last-child { border-bottom: 0; }
  .portal-hero + .portal-section,
  .portal-section--alt { padding: 4rem 1rem; }
  .portal-app { grid-template-columns: 58px minmax(0, 1fr); gap: .85rem; }
  .portal-app__icon { width: 54px; height: 54px; }
  .portal-app__icon svg { width: 32px; height: 32px; }
  .portal-app__topline { align-items: flex-start; }
  .portal-app__health { margin-top: .2rem; }
  .portal-feature { grid-template-columns: 44px minmax(0, 1fr); gap: .75rem; }
  .portal-feature__icon { width: 42px; height: 42px; }
  .portal-feature__icon svg { width: 36px; height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .portal-app,
  .portal-app__icon,
  .portal-app__cta svg { transition: none; }
}
/* Feedline woodland theme: shared portal shell and feed surfaces */
:root {
  --wood-dark: #160f08;
  --wood-mid: #2b1c0f;
  --moss-panel: #131a0f;
  --moss-edge: #536126;
  --antique-gold: #c7a567;
  --antique-gold-dim: #846431;
}

body {
  background: radial-gradient(ellipse at 18% 8%, rgba(80,100,39,.18), transparent 28%), radial-gradient(ellipse at 88% 76%, rgba(60,82,32,.14), transparent 30%), repeating-linear-gradient(92deg, transparent 0 24px, rgba(255,222,153,.018) 25px 26px), linear-gradient(160deg, #080a06, #0e0d08 52%, #070905) !important;
  color: #ead5a5;
}

.nav {
  border-bottom: 3px double rgba(199,165,103,.46) !important;
  background: repeating-linear-gradient(4deg, rgba(255,255,255,.018) 0 1px, transparent 2px 8px), linear-gradient(90deg, #1a1008, #2a1b0e 48%, #160e07) !important;
  box-shadow: inset 0 -7px 12px rgba(0,0,0,.45), 0 7px 18px rgba(0,0,0,.5) !important;
}
.nav-brand__mark { border: 2px ridge var(--antique-gold-dim) !important; background: radial-gradient(circle, #35401e, #111609 68%) !important; color: #ead5a5 !important; box-shadow: inset 0 0 9px rgba(199,165,103,.32), 0 2px 5px #000; }
.nav-brand__text, .nav-link, .user-menu__trigger { color: #ead5a5 !important; }
.nav-link:hover, .nav-link:focus-visible { color: #fff1c5 !important; background: rgba(83,97,38,.28) !important; }
.site-footer { border-top-color: rgba(199,165,103,.35) !important; background: linear-gradient(180deg, #171008, #0b0906) !important; color: #c9b991 !important; }
.portal-card, .owner-card, .page-card {
  border: 3px ridge rgba(103,76,35,.82) !important;
  background: radial-gradient(circle at 80% 20%, rgba(82,101,42,.10), transparent 30%), linear-gradient(110deg, #192012, #10150d 72%) !important;
  color: #ead5a5 !important;
  box-shadow: inset 0 0 24px rgba(0,0,0,.55), 0 9px 18px rgba(0,0,0,.52) !important;
}
.page-header h1, .owner-card h2, .portal-card h2 { color: #ead5a5 !important; font-family: Georgia, "Times New Roman", serif; }
.page-header p, .owner-text-block, .portal-card p { color: #c9b991; }
.form-control {
  border-color: rgba(172,136,72,.5) !important;
  background: rgba(8,13,8,.78) !important;
  color: #f3ead2 !important;
}
.form-control:focus { border-color: #c7a567 !important; box-shadow: 0 0 0 3px rgba(199,165,103,.18) !important; }
.form-label { color: #d8c49a !important; }
.owner-btn, .btn-rust { border: 2px ridge var(--antique-gold-dim) !important; background: linear-gradient(180deg, #3c4720, #1b210f) !important; color: #ead5a5 !important; }
.owner-btn:hover, .btn-rust:hover { border-color: var(--antique-gold) !important; color: #fff1c5 !important; }
.owner-btn--danger { background: linear-gradient(180deg, #78352b, #371510) !important; }

.feed-page { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 80px; }
.feed-header { display:flex; align-items:end; justify-content:space-between; gap:24px; padding: 0 8px 25px; }
.feed-header h1, .feed-detail h1 { margin:0; color:#ead5a5; font: 500 clamp(2.1rem,5vw,3.7rem)/1.05 Georgia,"Times New Roman",serif; text-shadow:0 2px 2px #000; }
.feed-header p { margin:.55rem 0 0; color:#c9b991; }
.feed-count { padding:8px 15px; border:1px solid rgba(199,165,103,.32); border-radius:999px; background:rgba(18,18,10,.55); color:#d2b980; white-space:nowrap; }
.feed-filters { display:flex; gap:10px; overflow-x:auto; padding:14px 10px 16px; margin-bottom:24px; border-block:3px ridge rgba(92,62,29,.8); background:linear-gradient(180deg,#392515,#25170c 56%,#160e08); scrollbar-color:#846431 #160e08; }
.feed-filter { min-height:40px; display:inline-flex; align-items:center; gap:8px; padding:8px 14px; border:1px solid rgba(172,136,72,.42); border-radius:8px; background:linear-gradient(180deg,rgba(54,43,23,.9),rgba(25,22,12,.94)); color:#d8c49a; text-decoration:none; white-space:nowrap; box-shadow:inset 0 1px rgba(255,230,170,.07),0 2px 5px rgba(0,0,0,.45); }
.feed-filter:hover, .feed-filter.is-active { border-color:#75823d; background:linear-gradient(180deg,#53612a,#263314 74%); color:#fff1c5; }
.feed-filter:focus-visible, .feed-card:focus-visible, .feed-back:focus-visible { outline:3px solid #f0c66e; outline-offset:3px; }
.feed-filter__dot { width:9px; height:9px; border-radius:50%; background:var(--feed-category,#c7a567); box-shadow:0 0 8px color-mix(in srgb,var(--feed-category,#c7a567),transparent 35%); }
.feed-filter__icon { width:26px; height:26px; border-radius:8px; object-fit:cover; border:1px solid color-mix(in srgb,var(--feed-category,#c7a567),transparent 35%); }
.feed-filter small { color:#af9665; }
.feed-list { display:grid; gap:18px; }
/* Fixed height, not min-height: without this the row (and so the media column, which stretches
   to match it) sized itself to whatever was tallest between the image and the title/subtitle text,
   so cards varied in height per article. overflow:hidden + the h2/p line-clamps below are the
   safety net for text that's still too long to fit once the box itself no longer grows for it. */
.feed-card { height:270px; display:grid; grid-template-columns:minmax(250px,40%) 1fr; overflow:hidden; position:relative; scroll-margin-top:24px; border:3px ridge rgba(103,76,35,.82); border-radius:10px; background:radial-gradient(circle at 80% 20%,rgba(82,101,42,.10),transparent 30%),linear-gradient(110deg,#192012,#10150d 72%); color:inherit; text-decoration:none; box-shadow:inset 0 0 0 1px rgba(195,155,80,.18),inset 0 0 24px rgba(0,0,0,.65),0 6px 12px rgba(0,0,0,.62); transition:transform .18s ease,border-color .18s ease; }
.feed-card:hover { transform:translateY(-2px); border-color:rgba(151,121,59,.92); }
.feed-card__media { height:100%; display:grid; place-items:center; overflow:hidden; border-right:3px ridge rgba(92,69,32,.76); background:radial-gradient(ellipse at 46% 62%,color-mix(in srgb,var(--feed-category),transparent 58%),transparent 26%),linear-gradient(145deg,#344323,#11180e 62%,#60451f); color:#e3c990; font:4rem Georgia,serif; }
.feed-card__media img { width:100%; height:100%; object-fit:cover; filter:sepia(.12) saturate(.9) contrast(1.04); }
.feed-card__body { min-width:0; display:flex; flex-direction:column; justify-content:center; padding:28px 34px 24px; overflow:hidden; }
.feed-card__meta { display:flex; justify-content:space-between; gap:16px; align-items:center; margin-bottom:14px; color:#af9665; font-size:.82rem; }
.feed-category { display:inline-flex; width:max-content; padding:5px 9px; border:1px solid color-mix(in srgb,var(--feed-category),transparent 38%); border-radius:7px; background:color-mix(in srgb,var(--feed-category),transparent 78%); color:#ece0b4; font-size:.75rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase; }
/* Truncate with an ellipsis instead of relying on the card's own overflow:hidden to hard-clip
   mid-line once the fixed card height above runs out of room. */
.feed-card h2 { margin:0 0 9px; color:#ead4a6; font:500 clamp(1.45rem,2.2vw,2rem)/1.15 Georgia,"Times New Roman",serif; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; line-clamp:2; overflow:hidden; }
.feed-card__body>p { margin:0 0 20px; color:#c9b991; line-height:1.5; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; line-clamp:2; overflow:hidden; }
.feed-dates { display:flex; gap:0; margin:0; padding-top:15px; border-top:1px solid rgba(111,131,50,.42); }
.feed-dates>div { padding-right:22px; }
.feed-dates>div+div { padding-left:22px; border-left:1px solid rgba(111,131,50,.42); }
.feed-dates dt { color:#b7a75a; font-size:.65rem; letter-spacing:.1em; text-transform:uppercase; }
.feed-dates dd { margin:3px 0 0; color:#d5c39a; font-size:.82rem; }
.feed-pagination { display:flex; justify-content:center; align-items:center; gap:20px; margin-top:28px; color:#af9665; }
.feed-pagination a, .feed-back { color:#d7bd82; }
.feed-empty { padding:70px 24px; text-align:center; border:3px ridge rgba(103,76,35,.6); background:rgba(19,26,15,.78); }
.feed-detail { max-width:800px; margin:0 auto; padding:28px 34px 52px; border-inline:1px solid rgba(118,85,39,.48); background:linear-gradient(90deg,rgba(43,28,14,.28),rgba(17,22,13,.66),rgba(43,28,14,.28)); }
.feed-back { display:inline-block; margin-bottom:28px; }
.feed-detail>.feed-category { margin-bottom:14px; }
.feed-detail__subtitle { color:#c9b991; font-size:1.1rem; line-height:1.55; }
.feed-detail__hero { width:100%; max-height:480px; object-fit:cover; margin:24px 0; border:3px ridge rgba(103,76,35,.82); border-radius:8px; }
.feed-detail__video { display:block; width:100%; max-height:70vh; margin:24px 0; border:3px ridge rgba(103,76,35,.82); border-radius:8px; background:#090704; box-shadow:0 16px 36px rgba(0,0,0,.34); }
.feed-detail__video--embed { position:relative; aspect-ratio:16/9; max-height:70vh; padding:0; overflow:hidden; }
.feed-detail__video--embed iframe { position:absolute; inset:0; width:100%; height:100%; border:0; }
.feed-detail__body p { color:#ead5a5; font-size:1.03rem; line-height:1.75; white-space:pre-wrap; }
.feed-sources { margin-top:34px; padding-top:20px; border-top:1px solid rgba(111,131,50,.42); }
.feed-sources h2 { color:#d7bd82; font-family:Georgia,serif; }
.feed-sources a { color:#c7a567; overflow-wrap:anywhere; }
.owner-feed { padding-block:36px 70px; }
.owner-feed .page-header { display:flex; justify-content:space-between; align-items:end; gap:24px; }
.owner-feed__editor { margin-bottom:24px; }
.owner-feed__editor-summary { display:flex; align-items:center; justify-content:space-between; gap:12px; cursor:pointer; list-style:none; -webkit-tap-highlight-color:transparent; padding:2px 0; }
.owner-feed__editor-summary::-webkit-details-marker { display:none; }
.owner-feed__editor-summary h2 { margin:0; }
.owner-feed__editor-summary:hover h2,.owner-feed__editor-summary:focus-visible h2 { color:#f0c66e; }
.owner-feed__editor-summary:focus-visible { outline:2px solid #c7a567; outline-offset:2px; }
.owner-feed__editor-chevron { flex:0 0 auto; width:9px; height:9px; border-right:2px solid #af9665; border-bottom:2px solid #af9665; transform:rotate(-45deg); transition:transform .15s ease; }
.owner-feed__editor-details[open] > .owner-feed__editor-summary .owner-feed__editor-chevron { transform:rotate(45deg); }
.owner-feed__editor-details > form { margin-top:18px; }
.owner-feed-form { display:grid; grid-template-columns:1fr 180px; gap:18px; }
.owner-feed-form__wide, .owner-feed-check, .owner-feed-actions { grid-column:1/-1; }
.form-control--color { min-height:44px; padding:5px; }
.owner-feed-check { display:flex; align-items:center; gap:9px; color:#d8c49a; }
.owner-feed-actions, .owner-feed-row__actions { display:flex; flex-wrap:wrap; gap:9px; }
.owner-feed-list { display:grid; gap:12px; }
.owner-feed-row { display:grid; grid-template-columns:auto 1fr auto; align-items:start; gap:16px; padding:18px; border:1px solid rgba(172,136,72,.35); background:rgba(8,13,8,.52); }
.owner-feed-row h3 { margin:0 0 4px; color:#ead4a6; font-family:Georgia,serif; }
.owner-feed-row p { margin:0 0 6px; color:#c9b991; }
.owner-feed-row small { color:#af9665; }
.owner-feed-row form { margin:0; }
.owner-ad-row__thumb { width:96px; height:80px; object-fit:cover; border-radius:6px; border:1px solid rgba(172,136,72,.35); flex-shrink:0; }
.owner-ad-row__pages { font-size:.82rem; color:#af9665 !important; }
.owner-ad-row__status { display:inline-block; padding:.13rem .48rem; border-radius:4px; background:rgba(255,255,255,.06); color:#af9665; font-family:var(--font-mono); font-size:.69rem; font-weight:700; white-space:nowrap; }

/* Werbebanner: quick "what's live right now" summary at the top of the admin page. */
.owner-ad-status { display:flex; align-items:center; gap:16px; padding:14px 16px; border:1px solid rgba(172,136,72,.35); border-radius:10px; background:rgba(8,13,8,.52); margin-top:14px; }
.owner-ad-status__thumb { width:64px; height:53px; object-fit:cover; border-radius:6px; border:1px solid rgba(172,136,72,.35); flex-shrink:0; }
.owner-ad-status__empty { width:64px; height:53px; border-radius:6px; border:1px dashed rgba(172,136,72,.4); flex-shrink:0; }
.owner-ad-status__thumb-stack { display:flex; gap:6px; flex-shrink:0; }
.owner-ad-status p { margin:0; color:#c9b991; }
.owner-ad-status strong { color:#ead4a6; }

/* Werbebanner: the upload/URL preview must use the SAME 6:5 crop as the live homepage banner
   (.portal-ad-banner__media), not the 16:9 crop shared with the feed image uploader. */
.feed-image-upload__preview.owner-ad-image-upload__preview { aspect-ratio:6/5; }

/* Werbebanner: "no image yet" dummy - an icon plus the recommended format/ratio, replacing the
   feed uploader's plain one-line text placeholder so an admin knows what to upload before they
   ever pick a file. */
.owner-ad-image-upload__placeholder { display:flex; flex-direction:column; align-items:center; gap:6px; padding:0 14px; text-align:center; }
.owner-ad-image-upload__placeholder-icon { color:#8a7550; opacity:.7; }
.owner-ad-image-upload__placeholder strong { color:#c7a567; font-weight:700; font-size:.92rem; }
.owner-ad-image-upload__placeholder small { color:#8a7550; font-size:.74rem; line-height:1.4; max-width:32ch; }

/* Werbebanner: a static (non-fixed) replica of .portal-ad-banner used only inside the editor,
   so an admin can see exactly how the banner will render before saving. */
.owner-ad-live-preview { display:flex; flex-direction:column; align-items:flex-start; gap:8px; }
.owner-ad-live-preview__frame { position:relative; width:min(300px,100%); background:var(--bg-elevated,#12140f); border:1px solid var(--border,rgba(172,136,72,.4)); border-radius:12px; box-shadow:0 12px 28px rgba(0,0,0,.34); overflow:hidden; }
.owner-ad-live-preview__close { position:absolute; top:8px; right:8px; width:26px; height:26px; border-radius:50%; border:none; background:rgba(10,10,10,.65); color:#f2e4c4; font-size:1.05rem; line-height:1; display:grid; place-items:center; pointer-events:none; }
.owner-ad-live-preview__media { display:block; aspect-ratio:6/5; width:100%; overflow:hidden; background:#0c0f08; position:relative; }
.owner-ad-live-preview__media img:not([hidden]) { width:100%; height:100%; object-fit:cover; display:block; }
.owner-ad-live-preview__placeholder { position:absolute; inset:0; display:grid; place-items:center; padding:12px; text-align:center; color:#8a7550; font-size:.85rem; }
.owner-ad-live-preview__media img[hidden] ~ .owner-ad-live-preview__placeholder { display:grid; }
.owner-ad-live-preview__media img:not([hidden]) ~ .owner-ad-live-preview__placeholder { display:none; }
.owner-ad-live-preview__label { display:block; padding:8px 12px; font-size:.68rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:#af9665; border-top:1px solid rgba(172,136,72,.24); }
.owner-ad-live-preview__caption { margin:0; color:#af9665; }
@media (max-width:700px) { .owner-ad-live-preview__frame { width:100%; } }
.owner-feed-filters { display:grid; grid-template-columns:minmax(220px,2fr) minmax(150px,1fr) minmax(180px,1fr) auto; gap:14px; align-items:end; margin:18px 0; }
.owner-feed-filter-actions { display:flex; gap:8px; padding-bottom:1px; }
.owner-category-delete { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin-top:14px; padding-top:14px; border-top:1px solid rgba(172,136,72,.24); }
.owner-category-delete .form-help { flex-basis:100%; }

@media (max-width:700px) {
  .feed-page { width:min(100% - 24px,1120px); padding-top:24px; }
  .feed-header { align-items:flex-start; }
  .feed-header p { max-width:28ch; }
  .feed-count { font-size:.75rem; }
  .feed-filters { margin-inline:-12px; padding-inline:12px; }
  .feed-filter { min-width:46px; min-height:44px; justify-content:center; padding-inline:12px; }
  .feed-filter small { display:none; }
  .feed-card { grid-template-columns:1fr; height:440px; }
  .feed-card__media { height:205px; min-height:0; border-right:0; border-bottom:3px ridge rgba(92,69,32,.76); }
  .feed-card__body { padding:18px; }
  .feed-card__meta time { display:none; }
  .feed-detail { padding:18px 16px 44px; }
  .owner-feed .page-header { align-items:flex-start; }
  .owner-feed-form { grid-template-columns:1fr; }
  .owner-feed-form>* { grid-column:1; }
  .owner-feed-row { grid-template-columns:1fr; }
  .owner-feed-filters { grid-template-columns:1fr; }
  .owner-feed-filter-actions { flex-wrap:wrap; }
}

.feed-image-upload__surface { display:grid; grid-template-columns:minmax(180px,320px) 1fr; gap:18px; padding:14px; border:1px solid rgba(172,136,72,.48); border-radius:10px; background:linear-gradient(145deg,rgba(48,31,17,.9),rgba(24,17,10,.92)); }
.feed-image-upload__surface:focus-within { outline:3px solid #f0c66e; outline-offset:2px; }
.feed-image-upload__preview { position:relative; aspect-ratio:16/9; overflow:hidden; display:grid; place-items:center; border:1px dashed rgba(215,180,110,.55); border-radius:8px; background:#140e08; color:#c7a567; }
.feed-image-upload__preview img { width:100%; height:100%; object-fit:cover; }
.feed-image-upload__preview[data-empty="false"] .feed-image-upload__placeholder { display:none; }
.feed-video-preview:not([hidden]) { display:block; width:100%; max-height:320px; margin-top:10px; border:1px solid rgba(172,136,72,.48); border-radius:8px; background:#140e08; }
.feed-video-preview-embed:not([hidden]) { display:block; width:100%; aspect-ratio:16/9; max-height:320px; margin-top:10px; border:1px solid rgba(172,136,72,.48); border-radius:8px; background:#140e08; }
.feed-image-upload__controls { display:flex; flex-direction:column; align-items:flex-start; justify-content:center; gap:10px; min-width:0; }
.feed-image-upload__input { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.feed-image-upload__input:focus-visible + * { outline:3px solid #f0c66e; }
.feed-image-upload__button { cursor:pointer; }
.feed-image-upload__external { margin-top:10px; }
.feed-image-upload__external summary { width:max-content; max-width:100%; cursor:pointer; color:#dec58d; }
.feed-image-upload__external .form-control { margin-top:9px; }
@media (max-width:700px) { .feed-image-upload__surface { grid-template-columns:1fr; } .feed-image-upload__preview { width:100%; } .feed-image-upload__button { min-height:44px; display:inline-flex; align-items:center; } }

@media (prefers-reduced-motion:reduce) { .feed-card { transition:none; } .feed-card:hover { transform:none; } }

.owner-feed-sections { display:flex; gap:10px; margin:18px 0 22px; padding:10px; border:3px ridge rgba(103,76,35,.72); background:linear-gradient(180deg,#392515,#1b1109); }
.owner-feed-sections a { display:flex; align-items:center; gap:9px; padding:10px 16px; border:1px solid rgba(199,165,103,.38); border-radius:7px; color:#ead5a5; text-decoration:none; font-family:Georgia,"Times New Roman",serif; }
.owner-feed-sections a:hover,.owner-feed-sections a:focus-visible { background:#35401e; border-color:#c7a567; }
.owner-feed-sections span { min-width:1.6rem; padding:2px 6px; border-radius:999px; background:rgba(199,165,103,.16); text-align:center; font:700 .72rem/1.4 system-ui,sans-serif; }
.owner-feed__categories { margin-bottom:28px; scroll-margin-top:90px; }
.owner-category-list { display:grid; gap:8px; margin-top:18px; }

.owner-category-item { border:1px solid rgba(172,136,72,.34); border-radius:8px; background:rgba(8,13,8,.55); overflow:hidden; }
.owner-category-item[open] { border-color:rgba(199,165,103,.55); }
.owner-category-item__summary {
  display:flex; align-items:center; gap:12px; padding:12px 15px;
  cursor:pointer; list-style:none; color:#ead5a5; font-weight:600;
  -webkit-tap-highlight-color:transparent;
}
.owner-category-item__summary::-webkit-details-marker { display:none; }
.owner-category-item__summary:hover,.owner-category-item__summary:focus-visible { background:rgba(83,97,42,.16); }
.owner-category-item__summary:focus-visible { outline:2px solid #c7a567; outline-offset:-2px; }

.owner-category-item__swatch { width:16px; height:16px; flex:0 0 auto; border-radius:50%; background:var(--feed-category,#75823d); box-shadow:0 0 0 2px rgba(0,0,0,.4),0 0 8px color-mix(in srgb,var(--feed-category,#75823d),transparent 45%); }
.owner-category-item__swatch--new { display:grid; place-items:center; background:transparent; border:1px dashed rgba(199,165,103,.6); box-shadow:none; color:#c7a567; font-size:.85rem; font-weight:800; }

.owner-category-item__name { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.owner-category-item__tag { padding:2px 8px; border:1px solid rgba(199,165,103,.35); border-radius:999px; color:#af9665; font-size:.68rem; font-weight:700; letter-spacing:.05em; text-transform:uppercase; }
.owner-category-item__count { flex:0 0 auto; color:#af9665; font-size:.78rem; font-weight:500; white-space:nowrap; }

.owner-category-item__chevron { flex:0 0 auto; width:9px; height:9px; border-right:2px solid #af9665; border-bottom:2px solid #af9665; transform:rotate(-45deg); transition:transform .15s ease; }
.owner-category-item[open] > .owner-category-item__summary .owner-category-item__chevron { transform:rotate(45deg); }

.owner-category-item__body { padding:4px 15px 18px; border-top:1px solid rgba(172,136,72,.24); }

.owner-category-preview { margin-top:14px; }
.owner-category-preview__label { display:block; margin-bottom:8px; color:#af9665; font-size:.68rem; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.owner-category-preview__card { max-width:480px; height:auto; grid-template-columns:150px 1fr; pointer-events:none; }
/* This small live-preview widget stays content-sized, unlike the fixed-height cards in the
   real feed list above - it shows one card at a time, so nothing needs to line up with it. */
.owner-category-preview__card .feed-card__media { min-height:150px; }
.owner-category-preview__card h2 { font-size:1.15rem; }

.owner-category-form { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:14px; margin-top:14px; }
.owner-category-form__upload { position:relative; }
.owner-category-form__preview { width:32px; height:32px; margin-top:6px; object-fit:cover; border:1px solid rgba(172,136,72,.4); border-radius:6px; }
.owner-category-form__preview--icon { border-radius:50%; }
.owner-category-form__actions { grid-column:1/-1; display:flex; }

.owner-feed-divider { display:flex; align-items:center; gap:16px; margin:26px 0 18px; color:#d7bd82; font:600 1.35rem Georgia,serif; scroll-margin-top:90px; }
.owner-feed-divider::before,.owner-feed-divider::after { height:1px; flex:1; background:linear-gradient(90deg,transparent,rgba(199,165,103,.5)); content:""; }
.owner-feed-divider::after { transform:scaleX(-1); }
@media (max-width:800px) { .owner-category-form { grid-template-columns:1fr; } .owner-feed-sections a { flex:1; justify-content:center; } }
.feed-editor-toolbar { display:flex; flex-wrap:wrap; gap:6px; padding:8px; border:1px solid rgba(172,136,72,.5); border-bottom:0; border-radius:8px 8px 0 0; background:linear-gradient(180deg,#392515,#21150b); }
.feed-editor-toolbar button { min-width:38px; min-height:34px; padding:5px 9px; border:1px solid rgba(199,165,103,.4); border-radius:5px; background:#171109; color:#dec58d; font:700 .78rem/1 system-ui,sans-serif; cursor:pointer; }
.feed-editor-toolbar button:hover { border-color:#c7a567; background:#35401e; color:#fff0c4; }
.feed-editor-toolbar button:focus-visible { outline:3px solid #f0c66e; outline-offset:2px; }
@media (max-width:700px) { .feed-editor-toolbar button { min-width:44px; min-height:44px; } }
.feed-editor-textarea { border-radius:0 0 8px 8px!important; font-family:Georgia,"Times New Roman",serif; line-height:1.65; }
.feed-detail__body h2,.feed-detail__body h3 { margin:1.8em 0 .55em; color:#e2c98f; font-family:Georgia,"Times New Roman",serif; }
.feed-detail__body h2 { font-size:1.55rem; }.feed-detail__body h3 { font-size:1.2rem; }
.feed-detail__body ul { padding-left:1.35rem; color:#ead5a5; line-height:1.7; }.feed-detail__body li+li { margin-top:.35rem; }
.feed-detail__body blockquote { margin:1.4rem 0; padding:.8rem 1rem; border-left:4px solid #71813b; background:rgba(113,129,59,.1); color:#d7c59e; font-style:italic; }
.feed-detail__body pre { overflow:auto; margin:1.4rem 0; padding:1rem; border:1px solid rgba(199,165,103,.34); border-radius:7px; background:#090b07; color:#d9d4bc; }
.feed-detail__body code { font-family:Consolas,"Courier New",monospace; }.feed-detail__body a { color:#d5b569; overflow-wrap:anywhere; }

/* Woodland portal system: extends the Feedline material language across active pages. */
:root {
  --wood-ink: #f0dfb4;
  --wood-copy: #c9b991;
  --wood-muted: #aa976f;
  --wood-line: rgba(172, 136, 72, .46);
  --wood-line-strong: rgba(199, 165, 103, .72);
  --wood-focus: #f0c66e;
  --wood-surface: #11170d;
  --wood-surface-raised: #192012;
  --wood-control: #090e08;
  --portal-blue: #9cab4d;
  --portal-blue-dark: #c7a567;
}

/* TaskBoard (matches Feed): remap the shared task-board's --tf-* theme
   tokens to the woodland palette so the whole board (toolbar, columns,
   cards) inherits it automatically instead of the plain --bg/--accent
   tokens it falls back to by default. */
.dashboard-taskflow {
  --tf-bg: var(--wood-control);
  --tf-surface: var(--wood-surface);
  --tf-surface-2: var(--wood-surface-raised);
  --tf-surface-3: #1c2414;
  --tf-border: var(--wood-line);
  --tf-border-strong: var(--wood-line-strong);
  --tf-text: var(--wood-ink);
  --tf-text-muted: var(--wood-copy);
  --tf-text-faint: var(--wood-muted);
  --tf-accent: var(--portal-blue);
  --tf-accent-soft: rgba(83, 97, 42, .28);
}
.shared-task-board .dashboard-project-section,
.shared-task-board .project-task-board {
  border-width: 2px;
  border-style: ridge;
  border-color: var(--wood-line-strong);
  background-image: radial-gradient(circle at 80% 15%, rgba(82,101,42,.10), transparent 30%);
}
.shared-task-board .dashboard-project-section__name,
.shared-task-board .project-task-board__title {
  font-family: Georgia, "Times New Roman", serif;
}

::selection { color: #160f08; background: #d8b56c; }
main { color: var(--wood-ink); }
a { color: #d4b36f; }
a:hover { color: #f4d995; }

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--wood-focus);
  outline-offset: 3px;
}

.nav__inner { min-height: 68px; height: auto; }
.nav-brand { font-family: Georgia, "Times New Roman", serif; font-size: 1.08rem; }
.nav-brand__text span { color: #b9ad61 !important; }
.nav-link { border: 1px solid transparent; border-radius: 7px; font-family: Georgia, "Times New Roman", serif; }
.nav-link.active { border-color: rgba(117,130,61,.7); background: linear-gradient(180deg,#53612a,#263314 74%) !important; color: #fff1c5 !important; }
.nav-link--cta { border: 1px solid var(--wood-line-strong); background: linear-gradient(180deg,#53612a,#263314 74%) !important; box-shadow: inset 0 1px rgba(255,230,170,.08),0 3px 8px #000 !important; }
.nav__toggle span { background: #dfc892; }
.lang-switch { border: 1px solid var(--wood-line); background: rgba(9,14,8,.72); }
.lang-switch__btn { color: var(--wood-muted); }
.lang-switch__btn.is-active { color: #fff1c5; background: #3b4720; }
.user-menu__trigger { border-color: var(--wood-line) !important; background: rgba(9,14,8,.7) !important; }
.user-menu__avatar { border: 1px solid var(--wood-line-strong); background: radial-gradient(circle,#53612a,#202a12 72%) !important; color: #f0dfb4 !important; }
.user-menu__dropdown {
  border: 3px ridge rgba(103,76,35,.82) !important;
  background: repeating-linear-gradient(2deg,rgba(255,255,255,.012) 0 1px,transparent 2px 7px),linear-gradient(145deg,#21160c,#0f120b) !important;
  box-shadow: inset 0 0 18px rgba(0,0,0,.6),0 14px 32px rgba(0,0,0,.72) !important;
}
.user-menu__item { color: var(--wood-copy) !important; }
.user-menu__item:hover, .user-menu__item:focus-visible { color: #fff1c5 !important; background: rgba(83,97,42,.34) !important; }
.user-menu__divider { border-color: var(--wood-line) !important; }
.user-menu__summary-label, .user-menu__summary-pill { color: var(--wood-muted) !important; }

.page-container { width: min(var(--site-shell-width), calc(100% - 2rem)); padding: clamp(1.5rem,4vw,3rem) 0; }
.page-header { padding-bottom: 1.15rem; border-bottom: 3px double var(--wood-line); }
.page-header h1,
.dashboard-section-title,
.portal-project-dashboard__title,
.dashboard-taskflow__brand h1,
.auth-card h1,
.legal-page h1 {
  color: var(--wood-ink) !important;
  font-family: Georgia, "Times New Roman", serif !important;
  font-weight: 500 !important;
  text-shadow: 0 2px 2px rgba(0,0,0,.72);
}
.page-header p,
.portal-project-dashboard__intro,
.dashboard-taskflow__lede,
.auth-tagline { color: var(--wood-copy) !important; }

.btn-primary,
.btn-rust,
.owner-btn:not(.owner-btn--danger),
button[type="submit"]:not(.user-menu__item--danger) {
  border: 2px ridge var(--antique-gold-dim) !important;
  border-radius: 7px !important;
  background: linear-gradient(180deg,#53612a,#263314 74%) !important;
  color: #f0dfb4 !important;
  box-shadow: inset 0 1px rgba(255,230,170,.1),0 3px 8px rgba(0,0,0,.55) !important;
}
.btn-primary:hover,
.btn-rust:hover,
.owner-btn:not(.owner-btn--danger):hover,
button[type="submit"]:not(.user-menu__item--danger):hover { border-color: var(--antique-gold) !important; background: linear-gradient(180deg,#657334,#303d18 74%) !important; }
.btn-secondary {
  border: 1px solid var(--wood-line) !important;
  background: linear-gradient(180deg,#332414,#181109) !important;
  color: var(--wood-copy) !important;
}
.btn-secondary:hover { border-color: var(--wood-line-strong) !important; color: #fff1c5 !important; }

.form-group { color: var(--wood-copy); }
.form-label, label { color: #dcc89b; }
.form-control,
input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
textarea,
select {
  min-height: 44px;
  border: 1px solid var(--wood-line) !important;
  background: linear-gradient(180deg,rgba(12,18,10,.96),rgba(6,10,6,.96)) !important;
  color: #f3ead2 !important;
  box-shadow: inset 0 2px 7px rgba(0,0,0,.5) !important;
}
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; accent-color: #71803d; }
::placeholder { color: #806f52 !important; }

.portal-card,
.owner-card,
.page-card,
.auth-card,
.legal-card,
.dashboard-board-shell,
.dashboard-modal__panel,
.portal-project-card,
.portal-project-drawer__panel,
.dashboard-taskflow__workspace-stat {
  border: 3px ridge rgba(103,76,35,.82) !important;
  border-radius: 10px !important;
  background: radial-gradient(circle at 80% 20%,rgba(82,101,42,.10),transparent 30%),repeating-linear-gradient(0deg,rgba(255,255,255,.01) 0 1px,transparent 2px 6px),linear-gradient(110deg,#192012,#10150d 72%) !important;
  color: var(--wood-ink) !important;
  box-shadow: inset 0 0 0 1px rgba(195,155,80,.13),inset 0 0 24px rgba(0,0,0,.62),0 7px 16px rgba(0,0,0,.5) !important;
}

.portal-project-dashboard { --dashboard-accent:#9cab4d; --dashboard-accent-hover:#c7a567; --dashboard-accent-soft:rgba(83,97,42,.3); }
.portal-project-dashboard__header {
  padding: clamp(1.15rem,3vw,2rem);
  border: 4px ridge rgba(103,76,35,.82);
  border-radius: 11px;
  background: repeating-linear-gradient(3deg,rgba(255,255,255,.015) 0 1px,transparent 2px 8px),linear-gradient(180deg,#352313,#1c120a);
  box-shadow: inset 0 0 22px rgba(0,0,0,.54),0 8px 18px rgba(0,0,0,.5);
}
.portal-project-dashboard__header::before { background: linear-gradient(90deg,transparent,var(--antique-gold-dim),transparent) !important; }
.portal-project-dashboard__count,
.portal-project-collection__count { color: #b9ad61 !important; }
.portal-project-collection__heading { border-bottom-color: var(--wood-line) !important; }
.portal-project-collection__title,
.portal-project-card__title,
.portal-project-drawer__header h2,
.portal-project-drawer__section h3 { color: var(--wood-ink) !important; font-family: Georgia,"Times New Roman",serif; }
.portal-project-card__description,
.portal-project-card__meta,
.portal-project-card__fact,
.portal-project-drawer__member small,
.portal-project-assignment__empty { color: var(--wood-copy) !important; }
.portal-project-card:hover { border-color: var(--wood-line-strong) !important; transform: translateY(-2px); }
.portal-project-card__progress { background: #080d07 !important; border: 1px solid rgba(83,97,42,.5); }
.portal-project-card__progress > span { background: linear-gradient(90deg,#657334,#c7a567) !important; }
.portal-project-card__open,
.portal-project-card__menu-trigger,
.dashboard-icon-button { border-color: var(--wood-line) !important; background: #12170e !important; color: #d7bd82 !important; }
.portal-project-card__menu { border: 2px ridge rgba(103,76,35,.78) !important; background: #11170d !important; }
.portal-project-card__menu button { color: var(--wood-copy) !important; }
.portal-project-drawer__backdrop,
.dashboard-modal__backdrop { background: rgba(3,5,3,.76) !important; backdrop-filter: blur(3px); }
.portal-project-drawer__header,
.dashboard-modal__header { border-bottom-color: var(--wood-line) !important; background: linear-gradient(180deg,#2d1e11,#181109) !important; }
.portal-project-drawer__eyebrow { color: #b9ad61 !important; }
.portal-project-drawer__board,
.portal-project-assignment__board-item,
.portal-project-assignment__add-panel,
.portal-project-assignment__user { border-color: var(--wood-line) !important; background: rgba(8,13,8,.54) !important; }

.dashboard-board-shell { padding: clamp(1rem,2.5vw,1.6rem); }
.dashboard-taskflow__topbar { padding-bottom: 1rem; border-bottom: 3px double var(--wood-line); }
.dashboard-taskflow__mark { border: 2px ridge var(--antique-gold-dim) !important; background: radial-gradient(circle,#53612a,#202a12 72%) !important; color: #f0dfb4 !important; }
.dashboard-taskflow__workspace-summary { gap: .75rem; }
.dashboard-taskflow__workspace-stat strong { font-family: Georgia,"Times New Roman",serif; }
.dashboard-board-toolbar { border: 1px solid var(--wood-line) !important; background: rgba(8,13,8,.62) !important; }
.dashboard-task-detail__section { border-color: var(--wood-line) !important; background: rgba(8,13,8,.58) !important; }

.auth-shell { padding-block: clamp(2rem,6vw,5rem); }
.auth-card { max-width: 520px; }
.auth-card__header,
.auth-tagline { border-color: var(--wood-line) !important; }
.alert { border-radius: 7px; }
.alert-info { color:#d8c88f; border-color:#6f7f38; background:#18200f; }
.alert-success { color:#b8d58f; border-color:#526b31; background:#121d0f; }
.alert-error,.alert-danger { color:#f0aaa0; border-color:#7e3b31; background:#26110e; }

.owner-layout__sidebar,
.owner-sidebar,
.admin-bar { border-color: var(--wood-line) !important; background: linear-gradient(180deg,#25180d,#100d08) !important; }
.owner-nav a { color: var(--wood-copy) !important; }
.owner-nav a:hover,.owner-nav a.is-active { color:#fff1c5 !important; background:rgba(83,97,42,.34) !important; }
table { color: var(--wood-copy); border-color: var(--wood-line) !important; }
th { color: #d9c38f !important; background: #23180d !important; }
td { border-color: rgba(172,136,72,.24) !important; }
tbody tr:hover { background: rgba(83,97,42,.16) !important; }

.portal-hero {
  color: var(--wood-ink);
  background: radial-gradient(ellipse at 75% 18%,rgba(91,111,45,.22),transparent 34%),linear-gradient(160deg,#090c07,#15140b 52%,#080a06) !important;
}
.portal-hero__eyebrow,.portal-section__kicker,.portal-section__eyebrow { color:#b9ad61 !important; }
.portal-hero__title,
.portal-section__title { color:var(--wood-ink) !important; font-family:Georgia,"Times New Roman",serif !important; text-shadow:0 2px 2px #000; }
.portal-hero__subtitle,.portal-section__subtitle { color:var(--wood-copy) !important; }
.portal-hero__actions .btn--primary {
  border:2px ridge var(--antique-gold-dim) !important;
  background:linear-gradient(180deg,#53612a,#263314 74%) !important;
  color:#f0dfb4 !important;
  box-shadow:inset 0 1px rgba(255,230,170,.1),0 6px 16px rgba(0,0,0,.48) !important;
}
.portal-hero__actions .btn--ghost { border-color:var(--wood-line-strong) !important; color:#d7bd82 !important; background:rgba(9,14,8,.58) !important; }
.portal-preview,
.portal-hero__stats,
.portal-app-list { border-color:var(--wood-line) !important; background:rgba(9,14,8,.52) !important; }
.portal-preview__head,
.portal-preview__foot,
.portal-preview__rail { border-color:var(--wood-line) !important; background:linear-gradient(180deg,#352313,#1c120a) !important; }
.portal-preview__slide,
.portal-preview__app,
.portal-app,
.portal-feature { border-color:var(--wood-line) !important; color:var(--wood-ink) !important; }
.portal-preview__apps { background:radial-gradient(circle at 72% 18%,rgba(83,97,42,.18),transparent 32%),#0b1009 !important; }
.portal-preview__slide { background:linear-gradient(145deg,#1a2113,#0e140c) !important; box-shadow:inset 0 0 18px rgba(0,0,0,.48); }
.portal-preview__slide-icon,
.portal-preview__app-icon,
.portal-preview__rail-item.is-active { border-color:var(--wood-line-strong) !important; background:radial-gradient(circle,#53612a,#202a12 72%) !important; color:#f0dfb4 !important; }
.portal-preview__slide-tag,
.portal-preview__open { color:#b9ad61 !important; }
.portal-preview__slide p { color:var(--wood-copy) !important; }
.portal-hero__stat-icon { color:#b9ad61 !important; background:rgba(83,97,42,.24) !important; border:1px solid rgba(117,130,61,.38); }
.portal-hero__stats dt { color:#d4b36f !important; }
.portal-hero__stats dd { color:var(--wood-muted) !important; }
.portal-app__title,.portal-feature h3 { color:var(--wood-ink) !important; }
.portal-app__description,.portal-feature p { color:var(--wood-copy) !important; }
.portal-app__icon,.portal-feature__icon { color:#b9ad61 !important; border-color:var(--wood-line) !important; background:rgba(18,25,14,.72) !important; }
.portal-hero + .portal-section,
.portal-section--alt { color:var(--wood-ink); border-color:var(--wood-line) !important; background:linear-gradient(180deg,#11150d,#0b0f09) !important; }

.site-footer__title { color:var(--wood-ink) !important; font-family:Georgia,"Times New Roman",serif; }
.site-footer a { color:var(--wood-copy) !important; }

@media (max-width: 800px) {
  .nav__inner { min-height: 64px; }
  .nav__right { border: 3px ridge rgba(103,76,35,.82) !important; background:linear-gradient(180deg,#2b1c0f,#110e08) !important; }
  .nav-link { min-height:44px; display:flex; align-items:center; }
  .page-container { width:min(100% - 1.25rem,var(--site-shell-width)); }
  .portal-project-dashboard__header { align-items:stretch; }
  .dashboard-taskflow__workspace-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media (max-width: 520px) {
  .dashboard-taskflow__workspace-summary { grid-template-columns:1fr; }
  .portal-project-dashboard__title { font-size:clamp(1.9rem,10vw,2.5rem) !important; }
  .portal-project-card { padding:1rem !important; }
}

@media (prefers-reduced-motion: reduce) {
  .portal-project-card,
  .portal-app { transition:none !important; transform:none !important; }
}

/* ── Homepage advertisement banner (fixed side banner, dismissible with cooldown) ── */
.portal-ad-banner {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 850;
  width: min(300px, calc(100vw - 32px));
  background: var(--bg-elevated, #12140f);
  border: 1px solid var(--border, rgba(172,136,72,.4));
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0,0,0,.4);
  overflow: hidden;
  animation: portal-ad-banner-in .25s ease-out;
}
.portal-ad-banner[hidden] { display: none; }
.portal-ad-banner__close-countdown {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  padding: 4px 8px;
  border: 1px solid rgba(172,136,72,.35);
  border-radius: 999px;
  background: rgba(9,12,7,.82);
  color: #af9665;
  font-size: .68rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}
.portal-ad-banner__close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(10,10,10,.65);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.portal-ad-banner__close:hover,
.portal-ad-banner__close:focus-visible { background: rgba(10,10,10,.85); outline: 2px solid #f0c66e; outline-offset: 1px; }
.portal-ad-banner__link { display: block; text-decoration: none; color: inherit; }
.portal-ad-banner__media { display: block; aspect-ratio: 6/5; width: 100%; overflow: hidden; background: #0c0f08; }
.portal-ad-banner__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portal-ad-banner__label { display: block; padding: 8px 12px; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #af9665; border-top: 1px solid rgba(172,136,72,.24); }
@keyframes portal-ad-banner-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 600px) {
  .portal-ad-banner { right: 12px; bottom: 12px; left: 12px; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .portal-ad-banner { animation: none; }
}

/* ── Homepage advertisement side rail (second placement, fixed to the left edge outside the
   main content column) - independent from .portal-ad-banner above: separate dismiss state, own
   close-delay countdown, can show at the same time as the corner window. Hidden below
   the 1024px desktop breakpoint. ── */
.portal-ad-siderail {
  position: fixed;
  z-index: 840;
  top: 120px;
  left: max(16px, calc((100vw - var(--site-shell-width)) / 2 - 176px));
  width: 160px;
  background: var(--bg-elevated, #12140f);
  border: 1px solid var(--border, rgba(172,136,72,.4));
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0,0,0,.4);
  overflow: hidden;
  animation: portal-ad-banner-in .25s ease-out;
}
.portal-ad-siderail[hidden] { display: none; }
.portal-ad-siderail__close-countdown {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  padding: 4px 7px;
  border: 1px solid rgba(172,136,72,.35);
  border-radius: 999px;
  background: rgba(9,12,7,.82);
  color: #af9665;
  font-size: .62rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}
.portal-ad-siderail__close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(10,10,10,.65);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.portal-ad-siderail__close:hover,
.portal-ad-siderail__close:focus-visible { background: rgba(10,10,10,.85); outline: 2px solid #f0c66e; outline-offset: 1px; }
.portal-ad-siderail__link { display: block; text-decoration: none; color: inherit; }
.portal-ad-siderail__media { display: block; aspect-ratio: 4/9; width: 100%; overflow: hidden; background: #0c0f08; }
.portal-ad-siderail__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portal-ad-siderail__label { display: block; padding: 6px 10px; font-size: .64rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #af9665; border-top: 1px solid rgba(172,136,72,.24); }
/* Mirrors the base rail onto the right edge - a separate placement (SideRailRight), so it can
   show a different banner than the left rail and both can be visible at once. */
.portal-ad-siderail--right {
  left: auto;
  right: max(16px, calc((100vw - var(--site-shell-width)) / 2 - 176px));
}
/* Give the rail its own space on smaller desktops; dismissal gives that space back. */
@media (min-width: 1024px) and (max-width: 1580px) {
  .portal-home:has(.portal-ad-siderail:not(.portal-ad-siderail--right):not([hidden])) { margin-left: 192px; }
  .portal-home:has(.portal-ad-siderail--right:not([hidden])) { margin-right: 192px; }
  .portal-ad-siderail:not(.portal-ad-siderail--right) { left: 16px; }
  .portal-ad-siderail--right { right: 16px; }
  .portal-home:has(.portal-ad-siderail:not([hidden])) .portal-hero__inner {
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
    gap: 2rem;
  }
}
@media (min-width: 1024px) and (max-width: 1200px) {
  .portal-home:has(.portal-ad-siderail:not([hidden])) .portal-hero__inner { grid-template-columns: 1fr; }
}
@media (max-width: 1023.98px) {
  .portal-ad-siderail { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .portal-ad-siderail { animation: none; }
}
