:root {
  --bg: #0f172a;
  --panel: #111827;
  --panel-2: #0b1222;
  --accent: #38bdf8;
  --accent-2: #22d3ee;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: #1f2937;
  --border-strong: #1d2734; /* 5% darker */
  --danger: #f87171;
  --main-gradient: linear-gradient(180deg, rgba(15, 23, 42, 0.8), rgba(17, 24, 39, 0.95));
  --surface-overlay: rgba(17, 24, 39, 0.92);
  --topbar-bg: rgba(17, 24, 39, 0.7);
  --shadow-strong: 0 20px 60px rgba(0, 0, 0, 0.45);
  --shadow-card: 0 16px 42px rgba(0, 0, 0, 0.25);
  --shadow-lift: 0 -10px 30px rgba(0, 0, 0, 0.35);
  --button-primary: #080e1b; /* ~15% darker than panel-2 */
  --sidebar-glass: rgba(17, 24, 39, 0.26);
  --sidebar-border: rgba(255, 255, 255, 0.06);
  --composer-bg: #1b1f26;
  --composer-border: #202632;
  --composer-pill: #252c38;
  --composer-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
}

:root.theme-light,
body.theme-light {
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-2: #f6f8fb;
  --accent: #1a73e8;
  --accent-2: #1a73e8;
  --text: #202124;
  --muted: #5f6368;
  --border: #e6e9ef;
  --border-strong: #d5d9e3;
  --danger: #dc2626;
  --main-gradient: linear-gradient(180deg, #f9fbff, #eef3fb);
  --surface-overlay: rgba(255, 255, 255, 0.96);
  --topbar-bg: rgba(255, 255, 255, 0.9);
  --shadow-strong: 0 26px 68px rgba(14, 30, 72, 0.12);
  --shadow-card: 0 18px 40px rgba(14, 30, 72, 0.08);
  --shadow-lift: 0 -10px 30px rgba(14, 30, 72, 0.08);
  --button-primary: #1a73e8;
  --sidebar-glass: #ffffff;
  --sidebar-border: rgba(32, 33, 36, 0.08);
  --composer-bg: #ffffff;
  --composer-border: #e2e6ed;
  --composer-pill: #eef2f8;
  --composer-shadow: 0 18px 40px rgba(14, 30, 72, 0.08);
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: "DM Sans", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  overflow-y: auto;
}

body.app-page {
  padding-right: 32px; /* reserve space on the right: edge → gap → button → gap → scrollbar */
}

.landing-page {
  background-color: #fcfdff;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.02) 1px, transparent 1px);
  background-size: 28px 28px, 28px 28px;
}

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

.theme-light body,
body.theme-light {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0)),
    var(--bg);
}

.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  grid-template-rows: 1fr;
  min-height: 100vh;
  height: 100vh;
  background: transparent;
  padding: 10px 14px 18px;
  gap: 0;
}

.app.collapsed {
  grid-template-columns: 64px 1fr;
}

.sidebar {
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  backdrop-filter: none;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 16px;
  gap: 16px;
}

.sidebar-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.menu-toggle {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  font-size: 20px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--text);
  padding: 0;
}

.menu-toggle {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  font-size: 20px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-toggle:hover,
.menu-toggle:focus-visible {
  background: rgba(26, 115, 232, 0.08);
  border: none;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.action-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.app-page .sidebar .action-row {
  gap: 10px;
}

.app-page .sidebar .primary {
  min-height: 42px;
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 700;
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(26, 115, 232, 0.18);
  white-space: nowrap;
}

.app-page .sidebar .primary:hover {
  filter: brightness(1.02);
  box-shadow: 0 12px 26px rgba(26, 115, 232, 0.22);
}

.app-page .sidebar .primary:active {
  transform: translateY(0);
  box-shadow: 0 10px 24px rgba(26, 115, 232, 0.18);
}

.icon-button {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
}

.graph-icon {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 6px;
  transition: color 0.12s ease, transform 0.12s ease;
}

.graph-icon:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

.graph-icon.active {
  background: transparent;
  border-color: transparent;
  color: var(--accent);
  box-shadow: none;
}

.graph-icon svg {
  stroke: currentColor;
}

.force-canvas-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  background: transparent;
  border-radius: 16px;
  overflow: visible;
  box-shadow: none;
}

.force-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: transparent;
  border-radius: inherit;
}

.sessions {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.session-item {
  padding: 12px;
  padding-right: 12px;
  padding-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.2s ease, background 0.2s ease;
  position: relative;
}

.session-item.menu-open {
  z-index: 20;
}

.session-item:hover {
  border-color: var(--border-strong);
}

.session-item.active {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 1px var(--border-strong);
}

.session-title-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  width: 100%;
}

.session-rename {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.session-rename-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
}

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

.session-rename-actions button {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
}

.session-rename-actions button:hover {
  background: var(--panel);
}

.session-meta {
  font-size: 12px;
  color: var(--muted);
}

.session-actions {
  position: absolute;
  top: auto;
  right: 10px;
  bottom: 10px;
  transform: none;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: none;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.session-item:hover .session-actions {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-2px);
}

.session-actions button {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}

.session-share-btn {
  color: var(--accent);
}

.session-archive-btn {
  color: var(--muted);
}

.session-delete-btn {
  color: var(--danger);
}

.session-share-btn:hover,
.session-share-btn:focus-visible {
  background: rgba(26, 115, 232, 0.12);
}

.session-archive-btn:hover,
.session-archive-btn:focus-visible {
  background: rgba(15, 23, 42, 0.06);
}

.session-delete-btn:hover,
.session-delete-btn:focus-visible {
  background: rgba(248, 113, 113, 0.14);
}

.session-actions .icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.session-menu {
  position: absolute;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
  min-width: 140px;
  max-width: 220px;
  padding: 6px 0;
  z-index: 50;
}
.session-menu button {
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 14px;
}
.session-menu button:hover {
  background: var(--panel-2);
}

/* Shared floating menu look */
.floating-menu {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: visible;
  padding: 10px 0;
  text-align: left;
}

.floating-menu .menu-item {
  border: none;
  background: transparent;
  padding: 12px 14px;
  text-align: left;
  width: 100%;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
  cursor: pointer;
  display: block;
  margin: 0 8px;
  border-radius: 10px;
}

.floating-menu .menu-item:not(:first-of-type) {
  margin-top: 8px;
}

.floating-menu .menu-item:hover,
.floating-menu .menu-item:focus-visible,
.floating-menu .menu-item.active {
  background: rgba(56, 189, 248, 0.12);
}

.floating-menu .menu-item.danger {
  color: var(--danger);
}

.vision-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  background: #e6f2ff;
  color: #215ca3;
  font-size: 11px;
  line-height: 1.2;
  vertical-align: middle;
}

.session-menu {
  position: absolute;
  top: 42px;
  right: 8px;
  min-width: 200px;
  z-index: 50;
}

.sidebar-footer {
  position: relative;
  margin-top: auto;
}

.user-profile-button {
  width: 100%;
  padding: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-profile-button .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  color: #0f172a;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.user-profile-button .avatar.has-photo {
  background-size: contain;
}

.user-profile-button .user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.user-profile-button .user-name {
  font-weight: 600;
}

.user-profile-button .user-email {
  color: var(--muted);
  font-size: 11px;
}

.user-profile-button .chevron {
  margin-left: auto;
}

.user-profile-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 60px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: visible;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  z-index: 200;
}

.user-profile-header {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px;
}

.user-profile-header .user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.user-profile-header .user-name {
  font-size: 14px;
  font-weight: 700;
  overflow: visible;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-profile-header .user-email {
  display: none;
}

.user-profile-header .avatar.large {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  color: #0f172a;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
}
.user-profile-header .avatar.large.has-photo {
  background-size: contain;
}

.menu-divider {
  height: 1px;
  background: var(--border);
}

.login-modal {
  max-width: 420px;
}

.login-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-subtext {
  color: var(--muted);
  margin: 0;
}

.login-btn {
  width: 100%;
  padding: 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 600;
}

.login-btn.google {
  position: relative;
}

.login-btn.google::before {
  content: "";
  width: 18px;
  height: 18px;
  display: inline-block;
  background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2018%2018%22%3E%0A%20%20%3Cpath%20fill%3D%22%234285F4%22%20d%3D%22M17.64%209.204c0-.639-.057-1.252-.164-1.84H9v3.48h4.84c-.208%201.12-.84%202.07-1.79%202.707v2.253h2.9c1.7-1.566%202.69-3.87%202.69-6.6z%22/%3E%0A%20%20%3Cpath%20fill%3D%22%2334A853%22%20d%3D%22M9%2018c2.43%200%204.47-.806%205.96-2.195l-2.9-2.253c-.806.54-1.84.86-3.06.86-2.35%200-4.34-1.587-5.05-3.72H.96v2.333C2.44%2015.98%205.48%2018%209%2018z%22/%3E%0A%20%20%3Cpath%20fill%3D%22%23FBBC05%22%20d%3D%22M3.95%2010.692c-.18-.54-.28-1.116-.28-1.692%200-.586.1-1.152.28-1.692V4.975H.96A8.996%208.996%200%200%200%200%209c0%201.45.35%202.82.96%204.025l2.99-2.333z%22/%3E%0A%20%20%3Cpath%20fill%3D%22%23EA4335%22%20d%3D%22M9%203.58c1.32%200%202.5.45%203.43%201.333l2.57-2.57C13.46.9%2011.42%200%209%200%205.48%200%202.44%202.02.96%204.975l2.99%202.333C4.66%205.167%206.65%203.58%209%203.58z%22/%3E%0A%3C/svg%3E") no-repeat center / contain;
}

.login-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.login-email {
  display: flex;
  gap: 8px;
}

.login-email input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
}

.login-email button {
  padding: 10px 14px;
  border-radius: 10px;
}

.app.collapsed .sidebar {
  padding: 12px 8px;
  align-items: center;
  overflow: visible;
}

.app.collapsed .sidebar-header {
  gap: 10px;
}

.app.collapsed .brand,
.app.collapsed .action-row,
.app.collapsed .sessions,
.app.collapsed .context-card {
  display: none;
}

.app.collapsed .sidebar-footer {
  display: block;
  width: 64px;
  padding: 0;
}

.app.collapsed .user-profile-button {
  justify-content: center;
  padding: 10px 6px;
}

.app.collapsed .user-profile-button .user-info {
  display: none;
}

.app.collapsed .user-profile-menu {
  left: 64px;
  right: auto;
  min-width: 240px;
  bottom: auto;
  top: 0;
}

/* keep primary buttons elsewhere visible when sidebar is collapsed */
.app.collapsed .sidebar .primary {
  display: none;
}

.sidebar-topic {
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  font-size: 13px;
  color: var(--text);
  background: transparent;
  box-shadow: none;
  display: none !important;
}

.context-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.context-card.hidden {
  display: none;
}
.context-card-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}
.context-card-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--muted);
}
.context-card-modes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.context-card .toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text);
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.confirm-overlay.hidden {
  display: none;
}
.confirm-dialog {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  min-width: 260px;
  max-width: 320px;
}
.confirm-message {
  margin-bottom: 12px;
  font-size: 15px;
  color: var(--text);
}
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.main {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  max-height: 100%;
  overflow: visible;
  background: transparent;
  padding: 0 18px 0 20px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  background: var(--topbar-bg);
}

