/* ========================================
   StoaBoard — Design System
   ======================================== */

/* Animations */
@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}
@keyframes loading-breathe {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(0.93); }
}
@keyframes loading-bar {
  0%   { transform: translateX(-100%) scaleX(0.4); }
  50%  { transform: translateX(40%)   scaleX(0.9); }
  100% { transform: translateX(140%)  scaleX(0.4); }
}
@keyframes loading-fadein {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Loading Screen ──────────────────────────────────────────────────────── */
.loading-screen {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
.loading-content {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  animation: loading-fadein 0.45s ease both;
}
.loading-logo-wrap {
  width: 72px; height: 72px; border-radius: 20px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 36px color-mix(in srgb, var(--accent) 35%, transparent);
  animation: loading-breathe 2s ease-in-out infinite;
}
.loading-brand {
  font-size: 26px;
  font-family: var(--font-display);
  color: var(--ink);
  letter-spacing: -0.02em;
}
.loading-brand em { font-style: italic; color: var(--accent); }
.loading-bar-wrap {
  width: 100px; height: 3px; border-radius: 2px;
  background: var(--bg-subtle); overflow: hidden;
}
.loading-bar {
  height: 100%; border-radius: 2px;
  background: var(--accent);
  animation: loading-bar 1.5s ease-in-out infinite;
}

/* ── Notification preference groups ─────────────────────────────────────── */
.notif-pref-group {
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 10px;
}
.notif-pref-group:last-of-type { border-bottom: none; margin-bottom: 0; }
.notif-pref-title {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--ink-faint);
  margin-bottom: 8px;
}
.tweak-toggle-info {
  display: flex; flex-direction: column; gap: 2px; flex: 1;
}
.tweak-toggle-info > span:first-child { font-size: 13px; color: var(--ink); }
.tweak-toggle-desc { font-size: 11px; color: var(--ink-muted); }
.notif-pref-note {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--ink-faint);
  padding: 6px 0 2px;
}

/* ── Toast stack ── */
.toast-stack {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
  max-width: 340px;
}
.toast-item {
  background: var(--bg-raised);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  pointer-events: auto;
  cursor: pointer;
  animation: toastIn 0.25s var(--ease) both;
  transition: opacity 0.2s, transform 0.2s;
}
.toast-item:hover { opacity: 0.9; }
.toast-error { border-color: var(--status-rose); }
.toast-success { border-color: var(--status-green); }
.toast-msg-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
}
.toast-msg-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.toast-msg-channel {
  font-size: 11px;
  color: var(--accent);
  flex: 1;
}
.toast-msg-time {
  font-size: 11px;
  color: var(--ink-dim);
}
.toast-msg-text {
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.45;
  word-break: break-word;
}
.toast-see-more {
  color: var(--accent);
  font-size: 12px;
  white-space: nowrap;
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(20px) scale(0.95); }
}

:root {
  /* Type */
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Default theme: LIGHT */
  --bg: #fafaf7;
  --bg-raised: #ffffff;
  --bg-subtle: #f3f2ed;
  --bg-sunken: #ededea;
  --ink: #1a1a17;
  --ink-2: #3a3a36;
  --ink-muted: #76766f;
  --ink-faint: #a8a8a0;
  --ink-dim: #c4c4bc;
  --line: #e5e4df;
  --line-strong: #d4d3ce;

  /* Accent — terracotta */
  --accent: oklch(55% 0.13 25);
  --accent-soft: oklch(55% 0.13 25 / 0.10);
  --accent-softer: oklch(55% 0.13 25 / 0.05);
  --accent-ink: oklch(40% 0.10 25);

  /* Semantic */
  --status-blue: oklch(55% 0.09 230);
  --status-amber: oklch(65% 0.11 70);
  --status-rose: oklch(58% 0.13 10);
  --status-green: oklch(55% 0.09 150);
  --status-yellow: oklch(72% 0.14 75);
  --status-slate: oklch(55% 0.02 250);
  --status-purple: oklch(55% 0.14 300);
  --status-teal:   oklch(55% 0.10 195);
  --status-orange: oklch(62% 0.14 50);
  --status-cyan:   oklch(60% 0.10 210);
  --status-pink:   oklch(60% 0.14 350);

  /* Shadows — physical, soft */
  --shadow-xs: 0 1px 2px rgba(20, 18, 12, 0.03);
  --shadow-sm: 0 1px 2px rgba(20, 18, 12, 0.04), 0 2px 6px rgba(20, 18, 12, 0.04);
  --shadow-md: 0 2px 4px rgba(20, 18, 12, 0.05), 0 8px 24px rgba(20, 18, 12, 0.06);
  --shadow-lg: 0 4px 8px rgba(20, 18, 12, 0.06), 0 24px 48px rgba(20, 18, 12, 0.10);

  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-snap: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Density */
  --card-pad: 14px;
  --card-gap: 10px;
  --col-w: 292px;
}

/* Theme: cream editorial */
[data-theme="cream"] {
  --bg: #f4f1ec;
  --bg-raised: #fbf9f4;
  --bg-subtle: #ecE8e0;
  --bg-sunken: #e4dfd5;
  --ink: #231f1a;
  --ink-2: #4a4238;
  --ink-muted: #7d7366;
  --ink-faint: #a89f90;
  --ink-dim: #c8bfae;
  --line: #dfd7c8;
  --line-strong: #cfc5b3;
}

/* Theme: dark */
[data-theme="dark"] {
  --bg: #111110;
  --bg-raised: #1a1a18;
  --bg-subtle: #1f1f1d;
  --bg-sunken: #0c0c0b;
  --ink: #ededea;
  --ink-2: #c8c8c2;
  --ink-muted: #8a8a82;
  --ink-faint: #5a5a54;
  --ink-dim: #3e3e38;
  --line: #2b2b28;
  --line-strong: #3a3a36;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 6px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.3), 0 24px 48px rgba(0, 0, 0, 0.5);
}

/* Accent variations — light theme */
[data-accent="sage"]     { --accent: oklch(55% 0.09 150); --accent-soft: oklch(55% 0.09 150 / 0.10); --accent-softer: oklch(55% 0.09 150 / 0.05); --accent-ink: oklch(40% 0.08 150); }
[data-accent="slate"]    { --accent: oklch(50% 0.04 250); --accent-soft: oklch(50% 0.04 250 / 0.10); --accent-softer: oklch(50% 0.04 250 / 0.05); --accent-ink: oklch(35% 0.04 250); }
[data-accent="indigo"]   { --accent: oklch(52% 0.15 270); --accent-soft: oklch(52% 0.15 270 / 0.10); --accent-softer: oklch(52% 0.15 270 / 0.05); --accent-ink: oklch(38% 0.13 270); }
[data-accent="plum"]     { --accent: oklch(50% 0.14 340); --accent-soft: oklch(50% 0.14 340 / 0.10); --accent-softer: oklch(50% 0.14 340 / 0.05); --accent-ink: oklch(35% 0.12 340); }

/* Accent variations — dark theme (higher lightness for visibility on dark bg) */
[data-theme="dark"]                      { --accent: oklch(72% 0.14 25);  --accent-soft: oklch(72% 0.14 25 / 0.15);  --accent-softer: oklch(72% 0.14 25 / 0.08);  --accent-ink: #fff; }
[data-theme="dark"][data-accent="sage"]  { --accent: oklch(70% 0.10 150); --accent-soft: oklch(70% 0.10 150 / 0.15); --accent-softer: oklch(70% 0.10 150 / 0.08); --accent-ink: #fff; }
[data-theme="dark"][data-accent="slate"] { --accent: oklch(68% 0.06 250); --accent-soft: oklch(68% 0.06 250 / 0.15); --accent-softer: oklch(68% 0.06 250 / 0.08); --accent-ink: #fff; }
[data-theme="dark"][data-accent="indigo"]{ --accent: oklch(70% 0.17 270); --accent-soft: oklch(70% 0.17 270 / 0.15); --accent-softer: oklch(70% 0.17 270 / 0.08); --accent-ink: #fff; }
[data-theme="dark"][data-accent="plum"]  { --accent: oklch(70% 0.16 340); --accent-soft: oklch(70% 0.16 340 / 0.15); --accent-softer: oklch(70% 0.16 340 / 0.08); --accent-ink: #fff; }

/* Font pair options */
[data-fontpair="fraunces"] { --font-display: 'Fraunces', 'Times New Roman', serif; }
[data-fontpair="sans"]     { --font-display: 'Inter', sans-serif; --font-display-weight: 600; }

/* Density */
[data-density="compact"]  { 
  --card-pad: 6px; 
  --card-gap: 2px; 
  --col-w: 240px;
  --r-md: 6px;
  --shadow-sm: none;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: -0.3px;
}
[data-density="balanced"] {
  --card-pad: 14px;
  --card-gap: 10px;
  --col-w: 292px;
  --r-md: 10px;
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.08);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0px;
}
[data-density="airy"]     { 
  --card-pad: 24px; 
  --card-gap: 18px; 
  --col-w: 340px;
  --r-md: 14px;
  --shadow-sm: 0 4px 12px rgba(0,0,0,0.12);
  font-size: 14.5px;
  line-height: 1.7;
  letter-spacing: 0.2px;
}

/* Density: List table adjustments */
[data-density="compact"] .list-table th,
[data-density="compact"] .list-table td { padding: 4px 8px; font-size: 12px; }
[data-density="compact"] .list-group-header { padding: 4px 8px; font-size: 11px; gap: 4px; }

[data-density="airy"] .list-table th,
[data-density="airy"] .list-table td { padding: 14px 16px; font-size: 14px; }
[data-density="airy"] .list-group-header { padding: 12px 16px; font-size: 13px; gap: 12px; }

/* Density: Modal and field adjustments */
[data-density="compact"] .modal-content { padding: 12px; gap: 8px; }
[data-density="airy"] .modal-content { padding: 28px; gap: 16px; }

[data-density="compact"] .field-row { gap: 6px; margin: 8px 0; }
[data-density="airy"] .field-row { gap: 12px; margin: 16px 0; }

/* ========================================
   Reset
   ======================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  height: 100%;
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; cursor: pointer; background: none; border: none; color: inherit; }
input, textarea, select { font-family: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

::selection { background: color-mix(in oklch, var(--accent) 28%, transparent); color: var(--accent-ink); }
[data-theme="dark"] ::selection { background: color-mix(in oklch, var(--accent) 32%, transparent); color: var(--ink); }

/* ── Non-selectable UI chrome ─────────────────────────────────────────── */
/* Shell navigation, labels, meta — users can't accidentally select these */
.sidebar,
.sidebar-logo-text,
.topbar,
.topbar-crumbs,
.topbar-right,
.workspace-switcher,
.user-profile,
.nav-item,
.project-item,
.sidebar-section-title,
.sidebar-header,
.sidebar-search kbd,
.col-header,
.col-actions,
.col-count,
.col-dot,
.card-tags,
.card-meta,
.card-footer,
.priority-pill,
.meta-item,
.modal-head,
.modal-foot,
.modal-title,
.modal-sub,
.settings-section > div:first-child,
.settings-section > div:first-child h3,
.settings-section > div:first-child p,
.tweak-group .tweak-label,
.tweak-options,
.tweak-toggle,
.swatch-row,
.avatar,
.avatar-stack,
.chip,
.btn,
.icon-btn,
.view-switch,
.auth-tabs,
.badge,
.nav-badge,
.tag,
.ws-info,
.ws-avatar,
.ws-arrow,
.col-menu-info,
.col-menu-divider,
.list-group-header,
.dashboard-stat,
.toast-message-meta {
  user-select: none;
}

/* Always re-enable selection inside inputs, textareas, editable content */
input, textarea, select, [contenteditable="true"] {
  user-select: text;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ink-dim); border-radius: 10px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }

/* ========================================
   App Shell
   ======================================== */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.app[data-auth="true"] {
  flex-direction: column;
}

/* ── SIDEBAR ── */
.sidebar {
  width: 252px;
  background: var(--bg-subtle);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transition: width 0.3s var(--ease);
  overflow: hidden;
  position: relative;
}
/* ── Collapsed sidebar ─────────────────────────────────────────── */
.sidebar[data-collapsed="true"] { width: 60px; }

/* Hide all text labels */
.sidebar[data-collapsed="true"] .sidebar-label,
.sidebar[data-collapsed="true"] .sidebar-section-title,
.sidebar[data-collapsed="true"] .ws-info,
.sidebar[data-collapsed="true"] .ws-arrow,
.sidebar[data-collapsed="true"] .nav-badge,
.sidebar[data-collapsed="true"] .project-meta,
.sidebar[data-collapsed="true"] .user-meta,
.sidebar[data-collapsed="true"] .sidebar-logo-text { display: none; }

/* Hide search bar & workspace switcher completely */
.sidebar[data-collapsed="true"] .sidebar-search,
.sidebar[data-collapsed="true"] .workspace-switcher { display: none; }

/* Header: just the logo centered */
.sidebar[data-collapsed="true"] .sidebar-header {
  justify-content: center;
  padding: 14px 0 10px;
  gap: 0;
}
.sidebar[data-collapsed="true"] .sidebar-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  cursor: pointer;
}
.sidebar[data-collapsed="true"] .sidebar-collapse-btn { display: none; }

/* Sections */
.sidebar[data-collapsed="true"] .sidebar-section { padding: 2px 8px; }

/* Nav & project items: centered icon pill */
.sidebar[data-collapsed="true"] .nav-item,
.sidebar[data-collapsed="true"] .project-item {
  justify-content: center;
  padding: 8px 0;
  width: 44px;
  margin: 1px auto;
  border-radius: 9px;
}

/* Project-dot bigger so it's visible */
.sidebar[data-collapsed="true"] .project-dot {
  width: 10px;
  height: 10px;
}

/* Footer */
.sidebar[data-collapsed="true"] .user-profile { justify-content: center; padding: 8px 0; }
.sidebar[data-collapsed="true"] .sidebar-footer { padding: 10px 8px; }
/* ────────────────────────────────────────────────────────────── */

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 14px;
}
.sidebar-logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--accent);
  color: white;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
