/* ═══════════════════════════════════════════════
   TeamBoard — design system
   ═══════════════════════════════════════════════ */
:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --bg: #f4f5f9;
  --surface: #ffffff;
  --surface-2: #f1f2f7;
  --border: #e4e6ef;
  --text: #1c2130;
  --text-2: #5a6072;
  --text-3: #9aa0b3;
  --accent: #5b5fc7;
  --accent-2: #7a7fe0;
  --accent-ink: #ffffff;
  --danger: #e5484d;
  --ok: #2e9e6b;
  --warn: #e2a500;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(20, 24, 45, .06), 0 1px 3px rgba(20, 24, 45, .05);
  --shadow-md: 0 6px 16px rgba(20, 24, 45, .10), 0 2px 6px rgba(20, 24, 45, .06);
  --shadow-lg: 0 24px 60px rgba(20, 24, 45, .22), 0 8px 20px rgba(20, 24, 45, .12);
  --topbar-h: 56px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button { font-family: var(--font); cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: var(--font); font-size: 14px; color: var(--text); }
input:focus, textarea:focus, select:focus, [contenteditable]:focus { outline: 2px solid var(--accent-2); outline-offset: 1px; }
a { color: var(--accent); text-decoration: none; }
::placeholder { color: var(--text-3); }

/* ── Scrollbars ── */
::-webkit-scrollbar { height: 12px; width: 10px; }
::-webkit-scrollbar-thumb { background: rgba(120, 126, 150, .35); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 13.5px; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border);
  transition: all .15s ease; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-2); color: #fff; }
.btn-danger { color: var(--danger); border-color: #f2c4c6; }
.btn-danger:hover { background: #fdecec; color: var(--danger); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: rgba(255,255,255,.2); color: inherit; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ── Top bar (app-wide) ── */
.app-topbar {
  height: var(--topbar-h);
  background: var(--text);
  color: #fff;
  display: flex; align-items: center; gap: 16px;
  padding: 0 18px;
  position: sticky; top: 0; z-index: 40;
  box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 2px 8px rgba(0,0,0,.18);
}
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.logo .mark {
  width: 26px; height: 26px; border-radius: 7px; background: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 13px;
}
.search-box {
  flex: 1; max-width: 460px; margin: 0 auto; position: relative;
}
.search-box input {
  width: 100%; padding: 8px 14px 8px 36px; border-radius: 9px;
  border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.1);
  color: #fff; font-size: 13.5px;
}
.search-box input::placeholder { color: rgba(255,255,255,.55); }
.search-box .s-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,.6); pointer-events: none; }
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  color: var(--text); overflow: hidden; z-index: 60; max-height: 380px; overflow-y: auto;
}
.search-results .sr-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--border); }
.search-results .sr-item:hover { background: var(--surface-2); }
.search-results .sr-item .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.search-results .sr-item .t { font-weight: 600; }
.search-results .sr-item .m { color: var(--text-3); font-size: 12px; }
.search-results .sr-empty { padding: 14px; color: var(--text-3); text-align: center; }