.session-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.session-title {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.1px;
}

.session-subtitle {
  font-size: 12px;
  color: var(--muted);
}

.token-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.token-chip {
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.18);
  white-space: nowrap;
}

.token-chip.muted {
  color: var(--muted);
  font-weight: 500;
}

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

.conversation {
  flex: 1 1 auto;
  min-height: 0;
  padding: 28px 16px 210px;
  max-width: min(1400px, 96vw);
  width: 100%;
  margin: 0 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin; /* keep gutter reserved */
  scrollbar-color: transparent transparent; /* hidden thumb by default */
  scrollbar-gutter: stable; /* keep layout from shifting when scrollbar appears */
}

.conversation:hover {
  scrollbar-width: thin;
  scrollbar-color: var(--muted) transparent;
}

.conversation::-webkit-scrollbar {
  width: 10px;
}

.conversation::-webkit-scrollbar-track {
  background: transparent;
}

.conversation::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 999px;
}

.conversation:hover::-webkit-scrollbar-thumb {
  background: var(--muted);
  opacity: 0.65;
}

.message {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 16px 14px;
  padding-right: 72px;
  background: var(--panel);
  line-height: 1.5;
  overflow: visible;
}

.message .md p {
  margin: 0 0 8px 0;
}

.message .md ul {
  margin: 0 0 8px 16px;
  padding: 0;
}

.message .md code {
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 4px;
  border-radius: 4px;
}

.message .md blockquote {
  margin: 0 0 12px 0;
  padding: 12px 14px 12px 42px;
  border-left: 4px solid var(--accent);
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.12), rgba(56, 189, 248, 0.04));
  border-radius: 12px;
  color: var(--text);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  position: relative;
}

.message .md blockquote p:last-child {
  margin-bottom: 0;
}



.readonly-view .conversation {
  background: var(--bg);
}

.readonly-view .message {
  background: var(--panel);
  border: none;
  box-shadow: none;
  padding-right: 16px;
}

.readonly-view .message.user {
  border: 1px solid var(--border-strong);
  background: var(--panel-2);
}

.readonly-view .message.assistant {
  border: none;
  background: transparent;
}

.readonly-view .message-toolbar {
  border-top: none;
  padding-top: 6px;
  margin-top: 8px;
  gap: 8px;
}

.readonly-view .message-toolbar .toolbar-btn,
.readonly-view .message-actions {
  display: none;
}

.readonly-view .message-toolbar .message-meta {
  margin-left: 0;
}


.readonly-view .readonly-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.readonly-view .readonly-meta .message-model-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--panel-2);
  color: var(--accent);
  font-weight: 600;
}

.readonly-view .readonly-meta .meta-sep {
  color: var(--border-strong);
  font-weight: 500;
}

.readonly-view .message-toolbar .message-model-tag {
  margin-left: 0;
}
.message .md blockquote::before {
  content: ">";
  position: absolute;
  left: 14px;
  top: 12px;
  color: var(--accent);
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
}

.message .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.01em;
  color: var(--text);
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.25);
  margin-bottom: 8px;
}

.message .badge[data-type="idea"] {
  background: rgba(252, 211, 77, 0.18);
  border-color: rgba(252, 211, 77, 0.32);
  color: #fbbf24;
}

.message .badge[data-type="comment"] {
  background: rgba(99, 102, 241, 0.14);
  border-color: rgba(99, 102, 241, 0.28);
  color: #a5b4fc;
}

.message .badge[data-type="task"] {
  background: rgba(52, 211, 153, 0.14);
  border-color: rgba(52, 211, 153, 0.3);
  color: #34d399;
}

.message .badge[data-type="question"] {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.28);
  color: #93c5fd;
}

.message .badge .icon {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-right: 2px;
}

.message.note .badge {
  display: none;
}

.message.note .note-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.message.note .note-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  color: #2f2a1b;
}

.message.note .note-title .icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message.note .note-time {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  opacity: 0.8;
}

.message.note .note-divider {
  width: 100%;
  border-top: 1px dashed rgba(0, 0, 0, 0.1);
  margin-bottom: 10px;
}

.edit-inline {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.edit-inline textarea {
  width: 100%;
  min-height: 80px;
  resize: vertical;
  padding: 10px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
}

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

.message-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  align-items: center;
  z-index: 2;
}

.message-actions .message-menu-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: transparent;
  border: none;
  color: var(--text);
}

.message-actions .message-menu-btn:hover {
  transform: none;
  color: var(--text);
}

.message .session-menu {
  top: 42px;
  right: 0;
}

.message.user {
  margin-left: auto;
  max-width: 65%;
  text-align: right;
  background: var(--panel);
  border-color: var(--border);
}

.message.user .md {
  text-align: left;
}

.message.assistant {
  max-width: 100%;
  background: transparent;
  border: none;
}

.message.note {
  max-width: 70%;
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
  font-size: 13px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
  transform: none;
}

.message.note::before {
  content: "📌";
  position: absolute;
  left: -10px;
  top: -14px;
  transform: none;
  font-size: 20px;
}

.message.note .md {
  color: #78350f;
}

.note-editor {
  margin-top: 10px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  padding: 12px;
  background: var(--panel-2);
}

.note-inline-edit {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.note-inline-edit textarea {
  width: 100%;
  min-height: 100px;
  resize: vertical;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 10px;
  font-size: 14px;
}

.note-inline-edit textarea:focus {
  outline: 1px solid var(--border-strong);
}

.note-inline-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.note-inline-meta select {
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 6px 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
}

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

.note-editor-top {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.note-editor textarea {
  flex: 1;
  min-height: 90px;
  resize: vertical;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 10px;
  font-size: 14px;
}

.note-editor textarea:focus {
  outline: 1px solid var(--border-strong);
}

.note-editor-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 150px;
  max-width: 180px;
}

.note-editor-meta label {
  font-size: 12px;
  color: var(--muted);
}

.note-editor-meta select {
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
}

.note-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.message-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.message-toolbar .toolbar-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: transparent;
  border: none;
  color: var(--text);
  position: relative;
}

.message-toolbar .toolbar-btn:hover {
  color: var(--text);
  transform: none;
}

.message-toolbar .toolbar-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 10px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  white-space: nowrap;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.message-toolbar .toolbar-btn:hover::after,
.message-toolbar .toolbar-btn:focus-visible::after {
  opacity: 1;
}

.message-toolbar .message-meta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.message-toolbar .message-time {
  margin-left: 0;
  font-size: 12px;
  color: var(--muted);
  opacity: 0.85;
  font-weight: 400;
}

.message-toolbar .message-tokens {
  color: var(--muted);
  font-weight: 400;
}

.message-toolbar .meta-sep {
  opacity: 0.6;
}

.message-toolbar .meta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: var(--muted);
  opacity: 0.9;
  vertical-align: middle;
}

.message-toolbar .meta-icon .icon {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message-toolbar .toolbar-btn .icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.message-toolbar .message-latency {
  color: var(--muted);
  font-weight: 400;
}

.message-toolbar .message-model-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  margin-left: 6px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
}

.message-toolbar .message-model-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  margin-left: 6px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  pointer-events: none;
}

.main-toolbar {
  position: fixed;
  top: 16px;
  right: 8px; /* small offset from edge: edge → small gap → button → gap → scrollbar */
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
}

.provider-switch {
  display: none;
}

.main-menu-button {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.main-menu {
  position: absolute;
  top: 44px;
  right: 0;
  min-width: 200px;
  z-index: 30;
}

.provider-switch {
  position: relative;
  display: none;
}

.provider-button {
  min-width: 160px;
  height: 36px;
  padding: 0 10px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
}

.provider-button .provider-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.provider-menu {
  position: absolute;
  top: 44px;
  right: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  padding: 8px;
  min-width: 220px;
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 40;
}

.provider-menu .provider-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
}

.provider-menu .provider-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.provider-menu .provider-models {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.provider-menu button.provider-choice {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 10px;
  padding: 8px;
}

.provider-menu button.provider-choice.active {
  border-color: var(--accent);
  color: var(--accent);
}

.composer {
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  position: sticky;
  bottom: 24px;
  width: min(1100px, calc(100% - 72px));
  max-width: min(1400px, 96vw);
  margin: 0 auto;
}

.composer.floating {
  position: absolute;
  bottom: auto;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(900px, calc(100% - 96px));
  max-width: min(1400px, 96vw);
  height: auto;
}

.composer-surface {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--composer-bg);
  border: 1px solid var(--composer-border);
  border-radius: 24px;
  padding: 12px 14px;
  box-shadow: var(--composer-shadow);
  backdrop-filter: blur(14px) saturate(140%);
}

.composer-left,
.composer-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.composer-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.composer textarea {
  width: 100%;
  min-width: 0;
  resize: none;
  min-height: 56px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  flex: 1;
  overflow-y: hidden;
  padding: 6px 4px;
}

.composer textarea:focus {
  outline: none;
  box-shadow: none;
}

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

.composer-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.composer-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  min-height: 22px;
}

.attachment-belt {
  display: flex;
  justify-content: flex-start;
  padding: 4px 0 6px;
  min-height: 26px;
}

.attachment-belt.hidden {
  display: none;
}

.provider-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.selector-wrap {
  position: relative;
}

.selector-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  padding: 4px 6px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.selector-btn::after {
  content: "▾";
  font-size: 12px;
  color: var(--muted);
}

.dropdown-menu {
  position: absolute;
  bottom: 110%;
  left: 0;
  min-width: 180px;
  background: var(--composer-bg);
  border: 1px solid var(--composer-border);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 20;
  max-height: 320px;
  overflow-y: auto;
}

.dropdown-menu.down {
  bottom: auto;
  top: 110%;
}

.dropdown-menu button {
  border: none;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
}

.dropdown-menu button:hover,
.dropdown-menu button.active {
  background: var(--composer-pill);
}

.composer-meta-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status {
  color: var(--muted);
  font-size: 13px;
  min-width: 0;
  width: auto;
  text-align: right;
  flex-shrink: 0;
}
.status:empty {
  display: none;
}

.composer-circle-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #e1e7f0;
  background: #f5f7fb;
  color: #1f2937;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(14, 30, 72, 0.06);
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.composer-circle-btn svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.composer-circle-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(14, 30, 72, 0.12);
  border-color: rgba(26, 115, 232, 0.3);
}

.composer-circle-btn:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(14, 30, 72, 0.1);
}

.attach-btn {
  background: #f5f7fb;
  color: #1a73e8;
  border-color: rgba(26, 115, 232, 0.22);
}

.mic-btn {
  background: #f5f7fb;
  color: #1a73e8;
  border-color: rgba(26, 115, 232, 0.22);
}

.mic-btn.recording {
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
  box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.16);
}

.send-button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #ffffff;
  border: 1px solid var(--accent);
  box-shadow: 0 10px 24px rgba(26, 115, 232, 0.22);
  transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.send-button:hover {
  filter: brightness(1.03);
  box-shadow: 0 12px 26px rgba(26, 115, 232, 0.24);
  transform: translateY(-1px);
}

.send-button:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(26, 115, 232, 0.2);
}

