/* ============================================================
   Csongi.hu — Design System
   Tokens → Base → Layout → Components → Utilities → Responsive
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@700;800&family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  /* Spacing (4pt base) */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  20px;
  --sp-6:  24px;
  --sp-8:  32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  /* Typography */
  --font:         "DM Sans", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-display: "Syne", "DM Sans", system-ui, sans-serif;
  --text-xs:   0.6875rem;
  --text-sm:   0.8125rem;
  --text-base: 0.9375rem;
  --text-lg:   1.0625rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.625rem;
  --text-3xl:  2.125rem;
  --text-4xl:  2.75rem;

  /* Radius */
  --r-sm:   6px;
  --r:      10px;
  --r-lg:   14px;
  --r-xl:   20px;
  --r-full: 9999px;

  /* Z-index scale */
  --z-sticky: 100;
  --z-overlay: 200;
  --z-menu: 300;
  --z-toast: 400;

  /* Brand: emerald */
  --brand:        oklch(0.72 0.18 155);
  --brand-hover:  oklch(0.64 0.18 155);
  --brand-soft:   oklch(0.72 0.18 155 / 0.13);
  --brand-softer: oklch(0.72 0.18 155 / 0.07);
  --brand-on:     oklch(0.97 0.01  155);   /* text on brand bg — white */

  /* Semantic */
  --danger:      oklch(0.60 0.22 25);
  --danger-soft: oklch(0.60 0.22 25 / 0.12);

  /* Dark theme (default) */
  --bg:             oklch(0.12 0.008 155);
  --surface:        oklch(0.17 0.010 155);
  --surface-raised: oklch(0.22 0.010 155);
  --text-1:         oklch(0.92 0.006 155);
  --text-2:         oklch(0.63 0.012 155);
  --text-3:         oklch(0.46 0.009 155);
  --border:         oklch(0.28 0.010 155);
  --border-subtle:  oklch(0.22 0.008 155);
  --input-bg:       oklch(0.14 0.008 155);
  --glass-bg:       oklch(0.13 0.008 155 / 0.88);
  --glass-border:   oklch(0.36 0.012 155 / 0.55);
  --shadow:         0 4px 20px oklch(0.05 0.01 155 / 0.32);
  --shadow-lg:      0 12px 48px oklch(0.05 0.01 155 / 0.38);
  --panel-bg:       oklch(0.17 0.010 155 / 0.90);
  --panel-border:   oklch(0.38 0.012 155 / 0.70);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  body {
    background:
      radial-gradient(ellipse 90% 55% at 50% -5%,  oklch(0.52 0.18 155 / 0.07), transparent 65%),
      radial-gradient(ellipse 55% 40% at 100% 80%,  oklch(0.52 0.18 155 / 0.04), transparent 55%),
      var(--bg);
  }

  :root {
    --bg:             oklch(0.96 0.004 155);
    --surface:        oklch(0.99 0.002 155);
    --surface-raised: oklch(0.94 0.006 155);
    --text-1:         oklch(0.17 0.012 155);
    --text-2:         oklch(0.44 0.014 155);
    --text-3:         oklch(0.60 0.010 155);
    --border:         oklch(0.84 0.008 155);
    --border-subtle:  oklch(0.90 0.005 155);
    --input-bg:       oklch(0.99 0.002 155);
    --glass-bg:       oklch(0.96 0.004 155 / 0.90);
    --glass-border:   oklch(0.78 0.010 155 / 0.70);
    --shadow:         0 4px 20px oklch(0.14 0.01 155 / 0.09);
    --shadow-lg:      0 12px 48px oklch(0.14 0.01 155 / 0.13);
    --brand:          oklch(0.52 0.18 155);
    --brand-hover:    oklch(0.44 0.18 155);
    --panel-bg:       oklch(0.99 0.002 155 / 0.96);
    --panel-border:   oklch(0.78 0.010 155 / 0.80);
    color-scheme: light;
  }
}

[data-theme="dark"] body {
  background:
    radial-gradient(ellipse 90% 55% at 50% -5%,  oklch(0.72 0.18 155 / 0.13), transparent 65%),
    radial-gradient(ellipse 55% 40% at 100% 80%,  oklch(0.72 0.18 155 / 0.07), transparent 55%),
    radial-gradient(ellipse 45% 35% at -5%  70%,  oklch(0.72 0.18 155 / 0.05), transparent 50%),
    oklch(0.12 0.008 155);
}
[data-theme="dark"] {
  --bg:             oklch(0.12 0.008 155);
  --surface:        oklch(0.17 0.010 155);
  --surface-raised: oklch(0.22 0.010 155);
  --text-1:         oklch(0.92 0.006 155);
  --text-2:         oklch(0.63 0.012 155);
  --text-3:         oklch(0.46 0.009 155);
  --border:         oklch(0.28 0.010 155);
  --border-subtle:  oklch(0.22 0.008 155);
  --input-bg:       oklch(0.14 0.008 155);
  --glass-bg:       oklch(0.13 0.008 155 / 0.88);
  --glass-border:   oklch(0.36 0.012 155 / 0.55);
  --shadow:         0 4px 20px oklch(0.05 0.01 155 / 0.32);
  --shadow-lg:      0 12px 48px oklch(0.05 0.01 155 / 0.38);
  --brand:          oklch(0.72 0.18 155);
  --brand-hover:    oklch(0.64 0.18 155);
  --panel-bg:       oklch(0.17 0.010 155 / 0.90);
  --panel-border:   oklch(0.38 0.012 155 / 0.70);
  color-scheme: dark;
}

