/* ── FreeSurf Post — Light theme with grid pattern background ── */

:root {
  --bg: #ffffff;
  --bg-alt: #f8f8f6;
  --surface: #ffffff;
  --panel: rgba(255, 255, 255, 0.82);
  --border: rgba(29, 27, 24, 0.09);
  --border-light: rgba(29, 27, 24, 0.06);
  --text: #1d1b18;
  --text-secondary: #5f5647;
  --text-muted: #8a8178;

  --brand: #1d1b18;
  --brand-dark: #000;
  --brand-light: #3d3a35;
  --brand-soft: rgba(29, 27, 24, 0.06);
  --brand-ring: rgba(29, 27, 24, 0.1);

  --success: #059669;
  --success-soft: rgba(5, 150, 105, 0.08);
  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, 0.08);
  --error: #dc2626;
  --error-soft: rgba(220, 38, 38, 0.08);

  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-sm: 8px;
  --transition: 150ms ease;
  --shadow: 0 20px 60px rgba(55, 34, 17, 0.12);
  --shadow-lg: 0 24px 80px rgba(55, 34, 17, 0.16);
  --sidebar-width: 260px;
}

/* Dark mode */
[data-theme="dark"] {
  --bg: #0a0a0c;
  --bg-alt: #111115;
  --surface: #17171d;
  --panel: rgba(23, 23, 29, 0.88);
  --border: #2c2c3a;
  --border-light: #23232e;
  --text: #ffffff;
  --text-secondary: #b9b9c6;
  --text-muted: #8b8b9a;

  --brand: #6b8cff;
  --brand-dark: #5a78e8;
  --brand-light: #8aa4ff;
  --brand-soft: rgba(107, 140, 255, 0.12);
  --brand-ring: rgba(107, 140, 255, 0.15);

  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.12);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.12);
  --error: #f87171;
  --error-soft: rgba(248, 113, 113, 0.12);

  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.5);
}

/* Dark mode grid (clouds live on body::after) */
[data-theme="dark"] body::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 1) 1px, transparent 1px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-size: 2rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }

.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

html, body { height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 0, 0, 1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 1) 1px, transparent 1px);
  background-size: 22px 22px, 22px 22px;
  background-repeat: repeat, repeat;
  z-index: 0;
}

/* Cloud layer — pulses larger then shrinks away, leaving only the grid */
body::after {
  content: "";
  position: fixed;
  inset: -10%;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse 340px 240px at 12% 8%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 300px 210px at 45% 4%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 360px 250px at 78% 10%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 310px 220px at 95% 6%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 320px 230px at 6% 30%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 350px 240px at 30% 24%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 380px 260px at 52% 28%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 330px 230px at 76% 22%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 300px 210px at 90% 32%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 360px 250px at 18% 48%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 320px 230px at 42% 52%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 380px 260px at 58% 46%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 340px 240px at 82% 50%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 310px 220px at 8% 68%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 350px 240px at 34% 72%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 320px 230px at 60% 66%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 360px 250px at 86% 70%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 330px 230px at 22% 88%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 300px 210px at 52% 90%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 350px 240px at 80% 88%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 320px 230px at 24% 14%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 340px 240px at 68% 18%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 300px 210px at 88% 42%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 330px 230px at 14% 58%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 350px 250px at 48% 60%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 320px 220px at 72% 78%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 280px 200px at 18% 20%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 300px 210px at 72% 12%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 260px 190px at 40% 36%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 290px 200px at 92% 58%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 280px 200px at 26% 76%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 310px 220px at 58% 92%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 260px 190px at 8% 40%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 300px 210px at 76% 34%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 300px 210px at 5% 18%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 270px 190px at 25% 8%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 320px 220px at 62% 5%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 290px 200px at 88% 16%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 340px 230px at 12% 42%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 280px 200px at 36% 34%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 350px 240px at 66% 26%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 300px 210px at 94% 38%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 310px 220px at 4% 58%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 260px 190px at 28% 50%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 330px 230px at 48% 66%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 300px 210px at 74% 44%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 350px 240px at 16% 76%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 280px 200px at 42% 86%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 320px 220px at 64% 84%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 310px 220px at 90% 72%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 290px 200px at 8% 90%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 260px 190px at 56% 14%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 340px 230px at 80% 62%, rgba(255, 255, 255, 1) 45%, transparent 100%),
    radial-gradient(ellipse 350px 240px at 33% 62%, rgba(255, 255, 255, 1) 45%, transparent 100%);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  z-index: 0;
}