.send-button svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.send-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.load-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(0deg);
  transform-origin: center;
  width: 68px;
  height: 68px;
  border: 4px solid var(--muted);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  pointer-events: none;
  opacity: 0.9;
  z-index: 1;
}

.spinner.small {
  width: 42px;
  height: 42px;
  border-width: 4px;
}

.spinner.inside-button {
  position: absolute;
  width: 18px;
  height: 18px;
  border-width: 3px;
  right: 12px;
  left: auto;
  top: 50%;
  transform: translateY(-50%);
}

.message.focused {
  outline: 2px solid var(--accent);
}

.spinner.hidden {
  display: none;
}

.spinner.inline {
  position: relative;
  width: 16px;
  height: 16px;
  border-width: 2px;
  top: auto;
  left: auto;
  transform: rotate(0deg);
  margin-left: 6px;
}

.attachment-chips {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 14px;
  background: var(--composer-pill);
  border: 1px solid var(--composer-border);
  color: var(--text);
  font-size: 12px;
  flex: 0 1 auto;
  max-width: 320px;
}

.attachment-name {
  overflow: visible;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-icon {
  font-size: 18px;
  line-height: 1;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.attachment-thumb {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  background-color: var(--panel-2);
  border: 1px solid var(--composer-border);
  flex-shrink: 0;
}

.attachment-chip button {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}

.attachment-chip button:hover {
  color: var(--text);
}

.attachment-name-link {
  text-decoration: underline;
  text-decoration-color: transparent;
}

.attachment-name-link:hover {
  text-decoration-color: currentColor;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.lightbox.hidden {
  display: none;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.lightbox-content {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  max-width: min(90vw, 920px);
  max-height: 90vh;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 8px;
}

.lightbox-caption {
  color: var(--muted);
  font-size: 13px;
  word-break: break-word;
}

.lightbox-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  z-index: 2;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: visible;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@keyframes spin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

button {
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, border-color 0.1s ease;
}

button:hover {
  border-color: var(--accent);
}

button:active {
  transform: none;
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

button.primary {
  background: var(--button-primary);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
  z-index: 1;
}

button.ghost {
  background: transparent;
  border-color: var(--border);
}

button.danger {
  color: var(--danger);
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 16px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  width: min(780px, calc(100% - 32px));
  box-shadow: var(--shadow-strong);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.project-modal {
  width: min(980px, calc(100% - 32px));
  max-width: 980px;
}

.project-modal .modal-body {
  gap: 12px;
  padding-right: 0;
}

.project-modal .modal-footer {
  gap: 12px;
}

.project-modal label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  color: var(--text);
}

.project-modal input,
.project-modal textarea,
.project-modal select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
}

.project-modal textarea {
  resize: vertical;
  min-height: 90px;
}

.project-modal .input-hint {
  font-size: 12px;
  color: var(--muted);
}

.project-modal .input-hint.error {
  color: #d14343;
}

.project-modal .modal-footer button {
  border-radius: 999px;
  padding: 11px 18px;
  font-weight: 600;
}

.project-modal .modal-footer .ghost {
  background: #ffffff;
  border: 1px solid #d6d9de;
  color: #111827;
}

.project-modal .modal-footer .ghost:hover {
  background: #f5f6f8;
}

.project-modal .modal-footer .primary {
  background: #1a73e8;
  border-color: #1a73e8;
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(26, 115, 232, 0.25);
}

.project-modal .modal-footer .primary:hover {
  filter: brightness(1.03);
  box-shadow: 0 12px 28px rgba(26, 115, 232, 0.3);
}

.settings-modal {
  width: min(1060px, calc(100% - 48px));
  min-height: 820px;
  max-height: 98vh;
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow-strong);
}

.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-overlay.hidden {
  display: none;
}

.settings-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.settings-overlay-frame {
  position: relative;
  z-index: 1;
  width: min(1100px, 95vw);
  height: min(820px, 90vh);
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
}

.settings-overlay-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.settings-overlay-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: visible;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 0.2s ease;
}

.progress-text {
  min-width: 140px;
  color: var(--text);
  font-size: 13px;
}

.quote-button {
  position: absolute;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 20;
}

.quote-button.hidden {
  display: none;
}

.share-modal {
  max-width: 660px;
  padding: 12px 18px 0;
  border-radius: 18px;
}

.share-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 4px 2px 0;
  background: transparent;
}

.share-invite {
  display: flex;
  gap: 8px;
}

.share-invite input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-2);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.share-section {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 14px 12px;
  background: var(--panel);
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.share-section-title {
  font-weight: 600;
  color: var(--text);
}

.share-person {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  box-shadow: var(--shadow-card);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
  font-weight: 700;
  border: 1px solid var(--border);
}

.person-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.person-name {
  font-weight: 700;
  font-size: 14px;
}

.person-email {
  color: var(--muted);
  font-size: 12px;
}

.person-role {
  color: var(--muted);
  font-size: 11px;
}

.pill {
  margin-left: auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  font-size: 12px;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.danger-pill {
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.25);
}

.avatar.has-photo {
  background-size: contain;
  background-position: center center !important;
  background-repeat: no-repeat;
  color: transparent;
}

.share-access-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.lock-icon {
  font-size: 20px;
  line-height: 1;
}

.share-access {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.share-select-wrap {
  position: relative;
}

.share-select {
  width: 100%;
  justify-content: space-between;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 12px;
  background: var(--panel);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.share-select .chevron {
  margin-left: auto;
}

.share-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.32);
  z-index: 10;
}

.share-dropdown button {
  border: none;
  background: transparent;
  text-align: left;
  padding: 12px 12px;
  color: var(--text);
}

.share-dropdown button:hover,
.share-dropdown button.active {
  background: rgba(56, 189, 248, 0.12);
}

.custom-select-wrap {
  position: relative;
  width: 100%;
}

.custom-select-hidden {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.custom-select-toggle {
  width: 100%;
  justify-content: space-between;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 12px;
  background: var(--panel-2);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.custom-select-toggle::after {
  content: "▾";
  margin-left: auto;
  color: var(--muted);
}

.custom-select-toggle:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.custom-select-menu {
  position: fixed;
  left: 0;
  top: 0;
  min-width: 200px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 12;
}

.custom-select-option.active {
  font-weight: 600;
  background: rgba(56, 189, 248, 0.12);
}

.mindmap-view {
  width: 100%;
  min-height: 360px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow-card);
}

.mindmap-card {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px dashed var(--border);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mindmap-title {
  font-weight: 700;
  color: var(--text);
}

.mindmap-svg {
  width: 100%;
  height: 100%;
}

.share-notes {
  color: var(--muted);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.share-notes label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-direction: row;
  margin: 0;
}

.share-notes input {
  margin: 0;
}

.share-url {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.share-input-row {
  display: flex;
  gap: 8px;
}

.share-input-row input {
  flex: 1;
  padding: 12px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-2);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.share-input-row button {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.share-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 4px 18px;
  border-top: 1px solid var(--border);
}

/* Buttons inside share modal aligned with main UI */
.share-modal button.primary {
  min-height: 42px;
  border-radius: 999px;
  padding: 11px 18px;
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(26, 115, 232, 0.18);
}

.share-modal button.primary:hover {
  filter: brightness(1.02);
  box-shadow: 0 12px 26px rgba(26, 115, 232, 0.22);
}

.share-modal button.ghost {
  min-height: 42px;
  border-radius: 999px;
  padding: 11px 16px;
  border: 1px solid var(--border);
  background: transparent;
}

.viewer-body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow: visible;
}

.viewer-wrapper {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 16px 24px;
}

.viewer-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: calc(100vh - 80px);
  height: calc(100vh - 80px);
}

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

.viewer-actions {
  display: flex;
  gap: 8px;
  position: relative;
}

.viewer-settings-menu {
  position: absolute;
  right: 0;
  top: 40px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 50;
}

.settings-title {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.settings-option {
  border: none;
  background: transparent;
  text-align: left;
  padding: 8px 6px;
  color: var(--text);
  border-radius: 8px;
}

.settings-option:hover {
  background: rgba(56, 189, 248, 0.12);
}

.viewer-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.viewer-meta {
  color: var(--muted);
  font-size: 13px;
}

.viewer-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.viewer-graph {
  border: none;
  border-radius: 16px;
  padding: 0;
  background: transparent;
  height: 100%;
  max-height: none;
  overflow: visible;
  box-shadow: none;
}

.viewer-tree {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.viewer-force {
  display: block;
}

.viewer-graph canvas {
  display: block;
  border-radius: inherit;
}

.viewer-message {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
}

.viewer-message.thread-highlight {
  border-color: #ef4444;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.4);
}

.viewer-message.current-message {
  outline: 2px solid #38bdf8;
}

.viewer-message-header {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.viewer-message-body {
  white-space: pre-wrap;
  line-height: 1.5;
}

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

#graphContainer {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
}

.app.graph-mode #composer {
  display: none;
}

.app.graph-mode #graphContainer {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 0 36px; /* align top edge flush with neighboring blocks */
  align-self: stretch;
  overflow: auto;
  background: transparent;
}

.app.graph-mode #graphContainer .graph-container {
  flex: 1 1 auto;
  min-height: 100%;
  padding: 0 12px 0;
}

.app.graph-mode #graphContainer .force-canvas-wrap {
  height: calc(100vh - 360px);
  min-height: 520px;
}

.graph-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.graph-node {
  --node-fill: var(--panel);
  --node-border: var(--border);
  border: 1px solid var(--node-border);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--node-fill);
  position: relative;
}
.graph-node.graph-node-user {
  --node-fill: var(--accent);
  --node-border: var(--accent);
  color: #ffffff;
}
.graph-node.graph-node-assistant {
  --node-fill: #ffffff;
  --node-border: #d5d9e3;
}
.graph-node .meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.graph-open-thread {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 1px solid #ef4444;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border-radius: 8px;
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}
.graph-open-thread:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #b91c1c;
  color: #b91c1c;
  transform: translateY(-1px);
}

.graph-node.thread-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.3);
}

.graph-node.current-thread {
  border-color: var(--accent);
  background: var(--node-fill);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.45);
}
.graph-node.context-path {
  border-color: #ef4444;
  background: var(--node-fill);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.35);
}
.graph-node.context-path .meta {
  color: #b91c1c;
}

.graph-node .meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.graph-children {
  border-left: 2px solid var(--border);
  margin-left: 16px;
  padding-left: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.graph-children.context-path {
  border-color: rgba(239, 68, 68, 0.8);
}

.inline-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.label-title {
  color: var(--muted);
  font-size: 14px;
}

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

.model-row input {
  flex: 1;
}

.load-wrap button {
  position: relative;
  padding-right: 40px;
}

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

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding-right: 8px;
  flex: 1;
  min-height: 0;
}

/* New styles for two-panel settings modal */
.modal-body-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 20px;
  flex: 1;
  min-height: 0;
}

.modal-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--border);
  padding-right: 16px;
}

.modal-nav .nav-button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 8px 0;
}

.modal-nav .nav-button:hover {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.04), rgba(56, 189, 248, 0));
}

.modal-nav .nav-button.active {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.07), rgba(56, 189, 248, 0));
  border-bottom-color: var(--accent);
  font-weight: 700;
  color: var(--accent);
}