[data-theme="light"] body {
  background:
    radial-gradient(ellipse 90% 55% at 50% -5%,  oklch(0.52 0.18 155 / 0.07), transparent 65%),
    radial-gradient(ellipse 55% 40% at 100% 80%,  oklch(0.52 0.18 155 / 0.04), transparent 55%),
    oklch(0.96 0.004 155);
}
[data-theme="light"] {
  --bg:             oklch(0.96 0.004 155);
  --surface:        oklch(0.99 0.002 155);
  --surface-raised: oklch(0.94 0.006 155);
  --text-1:         oklch(0.17 0.012 155);
  --text-2:         oklch(0.44 0.014 155);
  --text-3:         oklch(0.60 0.010 155);
  --border:         oklch(0.84 0.008 155);
  --border-subtle:  oklch(0.90 0.005 155);
  --input-bg:       oklch(0.99 0.002 155);
  --glass-bg:       oklch(0.96 0.004 155 / 0.90);
  --glass-border:   oklch(0.78 0.010 155 / 0.70);
  --shadow:         0 4px 20px oklch(0.14 0.01 155 / 0.09);
  --shadow-lg:      0 12px 48px oklch(0.14 0.01 155 / 0.13);
  --brand:          oklch(0.52 0.18 155);
  --brand-hover:    oklch(0.44 0.18 155);
  --panel-bg:       oklch(0.99 0.002 155 / 0.96);
  --panel-border:   oklch(0.78 0.010 155 / 0.80);
  color-scheme: light;
}

/* ============================================================
   BASE RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-1);
  background:
    radial-gradient(ellipse 90% 55% at 50% -5%,  oklch(0.72 0.18 155 / 0.13), transparent 65%),
    radial-gradient(ellipse 55% 40% at 100% 80%,  oklch(0.72 0.18 155 / 0.07), transparent 55%),
    radial-gradient(ellipse 45% 35% at -5%  70%,  oklch(0.72 0.18 155 / 0.05), transparent 50%),
    var(--bg);
  min-height: 100svh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; font-size: inherit; line-height: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  text-wrap: balance;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.12;
  color: var(--text-1);
}
p { max-width: 68ch; }
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* ============================================================
   LAYOUT
   ============================================================ */
.page {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}

.container {
  width: min(1360px, 100% - var(--sp-8));
  margin-inline: auto;
}

.container-md {
  width: min(900px, 100% - var(--sp-8));
  margin-inline: auto;
}

.container-page {
  width: min(960px, 100% - var(--sp-8));
  margin-inline: auto;
  padding-top: var(--sp-4);
  padding-bottom: var(--sp-12);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) 300px;
  gap: var(--sp-5);
  align-items: start;
}

.content-main { min-width: 0; }
.content-aside { min-width: 0; }

.stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.stack-sm { display: flex; flex-direction: column; gap: var(--sp-3); }
.stack-lg { display: flex; flex-direction: column; gap: var(--sp-6); }

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  height: 54px;
}

.topbar-start {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.topbar-end {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.brand-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  background: var(--brand);
  color: var(--brand-on);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.brand-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-1);
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: var(--r);
  color: var(--text-2);
  transition: background 0.15s ease-out, border-color 0.15s ease-out, color 0.15s ease-out;
}

.icon-btn:hover {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-1);
}

.icon-btn svg { width: 16px; height: 16px; }

.topbar-nav-link {
  display: inline-flex;
  align-items: center;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-2);
  transition: background 0.15s ease-out, color 0.15s ease-out;
  white-space: nowrap;
}

.topbar-nav-link:hover {
  background: var(--brand-softer);
  color: var(--text-1);
}

.topbar-nav-link.active {
  color: var(--brand);
}

/* Theme dropdown */
.theme-menu { position: relative; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-3);
  min-height: 28px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: var(--r);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.15s ease-out, color 0.15s ease-out, border-color 0.15s ease-out;
}

.theme-toggle:hover {
  background: var(--surface);
  color: var(--text-1);
}