[data-theme="dark"] .sidebar-logo { background: var(--accent); }
.sidebar-logo-text {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: -0.01em;
  line-height: 1;
}
.sidebar-logo-text em { font-style: italic; color: var(--accent-ink); }
[data-theme="dark"] .sidebar-logo-text em { color: var(--accent); }
.sidebar-collapse-btn {
  margin-left: auto;
  padding: 5px;
  border-radius: 5px;
  color: var(--ink-muted);
  display: grid;
  place-items: center;
}
.sidebar-collapse-btn:hover { background: var(--bg-sunken); color: var(--ink); }

.workspace-switcher {
  margin: 0 12px 12px;
  padding: 9px 10px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.15s var(--ease);
}
.workspace-switcher:hover { border-color: var(--line-strong); box-shadow: var(--shadow-xs); }
.ws-avatar {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--accent), oklch(from var(--accent) calc(l - 0.1) c h));
  color: white;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 13px;
  flex-shrink: 0;
}
.ws-info { flex: 1; min-width: 0; }
.ws-name { font-size: 12.5px; font-weight: 500; }
.ws-sub { font-size: 11px; color: var(--ink-muted); }
.ws-arrow { color: var(--ink-faint); display: flex; }

.sidebar-search {
  margin: 0 12px 12px;
  padding: 7px 10px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-muted);
  cursor: text;
  transition: border-color 0.15s var(--ease);
}
.sidebar-search:hover { border-color: var(--line-strong); }
.sidebar-search kbd {
  margin-left: auto;
  padding: 1px 5px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-muted);
}

.sidebar-section { padding: 6px 12px; }
.sidebar-section-title {
  padding: 10px 10px 4px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-section-title button {
  color: var(--ink-faint);
  display: grid;
  place-items: center;
  padding: 2px;
  border-radius: 4px;
}
.sidebar-section-title button:hover { background: var(--bg-sunken); color: var(--ink); }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--ink-2);
  transition: all 0.12s var(--ease);
  cursor: pointer;
  position: relative;
}
.nav-item:hover { background: var(--bg-sunken); color: var(--ink); }
.nav-item[data-active="true"] {
  background: var(--bg-raised);
  color: var(--ink);
  font-weight: 500;
  box-shadow: var(--shadow-xs);
}
.nav-item .icon { color: var(--ink-muted); flex-shrink: 0; }
.nav-item[data-active="true"] .icon { color: var(--accent); }
.nav-badge {
  margin-left: auto;
  padding: 1px 6px;
  background: var(--bg-sunken);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-muted);
}
.nav-badge[data-new="true"] {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
[data-theme="dark"] .nav-badge[data-new="true"] { color: var(--accent); }

.project-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.12s var(--ease);
}
.project-item:hover { background: var(--bg-sunken); }
.project-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.project-meta {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--r-md);
  cursor: pointer;
}
.user-profile:hover { background: var(--bg-sunken); }
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
}
[data-theme="dark"] .user-avatar { background: var(--accent); color: white; }
.user-meta { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 500; }
.user-status { font-size: 11px; color: var(--ink-muted); display: flex; align-items: center; gap: 5px; }
.user-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--user-status-dot, var(--status-green)); }

/* ========================================
   Main
   ======================================== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  min-width: 0;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  flex-shrink: 0;
  min-height: 58px;
}
.topbar-crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-muted);
}
.topbar-crumbs .sep { color: var(--ink-dim); }
.topbar-crumbs .current {
  color: var(--ink);
  font-weight: 500;
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: -0.005em;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Topbar invite code ── */
.topbar-invite {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px 4px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: 999px;
  height: 32px;
}
.topbar-invite-code {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--ink);
  user-select: none;
  min-width: 72px;
  text-align: center;
}
.topbar-invite-eye {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  color: var(--ink-muted);
}

.view-switch {
  display: flex;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 2px;
  gap: 2px;
}
.view-switch button {
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s var(--ease);
}
.view-switch button:hover { color: var(--ink); }
.view-switch button[data-active="true"] {
  background: var(--bg-raised);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--ink-muted);
  position: relative;
  transition: all 0.12s var(--ease);
}
.icon-btn:hover { background: var(--bg-subtle); color: var(--ink); }
.icon-btn .pip {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  border: 1.5px solid var(--bg);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s var(--ease);
  border: 1px solid transparent;
  line-height: 1.1;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover { background: var(--ink-2); transform: translateY(-0.5px); }
[data-theme="dark"] .btn-primary { background: var(--accent); color: white; }
[data-theme="dark"] .btn-primary:hover { background: oklch(from var(--accent) calc(l + 0.05) c h); }
.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border-color: var(--line);
}
.btn-ghost:hover { background: var(--bg-subtle); border-color: var(--line-strong); }
.btn-accent {
  background: var(--accent);
  color: white;
}
.btn-accent:hover { background: oklch(from var(--accent) calc(l - 0.05) c h); }

.toast-message-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.toast-message-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}
.toast-message-text {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.35;
}
.toast-message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 5px;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  color: var(--ink-muted);
}
.toast-message-meta span:first-child {
  color: var(--accent-ink);
  font-weight: 700;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 12px;
  color: var(--ink-muted);
  background: var(--bg-subtle);
  border: 1px solid transparent;
  transition: all 0.12s var(--ease);
}
.filter-chip:hover { color: var(--ink); border-color: var(--line); }
.filter-chip[data-active="true"] {
  color: var(--ink);
  background: var(--bg-raised);
  border-color: var(--line);
}

/* Secondary bar */
.subbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  flex-shrink: 0;
}
.subbar-left { display: flex; align-items: center; gap: 8px; }
.subbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.avatar-stack { display: flex; }
.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  display: grid;
  place-items: center;
  font-size: 10.5px;
  font-weight: 600;
  color: white;
  margin-left: -7px;
  flex-shrink: 0;
}
.avatar:first-child { margin-left: 0; }
.avatar[data-size="sm"] { width: 22px; height: 22px; font-size: 9.5px; border-width: 1.5px; }
.avatar[data-size="md"] { width: 30px; height: 30px; font-size: 12px; }
.avatar[data-size="lg"] { width: 36px; height: 36px; font-size: 13px; }

/* ========================================
   Board toolbar (filter toggle row)
   ======================================== */
.board-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  flex-shrink: 0;
}
.filter-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-muted);
  border: 1px solid var(--line);
  background: var(--bg-subtle);
  cursor: pointer;
  transition: all .12s;
}
.filter-toggle-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.filter-toggle-btn[data-active="true"] { color: var(--ink); border-color: var(--ink-2); background: var(--bg-raised); }
.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  background: var(--accent);
  color: var(--accent-ink);
}

/* Board search */
.board-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg-raised);
  min-width: 180px;
  max-width: 280px;
  transition: border-color 0.12s;
}
.board-search-wrap:focus-within { border-color: var(--accent); }
.board-search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 12.5px;
  color: var(--ink);
}
.board-search-input::placeholder { color: var(--ink-faint); }

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

/* ========================================
   Filter bar (Board + List shared)
   ======================================== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  flex-shrink: 0;
  flex-wrap: wrap;
  min-height: 38px;
}
.filter-bar-section {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.filter-bar-divider {
  width: 1px;
  height: 16px;
  background: var(--line);
  flex-shrink: 0;
  margin: 0 2px;
}
.filter-bar > .icon { color: var(--ink-muted); flex-shrink: 0; }
.filter-tag {
  opacity: 0.38;
  cursor: pointer;
  transition: opacity .12s;
}
.filter-tag:hover { opacity: 0.65; }
.filter-tag[data-active="true"] { opacity: 1; }
.filter-priority-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--line);
  color: var(--ink-dim);
  background: var(--bg-subtle);
  transition: all .1s;
}
.filter-priority-chip:hover { border-color: var(--ink-dim); color: var(--ink); }
.filter-priority-chip[data-active="true"] { border-color: var(--ink-2); color: var(--ink); background: var(--bg-raised); font-weight: 600; }
.filter-clear-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11.5px;
  color: var(--ink-muted);
  cursor: pointer;
  background: none;
  border: 1px solid var(--line);
  transition: all .1s;
  margin-left: 2px;
}
.filter-clear-btn:hover { color: var(--status-rose); border-color: var(--status-rose); }

/* ========================================
   Kanban Board
   ======================================== */
.board {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 18px 20px 4px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--bg);
}

.column {
  width: var(--col-w);
  min-width: var(--col-w);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: outline 0.1s;
}
.column[data-col-drag-over="true"],
.column[data-touch-over="true"] {
  outline: 2px dashed var(--accent);
  outline-offset: 2px;
}

.col-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--line);
  transition: all 0.2s ease;
}
.col-header[data-dragging="true"] {
  background: var(--status-rose);
  border-bottom-color: var(--status-rose);
  color: white;
  opacity: 0.8;
}
.col-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.col-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.003em;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.col-count {
  font-size: 11px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  padding: 1px 6px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 5px;
}
.col-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2px;
}
.col-actions button:not(.col-menu-item) {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  color: var(--ink-faint);
  display: grid;
  place-items: center;
}
.col-actions button:not(.col-menu-item):hover { background: var(--bg-raised); color: var(--ink); }