.modal-main-content {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0;
}
.modal-main-content label input,
.modal-main-content label select,
.modal-main-content label textarea {
  width: 100%;
}
.topics-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}
.topics-row button {
  min-width: 110px;
  height: 42px;
  align-self: center;
}
.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.two-col.align-start {
  align-items: start;
}
.inline-field {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
}
.inline-field input {
  flex: 1 1 auto;
}
.inline-field.compact {
  justify-content: flex-start;
  width: max-content;
}
.inline-field.compact input {
  flex: 0 0 110px;
  max-width: 130px;
}
.topics-inline {
  width: auto;
  max-width: 320px;
  display: block;
}
.add-topics-level {
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

#topicsCountInput {
  width: 110px;
  max-width: 130px;
  min-width: 100px;
  height: 36px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.topics-levels-list {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.topics-level-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  font-size: 13px;
}
.topics-level-pill .pill-label {
  font-weight: 600;
  color: #0f172a;
}
.topics-level-pill .pill-count {
  color: #475569;
}
.topics-level-pill button {
  border: none;
  background: transparent;
  cursor: pointer;
  color: #dc2626;
  padding: 4px;
  border-radius: 8px;
}
.topics-level-pill button:hover {
  background: rgba(220, 38, 38, 0.08);
}

.sub-nav {
  display: flex;
  width: 100%;
  gap: 0;
  margin-bottom: 16px;
  position: relative;
  padding-bottom: 8px;
}

.sub-nav::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--border);
}

.sub-nav-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px 14px;
  border-radius: 0;
  background: transparent;
  border: none;
  border-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.sub-nav-button:hover {
  color: var(--text);
}

.sub-nav-button:not(.active)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 4px;
  border-radius: 0;
  opacity: 0;
  transition: opacity 0.12s ease, background 0.12s ease;
}

.sub-nav-button:not(.active):hover::after {
  opacity: 0.95;
  background: #ff9800;
}

.sub-nav-button.active {
  color: var(--accent);
  font-weight: 600;
}

.sub-nav-button.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 4px;
  background: var(--accent);
  border-radius: 0;
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.2);
}
.sub-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* End of new styles */

.modal-body label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

/* Override modal label defaults inside share dialog */
.share-body .share-notes label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.modal-body input {
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
}

.modal-body select {
  padding: 12px 42px 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%),
    linear-gradient(90deg, transparent 50%, transparent 50%);
  background-position:
    calc(100% - 20px) center,
    calc(100% - 14px) center,
    calc(100% - 32px) center;
  background-size: 6px 6px, 6px 6px, 1px 50%;
  background-repeat: no-repeat;
}

.modal-body select:focus {
  outline: none;
  border-color: var(--accent);
}

.modal-body select::-ms-expand {
  display: none;
}

.modal-body option {
  background: var(--panel);
  color: var(--text);
}

.modal-section {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

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

.goal-modal .modal-footer button {
  border-radius: 999px;
  padding: 11px 18px;
  font-weight: 600;
}

.goal-modal .modal-footer .ghost {
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text);
}

.goal-modal .modal-footer .ghost:hover {
  background: #f5f6f8;
}

.goal-modal .modal-footer .primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(26, 115, 232, 0.18);
}

.goal-modal .modal-footer .primary:hover {
  filter: brightness(1.02);
  box-shadow: 0 12px 26px rgba(26, 115, 232, 0.22);
}

/* Buttons inside settings modal aligned with main UI */
.settings-modal button.primary {
  min-height: 42px;
  border-radius: 999px;
  padding: 11px 18px;
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(26, 115, 232, 0.18);
}

.settings-modal button.primary:hover {
  filter: brightness(1.02);
  box-shadow: 0 12px 26px rgba(26, 115, 232, 0.22);
}

.settings-modal button.ghost {
  min-height: 42px;
  border-radius: 999px;
  padding: 11px 16px;
  border: 1px solid var(--border);
  background: transparent;
}

.hidden {
  display: none !important;
}

@media (max-width: 960px) {
  .app {
    grid-template-columns: 240px 1fr;
    padding: 10px 12px 16px;
    gap: 0;
  }

  .main {
    min-height: calc(100vh - 24px);
    max-height: calc(100vh - 24px);
    padding: 0 14px;
  }

  .conversation {
    padding: 22px 12px 190px;
  }

  .composer {
    width: min(960px, calc(100% - 56px));
    bottom: 16px;
  }

  .session-item {
    padding: 10px;
    padding-right: 10px;
    padding-bottom: 10px;
  }
}

@media (max-width: 760px) {
  .app {
    grid-template-columns: 1fr;
    padding: 10px;
    gap: 0;
    height: auto;
    min-height: 100vh;
  }

  .sidebar {
    flex-direction: row;
    overflow-x: auto;
    gap: 12px;
    border-bottom: none;
  }

  .sessions {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .session-item {
    min-width: 180px;
  }

  .sidebar-footer {
    min-width: 200px;
  }

  .main {
    max-height: none;
    min-height: calc(100vh - 20px);
  }

  .conversation {
    padding: 16px 10px 150px;
  }

  .composer {
    width: 100%;
    margin: 0;
    bottom: 12px;
    border-radius: 14px;
  }

  .composer.floating {
    position: absolute;
    top: 32%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, 0);
    width: calc(100% - 20px);
  }
}
.message.editing {
  width: 100%;
}

body.landing-page {
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-2: #f6f8fb;
  --accent: #1a73e8;
  --accent-2: #1a73e8;
  --text: #202124;
  --muted: #5f6368;
  --border: #e6e9ef;
  --border-strong: #d5d9e3;
  --shadow-card: 0 18px 40px rgba(14, 30, 72, 0.08);
  --shadow-strong: 0 26px 68px rgba(14, 30, 72, 0.12);
  --button-primary: #1a73e8;
  overflow: auto;
  padding: 0;
  background: radial-gradient(circle at 18% 10%, rgba(26, 115, 232, 0.08), transparent 26%),
              radial-gradient(circle at 86% 14%, rgba(251, 188, 4, 0.08), transparent 22%),
              #ffffff;
  color: var(--text);
  font-family: "DM Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

body.app-page {
  background: radial-gradient(circle at 18% 10%, rgba(26, 115, 232, 0.08), transparent 26%),
              radial-gradient(circle at 86% 14%, rgba(251, 188, 4, 0.08), transparent 22%),
              #ffffff;
  color: var(--text);
}

body.config-only {
  background: #f7f8fb;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px;
}

.config-only .app {
  display: none;
}

.config-only #configModal {
  position: static;
  display: block;
}

.config-only #configModal .modal-backdrop {
  display: none;
}

.config-only .modal-content.settings-modal {
  position: relative;
  margin: 0 auto;
}

body.dashboard-page {
  overflow: auto;
  padding: 0;
  background: #ffffff;
}

.page-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 28px 24px 52px;
}

.landing-page .page-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 22px 64px;
}

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

.landing-header {
  padding: 10px 0 32px;
  gap: 12px;
}

.dashboard-header {
  gap: 18px;
  padding: 6px 4px 18px;
}

.brand-mark {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.dashboard-header .brand-mark {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.brand-logo {
  width: 72px;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(14, 30, 72, 0.1);
}

.dashboard-header .brand-logo {
  width: 180px;
  box-shadow: none;
  border-radius: 8px;
}
.dashboard-header .brand-text.only-text .brand-name {
  font-size: 18px;
  font-weight: 700;
}
.dashboard-header .brand-text.only-text .brand-tagline {
  color: var(--muted);
  font-size: 13px;
}

.brand-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 8px rgba(56, 189, 248, 0.14);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: 18px;
}

.brand-tagline {
  font-size: 13px;
  color: var(--muted);
}

.landing-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.landing-nav button {
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
}

.landing-nav .ghost {
  background: transparent;
  border-color: transparent;
  color: var(--accent);
}

.landing-nav .ghost:hover {
  background: rgba(26, 115, 232, 0.08);
}

.nav-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 10px;
}

.nav-link:hover {
  background: rgba(26, 115, 232, 0.12);
}

.landing-main {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.landing-hero {
  padding: 42px 0 74px;
  position: relative;
  overflow: visible;
}

.landing-hero::after {
  content: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 48px;
  align-items: center;
}

.hero-text {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.accent-line {
  width: 64px;
  height: 3px;
  background: var(--accent);
  border-radius: 999px;
}

.hero-bullets {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.hero-bullets span {
  position: relative;
  padding-left: 14px;
}

.hero-bullets span::before {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  left: 0;
  top: 7px;
}

.hero-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.logo-bubble {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 24px 54px rgba(14, 30, 72, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-bubble img {
  width: 72%;
  height: 72%;
  object-fit: contain;
}

.service-dots {
  display: flex;
  align-items: center;
  gap: 14px;
}

.service-dots .dot,
.ready-icon .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: 0 10px 20px rgba(14, 30, 72, 0.12);
}

.service-dots .dot.blue,
.ready-icon .dot.blue {
  background: #1a73e8;
}

.service-dots .dot.red,
.ready-icon .dot.red {
  background: #ea4335;
}

.service-dots .dot.yellow,
.ready-icon .dot.yellow {
  background: #fbbc04;
}

.service-dots .dot.green,
.ready-icon .dot.green {
  background: #34a853;
}

.service-note {
  font-size: 13px;
  color: var(--muted);
}

.hero-text h1 {
  margin: 12px 0 10px;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.hero-lead {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.hero-sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.hero-pill {
  width: fit-content;
}

.cta-row.minimal {
  justify-content: flex-start;
}

.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin: 8px 0 18px;
}

.landing-page .landing-nav button,
.landing-main button {
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 600;
  background: #ffffff;
  border-color: var(--border);
  color: var(--text);
  box-shadow: none;
}

.landing-main button.primary,
.landing-page .landing-nav button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(26, 115, 232, 0.22);
}

.landing-main button.ghost,
.landing-page .landing-nav button.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--accent);
}

.landing-main button.ghost:hover,
.landing-page .landing-nav button.ghost:hover {
  background: rgba(26, 115, 232, 0.08);
}

.cta-login {
  width: auto;
  min-width: 180px;
  padding: 13px 22px;
  font-size: 16px;
  box-shadow: var(--shadow-card);
}

.outline {
  border-color: var(--accent);
  color: var(--text);
}

.hero-meta {
  display: none;
}

.meta-item {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow-card);
}

.meta-label {
  color: var(--muted);
  font-size: 12px;
}

.meta-value {
  font-weight: 700;
}

.hero-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.glass-card {
  background: var(--surface-overlay);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(6px);
}

.hero-progress .card-header,
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-size: 11px;
  color: var(--muted);
}

.card-title {
  font-weight: 700;
  font-size: 18px;
  margin-top: 2px;
}

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: auto;
  padding: 0 4px;
  margin-left: 8px;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted, #6b7280);
  font-weight: 600;
  font-size: 14px;
  border: 0;
}

.subtle {
  background: rgba(56, 189, 248, 0.12);
  color: var(--text);
}

.progress-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 14px 0;
}

.progress-line {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px 12px;
}

.progress-title {
  font-weight: 600;
}

.progress-meter {
  grid-column: 1 / -1;
  position: relative;
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: visible;
}