.theme-toggle svg { flex-shrink: 0; }

.theme-toggle-chevron {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  transition: transform 0.15s ease-out;
  opacity: 0.5;
}

.theme-menu.open .theme-toggle-chevron { transform: rotate(180deg); }

.theme-dropdown {
  position: absolute;
  top: calc(100% + var(--sp-2));
  right: 0;
  min-width: 148px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-2);
  display: none;
  flex-direction: column;
  gap: 2px;
  box-shadow: var(--shadow-lg);
  z-index: 400;
}

.theme-menu.open .theme-dropdown { display: flex; }

.theme-option {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r);
  border: none;
  background: transparent;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  font-family: var(--font);
  width: 100%;
  text-align: left;
  transition: background 0.12s, color 0.12s;
}

.theme-option:hover { background: var(--brand-softer); color: var(--text-1); }
.theme-option.active { color: var(--brand); font-weight: 700; }

/* ============================================================
   SIDE MENU
   ============================================================ */
.side-overlay {
  position: fixed;
  inset: 0;
  background: oklch(0.06 0.01 155 / 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease-out, visibility 0.2s ease-out;
  z-index: var(--z-overlay);
}

.side-overlay.open {
  opacity: 1;
  visibility: visible;
}

.side-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 296px;
  height: 100%;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: var(--z-menu);
  display: flex;
  flex-direction: column;
  padding: var(--sp-6);
  gap: var(--sp-5);
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.26s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.side-menu.open {
  transform: translateX(0);
}

.side-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.side-menu-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.side-user {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--r-lg);
  background: var(--brand-softer);
  border: 1px solid var(--brand-soft);
}

.side-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--r);
  background: var(--brand);
  color: var(--brand-on);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 700;
  flex-shrink: 0;
}

.side-user-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-1);
}

.side-user-role {
  font-size: var(--text-xs);
  color: var(--text-3);
  margin-top: 1px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.side-nav-link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-2);
  transition: background 0.15s, color 0.15s;
}

.side-nav-link:hover {
  background: var(--brand-softer);
  color: var(--text-1);
}

.side-divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  min-height: 36px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease-out, opacity 0.15s ease-out, transform 0.1s ease-out, border-color 0.15s ease-out;
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--brand);
  color: var(--brand-on);
  border-color: transparent;
}
.btn-primary:hover { background: var(--brand-hover); }

.btn-secondary {
  background: var(--surface-raised);
  color: var(--text-1);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--border-subtle); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface); color: var(--text-1); }

.btn-danger {
  background: var(--danger);
  color: oklch(0.98 0.01 25);
  border-color: transparent;
}
.btn-danger:hover { opacity: 0.88; }

.btn-sm {
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--text-xs);
  min-height: 28px;
}

.btn-lg {
  padding: var(--sp-3) var(--sp-6);
  font-size: var(--text-base);
  min-height: 44px;
}

/* ============================================================
   FORMS
   ============================================================ */
input,
textarea,
select {
  display: block;
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text-1);
  font-family: var(--font);
  font-size: var(--text-sm);
  line-height: 1.5;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  min-height: 38px;
}

input::placeholder,
textarea::placeholder { color: var(--text-3); }

input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

textarea { resize: vertical; min-height: 80px; line-height: 1.55; }

.form-row {
  display: flex;
  gap: var(--sp-2);
  align-items: flex-end;
}

.form-row input,
.form-row textarea { margin: 0; }

.form-group { display: flex; flex-direction: column; gap: var(--sp-1); }
.form-label { font-size: var(--text-xs); font-weight: 600; color: var(--text-2); letter-spacing: 0.04em; text-transform: uppercase; }

/* ============================================================
   PANELS — frosted glass cards
   ============================================================ */
.panel {
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--r-xl);
  border: 1px solid var(--panel-border);
  padding: var(--sp-4);
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.panel-title {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.panel-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px var(--sp-2);
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--brand-soft);
  color: var(--brand);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding: var(--sp-10) 0 var(--sp-8);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: var(--sp-3);
}

.hero-eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
}

.hero-title {
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text-1);
  margin-bottom: var(--sp-3);
}

.hero-sub {
  font-size: var(--text-base);
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: var(--sp-6);
}

.hero-actions {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

/* ============================================================
   NOTICE (flash message)
   ============================================================ */
.notice {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-lg);
  border: 1px solid var(--brand-soft);
  background: var(--brand-softer);
  color: var(--brand);
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: var(--sp-5);
}

.notice-error {
  border-color: var(--danger-soft);
  background: var(--danger-soft);
  color: var(--danger);
}

/* ============================================================
   FEED (Posts)
   ============================================================ */
.feed { display: flex; flex-direction: column; }

.feed-item {
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.feed-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-3);
  margin-bottom: var(--sp-1);
}