/* Dark mode clouds */
[data-theme="dark"] body::after {
  background-image:
    radial-gradient(ellipse 340px 240px at 12% 8%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 300px 210px at 45% 4%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 360px 250px at 78% 10%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 310px 220px at 95% 6%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 320px 230px at 6% 30%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 350px 240px at 30% 24%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 380px 260px at 52% 28%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 330px 230px at 76% 22%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 300px 210px at 90% 32%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 360px 250px at 18% 48%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 320px 230px at 42% 52%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 380px 260px at 58% 46%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 340px 240px at 82% 50%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 310px 220px at 8% 68%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 350px 240px at 34% 72%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 320px 230px at 60% 66%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 360px 250px at 86% 70%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 330px 230px at 22% 88%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 300px 210px at 52% 90%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 350px 240px at 80% 88%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 320px 230px at 24% 14%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 340px 240px at 68% 18%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 300px 210px at 88% 42%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 330px 230px at 14% 58%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 350px 250px at 48% 60%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 320px 220px at 72% 78%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 280px 200px at 18% 20%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 300px 210px at 72% 12%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 260px 190px at 40% 36%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 290px 200px at 92% 58%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 280px 200px at 26% 76%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 310px 220px at 58% 92%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 260px 190px at 8% 40%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 300px 210px at 76% 34%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 300px 210px at 5% 18%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 270px 190px at 25% 8%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 320px 220px at 62% 5%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 290px 200px at 88% 16%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 340px 230px at 12% 42%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 280px 200px at 36% 34%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 350px 240px at 66% 26%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 300px 210px at 94% 38%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 310px 220px at 4% 58%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 260px 190px at 28% 50%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 330px 230px at 48% 66%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 300px 210px at 74% 44%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 350px 240px at 16% 76%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 280px 200px at 42% 86%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 320px 220px at 64% 84%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 310px 220px at 90% 72%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 290px 200px at 8% 90%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 260px 190px at 56% 14%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 340px 230px at 80% 62%, rgba(0, 0, 0, 1) 45%, transparent 100%),
    radial-gradient(ellipse 350px 240px at 33% 62%, rgba(0, 0, 0, 1) 45%, transparent 100%);
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.hidden { display: none !important; }

/* App Shell */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Mobile Header */
.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.mobile-logo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 8px;
}

.logo-mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  color: var(--text);
}

.freesurf-footer-logo .logo-mark {
  width: 24px;
  height: 24px;
}

.mobile-logo:hover { text-decoration: none; }

.mobile-logo-dot {
  width: 8px;
  height: 8px;
  background: var(--brand);
  border-radius: 50%;
  flex-shrink: 0;
  margin-left: 6px;
  animation: blink 2.4s ease-in-out infinite;
}

.mobile-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.mobile-menu-btn:hover {
  background: var(--bg-alt);
  color: var(--text);
}

/* Sidebar */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 50;
  transition: transform var(--transition);
}
.sidebar.hidden { display: none; }
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px;
  height: 60px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  padding-left: 10px;
}

.sidebar-logo:hover { text-decoration: none; }

.sidebar-logo-dot {
  width: 8px;
  height: 8px;
  background: var(--brand);
  border-radius: 50%;
  flex-shrink: 0;
  margin-left: 6px;
  animation: blink 2.4s ease-in-out infinite;
}

.sidebar-close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.sidebar-close:hover {
  background: var(--bg-alt);
  color: var(--text);
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  text-decoration: none;
}