.user-chip {
  display: flex; align-items: center; gap: 9px; position: relative;
  padding: 6px 10px; border-radius: 9px; cursor: pointer;
}
.user-chip:hover { background: rgba(255,255,255,.12); }
.user-chip .avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; color: #fff; }
.user-chip .caret { font-size: 10px; color: rgba(255,255,255,.6); }
.user-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 180px;
  background: var(--surface); color: var(--text); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 6px; z-index: 70;
}
.user-menu .um-name { padding: 8px 10px 4px; font-weight: 600; }
.user-menu .um-mail { padding: 0 10px 8px; color: var(--text-3); font-size: 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.user-menu button { width: 100%; text-align: left; padding: 8px 10px; border-radius: 7px; font-weight: 500; }
.user-menu button:hover { background: var(--surface-2); }

/* ── Auth ── */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 700px at 20% -10%, #6b70dd 0%, transparent 55%),
              radial-gradient(1000px 600px at 110% 110%, #2e9e6b 0%, transparent 50%),
              #10142a;
  padding: 24px;
}
.auth-card {
  width: 100%; max-width: 400px; background: var(--surface);
  border-radius: 20px; box-shadow: var(--shadow-lg); padding: 34px 34px 30px;
  animation: rise .35s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.auth-card .logo { color: var(--text); justify-content: center; font-size: 22px; margin-bottom: 4px; }
.auth-card .logo .mark { width: 34px; height: 34px; border-radius: 9px; font-size: 17px; }
.auth-tagline { text-align: center; color: var(--text-2); font-size: 13.5px; margin-bottom: 22px; }
.auth-tabs { display: flex; background: var(--surface-2); border-radius: 10px; padding: 4px; margin-bottom: 20px; }
.auth-tabs button { flex: 1; padding: 8px; border-radius: 8px; font-weight: 600; color: var(--text-2); font-size: 13.5px; transition: all .15s; }
.auth-tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px;
  font-size: 14px; transition: border .15s;
}
.field input:focus { border-color: var(--accent-2); outline: none; }
.auth-err { background: #fdecec; color: var(--danger); border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-bottom: 14px; display: none; }
.auth-note { text-align: center; font-size: 12.5px; color: var(--text-3); margin-top: 16px; }

/* ── Boards view ── */
.boards-main { max-width: 1080px; margin: 0 auto; padding: 30px 22px 60px; }
.boards-title { font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 4px; }
.boards-sub { color: var(--text-2); font-size: 13.5px; margin-bottom: 22px; }
.invites-banner {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: linear-gradient(90deg, #eef0ff, #f6fbff);
  border: 1px solid #d8dcff; border-radius: var(--radius); padding: 13px 16px; margin-bottom: 22px;
}
.invites-banner .txt { flex: 1; font-weight: 600; }
.invites-banner .txt small { display: block; font-weight: 400; color: var(--text-2); }
.boards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.board-tile {
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  background: var(--surface); box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  transition: transform .16s ease, box-shadow .16s ease;
  animation: rise .3s ease both;
}
.board-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.board-tile .bt-cover { height: 88px; position: relative; }
.board-tile .bt-cover .bt-name { position: absolute; left: 12px; bottom: 10px; color: #fff; font-weight: 700; font-size: 15px; text-shadow: 0 1px 3px rgba(0,0,0,.35); }
.board-tile .bt-meta { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; color: var(--text-3); font-size: 12px; }
.create-tile {
  border: 2px dashed #c9cde2; background: transparent; border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--text-2); font-weight: 600; min-height: 150px; cursor: pointer; transition: all .15s;
}
.create-tile:hover { border-color: var(--accent); color: var(--accent); background: #f7f7ff; }
.create-tile .plus { font-size: 26px; font-weight: 300; line-height: 1; }
.board-name-input { border: none; font-size: 16px; font-weight: 700; padding: 8px 12px; width: 100%; border-radius: 8px; }

/* ── Board view ── */
.board-view { min-height: 100vh; display: flex; flex-direction: column; position: relative; }
.board-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; transition: opacity .6s ease; }
.board-video.loop-fade { opacity: 0; }
.board-video-overlay { position: absolute; inset: 0; z-index: 1; background: linear-gradient(rgba(10,14,30,.32), rgba(10,14,30,.58)); }
.board-topbar, .board-scroll { position: relative; z-index: 2; }
.vid-swatch { display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.92); font-size: 13px; text-shadow: 0 1px 3px rgba(0,0,0,.55); }
.vid-swatch:hover { transform: scale(1.08); }
.board-topbar {
  height: var(--topbar-h); display: flex; align-items: center; gap: 10px; padding: 0 14px;
  background: rgba(0,0,0,.22); color: #fff; backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 40;
}
.board-topbar .back-btn { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; font-weight: 600; font-size: 13px; color: rgba(255,255,255,.92); }
.board-topbar .back-btn:hover { background: rgba(255,255,255,.16); }
.board-title { font-size: 16px; font-weight: 800; padding: 6px 10px; border-radius: 8px; cursor: text; }
.board-title:hover { background: rgba(255,255,255,.14); }
.board-title:focus { outline: none; background: rgba(255,255,255,.2); }
.board-topbar .spacer { flex: 1; }
.board-avatars { display: flex; }
.board-avatars .avatar { width: 28px; height: 28px; margin-left: -7px; border: 2px solid rgba(0,0,0,.3); }
.board-avatars .avatar:first-child { margin-left: 0; }
.topbtn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 8px; font-weight: 600; font-size: 13px; color: rgba(255,255,255,.92); }
.topbtn:hover { background: rgba(255,255,255,.16); }

.board-scroll { flex: 1; display: flex; align-items: flex-start; padding: 16px 14px 24px; overflow-x: auto; }
.lists-wrap { display: flex; align-items: flex-start; gap: 12px; min-height: 100%; }
.list {
  width: 272px; flex: none; background: var(--surface);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; max-height: calc(100vh - var(--topbar-h) - 46px);
  position: relative;
  animation: rise .25s ease both;
}
.list-header { display: flex; align-items: center; gap: 6px; padding: 11px 10px 8px 14px; }
.list-title { flex: 1; font-weight: 700; font-size: 14px; padding: 4px 6px; border-radius: 6px; cursor: text; }
.list-title:hover { background: var(--surface-2); }
.list-title:focus { outline: none; background: var(--surface-2); }
.list-count { background: var(--surface-2); color: var(--text-2); font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.list-menu-btn { padding: 4px 7px; border-radius: 6px; color: var(--text-3); font-weight: 800; letter-spacing: 1px; }
.list-menu-btn:hover { background: var(--surface-2); color: var(--text); }
.menu-pop {
  position: absolute; z-index: 80; min-width: 180px; background: var(--surface);
  color: var(--text);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px;
}
.menu-pop button { display: block; width: 100%; text-align: left; padding: 8px 11px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.menu-pop button:hover { background: var(--surface-2); color: var(--text); }
.menu-pop .mp-danger { color: var(--danger); }
.menu-pop .mp-danger:hover { background: #fdecec; }

.list-cards { padding: 2px 8px 4px; overflow-y: auto; flex: 1; min-height: 8px; }
.card {
  background: var(--surface); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  padding: 9px 11px; margin-bottom: 8px; cursor: grab; position: relative;
  transition: box-shadow .13s ease, transform .13s ease;
}
.card:hover { box-shadow: var(--shadow-md); }
.card:active { cursor: grabbing; }
.card-cover { height: 46px; border-radius: 6px; margin: -9px -11px 7px; }
.card-labels { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 5px; }
.label-chip { width: 34px; height: 8px; border-radius: 3px; cursor: pointer; }
.card-title { font-size: 13.5px; font-weight: 500; word-break: break-word; }
.card-badges { display: flex; align-items: center; gap: 8px; margin-top: 7px; font-size: 11.5px; color: var(--text-2); }
.card-badges .badge { display: inline-flex; align-items: center; gap: 4px; }
.card-badges .badge.overdue { color: var(--danger); font-weight: 700; }
.card-badges .avatar { width: 20px; height: 20px; font-size: 9px; margin-left: -4px; }
.card-badges .avatar:first-child { margin-left: 4px; }
.card.ghost { opacity: .4; }
.card.chosen { box-shadow: var(--shadow-lg); transform: rotate(2deg); }
/* urgency highlighting */
.card.overdue { border-left: 4px solid var(--danger); background: #fff8f8; }
.card.overdue .card-title { color: #c0392b; }
.card.due-today { border-left: 4px solid var(--warn); }
.badge.due-today { color: #b45309; font-weight: 700; }
.cl-progress-sm {
  height: 5px; background: #e4e6ef; border-radius: 99px; overflow: hidden; margin-top: 6px;
}
.cl-progress-sm > i { display: block; height: 100%; background: var(--ok); border-radius: 99px; transition: width .3s; }

.add-card-btn { padding: 8px 12px; color: var(--text-3); font-size: 13.5px; font-weight: 500; border-radius: 8px; text-align: left; }
.add-card-btn:hover { background: var(--surface-2); color: var(--text); }
.add-card-input { padding: 8px 10px; margin: 0 8px 8px; }
.composer-actions { display: flex; align-items: center; gap: 8px; padding: 0 8px 8px; }
.composer-x { color: var(--text-3); font-size: 18px; padding: 4px; border-radius: 6px; }
.composer-x:hover { background: var(--surface-2); color: var(--text); }

.add-list-tile {
  width: 272px; flex: none; background: rgba(0,0,0,.16); color: rgba(255,255,255,.95);
  border-radius: var(--radius); padding: 12px 14px; font-weight: 600; cursor: pointer; font-size: 14px;
  transition: background .15s;
}
.add-list-tile:hover { background: rgba(0,0,0,.26); }
.add-list-input { background: var(--surface); border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow-sm); }
.add-list-input input { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 7px; margin-bottom: 8px; }

/* ── Modal ── */
.overlay {
  position: fixed; inset: 0; background: rgba(16, 20, 42, .55); backdrop-filter: blur(3px);
  z-index: 90; display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fadein .18s ease;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 760px; max-height: calc(100vh - 48px); overflow-y: auto;
  animation: rise .22s ease;
  position: relative;
}
.modal-close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-2); font-size: 17px; z-index: 5; }
.modal-close:hover { background: var(--surface-2); }
.modal-body { display: flex; gap: 20px; padding: 26px 28px 30px; }
.modal-main { flex: 1; min-width: 0; }
.modal-side { width: 190px; flex: none; }
.modal-cover { height: 90px; border-radius: 16px 16px 0 0; }
.card-title-input {
  width: 100%; border: none; font-size: 19px; font-weight: 800; letter-spacing: -.01em;
  padding: 6px 8px; border-radius: 8px; margin-bottom: 4px;
}
.card-title-input:hover { background: var(--surface-2); }
.card-title-input:focus { outline: none; background: var(--surface-2); }
.modal-section { margin-top: 20px; }
.sec-label { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); margin-bottom: 9px; }
.sec-label .ic { font-size: 13px; }
.desc-edit { width: 100%; min-height: 74px; border: 1px solid transparent; border-radius: 9px; padding: 9px 11px; font-size: 13.5px; resize: vertical; background: transparent; }
.desc-edit:hover { background: var(--surface-2); }
.desc-edit:focus { outline: none; background: var(--surface-2); border-color: var(--border); }
.desc-empty { color: var(--text-3); font-size: 13.5px; padding: 9px 11px; border-radius: 9px; cursor: text; }
.desc-empty:hover { background: var(--surface-2); }

/* checklist */
.checklist-block { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 10px; }
.cl-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 700; font-size: 13.5px; }
.cl-progress { flex: 1; height: 6px; background: #d9dce8; border-radius: 99px; overflow: hidden; }
.cl-progress > i { display: block; height: 100%; background: var(--ok); border-radius: 99px; transition: width .25s; }
.cl-progress-num { font-size: 11.5px; color: var(--text-2); font-weight: 600; }
.cl-item { display: flex; align-items: center; gap: 9px; padding: 4px 2px; }
.cl-item input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--ok); cursor: pointer; }
.cl-item span { font-size: 13.5px; }
.cl-item span.done { text-decoration: line-through; color: var(--text-3); }
.cl-add { display: flex; gap: 7px; margin-top: 7px; }

/* comments */
.comment { display: flex; gap: 10px; margin-bottom: 14px; }
.comment .body { background: var(--surface-2); border-radius: 4px 12px 12px 12px; padding: 9px 12px; font-size: 13.5px; flex: 1; }
.comment .meta { display: flex; gap: 8px; font-size: 11.5px; color: var(--text-3); margin-bottom: 3px; }
.comment .meta b { color: var(--text-2); }
.comment-composer { display: flex; gap: 9px; align-items: flex-start; margin-top: 4px; }
.comment-composer textarea { flex: 1; min-height: 56px; border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; resize: vertical; }

/* attachments */
.attach { display: flex; align-items: center; gap: 11px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 9px 12px; margin-bottom: 8px; }
.attach .ic { width: 34px; height: 34px; border-radius: 8px; background: var(--surface); display: flex; align-items: center; justify-content: center; font-size: 15px; box-shadow: var(--shadow-sm); }
.attach .name { font-weight: 600; font-size: 13px; word-break: break-all; }
.attach .meta { font-size: 11.5px; color: var(--text-3); }
.attach a { margin-left: auto; font-size: 12.5px; font-weight: 600; }

/* side panel */
.side-btn {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  background: var(--surface-2); border-radius: 8px; font-size: 13px; font-weight: 600;
  color: var(--text-2); margin-bottom: 7px; text-align: left; transition: background .13s;
}
.side-btn:hover { background: #e6e8f2; }
.side-btn.danger { color: var(--danger); }
.side-btn.danger:hover { background: #fdecec; }
.side-pop { position: absolute; z-index: 95; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 12px; width: 240px; }

/* label picker */
.labels-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; margin-top: 8px; }
.label-opt { height: 30px; border-radius: 7px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 16px; font-weight: 800; border: 2px solid transparent; }
.label-opt.on { border-color: var(--text); box-shadow: 0 0 0 2px #fff inset; }
.label-opt:hover { transform: scale(1.05); }
.member-opt { display: flex; align-items: center; gap: 9px; padding: 7px 6px; border-radius: 8px; cursor: pointer; }
.member-opt:hover { background: var(--surface-2); }
.member-opt .avatar { width: 26px; height: 26px; font-size: 11px; }
.member-opt .ck { margin-left: auto; color: var(--ok); font-weight: 800; }
.due-input { display: flex; gap: 7px; margin-top: 8px; align-items: center; }
.due-input input[type=date] { padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; }
.cover-row { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 8px; }
.cover-swatch { width: 32px; height: 32px; border-radius: 8px; cursor: pointer; border: 2px solid transparent; }
.cover-swatch.on { border-color: var(--text); }
.cover-swatch.none { background: repeating-linear-gradient(45deg, #eee, #eee 4px, #fff 4px, #fff 8px); }

/* ── Side panel (members / activity) ── */
.slideover {
  position: fixed; top: 0; right: 0; bottom: 0; width: 340px; max-width: 92vw;
  background: var(--surface); box-shadow: var(--shadow-lg); z-index: 95;
  transform: translateX(100%); transition: transform .22s ease;
  display: flex; flex-direction: column;
}
.slideover.open { transform: none; }
.slideover-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); font-weight: 800; font-size: 15px; }
.slideover-body { padding: 16px 18px; overflow-y: auto; flex: 1; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; }
.member-row .avatar { width: 30px; height: 30px; font-size: 12px; }
.member-row .info { flex: 1; }
.member-row .info b { display: block; font-size: 13.5px; }
.member-row .info span { font-size: 12px; color: var(--text-3); }
.member-remove { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-3); font-size: 12px; flex: none; transition: all .13s; }
.member-remove:hover { background: #fdecec; color: var(--danger); }
.role-tag { font-size: 10.5px; font-weight: 700; text-transform: uppercase; background: var(--surface-2); color: var(--text-2); padding: 2px 7px; border-radius: 99px; }
.activity-item { display: flex; gap: 10px; padding: 9px 2px; font-size: 13px; border-bottom: 1px solid #eef0f6; }
.activity-item .avatar { width: 26px; height: 26px; font-size: 11px; flex: none; }
.activity-item .time { color: var(--text-3); font-size: 11.5px; display: block; }

/* ── Avatar ── */
.avatar { border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; flex: none; user-select: none; }

/* ── Toasts ── */
#toast-root { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--text); color: #fff; padding: 10px 18px; border-radius: 99px;
  font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-lg);
  animation: rise .2s ease; display: flex; align-items: center; gap: 8px;
}
.toast.error { background: var(--danger); }
.toast.ok { background: var(--ok); }

/* ── Empty / loading ── */
.spinner {
  width: 30px; height: 30px; border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite; margin: 60px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; color: var(--text-3); padding: 40px 20px; font-size: 13.5px; }
.board-empty { text-align: center; color: rgba(255,255,255,.9); padding: 30px; font-size: 14px; }

/* ── Misc ── */
.hidden { display: none !important; }
[contenteditable]:empty::before { content: attr(data-ph); color: var(--text-3); }
kbd { background: var(--surface-2); border-radius: 5px; padding: 1px 6px; font-size: 11px; border: 1px solid var(--border); }
@media (max-width: 640px) {
  .modal-body { flex-direction: column; padding: 20px 18px 24px; }
  .modal-side { width: 100%; }
  .lists-wrap { padding-bottom: 30px; }
}

/* ── Motivational popup ── */
.motiv-pop {
  position: fixed; bottom: 26px; right: 26px; z-index: 300;
  max-width: 360px; width: calc(100vw - 52px);
  opacity: 0; transform: translateY(16px) scale(.96);
  pointer-events: none;
  transition: opacity .45s ease, transform .45s ease;
}
.motiv-pop.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.motiv-card {
  position: relative;
  background: rgba(22, 27, 40, .92); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.14); border-radius: 16px;
  padding: 22px 22px 16px; box-shadow: 0 18px 50px rgba(0,0,0,.45);
  color: #fff;
}
.motiv-mark {
  position: absolute; top: 4px; left: 18px;
  font-size: 42px; line-height: 1; color: var(--accent, #6366f1);
  font-family: Georgia, serif; opacity: .9;
}
.motiv-q {
  margin: 6px 0 10px; padding-left: 6px;
  font-size: 15.5px; line-height: 1.5; color: #f3f5fb;
  font-style: italic; font-family: Georgia, 'Times New Roman', serif;
}
.motiv-a { font-size: 12.5px; color: #a8b3d1; font-weight: 600; letter-spacing: .3px; }
.motiv-close {
  position: absolute; top: 10px; right: 12px;
  background: none; border: none; color: #8b96b5; font-size: 14px;
  cursor: pointer; padding: 4px; line-height: 1;
}
.motiv-close:hover { color: #fff; }

/* ── Card complete circle ── */
.card-main-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.card-labels { display: flex; flex-wrap: wrap; gap: 3px; flex: 1; }
.card-complete {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 2px solid rgba(255,255,255,.55); background: rgba(255,255,255,.08);
  color: #fff; font-size: 11px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .15s ease; line-height: 1;
}
.card-complete:hover { border-color: #fff; background: rgba(255,255,255,.2); }
.card.complete .card-title { text-decoration: line-through; opacity: .55; }
.card.complete { opacity: .8; }
.card.complete .card-complete { background: var(--ok, #2e9e6b); border-color: var(--ok, #2e9e6b); }

/* ── Label text chips ── */
.label-chip-text { padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.label-opt-row { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.label-name-input { flex: 1; min-width: 0; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; background: var(--surface); color: var(--text); }

/* ── Description toolbar + preview ── */
.desc-toolbar { display: flex; gap: 4px; margin-bottom: 6px; flex-wrap: wrap; }
.desc-toolbar button {
  border: 1px solid var(--border); background: var(--surface-2, var(--surface));
  color: var(--text); border-radius: 6px; padding: 4px 9px; font-size: 12px; font-weight: 700; cursor: pointer;
}
.desc-toolbar button:hover { background: var(--border); }
.desc-toolbar .desc-prev-btn { margin-left: auto; font-weight: 600; }
.desc-toolbar .desc-prev-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.desc-preview {
  border: 1px dashed var(--border); border-radius: 8px; padding: 10px 12px;
  font-size: 13.5px; line-height: 1.55; color: var(--text); background: var(--surface);
  overflow-wrap: break-word;
}
.desc-preview a { color: var(--accent); }

/* ── Hide checked ── */
.cl-hide-btn {
  font-size: 11px; color: var(--text-3); cursor: pointer; padding: 2px 6px;
  border: 1px solid transparent; border-radius: 5px; user-select: none;
}
.cl-hide-btn:hover { color: var(--text); background: var(--border); }
.cl-hide-btn.on { color: var(--accent); border-color: var(--accent); }

/* ── Board card filter ── */
.cf-label { cursor: pointer; }
.cf-label.on { outline: 2px solid #fff; outline-offset: 1px; }
.cf-count { margin-top: 8px; font-size: 12px; color: var(--text-3); }
#filter-btn.filter-on { background: var(--accent); color: #fff; }
.list-empty-filtered { opacity: .55; }