.col-menu {
  position: fixed;
  width: 210px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  z-index: 1000;
  overflow: hidden;
}
.col-menu-info {
  padding: 9px 14px 8px;
  font-size: 11px;
  color: var(--ink-faint);
  font-weight: 500;
}
.col-menu-divider {
  height: 1px;
  background: var(--line);
  margin: 0;
}
.col-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 37px;
  box-sizing: border-box;
  padding: 0 14px;
  font-size: 13px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}
.col-menu-item:hover { background: var(--bg-subtle); }
.col-menu-item-danger { color: var(--status-rose); }
.col-menu-confirm-yes {
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--status-rose);
  color: white;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
}
.col-menu-confirm-no {
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--bg-subtle);
  color: var(--ink-muted);
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
}

/* Modal tab switcher */
.modal-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.modal-tab-btn {
  flex: 1;
  padding: 7px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.modal-tab-btn[data-active="true"] {
  background: var(--bg-raised);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.col-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--card-gap);
  display: flex;
  flex-direction: column;
  gap: var(--card-gap);
  min-height: 100px;
}
.col-body[data-drag-over="true"] {
  background: var(--accent-softer);
  outline: 1.5px dashed var(--accent);
  outline-offset: -4px;
  border-radius: 10px;
}

.col-add {
  padding: 8px 12px;
  margin: 0 var(--card-gap) var(--card-gap);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.12s var(--ease);
}
.col-add:hover { background: var(--bg-raised); color: var(--ink); }

/* Card */
.card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--card-pad);
  cursor: pointer;
  transition: all 0.15s var(--ease);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: cardIn 0.3s var(--ease) both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.card[data-dragging="true"] {
  opacity: 0.4;
  transform: rotate(2deg) scale(0.98);
}
.card[data-done="true"] { opacity: 0.65; }
.card[data-done="true"] .card-title { text-decoration: line-through; text-decoration-color: var(--ink-dim); }

.card[data-overdue="true"] {
  border-color: oklch(58% 0.13 10 / 0.4);
  border-left: 3px solid var(--status-rose);
  background: oklch(58% 0.13 10 / 0.04);
}
[data-theme="dark"] .card[data-overdue="true"] { background: oklch(58% 0.13 10 / 0.07); }
.card[data-overdue="true"]:hover { border-color: oklch(58% 0.13 10 / 0.6); }

.card[data-mine="true"] {
  border-left: 3px solid var(--accent);
  background: color-mix(in oklch, var(--accent) 8%, var(--bg-raised));
  border-color: var(--accent);
}
.card[data-mine="true"]:hover {
  background: color-mix(in oklch, var(--accent) 12%, var(--bg-raised));
}

/* Both mine + overdue: diagonal gradient blending both accent and red tints */
.card[data-mine="true"][data-overdue="true"] {
  border-left: 3px solid var(--status-rose);
  border-color: oklch(58% 0.13 10 / 0.4);
  border-left-color: var(--status-rose);
  background: linear-gradient(
    135deg,
    color-mix(in oklch, var(--accent) 10%, var(--bg-raised)) 0%,
    oklch(58% 0.13 10 / 0.06) 100%
  );
}
[data-theme="dark"] .card[data-mine="true"][data-overdue="true"] {
  background: linear-gradient(
    135deg,
    color-mix(in oklch, var(--accent) 14%, var(--bg-raised)) 0%,
    oklch(58% 0.13 10 / 0.10) 100%
  );
}

.card-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.card[data-show-tags="false"] .card-tags { display: none; }

.tag {
  font-size: 10.5px;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 4px;
  color: var(--ink-2);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  letter-spacing: 0.01em;
}
.tag[data-tone="blue"] { color: var(--status-blue); background: oklch(55% 0.09 230 / 0.08); border-color: oklch(55% 0.09 230 / 0.25); }
.tag[data-tone="amber"] { color: var(--status-amber); background: oklch(65% 0.11 70 / 0.10); border-color: oklch(65% 0.11 70 / 0.25); }
.tag[data-tone="rose"] { color: var(--status-rose); background: oklch(58% 0.13 10 / 0.08); border-color: oklch(58% 0.13 10 / 0.25); }
.tag[data-tone="green"] { color: var(--status-green); background: oklch(55% 0.09 150 / 0.08); border-color: oklch(55% 0.09 150 / 0.25); }
.tag[data-tone="accent"]  { color: var(--accent-ink);     background: var(--accent-soft);                    border-color: var(--accent-soft); }
[data-theme="dark"] .tag[data-tone="accent"] { color: var(--accent); }
.tag[data-tone="purple"]  { color: var(--status-purple);  background: oklch(55% 0.14 300 / 0.08);  border-color: oklch(55% 0.14 300 / 0.25); }
.tag[data-tone="teal"]    { color: var(--status-teal);    background: oklch(55% 0.10 195 / 0.08);  border-color: oklch(55% 0.10 195 / 0.25); }
.tag[data-tone="orange"]  { color: var(--status-orange);  background: oklch(62% 0.14 50  / 0.10);  border-color: oklch(62% 0.14 50  / 0.25); }
.tag[data-tone="cyan"]    { color: var(--status-cyan);    background: oklch(60% 0.10 210 / 0.08);  border-color: oklch(60% 0.10 210 / 0.25); }
.tag[data-tone="pink"]    { color: var(--status-pink);    background: oklch(60% 0.14 350 / 0.08);  border-color: oklch(60% 0.14 350 / 0.25); }

.card[data-mine="true"] .card-title { padding-right: 32px; }
.card-title {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
  word-break: break-word;
  overflow-wrap: break-word;
  color: var(--ink);
  letter-spacing: -0.005em;
  word-break: break-word;
}
.card-title[contenteditable="true"] {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.card-desc-preview {
  font-size: 12px;
  color: var(--ink-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
.meta-item[data-warn="true"] { color: var(--status-rose); }
.meta-item[data-done="true"] { color: var(--status-green); }

.priority-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
}
.priority-dot { width: 6px; height: 6px; border-radius: 50%; }
.priority-dot[data-p="high"] { background: var(--status-rose); }
.priority-dot[data-p="mid"]  { background: var(--status-amber); }
.priority-dot[data-p="low"]  { background: var(--status-slate); }

.card-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.card[data-show-progress="false"] .progress-row { display: none; }

.progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--ink-muted);
}
.progress-bar {
  flex: 1;
  height: 3px;
  background: var(--bg-sunken);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--ink);
  border-radius: 2px;
  transition: width 0.4s var(--ease);
}
[data-theme="dark"] .progress-fill { background: var(--accent); }

.card-assignees { margin-left: auto; display: flex; }

.add-column-btn {
  width: 240px;
  min-width: 240px;
  padding: 14px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-lg);
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  height: 48px;
  transition: all 0.15s var(--ease);
}
.add-column-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-softer);
}

.add-column-form {
  width: var(--col-w);
  min-width: var(--col-w);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--bg-raised);
}

.add-column-input {
  width: 100%;
  min-height: 44px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-subtle);
  color: var(--ink);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.add-column-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.add-column-actions {
  display: flex;
  gap: 10px;
}

.btn-save,
.btn-cancel {
  flex: 1;
  min-height: 44px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}

.btn-save {
  background: var(--accent);
  color: white;
  border: 1px solid transparent;
}
.btn-save:hover {
  filter: brightness(1.03);
}

.btn-cancel {
  background: var(--bg-subtle);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-cancel:hover {
  background: var(--bg-raised);
}
.btn-save:disabled,
.btn-cancel:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Board trash drop zone ─────────────────────────────────────────────── */
.board-trash-zone {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  background: var(--bg-raised);
  border: 2px dashed var(--line-strong);
  border-radius: 999px;
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 500;
  z-index: 200;
  pointer-events: all;
  user-select: none;
  box-shadow: var(--shadow-md);
  white-space: nowrap;
  animation: trashZoneIn 0.18s var(--ease);
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease),
              color 0.15s var(--ease), transform 0.15s var(--ease),
              box-shadow 0.15s var(--ease);
  max-width: 90vw;
}
.board-trash-zone[data-hover="true"] {
  background: oklch(58% 0.13 10 / 0.15);
  border-color: var(--status-rose);
  border-style: solid;
  color: var(--status-rose);
  transform: translateX(-50%) scale(1.08);
  box-shadow: var(--shadow-lg), 0 0 20px oklch(58% 0.13 10 / 0.2);
}
  box-shadow: 0 0 0 4px oklch(58% 0.13 10 / 0.08), var(--shadow-md);
}
@keyframes trashZoneIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px) scale(0.96); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0)    scale(1);    }
}

/* ========================================
   List view
   ======================================== */
.list-view {
  flex: 1;
  overflow: auto;
  padding: 12px 20px 20px;
}
.list-group { margin-bottom: 24px; }
.list-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--line);
}
.list-group-header .col-count { margin-left: 0; }

.list-table {
  width: 100%;
  border-collapse: collapse;
}
.list-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 1;
}
.list-table td {
  padding: 10px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.list-table tr { cursor: pointer; transition: background 0.1s var(--ease); }
.list-table tr:hover td { background: var(--bg-subtle); }
.list-table tr[data-done="true"] td { color: var(--ink-muted); }
.list-table tr[data-done="true"] .title { text-decoration: line-through; }

.list-check {
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 4px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--bg-raised);
  transition: all 0.1s var(--ease);
  flex-shrink: 0;
}
.list-check[data-checked="true"] {
  background: var(--ink);
  border-color: var(--ink);
}
[data-theme="dark"] .list-check[data-checked="true"] { background: var(--accent); border-color: var(--accent); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-subtle);
  color: var(--ink-2);
  border: 1px solid var(--line);
}

/* ========================================
   Calendar
   ======================================== */