.feed-item:first-child { padding-top: 0; }
.feed-item:last-child { border-bottom: none; padding-bottom: 0; }

.feed-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: var(--sp-1);
}

.feed-meta {
  font-size: var(--text-xs);
  color: var(--text-3);
  margin-bottom: var(--sp-2);
  font-variant-numeric: tabular-nums;
}

.feed-body {
  font-size: var(--text-sm);
  color: var(--text-2);
  line-height: 1.65;
}

.feed-delete {
  position: absolute;
  top: var(--sp-4);
  right: 0;
  background: transparent;
  border: none;
  color: var(--text-3);
  font-size: var(--text-sm);
  padding: 2px var(--sp-2);
  border-radius: var(--r-sm);
  transition: color 0.15s, background 0.15s;
}

.feed-delete:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

/* ============================================================
   APP GRID
   ============================================================ */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: var(--sp-3);
}

.app-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-2);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-subtle);
  background: var(--surface-raised);
  transition: border-color 0.15s, background 0.15s, transform 0.1s ease-out;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  position: relative;
}

.app-tile:hover {
  border-color: var(--brand-soft);
  background: var(--brand-softer);
  transform: translateY(-2px);
}


.app-tile-name {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-2);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.app-tile-del {
  position: absolute;
  top: var(--sp-1);
  right: var(--sp-1);
  width: 20px;
  height: 20px;
  border-radius: var(--r-full);
  background: var(--danger);
  color: oklch(0.98 0.01 25);
  border: none;
  font-size: 11px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
  cursor: pointer;
}

.app-tile:hover .app-tile-del { display: flex; }

/* Admin inline app form */
.app-add-form {
  display: grid;
  grid-template-columns: 1fr 1fr 80px auto;
  gap: var(--sp-2);
  align-items: end;
  margin-bottom: var(--sp-4);
}

/* ============================================================
   BOOKMARKS
   ============================================================ */
.bookmark-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.bookmark-link {
  display: inline-flex;
  align-items: center;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--surface-raised);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-2);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.bookmark-link:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-softer);
}

.bookmark-item {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.bookmark-item { cursor: context-menu; }

.bookmark-del {
  position: absolute;
  right: var(--sp-2);
  background: none;
  border: none;
  color: var(--text-3);
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 0 2px;
  line-height: 1;
  transition: color 0.15s;
  cursor: pointer;
}

.bookmark-del:hover { color: var(--danger); }

/* My bookmarks add form */
.bookmark-add-form {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

/* Protocol + URL joined input group */
.proto-url-wrap {
  display: flex;
  flex: 1;
  min-width: 0;
}

.proto-select {
  width: auto;
  min-width: 96px;
  flex-shrink: 0;
  border-radius: var(--r) 0 0 var(--r);
  border-right: none;
  background: var(--surface-raised);
  color: var(--text-2);
  font-size: var(--text-xs);
  font-weight: 600;
  padding-left: var(--sp-2);
  padding-right: var(--sp-2);
  cursor: pointer;
}

.proto-select:focus { z-index: 1; border-right: none; box-shadow: none; }

.proto-url-wrap input {
  border-radius: 0 var(--r) var(--r) 0;
  flex: 1;
  min-width: 0;
}

/* Jobb klikk kontextus menü könyvjelzőkhöz */
.bm-context-menu {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-1);
  display: none;
  flex-direction: column;
  min-width: 140px;
  box-shadow: var(--shadow-lg);
  z-index: var(--z-menu);
}

.bm-context-menu.open { display: flex; }

.bm-context-item {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r);
  border: none;
  background: transparent;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  font-family: var(--font);
  text-align: left;
  width: 100%;
  transition: background 0.12s, color 0.12s;
}

.bm-context-item.danger { color: var(--danger); }
.bm-context-item.danger:hover { background: var(--danger-soft); }

/* ============================================================
   HOME CHAT
   ============================================================ */
.chat-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--sp-4);
  min-height: 400px;
}

.chat-user-list {
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface);
}

.chat-user-item {
  display: block;
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-2);
  border-bottom: 1px solid var(--border-subtle);
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}

.chat-user-item:last-child { border-bottom: none; }

.chat-user-item:hover,
.chat-user-item.active {
  background: var(--brand-softer);
  color: var(--brand);
}

.chat-main { display: flex; flex-direction: column; gap: var(--sp-3); }

.chat-messages {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-height: 280px;
  max-height: 320px;
}

.chat-bubble {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-lg);
  font-size: var(--text-sm);
  max-width: 78%;
  word-wrap: break-word;
  line-height: 1.5;
}

.chat-bubble-sent {
  align-self: flex-end;
  background: var(--brand);
  color: var(--brand-on);
  border-radius: var(--r-lg) var(--r-lg) var(--r-sm) var(--r-lg);
}