.sidebar-nav-item:hover {
  background: var(--bg-alt);
  color: var(--text);
}

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

.sidebar-nav-item svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.sidebar-user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--brand-soft);
  border-radius: var(--radius-sm);
  color: var(--brand);
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-email {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-plan {
  display: block;
  font-size: 0.75rem;
  color: var(--success);
  margin-top: 2px;
}

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Main content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 36px 24px 60px;
  transition: margin-left var(--transition);
}
.sidebar.hidden ~ .main-content {
  margin-left: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.btn-primary:hover:not(:disabled) {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-alt);
  border-color: #cbd5e1;
}

.btn-ghost { background: transparent; color: var(--text-secondary); border: none; }
.btn-ghost:hover:not(:disabled) { background: var(--bg); color: var(--text); }

.btn-sm { padding: 6px 14px; font-size: 0.8125rem; }
.btn-xs { padding: 4px 10px; font-size: 0.75rem; }
.btn-large { padding: 12px 24px; font-size: 0.9375rem; }

.btn-full { width: 100%; }

/* View Transitions */
.view { animation: fadeIn 0.2s ease; }
.view.hidden { display: none; }

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

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.card-title { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; }
.card-subtitle { font-size: 0.875rem; color: var(--text-muted); margin-top: 2px; }

.card-header-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ── HERO SECTION ── */
.hero-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.hero-logo .logo-mark {
  width: 64px;
  height: 64px;
}

.hero {
  padding: 64px 24px;
  text-align: center;
  color: var(--text);
}

.hero-content {
  max-width: 620px;
  margin: 0 auto;
  padding: 48px 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--brand-soft, rgba(99, 102, 241, 0.1));
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--brand, #6366f1);
  margin-bottom: 24px;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
  color: var(--text);
  min-height: 2.2em;
}