.cal-wrap {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.cal-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}
.cal-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-left: auto;
}
.cal-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 4px;
}
.cal-month {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: -0.01em;
}
.cal-month em { font-style: italic; color: var(--ink-muted); font-weight: 400; }
.cal-nav { display: flex; gap: 2px; margin-left: 8px; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg-raised);
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
}
.cal-panels {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
.cal-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.cal-stat {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cal-stat span {
  font-size: 12px;
  color: var(--ink-muted);
}
.cal-stat strong {
  font-size: 20px;
  color: var(--ink);
}
.cal-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-raised);
}
.cal-filter-row span {
  font-size: 12px;
  color: var(--ink-muted);
}
.cal-filter-row .filter-chip {
  margin: 0;
}
.cal-weekday {
  padding: 8px 10px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--line);
  background: var(--bg-subtle);
}
.cal-day {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 6px 8px 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 96px;
  max-height: 130px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: background 0.1s var(--ease);
}
.cal-day:hover { background: var(--bg-subtle); }
.cal-day[data-other="true"] { background: var(--bg-subtle); }
.cal-day[data-other="true"] .day-num { color: var(--ink-dim); }
.cal-day[data-today="true"] .day-num {
  background: var(--ink);
  color: var(--bg);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
[data-theme="dark"] .cal-day[data-today="true"] .day-num { background: var(--accent); color: white; }
.day-num {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  padding: 2px 0 2px 2px;
}
.cal-chip {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 16px;
  font-weight: 500;
  width: 100%;
  box-sizing: border-box;
  color: var(--ink-2);
  background: var(--bg-subtle);
  border-left: 2px solid var(--ink-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.cal-chip:hover { background: var(--bg-sunken); }
.cal-chip[data-tone="blue"]   { border-left-color: var(--status-blue); }
.cal-chip[data-tone="amber"]  { border-left-color: var(--status-amber); }
.cal-chip[data-tone="rose"]   { border-left-color: var(--status-rose); }
.cal-chip[data-tone="green"]  { border-left-color: var(--status-green); }
.cal-chip[data-tone="accent"]  { border-left-color: var(--accent); }
.cal-chip[data-tone="purple"]  { border-left-color: var(--status-purple); }
.cal-chip[data-tone="teal"]    { border-left-color: var(--status-teal); }
.cal-chip[data-tone="orange"]  { border-left-color: var(--status-orange); }
.cal-chip[data-tone="cyan"]    { border-left-color: var(--status-cyan); }
.cal-chip[data-tone="pink"]    { border-left-color: var(--status-pink); }
.cal-chip[data-mine="true"] { background: color-mix(in oklch, var(--accent) 12%, var(--bg-raised)); border-left-color: var(--accent); font-weight: 600; }
.cal-week-chip[data-mine="true"] { outline: 1.5px solid var(--accent); background: color-mix(in oklch, var(--accent) 10%, var(--bg-raised)); }
.agenda-item[data-mine="true"] { background: color-mix(in oklch, var(--accent) 6%, var(--bg-raised)); }
.cal-more { font-size: 10.5px; color: var(--ink-muted); padding-left: 4px; }
.cal-empty { padding: 48px 0; text-align: center; color: var(--ink-dim); font-size: 14px; }

/* ── Date range bars ── */
.cal-bar {
  height: 6px;
  margin: 1px 0;
  border-radius: 0;
  opacity: 0.82;
  cursor: pointer;
  transition: opacity 0.12s;
  flex-shrink: 0;
}
.cal-bar:hover { opacity: 1; }
.cal-bar[data-start="true"] { border-radius: 4px 0 0 4px; margin-left: 2px; }
.cal-bar[data-end="true"]   { border-radius: 0 4px 4px 0; margin-right: 2px; }
.cal-bar[data-start="true"][data-end="true"] { border-radius: 4px; margin: 1px 2px; }
.cal-bar[data-mine="true"] { height: 8px; box-shadow: inset 0 2px 0 oklch(100% 0 0 / 0.55); }

/* ── Holiday dot ── */
.cal-holiday-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: oklch(62% 0.18 30);
  flex-shrink: 0;
  cursor: default;
}

/* ── Range selection highlight ── */
.cal-day[data-range-start="true"],
.cal-week-col[data-range-start="true"] {
  background: color-mix(in oklch, var(--accent) 15%, var(--bg)) !important;
  outline: 1.5px solid var(--accent);
  outline-offset: -1px;
}
.cal-day[data-in-range="true"],
.cal-week-col[data-in-range="true"] {
  background: color-mix(in oklch, var(--accent) 8%, var(--bg)) !important;
}

/* ── Week view ── */
.cal-week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.cal-week-col {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  min-height: 340px;
}
.cal-week-col:last-child { border-right: none; }
.cal-week-col[data-weekend="true"] { background: var(--bg-subtle); }
.cal-week-col[data-today="true"] { background: color-mix(in oklch, var(--accent) 5%, var(--bg)); }
.cal-week-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px 8px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-raised);
}
.cal-week-dow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.cal-week-date {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}
.cal-week-date[data-today="true"] {
  background: var(--accent);
  color: white;
  font-weight: 700;
}
.cal-week-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px 4px;
  flex: 1;
  overflow: hidden;
}
.cal-week-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 6px;
  background: var(--bg-raised);
  border-left: 3px solid var(--line);
  cursor: pointer;
  font-size: 11px;
  transition: background .12s;
}
.cal-week-chip:hover { background: var(--bg-sunken); }
.cal-week-chip[data-overdue="true"] { border-left-color: var(--status-rose) !important; }
.cal-week-chip-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
}
.cal-week-chip[data-tone="blue"]   { border-left-color: var(--status-blue); }
.cal-week-chip[data-tone="amber"]  { border-left-color: var(--status-amber); }
.cal-week-chip[data-tone="rose"]   { border-left-color: var(--status-rose); }
.cal-week-chip[data-tone="green"]  { border-left-color: var(--status-green); }
.cal-week-chip[data-tone="accent"]  { border-left-color: var(--accent); }
.cal-week-chip[data-tone="purple"]  { border-left-color: var(--status-purple); }
.cal-week-chip[data-tone="teal"]    { border-left-color: var(--status-teal); }
.cal-week-chip[data-tone="orange"]  { border-left-color: var(--status-orange); }
.cal-week-chip[data-tone="cyan"]    { border-left-color: var(--status-cyan); }
.cal-week-chip[data-tone="pink"]    { border-left-color: var(--status-pink); }

/* ── Agenda view ── */
.cal-agenda {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.agenda-group {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 12px;
}
.agenda-group:last-child { border-bottom: none; margin-bottom: 0; }
.agenda-date-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0 10px;
}
.agenda-date-header[data-today="true"] .agenda-date-label { color: var(--accent); font-weight: 700; }
.agenda-date-header[data-past="true"]:not([data-today="true"]) .agenda-date-label { color: var(--ink-dim); }
.agenda-date-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  min-width: 80px;
}
.agenda-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 99px;
}
.agenda-badge-late  { background: color-mix(in oklch, var(--status-rose) 15%, transparent);  color: var(--status-rose); }
.agenda-badge-today { background: color-mix(in oklch, var(--accent) 15%, transparent); color: var(--accent); }
.agenda-task-count  { font-size: 11px; color: var(--ink-dim); margin-left: auto; }
.agenda-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background .12s;
}
.agenda-item:hover { background: var(--bg-subtle); }
.agenda-item-bar {
  width: 3px;
  height: 32px;
  border-radius: 2px;
  background: var(--line);
  flex-shrink: 0;
}
.agenda-item[data-tone="blue"]   .agenda-item-bar { background: var(--status-blue); }
.agenda-item[data-tone="amber"]  .agenda-item-bar { background: var(--status-amber); }
.agenda-item[data-tone="rose"]   .agenda-item-bar { background: var(--status-rose); }
.agenda-item[data-tone="green"]  .agenda-item-bar { background: var(--status-green); }
.agenda-item[data-tone="accent"]  .agenda-item-bar { background: var(--accent); }
.agenda-item[data-tone="purple"]  .agenda-item-bar { background: var(--status-purple); }
.agenda-item[data-tone="teal"]    .agenda-item-bar { background: var(--status-teal); }
.agenda-item[data-tone="orange"]  .agenda-item-bar { background: var(--status-orange); }
.agenda-item[data-tone="cyan"]    .agenda-item-bar { background: var(--status-cyan); }
.agenda-item[data-tone="pink"]    .agenda-item-bar { background: var(--status-pink); }
.agenda-item-body { flex: 1; min-width: 0; }
.agenda-item-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 3px;
}
.agenda-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ========================================
   Dashboard
   ======================================== */
.dash {
  flex: 1;
  overflow: auto;
  padding: 24px 28px;
}
.dash-h1 {
  font-family: var(--font-display);
  font-size: 36px;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin-bottom: 4px;
}
.dash-h1 em { font-style: italic; color: var(--ink-muted); }
.dash-sub {
  font-size: 14px;
  color: var(--ink-muted);
  margin-bottom: 28px;
  max-width: 60ch;
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
}
.stat-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-delta {
  font-size: 11.5px;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.stat-delta[data-up="true"] { color: var(--status-green); }
.stat-delta[data-down="true"] { color: var(--status-rose); }

.dash-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.panel {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.panel-head {
  padding: 14px 18px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.panel-title {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: -0.005em;
}
.panel-sub { font-size: 12px; color: var(--ink-muted); }
.panel-body { padding: 4px 18px 18px; }

/* Chart */
.chart {
  height: 200px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 12px 0;
}
.bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  min-width: 0;
}
.bar-stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 4px;
  overflow: hidden;
  min-height: 2px;
}
.bar-seg {
  width: 100%;
  transition: height 0.3s var(--ease);
}
.bar-seg[data-t="done"]     { background: var(--status-green); }
.bar-seg[data-t="review"]   { background: var(--status-amber); }
.bar-seg[data-t="progress"] { background: var(--status-blue); }
.bar-label { font-size: 10.5px; color: var(--ink-faint); }
.bar-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s var(--ease);
}
.bar:hover .bar-tooltip { opacity: 1; }

.legend {
  display: flex;
  gap: 14px;
  font-size: 11.5px;
  color: var(--ink-muted);
  padding: 0 18px 14px;
}
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 8px; height: 8px; border-radius: 2px; }

/* Activity */
.activity-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.activity-item:last-child { border-bottom: none; }
.activity-body { flex: 1; min-width: 0; }
.activity-text { font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.activity-text strong { font-weight: 600; color: var(--ink); }
.activity-text em { font-style: normal; color: var(--accent-ink); }
[data-theme="dark"] .activity-text em { color: var(--accent); }
.activity-time { font-size: 11px; color: var(--ink-faint); margin-top: 2px; }

/* Dashboard empty states */
.dash-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px 18px;
  color: var(--ink-dim);
  font-size: 13px;
  text-align: center;
  min-height: 120px;
}
.dash-empty-state .icon { color: var(--ink-faint); }

/* People list */
.people-list { display: flex; flex-direction: column; gap: 2px; }
.person-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.person-row:not(:last-child) { border-bottom: 1px solid var(--line); }
.person-info { flex: 1; }
.person-name { font-size: 13px; font-weight: 500; }
.person-role { font-size: 11.5px; color: var(--ink-muted); }
.person-stat {
  font-size: 12px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ========================================
   Right drawer (task detail)
   ======================================== */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 12, 0.35);
  backdrop-filter: blur(2px);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}
.drawer-overlay[data-open="true"] { opacity: 1; pointer-events: all; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 620px;
  max-width: 96vw;
  background: var(--bg-raised);
  border-left: 1px solid var(--line);
  border-radius: 0 22px 22px 0;
  box-shadow: var(--shadow-lg);
  z-index: 51;
  transform: translateX(100%);
  transition: transform 0.3s var(--ease);
  display: flex;
  flex-direction: column;
}
.drawer[data-open="true"] { transform: translateX(0); }
.drawer[data-fullscreen="true"] {
  left: 0 !important;
  right: 0 !important;
  width: 100vw !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  max-width: 100vw !important;
  border-radius: 0 !important;
  border-left: none !important;
}
.drawer-overlay[data-fullscreen="true"] { display: none; }

.drawer-head {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.drawer-crumbs {
  font-size: 12px;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.drawer-crumbs .sep { color: var(--ink-dim); flex-shrink: 0; }
.drawer-crumbs > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.drawer-head-actions { margin-left: auto; display: flex; gap: 2px; flex-shrink: 0; }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 40px 60px;
}

.doc-title {
  font-family: var(--font-display);
  font-size: 38px;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin-bottom: 20px;
  outline: none;
}
.doc-title:focus { background: var(--bg-subtle); border-radius: 4px; padding: 2px 4px; margin-left: -4px; }

.props-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 4px 16px;
  margin-bottom: 32px;
}
.prop-label {
  font-size: 12.5px;
  color: var(--ink-muted);
  padding: 6px 0;
  display: flex;
  align-items: center;
  gap: 7px;
}
.prop-value {
  padding: 10px 14px;
  margin: 0 -8px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink);
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.15s var(--ease);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  position: relative;
}
.prop-value:hover { background: var(--bg-raised); box-shadow: 0 2px 6px oklch(0% 0 0 / 0.06); }
.custom-dropdown {
  position: relative;
  width: 100%;
}
.custom-dropdown-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-raised);
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.custom-dropdown-btn:hover {
  background: var(--bg-subtle);
  border-color: var(--line-strong);
}
.custom-dropdown-btn > .dropdown-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.custom-dropdown-menu {
  position: fixed;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  overflow-y: auto;
  max-height: 280px;
  max-width: 95vw;
}
.custom-dropdown-item {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 12px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s var(--ease);
}
.custom-dropdown-item:hover {
  background: var(--bg-subtle);
}
.custom-dropdown-item.active {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
[data-theme="dark"] .custom-dropdown-item.active { color: var(--accent); }

.doc-content {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink);
}
.doc-content h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 28px 0 12px;
  line-height: 1.2;
}
.doc-content h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 20px 0 8px;
}
.doc-content p { margin-bottom: 10px; color: var(--ink-2); }
.doc-content ul, .doc-content ol { margin: 10px 0 14px 20px; color: var(--ink-2); }
.doc-content li { margin-bottom: 5px; }
.doc-content code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 1px 6px;
  background: var(--bg-subtle);
  border-radius: 4px;
  color: var(--accent-ink);
}
[data-theme="dark"] .doc-content code { color: var(--accent); }
.doc-content pre {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 12px 14px;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow-x: auto;
  margin: 10px 0;
  line-height: 1.6;
}
.doc-content blockquote {
  margin: 12px 0;
  padding: 4px 14px;
  border-left: 3px solid var(--accent);
  color: var(--ink-muted);
  font-style: italic;
}
.doc-content hr { border: none; border-top: 1px solid var(--line); margin: 24px 0; }