.chat-bubble-recv {
  align-self: flex-start;
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg) var(--r-lg) var(--r-lg) var(--r-sm);
}

.chat-empty {
  text-align: center;
  color: var(--text-3);
  font-size: var(--text-sm);
  margin: auto;
  padding: var(--sp-8) 0;
}

.chat-send-form {
  display: flex;
  gap: var(--sp-2);
}

/* ============================================================
   AI PAGE: MESSAGES
   ============================================================ */
.ai-messages {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-2) 0 var(--sp-4);
  min-height: 320px;
}

.ai-message {
  max-width: 86%;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-xl);
  font-size: var(--text-base);
  line-height: 1.6;
  word-break: break-word;
}

.ai-message-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: var(--sp-2);
}

.ai-message.user {
  align-self: flex-end;
  background: var(--brand);
  color: var(--brand-on);
  border-radius: var(--r-xl) var(--r-xl) var(--r-sm) var(--r-xl);
}
.ai-message.user .ai-message-label { color: oklch(0.97 0.01 155 / 0.72); }

.ai-message.assistant {
  align-self: flex-start;
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl) var(--r-xl) var(--r-xl) var(--r-sm);
}
.ai-message.assistant .ai-message-label { color: var(--brand); }

.ai-message-img {
  display: block;
  width: min(100%, 420px);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-subtle);
  margin-top: var(--sp-3);
}

.ai-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--sp-2);
  padding: var(--sp-12) var(--sp-6);
  border: 1px dashed var(--border);
  border-radius: var(--r-xl);
  color: var(--text-3);
  font-size: var(--text-sm);
}

.ai-empty-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: -0.02em;
}

/* ============================================================
   AI COMPOSER (fixed bottom)
   ============================================================ */
.ai-composer {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: var(--z-sticky);
  width: min(900px, calc(100% - var(--sp-8)));
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-bottom: none;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: var(--sp-4) var(--sp-5) calc(var(--sp-4) + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.composer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

.mode-switcher {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 3px;
  gap: 3px;
}

.mode-btn {
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-sm);
  border: none;
  background: transparent;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.mode-btn.active {
  background: var(--brand);
  color: var(--brand-on);
}

.composer-hint {
  font-size: var(--text-xs);
  color: var(--text-3);
}

.composer-textarea {
  width: 100%;
  min-height: 52px;
  max-height: 140px;
  resize: none;
  overflow-y: auto;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text-1);
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.5;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.composer-textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

/* ============================================================
   ADMIN: TABLES
   ============================================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.data-table th {
  text-align: left;
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: var(--sp-3);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-2);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr:hover td { background: var(--surface-raised); }

/* ============================================================
   ADMIN: TABBED LAYOUT
   ============================================================ */
.admin-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
  padding: var(--sp-8) 0 var(--sp-16);
}

.admin-section-title {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: var(--sp-3);
}

/* ============================================================
   WIDGET CARDS
   ============================================================ */
.widget-img {
  width: 100%;
  border-radius: var(--r-lg);
  border: 1px solid var(--border-subtle);
  margin: var(--sp-3) 0;
}

/* ============================================================
   AUTH PANEL
   ============================================================ */
.auth-panel {
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
}

/* ============================================================
   COOKIE BAR
   ============================================================ */
.cookie-bar {
  position: fixed;
  bottom: var(--sp-5);
  left: 50%;
  transform: translateX(-50%);
  width: min(400px, calc(100% - var(--sp-6)));
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: var(--sp-4) var(--sp-5);
  display: none;
  align-items: center;
  gap: var(--sp-3);
  z-index: var(--z-toast);
  box-shadow: var(--shadow-lg);
}

.cookie-bar.visible { display: flex; }

.cookie-text {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--text-2);
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-muted { color: var(--text-2); }
.text-dim   { color: var(--text-3); }
.text-sm    { font-size: var(--text-sm); }
.text-xs    { font-size: var(--text-xs); }
.text-brand { color: var(--brand); }
.fw-600     { font-weight: 600; }
.fw-700     { font-weight: 700; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.msg-log {
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.msg-log-item {
  padding: var(--sp-3);
  border-radius: var(--r);
  background: var(--surface-raised);
  border-left: 2px solid var(--brand);
  font-size: var(--text-sm);
  color: var(--text-2);
}

.msg-log-meta {
  font-size: var(--text-xs);
  color: var(--brand);
  font-weight: 600;
  margin-bottom: var(--sp-1);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .topbar-inner { height: 48px; }
  .hero { padding: var(--sp-8) 0 var(--sp-6); }
  .hero-title { font-size: var(--text-2xl); }
  .chat-layout { grid-template-columns: 1fr; }
  .app-add-form { grid-template-columns: 1fr 1fr; }
  .ai-message { max-width: 100%; }
  .ai-composer { width: calc(100% - var(--sp-4)); padding: var(--sp-3); }
  .composer-actions { flex-direction: column; }
  .composer-actions .btn { width: 100%; }
  .topbar-nav-link.hide-mobile { display: none; }
  .bookmark-add-form { flex-direction: column; }
  /* Public homepage responsive */
  .public-hero-actions { flex-direction: column; }
  .public-hero-actions .btn { width: 100%; justify-content: center; }
  [style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
}

@media (max-width: 460px) {
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .app-add-form { grid-template-columns: 1fr; }
  .side-menu { width: 100%; }
}

/* ============================================================
   SPACE CANVAS BACKGROUND
   ============================================================ */
#spaceCanvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* ============================================================
   SITE HEADER
   ============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.site-header-inner {
    display: flex;
    align-items: center;
    height: 58px;
    gap: var(--sp-4);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: var(--sp-1);
    flex: 1;
}

.header-nav-link {
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--r);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-2);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.header-nav-link:hover { background: var(--brand-softer); color: var(--text-1); }

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    margin-left: auto;
}

/* Header profilkép */
.header-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

/* Hero profilkép (dashboard) */
.hero-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--brand-soft);
  margin-bottom: var(--sp-2);
}

