:root {
  --ink: #25223b;
  --muted: #77748b;
  --line: #e7e5ef;
  --surface: #ffffff;
  --canvas: #f6f5fb;
  --primary: #6254e7;
  --primary-dark: #4c3fd1;
  --primary-soft: #efedff;
  --sidebar: #292640;
  --sidebar-2: #34304e;
  --danger: #e05263;
  --success: #34aa86;
  --warning: #e7aa2f;
  --shadow: 0 18px 50px rgba(40, 35, 80, .12);
  --shadow-sm: 0 8px 24px rgba(40, 35, 80, .09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; overflow: hidden; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }

.button { border: 0; border-radius: 12px; min-height: 42px; padding: 0 17px; font-weight: 700; cursor: pointer; transition: .18s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button--primary { color: #fff; background: linear-gradient(135deg, #7063f0, var(--primary)); box-shadow: 0 8px 18px rgba(98, 84, 231, .22); }
.button--primary:hover { background: linear-gradient(135deg, #6254e7, var(--primary-dark)); }
.button--soft { background: var(--primary-soft); color: var(--primary); }
.button--ghost { background: #f4f3f8; color: #625f73; }
.button--danger { background: #fff0f2; color: var(--danger); }
.button--wide { width: 100%; min-height: 50px; }
.icon-button { width: 42px; height: 42px; border: 0; border-radius: 12px; background: transparent; cursor: pointer; display: grid; place-items: center; font-size: 20px; }

.brand { display: flex; align-items: center; gap: 11px; font-weight: 850; font-size: 20px; letter-spacing: -.4px; }
.brand--light { color: #fff; }
.brand-mark { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 11px; color: #fff; background: linear-gradient(145deg, #8a7cff, #5f50e1); box-shadow: inset 0 1px rgba(255,255,255,.3); }

.auth-view { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, .95fr) minmax(520px, 1.05fr); background: #fff; }
.auth-visual { position: relative; overflow: hidden; padding: 42px 7vw; color: #fff; display: flex; flex-direction: column; background: radial-gradient(circle at 15% 20%, rgba(154,138,255,.42), transparent 30%), radial-gradient(circle at 80% 75%, rgba(71,194,188,.28), transparent 30%), linear-gradient(150deg, #302b56 0%, #4d4398 50%, #5e54cf 100%); }
.auth-visual::after { content: ""; position: absolute; inset: 0; opacity: .18; background-image: linear-gradient(rgba(255,255,255,.14) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.14) 1px, transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(to bottom, transparent, black, transparent); }
.auth-copy { position: relative; z-index: 1; max-width: 580px; margin: auto 0 38px; }
.eyebrow { display: inline-block; padding: 8px 12px; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; background: rgba(255,255,255,.09); font-size: 13px; font-weight: 700; }
.auth-copy h1 { margin: 22px 0 16px; max-width: 560px; font-size: clamp(40px, 4.2vw, 66px); line-height: 1.02; letter-spacing: -2.4px; }
.auth-copy p { max-width: 560px; margin: 0; color: rgba(255,255,255,.76); font-size: 18px; line-height: 1.65; }
.mini-board { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.mini-board div { min-height: 118px; padding: 17px; border: 1px solid rgba(255,255,255,.16); border-radius: 18px; background: rgba(255,255,255,.12); backdrop-filter: blur(12px); display: flex; flex-direction: column; }
.mini-board span { width: 28px; height: 5px; border-radius: 99px; margin-bottom: 16px; background: #f8d268; }
.mini-board div:nth-child(2) span { background: #ca9cf8; }
.mini-board div:nth-child(3) span { background: #68d9c1; }
.mini-board b { font-size: 14px; line-height: 1.35; }
.mini-board small { margin-top: auto; color: rgba(255,255,255,.6); }
.auth-panel { display: grid; place-items: center; padding: 40px; overflow-y: auto; }
.auth-card { width: min(440px, 100%); }
.mobile-brand { display: none; margin-bottom: 30px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 5px; border-radius: 14px; background: #f3f2f7; margin-bottom: 32px; }
.auth-tab { min-height: 42px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 750; cursor: pointer; }
.auth-tab.active { color: var(--ink); background: #fff; box-shadow: 0 3px 12px rgba(40,35,80,.1); }
.auth-form { display: flex; flex-direction: column; gap: 18px; }
.auth-form h2 { margin: 0 0 7px; font-size: 30px; letter-spacing: -1px; }
.auth-form p { margin: 0; color: var(--muted); }
.auth-form label, .field { display: flex; flex-direction: column; gap: 8px; color: #4b485d; font-size: 13px; font-weight: 750; }
.auth-form input, .field input, .field textarea, .field select { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 13px 14px; color: var(--ink); outline: none; transition: .18s; font-weight: 500; }
.auth-form input:focus, .field input:focus, .field textarea:focus, .field select:focus { border-color: #958bf3; box-shadow: 0 0 0 4px rgba(98,84,231,.09); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }

.app-view { height: 100vh; display: grid; grid-template-columns: 264px 1fr; }
.sidebar { min-width: 0; color: rgba(255,255,255,.78); background: linear-gradient(180deg, var(--sidebar), #242138); display: flex; flex-direction: column; padding: 22px 15px 16px; overflow: hidden; }
.sidebar-head { height: 48px; padding: 0 8px; display: flex; align-items: center; justify-content: space-between; }
.sidebar-close { display: none; color: #fff; }
.profile-card { display: flex; align-items: center; gap: 12px; padding: 17px 11px; margin: 16px 0 9px; border-top: 1px solid rgba(255,255,255,.08); border-bottom: 1px solid rgba(255,255,255,.08); }
.avatar { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 800; background: var(--avatar, #6d5dfc); }
.profile-meta { min-width: 0; display: flex; flex-direction: column; }
.profile-meta strong { color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.profile-meta small { color: rgba(255,255,255,.47); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main-nav { display: grid; gap: 4px; }
.nav-item { width: 100%; min-height: 44px; display: flex; align-items: center; gap: 12px; padding: 0 12px; border: 0; border-radius: 11px; color: inherit; background: transparent; cursor: pointer; text-align: left; }
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255,255,255,.09); }
.nav-icon { width: 20px; text-align: center; }
.nav-badge { margin-left: auto; min-width: 21px; padding: 2px 6px; color: #fff; background: #ef6573; border-radius: 99px; font-size: 11px; text-align: center; }
.sidebar-section-title { margin: 25px 10px 10px; display: flex; align-items: center; justify-content: space-between; color: rgba(255,255,255,.4); font-size: 11px; font-weight: 850; letter-spacing: 1.2px; text-transform: uppercase; }
.sidebar-section-title button { border: 0; background: transparent; color: rgba(255,255,255,.65); font-size: 22px; cursor: pointer; }
.project-list { min-height: 0; overflow-y: auto; display: grid; gap: 4px; }
.project-item { width: 100%; min-height: 43px; border: 0; border-radius: 11px; padding: 0 12px; display: flex; align-items: center; gap: 11px; color: rgba(255,255,255,.68); background: transparent; cursor: pointer; text-align: left; }
.project-item:hover, .project-item.active { color: #fff; background: rgba(123,108,246,.22); }
.project-color { width: 9px; height: 9px; border-radius: 3px; background: var(--dot, #8a7cf6); }
.project-item span:nth-child(2) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-item small { margin-left: auto; color: rgba(255,255,255,.38); }
.sidebar-footer { margin-top: auto; padding: 16px 10px 4px; color: rgba(255,255,255,.36); font-size: 12px; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #4ed6aa; box-shadow: 0 0 0 4px rgba(78,214,170,.1); }
.sidebar-backdrop { display: none; }

.workspace { min-width: 0; min-height: 0; height: 100vh; overflow: hidden; display: flex; flex-direction: column; background: var(--canvas); }
.topbar { height: 82px; padding: 0 28px; flex: 0 0 auto; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.topbar-left { min-width: 0; display: flex; align-items: center; gap: 12px; }
.topbar-caption { color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .7px; }
.topbar h1 { margin: 2px 0 0; font-size: 24px; letter-spacing: -.7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-button { display: none; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.search-box { width: min(27vw, 320px); height: 42px; padding: 0 13px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: #faf9fc; }
.search-box input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.notification-button { position: relative; background: #f7f6fa; }
.notification-dot { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: #ef5f70; border: 2px solid #fff; }
.board-toolbar { min-height: 58px; padding: 8px 29px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.75); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.toolbar-stats { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.task-filter { padding: 4px; display: flex; align-items: center; gap: 3px; border-radius: 12px; background: #ebe9f2; }
.task-filter button { min-height: 34px; padding: 0 12px; border: 0; border-radius: 9px; color: #716d80; background: transparent; font-size: 11px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.task-filter button:hover { color: var(--ink); }
.task-filter button.active { color: var(--primary); background: #fff; box-shadow: 0 2px 8px rgba(39,34,68,.09); }
.separator { width: 4px; height: 4px; border-radius: 50%; background: #cbc8d7; }
.workspace-content { min-height: 0; flex: 1; overflow: auto; }
.empty-state { min-height: 100%; display: grid; place-content: center; justify-items: center; padding: 40px; text-align: center; }
.empty-state h2 { margin: 22px 0 8px; font-size: 28px; letter-spacing: -.8px; }
.empty-state p { margin: 0 0 24px; color: var(--muted); }
.empty-illustration { position: relative; width: 150px; height: 112px; border-radius: 24px; display: grid; place-items: center; color: #fff; font-size: 28px; background: linear-gradient(145deg, #7669f0, #584bd8); box-shadow: 0 24px 45px rgba(91,77,217,.25); transform: rotate(-3deg); }
.empty-illustration i, .empty-illustration b { position: absolute; width: 75px; height: 72px; border-radius: 18px; background: #e4e0ff; z-index: -1; }
.empty-illustration i { left: -20px; transform: rotate(-7deg); }
.empty-illustration b { right: -20px; background: #d5f3ea; transform: rotate(9deg); }

.board { min-height: 100%; padding: 24px 28px 34px; display: flex; align-items: stretch; gap: 18px; overflow: visible; background: radial-gradient(circle at 15% 15%, rgba(112,99,240,.05), transparent 28%), var(--canvas); }
.column { flex: 0 0 324px; padding: 12px; border: 1px solid #e8e6ef; border-radius: 17px; background: #efedf4; display: flex; flex-direction: column; transition: .18s; }
.column.drag-over { border-color: var(--primary); background: #e9e6fa; transform: translateY(-2px); }
.column-head { padding: 4px 4px 12px; display: flex; align-items: center; gap: 9px; }
.column-head[draggable="true"] { cursor: grab; user-select: none; }
.column-head[draggable="true"]:active { cursor: grabbing; }
.column.column-dragging { opacity: .5; transform: scale(.985); }
.column.column-drop-target { box-shadow: 0 0 0 2px var(--primary), var(--shadow); }
.column-color { width: 10px; height: 10px; border-radius: 4px; background: var(--column-color); box-shadow: 0 0 0 4px color-mix(in srgb, var(--column-color) 16%, transparent); }
.column-head h2 { min-width: 0; margin: 0; font-size: 15px; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.column-count { min-width: 24px; padding: 3px 7px; border-radius: 99px; color: var(--muted); background: #dedbe6; font-size: 11px; font-weight: 750; text-align: center; }
.column-menu { margin-left: auto; width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.column-menu:hover { background: #dedbe6; }
.task-list { min-height: 64px; flex: 1 1 auto; overflow: visible; display: flex; flex-direction: column; gap: 9px; padding: 1px; }
.task-card { flex: 0 0 auto; overflow: hidden; border: 1px solid #e4e1eb; border-radius: 14px; background: #fff; box-shadow: 0 3px 10px rgba(38,34,68,.05); cursor: pointer; transition: .18s ease; }
.task-card:hover { transform: translateY(-2px); border-color: #d3cef0; box-shadow: var(--shadow-sm); }
.task-card.dragging { opacity: .45; transform: rotate(2deg); }
.task-cover { width: 100%; height: 132px; object-fit: contain; display: block; background: #eeecf3; }
.task-body { padding: 13px; }
.task-title { margin: 0; font-size: 14px; line-height: 1.42; font-weight: 760; }
.task-description { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.task-meta { margin-top: 13px; display: flex; align-items: center; gap: 7px; }
.priority { display: inline-flex; align-items: center; gap: 5px; min-height: 25px; padding: 0 8px; border-radius: 8px; font-size: 10px; font-weight: 800; }
.priority::before { content: ""; width: 5px; height: 10px; border-left: 2px solid currentColor; border-right: 2px solid currentColor; }
.priority--low { color: #318f71; background: #e7f7f1; }
.priority--normal { color: #627087; background: #edf0f5; }
.priority--high { color: #c77923; background: #fff2df; }
.priority--urgent { color: #d34f5e; background: #ffe8eb; }
.task-assignee { margin-left: auto; }
.task-unread { margin-left: auto; padding: 4px 7px; border-radius: 999px; color: #fff; background: var(--primary); font-size: 10px; font-weight: 800; }
.task-unread + .task-assignee { margin-left: 2px; }
.task-assignee.avatar { width: 27px; height: 27px; border-radius: 9px; font-size: 9px; }
.unassigned { margin-left: auto; width: 27px; height: 27px; display: grid; place-items: center; border: 1px dashed #bbb7c9; border-radius: 9px; color: #9995aa; font-size: 15px; }
.add-task { margin-top: 9px; min-height: 40px; border: 1px dashed #d1cedb; border-radius: 11px; background: rgba(255,255,255,.45); color: #6e697e; font-weight: 700; cursor: pointer; }
.add-task:hover { border-color: #9f96ed; color: var(--primary); background: #fff; }
.column-empty { padding: 28px 12px; color: #9a96a8; text-align: center; font-size: 12px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; padding: 22px; display: grid; place-items: center; background: rgba(31,28,49,.54); backdrop-filter: blur(5px); animation: fade .16s ease-out; }
.modal { width: min(520px, 100%); max-height: calc(100vh - 44px); overflow: auto; border-radius: 20px; background: #fff; box-shadow: var(--shadow); animation: pop .2s ease-out; }
.modal--task { width: min(94vw, 1440px); height: min(92vh, 940px); max-height: 92vh; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) minmax(460px, 1.15fr); }
.modal-head { padding: 22px 24px 14px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.modal-head h2 { margin: 0; font-size: 21px; letter-spacing: -.6px; }
.modal-close { width: 36px; height: 36px; border: 0; border-radius: 10px; background: #f3f2f6; color: #777386; font-size: 21px; cursor: pointer; }
.modal-body { padding: 8px 24px 24px; }
.modal-actions { padding: 16px 24px 22px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); }
.form-grid { display: grid; gap: 16px; }
.field textarea { min-height: 104px; resize: vertical; line-height: 1.5; }
.field-help { color: #9995a8; font-size: 11px; font-weight: 500; }

.task-detail-main { min-width: 0; overflow-y: auto; padding: 26px 28px; }
.task-detail-side { position: relative; min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: #faf9fc; }
.task-detail-top { display: flex; align-items: flex-start; gap: 16px; }
.task-detail-top .modal-close { margin-left: auto; flex: 0 0 auto; }
.task-kicker { margin-bottom: 8px; color: var(--primary); font-size: 11px; font-weight: 850; letter-spacing: .8px; text-transform: uppercase; }
.task-edit-title { width: 100%; border: 0; outline: 0; padding: 0; color: var(--ink); font-size: 25px; line-height: 1.22; font-weight: 820; letter-spacing: -.7px; background: transparent; }
.detail-section { margin-top: 25px; }
.detail-section-title { margin: 0 0 10px; color: #4d495e; font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .6px; }
.detail-description { width: 100%; min-height: 120px; border: 1px solid var(--line); border-radius: 13px; padding: 13px; resize: vertical; outline: 0; color: var(--ink); background: #fbfafc; line-height: 1.55; }
.detail-description:focus { border-color: #968cf0; background: #fff; }
.detail-properties { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.property { padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.property label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.property select { width: 100%; border: 0; outline: 0; color: var(--ink); background: #fff; font-weight: 650; }
.upload-zone { position: relative; min-height: 86px; padding: 18px; display: grid; place-items: center; border: 1.5px dashed #cbc6df; border-radius: 14px; color: var(--muted); background: #faf9fd; text-align: center; cursor: pointer; }
.upload-zone:hover { border-color: #8e83ea; color: var(--primary); }
.upload-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-list { display: grid; gap: 8px; margin-top: 10px; }
.file-row { min-width: 0; padding: 10px 11px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.file-icon { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); font-size: 12px; font-weight: 850; }
.file-info { min-width: 0; flex: 1; }
.file-info a { display: block; color: var(--ink); text-decoration: none; font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-info small { color: var(--muted); }
.file-delete { width: 29px; height: 29px; border: 0; border-radius: 8px; color: #a19cac; background: transparent; cursor: pointer; }
.file-delete:hover { color: var(--danger); background: #fff0f2; }
.save-status { margin-top: 8px; min-height: 17px; color: var(--success); font-size: 11px; }
.detail-task-actions { min-height: 42px; margin-top: 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.detail-task-actions .save-status { margin: 0; }

.side-tabs { flex: 0 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); padding: 15px 15px 0; border-bottom: 1px solid var(--line); background: #fff; }
.side-tab { min-height: 42px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 12px; font-weight: 800; cursor: pointer; }
.side-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.side-panel { position: relative; min-height: 0; flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.message-list, .history-list, .media-panel { min-height: 0; flex: 1; overflow-y: auto; padding: 18px; }
.message-list { display: flex; flex-direction: column; gap: 15px; overscroll-behavior: contain; scrollbar-gutter: stable; }
.message { flex: 0 0 auto; display: grid; grid-template-columns: 32px 1fr; gap: 9px; }
.message .avatar { width: 32px; height: 32px; border-radius: 10px; font-size: 10px; }
.message-main { min-width: 0; }
.message--mine { grid-template-columns: minmax(0, 1fr) 32px; }
.message--mine > .avatar { order: 2; }
.message--mine .message-main { order: 1; display: flex; flex-direction: column; align-items: flex-end; }
.message--mine .message-head, .message--mine .message-actions { justify-content: flex-end; }
.message-head { display: flex; align-items: baseline; gap: 7px; }
.message-head strong { font-size: 12px; }
.message-head time { color: #a19dac; font-size: 10px; }
.message-head em { color: #aaa5b5; font-size: 9px; }
.message-body { max-width: min(440px, 100%); margin-top: 4px; padding: 9px 11px; border-radius: 3px 12px 12px; color: #403d4d; background: #fff; border: 1px solid #ece9f1; font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.message--mine .message-body { border-color: #639df1; border-radius: 12px 3px 12px 12px; color: #fff; background: #5c9cf3; }
.message--mine .reply-preview { color: rgba(255,255,255,.82); border-left-color: rgba(255,255,255,.75); }
.message--mine .message-file { color: #fff; text-decoration: underline; }
.reply-preview { margin-bottom: 5px; padding-left: 7px; border-left: 2px solid #9187eb; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.message-actions { margin-top: 4px; display: flex; gap: 5px; }
.message-actions button, .reaction { min-height: 23px; padding: 0 7px; border: 0; border-radius: 7px; color: #8a8698; background: transparent; font-size: 10px; cursor: pointer; }
.message-actions button:hover, .reaction:hover { color: var(--primary); background: var(--primary-soft); }
.reaction { background: #f0eef6; color: #59566a; }
.message-file { display: inline-flex; margin-top: 6px; color: var(--primary); font-size: 10px; font-weight: 700; text-decoration: none; }
.message-gallery { margin-top: 7px; width: min(400px, 60vw); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; overflow: hidden; border-radius: 10px; }
.message-gallery--1 { grid-template-columns: 1fr; }
.message-gallery--1 .attachment-image { aspect-ratio: auto; max-height: 360px; display: flex; align-items: center; justify-content: center; }
.message-gallery--1 .attachment-image img { width: auto; max-width: 100%; height: auto; max-height: 360px; object-fit: contain; }
.message-gallery--3 .attachment-image:first-child { grid-row: span 2; }
.message-documents { margin-top: 7px; display: grid; gap: 5px; }
.attachment-image { position: relative; min-width: 0; aspect-ratio: 1; overflow: hidden; display: block; padding: 0; border: 0; border-radius: 7px; background: #ddd9e8; text-decoration: none; cursor: zoom-in; }
.attachment-image img { width: 100%; height: 100%; display: block; object-fit: cover; }
.attachment-image > span { position: absolute; inset: auto 0 0; padding: 16px 6px 5px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.68)); font-size: 9px; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attachment-document { min-width: 170px; max-width: 300px; padding: 7px; display: flex; align-items: center; gap: 8px; border-radius: 9px; color: #444052; background: #f3f1f8; text-decoration: none; }
.attachment-extension { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; color: #fff; background: #7568de; font-size: 9px; font-weight: 900; }
.attachment-document > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 800; }
.message--mine .attachment-document { color: #444052; background: rgba(255,255,255,.94); }
.system-event { margin: 0 6px; padding: 8px 10px; display: flex; align-items: center; gap: 8px; border-radius: 9px; color: #777287; background: #efedf6; font-size: 10px; line-height: 1.35; }
.system-event > span { width: 20px; height: 20px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 7px; color: var(--primary); background: #fff; font-weight: 900; }
.system-event b { color: #555063; }
.system-event time { display: block; margin-top: 2px; color: #aaa5b5; font-size: 8px; }
.chat-compose { max-height: 55%; flex: 0 1 auto; overflow: hidden; padding: 12px 15px 15px; display: flex; flex-direction: column; border-top: 1px solid var(--line); background: #fff; }
.chat-upload-list { min-height: 0; max-height: min(160px, 22vh); flex: 0 1 160px; margin-bottom: 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; overflow-y: auto; }
.chat-upload-list:empty { display: none; }
.chat-upload-card { position: relative; min-width: 0; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: #f8f7fc; }
.chat-upload-card > .attachment-image, .chat-upload-card > .attachment-document { width: 100%; height: 88px; min-width: 0; }
.chat-upload-card > .file-delete { position: absolute; top: 3px; right: 3px; color: #fff; background: rgba(32,29,46,.62); }
.chat-upload-status { margin-top: 5px; min-height: 25px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; color: var(--muted); font-size: 9px; }
.chat-upload-status small { width: 100%; }
.upload-progress { width: 100%; height: 4px; overflow: hidden; border-radius: 999px; background: #dedbea; }
.upload-progress i { display: block; height: 100%; border-radius: inherit; background: var(--primary); transition: width .15s ease; }
.upload-complete { color: var(--success); }
.upload-error { color: var(--danger); }
.upload-action { padding: 3px 7px; border: 0; border-radius: 6px; color: var(--primary); background: var(--primary-soft); font-size: 9px; font-weight: 800; cursor: pointer; }
.chat-drop-overlay { position: absolute; z-index: 8; inset: 10px; display: grid; place-items: center; border: 2px dashed #8073ee; border-radius: 18px; color: var(--primary); background: rgba(245,243,255,.94); opacity: 0; pointer-events: none; transform: scale(.98); transition: .15s ease; }
.chat-drop-overlay.show { opacity: 1; transform: scale(1); }
.chat-drop-overlay div { text-align: center; }
.chat-drop-overlay b, .chat-drop-overlay span { display: block; }
.chat-drop-overlay b { font-size: 16px; }
.chat-drop-overlay span { margin-top: 5px; color: var(--muted); font-size: 11px; }
.new-messages-button { position: absolute; z-index: 2; left: 50%; bottom: 82px; transform: translate(-50%, 10px); padding: 8px 13px; border: 0; border-radius: 999px; color: #fff; background: var(--primary); box-shadow: 0 7px 20px rgba(83,72,181,.3); font-size: 11px; font-weight: 800; cursor: pointer; opacity: 0; pointer-events: none; transition: .16s ease; }
.new-messages-button.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.replying { flex: 0 0 auto; margin-bottom: 7px; padding: 7px 9px; display: flex; align-items: center; justify-content: space-between; border-radius: 8px; color: #6b6682; background: var(--primary-soft); font-size: 10px; }
.compose-row { flex: 0 0 auto; display: flex; align-items: flex-end; gap: 8px; }
.compose-row textarea { min-height: 42px; max-height: 110px; flex: 1; resize: none; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; outline: 0; line-height: 1.35; }
.compose-row textarea:focus { border-color: #958bf0; }
.attach-button { position: relative; flex: 0 0 auto; overflow: hidden; }
.attach-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.send-button { flex: 0 0 auto; width: 42px; height: 42px; border: 0; border-radius: 12px; color: #fff; background: var(--primary); cursor: pointer; }
.history-list { display: flex; flex-direction: column; gap: 0; }
.history-item { position: relative; padding: 0 0 18px 21px; border-left: 1px solid #ddd9e7; color: #625e70; font-size: 11px; line-height: 1.4; }
.history-item::before { content: ""; position: absolute; left: -4px; top: 2px; width: 7px; height: 7px; border-radius: 50%; background: #9186ec; box-shadow: 0 0 0 4px #efedff; }
.history-item b { color: #3b3849; }
.history-item time { display: block; margin-top: 3px; color: #aaa6b5; font-size: 9px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 7px; }
.media-card { position: relative; aspect-ratio: 1; overflow: hidden; padding: 0; border: 0; border-radius: 9px; background: #dedbe6; cursor: zoom-in; }
.media-card img { width: 100%; height: 100%; object-fit: contain; }
.media-card span { position: absolute; inset: auto 0 0; padding: 20px 7px 6px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.7)); font-size: 9px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.image-viewer { position: fixed; z-index: 300; inset: 0; display: flex; flex-direction: column; color: #fff; background: rgba(13,12,20,.94); backdrop-filter: blur(8px); animation: fade .15s ease-out; }
.image-viewer-toolbar { min-height: 64px; padding: 10px 18px; display: flex; align-items: center; gap: 12px; background: rgba(0,0,0,.22); }
.image-viewer-toolbar > span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 700; }
.image-viewer-zoom { flex: 0 0 auto; display: flex; align-items: center; gap: 5px; }
.image-viewer-zoom button { min-width: 36px; height: 36px; padding: 0 9px; border: 0; border-radius: 9px; color: #fff; background: rgba(255,255,255,.12); font-size: 16px; font-weight: 800; cursor: pointer; }
.image-viewer-zoom button:last-child { min-width: auto; font-size: 11px; }
.image-viewer-zoom b { width: 48px; color: rgba(255,255,255,.72); font-size: 10px; text-align: center; }
.image-viewer-download { min-height: 38px; padding: 0 15px; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: var(--primary); text-decoration: none; }
.image-viewer-close { width: 40px; height: 40px; border: 0; border-radius: 10px; color: #fff; background: rgba(255,255,255,.12); font-size: 26px; cursor: pointer; }
.image-viewer-stage { position: relative; min-height: 0; flex: 1; padding: 18px; overflow: hidden; display: grid; place-items: center; touch-action: none; }
.image-viewer-stage img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; user-select: none; cursor: zoom-in; box-shadow: 0 12px 50px rgba(0,0,0,.35); transform-origin: center; transition: transform .12s ease; }
.image-viewer-stage img.zoomed { cursor: grab; }
.image-viewer-stage img.dragging { cursor: grabbing; transition: none; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(31,28,49,.26); }
.drawer { position: fixed; z-index: 61; top: 0; right: 0; width: min(420px, 100%); height: 100vh; display: flex; flex-direction: column; background: #fff; box-shadow: -15px 0 45px rgba(35,31,62,.16); animation: slide .2s ease-out; }
.drawer-head { padding: 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 20px; }
.drawer-body { min-height: 0; overflow-y: auto; padding: 14px 20px 24px; }
.trash-list { display: grid; gap: 10px; }
.trash-item { padding: 14px; display: grid; gap: 13px; border: 1px solid var(--line); border-radius: 14px; background: #fbfafc; }
.trash-item strong { display: block; font-size: 13px; }
.trash-item p { margin: 5px 0; color: var(--muted); font-size: 11px; }
.trash-item small { color: #9b97a8; font-size: 10px; }
.trash-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.trash-actions .button { min-height: 36px; padding: 0 12px; font-size: 11px; }
.trash-empty { min-height: 50vh; padding: 20px; }
.trash-empty h2 { font-size: 20px; }
.notification-item { padding: 14px 8px; display: grid; grid-template-columns: 35px 1fr; gap: 10px; border-bottom: 1px solid #efedf3; cursor: pointer; }
.notification-item.unread { background: #f9f8ff; }
.notification-symbol { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 10px; color: var(--primary); background: var(--primary-soft); }
.notification-item strong { display: block; font-size: 12px; }
.notification-item p { margin: 4px 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.notification-item time { color: #aaa6b5; font-size: 9px; }
.settings-group { margin-bottom: 24px; }
.settings-group h3 { margin: 0 0 5px; font-size: 14px; }
.settings-group > p { margin: 0 0 13px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.toggle-row { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #efedf3; font-size: 12px; }
.toggle { position: relative; width: 39px; height: 23px; flex: 0 0 auto; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; border-radius: 99px; background: #d8d5df; cursor: pointer; transition: .2s; }
.toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.18); transition: .2s; }
.toggle input:checked + span { background: var(--primary); }
.toggle input:checked + span::after { transform: translateX(16px); }
.toast { position: fixed; z-index: 200; left: 50%; bottom: 24px; transform: translate(-50%, 20px); padding: 11px 16px; border-radius: 11px; color: #fff; background: #2c293d; box-shadow: var(--shadow-sm); font-size: 12px; font-weight: 650; opacity: 0; pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #c84958; }

@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98) } }
@keyframes slide { from { transform: translateX(40px); opacity: 0 } }

@media (max-width: 980px) {
  .auth-view { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .mobile-brand { display: flex; }
  .app-view { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 80; width: min(300px, 86vw); transform: translateX(-105%); transition: transform .22s ease; box-shadow: 20px 0 50px rgba(24,21,42,.24); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close, .menu-button { display: grid; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 79; background: rgba(28,25,44,.45); }
  .sidebar-backdrop.show { display: block; }
  .topbar { padding: 0 18px; }
  .board-toolbar { flex-wrap: wrap; gap: 7px 12px; }
  .task-filter { order: 3; width: 100%; justify-content: center; }
  .modal--task { grid-template-columns: 1fr; grid-template-rows: minmax(0, .9fr) minmax(0, 1.1fr); height: calc(100vh - 24px); overflow: hidden; }
  .task-detail-main { overflow-y: auto; }
  .task-detail-side { min-height: 0; border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 680px) {
  body { overflow: hidden; }
  .auth-panel { padding: 25px 20px; align-items: start; }
  .auth-card { margin-top: 24px; }
  .form-row { grid-template-columns: 1fr; }
  .topbar { height: 70px; }
  .topbar-caption { display: none; }
  .topbar h1 { font-size: 19px; }
  .search-box, #create-project-top { display: none; }
  .board-toolbar { padding: 8px 16px; }
  .task-filter button { flex: 1; padding: 0 5px; }
  .toolbar-stats span:nth-last-child(-n+2) { display: none; }
  .board { padding: 16px; scroll-snap-type: x mandatory; }
  .column { flex-basis: calc(100vw - 43px); scroll-snap-align: center; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { max-height: 92vh; border-radius: 20px 20px 0 0; }
  .modal--task { width: 100%; height: 100vh; max-height: 100vh; grid-template-rows: minmax(220px, 44%) minmax(0, 56%); border-radius: 0; }
  .task-detail-main { padding: 22px 19px; }
  .task-edit-title { font-size: 21px; }
  .detail-properties { grid-template-columns: 1fr; }
  .task-detail-side { min-height: 0; }
  .toast { width: calc(100% - 30px); text-align: center; }
  .image-viewer-toolbar { min-height: auto; flex-wrap: wrap; padding: 8px 10px; }
  .image-viewer-toolbar > span { width: calc(100% - 52px); flex-basis: calc(100% - 52px); order: 1; }
  .image-viewer-close { margin-left: auto; order: 2; }
  .image-viewer-zoom { order: 3; }
  .image-viewer-download { margin-left: auto; order: 4; }
}