.checklist {
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 5px 6px;
  margin-left: -6px;
  border-radius: 6px;
  cursor: pointer;
}
.check-row:hover { background: var(--bg-subtle); }
.check-row[data-checked="true"] .check-text { text-decoration: line-through; color: var(--ink-muted); }

/* Comment */
.comments-section { margin-top: 36px; }
.comment-row {
  display: flex;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.comment-body { flex: 1; }
.comment-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.comment-name { font-size: 13px; font-weight: 600; }
.comment-time { font-size: 11px; color: var(--ink-faint); }
.comment-text { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.comment-compose {
  display: flex;
  gap: 10px;
  padding: 14px 0 4px;
}
.comment-input-wrap {
  flex: 1;
  position: relative;
}
.comment-compose textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 13px;
  resize: none;
  min-height: 60px;
  outline: none;
  transition: border-color 0.15s;
}
.comment-compose textarea:focus { border-color: var(--accent); }

/* ── @ Mention dropdown ── */
.mention-dropdown {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  overflow: hidden;
  z-index: 200;
}
.mention-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}
.mention-item:hover { background: var(--bg-subtle); }
.mention-name { font-size: 13px; font-weight: 500; color: var(--ink); flex: 1; }
.mention-role { font-size: 11px; color: var(--ink-muted); }

/* ── Team sort dropdown ── */
.team-sort-wrap {
  position: relative;
  margin-left: auto;
}
.team-sort-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 190px;
  overflow: hidden;
  z-index: 100;
}
.team-sort-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 10px 14px 4px;
}
.team-sort-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 14px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink);
  text-align: left;
  transition: background 0.1s;
}
.team-sort-item:hover { background: var(--bg-subtle); }
.team-sort-item[data-active="true"] { font-weight: 600; color: var(--accent); }

/* ========================================
   Modal
   ======================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 10, 8, 0.45);
  backdrop-filter: blur(6px);
  z-index: 60;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease);
}
.modal-overlay[data-open="true"] { opacity: 1; pointer-events: all; }
.modal {
  width: 620px;
  max-width: 95vw;
  max-height: 92vh;
  background: var(--bg-raised);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 28px;
  box-shadow: 0 26px 80px rgba(16, 17, 23, 0.18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition: all 0.22s var(--ease);
}
.modal-overlay[data-open="true"] .modal { transform: translateY(0) scale(1); opacity: 1; }
.modal-head {
  padding: 22px 26px 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.modal-title { font-family: var(--font-display); font-size: 25px; letter-spacing: -0.01em; }
.modal-sub { font-size: 13px; color: var(--ink-muted); margin-top: 4px; line-height: 1.5; }
.modal-body {
  padding: 18px 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
}
.modal-foot {
  padding: 18px 26px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--bg-subtle);
  flex-shrink: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.field input, .field textarea, .field select {
  padding: 12px 14px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 16px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
  resize: none;
}
.field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border-radius: 999px;
  background-color: var(--bg-raised);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236F6F7A' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px 8px;
  padding-right: 38px;
  color: var(--ink);
}
.field select option {
  background: var(--bg-raised);
  color: var(--ink);
  border-radius: 14px;
}
.field input[type="date"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: textfield;
  background: var(--bg-raised) !important;
  border-radius: 999px !important;
  padding: 12px 14px !important;
  color: var(--ink) !important;
  caret-color: var(--ink) !important;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  border: 1px solid var(--line);
}
.field input[type="date"]::-webkit-datetime-edit-year-field,
.field input[type="date"]::-webkit-datetime-edit-month-field,
.field input[type="date"]::-webkit-datetime-edit-day-field,
.field input[type="date"]::-webkit-datetime-edit-hour-field,
.field input[type="date"]::-webkit-datetime-edit-minute-field {
  color: var(--ink) !important;
}
.field input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.75;
  cursor: pointer;
  filter: var(--date-picker-icon-filter, none);
}
.field input[type="date"]::-ms-expand {
  display: block;
}
.field textarea { min-height: 110px; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--bg);
}
.field-row { 
  display: grid; 
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  align-items: flex-end;
}
.field-row > .field { flex: 1; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}
.chip:hover { background: var(--bg-raised); }
.chip[data-selected="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-ink);
}
[data-theme="dark"] .chip[data-selected="true"] { color: var(--accent); }

/* ========================================
   Command palette
   ======================================== */
.palette-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 12, 0.35);
  backdrop-filter: blur(4px);
  z-index: 80;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 14vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease);
}
.palette-overlay[data-open="true"] { opacity: 1; pointer-events: all; }
.palette {
  width: 600px;
  max-width: 92vw;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(-8px) scale(0.98);
  opacity: 0;
  transition: all 0.22s var(--ease);
}
.palette-overlay[data-open="true"] .palette { transform: translateY(0) scale(1); opacity: 1; }
.palette-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.palette-input-wrap input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 15px;
  padding: 0;
}
.palette-list { max-height: 360px; overflow-y: auto; padding: 6px; }
.palette-group-title {
  padding: 8px 12px 4px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.palette-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink-2);
}
.palette-item[data-active="true"], .palette-item:hover {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
[data-theme="dark"] .palette-item[data-active="true"], [data-theme="dark"] .palette-item:hover { color: var(--ink); }
.palette-item .icon { color: var(--ink-muted); }
.palette-item[data-active="true"] .icon, .palette-item:hover .icon { color: var(--accent); }
.palette-item kbd {
  margin-left: auto;
  padding: 2px 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-muted);
}
.palette-hint {
  padding: 8px 14px;
  font-size: 11px;
  color: var(--ink-faint);
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  background: var(--bg-subtle);
}
.palette-hint kbd {
  padding: 1px 5px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  margin-right: 4px;
}

/* ========================================
   Notifications panel
   ======================================== */
.notif-panel {
  position: fixed;
  top: 58px;
  right: 16px;
  width: 380px;
  max-height: calc(100vh - 80px);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 70;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: top right;
  opacity: 0;
  transform: translateY(-4px) scale(0.97);
  pointer-events: none;
  transition: all 0.2s var(--ease);
}
.notif-panel[data-open="true"] {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}
.notif-head {
  padding: 14px 18px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}
.notif-title { font-family: var(--font-display); font-size: 18px; letter-spacing: -0.005em; }
.notif-count {
  font-size: 11px;
  background: var(--accent);
  color: white;
  padding: 1px 7px;
  border-radius: 99px;
}
.notif-tabs { display: flex; gap: 2px; margin-left: auto; }
.notif-tabs button {
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11.5px;
  color: var(--ink-muted);
}
.notif-tabs button[data-active="true"] { background: var(--bg-subtle); color: var(--ink); }

.notif-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px;
  max-height: 60vh;
}
.notif-item {
  padding: 10px 36px 10px 10px;
  border-radius: 8px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  position: relative;
}
.notif-item:hover { background: var(--bg-subtle); }
.notif-item[data-unread="true"]::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
/* Unread items: same padding as normal — dot is absolute overlay, no layout shift */

/* Notification type icon badge */
.notif-icon-badge {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg-subtle);
  color: var(--ink-muted);
}
.notif-type-message .notif-icon-badge { background: oklch(55% 0.09 230 / 0.12); color: var(--status-blue); }
.notif-type-task    .notif-icon-badge { background: oklch(55% 0.09 150 / 0.12); color: var(--status-green); }
.notif-type-mention .notif-icon-badge { background: oklch(65% 0.11 70  / 0.12); color: var(--status-amber); }

.notif-dismiss {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-faint);
  padding: 3px;
  line-height: 1;
  border-radius: 4px;
  opacity: 0;
  transition: opacity .12s;
}
.notif-item:hover .notif-dismiss { opacity: 1; }
.notif-dismiss:hover { color: var(--status-rose); background: var(--bg-raised); }

.notif-body { flex: 1; min-width: 0; }
.notif-text { font-size: 13px; line-height: 1.4; word-break: break-word; overflow-wrap: break-word; }
.notif-text strong { font-weight: 600; }
.notif-text em { font-style: normal; color: var(--ink); font-weight: 500; }
.notif-time { font-size: 11px; color: var(--ink-faint); margin-top: 2px; }

/* ========================================
   Tweaks panel
   ======================================== */
.tweaks-fab {
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow-md);
  display: grid;
  place-items: center;
  z-index: 90;
  transition: all 0.2s var(--ease);
}
.tweaks-fab:hover { transform: scale(1.05) rotate(30deg); }
[data-theme="dark"] .tweaks-fab { background: var(--accent); color: white; }

.tweaks-panel {
  position: fixed;
  bottom: 70px;
  right: 16px;
  width: 320px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 89;
  overflow: hidden;
  transform-origin: bottom right;
  opacity: 0;
  transform: translateY(4px) scale(0.96);
  pointer-events: none;
  transition: all 0.2s var(--ease);
}
.tweaks-panel[data-open="true"] {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}
.tweaks-head {
  padding: 14px 18px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}
.tweaks-title { font-family: var(--font-display); font-size: 18px; letter-spacing: -0.005em; }
.tweaks-body {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 72vh;
  overflow-y: auto;
}
.tweak-group { display: flex; flex-direction: column; gap: 6px; }
.tweak-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tweak-options { display: flex; gap: 4px; flex-wrap: wrap; }
.tweak-opt {
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 12px;
  background: var(--bg-subtle);
  border: 1px solid transparent;
  color: var(--ink-2);
  transition: all 0.12s var(--ease);
}
.tweak-opt:hover { border-color: var(--line-strong); }
.tweak-opt[data-active="true"] {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
[data-theme="dark"] .tweak-opt[data-active="true"] { background: var(--accent); color: white; border-color: var(--accent); }

.swatch-row { display: flex; gap: 8px; }
.swatch {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.12s var(--ease);
  position: relative;
}
.swatch[data-active="true"] {
  border-color: var(--ink);
  transform: scale(1.05);
}
[data-theme="dark"] .swatch[data-active="true"] { border-color: var(--ink); }

.tweak-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
  cursor: pointer;
}
.toggle {
  width: 32px;
  height: 18px;
  border-radius: 99px;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  position: relative;
  transition: all 0.2s var(--ease);
  flex-shrink: 0;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 1px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  box-shadow: var(--shadow-xs);
  transition: all 0.22s var(--ease-snap);
}
.toggle[data-on="true"] {
  background: var(--ink);
  border-color: var(--ink);
}
[data-theme="dark"] .toggle[data-on="true"] { background: var(--accent); border-color: var(--accent); }
.toggle[data-on="true"]::after { left: 15px; }

/* ========================================
   Auth
   ======================================== */
/* ========================================
   Auth & Workspace - Premium Stoa UI
   ======================================== */