.hero-avatar-initial {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--brand-soft);
  border: 2px solid var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
  font-weight: 800;
  margin-bottom: var(--sp-2);
}

/* User menu dropdown */
.user-menu { position: relative; }

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--r);
    border: 1px solid var(--border);
    background: transparent;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-1);
    cursor: pointer;
    font-family: var(--font);
    transition: background 0.15s, border-color 0.15s;
}

.user-menu-btn:hover { background: var(--surface); }

.user-dropdown {
    position: absolute;
    top: calc(100% + var(--sp-2));
    right: 0;
    min-width: 220px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--sp-3);
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 200;
}

.user-dropdown.open { display: flex; }

.user-dropdown-sep {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: var(--sp-1) 0;
}

.user-dropdown-link {
    display: block;
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--r);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-2);
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
}

.user-dropdown-link:hover { background: var(--brand-softer); color: var(--text-1); }
.user-dropdown-link.danger { color: var(--danger); }
.user-dropdown-link.danger:hover { background: var(--danger-soft); color: var(--danger); }

/* ============================================================
   AUTH MODAL
   ============================================================ */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: oklch(0.06 0.01 155 / 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 800;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-out, visibility 0.2s ease-out;
    padding: var(--sp-4);
}

.auth-overlay.open {
    opacity: 1;
    visibility: visible;
}

.auth-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: min(780px, 100%);
    min-height: 460px;
    border-radius: var(--r-xl);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    position: relative;
    transform: translateY(16px) scale(0.97);
    transition: transform 0.24s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.auth-overlay.open .auth-card {
    transform: translateY(0) scale(1);
}

/* Centered toggle — maximum contrast, unmistakable selection */
.auth-toggle {
    position: absolute;
    top: var(--sp-5);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    background: oklch(0.08 0.016 155);
    border: 1px solid oklch(0.22 0.018 155);
    border-radius: var(--r-full);
    padding: 4px;
    gap: 2px;
    z-index: 10;
    box-shadow:
        0 8px 28px oklch(0.04 0.01 155 / 0.70),
        0 2px 8px  oklch(0.04 0.01 155 / 0.50),
        inset 0 1px 0 oklch(0.28 0.018 155 / 0.4);
}

.auth-tab {
    padding: 9px var(--sp-5);
    border-radius: var(--r-full);
    border: none;
    background: transparent;
    font-size: var(--text-sm);
    font-weight: 600;
    color: oklch(0.40 0.012 155);    /* inactive: very muted */
    cursor: pointer;
    font-family: var(--font);
    transition: color 0.18s;
    white-space: nowrap;
    letter-spacing: 0.01em;
    position: relative;
    z-index: 1;
    min-width: 96px;
    text-align: center;
}

.auth-tab.active {
    color: oklch(0.97 0.005 155);    /* active: near-white */
    font-weight: 700;
    background: transparent;         /* slider handles bg */
}

/* Csúszó indicator — vivid emerald against near-black bg */
.auth-toggle-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    height: calc(100% - 8px);
    background: var(--brand);
    border-radius: var(--r-full);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                width    0.3s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 0;
    pointer-events: none;
    box-shadow: 0 2px 12px oklch(0.72 0.18 155 / 0.45);
}

/* Info side (right — emerald) */
.auth-info {
    background: var(--brand);
    padding: calc(var(--sp-12) + var(--sp-2)) var(--sp-8) var(--sp-8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--sp-5);
}