.hero-cursor {
  animation: blink 1.2s step-end infinite;
  font-weight: 400;
  color: var(--brand);
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.hero-brand-name {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.hero-parent-brand {
  font-size: 0.5em;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.2;
  color: var(--text-muted);
}

.hero-title-gradient {
  background: linear-gradient(135deg, var(--brand, #6366f1) 0%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-description {
  font-size: 1.1875rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto 6px;
  line-height: 1.6;
}

.hero-asterisk {
  font-size: 1.1875rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto 8px;
  line-height: 1.6;
}

.hero-tagline {
  font-size: 0.9375rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 0;
  line-height: 1.5;
}

.hero-tagline2 {
  margin: 0 auto 24px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.hero-platforms {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}

.hero-platform-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.hero-platform-icons {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-platform-icon {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0 10px;
  transition: color var(--transition);
}
.hero-platform-icon:not(:last-child)::after {
  content: "|";
  position: relative;
  left: 10px;
  color: var(--border);
}
.hero-platform-icon:hover {
  color: var(--text);
}

/* ── FEATURES SECTION ── */
.features {
  padding: 80px 24px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.feature-card {
  padding: 32px;
  background: var(--surface);
  border: none;
  border-radius: var(--radius-lg);
  transition: all var(--transition);
}

.feature-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.feature-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-description {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── COMPOSE PAGE ── */
.compose-page {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  max-width: 1200px;
}

.compose-main {
  min-width: 0;
}

.compose-sidebar {
  min-width: 0;
}

/* Compose Media */
.compose-media {
  margin-bottom: 16px;
}

.media-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.media-dropzone:hover,
.media-dropzone.drag-active {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.media-preview + .media-dropzone {
  margin-top: 8px;
}

.media-dropzone.compact {
  padding: 16px;
}

.media-dropzone.compact .media-dropzone-icon {
  display: none;
}

.media-dropzone.compact .media-dropzone-text {
  font-size: 0.875rem;
  margin-bottom: 2px;
}

.media-dropzone-icon {
  color: var(--text-muted);
  margin-bottom: 12px;
}

.media-dropzone-text {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.media-dropzone-subtext {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.media-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.media-preview {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.media-preview-item {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: var(--radius);
  overflow: hidden;
}

.media-preview-item img,
.media-preview-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-preview-moves {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.45);
}

.media-preview-move {
  border: none;
  background: transparent;
  color: #fff;
  cursor: pointer;
  padding: 2px 8px;
  font-size: 1rem;
  line-height: 1;
}

.media-preview-move:disabled {
  opacity: 0.3;
  cursor: default;
}

.media-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.75rem;
  transition: background var(--transition);
}

.media-preview-remove:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* Compose Toolbar */
.compose-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
}

.toolbar-actions {
  display: flex;
  gap: 4px;
}

.toolbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.toolbar-btn:hover {
  background: var(--bg-alt);
  color: var(--text);
  border-color: var(--text-secondary);
}

/* Compose Textarea */
.compose-textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
  min-height: 160px;
  color: var(--text);
  background: var(--bg);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.compose-textarea::placeholder { color: var(--text-muted); }

.compose-textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-ring);
}

.first-comment-wrap { margin-top: 12px; }
.first-comment-wrap .form-textarea { width: 100%; box-sizing: border-box; }
.first-comment-note { opacity: 0.6; font-weight: 400; }

/* Compose Footer */
.compose-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.platform-toggles { display: flex; flex-wrap: wrap; gap: 6px; }

.connect-hint {
  margin-bottom: 8px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.channel-reminder {
  margin-top: 10px;
  font-size: 0.8125rem;
  color: var(--warning);
  background: var(--warning-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.platform-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  color: var(--text-secondary);
  background: var(--surface);
  transition: all var(--transition);
}

.platform-chip:hover { border-color: #cdd3dc; color: var(--text); }
.platform-chip input { display: none; }

.platform-chip.selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.platform-chip.disabled { opacity: 0.5; cursor: not-allowed; }

.platform-chip.connected {
  border-color: var(--success);
  color: var(--text);
}

.chip-connected-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
}

.platform-icon { font-size: 1rem; line-height: 1; }

.compose-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.char-count {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.char-count.warning { color: var(--warning); }
.char-count.danger { color: var(--error); font-weight: 600; }

/* Preview Panel */
.preview-panel {
  position: sticky;
  top: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.preview-title {
  font-size: 0.9375rem;
  font-weight: 600;
}

.preview-count {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.preview-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  text-align: center;
}

.preview-empty svg {
  margin-bottom: 12px;
}

.preview-empty p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.preview-card {
  padding: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.preview-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.preview-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.preview-card-platform {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--brand);
}

.preview-card-icon {
  font-size: 1rem;
}

.preview-card-content {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.preview-card-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Feedback */
.feedback {
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  display: none;
  animation: fadeIn 0.2s ease;
}

.feedback.visible { display: block; }
.feedback.error { background: var(--error-soft); color: var(--error); border: 1px solid #fecaca; }
.feedback.success { background: var(--success-soft); color: var(--success); border: 1px solid #a7f3d0; }
.feedback.warning { background: var(--warning-soft); color: var(--warning); border: 1px solid #fde68a; }

.feedback-results { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }

.feedback-result-item { 
  display: flex; 
  align-items: center; 
  gap: 8px; 
  font-size: 0.8125rem; 
}

.feedback-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.feedback-icon-success { color: var(--success); }
.feedback-icon-error { color: var(--error); }

/* History */
.history-list { display: flex; flex-direction: column; gap: 16px; }

.history-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.history-item:hover { box-shadow: var(--shadow); }

.history-text { font-size: 0.9375rem; line-height: 1.6; margin-bottom: 14px; }

.history-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.history-platforms { display: flex; gap: 4px; }

.history-platform-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
}

.history-platform-badge.failed { background: var(--error-soft); color: var(--error); }

.history-date { font-size: 0.75rem; color: var(--text-muted); }
.history-link { font-size: 0.75rem; font-weight: 500; margin-left: auto; }

/* Accounts */
.account-list { display: flex; flex-direction: column; gap: 2px; }

.account-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius);
  transition: background var(--transition);
}

.account-item:hover { background: var(--bg); }

.account-item-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-size: 1.25rem;
  background: var(--bg);
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}

.account-item-info { flex: 1; min-width: 0; }
.account-item-name { font-weight: 600; font-size: 0.9375rem; }
.account-item-status { font-size: 0.8125rem; color: var(--text-muted); margin-top: 1px; }
.account-item-status.connected { color: var(--success); }
.account-item-selectable { cursor: pointer; }
.account-item.team-selected { background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand-ring); }

.copy-id-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  vertical-align: middle;
}
.copy-id-btn:hover { color: var(--brand); }

/* Empty state */
.empty-state { text-align: center; padding: 56px 24px; }
.empty-state-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.6; }
.empty-state-text { color: var(--text-muted); font-size: 0.9375rem; }

/* Calendar */
.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  max-width: 560px;
}

.calendar-header {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 0;
  text-transform: uppercase;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
}

.calendar-day:hover { background: var(--bg); }
.calendar-day.other-month { color: var(--text-muted); opacity: 0.4; }
.calendar-day.today { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.calendar-day.selected { background: var(--brand); color: #fff; }
.calendar-day.has-posts::after {
  content: "";
  position: absolute;
  bottom: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand);
}

.schedule-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius);
}

.schedule-form-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.schedule-form input[type="datetime-local"],
.schedule-form select {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: inherit;
  background: var(--surface);
  transition: border-color var(--transition);
}

.schedule-form input:focus,
.schedule-form select:focus {
  outline: none;
  border-color: var(--brand);
}

.scheduled-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.scheduled-list-item .sli-text { flex: 1; font-size: 0.875rem; }
.scheduled-list-item .sli-meta { font-size: 0.75rem; color: var(--text-muted); }

/* Responsive */
@media (max-width: 1024px) {
  .compose-page {
    grid-template-columns: 1fr;
  }
  
  .compose-sidebar {
    display: none;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.sidebar-open {
    transform: translateX(0);
  }
  
  .sidebar-close {
    display: flex;
  }
  
  .main-content {
    margin-left: 0;
    padding: 24px 16px 48px;
  }
  
  .mobile-header {
    display: flex;
  }
  
  .hero {
    padding: 48px 16px;
  }
  
  .hero-content {
    padding: 32px 16px;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-description {
    font-size: 1rem;
  }

  .hero-asterisk {
    font-size: 1rem;
  }
  
  .features {
    padding: 48px 16px;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .card {
    padding: 20px;
  }
  
  .account-item {
    flex-wrap: wrap;
  }
  
  .account-item .channel-select {
    flex: 1 1 100%;
    max-width: 100%;
  }
  
  .compose-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .compose-actions {
    justify-content: space-between;
  }
  
  .history-item {
    padding: 16px 18px;
  }
}

/* Sidebar Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
  opacity: 0;
  transition: opacity var(--transition);
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

@media (max-width: 768px) {
  .sidebar-overlay.active {
    display: block;
  }
}

/* ── DRAFTS VIEW ── */
.drafts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.draft-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: all var(--transition);
}

.draft-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.draft-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.draft-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.draft-text {
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 12px;
  white-space: pre-wrap;
}

.draft-platforms {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.draft-platform-tag {
  font-size: 0.75rem;
  padding: 4px 8px;
  background: var(--bg-alt);
  border-radius: 4px;
  color: var(--text-secondary);
}

.draft-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ── HASHTAG GROUPS VIEW ── */
.hashtag-groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.hashtag-group-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: all var(--transition);
}

.hashtag-group-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.hashtag-group-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.hashtag-group-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
}

.hashtag-group-platform {
  font-size: 0.75rem;
  padding: 4px 8px;
  background: var(--brand-soft);
  border-radius: 4px;
  color: var(--brand);
  font-weight: 600;
}

.hashtag-group-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.hashtag-tag {
  font-size: 0.8125rem;
  color: var(--brand);
  font-weight: 500;
}

/* ── SAVED REPLIES VIEW ── */
.saved-replies {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reply-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: all var(--transition);
}

.reply-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.reply-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.reply-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
}

.reply-content {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
  white-space: pre-wrap;
}

.reply-platforms {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

/* ── QUEUE VIEW ── */
.queue-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.queue-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.queue-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
}

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

.queue-schedule {
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.queue-schedule svg {
  width: 14px;
  height: 14px;
}

.queue-text {
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
}

.queue-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.queue-platforms {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.queue-actions {
  display: flex;
  gap: 8px;
}

/* ── INBOX VIEW ── */
.inbox-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.inbox-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: all var(--transition);
}

.inbox-item:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.inbox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.inbox-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inbox-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.inbox-user-info {
  display: flex;
  flex-direction: column;
}

.inbox-username {
  font-weight: 600;
  font-size: 0.9375;
  color: var(--text);
}

.inbox-platform {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.inbox-comment {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.inbox-reply-box {
  display: flex;
  gap: 8px;
}

.inbox-reply-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  resize: vertical;
  min-height: 80px;
}

.inbox-reply-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-ring);
}

/* ── ANALYTICS VIEW ── */
.import-history-panel {
  margin-bottom: 14px;
  padding: 12px 14px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.import-history-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.import-history-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.imported-item { flex-direction: column; align-items: stretch; gap: 2px; }
.form-input, .form-select {
  background: var(--surface);
  color-scheme: light;
}
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  color-scheme: dark;
}
[data-theme="dark"] .form-input::placeholder { color: var(--text-muted); }
.analytics-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.analytics-metric-card {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.analytics-metric-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.analytics-metric-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--brand);
}

.analytics-platforms {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.analytics-platform-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.analytics-platform-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.analytics-platform-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
}

.analytics-platform-icon {
  width: 28px;
  height: 28px;
}

.analytics-platform-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.analytics-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.analytics-stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.analytics-stat-value {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
}

/* ── ANALYTICS PREFERENCES + CHART ── */
.analytics-pref-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--text);
  cursor: pointer;
  flex-wrap: wrap;
}

.analytics-pref-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  cursor: pointer;
}

.analytics-pref-toggle .form-helper {
  flex-basis: 100%;
  margin: 0;
}

.analytics-chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 16px;
}

.analytics-chart-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.analytics-chart-card .btn-sm.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.analytics-chart {
  margin-top: 16px;
  width: 100%;
  height: 260px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  position: relative;
  border-bottom: 1px solid var(--border);
}

.analytics-chart .chart-empty {
  margin: auto;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.analytics-chart .chart-col {
  flex: 1 1 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
  position: relative;
}

.analytics-chart .chart-bar {
  width: 60%;
  background: linear-gradient(180deg, var(--brand), var(--brand-soft, var(--brand)));
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: height 0.2s ease;
}

.analytics-chart .chart-label {
  position: absolute;
  bottom: -18px;
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
  transform: translateX(-50%);
  left: 50%;
}

.analytics-chart .chart-legend,
.analytics-chart-legend {
  display: flex;
  gap: 16px;
  margin-top: 24px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.analytics-chart .chart-legend span::before,
.analytics-chart-legend span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 5px;
  background: var(--legend-color, var(--brand));
}

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.form-input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--text);
  transition: all var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-ring);
}