.progress-meter span {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.progress-value {
  color: var(--muted);
  font-size: 12px;
  justify-self: end;
  grid-row: 1;
  grid-column: 2;
}

.mini-checklist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0 12px;
}

.check-item {
  position: relative;
  padding-left: 18px;
}

.check-item::before {
  content: "•";
  position: absolute;
  left: 4px;
  color: var(--accent);
}

.card-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-note {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.note-label {
  color: var(--muted);
  font-size: 12px;
}

.note-value {
  font-weight: 700;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--panel-2);
  color: #0f172a;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(26, 115, 232, 0.14);
}

.button-link.primary {
  background: #2f6ded;
  color: #ffffff;
  border-color: #2f6ded;
}
.button-link.primary.outline {
  background: transparent;
  color: #1a73e8;
  border-color: #1a73e8;
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.2);
}

.button-link.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
  box-shadow: none;
}

.benefit-section {
  margin: 0 -22px;
  padding: 62px 22px 58px;
  background: #f6f8fb;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 44px;
}

.benefit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.benefit-card {
  background: transparent;
  padding: 8px 10px;
}

.benefit-card h3 {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 18px;
  letter-spacing: -0.01em;
}

.benefit-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.ready-block {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px 32px 36px;
  box-shadow: var(--shadow-card);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ready-icon {
  width: 68px;
  height: 68px;
  margin: 0 auto 4px;
  background: #f1f4fa;
  border-radius: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  place-items: center;
  gap: 6px;
  padding: 12px;
  box-shadow: 0 16px 38px rgba(14, 30, 72, 0.12);
}

.ready-icon .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: none;
}

.ready-copy h2 {
  margin: 4px 0 8px;
  font-size: 28px;
  letter-spacing: -0.01em;
}

.ready-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.ready-actions {
  justify-content: center;
  gap: 10px;
}

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

.ready-link:hover {
  color: var(--accent);
}

.feature-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.section-heading h2 {
  margin: 6px 0;
  font-size: 26px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.feature-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.feature-icon {
  font-size: 22px;
  line-height: 1;
}

.feature-card h3 {
  margin: 10px 0 6px;
}

.feature-card ul {
  padding-left: 16px;
  margin: 10px 0 0;
  color: var(--muted);
}

.cabinet-preview {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow-card);
}

.preview-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.landing-footer {
  margin-top: 36px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  color: var(--muted);
}

.plan-section {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.plan-section .glass-card {
  background: var(--panel-2);
}

.dashboard-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.header-user-menu {
  position: relative;
}

.user-menu-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 16px;
  border: 1px solid #dfe3ea;
  background: #f4f6fa;
  color: #111827;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(17, 24, 39, 0.08);
}

.dashboard-page .user-menu-chip {
  background: #f4f6fa;
  border: 1px solid #dfe3ea;
  color: #111827;
  box-shadow: 0 12px 26px rgba(17, 24, 39, 0.08);
}

.user-menu-chip .avatar {
  width: 38px;
  height: 38px;
  font-size: 14px;
  flex-shrink: 0;
  border: 1px solid #d8dce5;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}
.user-menu-chip .avatar.has-photo {
  background-size: contain !important;
}

.dashboard-page .user-menu-chip .avatar {
  background: linear-gradient(135deg, #f8fafc, #eef2f7);
  color: #0f172a;
  font-weight: 700;
}

.user-menu-name {
  font-weight: 700;
}

.user-chip-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.user-menu-email {
  font-size: 13px;
  color: #6b7280;
  font-weight: 600;
  line-height: 1.2;
}

.header-user-menu-dropdown {
  position: absolute;
  top: 44px;
  right: 0;
  min-width: 180px;
  z-index: 20;
}

.dashboard-main {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.cabinet-hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cabinet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.cabinet-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbff, #f3f7ff);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.avatar.large {
  width: 64px;
  height: 64px;
  font-size: 24px;
}

.user-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-email {
  font-weight: 700;
}

.user-status {
  color: var(--muted);
  font-size: 12px;
}

.cabinet-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.catalog-card {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px;
  background: #f8fbff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 200px;
}

.catalog-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(47, 109, 237, 0.1);
  color: #1a73e8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.catalog-card h3 {
  margin: 0;
  font-size: 16px;
  color: #1a73e8;
}

.catalog-card p {
  margin: 0;
  color: #42526e;
  line-height: 1.5;
  font-size: 14px;
}

.catalog-link {
  margin-top: auto;
  color: #1a73e8;
  font-weight: 700;
  text-decoration: none;
}

.promo-hero {
  padding: 48px 2px 32px;
  text-align: center;
}

.promo-text {
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.promo-text h1 {
  margin: 12px 0 10px;
  font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.promo-text .hero-lead {
  margin: 0;
  color: #4b5563;
  font-size: 17px;
  line-height: 1.7;
}

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

.cta-large {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.cta-large.primary {
  background: #1a73e8;
  color: #ffffff;
  border-color: #1a73e8;
  box-shadow: 0 12px 26px rgba(26, 115, 232, 0.22);
}

.cta-large.outline {
  background: transparent;
  color: #1a73e8;
  border-color: #1a73e8;
}

.cta-large.ghost {
  background: transparent;
  color: #1f2937;
  border-color: #e5e7eb;
}

.cta-large:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(26, 115, 232, 0.18);
}

.feature-strip {
  padding: 54px 0 50px;
  background: #f7f9fb;
}

.promo-benefits {
  padding: 64px 0 56px;
}

.study-grid {
  margin-top: 18px;
}

.stats-plain {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 10px;
}

.stats-plain-item .stat-label {
  font-size: 13px;
  color: #4b5563;
  text-transform: none;
}

.stats-plain-item .stat-value {
  font-size: 22px;
  font-weight: 800;
  color: #111827;
}

.stats-plain-item .stat-note {
  font-size: 13px;
  color: #6b7280;
}

.feature-columns {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  padding: 0 12px;
}

.feature-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feature-title {
  font-weight: 700;
  font-size: 18px;
  color: #1f2937;
}

.feature-title.feature-underline {
  position: relative;
  padding-bottom: 8px;
  margin-bottom: 4px;
}

.feature-title.feature-underline::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 62px;
  height: 4px;
  border-radius: 999px;
  background: #1a73e8;
}

.feature-title.feature-underline.amber::after {
  background: #fbbc04;
}

.feature-title.feature-underline.green::after {
  background: #34a853;
}

.feature-text {
  color: #4a5568;
  font-size: 14px;
  line-height: 1.7;
}

.nav-tiles {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 12px;
}

.free-tiles {
  padding: 12px 2px 60px;
}

.tiles-header h2 {
  margin: 0 0 6px;
  font-size: 24px;
}

.tiles-header p {
  margin: 0;
  color: #5f6368;
}

.tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.nav-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 22px 24px;
  border: 1px solid #e6e9ef;
  border-radius: 16px;
  background: #ffffff;
  text-decoration: none;
  color: #1f2937;
  box-shadow: none;
  min-height: 220px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.nav-card:hover {
  border-color: #cdd4e3;
  box-shadow: 0 14px 30px rgba(17, 36, 94, 0.12);
  transform: translateY(-2px);
}

.nav-card-body h3 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
  color: #1f2937;
}

.nav-card-body p {
  margin: 0 0 8px;
  font-size: 15px;
  color: #4a5568;
  line-height: 1.65;
}

.nav-card-body .nav-detail {
  font-size: 14px;
  color: #596376;
  line-height: 1.65;
}

.nav-card-footer {
  margin-top: 12px;
  align-self: flex-end;
  font-size: 18px;
  color: #1a73e8;
}

.stat-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--panel-2);
  box-shadow: var(--shadow-card);
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
}

.stat-value {
  font-size: 24px;
  font-weight: 800;
}

.stat-value.accent {
  color: var(--accent-2);
}

.stat-note {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.dash-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: var(--panel-2);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.dash-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash-list .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
}

.dash-link {
  color: var(--text);
  text-decoration: none;
}

.dash-link:hover {
  color: var(--accent);
}

#dialogList li.dialog-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}
#dialogList .dialog-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
#dialogList .dialog-actions {
  display: inline-flex;
  gap: 6px;
}
#dialogList .dialog-delete {
  min-width: 32px;
  height: 32px;
  border-radius: 8px;
}

.resource-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.resource-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.resource-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.resource-content .dash-link {
  word-break: break-word;
}

.resource-meta {
  display: block;
  margin-top: 2px;
  margin-left: 0;
}

.resource-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.resource-handle {
  cursor: grab;
  user-select: none;
  font-size: 14px;
  color: var(--muted);
}

.resource-item.dragging {
  opacity: 0.6;
}

.resource-delete {
  min-width: 32px;
  height: 32px;
  border-radius: 8px;
  line-height: 1;
  color: var(--muted);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.resource-delete:hover {
  color: var(--text);
}

.resource-item:hover .resource-delete {
  opacity: 1;
  pointer-events: auto;
}

.materials-add {
  display: none;
  margin-top: 8px;
  justify-content: flex-end;
}

.materials-card.expanded .materials-add {
  display: flex;
}

.materials-add-btn {
  padding: 10px 16px;
  min-width: 0;
  align-self: flex-end;
  box-shadow: 0 8px 18px rgba(47, 109, 237, 0.25);
  font-size: 14px;
}

.materials-card #resourcesList {
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--muted) transparent;
}

.materials-card #resourcesList::-webkit-scrollbar {
  width: 8px;
}

.materials-card #resourcesList::-webkit-scrollbar-thumb {
  background: rgba(156, 163, 175, 0.6);
  border-radius: 8px;
}

.materials-card #resourcesList::-webkit-scrollbar-track {
  background: transparent;
}

.resources-body .modal-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.upload-drop {
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 26px;
  text-align: center;
  background: var(--panel-2);
}

.upload-drop.dragover {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.resources-tabs {
  margin-bottom: 10px;
}

.resources-modal .modal-body {
  min-height: 360px;
}

.resources-body {
  min-height: 260px;
}

.resources-modal button.primary {
  min-height: 44px;
  border-radius: 999px;
  padding: 12px 20px;
  background: #2f6ded;
  border-color: #2f6ded;
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(47, 109, 237, 0.25);
}

.resources-modal button.primary:hover {
  filter: brightness(1.02);
  box-shadow: 0 12px 26px rgba(26, 115, 232, 0.22);
}

.resources-modal button.ghost {
  min-height: 44px;
  border-radius: 999px;
  padding: 12px 20px;
  background: transparent;
  border-color: #d7dce4;
  color: #1f2937;
  font-weight: 600;
  box-shadow: none;
}

.upload-icon {
  font-size: 26px;
  margin-bottom: 10px;
}

.upload-title {
  font-weight: 700;
}

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

.upload-hint {
  margin-top: 10px;
  font-size: 13px;
}

.linkish {
  color: #1a73e8;
  cursor: pointer;
}

.upload-status {
  margin-top: 10px;
}

.upload-status.error {
  color: var(--danger);
}

.upload-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}
.res-pending-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pending-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  font-size: 14px;
}
.pending-pill.pending-link {
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
}
.pending-link-title {
  font-weight: 600;
  color: var(--text);
}
.pending-link-url {
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}
.pending-pill .delete {
  margin-left: auto;
  cursor: pointer;
  color: var(--muted);
}