.auth-info-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--r);
    background: oklch(0.58 0.16 155);
    color: oklch(0.96 0.02 155);
    font-size: var(--text-base);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.auth-info-title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.1;
    color: oklch(0.97 0.01 155);
}

.auth-info-sub {
    font-size: var(--text-sm);
    color: oklch(0.88 0.06 155);
    line-height: 1.65;
    max-width: 28ch;
}

.auth-info-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.auth-info-list li {
    font-size: var(--text-sm);
    font-weight: 500;
    color: oklch(0.92 0.05 155);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.auth-info-list li::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: oklch(0.92 0.05 155);
    flex-shrink: 0;
}

/* ── Animációk ─────────────────────────── */
@keyframes auth-fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes auth-slide-in-right {
    from { opacity: 0; transform: translateX(14px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes auth-slide-in-left {
    from { opacity: 0; transform: translateX(-14px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Modal nyitáskor: form panel felcsúszik */
.auth-overlay.open .auth-form-panel {
    animation: auth-fade-up 0.32s 0.06s ease-out both;
}

/* Info oldal elemeinek egymás utáni belépése */
.auth-overlay:not(.open) .auth-info > * { opacity: 0; }

.auth-overlay.open .auth-info > * {
    animation: auth-fade-up 0.36s ease-out both;
}
.auth-overlay.open .auth-info > *:nth-child(1) { animation-delay: 0.10s; }
.auth-overlay.open .auth-info > *:nth-child(2) { animation-delay: 0.16s; }
.auth-overlay.open .auth-info > *:nth-child(3) { animation-delay: 0.22s; }
.auth-overlay.open .auth-info > *:nth-child(4) { animation-delay: 0.28s; }

/* Tab váltás — kilépés */
@keyframes auth-exit-left {
    to { opacity: 0; transform: translateX(-14px); }
}
@keyframes auth-exit-right {
    to { opacity: 0; transform: translateX(14px); }
}

/* Tab váltás — belépés (osztályok JS-ből) */
.auth-panel-enter-right { animation: auth-slide-in-right 0.22s ease-out both; }
.auth-panel-enter-left  { animation: auth-slide-in-left  0.22s ease-out both; }

/* Form side (left) */
.auth-form-panel {
    background: var(--surface);
    padding: calc(var(--sp-12) + var(--sp-2)) var(--sp-8) var(--sp-8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--sp-4);
}

.auth-form-heading {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 800;
    letter-spacing: -0.030em;
    color: var(--text-1);
}

.auth-form-hint {
    font-size: var(--text-sm);
    color: var(--text-2);
    margin-top: calc(-1 * var(--sp-2));
}

/* Close */
.auth-close {
    position: absolute;
    top: var(--sp-3);
    right: var(--sp-3);
    width: 32px;
    height: 32px;
    border-radius: var(--r);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    line-height: 1;
    cursor: pointer;
    z-index: 20;
    transition: background 0.15s, color 0.15s;
    font-family: var(--font);
}

.auth-close:hover { background: var(--surface-raised); color: var(--text-1); }

@media (max-width: 580px) {
    .auth-card {
        grid-template-columns: 1fr;
        min-height: auto;
        max-height: 92svh;
        overflow-y: auto;
    }
    .auth-info {
        padding: var(--sp-6) var(--sp-5) var(--sp-5);
        min-height: 160px;
    }
    .auth-form-panel {
        padding: var(--sp-5);
    }
    .auth-toggle { top: var(--sp-3); }
}

/* ============================================================
   PUBLIC HOMEPAGE
   ============================================================ */
.public-hero {
    text-align: center;
    padding: var(--sp-16) var(--sp-4) var(--sp-10);
    max-width: 560px;
    margin: 0 auto;
}

.public-hero-title {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 1.06;
    color: var(--text-1);
    margin-bottom: var(--sp-3);
}

.public-hero-sub {
    font-size: var(--text-base);
    color: var(--text-2);
    line-height: 1.65;
    margin-bottom: var(--sp-6);
    max-width: 42ch;
    margin-left: auto;
    margin-right: auto;
}

.public-hero-actions {
    display: flex;
    gap: var(--sp-3);
    justify-content: center;
    flex-wrap: wrap;
}

.public-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--sp-4) var(--sp-16);
}

.public-divider {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: 0 auto var(--sp-8);
    max-width: 800px;
}

/* ============================================================
   APP SHELL — Left sidebar layout
   ============================================================ */
.app-shell {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: 100svh;
}

.app-sidebar {
    position: sticky;
    top: 0;
    height: 100svh;
    overflow-y: auto;
    background: var(--surface);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    padding: var(--sp-5) var(--sp-4);
    gap: var(--sp-4);
}

.app-main {
    min-width: 0;
    padding: var(--sp-10) var(--sp-10) var(--sp-16);
    background:
        radial-gradient(ellipse 70% 35% at 70% 0%, var(--brand-softer), transparent),
        var(--bg);
}

/* Sidebar brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding-bottom: var(--sp-4);
    border-bottom: 1px solid var(--border-subtle);
}

/* Sidebar nav */
.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--r);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-2);
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
    cursor: pointer;
    border: none;
    background: transparent;
    text-align: left;
    width: 100%;
    line-height: inherit;
    font-family: var(--font);
}

.sidebar-item:hover {
    background: var(--brand-softer);
    color: var(--text-1);
}

.sidebar-item.active {
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 600;
}

.sidebar-divider {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: var(--sp-2) 0;
}

/* Sidebar footer */
.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    padding-top: var(--sp-4);
    border-top: 1px solid var(--border-subtle);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.sidebar-avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--r-sm);
    background: var(--brand);
    color: var(--brand-on);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: 0;
}