.form-select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
}

.form-textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-ring);
}

.form-helper {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Shared FreeSurf footer ── */
.freesurf-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 40px 24px 24px;
  margin-top: 48px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
}

.freesurf-footer-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}

.freesurf-footer-brand { max-width: 260px; }

.freesurf-footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.freesurf-footer-tagline {
  margin: 8px 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.freesurf-footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.freesurf-footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.freesurf-footer-heading {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.freesurf-footer-col a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}
.freesurf-footer-col a:hover { color: var(--brand); }

.freesurf-footer-bottom {
  max-width: 960px;
  margin: 28px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.footer-theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.footer-theme-toggle:hover {
  color: var(--text);
  border-color: var(--brand);
}

@media (max-width: 640px) {
  .freesurf-footer-inner { flex-direction: column; gap: 24px; }
  .freesurf-footer-bottom { flex-direction: column; text-align: center; }
}

/* ── Auth page ── */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 48px 16px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1.4;
}
.auth-checkbox input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--brand);
  flex-shrink: 0;
}
.auth-checkbox-main {
  display: block;
  font-weight: 400;
  color: var(--text);
}
.auth-checkbox-sub {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.auth-checkbox a {
  color: var(--brand);
  text-decoration: underline;
}

.auth-verify-text {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

#auth-extra-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Neutralize the browser's yellow autofill background */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset !important;
  -webkit-text-fill-color: var(--text) !important;
  box-shadow: 0 0 0 1000px var(--surface) inset !important;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.link-warning {
  font-size: 0.75rem;
  color: var(--warning);
  font-weight: 500;
  margin-left: 8px;
}

.tz-note {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tz-select {
  max-width: 220px;
  font-size: 0.8125rem;
}

.fees-balance {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt);
  margin-bottom: 16px;
}
.fees-balance-amount {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.fees-balance-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.fees-topup {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topup-estimate {
  margin-left: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.topup-estimate:empty { display: none; }

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.spinner-surface {
  border: 2px solid var(--border);
  border-top-color: var(--text);
}

.topup-quick {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.limits-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  margin-top: 8px;
}
.limits-table th,
.limits-table td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: left;
}
.limits-table th {
  background: var(--bg-alt);
  font-weight: 600;
}
.limits-table td.num,
.limits-table th.num {
  text-align: right;
}
.limits-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 10px 0 0;
}

.api-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 10px;
}

.api-section summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
}

.api-section summary::-webkit-details-marker { display: none; }

.api-section summary::before {
  content: "›";
  margin-right: 10px;
  transition: transform var(--transition);
  font-size: 1.1rem;
  line-height: 1;
}

.api-section[open] summary::before { transform: rotate(90deg); }

.api-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.5;
}