/* ========================================
   Auth & Workspace — Premium Stoa UI v3
   ======================================== */
body { margin: 0; padding: 0; overflow: hidden; font-family: var(--font-ui); }

:root {
  --color-ink: #1a1a1a;
  --color-ink-muted: rgba(26, 26, 26, 0.7);
  --color-line: rgba(0,0,0,0.08);
  --color-brand-blue: #1d3461;
  --color-brand-red: #9b1d20;
  --auth-theme: var(--color-brand-blue);
  --auth-glow: rgba(29, 52, 97, 0.18);
  --ws-theme: var(--color-brand-blue);
}

[data-variant="register"] {
  --auth-theme: var(--color-brand-blue);
  --auth-glow: rgba(29, 52, 97, 0.18);
}

[data-variant="ws-create"] {
  --auth-theme: var(--color-brand-blue);
  --auth-glow: rgba(29, 52, 97, 0.18);
  --ws-theme: var(--color-brand-blue);
}

[data-variant="ws-join"] {
  --auth-theme: var(--color-brand-blue);
  --auth-glow: rgba(29, 52, 97, 0.18);
  --ws-theme: var(--color-brand-blue);
}

/* Auth sayfası: dark temada metin renkleri */
[data-theme="dark"] {
  --color-ink: #ededea;
  --color-ink-muted: rgba(237, 237, 234, 0.62);
  --color-line: rgba(255, 255, 255, 0.09);
  --auth-glow: rgba(237, 237, 234, 0.07);
}
[data-theme="dark"] .glow-input {
  background: var(--bg-subtle);
  border-color: var(--line-strong);
  color: var(--ink);
}
[data-theme="dark"] .glow-input::placeholder { color: var(--ink-faint); }
[data-theme="dark"] .oauth-btn {
  background: var(--bg-raised);
  border-color: var(--line-strong);
  color: var(--ink);
}
[data-theme="dark"] .oauth-btn:hover { background: var(--bg-subtle); }
[data-theme="dark"] .auth-tabs { background: var(--bg-subtle); }
[data-theme="dark"] .auth-tabs button[data-active="true"] { background: var(--bg-raised); color: var(--ink); }

/* ─── LAYOUT ─────────────────────────────────────────────────── */
.auth-page {
  height: 100vh; width: 100vw; overflow: hidden;
  display: grid; grid-template-columns: 2fr 1fr;
  background: var(--bg);
}
.auth-visual {
  position: relative; height: 100vh; width: 100%;
  overflow: hidden; display: flex; flex-direction: column;
}
.auth-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(244, 241, 236, 0.48) 0%, rgba(244, 241, 236, 0.22) 48%, rgba(244, 241, 236, 0.04) 100%),
    radial-gradient(circle at 18% 28%, rgba(255,255,255,0.22), transparent 42%);
}
.workspace-page .auth-visual::after {
  display: none;
}

/* ─── AUTH — SLIDER (fotoğraf arka plan) ─────────────────────── */
.slider-container {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 1; background: #111;
}
.slide {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background-size: cover; background-position: center center;
  opacity: 0; transition: opacity 1.2s ease-in-out;
  /* Zoom KALDIRILDI - kenBurns animasyonu yok, sabit görüntü */
}
.slide.active { opacity: 1; }

.dust-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 2; pointer-events: none; opacity: 0.55;
}
.dust-particle {
  position: absolute; background: rgba(255,255,255,0.35);
  border-radius: 50%; animation: particleRise linear infinite;
}
@keyframes particleRise {
  0%   { transform: translateY(100vh) scale(1); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(-10vh) scale(0.5); opacity: 0; }
}

/* Glassmorphism panel */
.glass-content {
  position: relative; z-index: 3;
  margin: auto 48px 72px 8vw; padding: 40px;
  background: rgba(250, 248, 242, 0.82);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.62); border-radius: 12px;
  box-shadow: 0 16px 44px rgba(24,20,14,0.18); max-width: 540px;
}

/* Logo + Marka satırı */
.auth-brand-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 28px;
}
.auth-brand-text {
  font-family: var(--font-display); font-size: 40px;
  color: var(--color-ink); letter-spacing: -0.02em; line-height: 1;
}
.auth-brand-text em { color: var(--color-brand-blue); font-style: normal; }

.auth-hero h1 {
  font-family: var(--font-display); font-size: 34px; line-height: 1.2;
  letter-spacing: -0.015em; margin-bottom: 20px; color: var(--color-ink);
}
.auth-hero h1 em { font-style: italic; color: var(--color-brand-blue); }
.auth-hero p {
  font-size: 15.5px; color: var(--color-ink); line-height: 1.7;
  max-width: 44ch; margin-bottom: 32px; font-weight: 400; opacity: 0.85;
}

.stats-row {
  display: flex; gap: 32px; margin-top: 20px;
  padding-top: 16px; border-top: 1px solid var(--color-line);
}
.stats-row div { display: flex; flex-direction: column; gap: 4px; }
.stats-row strong { font-size: 24px; font-family: var(--font-display); color: var(--color-ink); }
.stats-row span { font-size: 12.5px; color: var(--color-ink-muted); }

/* ─── SAĞ TARAF ───────────────────────────────────────────────── */
.auth-form-wrap {
  height: 100vh; overflow-y: auto;
  display: flex; align-items: center; justify-content: center; padding: 48px;
}
.auth-form { width: 100%; max-width: 390px; }
.auth-form h2 {
  font-family: var(--font-display); font-size: 36px; letter-spacing: -0.015em;
  margin-bottom: 8px; color: var(--color-ink);
}
.auth-form p.sub { font-size: 14.5px; color: var(--color-ink-muted); margin-bottom: 32px; }

/* Tab butonları */
.auth-tabs {
  display: flex; gap: 4px; padding: 5px;
  background: #f1f1f0; border: 1px solid var(--color-line);
  border-radius: 8px; margin-bottom: 28px;
}
.tab-btn {
  flex: 1; padding: 10px; border-radius: 5px; font-size: 13.5px;
  color: var(--color-ink-muted); font-weight: 500;
  transition: all 0.3s ease; background: transparent; border: none; cursor: pointer;
}
.tab-btn[data-active="true"] { background: var(--auth-theme); color: white; }
.tab-btn:hover:not([data-active="true"]) { background: rgba(0,0,0,0.04); }