.upload-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  min-width: 260px;
}

.upload-item .file-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #eef2fb;
  font-weight: 700;
  color: #2f6ded;
}

.upload-item .file-name {
  flex: 1;
}

.upload-item .file-size {
  color: var(--muted);
  font-size: 13px;
}

.notes-existing {
  margin-top: 10px;
}

.notes-list {
  list-style: disc;
  padding-left: 20px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text);
}

.editable-list .editable-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  border-left: 4px solid transparent;
  position: relative;
}

.editable-line {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  width: 100%;
}

.editable-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 3;
  background: var(--panel);
  padding: 6px;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.item-text {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  display: flex;
}
.item-text p {
  margin: 0;
}
.item-text ul,
.item-text ol {
  margin: 0 0 0 18px;
  padding-left: 18px;
}

.inline-input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
}

.icon-chip {
  min-width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  padding: 0 8px;
}

.icon-chip:hover {
  border-color: var(--accent);
}

.drag-handle {
  color: var(--muted);
  cursor: grab;
  user-select: none;
  padding: 6px 6px 6px 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.drag-handle:active {
  cursor: grabbing;
}

.editable-item:hover .editable-actions,
.editable-item.is-editing .editable-actions {
  opacity: 1;
  pointer-events: auto;
}

.editable-item.drag-over {
  border-style: dashed;
  border-color: var(--accent);
}

.editable-item.completed .item-text {
  text-decoration: line-through;
  color: var(--muted);
}

.editable-item.completed {
  border-left-color: #22c55e;
}

.editable-item.current:not(.completed) {
  border-left-color: #ef4444;
}

.goal-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent);
}

.editable-list-add {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.editable-list-add input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font: inherit;
}

.goals-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.goals-header .header-left {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.goals-header .header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.goals-header .icon-btn.subtle {
  border: none;
  padding: 6px;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  transition: background 0.12s ease, color 0.12s ease;
}

.goals-header .icon-btn.subtle:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text);
}

.goals-header .icon-btn.subtle:active {
  transform: scale(0.98);
}

#goalsListAdd {
  min-width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: -10px;
}

#generateTopicsBtn {
  min-width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: -10px;
}

.topics-card .dash-list {
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.focus-view {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  min-height: 60px;
}

.focus-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  resize: vertical;
}

.rules-body {
  padding: 6px 2px 2px 0;
}

.rules-list {
  display: grid;
  gap: 8px;
  padding-left: 16px;
  color: var(--text);
}

.rules-list li {
  line-height: 1.4;
}

.graph-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.graph-legend {
  margin: 0 4px;
}

.wizard-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 2px 0 2px;
}

.wizard-meta .sep {
  color: var(--muted);
}

.wizard-meta input[type="number"] {
  width: 60px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
}

.graph-canvas {
  position: relative;
  min-height: 420px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--panel-2);
  overflow: hidden;
}

.graph-edges {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.graph-nodes {
  position: absolute;
  inset: 0;
}

.wall-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 10px;
}

.wall-column {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid #dbe0ea;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.lane-title {
  padding: 8px 10px;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 12px;
}

.lane-body {
  flex: 1;
  padding: 6px 8px 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.matrix-grid {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.08) 0%, rgba(148, 163, 184, 0.03) 100%);
  border: 1px solid #cbd5e1;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  pointer-events: none;
}

.matrix-axis {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #475569;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-weight: 700;
}

.matrix-axis-y {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  left: 8px;
  top: 16px;
  bottom: 16px;
  flex-direction: column;
  gap: 12px;
}

.matrix-axis-x {
  bottom: 8px;
  left: 16px;
  right: 16px;
  flex-direction: row;
  gap: 12px;
}

.matrix-quadrants {
  position: absolute;
  inset: 18px 18px 28px 32px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 8px;
}

.matrix-quadrants .quadrant {
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 600;
  color: #334155;
  background: rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

.path-grid {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: rgba(148, 163, 184, 0.05);
  pointer-events: none;
}

.path-cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 100%;
  height: 100%;
}

.path-cols::before,
.path-cols::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.path-cols > div {
  border-left: 1px dashed #cbd5e1;
  position: relative;
  padding: 10px;
  color: #475569;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 12px;
}

.path-cols > div:first-child {
  border-left: none;
}

.graph-node {
  position: absolute;
  min-width: 140px;
  max-width: 220px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #dbe0ea;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  cursor: grab;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.graph-node.cluster {
  border-color: #1a73e8;
  box-shadow: 0 12px 28px rgba(26, 115, 232, 0.18);
}

.graph-node:active {
  cursor: grabbing;
}

.graph-node-title {
  font-weight: 700;
  color: var(--text);
  word-break: break-word;
}

.graph-node-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.graph-parent-select {
  flex: 1;
  border: 1px solid #dbe0ea;
  border-radius: 8px;
  padding: 4px 6px;
  background: #f8fafc;
  color: var(--text);
  min-width: 120px;
}

.quiz-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
}

.quiz-item .dash-link {
  flex: 1;
  min-width: 0;
}

.quiz-list .quiz-item .stack.horizontal {
  margin-left: auto;
}

.depth-pill {
  font-weight: 700;
}
.depth-pill.low {
  background: rgba(250, 204, 21, 0.15);
  color: #854d0e;
  border-color: rgba(250, 204, 21, 0.35);
}
.depth-pill.mid {
  background: rgba(34, 197, 94, 0.14);
  color: #166534;
  border-color: rgba(34, 197, 94, 0.35);
}
.depth-pill.high {
  background: rgba(239, 68, 68, 0.14);
  color: #991b1b;
  border-color: rgba(239, 68, 68, 0.35);
}

.history-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: var(--panel);
}

.expand-toggle {
  margin-left: auto;
  align-self: flex-start;
  margin-top: -10px;
  min-width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #1f2937;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: transform 0.18s ease;
}

.expand-toggle:hover {
  background: transparent;
  border-color: transparent;
  transform: translateY(-1px);
}

.study-grid {
  transition: grid-template-columns 0.28s ease, gap 0.28s ease;
}

.study-grid.expanded-1,
.study-grid.expanded-2,
.study-grid.expanded-3,
.study-grid.expanded-4,
.study-grid.expanded-5,
.study-grid.expanded-6 {
  grid-template-columns: 2fr 1fr;
}

.study-grid.expanded-1 .dash-card:nth-child(1) {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.study-grid.expanded-1 .dash-card:nth-child(2) {
  grid-column: 2;
  grid-row: 1;
}

.study-grid.expanded-1 .dash-card:nth-child(3) {
  grid-column: 2;
  grid-row: 2;
}

.study-grid.expanded-2 .dash-card:nth-child(2) {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.study-grid.expanded-2 .dash-card:nth-child(1) {
  grid-column: 2;
  grid-row: 1;
}

.study-grid.expanded-2 .dash-card:nth-child(3) {
  grid-column: 2;
  grid-row: 2;
}

.study-grid.expanded-3 .dash-card:nth-child(3) {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.study-grid.expanded-3 .dash-card:nth-child(1) {
  grid-column: 2;
  grid-row: 1;
}

.study-grid.expanded-3 .dash-card:nth-child(2) {
  grid-column: 2;
  grid-row: 2;
}

.study-grid.expanded-4 .dash-card:nth-child(4) {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.study-grid.expanded-4 .dash-card:nth-child(1) {
  grid-column: 2;
  grid-row: 1;
}

.study-grid.expanded-4 .dash-card:nth-child(2) {
  grid-column: 2;
  grid-row: 2;
}

.study-grid.expanded-5 .dash-card:nth-child(5) {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.study-grid.expanded-5 .dash-card:nth-child(1) {
  grid-column: 2;
  grid-row: 1;
}

.study-grid.expanded-5 .dash-card:nth-child(2) {
  grid-column: 2;
  grid-row: 2;
}

.study-grid.expanded-6 .dash-card:nth-child(6) {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.study-grid.expanded-6 .dash-card:nth-child(1) {
  grid-column: 2;
  grid-row: 1;
}

.study-grid.expanded-6 .dash-card:nth-child(2) {
  grid-column: 2;
  grid-row: 2;
}

.small {
  font-size: 12px;
}

.login-hint {
  min-height: 16px;
}

@media (max-width: 960px) {
  .landing-hero {
    padding: 32px 0 56px;
  }

  .hero-grid {
    gap: 32px;
  }

  .benefit-section {
    margin: 0 -16px;
    padding: 52px 16px;
  }

  .feature-grid,
  .cabinet-preview,
  .dashboard-grid,
  .cabinet-stats,
  .plan-section {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 18px 12px 32px;
  }

  .landing-page .page-shell {
    padding: 18px 14px 44px;
  }

  .landing-header,
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .landing-hero {
    padding: 24px 0 46px;
  }

  .hero-grid {
    gap: 24px;
  }

  .logo-bubble {
    width: 180px;
    height: 180px;
  }

  .benefit-section {
    margin: 0 -12px;
    padding: 44px 12px;
  }

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

  .ready-block {
    padding: 28px 24px 32px;
  }

  .feature-grid,
  .cabinet-preview,
  .dashboard-grid,
  .cabinet-stats {
    grid-template-columns: 1fr;
  }

  .plan-section {
    grid-template-columns: 1fr;
  }

  .cabinet-header {
    flex-direction: column;
  }

  .landing-nav {
    width: 100%;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
  }
}


/* Model status indicator */
.model-status {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  margin-left: 8px;
}
.status-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #1f6feb;
  cursor: pointer;
  box-shadow: none;
}
.status-icon.success {
  color: #1b8f3c;
}
.status-icon.error {
  color: #d93025;
}
.status-popup {
  position: fixed;
  z-index: 9999;
  top: auto;
  right: auto;
  min-width: 240px;
  max-width: 360px;
  background: #fff;
  border: 1px solid #d0d4dc;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border-radius: 8px;
  padding: 10px 12px;
}
.status-text {
  font-size: 12px;
  color: #2f2f2f;
  max-height: 160px;
  overflow: auto;
  margin-bottom: 8px;
  white-space: pre-wrap;
  word-break: break-word;
}
.status-popup .small {
  font-size: 12px;
  padding: 6px 10px;
}
.status-popup:after {
  content: '';
  position: absolute;
  top: -6px;
  right: 16px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-left: 1px solid #d0d4dc;
  border-top: 1px solid #d0d4dc;
  transform: rotate(45deg);
}

body.readonly-view .composer, body.readonly-view #newDialogBtn, body.readonly-view .main-menu-button { display: none !important; }
body.readonly-view .session-menu-btn { display: none !important; }
.projects-hero h1 {
  margin: 0;
  color: #1f2937;
}

.projects-hero p {
  margin: 4px 0 0;
  color: #6b7280;
}

.projects-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0 6px;
  border-bottom: 1px solid #dfe3eb;
}

.projects-topnav {
  display: flex;
  gap: 18px;
  position: relative;
}

.topnav-btn {
  background: transparent;
  border: none;
  padding: 8px 0;
  font-weight: 600;
  color: #4b5563;
  position: relative;
}

.topnav-btn.active {
  color: #2f6ded;
}

.topnav-btn.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -13px;
  height: 4px;
  background: #2f6ded;
  border-radius: 6px;
  box-shadow: 0 6px 14px rgba(47, 109, 237, 0.3);
}

.projects-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 16px;
}

.pill-switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(180deg, #f9fbff, #f2f6fd);
  padding: 10px 16px;
  border-radius: 999px;
  border: 1.5px solid #d8e2f2;
  box-shadow: 0 18px 38px rgba(47, 109, 237, 0.18);
}

.pill-btn {
  border: none;
  background: transparent;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 700;
  color: #4a5166;
  font-size: 16px;
  transition: all 0.16s ease;
}

.pill-btn.active {
  background: #2f6ded;
  color: #fff;
  box-shadow: 0 14px 32px rgba(47, 109, 237, 0.32);
}

.view-toggle .pill-btn {
  padding: 8px 12px;
}

.filters-right {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  margin-left: auto;
  flex-wrap: wrap;
}

.ownership-toggle {
  display: inline-flex;
  gap: 6px;
}

.chip-btn {
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid #dbe0ea;
  background: #fff;
  color: #1f2937;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}

.chip-btn:hover {
  border-color: #b8c6e0;
  color: #0f172a;
}

.chip-btn.active {
  background: #2f6ded;
  color: #fff;
  border-color: #2f6ded;
  box-shadow: 0 10px 22px rgba(47, 109, 237, 0.25);
}

.projects-select {
  border: 1px solid #dbe0ea;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  color: #1f2937;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.05);
}

.projects-select.compact {
  padding: 8px 10px;
}

.projects-search {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.projects-search input {
  min-width: 280px;
}

.projects-search .icon-btn {
  padding: 6px;
  border-radius: 8px;
  color: #4b5563;
}
.projects-search .icon-btn:hover {
  color: #1f2937;
}

.filters-right input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #dbe0ea;
  background: #ffffff;
  color: #1f2937;
  min-width: 240px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.05);
}

.icon-btn {
  width: auto;
  height: auto;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: none;
  background: transparent;
  color: #1f2937;
  cursor: pointer;
  transition: color 0.12s ease, transform 0.12s ease;
  padding: 0;
  box-shadow: none;
  appearance: none;
}

.icon-btn .icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn.primary {
  color: #2f6ded;
}

.icon-btn.ghost {
  color: #4b5563;
}

.icon-btn:hover {
  transform: translateY(-1px);
  color: #2f6ded;
  background: transparent;
}

.view-icons {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 6px;
}

#newProjectBtn {
  background: transparent;
  border: none;
  box-shadow: none;
  color: #2f6ded;
  padding: 0 4px;
}
#newProjectBtn:hover {
  transform: translateY(-1px);
  color: #1d4ed8;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 260px);
  gap: 16px;
  justify-content: start;
}

