:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #f1f5ff;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #2454ff;
  --primary-dark: #1b3fc2;
  --accent: #0ea5e9;
  --border: #dbe4ff;
  --danger: #dc2626;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top right, #e7edff 0, transparent 42%), var(--bg);
}

a {
  color: var(--primary);
}

.hidden {
  display: none !important;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
  background: #fff;
  padding: 10px;
  border-radius: 8px;
  z-index: 1000;
}

#app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: #0b1226;
  font-weight: 800;
}

.brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 8px;
}

.logo-emoji {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: #eef3ff;
  font-size: 1rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: visible;
  flex-wrap: wrap;
  min-height: 44px;
}

.topbar,
.topbar-inner {
  overflow: visible;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  height: 38px;
  border: 1px solid transparent;
  border-radius: 999px;
  text-decoration: none;
  color: #1f2a44;
  font-weight: 600;
  padding: 0 13px;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.active {
  background: #eaf0ff;
  border-color: #c9d8ff;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown summary {
  list-style: none;
  cursor: pointer;
  height: 38px;
  border-radius: 999px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  font-weight: 600;
  color: #1f2a44;
}

.nav-dropdown summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown[open] summary,
.nav-dropdown.active summary,
.nav-dropdown summary:hover {
  background: #eaf0ff;
  border-color: #c9d8ff;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 8px;
  display: grid;
  gap: 4px;
  z-index: 60;
}

.nav-dropdown-link {
  text-decoration: none;
  color: #1f2a44;
  border-radius: 8px;
  padding: 9px 10px;
  font-weight: 500;
}

.nav-dropdown-link:hover {
  background: #f4f7ff;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#main-content {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 26px 18px 110px;
}

.footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-partner {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

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

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
}

.footer-links a:hover {
  color: var(--primary);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid-2 {
  grid-template-columns: 1fr;
}

.section-title {
  margin: 0 0 10px;
  font-size: 1.35rem;
  color: #101b3a;
}

.muted {
  color: var(--muted);
}

.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.94rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-accent {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #fff;
}

.btn-ghost {
  background: #fff;
  border-color: var(--border);
  color: #203050;
}

.input,
.textarea,
.select {
  width: 100%;
  border: 1px solid #cad8ff;
  border-radius: 10px;
  padding: 11px 12px;
  background: #fff;
  font: inherit;
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(36, 84, 255, 0.14);
}

.textarea {
  min-height: 140px;
  resize: vertical;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.justify-between {
  justify-content: space-between;
}

.meta,
.post-meta {
  font-size: 0.84rem;
  color: var(--muted);
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  border: 1px solid var(--border);
  background: #fff;
  color: #203050;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.86rem;
  font-weight: 600;
}

.filter-chip.active {
  background: #1f3ba8;
  border-color: #1f3ba8;
  color: #fff;
}

.reactions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.reaction-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  padding: 5px 10px;
}

.hero {
  padding: 28px;
  background: linear-gradient(155deg, #ffffff, #f3f6ff);
}

.floating-coaching-btn {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 30;
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  box-shadow: var(--shadow);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 12, 24, 0.6);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 16px;
}

.modal {
  width: min(860px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  padding: 16px;
}

.pagination {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
}

.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid #d8e1ff;
  border-top-color: #365eff;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.toast {
  position: fixed;
  right: 16px;
  top: 84px;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 140;
}

.toast.error {
  border-left-color: var(--danger);
}

.page-editor-layout {
  display: grid;
  gap: 14px;
}

.page-editor-list {
  display: grid;
  gap: 10px;
}

.page-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.page-item .meta {
  font-size: 0.75rem;
}

.editor-grid {
  display: grid;
  gap: 10px;
}

.editor-grid textarea {
  min-height: 180px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

@media (max-width: 960px) {
  .topbar-inner {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .topbar-actions {
    justify-content: flex-end;
  }

  .nav-dropdown-menu {
    right: auto;
    left: 0;
  }
}

@media (min-width: 960px) {
  #main-content {
    padding: 32px 24px 120px;
  }

  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-editor-layout {
    grid-template-columns: 320px 1fr;
    align-items: start;
  }
}