/* Input */
.auth-fields { display: flex; flex-direction: column; gap: 18px; margin-bottom: 24px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 11px; font-weight: 600; color: var(--color-ink-muted); letter-spacing: 0.5px; text-transform: uppercase; }
.glow-input {
  width: 100%; padding: 13px 15px; border: 1px solid var(--color-line);
  border-radius: 4px; background: white; transition: all 0.3s ease;
  font-size: 14.5px; box-sizing: border-box;
}
.glow-input:focus { outline: none; border-color: var(--auth-theme); box-shadow: 0 0 0 4px var(--auth-glow); }
.glow-input:disabled { opacity: 0.5; cursor: not-allowed; background: #f5f5f5; }

/* Şifre güç */
.password-strength-container {
  width: 100%; height: 4px; background: var(--color-line); border-radius: 2px;
  margin-top: -12px; margin-bottom: 12px; overflow: hidden; transition: all 0.3s ease;
}
.password-strength-container.hidden { height: 0; margin-top: 0; margin-bottom: 0; opacity: 0; }
.password-strength-bar { height: 100%; width: 0%; border-radius: 2px; transition: width 0.3s ease, background-color 0.3s ease; }

.password-header { display: flex; justify-content: space-between; align-items: center; }
.forgot-link { font-size: 12px; color: var(--auth-theme); text-decoration: none; font-weight: 500; cursor: pointer; }
.forgot-link:hover { opacity: 0.7; }
.password-wrapper { position: relative; width: 100%; }
.toggle-eye {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  cursor: pointer; color: var(--color-ink-muted); display: flex; transition: color 0.2s; z-index: 2;
}
.toggle-eye:hover { color: var(--auth-theme); }

/* Ana buton */
.auth-submit {
  width: 100%; display: flex; justify-content: center; align-items: center;
  height: 48px; background: var(--auth-theme); color: white;
  border-radius: 4px; font-size: 14px; font-weight: 600;
  transition: all 0.2s ease; border: none; cursor: pointer;
  text-transform: uppercase; letter-spacing: 0.8px;
}
.auth-submit:hover { filter: brightness(1.15); transform: translateY(-1px); box-shadow: 0 4px 12px var(--auth-glow); }
.auth-submit:active { transform: translateY(0); }
.auth-submit[disabled] { opacity: 0.7; cursor: not-allowed; transform: none; box-shadow: none; }

/* OAuth */
.auth-divider {
  display: flex; align-items: center; gap: 16px;
  font-size: 12px; color: var(--color-ink-muted); margin: 24px 0;
}
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--color-line); }
.auth-oauth-list { display: flex; flex-direction: column; gap: 12px; }
.oauth-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; padding: 12px; border: 1px solid var(--color-line);
  border-radius: 4px; background: white; color: var(--color-ink);
  font-size: 14px; font-weight: 500; transition: all 0.2s ease;
  cursor: pointer; font-family: inherit;
}
.oauth-btn:hover { background: #fbfbfa; border-color: rgba(0,0,0,0.15); transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0,0,0,0.03); }
.oauth-btn svg { width: 18px; height: 18px; }

/* OAuth hata popup */
.oauth-error-popup {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  padding: 16px; background: #fff5f5; border: 1.5px solid #fca5a5;
  border-radius: 8px; margin-bottom: 20px;
}
.oauth-error-icon { font-size: 22px; }
.oauth-error-text strong { font-size: 14px; color: #991b1b; display: block; margin-bottom: 4px; }
.oauth-error-text p { font-size: 13px; color: #7f1d1d; margin: 0; }
.oauth-error-close { position: absolute; top: 12px; right: 12px; background: none; border: none; cursor: pointer; color: #9ca3af; padding: 4px; display: flex; }
.oauth-error-close:hover { color: #ef4444; }
.oauth-error-back {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
  background: #ef4444; color: white; border: none; border-radius: 4px;
  font-size: 13px; font-weight: 600; cursor: pointer; width: fit-content;
}
.oauth-error-back:hover { background: #dc2626; }

/* Hata + titreme */
.shake { animation: shakeError 0.4s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shakeError {
  10%, 90% { transform: translate3d(-2px,0,0); }
  20%, 80% { transform: translate3d(3px,0,0); }
  30%, 50%, 70% { transform: translate3d(-5px,0,0); }
  40%, 60% { transform: translate3d(5px,0,0); }
}
.error-msg {
  padding: 10px 14px; border-radius: 4px; background: #fef2f2;
  border: 1px solid #fecaca; color: #ef4444; font-size: 13px;
  margin-bottom: 16px; animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.auth-foot { text-align: center; margin-top: 24px; font-size: 13.5px; color: var(--color-ink-muted); }
.auth-foot a { color: var(--auth-theme); font-weight: 500; cursor: pointer; text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }

/* Room blueprint info kutusu */
.room-blueprint {
  padding: 18px; background: rgba(26,26,26,0.02);
  border: 1px dashed rgba(26,26,26,0.2); border-radius: 8px;
  font-size: 13px; color: var(--color-ink-muted); line-height: 1.6;
}
.room-blueprint strong { color: var(--color-ink); display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; }

/* Ağ durumu kartı */
.user-session-card {
  display: flex; align-items: center; gap: 14px; padding: 14px;
  background: white; border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
  margin-bottom: 24px; transition: all 0.8s ease;
}
.net-online { border: 1px solid rgba(34,197,94,0.3); }
.net-offline { border: 1.5px solid #fca5a5; background: #fff5f5; animation: pulseRed 2s ease-in-out infinite; }
.net-flash   { border: 1.5px solid rgba(34,197,94,0.5); background: #f0fdf4; }
@keyframes pulseRed {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.15); }
  50%       { box-shadow: 0 0 0 6px rgba(239,68,68,0.05); }
}

/* Logo avatar (kullanıcı avatarı yerine StoaBoard logosu) */
.ws-logo-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
  transition: background 0.8s ease;
}

/* ─── WORKSPACE SOL TARAF — BLUEPRINT ──────────────────────────── */
.ws-blueprint-bg {
  position: relative;
  transition: background 0.7s ease;
}
.ws-bp-overlay {
  position: absolute; inset: 0; z-index: 0;
  transition: background 0.7s ease;
  pointer-events: none;
}

/* Blueprint içerik — DİKEY DAĞILIM DÜZELTİLDİ */
.ws-blueprint-content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  padding: 36px 5vw 36px 5vw;   /* üst/alt eşit padding */
  height: 100%; box-sizing: border-box; overflow: hidden;
  justify-content: flex-start;   /* üstten başla, altta boşluk kalır */
  gap: 0;
}

.ws-brand { font-size: 34px !important; }

/* Blueprint çizim — orta alanda geniş yer kaplasın */
.ws-blueprint-drawing {
  margin: 4px -8px 0 -8px;
  opacity: 0.88;
  flex-shrink: 0;
}

/* Alt metin + istatistikler — mimarinin hemen altına yapıştırılmış, asla ekran dışında */
.ws-bp-bottom {
  margin-top: 18px;
  flex-shrink: 0;
}

.ws-bp-title {
  font-family: var(--font-display);
  font-size: 28px; line-height: 1.2;       /* küçültüldü: 36 → 28 */
  letter-spacing: -0.01em; margin-bottom: 6px;
  transition: color 0.5s ease;
}
.ws-bp-subtitle {
  font-size: 13px; line-height: 1.55;      /* küçültüldü: 14 → 13 */
  max-width: 50ch; margin-bottom: 16px;
  transition: color 0.5s ease;
}

/* İstatistik bar */
.ws-bp-stats {
  display: flex; gap: 20px; flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: 8px; margin-bottom: 14px;
  transition: all 0.5s ease;
}
.ws-bp-stats div { display: flex; flex-direction: column; gap: 2px; }
.ws-bp-stats strong { font-size: 19px; font-family: var(--font-display); transition: color 0.5s ease; }
.ws-bp-stats span { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.04em; transition: color 0.5s ease; }

.ws-bp-footer {
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  transition: color 0.5s ease;
}

/* ─── ODA ROZETİ ÖNİZLEMESİ (oda kur) ─────────────────────────── */
.room-badge-preview {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 8px;
  background: white; border: 1.5px solid var(--color-brand-blue);
  box-shadow: 0 4px 16px rgba(29,52,97,0.12);
  animation: fadeIn 0.3s ease;
  margin-top: -8px;
}
.room-badge-icon {
  width: 38px; height: 38px; border-radius: 8px;
  display: grid; place-items: center; font-size: 18px; flex-shrink: 0;
}
.room-badge-name { font-size: 14px; font-weight: 600; color: var(--color-ink); line-height: 1.3; }
.room-badge-type { font-size: 11px; color: var(--color-ink-muted); margin-top: 2px; }
.room-badge-live {
  margin-left: auto; font-size: 9px; font-weight: 700;
  color: var(--color-brand-blue); letter-spacing: 0.08em;
  background: rgba(29,52,97,0.08); padding: 4px 8px; border-radius: 4px;
  border: 1px solid rgba(29,52,97,0.15); flex-shrink: 0;
}

/* ─── ŞABLON SEÇİCİ ─────────────────────────────────────────────── */
.template-selector { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.template-card {
  position: relative; padding: 14px 12px; border-radius: 8px;
  border: 1.5px solid var(--color-line); background: white;
  cursor: pointer; transition: all 0.2s ease; text-align: center;
}
.template-card:hover { border-color: var(--auth-theme); background: rgba(26,26,26,0.02); transform: translateY(-1px); }
.template-card.selected { border-color: var(--auth-theme); background: rgba(26,26,26,0.04); box-shadow: 0 4px 12px var(--auth-glow); }
.template-icon { font-size: 22px; margin-bottom: 6px; }
.template-title { font-size: 11px; font-weight: 600; color: var(--color-ink); line-height: 1.3; margin-bottom: 4px; }
.template-desc  { font-size: 10px; color: var(--color-ink-muted); line-height: 1.4; }
.template-check { position: absolute; top: 6px; right: 8px; font-size: 11px; color: var(--auth-theme); font-weight: 700; }

/* ─── ODAYA KATIL — DOĞRULAMA ÖNİZLEME KARTI ───────────────────── */
.join-room-preview {
  padding: 14px 16px; border-radius: 8px;
  background: white;
  border: 1.5px solid var(--color-brand-blue);
  box-shadow: 0 4px 16px rgba(29,52,97,0.12);
  margin-top: -8px;
}
.join-room-status {
  display: flex; align-items: center; gap: 7px; margin-bottom: 6px;
}
.join-room-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,0.2);
  animation: pulseDot 1.8s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(34,197,94,0.2); }
  50%       { box-shadow: 0 0 0 6px rgba(34,197,94,0.08); }
}
.join-room-verified {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: #16a34a;
}
.join-room-name {
  font-size: 15px; font-weight: 700; color: var(--color-ink);
  margin-bottom: 5px; line-height: 1.3;
}
.join-room-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--color-ink-muted);
}
.join-room-meta strong { color: var(--color-ink); }

/* ─── GÜVENLİK PROTOKOLÜ NOTU ──────────────────────────────────── */
.security-note {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-radius: 8px;
  background: rgba(29,52,97,0.04);
  border: 1px solid rgba(29,52,97,0.14);
}
.security-note-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: rgba(29,52,97,0.1);
  border: 1px solid rgba(29,52,97,0.18);
  display: grid; place-items: center;
  color: var(--color-brand-blue); flex-shrink: 0;
}
.security-note-text { flex: 1; }
.security-note-title {
  font-size: 12px; font-weight: 700;
  color: var(--color-brand-blue);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 5px;
}
.security-note-body {
  font-size: 12px; color: var(--color-ink-muted);
  line-height: 1.55;
}


/* ========================================
   Settings
   ======================================== */
.settings-wrap {
  flex: 1;
  overflow: auto;
  padding: 32px 40px;
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
}
.settings-wrap h1 {
  font-family: var(--font-display);
  font-size: 36px;
  letter-spacing: -0.015em;
  margin-bottom: 4px;
}
.settings-wrap h1 em { font-style: italic; color: var(--ink-muted); }
.settings-sub { color: var(--ink-muted); margin-bottom: 32px; }
.settings-section {
  padding: 24px 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
}
.settings-section h3 {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: -0.005em;
  margin-bottom: 4px;
}
.settings-section .desc {
  font-size: 13px;
  color: var(--ink-muted);
  max-width: 32ch;
}
.settings-card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-xs);
}
.settings-card + .settings-card {
  margin-top: 18px;
}
/* ── Label management rows ── */
.label-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  transition: background 0.12s;
}
.label-row:hover { background: var(--bg-subtle); }
.label-row-slug {
  flex: 1;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--ink-dim);
}
.label-row-del {
  opacity: 0;
  color: var(--status-rose) !important;
  transition: opacity 0.15s;
}
.label-row:hover .label-row-del { opacity: 1; }

.label-add-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--bg-subtle);
  flex-wrap: wrap;
}
.label-add-input {
  flex: 1;
  min-width: 130px;
  padding: 9px 14px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 13px;
  font-family: var(--font-ui);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.label-add-input::placeholder { color: var(--ink-faint); }
.label-add-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.label-tone-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.label-tone-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid transparent;
  outline: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s, outline 0.15s;
}
.label-tone-dot[data-active="true"] {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  transform: scale(1.2);
}

.settings-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.settings-card.members-panel {
  padding: 0;
}
.member-row:first-child { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.member-row:last-child  { border-radius: 0 0 var(--r-lg) var(--r-lg); border-bottom: none; }
.settings-panel.members-panel {
  gap: 0;
  padding: 0;
}
.member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  transition: background 0.12s;
}
.member-row:not(:last-child) { border-bottom: 1px solid var(--line); }
.member-row:hover { background: var(--bg-subtle); }
.member-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.03em;
  background: oklch(65% 0.11 70 / 0.14);
  color: oklch(44% 0.10 70);
  border: 1px solid oklch(65% 0.11 70 / 0.22);
}
[data-theme="dark"] .member-badge {
  background: oklch(65% 0.11 70 / 0.18);
  color: oklch(72% 0.11 70);
  border-color: oklch(65% 0.11 70 / 0.28);
}
.danger-confirm {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid oklch(58% 0.13 10 / 0.3);
  border-radius: 10px;
  background: oklch(58% 0.13 10 / 0.06);
}
.danger-confirm strong {
  color: var(--status-rose);
  font-size: 13px;
}
.danger-confirm p {
  color: var(--ink-muted);
  font-size: 12px;
  margin-top: 2px;
}
.danger-confirm input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-raised);
  outline: none;
}
.danger-confirm input:focus {
  border-color: var(--status-rose);
}
.inline-error {
  color: var(--status-rose);
  font-size: 12px;
}
.settings-panel-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.settings-panel-row.full {
  grid-template-columns: 1fr;
}

/* Utility */
.sr { position: absolute; left: -9999px; }
.hide-on-collapse { }
.spacer { flex: 1; }

/* Icon sizing */
.icon { display: inline-flex; flex-shrink: 0; }

/* ========================================
   Online status badge
   ======================================== */
.online-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-dim);
  border: 1.5px solid var(--bg);
}
.online-badge.is-online {
  background: var(--status-green);
}

/* ========================================
   Chat panel
   ======================================== */
.chat-overlay {
  position: fixed;
  inset: 0;
  z-index: 54;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease);
}
.chat-overlay[data-open="true"] {
  opacity: 1;
  pointer-events: all;
}

.chat-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 380px;
  max-width: 96vw;
  background: var(--bg-raised);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  z-index: 55;
  transform: translateX(100%);
  transition: transform 0.3s var(--ease);
  display: flex;
  flex-direction: column;
}
.chat-panel[data-open="true"] { transform: translateX(0); }
.chat-panel[data-full-page="true"] {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  transform: none !important;
  border-left: none;
  z-index: 10;
  box-shadow: none;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  min-height: 54px;
}
.chat-head-title {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: -0.005em;
}

.chat-tabs {
  display: flex;
  gap: 2px;
  padding: 8px 12px 0;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.chat-tabs button {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 7px 7px 0 0;
  font-size: 12.5px;
  color: var(--ink-muted);
  border-bottom: 2px solid transparent;
  transition: all 0.12s var(--ease);
  margin-bottom: -1px;
}
.chat-tabs button:hover { color: var(--ink); }
.chat-tabs button[data-active="true"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
  font-weight: 500;
}

.chat-member-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
}
.chat-member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s var(--ease);
}
.chat-member-row:hover { background: var(--bg-subtle); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-muted);
}

.chat-msg {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  max-width: 100%;
}
.chat-msg.mine {
  flex-direction: row-reverse;
}
.chat-msg-avatar { flex-shrink: 0; }

.chat-bubble-wrap {
  display: flex;
  flex-direction: column;
  max-width: 72%;
}
.chat-msg.mine .chat-bubble-wrap { align-items: flex-end; }

.chat-sender-name {
  font-size: 10.5px;
  color: var(--ink-muted);
  margin-bottom: 2px;
  padding-left: 2px;
}