.projects-grid.list-view {
  display: flex;
  flex-direction: column;
}

.projects-grid.cards-view,
.projects-row {
  grid-template-columns: repeat(auto-fill, 260px);
  justify-content: start;
}

.project-card {
  border: 1px solid #e4e8f0;
  border-radius: 12px;
  padding: 0;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  position: relative;
  padding-bottom: 44px;
}

.projects-grid.cards-view .project-card,
.projects-row .project-card {
  width: 260px;
}

.project-card:hover {
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.project-card.selected {
  border-color: #2f6ded;
  box-shadow: 0 16px 36px rgba(47, 109, 237, 0.18);
}

.project-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #eef3ff;
  color: #2f6ded;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
}

.project-cover {
  height: 150px;
  border-radius: 12px 12px 0 0;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

.project-type-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.86);
  border-radius: 12px;
  padding: 6px 10px;
  font-weight: 700;
  color: #2f6ded;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.badge-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border-radius: 50%;
  background: #eef3ff;
  color: #2f6ded;
}

.project-body {
  padding: 0 12px 2px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project-title {
  font-weight: 800;
  font-size: 15px;
  color: #1f2937;
}

.project-desc {
  font-size: 14px;
  color: #4b5563;
}

.project-footer {
  position: absolute;
  right: 10px;
  bottom: 10px;
}

.project-footer-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.projects-grid.list-view .project-card {
  flex-direction: row;
  align-items: center;
  width: 100%;
  padding-bottom: 36px;
}
.projects-grid.list-view .project-cover {
  width: 120px;
  border-radius: 10px;
}
.projects-grid.list-view .project-body {
  flex: 1;
}

.projects-lists {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.projects-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.projects-subheader {
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 12px;
}

.projects-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, 260px);
  gap: 16px;
  justify-content: start;
}

.projects-divider {
  height: 1px;
  background: #e5e7eb;
}

.all-projects-wrap {
  max-height: 420px;
  overflow-y: auto;
  padding-right: 6px;
}

/* Brainstorm page */
body.brainstorm-page {
  background: #f6f8fb;
  color: #0f172a;
}

.brainstorm-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 72px;
}

.brainstorm-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  box-shadow: 0 16px 36px rgba(14, 30, 72, 0.08);
}

.topbar-left h1 {
  margin: 4px 0 6px;
  font-size: 28px;
  line-height: 1.24;
  font-weight: 500;
  color: #3c4653;
}

.topbar-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  justify-content: flex-end;
}

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

.timer-row {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

.brainstorm-page .pill-btn,
.brainstorm-page .icon-pill {
  border: 1px solid #d9e3f2;
  background: #ffffff;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 15px;
  color: #0f172a;
  cursor: pointer;
  transition: all 0.16s ease;
  box-shadow: 0 10px 26px rgba(14, 30, 72, 0.08);
}

.brainstorm-page .pill-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(14, 30, 72, 0.12);
}

.brainstorm-page .pill-btn.primary {
  background: #2f6ded;
  border-color: #2f6ded;
  color: #ffffff;
}

.share-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-inline: 18px;
  border-radius: 999px;
  font-weight: 700;
}

.share-button .share-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brainstorm-page .pill-btn.secondary {
  background: #1a73e8;
  border-color: #1a73e8;
  color: #ffffff;
}

.brainstorm-page .pill-btn.ghost {
  background: transparent;
  border-color: #e2e8f0;
  color: #0f172a;
  box-shadow: none;
}

.share-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.share-caption {
  font-size: 12px;
}

.timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: #5b6470;
  font-weight: 500;
  font-size: 20px;
  letter-spacing: 0.01em;
  box-shadow: none;
}

.timer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #5b6470;
  transform: translateY(1px);
}

.timer-icon svg {
  display: block;
  width: 22px;
  height: 22px;
}

.brainstorm-hero {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: 0 12px 28px rgba(14, 30, 72, 0.06);
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.brainstorm-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid #e5e7eb;
  margin: 22px 0 12px;
}

.brainstorm-tab {
  border: none;
  background: transparent;
  padding: 12px 14px;
  font-weight: 500;
  font-size: 24px;
  color: #6b7280;
  cursor: pointer;
  position: relative;
}

.brainstorm-tab.active {
  color: #1a73e8;
}

.brainstorm-tab.active::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -2px;
  height: 6px;
  border-radius: 0;
  background: #1a73e8;
}

.brainstorm-panels {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.brainstorm-panel {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 16px 38px rgba(14, 30, 72, 0.08);
}

.brainstorm-page .small {
  font-size: 13px;
  line-height: 1.4;
}

.focus-editor {
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.pill-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  padding: 12px 16px;
  background: #ffffff;
  box-shadow: inset 0 1px 0 #f8fafc, 0 12px 32px rgba(14, 30, 72, 0.06);
  min-width: 320px;
}

.focus-editor .pill-field {
  width: 60%;
  max-width: 100%;
  margin: 0 auto;
}

.pill-field input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 16px;
  flex: 1;
  min-width: 0;
  color: #0f172a;
}

.pill-field .icon {
  font-size: 16px;
  color: #6b7280;
}

.pill-field.grow {
  width: 100%;
}

