:root {
  --bg: #0b0d10;
  --panel: #101318;
  --panel-2: #15191f;
  --panel-3: #1b2028;
  --line: #252b34;
  --line-2: #323a46;
  --text: #f2f4f7;
  --muted: #8f99a8;
  --accent: #91ff00;
  --accent-2: #b7ff5a;
  --accent-ink: #0a0c08;
  --danger: #ff5f69;
  --warning: #ffbf47;
  --info: #63a4ff;
  --shadow: 0 18px 50px rgba(0,0,0,.32);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
body {
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.mobile-only { display: none !important; }

.auth-view {
  min-height: 100vh;
  overflow: auto;
  background:
    radial-gradient(circle at 11% 18%, rgba(145,255,0,.12), transparent 28rem),
    radial-gradient(circle at 90% 80%, rgba(77,123,255,.08), transparent 34rem),
    #090b0e;
}
.auth-shell {
  width: min(1180px, calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  align-items: center;
  gap: 70px;
  position: relative;
  padding: 80px 0;
}
.auth-brand { position: absolute; top: 30px; left: 0; display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 11px; background: var(--accent); color: var(--accent-ink);
  font-weight: 900; letter-spacing: -.06em; box-shadow: 0 0 0 1px rgba(255,255,255,.05), 0 0 40px rgba(145,255,0,.12);
}
.brand-mark.small { width: 34px; height: 34px; border-radius: 9px; }
.brand-word { font-size: 15px; font-weight: 850; letter-spacing: .14em; }
.brand-sub { color: var(--muted); font-size: 9px; letter-spacing: .3em; margin-top: 2px; }
.auth-copy { max-width: 650px; }
.eyebrow { display: flex; align-items: center; gap: 9px; color: var(--accent); text-transform: uppercase; letter-spacing: .18em; font-size: 11px; font-weight: 750; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(145,255,0,.1); display: inline-block; }
.auth-copy h1 { font-size: clamp(44px, 6.2vw, 76px); line-height: .98; letter-spacing: -.055em; margin: 24px 0 28px; max-width: 760px; }
.auth-copy p { max-width: 590px; color: #aab2bf; font-size: 16px; line-height: 1.75; }
.auth-feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 13px; overflow: hidden; margin-top: 38px; max-width: 600px; }
.auth-feature-grid > div { background: rgba(16,19,24,.94); padding: 18px; min-height: 90px; }
.auth-feature-grid strong { display: block; color: var(--accent); font-size: 14px; }
.auth-feature-grid span { display: block; color: var(--muted); font-size: 12px; margin-top: 7px; }
.auth-card { background: rgba(17,20,25,.94); border: 1px solid var(--line); border-radius: 18px; padding: 8px 28px 28px; box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.auth-tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.auth-tab { flex: 1; padding: 16px 5px 14px; border: 0; border-bottom: 2px solid transparent; background: transparent; cursor: pointer; color: var(--muted); font-size: 13px; }
.auth-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.auth-card label { display: block; color: #c9cfd8; font-size: 12px; margin: 17px 0; }
.auth-card input, .modal input, .modal select, .modal textarea {
  width: 100%; border: 1px solid var(--line-2); border-radius: 10px; background: #0d1014; color: var(--text);
  outline: none; padding: 12px 13px; margin-top: 7px; transition: .15s;
}
.auth-card input:focus, .modal input:focus, .modal textarea:focus, .modal select:focus { border-color: rgba(145,255,0,.6); box-shadow: 0 0 0 3px rgba(145,255,0,.07); }
.auth-hint { color: #6f7987; font-size: 11px; line-height: 1.55; margin: 18px 2px 0; }
.form-error { border: 1px solid rgba(255,95,105,.3); background: rgba(255,95,105,.07); color: #ff9da4; border-radius: 9px; padding: 9px 11px; font-size: 12px; margin-bottom: 12px; }

.btn { border: 1px solid transparent; border-radius: 10px; min-height: 39px; padding: 0 14px; cursor: pointer; transition: .15s ease; font-size: 13px; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost { background: var(--panel-2); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--panel-3); }
.btn-danger { background: rgba(255,95,105,.08); border-color: rgba(255,95,105,.25); color: #ff818a; }
.btn-full { width: 100%; }
.icon-btn { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; display: grid; place-items: center; color: #b8c0cc; font-size: 18px; }
.icon-btn:hover { background: var(--panel-3); color: var(--text); }

.workspace { height: 100vh; display: grid; grid-template-columns: 236px minmax(0, 1fr) 310px; background: var(--bg); }
.sidebar { min-width: 0; border-right: 1px solid var(--line); background: #0e1115; padding: 14px 12px 12px; display: flex; flex-direction: column; z-index: 30; }
.sidebar-brand { height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 5px; }
.sidebar-brand-text { display: flex; flex-direction: column; min-width: 0; }
.sidebar-brand-text strong { font-size: 13px; letter-spacing: .14em; }
.sidebar-brand-text span { font-size: 8px; letter-spacing: .28em; color: var(--muted); margin-top: 2px; }
.new-channel { margin: 15px 0 18px; }
.sidebar-section-head { display: flex; align-items: center; justify-content: space-between; color: #697381; font-size: 10px; letter-spacing: .14em; padding: 0 8px 7px; }
.channel-list { display: flex; flex-direction: column; gap: 4px; overflow: auto; min-height: 0; }
.channel-row { width: 100%; border: 1px solid transparent; background: transparent; border-radius: 9px; padding: 9px 9px; display: grid; grid-template-columns: 20px minmax(0,1fr) auto; align-items: center; gap: 7px; cursor: pointer; color: #aab2be; text-align: left; }
.channel-row:hover { background: #15191f; color: var(--text); }
.channel-row.active { background: rgba(145,255,0,.08); border-color: rgba(145,255,0,.12); color: var(--text); }
.channel-row .hash { color: #65707f; font-weight: 700; }
.channel-row.active .hash { color: var(--accent); }
.channel-row .channel-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.channel-row .role-mini { font-size: 8px; color: #7f8997; border: 1px solid var(--line); border-radius: 5px; padding: 2px 4px; }
.sidebar-spacer { flex: 1; }
.sidebar-user { border-top: 1px solid var(--line); padding: 12px 4px 1px; display: grid; grid-template-columns: 34px minmax(0,1fr) 36px; align-items: center; gap: 9px; }
.avatar { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #0a0d0a; font-weight: 800; font-size: 10px; border: 1px solid rgba(255,255,255,.08); background: var(--accent); flex: 0 0 auto; }
.sidebar-user-copy { min-width: 0; display: flex; flex-direction: column; }
.sidebar-user-copy strong { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-copy span { font-size: 9px; color: var(--muted); margin-top: 2px; }

.main-column { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 69px; border-bottom: 1px solid var(--line); background: rgba(13,16,20,.94); display: flex; align-items: center; gap: 12px; padding: 0 14px 0 18px; flex: 0 0 auto; }
.channel-heading { min-width: 0; flex: 1; }
.channel-title-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.channel-title-row h2 { margin: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-meta { color: #727d8b; font-size: 10px; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role-badge, .live-badge { border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 6px; font-size: 8px; letter-spacing: .07em; color: #98a2af; }
.role-badge.admin { color: var(--accent); border-color: rgba(145,255,0,.22); background: rgba(145,255,0,.05); }
.live-badge { display: inline-flex; align-items: center; gap: 6px; }
.live-badge .live-dot { width: 5px; height: 5px; }
.topbar-actions { display: flex; align-items: center; gap: 7px; }
.presence-avatars { display: flex; align-items: center; padding-left: 5px; }
.presence-avatars .avatar { width: 28px; height: 28px; border-radius: 8px; margin-left: -6px; border: 2px solid #0e1115; cursor: default; }
.presence-overflow { width: 28px; height: 28px; display: grid; place-items: center; background: var(--panel-3); border-radius: 8px; border: 2px solid #0e1115; margin-left: -6px; font-size: 9px; color: var(--muted); }

.board-shell { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.empty-state { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px; background: radial-gradient(circle at center, rgba(145,255,0,.035), transparent 29rem); }
.empty-icon { width: 62px; height: 62px; border: 1px solid rgba(145,255,0,.25); border-radius: 17px; background: rgba(145,255,0,.06); display: grid; place-items: center; color: var(--accent); font-size: 25px; font-weight: 900; margin-bottom: 20px; }
.empty-state h3 { margin: 0; font-size: 21px; letter-spacing: -.03em; }
.empty-state p { color: var(--muted); max-width: 480px; font-size: 13px; line-height: 1.7; margin: 12px 0 22px; }
.board-view { width: 100%; height: 100%; position: relative; overflow: hidden; }
.board-viewport { position: absolute; inset: 0; overflow: auto; cursor: default; scrollbar-width: thin; scrollbar-color: #303742 #111419; background-color: #101319; background-image: radial-gradient(circle, #2b313a 1px, transparent 1.1px); background-size: 24px 24px; }
.board-world { width: 4000px; height: 2500px; position: relative; transform-origin: 0 0; }
.items-layer, .cursors-layer { position: absolute; inset: 0; pointer-events: none; }
.stroke-layer { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.draft-layer { z-index: 6; }
.items-layer { z-index: 10; }
.cursors-layer { z-index: 50; }

.toolbar { position: absolute; left: 50%; top: 13px; transform: translateX(-50%); z-index: 100; display: flex; gap: 3px; padding: 5px; background: rgba(13,16,20,.95); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.22); backdrop-filter: blur(12px); }
.tool { width: 54px; height: 48px; padding: 4px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; color: #a8b0bb; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.tool > span { font-size: 17px; line-height: 1; }
.tool small { font-size: 8px; color: #7b8593; }
.tool:hover { background: #1b2027; color: var(--text); }
.tool.active { background: rgba(145,255,0,.1); color: var(--accent); }
.tool.active small { color: #c6d7b4; }
.tool.danger:hover { color: var(--danger); background: rgba(255,95,105,.08); }
.toolbar-divider { width: 1px; background: var(--line); margin: 5px 2px; }

.board-item { position: absolute; pointer-events: auto; user-select: none; touch-action: none; transform-origin: center center; }
.board-item.selected::after { content: ""; position: absolute; inset: -5px; border: 1px solid var(--accent); border-radius: inherit; pointer-events: none; box-shadow: 0 0 0 1px rgba(145,255,0,.08); }
.board-item.remote-active::after { content: ""; position: absolute; inset: -5px; border: 1px dashed #63a4ff; border-radius: inherit; pointer-events: none; }
.board-item .drag-handle { cursor: grab; }
.board-item.dragging { cursor: grabbing; opacity: .97; }
.board-item.editing { user-select: text; }
.board-item [contenteditable="true"] { outline: none; user-select: text; cursor: text; }
.item-note { width: 220px; min-height: 150px; padding: 18px 17px 15px; color: #1b220f; background: #d7ff8f; border-radius: 3px 3px 11px 3px; box-shadow: 0 15px 30px rgba(0,0,0,.20); border: 1px solid rgba(255,255,255,.26); }
.item-note::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 7px; background: rgba(82,120,25,.18); }
.item-note .note-text { min-height: 90px; font-size: 14px; line-height: 1.55; white-space: pre-wrap; }
.item-note .note-author { margin-top: 12px; font-size: 9px; opacity: .5; }
.item-text { min-width: 150px; max-width: 520px; padding: 7px 10px; color: var(--text); font-size: 25px; line-height: 1.2; font-weight: 650; letter-spacing: -.025em; }
.item-card { width: 284px; min-height: 182px; padding: 13px; background: #171b21; border: 1px solid #303742; border-radius: 12px; box-shadow: 0 14px 35px rgba(0,0,0,.22); transition: border-color .18s ease, background .18s ease, opacity .18s ease; }
.item-card.task-status-todo { border-left: 3px solid #68717d; }
.item-card.task-status-progress { border-left: 3px solid #f0b84b; }
.item-card.task-status-done { border-left: 3px solid var(--accent); background: #141a17; }
.card-topline { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-status { color: #9ba5b1; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.task-status-progress .card-status { color: #f0b84b; }
.task-status-done .card-status { color: var(--accent); }
.card-grip { color: #596270; cursor: grab; letter-spacing: 2px; }
.card-title { margin-top: 12px; font-size: 14px; line-height: 1.4; font-weight: 700; min-height: 38px; }
.task-status-done .card-title { color: #87918c; text-decoration: line-through; text-decoration-thickness: 1px; }
.task-status-control { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 5px; margin-top: 13px; }
.task-state { min-width: 0; border: 1px solid #303742; background: #11151a; color: #7f8996; border-radius: 8px; padding: 7px 4px; display: flex; align-items: center; justify-content: center; gap: 4px; font: inherit; font-size: 8px; cursor: pointer; white-space: nowrap; transition: .15s ease; }
.task-state:hover { border-color: #4b5663; color: #d5dbe2; transform: translateY(-1px); }
.task-state-icon { font-size: 11px; line-height: 1; }
.task-state.active { border-color: #697482; background: #20262e; color: #eef2f5; }
.task-state-progress.active { border-color: rgba(240,184,75,.65); background: rgba(240,184,75,.10); color: #f3c66c; }
.task-state-done.active { border-color: rgba(145,255,0,.55); background: rgba(145,255,0,.09); color: var(--accent); }
.card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 13px; }
.card-date { color: #75808e; font-size: 9px; }
.task-status-done .card-date { color: #7fa25d; }
.card-owner { width: 24px; height: 24px; border-radius: 7px; background: #252b34; display: grid; place-items: center; font-size: 8px; color: #bec6d0; }
.item-image { width: 300px; background: #14181e; border: 1px solid #303742; border-radius: 11px; padding: 6px; box-shadow: 0 14px 35px rgba(0,0,0,.22); }
.item-image img { display: block; width: 100%; max-height: 280px; object-fit: contain; border-radius: 7px; background: #0b0d10; pointer-events: none; }
.item-image .image-caption { color: #9ba5b1; font-size: 10px; padding: 8px 5px 4px; min-height: 22px; }
.stroke-line { fill: none; stroke-linecap: round; stroke-linejoin: round; pointer-events: stroke; }
.stroke-line.selected { filter: drop-shadow(0 0 3px rgba(145,255,0,.75)); }
.live-cursor { position: absolute; pointer-events: none; transform: translate(-2px,-2px); transition: left .055s linear, top .055s linear; }
.cursor-arrow { width: 18px; height: 22px; clip-path: polygon(0 0, 100% 68%, 58% 73%, 38% 100%); background: var(--cursor-color, #63a4ff); filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
.cursor-name { display: inline-block; margin: -2px 0 0 12px; background: var(--cursor-color, #63a4ff); color: #071019; padding: 3px 6px; border-radius: 5px; font-size: 8px; font-weight: 800; white-space: nowrap; }
.board-status { position: absolute; bottom: 13px; left: 14px; z-index: 80; border: 1px solid var(--line); background: rgba(13,16,20,.9); border-radius: 8px; padding: 6px 9px; color: #77818e; font-size: 9px; backdrop-filter: blur(10px); }
.sync-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 6px; }
.sync-dot.busy { background: var(--warning); }
.sync-dot.error { background: var(--danger); }
.zoom-controls { position: absolute; right: 13px; bottom: 13px; z-index: 80; display: grid; grid-template-columns: 34px 55px 34px; border: 1px solid var(--line); background: rgba(13,16,20,.9); border-radius: 9px; overflow: hidden; }
.zoom-controls button { height: 32px; border: 0; border-right: 1px solid var(--line); background: transparent; cursor: pointer; color: #909aa8; font-size: 12px; }
.zoom-controls button:last-child { border-right: 0; }
.zoom-controls button:hover { background: #1a1f26; color: var(--text); }

.chat-panel { border-left: 1px solid var(--line); background: #0f1217; min-width: 0; display: flex; flex-direction: column; z-index: 25; }
.chat-head { height: 69px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 14px 0 17px; }
.chat-head > div { display: flex; flex-direction: column; }
.chat-head strong { font-size: 12px; }
.chat-head span { color: var(--muted); font-size: 9px; margin-top: 5px; }
.chat-messages { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 13px; }
.chat-empty { color: #697381; text-align: center; font-size: 11px; line-height: 1.6; padding: 40px 20px; }
.chat-row { display: grid; grid-template-columns: 28px minmax(0,1fr); gap: 8px; margin-bottom: 15px; }
.chat-row.me { grid-template-columns: minmax(0,1fr) 28px; }
.chat-row.me .chat-avatar { grid-column: 2; }
.chat-row.me .chat-body { grid-column: 1; grid-row: 1; text-align: right; }
.chat-avatar { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 8px; font-weight: 850; color: #09100a; }
.chat-meta { display: flex; gap: 7px; align-items: center; color: #717c89; font-size: 8px; margin: 1px 0 5px; }
.chat-row.me .chat-meta { justify-content: flex-end; }
.chat-name { color: #adb5c0; font-weight: 650; }
.chat-bubble { display: inline-block; max-width: 100%; background: #171b21; border: 1px solid #252c35; border-radius: 4px 11px 11px 11px; color: #c8ced7; font-size: 11px; line-height: 1.55; padding: 8px 10px; text-align: left; white-space: pre-wrap; word-break: break-word; }
.chat-row.me .chat-bubble { background: rgba(145,255,0,.08); border-color: rgba(145,255,0,.15); border-radius: 11px 4px 11px 11px; }
.chat-compose { border-top: 1px solid var(--line); padding: 11px; display: grid; grid-template-columns: minmax(0,1fr) 36px; gap: 7px; align-items: end; }
.chat-compose textarea { resize: none; max-height: 120px; overflow-y: auto; border: 1px solid #2b323c; background: #13171c; color: var(--text); border-radius: 10px; outline: none; min-height: 38px; padding: 10px 11px; font-size: 11px; line-height: 1.45; }
.chat-compose textarea:focus { border-color: #45505e; }
.send-btn { width: 36px; height: 36px; border: 0; border-radius: 9px; background: var(--accent); color: #0a0e08; cursor: pointer; font-size: 13px; }
.send-btn:disabled { opacity: .3; cursor: not-allowed; }
.tablet-chat { display: none; }

.modal-backdrop { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: rgba(2,4,6,.68); backdrop-filter: blur(6px); padding: 20px; }
.modal { width: min(520px, 100%); max-height: min(760px, calc(100vh - 40px)); overflow: auto; background: #11151a; border: 1px solid #2b323d; border-radius: 16px; box-shadow: 0 30px 90px rgba(0,0,0,.5); padding: 21px; }
.modal h3 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.modal-sub { color: var(--muted); font-size: 11px; line-height: 1.55; margin: 6px 0 19px; }
.modal-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.modal label { display: block; color: #bec5cf; font-size: 10px; margin-top: 15px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.invite-box { border: 1px solid var(--line); border-radius: 11px; padding: 12px; background: #0d1014; }
.invite-url { color: #aeb7c3; font-size: 10px; word-break: break-all; line-height: 1.5; margin-bottom: 10px; }
.member-list { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.member-row { border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 8px; }
.member-info { min-width: 0; display: flex; flex-direction: column; }
.member-info strong { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-info span { color: var(--muted); font-size: 8px; margin-top: 2px; }
.member-online { color: var(--accent) !important; }
.tiny-btn { border: 1px solid var(--line); border-radius: 7px; background: #171b21; color: #a9b1bc; padding: 6px 7px; cursor: pointer; font-size: 9px; }
.tiny-btn:hover { background: #20262e; }
.danger-zone { border-top: 1px solid rgba(255,95,105,.16); margin-top: 22px; padding-top: 17px; }
.danger-zone strong { color: #ff818a; font-size: 10px; }

.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { max-width: 320px; background: #161b21; border: 1px solid #303844; color: #d4dae2; border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.25); padding: 10px 12px; font-size: 10px; line-height: 1.45; animation: toast-in .18s ease-out; }
.toast.error { border-color: rgba(255,95,105,.36); color: #ff9da4; }
.toast.success { border-color: rgba(145,255,0,.24); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (max-width: 1120px) {
  .workspace { grid-template-columns: 220px minmax(0,1fr); }
  .chat-panel { position: fixed; right: 0; top: 0; bottom: 0; width: 320px; transform: translateX(105%); transition: transform .2s ease; box-shadow: -20px 0 50px rgba(0,0,0,.3); }
  .chat-panel.open { transform: translateX(0); }
  .tablet-chat { display: grid; }
}

@media (max-width: 760px) {
  body { overflow: hidden; }
  .auth-shell { width: min(100% - 32px, 560px); grid-template-columns: 1fr; gap: 35px; padding: 105px 0 45px; }
  .auth-brand { top: 24px; }
  .auth-copy h1 { font-size: clamp(40px, 12vw, 62px); }
  .auth-feature-grid { grid-template-columns: 1fr; }
  .auth-feature-grid > div { min-height: auto; }
  .auth-card { padding: 6px 20px 24px; }

  .workspace { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(285px, 88vw); transform: translateX(-105%); transition: transform .2s ease; box-shadow: 20px 0 50px rgba(0,0,0,.35); }
  .sidebar.open { transform: translateX(0); }
  .mobile-only { display: grid !important; }
  .sidebar-brand .mobile-only { margin-left: auto; }
  .topbar { height: 62px; padding-left: 9px; }
  .presence-avatars { display: none; }
  .topbar .btn { min-height: 34px; padding: 0 10px; }
  .channel-meta { max-width: 58vw; }
  .toolbar { left: 8px; right: 8px; transform: none; overflow-x: auto; justify-content: flex-start; }
  .tool { flex: 0 0 48px; width: 48px; }
  .tool small { display: none; }
  .tool > span { font-size: 18px; }
  .toolbar-divider { flex: 0 0 1px; }
  .board-status { display: none; }
  .item-note { width: 190px; }
  .item-card { width: 230px; }
  .item-image { width: 250px; }
  .chat-panel { width: min(340px, 94vw); }
  .zoom-controls { right: 9px; bottom: 9px; }
}

/* v2.2 — task deadlines */
.item-card.task-overdue:not(.task-status-done) { border-color: rgba(255,95,105,.46); box-shadow: 0 14px 35px rgba(0,0,0,.22), 0 0 0 1px rgba(255,95,105,.08); }
.item-card.task-due-soon:not(.task-status-done):not(.task-overdue) { border-color: rgba(255,191,71,.38); }
.task-due { margin-top: 10px; border: 1px solid #2b323c; border-radius: 9px; background: #11151a; padding: 8px 9px; display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 8px; }
.task-due-label { color: #6f7a88; font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.task-due input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: #c9d0d9; font-size: 9px; color-scheme: dark; padding: 0; }
.task-due input::-webkit-calendar-picker-indicator { opacity: .65; cursor: pointer; filter: invert(.8); }
.task-due-meta { grid-column: 1 / -1; color: #718090; font-size: 8px; line-height: 1.35; }
.task-overdue .task-due { border-color: rgba(255,95,105,.36); background: rgba(255,95,105,.055); }
.task-overdue .task-due-meta { color: #ff8991; font-weight: 750; }
.task-due-soon .task-due-meta { color: #e7b95f; }
.task-status-done .task-due-meta { color: #7fa25d; }

/* v2.2 — voice calls */
.btn-voice { background: rgba(99,164,255,.10); border-color: rgba(99,164,255,.28); color: #a9ceff; }
.btn-voice:hover { background: rgba(99,164,255,.16); border-color: rgba(99,164,255,.42); }
.btn-voice.in-call { background: rgba(145,255,0,.09); border-color: rgba(145,255,0,.27); color: var(--accent); }
.btn-voice.call-active:not(.in-call) { background: rgba(240,184,75,.10); border-color: rgba(240,184,75,.34); color: #efc66f; }
.btn-voice:disabled { opacity: .42; }
.voice-btn-icon { font-size: 15px; line-height: 1; }

.incoming-call { position: fixed; right: 18px; top: 86px; z-index: 2500; width: min(440px, calc(100vw - 36px)); background: #131820; border: 1px solid rgba(99,164,255,.34); border-radius: 15px; padding: 13px; display: grid; grid-template-columns: 42px minmax(0,1fr) 38px 38px; gap: 10px; align-items: center; box-shadow: 0 24px 65px rgba(0,0,0,.45); animation: call-in .18s ease-out; }
.incoming-call-icon { width: 42px; height: 42px; border-radius: 12px; background: rgba(99,164,255,.13); color: #9bc7ff; display: grid; place-items: center; font-size: 20px; animation: phone-pulse 1.25s ease-in-out infinite; }
.incoming-call-copy { min-width: 0; display: flex; flex-direction: column; }
.incoming-call-copy strong { font-size: 12px; }
.incoming-call-copy span { color: #8994a2; font-size: 9px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voice-circle { width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; font-size: 17px; font-weight: 850; }
.voice-circle.accept { background: var(--accent); color: #081006; }
.voice-circle.danger { background: #2a171a; color: #ff777f; border: 1px solid rgba(255,95,105,.25); }

.voice-panel { position: fixed; right: 18px; bottom: 18px; z-index: 2200; width: min(330px, calc(100vw - 36px)); background: rgba(16,20,26,.97); border: 1px solid #303844; border-radius: 16px; box-shadow: 0 24px 70px rgba(0,0,0,.48); overflow: hidden; backdrop-filter: blur(14px); }
.voice-panel.collapsed .voice-participants, .voice-panel.collapsed .voice-actions { display: none; }
.voice-panel-head { min-height: 58px; padding: 11px 12px; display: grid; grid-template-columns: 10px minmax(0,1fr) 34px; gap: 9px; align-items: center; border-bottom: 1px solid #262d36; }
.voice-panel.collapsed .voice-panel-head { border-bottom: 0; }
.voice-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px rgba(145,255,0,.08); }
.voice-panel-head > div:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.voice-panel-head strong { font-size: 11px; }
.voice-panel-head span { color: #7f8b99; font-size: 8px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voice-collapse { width: 32px; height: 32px; font-size: 15px; }
.voice-participants { padding: 10px 11px; display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow: auto; }
.voice-person { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 8px; border: 1px solid #252c35; background: #12161b; border-radius: 10px; padding: 7px 8px; }
.voice-person .avatar { width: 30px; height: 30px; border-radius: 8px; }
.voice-person-copy { min-width: 0; display: flex; flex-direction: column; }
.voice-person-copy strong { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voice-person-copy span { color: #727e8b; font-size: 8px; margin-top: 2px; }
.voice-connected { color: var(--accent); font-size: 8px; }
.voice-connecting { color: #efc66f; font-size: 8px; }
.voice-actions { padding: 10px 11px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; border-top: 1px solid #262d36; }
.voice-action { min-height: 44px; border: 1px solid #303844; border-radius: 10px; background: #171c22; color: #c3cad3; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px; }
.voice-action span { font-size: 15px; }
.voice-action small { font-size: 9px; }
.voice-action.active { border-color: rgba(240,184,75,.38); color: #efc66f; background: rgba(240,184,75,.07); }
.voice-action.hangup { background: rgba(255,95,105,.09); border-color: rgba(255,95,105,.25); color: #ff858d; }

@keyframes phone-pulse { 0%,100% { transform: rotate(0) scale(1); } 25% { transform: rotate(-8deg) scale(1.04); } 50% { transform: rotate(8deg) scale(1.04); } 75% { transform: rotate(-5deg) scale(1.02); } }
@keyframes call-in { from { transform: translateY(-8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (max-width: 760px) {
  .btn-voice { min-width: 38px; padding: 0 10px; }
  .btn-voice #voiceCallBtnLabel { display: none; }
  .incoming-call { right: 10px; top: 72px; width: calc(100vw - 20px); }
  .voice-panel { right: 10px; bottom: 10px; width: calc(100vw - 20px); }
}

/* v2.3 — expandable canvas, colors, link buttons and resize handles */
.color-tool { position: relative; overflow: hidden; }
.color-tool input[type="color"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.color-tool:has(input:disabled) { opacity: .36; cursor: not-allowed; }
.color-tool:has(input:disabled) input { cursor: not-allowed; }
.color-letter { width: 22px; height: 22px; display: grid; place-items: center; border-bottom: 3px solid currentColor; font-weight: 900; font-size: 16px !important; }
.color-pencil { width: 22px; height: 22px; display: grid; place-items: center; border-bottom: 3px solid var(--accent); }

.board-world { min-width: 4000px; min-height: 2500px; }
.board-item.selected { z-index: 30 !important; }
.resize-handle { display: none; position: absolute; z-index: 60; width: 13px; height: 13px; border: 2px solid #0d1014; border-radius: 3px; background: var(--accent); box-shadow: 0 0 0 1px rgba(255,255,255,.18); touch-action: none; }
.board-item.selected > .resize-handle { display: block; }
.resize-nw { left: -9px; top: -9px; cursor: nwse-resize; }
.resize-ne { right: -9px; top: -9px; cursor: nesw-resize; }
.resize-se { right: -9px; bottom: -9px; cursor: nwse-resize; }
.resize-sw { left: -9px; bottom: -9px; cursor: nesw-resize; }
.board-item.resizing { opacity: .96; }

.item-text { min-width: 80px; max-width: none; }
.item-text .text-content { width: 100%; min-height: 1.05em; white-space: pre-wrap; overflow-wrap: anywhere; }
.item-note .note-text { overflow-wrap: anywhere; }
.item-card .card-title { overflow-wrap: anywhere; }
.item-image { display: flex; flex-direction: column; min-height: 120px; }
.item-image img { flex: 1 1 auto; min-height: 70px; max-height: none; height: calc(100% - 34px); }
.item-image .image-caption { flex: 0 0 auto; }

.item-link { width: 210px; height: 56px; min-width: 130px; min-height: 48px; display: flex; align-items: stretch; gap: 5px; padding: 5px; background: #14181e; border: 1px solid #303742; border-radius: 12px; box-shadow: 0 14px 35px rgba(0,0,0,.22); }
.link-grip { flex: 0 0 22px; display: grid; place-items: center; color: #5d6875; cursor: grab; user-select: none; font-size: 13px; letter-spacing: -2px; }
.link-button { min-width: 0; flex: 1; display: flex; align-items: center; justify-content: center; gap: 9px; border-radius: 8px; padding: 8px 12px; background: var(--accent); color: #0a0c08; text-decoration: none; font-weight: 800; font-size: 11px; line-height: 1.2; overflow: hidden; }
.link-button:hover { background: var(--accent-2); }
.link-label { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-arrow { flex: 0 0 auto; font-size: 13px; }

@media (max-width: 760px) {
  .item-link { width: 185px; }
  .resize-handle { width: 16px; height: 16px; }
}
.item-link .link-edit { flex: 0 0 32px; border: 1px solid #303742; border-radius: 8px; background: #101419; color: #8d98a6; cursor: pointer; }
.item-link .link-edit:hover { color: var(--text); background: #1c222a; }

/* v2.4 — jeden kolor dla tekstu i rysowania + indywidualne kolory użytkowników */
.unified-color-tool { isolation: isolate; }
.active-color-swatch { width: 18px; height: 18px; border-radius: 6px; display: block; border: 1px solid rgba(255,255,255,.38); background: var(--accent); transition: background .12s ease, box-shadow .12s ease, transform .12s ease; }
.unified-color-tool:hover .active-color-swatch { transform: scale(1.08); }
.unified-color-tool small { color: #aab4c0; }
.incoming-call:not(.hidden) { box-shadow: 0 24px 65px rgba(0,0,0,.45), 0 0 0 1px rgba(99,164,255,.08); }

/* v2.4.1 — łatwiejsze przeciąganie zwykłego tekstu */
.item-text:not(.editing),
.item-text:not(.editing) .text-content { cursor: grab; user-select: none; }
.item-text.dragging,
.item-text.dragging .text-content { cursor: grabbing; }
.item-text.editing .text-content { cursor: text; user-select: text; }
.item-text.selected:not(.editing) .text-content::selection { background: transparent; }


/* v2.5 — foldery i trwały magazyn plików */
.item-folder { width: 190px; height: 108px; min-width: 150px; min-height: 92px; display: flex; align-items: center; gap: 13px; padding: 13px; background: #151a20; border: 1px solid #303742; border-radius: 13px; box-shadow: 0 14px 35px rgba(0,0,0,.22); overflow: hidden; cursor: grab; }
.item-folder.dragging { cursor: grabbing; }
.folder-icon { flex: 0 0 52px; width: 52px; height: 46px; position: relative; color: var(--folder-color, var(--accent)); }
.folder-tab { position: absolute; left: 4px; top: 2px; width: 25px; height: 10px; border-radius: 5px 5px 0 0; background: currentColor; opacity: .82; }
.folder-body { position: absolute; inset: 9px 0 0; border: 1px solid color-mix(in srgb, currentColor 75%, #fff 5%); border-radius: 7px; background: color-mix(in srgb, currentColor 13%, #151a20); display: grid; place-items: center; font-size: 17px; }
.folder-copy { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.folder-copy strong { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder-copy span { color: #7f8996; font-size: 9px; line-height: 1.35; }
.folder-dropzone { border: 1px dashed #3b4552; border-radius: 13px; min-height: 92px; padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: #0e1216; transition: border-color .15s ease, background .15s ease; }
.folder-dropzone.dragover { border-color: var(--accent); background: rgba(145,255,0,.045); }
.folder-dropzone > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.folder-dropzone strong { font-size: 11px; }
.folder-dropzone span { color: #7b8794; font-size: 9px; }
.folder-upload-progress { min-height: 22px; padding: 8px 2px 4px; color: #8e99a7; font-size: 9px; }
.folder-files { display: flex; flex-direction: column; gap: 6px; margin-top: 5px; }
.folder-file-row { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 9px; border: 1px solid #272e38; border-radius: 10px; background: #14191f; }
.folder-file-icon { width: 42px; height: 38px; border-radius: 8px; display: grid; place-items: center; background: #202731; color: #a9b5c4; font-size: 9px; font-weight: 800; }
.folder-file-copy { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.folder-file-copy strong { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder-file-copy span { color: #737f8d; font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder-file-actions { display: flex; gap: 5px; align-items: center; }
.folder-file-actions .tiny-btn { min-height: 29px; }
.folder-empty { min-height: 130px; display: grid; place-items: center; align-content: center; gap: 5px; text-align: center; color: #b8c0ca; border: 1px solid #252d36; border-radius: 11px; }
.folder-empty span { color: #727e8b; font-size: 9px; }
.folder-loading { min-height: 150px; display: grid; place-items: center; color: #7d8895; font-size: 10px; }
.file-preview { min-height: 280px; max-height: 65vh; border: 1px solid #282f39; border-radius: 11px; overflow: hidden; background: #080a0d; display: grid; place-items: center; }
.file-preview-image { display: block; max-width: 100%; max-height: 65vh; object-fit: contain; }
.file-preview-frame { width: 100%; height: 62vh; border: 0; background: #fff; }
.file-preview-media { width: min(560px, 100%); padding: 20px; }
.file-preview-video { width: 100%; max-height: 62vh; background: #000; }
.file-preview-text { width: 100%; max-height: 62vh; overflow: auto; margin: 0; padding: 16px; color: #d3d8de; background: #0b0e12; white-space: pre-wrap; word-break: break-word; font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.modal:has(.folder-files), .modal:has(.file-preview) { width: min(820px, 100%); }
@media (max-width: 760px) {
  .item-folder { width: 175px; height: 100px; }
  .folder-file-row { grid-template-columns: 38px minmax(0,1fr); }
  .folder-file-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .folder-dropzone { align-items: stretch; flex-direction: column; }
}