.sidebar-username {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-1);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Mobile header (hidden on desktop) */
.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-3) var(--sp-4);
    background: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
}

/* ============================================================
   BENTO GRID
   ============================================================ */
.bento {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: auto;
    gap: var(--sp-2);
}

.b-2 { grid-column: span 2; }
.b-3 { grid-column: span 3; }
.b-4 { grid-column: span 4; }
.b-6 { grid-column: span 6; }

/* Bento hero — centered */
.bento-hero {
    grid-column: span 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--sp-8) var(--sp-6) var(--sp-6);
    gap: var(--sp-3);
}

.bento-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--brand);
}

.bento-hero-eyebrow::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand);
}

.bento-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4.5vw, 3.25rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.06;
    color: var(--text-1);
}

.bento-hero p {
    font-size: var(--text-base);
    color: var(--text-2);
    max-width: 46ch;
    line-height: 1.65;
}

.bento-hero .hero-actions {
    justify-content: center;
    margin-top: var(--sp-2);
}

.bento-hero-guest {
    padding: var(--sp-10) var(--sp-6) var(--sp-8);
}

.bento-hero-guest h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    letter-spacing: -0.05em;
}

/* Bento section label */
.bento-label {
    font-family: var(--font);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: var(--sp-3);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Featured post inside bento cell */
.featured-post-date {
    font-size: var(--text-xs);
    color: var(--brand);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: var(--sp-2);
}

.featured-post-title {
    font-size: var(--text-xl);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
    color: var(--text-1);
    margin-bottom: var(--sp-3);
}

.featured-post-body {
    font-size: var(--text-sm);
    color: var(--text-2);
    line-height: 1.65;
}

/* Mini post list */
.post-mini {
    padding: var(--sp-3) 0;
    border-top: 1px solid var(--border-subtle);
}

.post-mini-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-1);
    margin-bottom: 3px;
}

.post-mini-meta {
    font-size: var(--text-xs);
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
}

/* Bento responsive */
@media (max-width: 900px) {
    .bento              { grid-template-columns: repeat(4, 1fr); }
    .b-4, .b-6          { grid-column: span 4; }
    .b-2, .b-3          { grid-column: span 2; }
    .bento-hero         { grid-column: span 4; }
}

@media (max-width: 580px) {
    .bento              { grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
    .b-2, .b-3, .b-4, .b-6 { grid-column: span 2; }
    .bento-hero         { grid-column: span 2; }
    .bento-hero-guest h1 { font-size: 2rem; }
}

/* ============================================================
   PAGE HERO — Big type, no card
   ============================================================ */
.page-hero {
    padding-bottom: var(--sp-10);
    margin-bottom: var(--sp-8);
    border-bottom: 1px solid var(--border-subtle);
}

.page-hero-eyebrow {
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--brand);
    margin-bottom: var(--sp-3);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.page-hero-eyebrow::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.page-hero-title {
    font-size: clamp(1.875rem, 4vw, 3.125rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.06;
    color: var(--text-1);
    margin-bottom: var(--sp-3);
    text-wrap: balance;
}

.page-hero-sub {
    font-size: var(--text-base);
    color: var(--text-2);
    margin-bottom: var(--sp-6);
    max-width: 52ch;
}

/* ============================================================
   CONTENT SECTIONS — No card wrapper, visual rhythm
   ============================================================ */
.content-section {
    margin-bottom: var(--sp-5);
}

.content-section.panel {
    margin-bottom: var(--sp-4);
}

/* Bento-ban lévő panelek ne adjanak extra margint */
.bento > .panel.content-section {
    margin-bottom: 0;
}

.content-section-label {
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: var(--sp-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Bigger app tiles for the launchpad feel */
.app-tile-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--r-lg);
    margin: 0 auto var(--sp-2);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-soft);
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--brand);
    flex-shrink: 0;
}

.hidden { display: none !important; }

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