.idea-creator {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.ideas-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.idea-card {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px 16px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(14, 30, 72, 0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.idea-card.drag-over {
  border-color: #1a73e8;
}

.idea-text {
  font-weight: 400;
  display: inline-flex;
  align-items: center;
}

.idea-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.idea-meta-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.idea-time {
  font-size: 12px;
  color: #6b7280;
}

.idea-inline-input {
  width: 100%;
  font-size: 15px;
  font-weight: 400;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(14, 30, 72, 0.08);
}

.cluster-inline-input {
  width: 100%;
  font-size: 15px;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(14, 30, 72, 0.08);
}

.idea-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 8px 0 0;
  align-self: center;
  cursor: grab;
  color: #94a3b8;
}

.idea-drag-handle svg {
  width: 18px;
  height: 18px;
  display: block;
}

.idea-drag-handle:active {
  cursor: grabbing;
}

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

.idea-tag-btn {
  border: 1px solid #cbd5e1;
  background: #eef2ff;
  color: #1d4ed8;
  border-radius: 12px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.idea-stars {
  display: inline-flex;
  gap: 2px;
}

.star-btn {
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  color: #f7b500;
  padding: 0 2px;
  line-height: 1;
}

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

.idea-footer-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lane-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lane-head-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cluster-color-bar {
  display: inline-block;
  width: 6px;
  height: 18px;
  border-radius: 0;
  margin-right: 6px;
  align-self: center;
}

.cluster-dropzone {
  margin-top: 8px;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  color: #64748b;
  background: #f8fafc;
}

.cluster-dropzone.drag-over {
  border-color: #1a73e8;
  color: #1a73e8;
  background: #eef3ff;
}

.cluster-nested.drag-over {
  border: 1px dashed #1a73e8;
  border-radius: 10px;
  padding: 6px;
}

.lane-card.cluster.drag-over {
  border-color: #1a73e8;
}

.pill.tiny {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  cursor: pointer;
}

.pill.tiny.ghost {
  background: transparent;
}

.idea-ai {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.lanes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.lane {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 12px 30px rgba(14, 30, 72, 0.08);
}

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

.lane-title {
  font-weight: 700;
}

.lane-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lane-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(14, 30, 72, 0.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lane-card.cluster {
  background: #f1f5f9;
}

.lane-card.muted {
  color: #6b7280;
}

.lane-card-title,
.lane-title-row {
  font-weight: 500;
}

.lane-card-title {
  display: inline-flex;
  align-items: center;
}

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

.lane-select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  font-weight: 600;
}

.idea-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #dfe3ea;
  font-size: 13px;
  box-shadow: 0 8px 18px rgba(14, 30, 72, 0.08);
}

.idea-chip-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cluster-nested {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.top-card {
  border-color: #2f6ded;
  box-shadow: 0 12px 30px rgba(47, 109, 237, 0.18);
}

.board-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
}

.board-sidebar {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.sidebar-title {
  font-weight: 800;
}

.sidebar-subtitle {
  font-weight: 700;
  color: #0f172a;
  font-size: 14px;
}

.sidebar-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: #1a73e8;
  color: #ffffff;
  font-weight: 700;
  width: fit-content;
}

.legend-list,
.hints-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #4b5563;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 6px;
  background: #1d4ed8;
}

.legend-dot.pro {
  background: #22c55e;
}

.legend-dot.con {
  background: #ef4444;
}

.legend-dot.risk {
  background: #f97316;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.board-main {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 16px 32px rgba(14, 30, 72, 0.08);
  display: flex;
  flex-direction: column;
  min-height: 640px;
}

.board-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
}

.toolbar-right {
  display: flex;
  gap: 8px;
}

.graph-stage {
  position: relative;
  flex: 1;
  background-image:
    linear-gradient(#e5e7eb 1px, transparent 1px),
    linear-gradient(90deg, #e5e7eb 1px, transparent 1px);
  background-size: 36px 36px;
  border-radius: 0 0 16px 16px;
  overflow: hidden;
}

.graph-edges {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.graph-nodes {
  position: absolute;
  inset: 0;
}

.graph-node {
  position: absolute;
  min-width: 180px;
  max-width: 240px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #dbe1eb;
  box-shadow: 0 12px 26px rgba(14, 30, 72, 0.16);
  cursor: grab;
}

.graph-node.cluster {
  border-left: 4px solid #1a73e8;
}

.graph-node[data-tone="pro"] {
  border-left: 4px solid #22c55e;
}

.graph-node[data-tone="con"] {
  border-left: 4px solid #ef4444;
}

.graph-node[data-tone="risk"] {
  border-left: 4px solid #f97316;
}

.graph-node-title {
  font-weight: 800;
  margin-bottom: 6px;
}

.graph-node-detail {
  color: #4b5563;
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 6px;
}

.graph-node-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 700;
  font-size: 12px;
}

.graph-inline-input {
  width: 100%;
  border: 1px solid #dbe1eb;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 15px;
  font-weight: 600;
  outline: none;
  box-shadow: 0 8px 18px rgba(14, 30, 72, 0.14);
}

.cluster-toggle {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #d5dbe7;
  font-weight: 700;
  line-height: 1;
  color: #0f172a;
  box-shadow: 0 6px 16px rgba(14, 30, 72, 0.12);
  opacity: 0;
  pointer-events: auto;
  z-index: 3;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.graph-node.cluster:hover .cluster-toggle,
.cluster-toggle:hover {
  opacity: 1;
  transform: translateY(-2px);
}

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

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

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 700;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  color: #374151;
}

.tag.ghost {
  background: #ffffff;
}

.matrix-board {
  position: relative;
  height: 620px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: inset 0 1px 0 #ffffff, 0 16px 38px rgba(14, 30, 72, 0.08);
  background-image:
    linear-gradient(#e5e7eb 1px, transparent 1px),
    linear-gradient(90deg, #e5e7eb 1px, transparent 1px);
  background-repeat: no-repeat;
  background-size: 100% 1px, 1px 100%;
  background-position: 0 50%, 50% 0;
}

.axis {
  position: absolute;
  font-weight: 700;
  color: #6b7280;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.axis.y-axis {
  top: 16px;
  left: 16px;
  height: calc(100% - 32px);
  width: 18px;
  flex-direction: column;
  align-items: flex-start;
}

.axis.x-axis {
  bottom: 16px;
  left: 120px;
  width: calc(100% - 240px);
}

.quadrant-label {
  position: absolute;
  font-weight: 800;
  color: #9ca3af;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.quadrant-label.tl {
  top: 28px;
  left: 140px;
}

.quadrant-label.tr {
  top: 28px;
  right: 140px;
}

.quadrant-label.bl {
  bottom: 42px;
  left: 140px;
}

.quadrant-label.br {
  bottom: 42px;
  right: 140px;
}

.matrix-card {
  position: absolute;
  width: 240px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 12px 14px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(14, 30, 72, 0.12);
  cursor: grab;
}

.matrix-title {
  font-weight: 800;
  margin-bottom: 6px;
}

.matrix-detail {
  color: #4b5563;
  font-size: 13px;
  line-height: 1.4;
}

@media (max-width: 960px) {
  .brainstorm-shell {
    padding: 18px 14px 48px;
  }

  .brainstorm-tabs {
    flex-wrap: wrap;
  }

  .board-shell {
    grid-template-columns: 1fr;
  }

  .matrix-board {
    height: 520px;
  }
}


.new-project-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}



.new-project-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.projects-empty-tooltip {
  position: absolute;
  top: 48px;
  right: 0;
  z-index: 6;
  background: #0f172a;
  color: #fff;
  padding: 14px 16px;
  border-radius: 12px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.18);
  font-size: 13px;
  width: 280px;
  line-height: 1.45;
}

.projects-empty-tooltip .tour-step-header {
  font-weight: 700;
  margin-bottom: 6px;
}

.projects-empty-tooltip .tour-step-body {
  color: #e5e7eb;
}

.projects-empty-tooltip .tour-step-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-start;
}

.projects-empty-tooltip .tour-arrow {
  position: absolute;
  top: -8px;
  right: 22px;
  width: 14px;
  height: 14px;
  background: #0f172a;
  transform: rotate(45deg);
  box-shadow: -2px -2px 6px rgba(0, 0, 0, 0.16);
}

.projects-empty-tooltip.hidden {
  display: none;
}


#projectsEmptyPromo {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  margin: 100px -24px 48px;
  background: #f7f9fc;
}
#projectsEmptyPromo.hidden {
  display: none;
}
#projectsEmptyPromo .promo-hero {
  text-align: center;
}
#projectsEmptyPromo .promo-hero h2 {
  margin: 0 0 8px;
  font-size: 24px;
}
#projectsEmptyPromo .promo-hero .muted {
  margin: 0;
}
#projectsEmptyPromo .promo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
#projectsEmptyPromo .promo-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  padding: 10px 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
}
#projectsEmptyPromo .promo-title {
  font-weight: 400;
  margin-bottom: 10px;
  font-size: 22px;
  color: #4b5563;
  display: inline-block;
  padding-bottom: 4px;
  border-bottom: 5px solid transparent;
}
#projectsEmptyPromo .promo-text {
  color: #4b5563;
  line-height: 1.45;
  font-size: 13px;
}
#projectsEmptyPromo .promo-list {
  margin: 0;
  padding-left: 18px;
  color: #4b5563;
  line-height: 1.45;
  font-size: 13px;
  display: grid;
  gap: 6px;
}
#projectsEmptyPromo .promo-card:nth-child(1) .promo-title {
  border-bottom-color: #62c554; /* green */
}
#projectsEmptyPromo .promo-card:nth-child(2) .promo-title {
  border-bottom-color: #f6b93b; /* warm yellow/orange */
}
#projectsEmptyPromo .promo-card:nth-child(3) .promo-title {
  border-bottom-color: #b5651d; /* warm brown */
}
#projectsEmptyPromo .promo-card:nth-child(4) .promo-title {
  border-bottom-color: #4f46e5; /* indigo */
}
#projectsEmptyPromo .promo-card:nth-child(5) .promo-title {
  border-bottom-color: #059669; /* green teal */
}

/* Study plan / learning graph page */
.study-plan-page .study-plan-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.study-plan-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.study-plan-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.study-plan-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
}

.study-plan-tab {
  border: none;
  background: transparent;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  position: relative;
}

.study-plan-tab.active {
  color: var(--accent);
}

.study-plan-tab.active::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -2px;
  height: 3px;
  background: var(--accent);
}

.study-plan-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.study-plan-search {
  min-width: 220px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
}

.study-plan-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

@media (max-width: 980px) {
  .study-plan-layout {
    grid-template-columns: 1fr;
  }
}

.study-plan-main {
  min-width: 0;
}

.study-plan-details {
  min-width: 0;
}

.study-plan-state {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
}

.study-plan-views {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.study-plan-view-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.study-plan-view-title {
  font-weight: 800;
  color: var(--text);
}

.study-plan-view-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.study-plan-graph {
  width: 100%;
  height: min(72vh, 720px);
  min-height: 560px;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: var(--panel);
}

.study-plan-page .study-plan-graph-stage {
  width: 100%;
  height: 100%;
  overflow: auto;
  border-radius: 18px;
}

.study-plan-page .study-plan-graph-world {
  min-width: 100%;
  min-height: 100%;
}

.study-plan-page .graph-node.is-selected {
  outline: 3px solid rgba(26, 115, 232, 0.35);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12), 0 12px 26px rgba(14, 30, 72, 0.16);
}

.study-plan-roadmap,
.study-plan-readiness,
.study-plan-list {
  background: transparent;
  min-height: 240px;
}

.details-card {
  position: sticky;
  top: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  padding: 16px;
  box-shadow: var(--shadow-soft);
  max-height: calc(100vh - 120px);
  overflow: auto;
}

.details-title {
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text);
}

.details-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.details-kv {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.details-kv > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.details-k {
  font-size: 12px;
  color: var(--muted);
}

.details-v {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-align: right;
}

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

.details-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.details-section-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
}

.details-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.link-btn {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
  text-align: left;
}

.link-btn:hover {
  text-decoration: underline;
}

.study-plan-page .pill {
  margin-left: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pill-strong {
  background: rgba(26, 115, 232, 0.12);
  border-color: rgba(26, 115, 232, 0.28);
  color: #1a73e8;
}

.pill-soft {
  background: rgba(100, 116, 139, 0.12);
  border-color: rgba(100, 116, 139, 0.25);
  color: #64748b;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.status-mastered {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.32);
  color: #16a34a;
}

.status-in_progress {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.32);
  color: #b45309;
}

.status-not_started {
  background: rgba(100, 116, 139, 0.10);
  border-color: rgba(100, 116, 139, 0.22);
  color: #64748b;
}

.status-blocked {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.30);
  color: #dc2626;
}

.roadmap-stages {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.roadmap-stage {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  padding: 16px;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

.roadmap-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.roadmap-title {
  font-weight: 800;
  color: var(--text);
}

.roadmap-progress {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.roadmap-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

@media (max-width: 780px) {
  .roadmap-columns {
    grid-template-columns: 1fr;
  }
}

.roadmap-subtitle {
  font-weight: 700;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.roadmap-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.roadmap-unlocks {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.readiness-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.readiness-title {
  font-weight: 800;
  color: var(--text);
}

.readiness-pill {
  border-radius: 999px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  font-weight: 800;
  font-size: 12px;
}

.pill-ready {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.32);
  color: #16a34a;
}

.pill-warn {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.32);
  color: #b45309;
}

.pill-danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.32);
  color: #dc2626;
}

.readiness-section {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.readiness-subtitle {
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--text);
}

.readiness-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.readiness-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.readiness-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.readiness-kind {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}

.readiness-kind.hard {
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.25);
  color: #dc2626;
}

.readiness-kind.soft {
  background: rgba(26, 115, 232, 0.10);
  border-color: rgba(26, 115, 232, 0.25);
  color: #1a73e8;
}

.readiness-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.library-table {
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.library-row {
  display: grid;
  grid-template-columns: 2.2fr 1.4fr 1.2fr 0.9fr 0.7fr 0.9fr 0.6fr 0.8fr;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.library-head {
  background: var(--panel-2);
  font-weight: 800;
  color: var(--text);
}

.library-body {
  max-height: 70vh;
  overflow: auto;
}

.library-row:not(.library-head):hover {
  background: rgba(26, 115, 232, 0.05);
  cursor: pointer;
}

.library-topic {
  font-weight: 700;
  color: var(--text);
}

.study-plan-tooltip {
  position: fixed;
  z-index: 1000;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
  font-size: 12px;
  max-width: 320px;
  pointer-events: none;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}