.api-text code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--brand-soft);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.8125rem;
}

.api-code {
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text);
  white-space: pre;
}

.api-code code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.api-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.api-tab {
  padding: 5px 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  border-radius: 999px;
  cursor: pointer;
}

.api-tab.active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
}
/* -- Auth: Google sign-in -- */
.auth-oauth { margin-bottom: 4px; }
.btn-oauth { display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-oauth:hover:not(:disabled) { background: var(--bg-alt); }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 0.8125rem; margin: 14px 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }


/* -- Compose disclosures -- */
.compose-disclosures { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.compose-disclosures .auth-checkbox { font-size: 0.875rem; }

/* -- App download badges (hero + reusable) -- */
.app-download { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; margin-top: 20px; }
.store-badge { display: inline-flex; align-items: center; gap: 10px; background: #000; color: #fff; border: 1px solid #000; border-radius: 10px; padding: 8px 16px; text-decoration: none; transition: transform .12s ease, opacity .12s ease; }
.store-badge:hover { transform: translateY(-1px); opacity: .88; }
.store-badge svg { width: 22px; height: 22px; flex: none; }
.store-badge-text { display: flex; flex-direction: column; line-height: 1.15; }
.store-badge-top { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; opacity: .8; }
.store-badge-bottom { font-size: 14px; font-weight: 600; }

/* -- Onboarding (post-sign-in) -- */
.onboarding-intro { font-size: 0.9375rem; color: var(--text); line-height: 1.6; margin: 4px 0 18px; }
#onboarding-step-1 .auth-checkbox,
#onboarding-step-2 .auth-checkbox { margin-bottom: 12px; }
#btn-onboarding-terms,
#btn-onboarding-finish { margin-top: 6px; }