.chat-bubble {
  position: relative;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
  background: var(--bg-subtle);
  color: var(--ink);
  border: 1px solid var(--line);
}
.chat-msg.mine .chat-bubble {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
[data-theme="dark"] .chat-msg.mine .chat-bubble { background: var(--accent); border-color: var(--accent); }

.chat-msg-time {
  font-size: 10px;
  color: var(--ink-faint);
  margin-top: 2px;
  padding: 0 2px;
}

.chat-bubble-deleted {
  opacity: 0.6;
  border-style: dashed !important;
}

.chat-msg-action-btn {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  color: var(--ink-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s, background 0.12s;
  margin-bottom: 2px;
}
.chat-msg:hover .chat-msg-action-btn { opacity: 1; pointer-events: auto; }
.chat-msg-action-btn:hover { background: var(--bg-subtle); color: var(--ink); }

.chat-msg-react-btn {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s, background 0.12s;
  margin-bottom: 2px;
  font-size: 12px; line-height: 1;
}
.chat-msg:hover .chat-msg-react-btn { opacity: 1; pointer-events: auto; }
.chat-msg-react-btn:hover { background: var(--bg-subtle); }

.chat-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
  padding: 0 2px;
}
.chat-reaction-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px 2px 6px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--bg-subtle);
  font-size: 14px; line-height: 1.5;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.1s;
  user-select: none;
}
.chat-reaction-btn span {
  font-size: 11px; font-weight: 600;
  color: var(--ink-muted);
  line-height: 1;
}
.chat-reaction-btn:hover {
  background: var(--bg-raised);
  border-color: var(--line-strong);
  transform: scale(1.08);
}
.chat-reaction-btn[data-mine="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.chat-reaction-btn[data-mine="true"] span { color: var(--accent-ink); }

.chat-emoji-opt {
  padding: 5px 6px;
  border-radius: 8px;
  border: none;
  background: none;
  font-size: 20px; line-height: 1;
  cursor: pointer;
  transition: transform 0.1s, background 0.1s;
}
.chat-emoji-opt:hover {
  background: var(--bg-sunken);
  transform: scale(1.3);
}

.chat-menu-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 14px;
  font-size: 13px; color: var(--ink);
  background: none; cursor: pointer; text-align: left;
}
.chat-menu-item:hover { background: var(--bg-subtle); }

.chat-tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--status-yellow); color: #fff;
  font-size: 9px; font-weight: 700;
  min-width: 14px; height: 14px; border-radius: 7px;
  padding: 0 3px; margin-left: 3px;
}

.chat-starred-list {
  flex: 1; overflow-y: auto; padding: 8px 0;
}
.chat-starred-item {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}
.chat-starred-item:last-child { border-bottom: none; }
.chat-starred-meta {
  display: flex; align-items: center; gap: 7px;
  margin-bottom: 5px;
}
.chat-starred-name { font-size: 12px; font-weight: 600; color: var(--ink); }
.chat-starred-time { font-size: 10px; color: var(--ink-faint); }
.chat-starred-body {
  font-size: 13px; color: var(--ink);
  padding-left: 28px;
  word-break: break-word;
}


.chat-typing-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 2px;
  font-size: 11px;
  color: var(--ink-muted);
}
.typing-dots {
  display: flex;
  gap: 3px;
}
.typing-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ink-faint);
  animation: typingBounce 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

.chat-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  padding: 9px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 13px;
  resize: none;
  min-height: 40px;
  max-height: 120px;
  outline: none;
  transition: border-color 0.15s;
  font-family: var(--font-ui);
  overflow-y: auto;
}
.chat-input:focus { border-color: var(--accent); }

/* ── Chat bubble sending state ─── */
.chat-bubble-sending { opacity: 0.6; }

/* ── Chat media ─── */
.chat-media-wrap { display: flex; flex-direction: column; gap: 6px; }
.chat-media-img {
  max-width: 260px;
  max-height: 220px;
  border-radius: 8px;
  object-fit: cover;
  cursor: zoom-in;
  display: block;
  transition: opacity 0.15s;
}
.chat-media-img:hover { opacity: 0.92; }
.chat-media-video {
  max-width: 280px;
  border-radius: 8px;
  display: block;
}
.chat-file-attach {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  min-width: 160px;
  max-width: 240px;
}
.chat-file-attach a { color: var(--ink); text-decoration: none; }
.chat-file-attach a:hover { text-decoration: underline; }
.chat-bubble-text { margin-top: 4px; font-size: 13px; }

/* ── Pending file preview bar ─── */
.chat-pending-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--accent-soft);
  border-top: 1px solid var(--line);
  flex-shrink: 0;
  font-size: 12px;
  color: var(--ink-muted);
}

/* Placeholder image */
.placeholder-img {
  background:
    repeating-linear-gradient(
      45deg,
      var(--bg-subtle),
      var(--bg-subtle) 8px,
      var(--bg-sunken) 8px,
      var(--bg-sunken) 12px
    );
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  text-align: center;
  padding: 16px;
}

/* ========================================
   Responsive — Mobile & Tablet
   ======================================== */

.mobile-menu-btn {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  transition: all 0.12s var(--ease);
  flex-shrink: 0;
}
.mobile-menu-btn:hover { background: var(--bg-subtle); color: var(--ink); }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}
.sidebar-backdrop[data-open="true"] {
  opacity: 1;
  pointer-events: all;
}

@media (max-width: 768px) {

  /* ── Hamburger ── */
  .mobile-menu-btn { display: flex; }

  /* ── App: tek sütun ── */
  .app { grid-template-columns: 1fr; }

  /* ── Sidebar: overlay ── */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    z-index: 100;
    transform: translateX(-100%);
    width: 252px !important;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s var(--ease), width 0.3s var(--ease);
  }
  .sidebar[data-mobile-open="true"] { transform: translateX(0); }

  /* Collapsed durumu override et — tam genişlik göster */
  .sidebar .sidebar-label,
  .sidebar .sidebar-section-title,
  .sidebar .ws-info,
  .sidebar .ws-arrow,
  .sidebar .nav-badge,
  .sidebar .project-meta,
  .sidebar .user-meta,
  .sidebar .sidebar-logo-text { display: initial !important; }
  .sidebar .sidebar-search,
  .sidebar .workspace-switcher { display: flex !important; }
  .sidebar .nav-item,
  .sidebar .project-item {
    justify-content: flex-start !important;
    padding: 7px 10px !important;
    width: auto !important;
    margin: 0 !important;
    border-radius: 7px !important;
  }
  .sidebar .sidebar-collapse-btn { display: none !important; }
  .sidebar .user-profile { justify-content: flex-start !important; padding: 6px 8px !important; }
  .sidebar .sidebar-footer { padding: 12px !important; }

  /* ── Backdrop ── */
  .sidebar-backdrop { display: block; }

  /* ── Topbar ── */
  .topbar { padding: 10px 14px; gap: 8px; min-height: 52px; }
  .topbar-crumbs { font-size: 12px; gap: 5px; }
  .topbar-crumbs .current { font-size: 14px; }
  .topbar-right { gap: 4px; }
  .view-switch { display: none; }

  /* ── Modal ── */
  .modal-overlay {
    align-items: flex-end;
    padding: 0 0 env(safe-area-inset-bottom, 0);
  }
  .modal {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 90vh;
    border-radius: 20px 20px 0 0 !important;
  }
  .modal-head { padding: 16px 18px 12px; }
  .modal-title { font-size: 20px; }
  .modal-body { padding: 14px 18px; gap: 14px; }
  .modal-foot { padding: 12px 18px 20px; }

  /* ── Drawer ── */
  .drawer {
    width: 100vw !important;
    max-width: 100vw !important;
    border-radius: 0 !important;
    border-left: none !important;
  }
  .drawer-body { padding: 16px 20px 60px; }
  .drawer-fullscreen-btn { display: none; }
  .doc-title { font-size: 28px; }
  .props-grid { grid-template-columns: 100px 1fr; gap: 4px 12px; }

  /* ── Dashboard ── */
  .dash { padding: 16px; }
  .dash-h1 { font-size: 26px; }
  .dash-sub { margin-bottom: 20px; }
  .dash-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
  .dash-row { grid-template-columns: 1fr; }
  .stat-value { font-size: 32px; }

  /* ── Calendar ── */
  .cal-wrap { padding: 10px 12px 16px; }
  .cal-header { flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 12px; }
  .cal-header-actions { margin-left: 0; flex-wrap: wrap; }
  .cal-summary { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .cal-month { font-size: 20px; }

  /* ── Liste görünümü ── */
  .list-view { padding: 8px 12px 16px; }

  /* ── Pano ── */
  .board { padding: 12px 12px 4px; gap: 10px; -webkit-overflow-scrolling: touch; }
  .column { min-width: 260px; }

  /* ── Bildirim paneli ── */
  .notif-panel {
    width: calc(100vw - 24px);
    right: 12px;
    left: 12px;
    max-height: calc(100vh - 70px);
  }

  /* ── Chat paneli ── */
  .chat-panel {
    width: 100vw !important;
    max-width: 100vw !important;
  }

  /* ── Ayarlar ── */
  .settings-wrap { padding: 16px; overflow-x: hidden; }
  .settings-wrap h1 { font-size: 26px; }
  .settings-section { grid-template-columns: 1fr; gap: 16px; }
  .settings-panel-row { grid-template-columns: 1fr; }
  .settings-card { padding: 16px; overflow: hidden; min-width: 0; }
  .settings-card input,
  .settings-card select,
  .settings-card textarea { max-width: 100%; box-sizing: border-box; min-width: 0; }
  /* Member row: wrap on narrow screens */
  .member-row { flex-wrap: wrap; padding: 10px 12px; gap: 8px; }
  .member-row select { max-width: 100%; min-width: 0; font-size: 12px; }
  /* Tweak options: ensure they wrap */
  .tweak-options { flex-wrap: wrap; }
  .tweak-opt { flex-shrink: 0; }

  /* ── Auth sayfası ── */
  .auth-page { grid-template-columns: 1fr; }
  .auth-visual { display: none !important; }
  .auth-form-wrap { padding: 32px 20px; align-items: flex-start; }
  .auth-form h2 { font-size: 28px; }
  .auth-form input { max-width: 100%; box-sizing: border-box; }
  .glow-input { font-size: 16px !important; } /* prevent iOS zoom on focus */
  .field input, .field textarea, .field select { font-size: 16px; }
  .settings-card input, .settings-card select, .settings-card textarea { font-size: 16px; }
  .template-selector { grid-template-columns: repeat(2, 1fr) !important; }
  .ws-bp-stats { grid-template-columns: repeat(2, 1fr) !important; }

  /* ── Alan satırları: alt alta ── */
  .field-row { grid-template-columns: 1fr; gap: 12px; }

  /* ── Alt bar ── */
  .subbar { padding: 8px 12px; gap: 6px; overflow-x: auto; }

  /* ── Trash zone: tam genişlik şerit ── */
  .board-trash-zone {
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    transform: none;
    border-radius: 16px;
    padding: 14px 20px;
    font-size: 14px;
  }
  .board-trash-zone[data-hover="true"] {
    transform: scale(1.02);
  }
  @keyframes trashZoneIn {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
  }
}

@media (max-width: 480px) {
  .dash-grid { grid-template-columns: 1fr; }
  .cal-summary { grid-template-columns: 1fr; }
  .modal { border-radius: 16px 16px 0 0 !important; }
  /* Topbar'da sadece mevcut sayfayı göster */
  .topbar-crumbs > span:not(.current),
  .topbar-crumbs .sep { display: none; }

  /* ── Trash zone: daha büyük dokunma hedefi ── */
  .board-trash-zone {
    left: 8px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    border-radius: 14px;
    padding: 16px 20px;
    font-size: 14px;
  }
}
