@charset "UTF-8";
:root,
:root[data-theme=light],
:root[data-theme=purple] {
  --color-bg: #f5f6fa;
  --color-bg-muted: #f0f1f7;
  --color-bg-hover: #eef0f8;
  --color-surface: #ffffff;
  --color-input-bg: #ffffff;
  --color-border: #e2e4ea;
  --color-border-muted: #eceef4;
  --color-text: #1f2230;
  --color-text-muted: #6b7280;
  --color-primary: #7c3aed;
  --color-primary-hover: #6d28d9;
  --color-primary-light: rgba(124, 58, 237, 0.12);
  --color-primary-tint: #f3e8ff;
  --color-sidebar-bg: #f5f3ff;
  --color-success: #16a34a;
  --color-danger: #dc2626;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 2px 8px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 8px 24px rgba(16, 24, 40, 0.12);
}

:root[data-theme=blue] {
  --color-bg: #f4f7fb;
  --color-bg-muted: #ebf1f8;
  --color-bg-hover: #e1ebf7;
  --color-surface: #ffffff;
  --color-input-bg: #ffffff;
  --color-border: #dbe4f0;
  --color-border-muted: #e6edf5;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-light: rgba(37, 99, 235, 0.12);
  --color-primary-tint: #eff6ff;
  --color-sidebar-bg: #f0f7ff;
  --color-success: #16a34a;
  --color-danger: #dc2626;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 2px 8px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.12);
}

:root[data-theme=green] {
  --color-bg: #f3f9f6;
  --color-bg-muted: #e6f4ed;
  --color-bg-hover: #d8eee3;
  --color-surface: #ffffff;
  --color-input-bg: #ffffff;
  --color-border: #d1e7dd;
  --color-border-muted: #e2f0e9;
  --color-text: #132a1e;
  --color-text-muted: #52796f;
  --color-primary: #059669;
  --color-primary-hover: #047857;
  --color-primary-light: rgba(5, 150, 105, 0.12);
  --color-primary-tint: #ecfdf5;
  --color-sidebar-bg: #f0fdf4;
  --color-success: #16a34a;
  --color-danger: #dc2626;
  --shadow-sm: 0 1px 2px rgba(19, 42, 30, 0.06);
  --shadow-md: 0 2px 8px rgba(19, 42, 30, 0.08);
  --shadow-lg: 0 8px 24px rgba(19, 42, 30, 0.12);
}

:root[data-theme=pink] {
  --color-bg: #faf4f7;
  --color-bg-muted: #f7e8ef;
  --color-bg-hover: #f3dce6;
  --color-surface: #ffffff;
  --color-input-bg: #ffffff;
  --color-border: #f0d2e0;
  --color-border-muted: #f7e4ed;
  --color-text: #2c1622;
  --color-text-muted: #835269;
  --color-primary: #db2777;
  --color-primary-hover: #be185d;
  --color-primary-light: rgba(219, 39, 119, 0.12);
  --color-primary-tint: #fdf2f8;
  --color-sidebar-bg: #fff1f2;
  --color-success: #16a34a;
  --color-danger: #dc2626;
  --shadow-sm: 0 1px 2px rgba(44, 22, 34, 0.06);
  --shadow-md: 0 2px 8px rgba(44, 22, 34, 0.08);
  --shadow-lg: 0 8px 24px rgba(44, 22, 34, 0.12);
}

:root[data-theme=bronze] {
  --color-bg: #faf7f2;
  --color-bg-muted: #f5ede2;
  --color-bg-hover: #efe2d1;
  --color-surface: #ffffff;
  --color-input-bg: #ffffff;
  --color-border: #e6d6c2;
  --color-border-muted: #f0e6d8;
  --color-text: #2a2218;
  --color-text-muted: #786650;
  --color-primary: #d97706;
  --color-primary-hover: #b45309;
  --color-primary-light: rgba(217, 119, 6, 0.12);
  --color-primary-tint: #fffbeb;
  --color-sidebar-bg: #fdf8f0;
  --color-success: #16a34a;
  --color-danger: #dc2626;
  --shadow-sm: 0 1px 2px rgba(42, 34, 24, 0.06);
  --shadow-md: 0 2px 8px rgba(42, 34, 24, 0.08);
  --shadow-lg: 0 8px 24px rgba(42, 34, 24, 0.12);
}

:root[data-theme=dark] {
  --color-bg: #0d1117;
  --color-bg-muted: #161b22;
  --color-bg-hover: #21262d;
  --color-surface: #161b22;
  --color-input-bg: #0d1117;
  --color-border: #30363d;
  --color-border-muted: #21262d;
  --color-text: #e6edf3;
  --color-text-muted: #8d96a0;
  --color-primary: #4493f8;
  --color-primary-hover: #1f6feb;
  --color-primary-light: rgba(56, 139, 253, 0.15);
  --color-primary-tint: #1f2a44;
  --color-sidebar-bg: #12141c;
  --color-success: #3fb950;
  --color-danger: #f85149;
  --shadow-sm: 0 1px 2px rgba(1, 4, 9, 0.5);
  --shadow-md: 0 3px 10px rgba(1, 4, 9, 0.6);
  --shadow-lg: 0 8px 24px rgba(1, 4, 9, 0.7);
}

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

[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue", Roboto, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  font-size: 14px;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

h1, h2, h3 {
  margin: 0 0 12px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: 500;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.btn:hover {
  background: var(--color-bg);
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
.btn--primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.btn--primary:hover {
  background: var(--color-primary-hover);
}
.btn--ghost {
  background: transparent;
  border: 1px dashed var(--color-border);
}
.btn--block {
  width: 100%;
  justify-content: center;
}

.ui-flex-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.ui-flex-header > .field__label,
.ui-flex-header > .task-section__title {
  margin-bottom: 0;
}

.ui-flex-fill {
  flex: 1;
}

.stt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.stt-btn:hover:not(:disabled) {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.stt-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
.stt-btn:disabled {
  cursor: not-allowed;
}
.stt-btn--recording {
  background: color-mix(in srgb, var(--color-danger) 12%, transparent);
  border-color: var(--color-danger);
  color: var(--color-danger);
  animation: stt-pulse 1.4s ease-in-out infinite;
}
.stt-btn--busy {
  color: var(--color-primary);
  cursor: wait;
}
.stt-btn--blocked, .stt-btn--unsupported {
  opacity: 0.45;
  cursor: not-allowed;
}
.stt-btn__spinner {
  animation: stt-spin 0.8s linear infinite;
}

@keyframes stt-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-danger) 35%, transparent);
  }
  50% {
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--color-danger) 0%, transparent);
  }
}
@keyframes stt-spin {
  to {
    transform: rotate(360deg);
  }
}
select {
  appearance: none;
  -webkit-appearance: none;
  padding: 8px 30px 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-input-bg, var(--color-surface)) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5l3.5 3.5 3.5-3.5' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center;
  background-size: 10px;
  color: var(--color-text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
select:hover {
  border-color: color-mix(in srgb, var(--color-text-muted) 60%, var(--color-border));
}
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.field {
  display: block;
  margin-bottom: 14px;
}
.field__label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}
.field input:not([type=checkbox]):not([type=radio]):not([type=color]), .field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-input-bg, var(--color-surface));
  color: var(--color-text);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.field input:not([type=checkbox]):not([type=radio]):not([type=color])::placeholder, .field textarea::placeholder {
  color: var(--color-text-muted);
  opacity: 0.8;
}
.field input:not([type=checkbox]):not([type=radio]):not([type=color]):focus, .field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
.field input[type=color] {
  width: 56px;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-input-bg, var(--color-surface));
  cursor: pointer;
}
.field input[type=color]:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
.field select {
  width: 100%;
}
.field textarea {
  min-height: 80px;
  resize: vertical;
}
.field--fill {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.field--checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.field--checkbox input[type=checkbox] {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: none;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.password-input-row {
  display: flex;
  gap: 8px;
}
.password-input-row input {
  flex: 1;
  min-width: 0;
}
@media (max-width: 640px) {
  .password-input-row {
    flex-wrap: wrap;
  }
  .password-input-row input {
    flex: 1 1 100%;
  }
  .password-input-row #js-generate-password {
    flex: 1;
    justify-content: center;
  }
}

.field-row--2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

input[type=date],
input[type=datetime-local],
input[type=time] {
  color-scheme: light dark;
  color: var(--color-text);
  background: var(--color-surface);
}
input[type=date]::-webkit-datetime-edit,
input[type=datetime-local]::-webkit-datetime-edit,
input[type=time]::-webkit-datetime-edit {
  color: var(--color-text);
}
input[type=date]::-webkit-datetime-edit-fields-wrapper,
input[type=datetime-local]::-webkit-datetime-edit-fields-wrapper,
input[type=time]::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}
input[type=date]::-webkit-datetime-edit-text, input[type=date]::-webkit-datetime-edit-month-field, input[type=date]::-webkit-datetime-edit-day-field, input[type=date]::-webkit-datetime-edit-year-field, input[type=date]::-webkit-datetime-edit-hour-field, input[type=date]::-webkit-datetime-edit-minute-field,
input[type=datetime-local]::-webkit-datetime-edit-text,
input[type=datetime-local]::-webkit-datetime-edit-month-field,
input[type=datetime-local]::-webkit-datetime-edit-day-field,
input[type=datetime-local]::-webkit-datetime-edit-year-field,
input[type=datetime-local]::-webkit-datetime-edit-hour-field,
input[type=datetime-local]::-webkit-datetime-edit-minute-field,
input[type=time]::-webkit-datetime-edit-text,
input[type=time]::-webkit-datetime-edit-month-field,
input[type=time]::-webkit-datetime-edit-day-field,
input[type=time]::-webkit-datetime-edit-year-field,
input[type=time]::-webkit-datetime-edit-hour-field,
input[type=time]::-webkit-datetime-edit-minute-field {
  color: var(--color-text);
}
input[type=date]::-webkit-datetime-edit-text:focus, input[type=date]::-webkit-datetime-edit-month-field:focus, input[type=date]::-webkit-datetime-edit-day-field:focus, input[type=date]::-webkit-datetime-edit-year-field:focus, input[type=date]::-webkit-datetime-edit-hour-field:focus, input[type=date]::-webkit-datetime-edit-minute-field:focus,
input[type=datetime-local]::-webkit-datetime-edit-text:focus,
input[type=datetime-local]::-webkit-datetime-edit-month-field:focus,
input[type=datetime-local]::-webkit-datetime-edit-day-field:focus,
input[type=datetime-local]::-webkit-datetime-edit-year-field:focus,
input[type=datetime-local]::-webkit-datetime-edit-hour-field:focus,
input[type=datetime-local]::-webkit-datetime-edit-minute-field:focus,
input[type=time]::-webkit-datetime-edit-text:focus,
input[type=time]::-webkit-datetime-edit-month-field:focus,
input[type=time]::-webkit-datetime-edit-day-field:focus,
input[type=time]::-webkit-datetime-edit-year-field:focus,
input[type=time]::-webkit-datetime-edit-hour-field:focus,
input[type=time]::-webkit-datetime-edit-minute-field:focus {
  background: color-mix(in srgb, var(--color-primary) 20%, transparent);
  color: var(--color-text);
  border-radius: 2px;
}
input[type=date]::-webkit-calendar-picker-indicator,
input[type=datetime-local]::-webkit-calendar-picker-indicator,
input[type=time]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
  border-radius: 3px;
  padding: 2px;
  transition: opacity 0.12s, background 0.12s;
}
input[type=date]::-webkit-calendar-picker-indicator:hover,
input[type=datetime-local]::-webkit-calendar-picker-indicator:hover,
input[type=time]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  background: var(--color-bg);
}

[data-theme=dark] input[type=date]::-webkit-calendar-picker-indicator,
[data-theme=dark] input[type=datetime-local]::-webkit-calendar-picker-indicator,
[data-theme=dark] input[type=time]::-webkit-calendar-picker-indicator {
  filter: invert(0.8);
}

.alert {
  display: block;
  position: relative;
  padding: 13px 16px 13px 44px;
  border-radius: 12px;
  margin-bottom: 20px;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-text-muted);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 13px;
  line-height: 1.55;
}
.alert::before {
  position: absolute;
  left: 14px;
  top: 14px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
.alert--info {
  border-left-color: var(--color-primary);
  background: var(--color-primary-tint, rgba(124, 58, 237, 0.06));
}
.alert--info::before {
  content: "i";
  background: var(--color-primary);
}
.alert--error {
  border-left-color: var(--color-danger);
  background: color-mix(in srgb, var(--color-danger) 8%, var(--color-surface));
}
.alert--error::before {
  content: "✕";
  background: var(--color-danger);
}
.alert--success {
  border-left-color: var(--color-success);
  background: color-mix(in srgb, var(--color-success) 8%, var(--color-surface));
}
.alert--success::before {
  content: "✓";
  background: var(--color-success);
}

.dialog {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
  border-radius: 12px;
  padding: 24px;
  width: 420px;
  max-width: 90vw;
}
.dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
}
.dialog__form h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 18px;
}
.dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
.dialog--wide {
  width: 80vw;
  max-width: 1000px;
  height: 80vh;
  display: none;
}
.dialog--wide[open] {
  display: flex;
  flex-direction: column;
}
.dialog--wide .dialog__form {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.dialog--wide .dialog__body {
  flex-grow: 1;
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-right: 8px; /* for scrollbar */
}

.empty-state {
  color: var(--color-text-muted);
  font-style: italic;
}

.empty-state--panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 48px 20px;
  font-style: normal;
  text-align: center;
}
.empty-state--panel .empty-state__icon {
  font-size: 26px;
  opacity: 0.55;
}
.empty-state--panel .empty-state__text {
  font-size: 13px;
  color: var(--color-text-muted);
}

.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border-muted);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  padding: 22px;
  margin-bottom: 20px;
}
.panel__title {
  font-size: 15px;
}
.panel--danger {
  border-color: color-mix(in srgb, var(--color-danger) 30%, var(--color-border));
  box-shadow: none;
}

.danger-zone__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.danger-zone__row p {
  margin: 4px 0 0;
}

.btn--danger {
  background: var(--color-danger);
  color: #fff;
  border-color: var(--color-danger);
}
.btn--danger:hover {
  background: color-mix(in srgb, var(--color-danger) 80%, #000);
  border-color: color-mix(in srgb, var(--color-danger) 80%, #000);
}
.btn--danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--ghost.btn--danger {
  background: transparent;
  color: var(--color-danger);
  border: 1px dashed var(--color-danger);
}
.btn--ghost.btn--danger:hover {
  background: color-mix(in srgb, var(--color-danger) 12%, transparent);
  border-style: solid;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
}
.data-table th {
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 12px;
}
.data-table tr:last-child td {
  border-bottom: none;
}
.data-table select {
  padding: 4px 8px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-bg);
  color: var(--color-text);
}

.task-list-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.task-list-filters__select, .task-list-filters__date {
  padding: 7px 10px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 13px;
}
.task-list-filters__search {
  flex: 1;
  min-width: 160px;
  padding: 7px 10px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 13px;
}
.task-list-filters__checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text-muted);
  cursor: pointer;
}

.task-list-wrap {
  overflow-x: auto;
}

.task-list-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border: 1px solid var(--color-border-muted);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  font-size: 13px;
}
.task-list-table th, .task-list-table td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}
.task-list-table th {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--color-bg);
}
.task-list-table tr:last-child td {
  border-bottom: none;
}
.task-list-table__col-unread {
  width: 28px;
  padding-left: 10px;
  padding-right: 10px;
}
.task-list-table__col-priority {
  width: 132px;
  padding-right: 4px;
}
.task-list-table__th-title {
  display: flex;
  align-items: center;
  gap: 4px;
}
.task-list-table#js-task-list-table {
  table-layout: fixed;
  min-width: 1000px;
}
.task-list-table#js-task-list-table th, .task-list-table#js-task-list-table td {
  overflow: hidden;
}
.task-list-table#js-task-list-table .task-list-table__col-category {
  width: 150px;
}
.task-list-table#js-task-list-table .task-list-table__col-importance {
  width: 92px;
}
.task-list-table#js-task-list-table .task-list-table__col-assignee {
  width: 170px;
}
.task-list-table#js-task-list-table .task-list-table__col-due {
  width: 110px;
}
.task-list-table#js-task-list-table .task-list-table__col-status {
  width: 165px;
}

@media (max-width: 768px) {
  .task-list-table th, .task-list-table td {
    padding: 12px 14px;
  }
  .task-list-table th[data-col=project], .task-list-table td[data-col=project],
  .task-list-table th[data-col=status], .task-list-table td[data-col=status],
  .task-list-table th[data-col=priority], .task-list-table td[data-col=priority],
  .task-list-table th[data-col=created], .task-list-table td[data-col=created],
  .task-list-table .task-list-table__col-priority {
    display: none !important;
  }
}
.task-list-row {
  transition: background 0.1s ease;
}
.task-list-row:hover {
  background: var(--color-bg);
}
.task-list-row--done td {
  opacity: 0.55;
}
.task-list-row--priority-low > td:first-child {
  box-shadow: inset 3px 0 0 0 #94a3b8;
}
.task-list-row--priority-medium > td:first-child {
  box-shadow: inset 3px 0 0 0 #60a5fa;
}
.task-list-row--priority-high > td:first-child {
  box-shadow: inset 3px 0 0 0 #fbbf24;
}
.task-list-row--priority-urgent > td:first-child {
  box-shadow: inset 3px 0 0 0 #f87171;
}
.task-list-row__title {
  color: var(--color-text);
  font-weight: 600;
}
.task-list-row__title:hover {
  color: var(--color-primary);
}

.tl-category-header td {
  padding: 8px 14px;
  background: var(--color-bg);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}
.tl-category-header__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.tl-category-header__name {
  vertical-align: middle;
}
.tl-category-header__count {
  margin-left: 6px;
  color: var(--color-text-muted);
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
}

.task-overdue {
  color: #ef4444;
  font-weight: 600;
}

.task-list-row__title-input {
  width: 100%;
  border: 1px solid var(--color-primary);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 13px;
  font-weight: 500;
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 20%, transparent);
}
.task-list-row__title-input:focus {
  outline: none;
}

.task-list-row__open {
  display: inline;
  font-size: 11px;
  color: transparent;
  margin-left: 4px;
  text-decoration: none;
  transition: color 0.15s;
}
.task-list-row__open:hover {
  color: var(--color-primary);
}
.task-list-row:hover .task-list-row__open {
  color: var(--color-text-muted);
}

.tl-editable {
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.tl-editable .tl-cell-hint {
  opacity: 0;
  font-size: 10px;
  color: var(--color-text-muted);
  margin-left: 4px;
  transition: opacity 0.1s;
}
.tl-editable:hover .tl-cell-hint {
  opacity: 1;
}
.tl-editable .tl-cell-value--empty {
  color: var(--color-text-muted);
}
.tl-editable:hover .tl-cell-value--empty {
  color: var(--color-primary);
}

.tl-avatar {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 11px;
  font-weight: bold;
}

.ui-icon {
  flex-shrink: 0;
  vertical-align: -0.125em;
}

.tl-avatar--empty {
  background: transparent;
  border: 1px dashed var(--color-text-muted);
  color: var(--color-text-muted);
  opacity: 0.6;
}

.tl-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  font-size: 11px;
  color: var(--color-text-muted);
  background: var(--color-bg);
  padding: 3px 7px;
  border-radius: 12px;
  white-space: nowrap;
}

.tl-status-checkbox {
  margin: 0;
  cursor: pointer;
  width: 16px;
  height: 16px;
}

.tl-subtasks-row td {
  padding: 8px 24px 12px 40px !important;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.tl-subtasks-row td:nth-child(1) {
  padding-left: 24px !important;
}
.tl-subtasks-row td:nth-child(2) {
  padding-left: 24px !important;
}

.tl-popup {
  position: absolute;
  z-index: 1200;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  min-width: 180px;
  max-height: 260px;
  overflow-y: auto;
}
.tl-popup__item {
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  color: var(--color-text);
}
.tl-popup__item:hover {
  background: var(--color-bg);
}
.tl-popup__item--active {
  font-weight: 600;
  color: var(--color-primary);
}
.tl-popup__date-wrap {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 220px;
}
.tl-popup__date-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}
.tl-popup__date-input {
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
  background: var(--color-bg);
  color: var(--color-text);
}
.tl-popup__date-input:focus {
  outline: none;
  border-color: var(--color-primary);
}
.tl-popup__date-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.tl-popup__date-clear {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--color-text-muted);
  padding: 4px 6px;
  border-radius: 4px;
}
.tl-popup__date-clear:hover {
  color: var(--color-danger);
  background: color-mix(in srgb, var(--color-danger) 10%, transparent);
}

.tl-checkbox {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.tl-checkbox__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.tl-checkbox__box {
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-border);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}
.tl-checkbox__box::after {
  content: "";
  display: none;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
}
.tl-checkbox__input:checked + .tl-checkbox__box {
  background: #22c55e;
  border-color: #22c55e;
}
.tl-checkbox__input:checked + .tl-checkbox__box::after {
  display: block;
}
.tl-checkbox:hover .tl-checkbox__box {
  border-color: #22c55e;
}

.task-list-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge--active, .badge--green {
  background: #dcfce7;
  color: #166534;
}
.badge--pending, .badge--yellow {
  background: #fef9c3;
  color: #854d0e;
}
.badge--inactive, .badge--gray {
  background: #f3f4f6;
  color: #6b7280;
}
.badge--blue {
  background: #dbeafe;
  color: #1d4ed8;
}
.badge--red {
  background: #fee2e2;
  color: #991b1b;
}
.badge--purple {
  background: #ede9fe;
  color: #6d28d9;
}
[data-theme=dark] .badge--active, [data-theme=dark] .badge--green {
  background: rgba(22, 163, 74, 0.2);
  color: #4ade80;
}
[data-theme=dark] .badge--inactive, [data-theme=dark] .badge--gray {
  background: rgba(107, 114, 128, 0.2);
  color: #9ca3af;
}
[data-theme=dark] .badge--blue {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}
[data-theme=dark] .badge--red {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}
[data-theme=dark] .badge--yellow {
  background: rgba(234, 179, 8, 0.2);
  color: #fbbf24;
}

/* Custom uploaded app logo (replaces text wordmark when set) */
.app-logo-image {
  max-height: 32px;
  width: auto;
  display: block;
}

.auth-card__logo .app-logo-image {
  max-height: 48px;
  margin: 0 auto;
}

/* Performer badge */
.performer-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 6px;
  border-radius: 8px;
  background: var(--color-bg-muted);
  color: var(--color-text-muted);
  font-size: 11px;
}

/* ── Convert-to-recurring dialog hint ───────────────────────────── */
.dialog__hint {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.field__hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--color-text-muted);
}
.field__hint code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--color-bg-muted);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 11px;
}

.field input:not([type=checkbox]):not([type=radio]):not([type=color]).is-invalid,
.field textarea.is-invalid,
.field select.is-invalid,
input.is-invalid,
textarea.is-invalid,
select.is-invalid {
  border-color: var(--color-danger);
}
.field input:not([type=checkbox]):not([type=radio]):not([type=color]).is-invalid:focus,
.field textarea.is-invalid:focus,
.field select.is-invalid:focus,
input.is-invalid:focus,
textarea.is-invalid:focus,
select.is-invalid:focus {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-danger) 20%, transparent);
}

.field__error {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--color-danger);
  animation: field-error-in 0.15s ease-out;
}
.field__error::before {
  content: "✕";
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  color: #fff;
  background: var(--color-danger);
}

@keyframes field-error-in {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* ── UI/UX: Иконка повторяющейся задачи (Канбан, списки) ──────── */
.recurring-icon {
  width: 14px;
  height: 14px;
  margin-right: 6px;
  vertical-align: text-bottom;
  color: var(--indigo, #8b5cf6); /* Primer / GitHub Style fallback */
  flex-shrink: 0;
  /* Приглушенный золотой для темной темы или по желанию (альтернатива) */
}
:root[data-theme=dark] .recurring-icon {
  color: var(--gold, #d29922);
}

.badge--indigo {
  background-color: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 2px 6px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}
:root[data-theme=dark] .badge--indigo {
  background-color: rgba(139, 92, 246, 0.2);
  color: #a78bfa;
  border-color: rgba(139, 92, 246, 0.4);
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 5px;
}

.form-input,
.form-select {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-input-bg, var(--color-surface));
  color: var(--color-text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s;
}
.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-light);
}

textarea.form-input {
  min-height: 80px;
  resize: vertical;
}

.inbox-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inbox-day-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 2px 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.inbox-day-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-border-muted);
}
.inbox-day-divider:first-child {
  margin-top: 0;
}

.inbox-item {
  --accent: var(--color-text-muted);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid color-mix(in srgb, var(--color-border) 70%, transparent);
  border-left: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  transition: background 0.12s ease, border-color 0.12s ease;
}
.inbox-item:hover {
  background: var(--color-bg-hover);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--color-border));
}
.inbox-item:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}
.inbox-item--moved {
  --accent: var(--color-success);
}
.inbox-item--comment_added {
  --accent: #60a5fa;
}
.inbox-item--assignees_changed {
  --accent: var(--color-primary);
}
.inbox-item--assignees_changed .inbox-item__type-badge {
  background: color-mix(in srgb, var(--accent) 28%, transparent);
}
.inbox-item__avatar {
  width: 28px;
  height: 28px;
  margin-top: 1px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
.inbox-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.inbox-item__row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.inbox-item__type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  white-space: nowrap;
}
.inbox-item__text {
  min-width: 0;
  font-size: 13px;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inbox-item__text code {
  font-size: 11px;
  padding: 1px 4px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--color-text-muted) 14%, transparent);
}
.inbox-item__project {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.inbox-item__time {
  flex-shrink: 0;
  padding-top: 2px;
  font-size: 11px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

@media (max-width: 768px) {
  .inbox-item {
    flex-wrap: wrap;
  }
  .inbox-item__row {
    flex-wrap: wrap;
    row-gap: 4px;
  }
  .inbox-item__text {
    white-space: normal;
  }
  .inbox-item__time {
    margin-left: 40px;
  }
}
.all-tasks-table .at-col-dot {
  width: 132px;
  padding-right: 4px;
}
.all-tasks-table .at-col-project {
  width: 160px;
  color: var(--color-text-muted);
  font-size: 12px;
}
.all-tasks-table .at-col-category {
  width: 130px;
}
.all-tasks-table .at-col-assignee {
  width: 160px;
}
.all-tasks-table .at-col-creator {
  width: 160px;
}
.all-tasks-table .at-col-due {
  width: 110px;
}
.all-tasks-table .at-col-status {
  width: 36px;
  text-align: center;
}
.all-tasks-table .at-col-del {
  width: 36px;
  text-align: right;
  padding-right: 8px;
}

.cat-chip__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cat-color, var(--color-text-muted));
  margin-right: 6px;
  vertical-align: baseline;
}
.cat-chip.btn--ghost {
  border-style: solid;
  border-color: color-mix(in srgb, var(--cat-color) 30%, var(--color-border));
}
.cat-chip.btn--ghost:hover {
  background: color-mix(in srgb, var(--cat-color) 10%, transparent);
  border-color: color-mix(in srgb, var(--cat-color) 50%, var(--color-border));
}
.cat-chip.btn--primary {
  background: color-mix(in srgb, var(--cat-color) 16%, transparent);
  border-color: color-mix(in srgb, var(--cat-color) 45%, transparent);
  color: var(--cat-color);
  font-weight: 600;
}
.cat-chip.btn--primary:hover {
  background: color-mix(in srgb, var(--cat-color) 24%, transparent);
}
.cat-chip.btn--primary .cat-chip__dot {
  background: var(--cat-color);
}

.at-title-link {
  color: var(--color-text);
  font-weight: 600;
  text-decoration: none;
}
.at-title-link:hover {
  color: var(--color-primary);
}

.at-row--done td {
  opacity: 0.5;
}
.at-row--priority-low > td:first-child {
  box-shadow: inset 3px 0 0 0 #94a3b8;
}
.at-row--priority-medium > td:first-child {
  box-shadow: inset 3px 0 0 0 #60a5fa;
}
.at-row--priority-high > td:first-child {
  box-shadow: inset 3px 0 0 0 #fbbf24;
}
.at-row--priority-urgent > td:first-child {
  box-shadow: inset 3px 0 0 0 #f87171;
}
.at-row .at-del-btn {
  opacity: 0;
  background: none;
  border: none;
  color: var(--color-danger);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  transition: opacity 0.1s, background 0.1s;
}
.at-row .at-del-btn:hover {
  background: color-mix(in srgb, var(--color-danger) 12%, transparent);
}
.at-row:hover .at-del-btn {
  opacity: 1;
}

.at-inline-view {
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 13px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.at-inline-view:hover {
  background: var(--color-bg);
}

.tl-date-icon {
  display: inline-block;
  margin-right: 2px;
}

.at-inline-input,
.at-inline-select {
  font-size: 12px;
  padding: 3px 6px;
  border: 1px solid var(--color-primary);
  border-radius: 4px;
  background: var(--color-surface);
  color: var(--color-text);
  width: 100%;
  outline: none;
}

.at-overdue {
  color: #ef4444;
  font-weight: 600;
}

.at-done-badge {
  font-size: 14px;
  color: #22c55e;
}

.sla-tile:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.at-view-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 16px;
  background: var(--color-primary-tint);
  border: 1px solid color-mix(in srgb, var(--color-primary) 30%, transparent);
  border-radius: 8px;
  font-size: 13px;
  color: var(--color-text);
}
.at-view-banner strong {
  color: var(--color-primary);
}

.at-group {
  margin-bottom: 28px;
}
.at-group__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 2px 12px;
  margin-bottom: 10px;
  border-bottom: 2px solid var(--proj-color, var(--color-primary));
}
.at-group__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--proj-color, var(--color-primary));
  flex-shrink: 0;
}
.at-group__name {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
  text-decoration: none;
}
.at-group__name:hover {
  color: var(--proj-color, var(--color-primary));
}
.at-group__count {
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 500;
}
.at-group__table {
  margin-bottom: 8px;
}
.at-group__add {
  font-size: 13px;
}

.fm-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.fm-type-tabs {
  display: flex;
  gap: 4px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 3px;
}

.fm-type-tab {
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: background 0.1s, color 0.1s;
}
.fm-type-tab:hover {
  color: var(--color-text);
}
.fm-type-tab--active {
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.fm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.fm-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.1s;
}
.fm-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.fm-item__thumb {
  height: 140px;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}
.fm-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}
.fm-item__thumb img:hover {
  transform: scale(1.03);
}
.fm-item__icon {
  font-size: 40px;
}
.fm-item__info {
  padding: 10px 12px 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}
.fm-item__name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fm-item__meta {
  font-size: 11px;
  color: var(--color-text-muted);
}
.fm-item__date {
  font-size: 11px;
  color: var(--color-text-muted);
}
.fm-item__task-link {
  color: var(--color-primary);
  text-decoration: none;
}
.fm-item__task-link:hover {
  text-decoration: underline;
}
.fm-item__actions {
  padding: 6px 12px 10px;
  display: flex;
  justify-content: flex-end;
}

.fm-lightbox {
  border: none;
  border-radius: 0;
  padding: 0;
  max-width: 100vw;
  max-height: 100vh;
  width: 100vw;
  height: 100vh;
  background: transparent;
}
.fm-lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
}
.fm-lightbox::backdrop {
  background: transparent;
}
.fm-lightbox__close {
  position: fixed;
  top: 16px;
  right: 20px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font-size: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fm-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.toggle__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle__input:checked + .toggle__track {
  background: var(--color-primary);
}
.toggle__input:checked + .toggle__track::after {
  transform: translateX(20px);
}
.toggle__track {
  width: 44px;
  height: 24px;
  background: var(--color-border);
  border-radius: 12px;
  transition: background 0.2s;
  position: relative;
}
.toggle__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s;
}

.feature-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
}
.feature-row:last-child {
  border-bottom: none;
}
.feature-row__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.feature-row__label {
  font-size: 14px;
  font-weight: 600;
}
.feature-row__desc {
  font-size: 12px;
  color: var(--color-text-muted);
}

.settings-layout {
  display: flex;
  align-items: flex-start;
  gap: 32px;
}

.settings-sidebar {
  flex: 0 0 208px;
  position: sticky;
  top: 28px;
}

.settings-content {
  flex: 1;
  min-width: 0;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.settings-nav__tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--color-text-muted);
  white-space: nowrap;
  transition: background 0.1s ease, color 0.1s ease;
}
.settings-nav__tab svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
  opacity: 0.7;
}
.settings-nav__tab:hover {
  background: var(--color-bg-hover, var(--color-bg));
  color: var(--color-text);
}
.settings-nav__tab:hover svg {
  opacity: 1;
}
.settings-nav__tab--active {
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
  color: var(--color-primary);
  font-weight: 600;
}
.settings-nav__tab--active svg {
  opacity: 1;
}

.roles-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.roles-list__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
}
.roles-list__swatch {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
}
.roles-list__label {
  font-weight: 600;
  font-size: 14px;
  min-width: 120px;
}
.roles-list__key {
  font-size: 12px;
  color: var(--color-text-muted);
  background: var(--color-border);
  padding: 2px 6px;
  border-radius: 4px;
  min-width: 70px;
}
.roles-list__color-input {
  width: 38px;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
}
.roles-list__label-input {
  flex: 1;
  max-width: 200px;
}

.tl-cell-value {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.tl-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
  background: var(--color-bg);
  border: 1px solid color-mix(in srgb, currentColor 28%, var(--color-border));
}
.tl-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: currentColor;
}

[data-theme=dark] .tl-badge {
  border-color: color-mix(in srgb, currentColor 38%, var(--color-border));
}

.tl-badge--gray {
  color: var(--color-text-muted);
}

.tl-badge--blue {
  color: #3b82f6;
}

.tl-badge--orange {
  color: #f59e0b;
}

.tl-badge--purple {
  color: #8b5cf6;
}

.tl-badge--green {
  color: #10b981;
}

.tl-badge--red {
  color: #ef4444;
}

.tl-badge--project::before {
  display: none;
}

.tl-badge--category {
  max-width: calc(100% - 14px);
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.task-list-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}
.task-list-tabs__btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease;
}
.task-list-tabs__btn:hover {
  color: var(--color-text);
}
.task-list-tabs__btn--active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.tl-dropdown {
  position: relative;
  display: inline-block;
}
.tl-dropdown__panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 50;
  min-width: 200px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 8px;
}
.tl-dropdown__title {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 8px 8px;
}
.tl-dropdown__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 8px;
  font-size: 13px;
  color: var(--color-text);
  background: transparent;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}
.tl-dropdown__item:hover {
  background: var(--color-bg);
}
.tl-dropdown__item--active {
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 500;
}
.tl-dropdown__toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  font-size: 13px;
  color: var(--color-text);
  cursor: pointer;
  border-radius: 5px;
}
.tl-dropdown__toggle:hover {
  background: var(--color-bg);
}
.tl-dropdown__toggle input[type=checkbox] {
  width: 15px;
  height: 15px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

@keyframes pulse {
  0% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.6;
  }
}
.unread-mention-indicator {
  display: inline-block;
  color: var(--color-danger, #f85149);
  animation: pulse 2s infinite ease-in-out;
  font-size: 14px;
  vertical-align: middle;
}

.trash-list {
  display: flex;
  flex-direction: column;
}

.trash-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 6px;
  border-bottom: 1px solid var(--color-border-muted);
  transition: background 0.12s ease;
}
.trash-row:last-child {
  border-bottom: none;
}
.trash-row:hover {
  background: var(--color-bg-hover);
}
.trash-row__type {
  flex-shrink: 0;
}
.trash-row__title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.trash-row__name {
  font-weight: 500;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trash-row__parent {
  font-size: 12px;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trash-row__time {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--color-text-muted);
  text-align: right;
  white-space: nowrap;
}
.trash-row__actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 640px) {
  .trash-row {
    flex-wrap: wrap;
  }
  .trash-row__time {
    order: 3;
    margin-left: 40px;
    text-align: left;
  }
  .trash-row__actions {
    order: 4;
    margin-left: auto;
  }
}
.logs-list {
  display: flex;
  flex-direction: column;
}

.log-entry {
  padding: 10px 6px;
  border-bottom: 1px solid var(--color-border-muted);
}
.log-entry:last-child {
  border-bottom: none;
}
.log-entry__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.log-entry__time {
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
}
.log-entry__message {
  font-size: 13px;
  color: var(--color-text);
  overflow-wrap: anywhere;
}
.log-entry__trace {
  margin: 6px 0 0;
  padding: 8px 10px;
  background: var(--color-bg-hover);
  border-radius: 6px;
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text-muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 320px;
  overflow-y: auto;
}

.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, 100vw - 32px);
  pointer-events: none;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(16px);
  }
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-text-muted);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  padding: 12px 12px 12px 14px;
  font-size: 13px;
  color: var(--color-text);
  animation: toast-in 0.18s ease-out;
}
.toast--leaving {
  animation: toast-out 0.15s ease-in forwards;
}
.toast--success {
  border-left-color: var(--color-success);
}
.toast--error {
  border-left-color: var(--color-danger);
}
.toast--info {
  border-left-color: var(--color-primary);
}
.toast__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
.toast--success .toast__icon {
  background: var(--color-success);
}
.toast--error .toast__icon {
  background: var(--color-danger);
}
.toast--info .toast__icon {
  background: var(--color-primary);
}
.toast__text {
  flex: 1;
  min-width: 0;
  line-height: 1.4;
  word-break: break-word;
}
.toast__close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.toast__close:hover {
  color: var(--color-text);
}

.confirm-dialog {
  width: 380px;
}
.confirm-dialog__message {
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 4px;
  white-space: pre-line;
}

@media (max-width: 640px) {
  .toast-container {
    top: auto;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    left: 16px;
    right: 16px;
    max-width: none;
  }
}
.task-404 {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 64px 20px;
  max-width: 420px;
  margin: 0 auto;
}
.task-404__illustration {
  margin-bottom: 8px;
  animation: task-404-float 3.2s ease-in-out infinite;
}
.task-404__paper {
  fill: var(--color-bg);
  stroke: var(--color-border);
  stroke-width: 2;
}
.task-404__line {
  stroke: var(--color-border);
  stroke-width: 3;
  stroke-linecap: round;
}
.task-404__glass {
  fill: color-mix(in srgb, var(--color-primary) 10%, transparent);
  stroke: var(--color-primary);
  stroke-width: 3;
}
.task-404__handle {
  stroke: var(--color-primary);
  stroke-width: 4;
  stroke-linecap: round;
}
.task-404__mark {
  stroke: var(--color-danger);
  stroke-width: 2.5;
  stroke-linecap: round;
}
.task-404__title {
  font-size: 20px;
  font-weight: 700;
  margin: 8px 0 4px;
  color: var(--color-text);
}
.task-404__text {
  color: var(--color-text-muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 24px;
}
.task-404__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

@keyframes task-404-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}
.theme-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.15s ease;
}
.theme-option__swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.theme-option:hover {
  border-color: var(--color-primary);
  background: var(--color-bg-hover);
}
.theme-option.is-active {
  border-color: var(--color-primary);
  background: var(--color-primary-tint);
  color: var(--color-primary);
  font-weight: 600;
  box-shadow: 0 0 0 2px var(--color-primary-light);
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modalBackdropFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalBackdropFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes modalScaleIn {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.modal {
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #1e293b);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 16px;
  box-shadow: 0 20px 50px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1);
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal--sm {
  max-width: 420px;
}
.modal--md {
  max-width: 540px;
}
.modal--lg {
  max-width: 720px;
}
.modal__header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--color-border, #f1f5f9);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  position: relative;
}
.modal__header-content {
  display: flex;
  align-items: center;
  gap: 14px;
}
.modal__icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--color-primary-tint, #eeedfe);
  color: var(--color-primary, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px var(--color-primary-light, rgba(99, 102, 241, 0.15));
}
.modal__title {
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text, #0f172a);
  margin: 0;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.modal__subtitle {
  font-size: 13px;
  color: var(--color-text-muted, #64748b);
  margin: 3px 0 0;
  line-height: 1.4;
}
.modal__close {
  background: transparent;
  border: none;
  color: var(--color-text-muted, #94a3b8);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}
.modal__close:hover {
  background: var(--color-bg-hover, #f1f5f9);
  color: var(--color-text, #0f172a);
}
.modal__body {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.modal__footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border, #f1f5f9);
  background: var(--color-bg, #f8fafc);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.space-slug-preview {
  display: flex;
  align-items: center;
  border: 1px solid var(--color-border, #cbd5e1);
  border-radius: 10px;
  overflow: hidden;
  background: var(--color-surface, #ffffff);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.space-slug-preview:focus-within {
  border-color: var(--color-primary, #6366f1);
  box-shadow: 0 0 0 3px var(--color-primary-light, rgba(99, 102, 241, 0.15));
}
.space-slug-preview__prefix {
  padding: 9px 12px;
  background: var(--color-bg, #f8fafc);
  color: var(--color-text-muted, #64748b);
  font-size: 13px;
  font-weight: 500;
  border-right: 1px solid var(--color-border, #e2e8f0);
  user-select: none;
}
.space-slug-preview__input {
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 9px 12px !important;
  flex: 1;
}

.space-icon-selector__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.space-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--color-border, #cbd5e1);
  background: var(--color-surface, #ffffff);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}
.space-icon-btn:hover {
  border-color: var(--color-primary, #6366f1);
  background: var(--color-primary-tint, #eeedfe);
  transform: translateY(-1px);
}
.space-icon-btn.is-selected {
  border-color: var(--color-primary, #6366f1);
  background: var(--color-primary-tint, #eeedfe);
  box-shadow: 0 0 0 3px var(--color-primary-light, rgba(99, 102, 241, 0.15));
}

body .ql-toolbar.ql-snow {
  border: 1px solid var(--color-border);
  border-radius: 8px 8px 0 0;
  background: var(--color-bg-muted);
  padding: 6px 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue", Roboto, sans-serif;
}
body .ql-container.ql-snow {
  border: 1px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  background: var(--color-input-bg);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue", Roboto, sans-serif;
  font-size: 14px;
}
body .ql-editor {
  min-height: 80px;
  line-height: 1.6;
  padding: 10px 12px;
}
body .ql-editor.ql-blank::before {
  color: var(--color-text-muted);
  opacity: 0.75;
  font-style: normal;
  left: 12px;
  right: 12px;
}
body .ql-snow a {
  color: var(--color-primary);
}
body .ql-snow .ql-stroke {
  stroke: var(--color-text-muted);
}
body .ql-snow .ql-stroke-miter {
  stroke: var(--color-text-muted);
}
body .ql-snow .ql-fill,
body .ql-snow .ql-stroke.ql-fill {
  fill: var(--color-text-muted);
}
body .ql-snow .ql-picker {
  color: var(--color-text-muted);
}
body .ql-snow.ql-toolbar button,
body .ql-snow .ql-toolbar button {
  border-radius: 5px;
  transition: background 0.1s ease;
}
body .ql-snow.ql-toolbar button:hover,
body .ql-snow .ql-toolbar button:hover {
  background: var(--color-bg-hover);
}
body .ql-snow.ql-toolbar button.ql-active,
body .ql-snow .ql-toolbar button.ql-active {
  background: var(--color-primary-light);
}
body .ql-snow.ql-toolbar button:hover .ql-stroke,
body .ql-snow.ql-toolbar button:focus .ql-stroke,
body .ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke {
  stroke: var(--color-text);
}
body .ql-snow.ql-toolbar button:hover .ql-fill,
body .ql-snow.ql-toolbar button:focus .ql-fill,
body .ql-snow.ql-toolbar .ql-picker-label:hover .ql-fill {
  fill: var(--color-text);
}
body .ql-snow.ql-toolbar button.ql-active .ql-stroke,
body .ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke,
body .ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke {
  stroke: var(--color-primary);
}
body .ql-snow.ql-toolbar button.ql-active .ql-fill,
body .ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-fill,
body .ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-fill {
  fill: var(--color-primary);
}
body .ql-snow.ql-toolbar .ql-picker-label:hover,
body .ql-snow.ql-toolbar .ql-picker-label.ql-active,
body .ql-snow.ql-toolbar .ql-picker-item:hover,
body .ql-snow.ql-toolbar .ql-picker-item.ql-selected {
  color: var(--color-primary);
}
body .ql-toolbar.ql-snow .ql-picker-options {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  padding: 4px;
}
body .ql-snow .ql-picker.ql-expanded .ql-picker-label {
  border-color: var(--color-border);
  border-radius: 5px;
  color: var(--color-text);
}
body .ql-snow .ql-picker.ql-expanded .ql-picker-options {
  border-color: var(--color-border);
}
body .ql-snow .ql-picker-item {
  border-radius: 5px;
  padding: 3px 6px;
}
body .ql-snow .ql-picker-item:hover {
  background: var(--color-bg-hover);
}
body .ql-snow .ql-tooltip {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  color: var(--color-text);
  z-index: 30;
}
body .ql-snow .ql-tooltip input[type=text] {
  background: var(--color-input-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text);
}
body .ql-snow .ql-tooltip input[type=text]:focus {
  outline: none;
  border-color: var(--color-primary);
}
body .ql-snow .ql-tooltip .ql-action,
body .ql-snow .ql-tooltip .ql-remove {
  color: var(--color-primary);
}

#js-task-quill {
  flex-grow: 1;
  min-height: 150px;
}

.task-desc-wrap .ql-editor {
  min-height: 96px;
}

.ql-image-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
  padding: 8px;
  background: var(--color-bg-muted);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}
.ql-image-gallery__thumb {
  width: 180px !important;
  height: 120px !important;
  object-fit: cover !important;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  cursor: zoom-in;
  transition: opacity 0.12s;
}
.ql-image-gallery__thumb:hover {
  opacity: 0.85;
}

.slash-menu,
.mention-menu {
  position: absolute;
  z-index: 1000;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  width: 250px;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
}

.slash-menu__item,
.mention-menu__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 6px;
  font-size: 13px;
  color: var(--color-text);
  transition: background 0.1s ease;
}
.slash-menu__item:hover, .slash-menu__item.is-active,
.mention-menu__item:hover,
.mention-menu__item.is-active {
  background: var(--color-bg-hover);
}

.slash-menu__hint {
  color: var(--color-text-muted);
  font-size: 12px;
  font-family: monospace;
}

.mention-menu__avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-border);
  flex-shrink: 0;
}

.mention-node {
  color: var(--color-primary);
  font-weight: 500;
  background: rgba(99, 102, 241, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}

.img-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.88);
  align-items: center;
  justify-content: center;
}
.img-lightbox--open {
  display: flex;
}
.img-lightbox__img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
}
.img-lightbox__close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 6px;
}
.img-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  font-size: 32px;
  line-height: 1;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.12s;
}
.img-lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.25);
}
.img-lightbox__nav--prev {
  left: 16px;
}
.img-lightbox__nav--next {
  right: 16px;
}

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--color-bg);
}

.auth-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 32px;
  width: 360px;
}
.auth-card__title {
  text-align: center;
  margin-bottom: 20px;
}
.auth-card__logo {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -1px;
  color: var(--color-text);
}
.auth-card__logo span {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.branding-preview {
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
  display: inline-flex;
  align-items: center;
}

.proj-icon-upload {
  display: flex;
  align-items: center;
  gap: 20px;
}
.proj-icon-upload__preview {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--color-border);
}
.proj-icon-upload__placeholder {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 16px;
  color: var(--color-text-muted);
  font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.auth-oauth {
  display: flex;
  gap: 8px;
}
.auth-oauth__btn {
  flex: 1;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}
.auth-oauth__btn svg {
  flex-shrink: 0;
}
.auth-oauth__btn--github {
  color: var(--color-text);
}

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.header {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}
@media (max-width: 480px) {
  .header {
    padding: 0 12px;
    gap: 8px;
  }
  .header__search {
    max-width: 160px;
  }
}
.header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header__logo {
  display: flex;
  align-items: baseline;
  gap: 1px;
  text-decoration: none;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.8px;
  color: var(--color-text);
  white-space: nowrap;
  margin-right: 20px;
  flex-shrink: 0;
}
.header__logo span {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header__logo:hover {
  opacity: 0.8;
}
.header__search {
  flex: 1;
  max-width: 360px;
}
.header__search input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
  color: var(--color-text);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.header__search input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.8;
}
.header__search input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
.header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header__theme-toggle, .header__notif-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.header__theme-toggle svg, .header__notif-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.header__theme-toggle:hover, .header__notif-btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}
.header__notifications {
  position: relative;
}
.header__notif-btn {
  position: relative;
}
.header__notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 15px;
  height: 15px;
  border-radius: 99px;
  background: var(--color-danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
  padding: 0 3px;
  box-shadow: 0 0 0 2px var(--color-surface);
}
.header__notif-dropdown {
  position: absolute;
  right: 0;
  top: 40px;
  width: 340px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  display: none;
  flex-direction: column;
  z-index: 20;
}
.header__notif-dropdown.is-open {
  display: flex;
}
@media (max-width: 480px) {
  .header__notif-dropdown {
    width: calc(100vw - 24px);
    right: -8px;
  }
}
.header__notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  flex-shrink: 0;
}
.header__notif-read-all {
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 12px;
  cursor: pointer;
}
.header__notif-read-all:hover {
  text-decoration: underline;
}
.header__notif-list {
  list-style: none;
  padding: 4px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.header__notif-empty {
  padding: 16px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 13px;
}
.header__notif-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s ease;
}
.header__notif-item:hover {
  background: var(--color-bg);
}
.header__notif-item--unread {
  background: color-mix(in srgb, var(--color-primary) 6%, transparent);
}
.header__notif-item-icon {
  flex-shrink: 0;
  font-size: 16px;
  color: var(--color-text-muted);
  margin-top: 1px;
}
.header__notif-item-icon svg {
  width: 16px;
  height: 16px;
}
.header__notif-item-body {
  flex: 1;
  min-width: 0;
}
.header__notif-item-body strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 2px;
}
.header__notif-item-body span {
  font-size: 12px;
  color: var(--color-text-muted);
}
.header__user-menu {
  position: relative;
  margin-left: 4px;
  padding-left: 12px;
  border-left: 1px solid var(--color-border);
}
.header__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  border: none;
  cursor: pointer;
  transition: box-shadow 0.12s ease;
}
.header__avatar:hover {
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
.header__dropdown {
  position: absolute;
  right: 0;
  top: 40px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  min-width: 180px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  display: none;
  flex-direction: column;
  padding: 6px;
}
.header__dropdown.is-open {
  display: flex;
}
.header__dropdown a, .header__dropdown button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--color-text);
  font-size: 13px;
}
.header__dropdown a svg, .header__dropdown button svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
  color: var(--color-text-muted);
}
.header__dropdown a:hover, .header__dropdown button:hover {
  background: var(--color-bg);
}

.app-body {
  display: flex;
  flex: 1;
  min-height: calc(100vh - 56px);
}
@media (max-width: 768px) {
  .app-body {
    flex-direction: column;
  }
}

.sidebar {
  width: 220px;
  background: var(--color-sidebar-bg);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  padding: 8px 0 16px;
  overflow-y: auto;
}
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    bottom: 0;
    width: 280px;
    height: 100vh;
    z-index: 1000;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid var(--color-border);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
  }
  .sidebar.sidebar--open {
    left: 0;
  }
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 999;
  backdrop-filter: blur(2px);
}
.sidebar-backdrop.sidebar-backdrop--active {
  display: block;
}

.header__hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--color-text);
  cursor: pointer;
  padding: 4px 8px;
  margin-left: -8px;
  margin-right: 8px;
  line-height: 1;
  border-radius: 6px;
  transition: background 0.1s ease;
}
.header__hamburger svg {
  width: 20px;
  height: 20px;
}
.header__hamburger:hover {
  background: var(--color-bg-hover);
}
@media (max-width: 768px) {
  .header__hamburger {
    display: flex;
  }
}

.app-main {
  flex: 1;
  padding: 28px 32px;
  max-width: none;
  min-width: 0;
}
@media (max-width: 768px) {
  .app-main {
    padding: 16px;
  }
}
@media (max-width: 480px) {
  .app-main {
    padding: 12px;
  }
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.page-header h1 {
  font-size: clamp(18px, 4vw, 28px);
}

.page-header__controls {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.page-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
@media (max-width: 480px) {
  .project-grid {
    grid-template-columns: 1fr;
  }
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 8px 8px;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--color-text);
  text-decoration: none;
  transition: background 0.1s;
  position: relative;
}
.sidebar__link:hover {
  background: var(--color-bg-hover, var(--color-bg));
}
.sidebar__link--active {
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
  color: var(--color-primary);
  font-weight: 600;
}
.sidebar__link--sm {
  font-size: 13px;
}
.sidebar__link--settings {
  margin-top: 4px;
  color: var(--color-text-muted);
}

.sidebar__link-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}
.sidebar__link--active .sidebar__link-icon {
  opacity: 1;
}

.sidebar__badge {
  margin-left: auto;
  background: var(--color-danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar__section {
  margin: 4px 0 8px;
}

.sidebar__section-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 18px 2px 18px;
  margin-bottom: 2px;
}
.sidebar__section-hd:hover .sidebar__section-add {
  opacity: 1;
}

.sidebar__section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.sidebar__section-add {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.1s, background 0.1s, color 0.1s;
}
.sidebar__section-add:hover {
  background: var(--color-bg-hover, var(--color-bg));
  color: var(--color-text);
  opacity: 1;
}

.sidebar__proj-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar__proj-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px 5px 14px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--color-text);
  text-decoration: none;
  transition: background 0.1s;
  margin: 0 8px;
}
.sidebar__proj-item:hover {
  background: var(--color-bg-hover, var(--color-bg));
}
.sidebar__proj-item--active {
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
  color: var(--color-primary);
  font-weight: 600;
}

.sidebar__proj-icon {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  text-transform: uppercase;
}

.sidebar__proj-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar__proj-empty {
  padding: 6px 22px;
  font-size: 12px;
  color: var(--color-text-muted);
  font-style: italic;
}

.sidebar__all-link {
  display: block;
  padding: 4px 22px;
  font-size: 12px;
  color: var(--color-text-muted);
  text-decoration: none;
  margin-top: 2px;
}
.sidebar__all-link:hover {
  color: var(--color-primary);
}

.sidebar__project-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0 8px 8px;
  padding-top: 4px;
  border-top: 1px solid var(--color-border);
}
.sidebar__project-nav:empty {
  display: none;
}

.sidebar__link--sub {
  font-size: 12.5px;
  padding-left: 22px;
  color: var(--color-text-muted);
}
.sidebar__link--sub.sidebar__link--active {
  color: var(--color-primary);
}
.sidebar__link--sub:hover {
  color: var(--color-text);
  background: var(--color-bg-hover, var(--color-bg));
}

.view-switcher {
  display: flex;
  gap: 4px;
}
.view-switcher__btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  transition: background 0.1s, color 0.1s;
}
.view-switcher__btn:hover {
  background: var(--color-bg);
  color: var(--color-text);
}
.view-switcher__btn--active {
  background: color-mix(in srgb, var(--color-primary) 10%, var(--color-surface));
  border-color: color-mix(in srgb, var(--color-primary) 40%, var(--color-border));
  color: var(--color-primary);
  font-weight: 600;
}

.header__timer {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 4px 0 12px;
  border-radius: 99px;
  border: 1px solid color-mix(in srgb, var(--color-primary) 30%, var(--color-border));
  background: var(--color-primary-light);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-primary);
  flex-shrink: 0;
}
.header__timer > span {
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  font-variant-numeric: tabular-nums;
  animation: timer-pulse 2s ease-in-out infinite;
}
.header__timer-stop {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  font-size: 12px;
  line-height: 1;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--color-primary);
}
.header__timer-stop:hover {
  background: color-mix(in srgb, var(--color-primary) 18%, transparent);
}

@keyframes timer-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.65;
  }
}
.space-description {
  color: var(--color-text-muted);
  margin-bottom: 16px;
  max-width: 70ch;
}

.space-toc {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.space-toc__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
}
.space-toc__link:hover {
  border-color: var(--color-primary);
}
.space-toc__title {
  font-weight: 500;
}
.space-toc__count {
  margin-left: auto;
  font-size: 12px;
  color: var(--color-text-muted);
}

.doc-tree {
  list-style: none;
  margin: 0;
  padding: 0;
}
.doc-tree__children {
  list-style: none;
  margin: 0;
  padding: 0;
}
.doc-tree__row {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px 8px 3px calc(8px + var(--depth, 0) * 14px);
  border-radius: 6px;
  color: var(--color-text);
}
.doc-tree__row:hover {
  background: var(--color-bg-hover);
}
.doc-tree__row:hover .doc-tree__add {
  opacity: 1;
}
.doc-tree__row--active {
  background: var(--color-primary-tint);
  font-weight: 600;
}
.doc-tree__row--dragging {
  opacity: 0.45;
}
.doc-tree__row--drop-into {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}
.doc-tree__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
  transform: rotate(90deg);
  transition: transform 0.12s ease;
}
.doc-tree__toggle--collapsed {
  transform: rotate(0deg);
}
.doc-tree__toggle--leaf {
  cursor: default;
}
.doc-tree__link {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
  padding: 2px 0;
  color: inherit;
  text-decoration: none;
  font-size: 13px;
}
.doc-tree__icon {
  flex-shrink: 0;
  font-size: 13px;
}
.doc-tree__title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-tree__add {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: none;
  color: var(--color-text-muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.doc-tree__add:hover {
  background: var(--color-bg);
  color: var(--color-text);
}
@media (hover: none) {
  .doc-tree__add {
    opacity: 1;
  }
}

.doc-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--color-text-muted);
}
.doc-breadcrumbs a {
  color: inherit;
  text-decoration: none;
}
.doc-breadcrumbs a:hover {
  color: var(--color-primary);
}
.doc-breadcrumbs__sep {
  opacity: 0.5;
}
.doc-breadcrumbs__current {
  color: var(--color-text);
  font-weight: 500;
}

.doc-page {
  max-width: 900px;
}
.doc-page__header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.doc-page__icon-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background-color 0.15s ease;
}
.doc-page__icon-wrap:hover {
  background-color: var(--color-bg-hover);
}
.doc-page__icon-input {
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  border: 1px solid transparent;
  background: transparent;
  font-size: 28px;
  line-height: 44px;
  text-align: center;
  cursor: pointer;
  border-radius: 8px;
  outline: none;
  box-shadow: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.doc-page__icon-input[readonly] {
  caret-color: transparent;
  cursor: pointer;
}
.doc-page__icon-input:hover {
  background-color: var(--color-bg-hover);
  border-color: var(--color-border);
}
.doc-page__icon-input:focus {
  background-color: var(--color-surface);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-tint);
}
.doc-page__icon-static {
  width: 44px;
  height: 44px;
  font-size: 28px;
  line-height: 44px;
  text-align: center;
  user-select: none;
}
.doc-page__title-wrap {
  flex: 1;
  min-width: 250px;
  display: flex;
  align-items: center;
}
.doc-page__title {
  width: 100%;
  border: none;
  background: none;
  color: var(--color-text);
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 700;
  line-height: 1.25;
  padding: 4px 0;
  margin: 0;
}
.doc-page__title:focus {
  outline: none;
}
.doc-page__title::placeholder {
  color: var(--color-text-muted);
  opacity: 0.6;
}
.doc-page__title--static {
  margin: 0;
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 700;
  line-height: 1.25;
}
.doc-page__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
  margin-top: 4px;
}
.doc-page__status {
  font-size: 12px;
  color: var(--color-text-muted);
}
.doc-page__status--ok {
  color: var(--color-success);
}
.doc-page__status--error {
  color: var(--color-danger);
  font-weight: 600;
}
.doc-page__meta {
  margin: 8px 0 16px;
  font-size: 12px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.doc-page__editor {
  min-height: 60vh;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0 0 8px 8px;
}
.doc-page__content {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 20px;
  min-height: 40vh;
}
.doc-page__empty {
  color: var(--color-text-muted);
}

.callout {
  position: relative;
  padding: 14px 18px 14px 44px;
  margin: 16px 0;
  border-radius: 8px;
  border-left: 4px solid var(--callout-border, #0969da);
  background-color: var(--callout-bg, rgba(9, 105, 218, 0.08));
  color: var(--color-text);
  font-size: 15px;
  line-height: 1.6;
  transition: background-color 0.2s, border-color 0.2s;
}
.callout::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 15px;
  width: 20px;
  height: 20px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
.callout--info {
  --callout-border: #0969da;
  --callout-bg: rgba(9, 105, 218, 0.08);
}
.callout--info::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%230969da'%3E%3Cpath d='M8 1.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13zM0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8zm6.5-.25A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75zM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2z'/%3E%3C/svg%3E");
}
.callout--warning {
  --callout-border: #9a6700;
  --callout-bg: rgba(212, 167, 44, 0.12);
}
.callout--warning::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%239a6700'%3E%3Cpath d='M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575L6.457 1.047zM8 5a.75.75 0 0 0-.75.75v3.5a.75.75 0 0 0 1.5 0v-3.5A.75.75 0 0 0 8 5zm0 8a1 1 0 1 0 0-2 1 1 0 0 0 0 2z'/%3E%3C/svg%3E");
}
.callout--success {
  --callout-border: #1a7f37;
  --callout-bg: rgba(46, 160, 67, 0.1);
}
.callout--success::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%231a7f37'%3E%3Cpath d='M8 16A8 8 0 1 1 8 0a8 8 0 0 1 0 16zm3.78-9.72a.75.75 0 0 0-1.06-1.06L6.75 9.19 5.28 7.72a.75.75 0 0 0-1.06 1.06l2 2a.75.75 0 0 0 1.06 0l4.5-4.5z'/%3E%3C/svg%3E");
}
.callout--danger {
  --callout-border: #cf222e;
  --callout-bg: rgba(207, 34, 46, 0.1);
}
.callout--danger::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23cf222e'%3E%3Cpath d='M2.343 13.657A8 8 0 1 1 13.657 2.343 8 8 0 0 1 2.343 13.657zM6.03 4.97a.75.75 0 0 0-1.06 1.06L6.94 8 4.97 9.97a.75.75 0 1 0 1.06 1.06L8 9.06l1.97 1.97a.75.75 0 0 0 1.06-1.06L9.06 8l1.97-1.97a.75.75 0 1 0-1.06-1.06L8 6.94 6.03 4.97z'/%3E%3C/svg%3E");
}

.doc-link-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  margin: 0 2px;
  border-radius: 6px;
  background-color: var(--color-bg-hover);
  border: 1px solid var(--color-border);
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92em;
  vertical-align: baseline;
  transition: all 0.15s ease;
}
.doc-link-chip:hover {
  background-color: var(--color-primary-tint);
  border-color: var(--color-primary);
  text-decoration: none;
}
.doc-link-chip__icon {
  font-size: 1.05em;
  line-height: 1;
}

.doc-link-picker {
  position: absolute;
  z-index: 1000;
  width: 320px;
  max-height: 280px;
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 6px;
}
.doc-link-picker__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--color-text);
  transition: background 0.1s;
}
.doc-link-picker__item:hover, .doc-link-picker__item.is-selected {
  background: var(--color-primary-tint);
  color: var(--color-primary);
}
.doc-link-picker__title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.doc-link-picker__space {
  font-size: 12px;
  color: var(--color-text-muted);
}

.code-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background-color 0.15s ease, color 0.15s ease;
  z-index: 10;
}
pre:hover .code-copy-btn, .ql-syntax:hover .code-copy-btn {
  opacity: 1;
}
.code-copy-btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}
.code-copy-btn.is-copied {
  opacity: 1;
  color: var(--color-success);
  border-color: var(--color-success);
  background: rgba(46, 160, 67, 0.1);
}

.doc-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}
.doc-status-badge--published {
  background: rgba(46, 160, 67, 0.12);
  color: #1a7f37;
  border: 1px solid rgba(46, 160, 67, 0.25);
}
.doc-status-badge--draft {
  background: rgba(101, 109, 118, 0.12);
  color: #656d76;
  border: 1px solid rgba(101, 109, 118, 0.25);
}
.doc-status-badge--review {
  background: rgba(212, 167, 44, 0.15);
  color: #9a6700;
  border: 1px solid rgba(212, 167, 44, 0.3);
}
.doc-status-badge--outdated {
  background: rgba(207, 34, 46, 0.12);
  color: #cf222e;
  border: 1px solid rgba(207, 34, 46, 0.25);
}

.doc-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 8px 0 16px 0;
}

.doc-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.doc-tag-chip:hover {
  background: var(--color-primary-tint);
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.doc-tag-chip__remove {
  cursor: pointer;
  font-size: 12px;
  margin-left: 2px;
  opacity: 0.6;
}
.doc-tag-chip__remove:hover {
  opacity: 1;
  color: var(--color-danger);
}

.doc-tag-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--color-text-muted);
  border: 1px dashed var(--color-border);
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}
.doc-tag-add-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.doc-verification-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  margin: 16px 0 20px 0;
  border-radius: 8px;
  border: 1px solid transparent;
}
.doc-verification-banner--pending {
  background-color: rgba(212, 167, 44, 0.12);
  border-color: rgba(212, 167, 44, 0.35);
  color: #7a5200;
}
.doc-verification-banner--acknowledged {
  background-color: rgba(46, 160, 67, 0.1);
  border-color: rgba(46, 160, 67, 0.25);
  color: #1a7f37;
}
.doc-verification-banner__title {
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.doc-verification-banner__sub {
  font-size: 13px;
  opacity: 0.85;
  margin-top: 2px;
}

.version-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 760px;
}
.version-list__item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
  padding: 12px 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}
.version-list__main {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.version-list__number {
  font-weight: 600;
}
.version-list__title {
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.version-list__meta {
  grid-column: 1;
  font-size: 12px;
  color: var(--color-text-muted);
}

.search-form {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  max-width: 640px;
}
.search-form .form-input {
  flex: 1;
}

.search-results {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 760px;
}
.search-results__count {
  color: var(--color-text-muted);
  font-size: 13px;
  margin-bottom: 10px;
}
.search-results__item {
  padding: 14px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}
.search-results__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
}
.search-results__title:hover {
  text-decoration: underline;
}
.search-results__space {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.search-results__snippet {
  margin: 8px 0 6px;
  line-height: 1.5;
}
.search-results__snippet mark {
  background: var(--color-primary-light);
  color: inherit;
  padding: 0 2px;
  border-radius: 3px;
}
.search-results__meta {
  font-size: 12px;
  color: var(--color-text-muted);
}

.perm-dialog {
  width: 560px;
}
.perm-dialog .perm-list {
  max-height: 40vh;
  overflow-y: auto;
}

.perm-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
}
.perm-list__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
}
.perm-list__name {
  font-weight: 500;
}
.perm-list__kind {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--color-bg-muted);
  font-size: 11px;
  color: var(--color-text-muted);
}
.perm-list__role {
  font-size: 12px;
  color: var(--color-primary);
}
.perm-list__source {
  margin-left: auto;
  font-size: 12px;
  color: var(--color-text-muted);
}
.perm-list__empty {
  color: var(--color-text-muted);
  font-size: 13px;
}

.perm-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.perm-form .form-select {
  flex: 1;
  min-width: 130px;
}
.perm-form .form-input {
  flex: 1;
  min-width: 180px;
}

.perm-private {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
  cursor: pointer;
}
.perm-private input {
  margin-top: 2px;
}
.perm-private strong {
  display: block;
  font-size: 13px;
}
.perm-private .field__hint {
  margin: 2px 0 0;
}

.emoji-picker {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
  margin-bottom: 8px;
}
@media (max-width: 520px) {
  .emoji-picker {
    grid-template-columns: repeat(8, 1fr);
  }
}
.emoji-picker__item {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.emoji-picker__item:hover {
  background: var(--color-bg-hover);
}
.emoji-picker__item.is-selected {
  border-color: var(--color-primary);
  background: var(--color-primary-tint);
}

.space-dialog {
  width: 480px;
}

.doc-private-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--color-primary-tint);
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 600;
}

.doc-tree__lock {
  display: inline-flex;
  flex-shrink: 0;
  margin-left: 2px;
  color: var(--color-text-muted);
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 520px;
}
.settings-form .btn {
  align-self: flex-start;
}

.role-perms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin: 12px 0 16px;
}
.role-perms__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
}
.role-perms__item:hover {
  border-color: var(--color-primary);
}

.log-view {
  max-height: 60vh;
  overflow: auto;
  padding: 14px 16px;
  background: var(--color-bg-muted);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.audit__changes code {
  font-size: 11px;
  color: var(--color-text-muted);
  word-break: break-all;
}

.data-table__actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  white-space: nowrap;
}

.comment-mark {
  background: var(--color-primary-light);
  border-bottom: 2px solid var(--color-primary);
  cursor: pointer;
}

.comment-bubble {
  position: absolute;
  z-index: 800;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: none;
  border-radius: 8px;
  background: var(--color-text);
  color: var(--color-surface);
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}
.comment-bubble[hidden] {
  display: none;
}

.comments-count {
  display: inline-block;
  min-width: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  font-size: 11px;
}
.comments-count:empty {
  display: none;
}

body.has-comments .workspace__main {
  padding-right: 356px;
}
@media (max-width: 900px) {
  body.has-comments .workspace__main {
    padding-right: 28px;
  }
}

.comments-panel {
  position: fixed;
  top: 52px;
  right: 0;
  bottom: 0;
  z-index: 400;
  width: 340px;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  transform: translateX(100%);
  transition: transform 0.2s ease;
}
.comments-panel.is-open {
  transform: none;
}
@media (max-width: 640px) {
  .comments-panel {
    width: 100%;
  }
}
.comments-panel__head {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--color-border);
}
.comments-panel__head h2 {
  font-size: 15px;
}
.comments-panel__head .field__hint {
  margin: 4px 0 0;
}
.comments-panel__list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comments__empty {
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.comment {
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
  cursor: pointer;
}
.comment:hover {
  border-color: var(--color-primary);
}
.comment.is-active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
.comment__quote {
  margin: 0 0 8px;
  padding-left: 8px;
  border-left: 2px solid var(--color-primary);
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1.4;
}
.comment__lost {
  margin: 0 0 8px;
  font-size: 11px;
  color: var(--color-danger);
}
.comment__head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.comment__author {
  font-size: 12px;
  font-weight: 600;
}
.comment__date {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-left: auto;
}
.comment__body {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.comment__reply {
  margin-top: 10px;
  padding-top: 8px;
  padding-left: 10px;
  border-top: 1px solid var(--color-border-muted);
  border-left: 2px solid var(--color-border);
}
.comment__actions {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.header__user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header__user-name {
  font-size: 13px;
  color: var(--color-text-muted);
  text-decoration: none;
}
.header__user-name:hover {
  color: var(--color-text);
}
@media (max-width: 640px) {
  .header__user-name {
    display: none;
  }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 14px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.topbar__burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 7px;
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
}
@media (max-width: 900px) {
  .topbar__burger {
    display: flex;
  }
}
.topbar__logo {
  display: flex;
  align-items: baseline;
  gap: 1px;
  margin-right: 6px;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
}
.topbar__logo span {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.topbar__search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 200px;
  max-width: 380px;
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-size: 13px;
  cursor: pointer;
}
.topbar__search:hover {
  border-color: var(--color-primary);
}
.topbar__search-text {
  flex: 1;
  text-align: left;
}
.topbar__search-kbd {
  padding: 1px 5px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 11px;
}
@media (max-width: 640px) {
  .topbar__search-kbd {
    display: none;
  }
}
.topbar__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.topbar__icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  padding: 0;
  border: none;
  border-radius: 7px;
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
}
.topbar__icon-btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}
.topbar__icon-btn.is-active {
  background: var(--color-primary-tint);
  color: var(--color-primary);
}
.topbar__notifications-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.topbar__badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 10px;
  background: #ef4444;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  box-shadow: 0 0 0 2px var(--color-surface);
}
.topbar__user {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 6px 0 2px;
}
.topbar__user-name {
  font-size: 13px;
  color: var(--color-text);
}
@media (max-width: 780px) {
  .topbar__user-name {
    display: none;
  }
}

.notifications-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 350px;
  max-height: 460px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.notifications-popover__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}
.notifications-popover__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}
.notifications-popover__read-all {
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}
.notifications-popover__read-all:hover {
  text-decoration: underline;
}
.notifications-popover__list {
  overflow-y: auto;
  max-height: 380px;
  display: flex;
  flex-direction: column;
}
.notifications-popover__empty {
  padding: 24px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 13px;
}

.notifications-item {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border-subtle, rgba(0, 0, 0, 0.05));
  transition: background 0.12s;
}
.notifications-item:hover {
  background: var(--color-bg-hover);
}
.notifications-item.is-unread {
  background: var(--color-primary-tint, rgba(99, 102, 241, 0.08));
}
.notifications-item__icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}
.notifications-item__content {
  flex: 1;
  min-width: 0;
}
.notifications-item__text {
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
}
.notifications-item__snippet {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--color-bg);
  padding: 2px 6px;
  border-radius: 4px;
  border-left: 2px solid var(--color-primary);
}
.notifications-item__time {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 4px;
}
.notifications-item__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6366f1;
  flex-shrink: 0;
  align-self: center;
}

.doc-tree__mention-badge {
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 10px;
  background: #6366f1;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(99, 102, 241, 0.4);
  user-select: none;
}

.workspace {
  display: flex;
  min-height: calc(100vh - 52px);
}

.space-nav {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 10px 24px;
  border-right: 1px solid var(--color-border);
  background: var(--color-surface);
  height: calc(100vh - 52px);
  position: sticky;
  top: 52px;
  overflow-y: auto;
}
@media (max-width: 900px) {
  .space-nav {
    position: fixed;
    left: -100%;
    top: 52px;
    bottom: 0;
    z-index: 900;
    width: 280px;
    height: auto;
    transition: left 0.25s ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
  }
  .space-nav.is-open {
    left: 0;
  }
}
.space-nav__head {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px 10px;
}
.space-nav__title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  color: var(--color-text);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}
.space-nav__title-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 7px;
  background: var(--color-bg-muted);
  color: var(--color-text-muted);
  font-size: 14px;
}
.space-nav__title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.space-nav__icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}
.space-nav__icon-btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}
.space-nav__quick {
  padding: 0 6px;
}
.space-nav__quick summary {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  color: var(--color-primary);
  font-size: 12px;
  cursor: pointer;
  list-style: none;
}
.space-nav__quick summary::-webkit-details-marker {
  display: none;
}
.space-nav__quick summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}
.space-nav__quick-empty {
  padding: 4px 0;
  font-size: 12px;
  color: var(--color-text-muted);
}
.space-nav__quick-list {
  list-style: none;
  margin: 4px 0 8px;
  padding: 0;
}
.space-nav__quick-list a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 6px;
  color: var(--color-text);
  text-decoration: none;
  font-size: 13px;
}
.space-nav__quick-list a:hover {
  background: var(--color-bg-hover);
}
.space-nav__section-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 6px 4px;
  font-size: 12px;
  color: var(--color-text-muted);
}
.space-nav__section-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}
.space-nav__icon-expand {
  display: none;
}
.space-nav__icon-collapse {
  display: block;
}
.space-nav #js-tree-toggle-all[data-state=collapsed] .space-nav__icon-expand {
  display: block;
}
.space-nav #js-tree-toggle-all[data-state=collapsed] .space-nav__icon-collapse {
  display: none;
}
.space-nav__tree {
  padding: 0 2px;
}
.space-nav__back {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 6px 4px;
  padding: 5px 6px;
  border-radius: 6px;
  color: var(--color-text-muted);
  font-size: 12.5px;
  text-decoration: none;
}
.space-nav__back:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}
.space-nav__footer {
  margin-top: auto;
  position: sticky;
  bottom: -24px;
  padding: 10px 6px 0;
  background: var(--color-surface);
}
.space-nav__create {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px 12px;
  border: 1px dashed var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-size: 13px;
  cursor: pointer;
}
.space-nav__create:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  border-style: solid;
}
.space-nav__spaces {
  list-style: none;
  margin: 0;
  padding: 0 2px;
}
.space-nav__spaces a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--color-text);
  text-decoration: none;
  font-size: 13px;
}
.space-nav__spaces a:hover {
  background: var(--color-bg-hover);
}

.space-nav-backdrop {
  display: none;
}
@media (max-width: 900px) {
  .space-nav-backdrop.is-visible {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 890;
    background: rgba(0, 0, 0, 0.35);
  }
}

.space-menu {
  position: relative;
}
.space-menu__dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 30px;
  z-index: 40;
  min-width: 210px;
  padding: 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
}
.space-menu.is-open .space-menu__dropdown {
  display: block;
}
.space-menu__item {
  display: block;
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--color-text);
  font-size: 13px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.space-menu__item:hover {
  background: var(--color-bg-hover);
}

.doc-tree__root {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.workspace__main {
  flex: 1;
  min-width: 0;
  padding: 22px 28px 60px;
  background: var(--color-bg);
}
@media (max-width: 640px) {
  .workspace__main {
    padding: 16px 14px 40px;
  }
}

.settings-layout .settings-sidebar {
  top: calc(52px + 16px);
}
@media (max-width: 1100px) {
  .settings-layout {
    display: block;
  }
  .settings-layout .settings-sidebar {
    position: static;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--color-border);
  }
  .settings-layout .settings-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2px;
  }
}

.data-table .form-select {
  min-width: 150px;
}

.spaces-page {
  max-width: 760px;
}
.spaces-page__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.spaces-page__head h1 {
  font-size: 20px;
}
.spaces-page__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
}
.icon-btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}
.icon-btn--primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.icon-btn--primary:hover {
  background: var(--color-primary-hover);
  color: #fff;
}

.spaces-search {
  position: relative;
  margin-bottom: 14px;
}
.spaces-search__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
}
.spaces-search input {
  width: 100%;
  padding: 9px 12px 9px 32px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  color: var(--color-text);
}
.spaces-search input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.space-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.space-list__item {
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 4px solid transparent;
  border-bottom: 1px solid var(--color-border-muted);
  padding: 8px 6px 8px 8px;
  transition: background-color 0.12s ease;
}
.space-list__item:hover {
  background: var(--color-bg-hover);
}
.space-list__item--pinned {
  background: var(--color-primary-tint);
  border-left-color: var(--color-primary);
}
.space-list__item--pinned:hover {
  background: var(--color-primary-tint);
}
.space-list__item--pinned:not(:has(+ .space-list__item--pinned)) {
  margin-bottom: 10px;
  border-bottom-color: var(--color-border);
}
.space-list__link {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
}
.space-list__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 9px;
  background: var(--color-bg-muted);
  color: var(--color-text-muted);
  font-size: 17px;
}
.space-list__item--pinned .space-list__icon {
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-primary-light);
}
.space-list__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.space-list__name {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.space-list__desc {
  font-size: 12px;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.space-list__pin {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease, color 0.12s ease, background-color 0.12s ease;
}
.space-list__pin:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}
.space-list__pin:focus-visible {
  opacity: 1;
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}
.space-list__pin-off, .space-list__pin-on {
  grid-area: 1/1;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.space-list__pin-off {
  transform: rotate(45deg);
}
.space-list__pin-on {
  opacity: 0;
  transform: scale(0.6) rotate(-20deg);
}
.space-list__pin--on {
  opacity: 1;
  color: var(--color-primary);
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-primary);
}
.space-list__pin--on .space-list__pin-off {
  opacity: 0;
  transform: scale(0.6) rotate(90deg);
}
.space-list__pin--on .space-list__pin-on {
  opacity: 1;
  transform: none;
}
.space-list__pin--on:hover {
  background: var(--color-surface);
  color: var(--color-primary-hover);
}
.space-list__item:hover .space-list__pin, .space-list__item:focus-within .space-list__pin {
  opacity: 1;
}
@media (hover: none) {
  .space-list__pin {
    opacity: 1;
  }
}

.feed-page__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.feed-page__head h1 {
  font-size: 19px;
}

.feed {
  margin: 0 auto;
  width: 100%;
}

.doc-table-header {
  display: none;
}

.feed--stream {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 700px;
}
.feed--stream .feed-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
}
.feed--stream .feed-card__cover {
  display: block;
  max-height: 150px;
  overflow: hidden;
}
.feed--stream .feed-card__cover img {
  width: 100%;
  object-fit: cover;
  display: block;
}
.feed--stream .feed-card__body {
  padding: 16px 18px 12px;
}
.feed--stream .feed-card .col--name {
  display: block;
}
.feed--stream .feed-card__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
}
.feed--stream .feed-card__title:hover {
  color: var(--color-primary);
}
.feed--stream .feed-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.feed--stream .feed-card .col--author {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}
.feed--stream .feed-card__author {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.feed--stream .feed-card__author-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
}
.feed--stream .feed-card .col--updated {
  display: flex;
}
.feed--stream .feed-card__date {
  font-size: 12px;
  color: var(--color-primary);
}
.feed--stream .feed-card__counters {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.feed--stream .feed-card__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border-muted);
}

.feed--grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  max-width: 100%;
}
.feed--grid .feed-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.feed--grid .feed-card__cover {
  display: block;
  height: 140px;
  overflow: hidden;
  flex-shrink: 0;
}
.feed--grid .feed-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.feed--grid .feed-card__body {
  padding: 16px 18px 12px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.feed--grid .feed-card .col--name {
  display: block;
}
.feed--grid .feed-card__title {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  line-height: 1.3;
}
.feed--grid .feed-card__title:hover {
  color: var(--color-primary);
}
.feed--grid .feed-card__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
}
.feed--grid .feed-card .col--author {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}
.feed--grid .feed-card__author {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.feed--grid .feed-card__author-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}
.feed--grid .feed-card .col--updated {
  display: flex;
  align-items: center;
}
.feed--grid .feed-card__date {
  font-size: 12px;
  color: var(--color-text-muted);
}
.feed--grid .feed-card__counters {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  width: 100%;
}
.feed--grid .feed-card__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--color-border-subtle);
}

.feed--table {
  width: 100%;
  max-width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.feed--table .doc-table-header {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  background: var(--color-bg-hover);
  border-bottom: 1px solid var(--color-border);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
}
.feed--table .feed-card {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--color-border-subtle);
  transition: background 0.15s ease;
  font-size: 14px;
  margin: 0;
  border-radius: 0;
  background: none;
}
.feed--table .feed-card:hover {
  background: var(--color-bg-hover);
}
.feed--table .feed-card:last-child {
  border-bottom: none;
}
.feed--table .feed-card__cover {
  display: none;
}
.feed--table .feed-card__body {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px 16px;
  gap: 16px;
}
.feed--table .feed-card__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feed--table .feed-card__title:hover {
  color: var(--color-primary);
}
.feed--table .feed-card__icon {
  font-size: 16px;
  flex-shrink: 0;
}
.feed--table .feed-card__title-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feed--table .feed-card__meta {
  display: contents;
}
.feed--table .feed-card__counters {
  display: none;
}
.feed--table .feed-card__author {
  display: none;
}
.feed--table .feed-card .avatar-initial {
  display: none;
}
.feed--table .feed-card__author-name {
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.feed--table .feed-card__date {
  font-size: 13px;
  color: var(--color-text-muted);
  white-space: nowrap;
}
.feed--table .feed-card__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin: 0;
  padding: 0;
  border: none;
}
.feed--table .col--name {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}
.feed--table .col--author {
  width: 160px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.feed--table .col--updated {
  width: 140px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.feed--table .col--actions {
  width: 80px;
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
}

.feed-card__counter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--color-text-muted);
  font-size: 12px;
  cursor: pointer;
}
.feed-card__counter:hover {
  background: var(--color-bg-hover);
}
.feed-card__counter--static {
  cursor: default;
}
.feed-card__counter--static:hover {
  background: none;
}
.feed-card__counter.is-on {
  color: var(--color-primary);
}

.feed-card__action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
}
.feed-card__action:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}
.feed-card__action.is-on {
  color: var(--color-primary);
}

.avatar-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--color-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.avatar-initial--sm {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 11px;
}

.doc-page__engagement {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: 6px;
}

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}
.search-modal[hidden] {
  display: none;
}
.search-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 30, 0.35);
}
.search-modal__box {
  position: relative;
  width: min(830px, 92vw);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}
.search-modal__query {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px 10px;
}
.search-modal__input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-input-bg);
  color: var(--color-text);
}
.search-modal__input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
.search-modal__query .btn:disabled {
  background: var(--color-bg-muted);
  border-color: var(--color-border);
  color: var(--color-text-muted);
  cursor: not-allowed;
}
.search-modal__tabs {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  border-bottom: 1px solid var(--color-border);
}
.search-modal__tab {
  padding: 8px 2px 10px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--color-text-muted);
  font-size: 13px;
  cursor: pointer;
}
.search-modal__tab--active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}
.search-modal__results {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px 16px;
}
.search-modal__group {
  padding: 8px 10px 4px;
  font-size: 12px;
  color: var(--color-text-muted);
}
.search-modal__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
}
.search-modal__item:hover {
  background: var(--color-bg-hover);
}
.search-modal__item-title {
  color: var(--color-text);
  font-weight: 500;
}
.search-modal__item-sub {
  font-size: 12px;
  color: var(--color-text-muted);
}
.search-modal__item-sub mark {
  background: var(--color-primary-light);
  color: inherit;
}
.search-modal__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 48px 20px;
  color: var(--color-text-muted);
}
.search-modal__empty-icon {
  opacity: 0.35;
}
.search-modal__empty-title {
  font-weight: 600;
  color: var(--color-text);
}
.search-modal__empty-hint {
  font-size: 13px;
}

.topbar__ai-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.12) 100%);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.topbar__ai-btn:hover {
  border-color: #6366f1;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.22) 100%);
  transform: translateY(-1px);
}

.topbar__ai-icon {
  font-size: 15px;
}

.topbar__ai-kbd {
  padding: 1px 5px;
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 4px;
  font-size: 10px;
  color: #6366f1;
  background: var(--color-surface);
}

@media (max-width: 640px) {
  .topbar__ai-text, .topbar__ai-kbd {
    display: none;
  }
  .topbar__ai-btn {
    padding: 6px;
  }
}
.ai-drawer {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0.25s;
}
.ai-drawer.ai-drawer--open {
  pointer-events: auto;
  visibility: visible;
}
.ai-drawer.ai-drawer--open .ai-drawer__backdrop {
  opacity: 1;
}
.ai-drawer.ai-drawer--open .ai-drawer__panel {
  transform: translateX(0);
}
.ai-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.ai-drawer__panel {
  position: relative;
  width: 440px;
  max-width: 100vw;
  height: 100%;
  background: var(--color-surface);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1;
}
.ai-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}
.ai-drawer__title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ai-drawer__icon {
  font-size: 24px;
}
.ai-drawer__sub {
  display: block;
  font-size: 11px;
  color: var(--color-text-muted);
}
.ai-drawer__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ai-drawer__close {
  background: none;
  border: none;
  font-size: 16px;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.ai-drawer__close:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}
.ai-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ai-drawer__suggestions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.ai-drawer__footer {
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-drawer__context-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  padding: 4px 8px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 6px;
  color: var(--color-text);
}
.ai-drawer__context-badge button {
  background: none;
  border: none;
  color: #6366f1;
  font-size: 11px;
  cursor: pointer;
  font-weight: 600;
}
.ai-drawer__form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 6px 10px;
}
.ai-drawer__form:focus-within {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}
.ai-drawer__input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  resize: none;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--color-text);
  max-height: 120px;
  line-height: 1.4;
  padding: 2px 0;
}
.ai-drawer__send-btn {
  background: #6366f1;
  color: #ffffff;
  border: none;
  border-radius: 7px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.12s;
}
.ai-drawer__send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ai-msg {
  display: flex;
  gap: 10px;
  max-width: 92%;
}
.ai-msg--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.ai-msg--user .ai-msg__bubble {
  background: #6366f1;
  color: #ffffff;
  border-bottom-right-radius: 2px;
}
.ai-msg--assistant {
  align-self: flex-start;
}
.ai-msg--assistant .ai-msg__bubble {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-bottom-left-radius: 2px;
}
.ai-msg--error .ai-msg__bubble {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}
.ai-msg__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  color: #fff;
}
.ai-msg__content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-msg__bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
}

.ai-suggestion-btn {
  text-align: left;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.12s;
}
.ai-suggestion-btn:hover {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.05);
  color: #6366f1;
}

.ai-sources {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed var(--color-border);
}
.ai-sources__title {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
}
.ai-sources__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-source-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  text-decoration: none;
  color: var(--color-text);
  transition: all 0.12s;
}
.ai-source-card:hover {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.04);
}
.ai-source-card__title {
  font-size: 12.5px;
  font-weight: 600;
  color: #6366f1;
  display: block;
}
.ai-source-card__space {
  font-size: 11px;
  color: var(--color-text-muted);
  display: block;
}

.ai-typing__bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
}
.ai-typing__bubble span {
  width: 6px;
  height: 6px;
  background: #6366f1;
  border-radius: 50%;
  animation: typingJump 1.2s infinite ease-in-out;
}
.ai-typing__bubble span:nth-child(2) {
  animation-delay: 0.2s;
}
.ai-typing__bubble span:nth-child(3) {
  animation-delay: 0.4s;
}

.doc-presence-container {
  display: flex;
  align-items: center;
  margin-right: 8px;
}

.doc-presence-group {
  display: flex;
  align-items: center;
  margin-left: 6px;
}

.doc-presence-avatar {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  margin-left: -6px;
  border: 2px solid var(--color-surface);
  background: #6366f1;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  cursor: default;
  transition: transform 0.15s ease, z-index 0.15s ease;
}
.doc-presence-avatar:hover {
  transform: scale(1.15) translateY(-2px);
  z-index: 10;
}
.doc-presence-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.doc-presence-avatar .doc-presence-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--color-surface);
  background: #94a3b8;
}
.doc-presence-avatar--editing .doc-presence-dot {
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: presencePulse 1.8s infinite cubic-bezier(0.66, 0, 0, 1);
}

@keyframes presencePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}
.doc-conflict-modal-backdrop {
  z-index: 1000;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
}

.doc-conflict-modal {
  max-width: 760px;
  width: 95%;
}
.doc-conflict-modal__header {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 14px;
}
.doc-conflict-modal__title-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.doc-conflict-modal__icon {
  font-size: 24px;
  line-height: 1;
}
.doc-conflict-modal__subtitle {
  margin: 4px 0 0;
  font-size: 13.5px;
  color: var(--color-text-muted);
  line-height: 1.45;
}
.doc-conflict-modal__body {
  padding: 16px 0;
}
.doc-conflict-modal__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid var(--color-border);
  padding-top: 16px;
}

.doc-conflict-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 12px;
  padding-bottom: 8px;
}

.doc-conflict-tab {
  padding: 6px 12px;
  border: none;
  background: none;
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.doc-conflict-tab:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}
.doc-conflict-tab.is-active {
  background: var(--color-primary);
  color: #fff;
}

.doc-conflict-preview {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 14px;
  background: var(--color-bg);
}

.doc-conflict-view-content {
  font-size: 14px;
  line-height: 1.6;
}

.doc-conflict-actions-secondary {
  display: flex;
  gap: 8px;
}

.doc-conflict-actions-primary {
  display: flex;
  gap: 8px;
}

.btn--danger-accent {
  background: #e11d48 !important;
  border-color: #e11d48 !important;
  color: #fff !important;
}
.btn--danger-accent:hover {
  background: #be123c !important;
  border-color: #be123c !important;
}

.roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
  max-width: 1100px;
}
.roles-grid__loading {
  color: var(--color-text-muted);
  font-size: 13px;
  padding: 20px 0;
}

.role-card {
  display: flex;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.role-card:hover {
  border-color: color-mix(in srgb, var(--role-color) 45%, var(--color-border));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.role-card__accent {
  width: 4px;
  flex-shrink: 0;
  background: var(--role-color);
}
.role-card__body {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.role-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.role-card__swatch {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--role-color);
  border: 2px solid color-mix(in srgb, var(--role-color) 40%, var(--color-border));
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.1s;
}
.role-card__swatch:hover {
  transform: scale(1.1);
}
.role-card__swatch input[type=color] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.role-card__label-input {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 8px;
  transition: border-color 0.12s, background 0.12s;
}
.role-card__label-input:hover {
  background: var(--color-bg);
}
.role-card__label-input:focus {
  outline: none;
  background: var(--color-bg);
  border-color: var(--color-primary);
}
.role-card__saved {
  color: #22c55e;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.role-card__key {
  font-size: 11px;
  color: var(--color-text-muted);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 5px;
  padding: 2px 7px;
  flex-shrink: 0;
}
.role-card__perms {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.role-card__perm {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  opacity: 0.55;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.1s, border-color 0.1s, background 0.1s;
}
.role-card__perm:hover:not(:disabled) {
  opacity: 0.85;
  border-color: color-mix(in srgb, var(--role-color) 40%, var(--color-border));
}
.role-card__perm--on {
  opacity: 1;
  color: var(--color-text);
  border-color: color-mix(in srgb, var(--role-color) 50%, var(--color-border));
  background: color-mix(in srgb, var(--role-color) 10%, transparent);
}
.role-card__perm--on:hover:not(:disabled) {
  opacity: 1;
}
.role-card__perm--locked {
  cursor: not-allowed;
}
.role-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--color-border);
}
.role-card__users {
  font-size: 12px;
  color: var(--color-text-muted);
  text-decoration: none;
}
.role-card__users:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.search-bar {
  margin-bottom: 14px;
}
.search-bar__input {
  width: 100%;
  font-size: 16px;
  padding: 12px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  color: var(--color-text);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.search-bar__input::placeholder {
  color: var(--color-text-muted);
}
.search-bar__input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 15%, transparent);
}

.search-results mark {
  background: color-mix(in srgb, var(--color-primary) 25%, transparent);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

.search-section {
  margin-bottom: 24px;
}
.search-section__title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}
.search-section__count {
  font-weight: 400;
  opacity: 0.7;
}

.search-hit {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin-bottom: 6px;
  text-decoration: none;
  color: var(--color-text);
  transition: border-color 0.12s;
}
.search-hit:hover {
  border-color: color-mix(in srgb, var(--color-primary) 40%, var(--color-border));
}
.search-hit__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.search-hit__proj-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
}
.search-hit__proj-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.search-hit__comment-icon {
  font-size: 16px;
  margin-top: 2px;
  flex-shrink: 0;
}
.search-hit__body {
  flex: 1;
  min-width: 0;
}
.search-hit__title {
  font-size: 14px;
  line-height: 1.4;
  color: var(--color-text);
}
.search-hit__key {
  font-size: 11px;
  color: var(--color-text-muted);
  background: var(--color-bg);
  border-radius: 4px;
  padding: 1px 6px;
  margin-right: 4px;
}
.search-hit__meta {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.search-hit__subtask {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
  font-style: italic;
}
.search-hit__done {
  font-size: 11px;
  color: #22c55e;
  font-weight: 600;
}
.search-hit__archived {
  font-size: 11px;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0 6px;
  display: inline-block;
}

.header-search-drop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 300;
  overflow: hidden;
}
.header-search-drop__item {
  display: block;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.12s;
}
.header-search-drop__item:hover {
  background: var(--color-bg);
}
.header-search-drop__type {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-right: 8px;
}
.header-search-drop__all {
  display: block;
  padding: 9px 14px;
  font-size: 12px;
  color: var(--color-primary);
  text-decoration: none;
  border-top: 1px solid var(--color-border);
  transition: background 0.12s;
}
.header-search-drop__all:hover {
  background: var(--color-bg);
}
.header-search-drop__empty {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.account-page {
  max-width: 860px;
  margin: 0;
}
.account-page__title {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 24px;
  letter-spacing: -0.01em;
}

.account-card {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 28px;
}
@media (max-width: 640px) {
  .account-card {
    flex-direction: column;
    align-items: center;
  }
}
.account-card__fields {
  flex: 1;
  min-width: 0;
  width: 100%;
}
.account-card__hint {
  font-size: 12px;
  color: var(--color-text-muted, #94a3b8);
  line-height: 1.45;
  margin: 10px 0 16px;
}
.account-card__actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

.account-avatar {
  width: 124px;
  height: 124px;
  border-radius: 18px;
  background: #4361ee;
  background: linear-gradient(135deg, #4361ee, #3a0ca3);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(67, 97, 238, 0.22);
  user-select: none;
}
.account-avatar__text {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1;
}
.account-avatar__img {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  object-fit: cover;
}

.account-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 540px) {
  .account-form__row {
    grid-template-columns: 1fr;
  }
}

.account-field__label {
  display: block;
  font-size: 12px;
  color: var(--color-text-muted, #94a3b8);
  margin-bottom: 6px;
  font-weight: 400;
}
.account-field__input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.account-field__input {
  width: 100%;
  height: 40px;
  padding: 0 60px 0 14px;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 8px;
  background: var(--color-surface, #fff);
  color: var(--color-text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.account-field__input:focus {
  outline: none;
  border-color: #4361ee;
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}
.account-field__counter {
  position: absolute;
  right: 12px;
  font-size: 12px;
  color: var(--color-text-muted, #94a3b8);
  pointer-events: none;
  user-select: none;
}

.account-btn-ghost {
  background: none;
  border: none;
  color: var(--color-text-muted, #94a3b8);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 6px;
  transition: color 0.15s ease;
}
.account-btn-ghost:hover:not(:disabled) {
  color: var(--color-text);
}
.account-btn-ghost:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.account-btn-apply {
  background: var(--color-bg-hover, #e2e8f0);
  color: var(--color-text-muted, #94a3b8);
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 20px;
  border-radius: 8px;
  border: none;
  cursor: not-allowed;
  transition: all 0.15s ease;
}
.account-btn-apply.is-active, .account-btn-apply:not(:disabled) {
  background: #4361ee;
  color: #fff;
  cursor: pointer;
}
.account-btn-apply.is-active:hover, .account-btn-apply:not(:disabled):hover {
  background: #3b50d9;
}

.account-list {
  border-top: 1px solid var(--color-border, #e2e8f0);
}

.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  gap: 16px;
}
.account-row__info {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.account-row__icon {
  color: var(--color-text-muted, #64748b);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
}
.account-row__texts {
  min-width: 0;
}
.account-row__title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.35;
}
.account-row__subtitle {
  font-size: 12.5px;
  color: var(--color-text-muted, #64748b);
  margin-top: 2px;
  line-height: 1.35;
}

.account-action-btn {
  padding: 6px 18px;
  border: 1px solid var(--color-border, #cbd5e1);
  border-radius: 8px;
  background: var(--color-surface, #fff);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s ease;
  white-space: nowrap;
  font-family: inherit;
}
.account-action-btn:hover {
  background: var(--color-bg-hover, #f8fafc);
  border-color: var(--color-primary, #4361ee);
}
.account-action-btn--danger:hover {
  color: #ef4444;
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.04);
}

.user-profile {
  max-width: 560px;
}
.user-profile__header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.user-profile__avatar, .user-profile__avatar-img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  flex-shrink: 0;
}
.user-profile__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 22px;
}
.user-profile__avatar-img {
  object-fit: cover;
}
.user-profile__identity {
  min-width: 0;
}
.user-profile__name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.user-profile__role-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--badge-color, #94a3b8);
  background: color-mix(in srgb, var(--badge-color, #94a3b8) 14%, transparent);
  border-radius: 20px;
  padding: 2px 10px;
}

.account-row--theme {
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 14px;
}
@media (max-width: 640px) {
  .account-row--theme {
    flex-direction: column;
    align-items: stretch;
  }
}

.account-theme-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  width: 100%;
}
@media (max-width: 640px) {
  .account-theme-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
  }
}

.account-theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--color-border, #cbd5e1);
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #1e293b);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  outline: none;
  touch-action: manipulation;
}
@media (max-width: 640px) {
  .account-theme-btn {
    width: 100%;
    padding: 9px 8px;
    font-size: 12.5px;
  }
}
.account-theme-btn__swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.account-theme-btn:hover {
  border-color: var(--color-primary, #6366f1);
  background: var(--color-bg-hover, #f8fafc);
  transform: translateY(-1px);
}
.account-theme-btn.is-active {
  border-color: var(--color-primary, #6366f1);
  background: var(--color-primary-tint, #eeedfe);
  color: var(--color-primary, #6366f1);
  font-weight: 600;
  box-shadow: 0 0 0 3px var(--color-primary-light, rgba(99, 102, 241, 0.15));
}
.account-theme-btn--dark.is-active {
  border-color: #60a5fa;
  background: #1f2a44;
  color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.pwd-gen-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--color-primary-light, rgba(124, 58, 237, 0.2));
  background: var(--color-primary-tint, #f3e8ff);
  color: var(--color-primary, #7c3aed);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}
.pwd-gen-btn:hover {
  background: var(--color-primary, #7c3aed);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px var(--color-primary-light, rgba(124, 58, 237, 0.25));
}

.pwd-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.pwd-input-wrap input {
  width: 100%;
  padding-right: 40px !important;
}

.pwd-toggle-btn {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  opacity: 0.6;
  padding: 4px;
  border-radius: 6px;
  transition: opacity 0.15s ease;
}
.pwd-toggle-btn:hover {
  opacity: 1;
  background: var(--color-bg-hover);
}

.pwd-strength {
  margin-top: 8px;
}
.pwd-strength__bar {
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}
.pwd-strength__fill {
  height: 100%;
  width: 0%;
  transition: all 0.25s ease;
  border-radius: 2px;
}
.pwd-strength__text {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
}
.pwd-strength--weak .pwd-strength__fill {
  width: 25%;
  background: #dc2626;
}
.pwd-strength--weak .pwd-strength__text {
  color: #dc2626;
}
.pwd-strength--medium .pwd-strength__fill {
  width: 50%;
  background: #d97706;
}
.pwd-strength--medium .pwd-strength__text {
  color: #d97706;
}
.pwd-strength--strong .pwd-strength__fill {
  width: 75%;
  background: #059669;
}
.pwd-strength--strong .pwd-strength__text {
  color: #059669;
}
.pwd-strength--maximum .pwd-strength__fill {
  width: 100%;
  background: #7c3aed;
}
.pwd-strength--maximum .pwd-strength__text {
  color: #7c3aed;
}

.dashboard-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.dashboard-hero {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 24px;
  background-color: var(--color-surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.dashboard-hero__bg {
  height: 100px;
  background: linear-gradient(135deg, #FF6B6B 0%, #FFD93D 25%, #4ECDC4 50%, #6BCB77 75%, #4D96FF 100%);
  background-size: 200% 200%;
  animation: gradient-shift 10s ease infinite;
}
.dashboard-hero__content {
  padding: 0 24px 24px;
  display: flex;
  align-items: flex-end;
  margin-top: -32px;
}
.dashboard-hero__content h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: var(--color-text);
  padding-bottom: 4px;
}

@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
.dashboard-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.widget-card {
  background: var(--color-surface);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
}
.widget-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.widget-card__head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text);
}
.widget-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
}
.widget-card__more {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 20px;
  line-height: 1;
  padding: 0 4px;
  border-radius: 4px;
}
.widget-card__more:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}
.widget-card__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.widget-card__empty {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0;
  text-align: center;
  padding: 16px 0;
}

.widget-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--color-text);
  transition: background-color 0.2s;
}
.widget-item:hover {
  background-color: var(--color-bg-hover);
}
.widget-item__icon {
  font-size: 16px;
  flex-shrink: 0;
}
.widget-item__text {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.widget-item__title {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.widget-item__space {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-left: 6px;
  flex-shrink: 0;
}
.widget-item__star {
  color: var(--color-primary);
  flex-shrink: 0;
}
.widget-item__time {
  font-size: 11px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.dashboard-feed {
  background: var(--color-surface);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.dashboard-feed__head {
  margin-bottom: 24px;
}

.feed-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}
.feed-filters__pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.feed-filter-pill {
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--color-text);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
}
.feed-filter-pill:hover {
  background-color: var(--color-bg-hover);
}
.feed-filter-pill.is-active {
  background-color: var(--color-primary-tint);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.feed-filter-reset {
  background: none;
  border: none;
  font-size: 13px;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 6px 12px;
}
.feed-filter-reset:hover {
  color: var(--color-text);
  text-decoration: underline;
}

.doc-discussion-section {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
  max-width: 900px;
}

.doc-discussion-tabs {
  display: flex;
  gap: 28px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 24px;
}
.doc-discussion-tabs__item {
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-muted);
  padding: 0 0 12px 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.doc-discussion-tabs__item:hover {
  color: var(--color-text);
}
.doc-discussion-tabs__item.is-active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}
.doc-discussion-tabs__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
  background: var(--color-bg-hover);
  color: var(--color-text-muted);
}
.is-active .doc-discussion-tabs__badge {
  background: var(--color-primary-tint);
  color: var(--color-primary);
}

.doc-comments-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.doc-comments-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.discussion-msg {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.discussion-msg--reply {
  margin-left: 44px;
  position: relative;
}
.discussion-msg--reply::before {
  content: "";
  position: absolute;
  left: -22px;
  top: -10px;
  bottom: 14px;
  width: 2px;
  background: var(--color-border);
  border-radius: 2px;
}
.discussion-msg__avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  color: #fff;
  background: var(--color-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.discussion-msg__card {
  flex: 1;
  min-width: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: border-color 0.15s ease;
}
.discussion-msg__card:hover {
  border-color: color-mix(in srgb, var(--color-primary) 30%, var(--color-border));
}
.discussion-msg__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.discussion-msg__author {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}
.discussion-msg__date {
  font-size: 11px;
  color: var(--color-text-muted);
}
.discussion-msg__text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text);
  white-space: pre-wrap;
  word-break: break-word;
}
.discussion-msg__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--color-border-muted, rgba(0, 0, 0, 0.04));
}
.discussion-msg__action-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s ease;
}
.discussion-msg__action-btn:hover {
  color: var(--color-primary);
}
.discussion-msg__action-btn--danger:hover {
  color: var(--color-danger, #ef4444);
}

.doc-comment-editor {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-top: 10px;
}
.doc-comment-editor__box {
  flex: 1;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.doc-comment-editor__box:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-tint, rgba(59, 130, 246, 0.1));
}
.doc-comment-editor__textarea {
  width: 100%;
  border: none;
  background: transparent;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--color-text);
  min-height: 52px;
  max-height: 200px;
  resize: none;
  outline: none;
  font-family: inherit;
}
.doc-comment-editor__textarea::placeholder {
  color: var(--color-text-muted);
}
.doc-comment-editor__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--color-bg, #f8fafc);
  border-top: 1px solid var(--color-border);
}
.doc-comment-editor__tools {
  display: flex;
  align-items: center;
  gap: 6px;
}
.doc-comment-editor__tool-btn {
  background: none;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.doc-comment-editor__tool-btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.doc-reply-box {
  margin-top: 10px;
  background: var(--color-bg, #f8fafc);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.doc-reply-box__textarea {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--color-text);
  min-height: 38px;
  resize: vertical;
  outline: none;
  font-family: inherit;
}
.doc-reply-box__textarea:focus {
  border-color: var(--color-primary);
}
.doc-reply-box__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.doc-attachments-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.doc-dropzone {
  border: 2px dashed var(--color-border);
  border-radius: 12px;
  padding: 28px 20px;
  text-align: center;
  background: var(--color-bg, #f8fafc);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.doc-dropzone:hover, .doc-dropzone.is-dragover {
  border-color: var(--color-primary);
  background: var(--color-primary-tint, rgba(59, 130, 246, 0.05));
}
.doc-dropzone__icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.doc-dropzone__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}
.doc-dropzone__hint {
  font-size: 12px;
  color: var(--color-text-muted);
}

.doc-attachments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.doc-file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 12px;
  text-decoration: none;
  color: var(--color-text);
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: all 0.15s ease;
}
.doc-file-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}
.doc-file-card__icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--color-bg, #f1f5f9);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
}
.doc-file-card__info {
  flex: 1;
  min-width: 0;
}
.doc-file-card__name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  color: var(--color-text);
  margin-bottom: 2px;
}
.doc-file-card__meta {
  font-size: 11px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.doc-file-card__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.doc-file-card__btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.doc-file-card__btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}
.doc-file-card__btn--delete:hover {
  color: var(--color-danger, #ef4444);
  background: rgba(239, 68, 68, 0.1);
}

.ai-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #a855f7 0%, #8b5cf6 50%, #7c3aed 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.45), 0 2px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9999;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, background 0.2s ease;
  user-select: none;
  outline: none;
}
.ai-fab__icon-sparkle {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.ai-fab__icon-close {
  display: none;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  transition: transform 0.25s ease;
}
.ai-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 26px rgba(139, 92, 246, 0.55), 0 3px 8px rgba(0, 0, 0, 0.14);
}
.ai-fab:active {
  transform: scale(0.96);
}
.ai-fab.is-open {
  background: linear-gradient(135deg, #9333ea, #7c3aed);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}
.ai-fab.is-open .ai-fab__icon-sparkle {
  display: none;
}
.ai-fab.is-open .ai-fab__icon-close {
  display: block;
}

.ai-widget {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
}
.ai-widget__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.22s ease;
  display: none;
}
.ai-widget__card {
  position: fixed;
  bottom: 88px;
  right: 24px;
  width: 480px;
  height: 680px;
  max-height: calc(100vh - 110px);
  max-width: calc(100vw - 32px);
  background: var(--color-surface, #fff);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), width 0.25s ease, height 0.25s ease;
}
.ai-widget.is-open .ai-widget__card {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.ai-widget.is-fullscreen {
  pointer-events: auto;
}
.ai-widget.is-fullscreen .ai-widget__backdrop {
  display: block;
  opacity: 1;
  pointer-events: auto;
}
.ai-widget.is-fullscreen .ai-widget__card {
  inset: 0;
  margin: auto;
  bottom: auto;
  right: auto;
  width: 940px;
  height: 88vh;
  max-width: 94vw;
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
  pointer-events: auto;
}
.ai-widget__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  background: var(--color-surface, #fff);
  flex-shrink: 0;
}
.ai-widget__head-left, .ai-widget__head-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ai-widget__brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--color-text);
}
.ai-widget__brand .ai-brand-sparkle {
  color: #8b5cf6;
  font-size: 15px;
}
.ai-widget__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ai-widget__footer {
  padding: 12px 18px 16px;
  background: var(--color-surface, #fff);
  border-top: 1px solid var(--color-border, #e2e8f0);
  flex-shrink: 0;
}

.ai-icon-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--color-text-muted, #64748b);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s ease;
}
.ai-icon-btn:hover {
  background: var(--color-bg-hover, #f1f5f9);
  color: var(--color-text);
}
.ai-icon-btn.is-active {
  color: #8b5cf6;
  background: rgba(139, 92, 246, 0.12);
}
.ai-icon-btn--close {
  font-size: 15px;
}

.ai-welcome {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ai-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, #7c3aed 0%, #9333ea 50%, #a855f7 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.22);
  gap: 12px;
}
.ai-banner__text-wrap {
  flex: 1;
  min-width: 0;
}
.ai-banner__title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 6px;
  line-height: 1.35;
  color: #fff;
}
.ai-banner__sub {
  font-size: 12px;
  line-height: 1.4;
  margin: 0;
  color: #f3e8ff;
  opacity: 0.94;
}
.ai-banner__stars {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-section__title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted, #94a3b8);
  margin-bottom: 6px;
}

.ai-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ai-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
  font-family: inherit;
}
.ai-list-item__icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #f5f3ff;
  color: #7c3aed;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.ai-list-item__text {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.3;
}
.ai-list-item:hover {
  background: var(--color-bg-hover, #faf5ff);
}
.ai-list-item:hover .ai-list-item__text {
  color: #7c3aed;
}

.ai-messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ai-msg {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.ai-msg__avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
  background: #f1f5f9;
}
.ai-msg__content {
  flex: 1;
  min-width: 0;
}
.ai-msg__bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg, #f8fafc);
  border: 1px solid var(--color-border, #e2e8f0);
  word-break: break-word;
}
.ai-msg__bubble p {
  margin: 0 0 6px;
}
.ai-msg__bubble p:last-child {
  margin-bottom: 0;
}
.ai-msg__bubble ul, .ai-msg__bubble ol {
  margin: 4px 0 4px 16px;
  padding: 0;
}
.ai-msg__bubble li {
  margin-bottom: 3px;
}
.ai-msg--user {
  flex-direction: row-reverse;
}
.ai-msg--user .ai-msg__avatar {
  background: #ede9fe;
  color: #7c3aed;
}
.ai-msg--user .ai-msg__bubble {
  background: #7c3aed;
  color: #fff;
  border-color: #7c3aed;
  border-bottom-right-radius: 4px;
}
.ai-msg--assistant .ai-msg__avatar {
  background: #f5f3ff;
  color: #7c3aed;
}
.ai-msg--assistant .ai-msg__bubble {
  background: var(--color-surface, #fff);
  border-bottom-left-radius: 4px;
}
.ai-msg__sources {
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--color-bg, #f8fafc);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 8px;
}
.ai-msg__sources-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted, #64748b);
  margin-bottom: 4px;
  text-transform: uppercase;
}
.ai-msg__sources-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.ai-msg__model {
  font-size: 11px;
  color: var(--color-text-muted, #94a3b8);
  margin-top: 4px;
}

.ai-citation-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #7c3aed;
  background: #ede9fe;
  padding: 1px 6px;
  border-radius: 5px;
  text-decoration: none;
  margin: 0 3px;
  vertical-align: baseline;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ai-citation-badge:hover {
  background: #7c3aed;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.25);
}

.ai-sources-shelf {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--color-bg, #f8fafc);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 10px;
}
.ai-sources-shelf__label {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-muted, #64748b);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ai-sources-shelf__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-source-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #cbd5e1);
  color: var(--color-text);
  font-size: 12px;
  text-decoration: none;
  transition: all 0.15s ease;
}
.ai-source-chip__index {
  font-weight: 700;
  color: #7c3aed;
}
.ai-source-chip__title {
  font-weight: 500;
}
.ai-source-chip:hover {
  border-color: #7c3aed;
  color: #7c3aed;
  background: #faf5ff;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.12);
}

.ai-input-card {
  border: 1px solid var(--color-border, #cbd5e1);
  border-radius: 14px;
  background: var(--color-surface, #fff);
  padding: 10px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ai-input-card:focus-within {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.14);
}
.ai-input-card__textarea {
  border: none;
  outline: none;
  background: transparent;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--color-text);
  width: 100%;
  resize: none;
  font-family: inherit;
  max-height: 120px;
}
.ai-input-card__textarea::placeholder {
  color: var(--color-text-muted, #94a3b8);
}
.ai-input-card__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
}

.ai-scope-box {
  position: relative;
}

.ai-scope-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--color-text);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
  font-family: inherit;
}
.ai-scope-tag__badge {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #3b82f6;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.ai-scope-tag__text {
  font-size: 12px;
  color: var(--color-text-muted, #64748b);
}
.ai-scope-tag:hover {
  background: var(--color-bg-hover, #f1f5f9);
}

.ai-scope-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  width: 250px;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #cbd5e1);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 5px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ai-scope-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
  font-family: inherit;
  width: 100%;
}
.ai-scope-option__icon {
  font-size: 15px;
  line-height: 1.2;
}
.ai-scope-option strong {
  font-size: 12px;
  font-weight: 600;
  display: block;
}
.ai-scope-option small {
  font-size: 11px;
  color: var(--color-text-muted, #64748b);
  display: block;
}
.ai-scope-option:hover:not(:disabled) {
  background: var(--color-bg-hover, #f1f5f9);
}
.ai-scope-option.is-active {
  background: rgba(139, 92, 246, 0.1);
}
.ai-scope-option.is-active strong {
  color: #7c3aed;
}
.ai-scope-option:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ai-send-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: #f1f5f9;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.ai-send-btn:hover:not(:disabled) {
  background: #7c3aed;
  color: #fff;
  transform: scale(1.05);
}
.ai-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ai-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
}
.ai-typing-dots span {
  width: 5px;
  height: 5px;
  background: #8b5cf6;
  border-radius: 50%;
  animation: aiBounce 1.4s infinite ease-in-out both;
}
.ai-typing-dots span:nth-child(1) {
  animation-delay: -0.32s;
}
.ai-typing-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes aiBounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}
body.ai-chat-body {
  overflow: hidden;
  height: 100vh;
}
body.ai-chat-body .topbar, body.ai-chat-body .workspace__sidebar, body.ai-chat-body .space-nav-backdrop {
  display: none !important;
}
body.ai-chat-body .workspace__main {
  padding: 0 !important;
  margin: 0 !important;
  height: 100vh;
  max-width: 100vw;
}

.ai-page {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: var(--color-surface, #fff);
}
.ai-page__sidebar {
  width: 280px;
  min-width: 280px;
  height: 100%;
  border-right: 1px solid var(--color-border, #e2e8f0);
  background: var(--color-bg, #f8fafc);
  display: flex;
  flex-direction: column;
  transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s ease, min-width 0.22s ease;
  z-index: 10;
}
.ai-page__sidebar.is-collapsed {
  width: 0;
  min-width: 0;
  overflow: hidden;
  border-right: none;
  transform: translateX(-100%);
}
.ai-page__sidebar-head {
  padding: 18px 20px 14px;
  display: flex;
  align-items: center;
}
.ai-page__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--color-text);
  font-size: 16px;
  font-weight: 700;
}
.ai-page__logo-icon {
  font-size: 18px;
  color: #8b5cf6;
}
.ai-page__new-wrap {
  padding: 0 16px 14px;
}
.ai-page__new-btn {
  width: 100%;
  padding: 10px 16px;
  border-radius: 12px;
  background: #ede9fe;
  color: #7c3aed;
  border: 1px solid rgba(139, 92, 246, 0.2);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}
.ai-page__new-btn:hover {
  background: #ddd6fe;
  transform: translateY(-1px);
}
.ai-page__history {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ai-page__empty-sidebar {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  color: var(--color-text-muted, #94a3b8);
  font-size: 13.5px;
}
.ai-page__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  background: var(--color-surface, #fff);
}
.ai-page__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  height: 56px;
  flex-shrink: 0;
}
.ai-page__topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ai-page__icon-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--color-text-muted, #64748b);
  cursor: pointer;
  transition: all 0.15s ease;
}
.ai-page__icon-btn:hover {
  background: var(--color-bg-hover, #f1f5f9);
  color: var(--color-text);
}
.ai-page__chat-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: var(--color-text);
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-page__content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.ai-page__welcome {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.ai-page__hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 760px;
  width: 100%;
}
.ai-page__chat-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.ai-page__messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20% 24px 20%;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
@media (max-width: 1024px) {
  .ai-page__messages {
    padding: 20px 24px;
  }
}
.ai-page__chat-footer {
  padding: 16px 20% 24px 20%;
  background: var(--color-surface, #fff);
  border-top: 1px solid var(--color-border, #e2e8f0);
  flex-shrink: 0;
}
@media (max-width: 1024px) {
  .ai-page__chat-footer {
    padding: 14px 24px 18px;
  }
}
.ai-page__chat-footer .ai-page-input-card {
  width: 100%;
  max-width: 100%;
}

.ai-history-group__title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--color-text-muted, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 8px 6px;
}
.ai-history-group__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ai-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 10px;
  transition: background 0.15s ease;
}
.ai-history-item__link {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--color-text);
  font-size: 13.5px;
  min-width: 0;
}
.ai-history-item__title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-history-item__actions {
  display: none;
  align-items: center;
  gap: 4px;
}
.ai-history-item:hover {
  background: var(--color-bg-hover, #e2e8f0);
}
.ai-history-item:hover .ai-history-item__actions {
  display: flex;
}
.ai-history-item.is-active {
  background: #ede9fe;
  color: #7c3aed;
}
.ai-history-item.is-active .ai-history-item__link {
  color: #7c3aed;
  font-weight: 600;
}

.ai-item-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 4px;
  opacity: 0.65;
  transition: opacity 0.15s ease;
}
.ai-item-btn:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.06);
}

.ai-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--color-border, #cbd5e1);
  background: var(--color-surface, #fff);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ai-share-btn:hover {
  background: #faf5ff;
  border-color: #8b5cf6;
  color: #7c3aed;
}

.ai-hero-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--color-text);
  margin-bottom: 32px;
}
.ai-hero-logo__icon {
  font-size: 32px;
  color: #8b5cf6;
}

.ai-page-input-card {
  width: 680px;
  max-width: 90vw;
  border: 1.5px solid #cbd5e1;
  border-radius: 18px;
  background: var(--color-surface, #fff);
  padding: 14px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.ai-page-input-card:focus-within {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}
.ai-page-input-card__textarea {
  border: none;
  outline: none;
  background: transparent;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--color-text);
  width: 100%;
  resize: none;
  font-family: inherit;
  max-height: 160px;
}
.ai-page-input-card__textarea::placeholder {
  color: var(--color-text-muted, #94a3b8);
}
.ai-page-input-card__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
}

.ai-page-send-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: #f1f5f9;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ai-page-send-btn:hover {
  background: #7c3aed;
  color: #fff;
  transform: scale(1.05);
}

.ai-page-prompts-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  width: 680px;
  max-width: 90vw;
  margin-top: 40px;
  text-align: left;
}
@media (max-width: 640px) {
  .ai-page-prompts-columns {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.ai-page-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-page-col__title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-text-muted, #94a3b8);
  margin-bottom: 4px;
}

.ai-page-prompts-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ai-page-prompt-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  font-family: inherit;
  width: 100%;
  text-align: left;
}
.ai-page-prompt-item__icon {
  font-size: 15px;
  flex-shrink: 0;
}
.ai-page-prompt-item__text {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.3;
}
.ai-page-prompt-item:hover {
  background: #faf5ff;
  color: #7c3aed;
}

.modal--ai-share {
  max-width: 480px;
  width: 100%;
}

.share-add-row {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.share-add-row .share-role-select {
  width: 130px;
  flex-shrink: 0;
}

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

.share-list-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted, #64748b);
  text-transform: uppercase;
}

.share-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.share-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--color-bg, #f8fafc);
  border: 1px solid var(--color-border, #e2e8f0);
}
.share-row__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.share-row__info strong {
  font-size: 13px;
}
.share-row__info small {
  font-size: 11.5px;
  color: var(--color-text-muted, #64748b);
}

.btn-remove-share {
  border: none;
  background: transparent;
  color: #ef4444;
  cursor: pointer;
  font-size: 14px;
  padding: 4px 6px;
  border-radius: 4px;
}
.btn-remove-share:hover {
  background: #fee2e2;
}

.share-empty {
  font-size: 13px;
  color: var(--color-text-muted, #94a3b8);
  font-style: italic;
  padding: 8px 0;
}

.mobile-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  background: color-mix(in srgb, var(--color-surface) 90%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--color-border);
  padding-bottom: env(safe-area-inset-bottom);
}
@media (max-width: 768px) {
  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }
}
.mobile-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 56px;
  position: relative;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.12s ease;
}
.mobile-nav__item svg {
  width: 21px;
  height: 21px;
  flex-shrink: 0;
}
.mobile-nav__item:active {
  color: var(--color-text);
}
.mobile-nav__item--active {
  color: var(--color-primary);
  font-weight: 600;
}
.mobile-nav__item:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
  border-radius: 8px;
}
.mobile-nav__badge {
  position: absolute;
  top: 6px;
  left: calc(50% + 4px);
  min-width: 15px;
  height: 15px;
  border-radius: 99px;
  background: var(--color-danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
  padding: 0 3px;
}

.upload-manager {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 950;
  width: 300px;
  max-width: calc(100vw - 32px);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  overflow: hidden;
  flex-direction: column;
}
@media (max-width: 768px) {
  .upload-manager {
    right: 12px;
    bottom: calc(64px + env(safe-area-inset-bottom));
  }
}
.upload-manager__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
}
.upload-manager__title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
}
.upload-manager__toggle {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
}
.upload-manager__toggle:hover {
  background: var(--color-bg);
}
.upload-manager__list {
  max-height: 40dvh;
  overflow-y: auto;
  padding: 4px 6px 6px;
}

.header {
  padding-top: env(safe-area-inset-top);
  height: calc(56px + env(safe-area-inset-top));
}

.header__search-btn {
  display: none;
}

@media (max-width: 768px) {
  .header {
    padding-left: 12px;
    padding-right: 12px;
    gap: 8px;
  }
  .header__logo {
    font-size: 22px;
    margin-right: 4px;
  }
  .header__search {
    max-width: none;
  }
  .header__search input {
    font-size: 16px;
    padding: 8px 12px;
  }
  .header__user-menu {
    margin-left: 0;
    padding-left: 8px;
  }
}
@media (max-width: 768px) and (max-width: 640px) {
  .header__search {
    display: none;
  }
  .header__search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 8px;
    color: var(--color-text-muted);
  }
  .header__search-btn:active {
    background: var(--color-bg-hover);
  }
}
@media (max-width: 768px) {
  .header__timer {
    padding: 0 4px 0 10px;
    font-size: 11.5px;
  }
  .sidebar {
    width: min(300px, 85vw);
    height: 100dvh;
    padding-top: calc(8px + env(safe-area-inset-top));
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
  .app-main {
    padding: 16px 16px calc(76px + env(safe-area-inset-bottom));
  }
  .header__notif-dropdown {
    position: fixed;
    left: 12px;
    right: 12px;
    top: calc(56px + env(safe-area-inset-top) + 6px);
    width: auto;
    max-height: 65dvh;
  }
  .data-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .all-tasks-table {
    display: block;
    background: transparent;
    border: none;
    overflow: visible;
  }
  .all-tasks-table tbody {
    display: block;
  }
  .all-tasks-table tr {
    display: flex;
    flex-wrap: wrap;
  }
  .all-tasks-table td {
    display: flex;
    align-items: center;
    padding: 0;
    border: none;
    text-align: left;
  }
  .all-tasks-table .at-row {
    column-gap: 8px;
    row-gap: 8px;
    align-items: flex-start;
    background: var(--color-surface);
    border: none;
    border-left: 3px solid transparent;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    padding: 15px 40px 15px 15px;
    margin-bottom: 10px;
    position: relative;
  }
  .all-tasks-table .at-row:last-child {
    margin-bottom: 0;
  }
  .all-tasks-table .at-row--priority-low {
    border-left-color: #94a3b8;
  }
  .all-tasks-table .at-row--priority-medium {
    border-left-color: #60a5fa;
  }
  .all-tasks-table .at-row--priority-high {
    border-left-color: #fbbf24;
  }
  .all-tasks-table .at-row--priority-urgent {
    border-left-color: #f87171;
  }
  .all-tasks-table .at-row > td:first-child {
    box-shadow: none;
  }
  .all-tasks-table .at-col-dot {
    order: 1;
    flex: 0 0 auto;
    width: auto;
  }
  .all-tasks-table .at-col-title {
    order: 2;
    flex: 0 1 100%;
    width: auto;
    min-width: 0;
  }
  .all-tasks-table .at-col-title .at-title-link {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
  }
  .all-tasks-table .at-col-category {
    order: 3;
    flex: 0 0 auto;
    width: auto;
  }
  .all-tasks-table .at-col-assignee {
    order: 4;
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }
  .all-tasks-table .at-col-assignee .at-inline-view {
    white-space: normal;
    max-width: 100%;
  }
  .all-tasks-table .at-col-assignee .assignee-pill__name {
    overflow-wrap: break-word;
  }
  .all-tasks-table .at-col-creator {
    order: 5;
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }
  .all-tasks-table .at-col-creator .assignee-pill__name {
    overflow-wrap: break-word;
  }
  .all-tasks-table .at-col-due {
    order: 6;
    flex: 0 0 auto;
    width: auto;
  }
  .all-tasks-table .at-col-status {
    order: 7;
    flex: 0 0 auto;
    width: auto;
    text-align: left;
  }
  .all-tasks-table .at-col-del {
    order: 8;
    position: absolute;
    top: 8px;
    right: 8px;
    flex: 0 0 auto;
    width: auto;
  }
  .all-tasks-table .at-col-del .at-del-btn {
    opacity: 1;
  }
  .all-tasks-table .at-inline-select,
  .all-tasks-table .at-inline-input {
    width: auto;
    min-width: 130px;
  }
  .task-list-tabs,
  .view-switcher {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .task-list-tabs::-webkit-scrollbar,
  .view-switcher::-webkit-scrollbar {
    display: none;
  }
  .page-header__controls {
    width: 100%;
    flex-wrap: nowrap;
  }
  .view-switcher {
    min-width: 0;
    flex: 1 1 auto;
  }
  .page-header__action {
    padding: 0;
    width: 34px;
    height: 34px;
    justify-content: center;
    flex-shrink: 0;
  }
  .page-header__action-text {
    display: none;
  }
  .settings-layout {
    flex-direction: column;
    gap: 16px;
  }
  .settings-sidebar {
    flex: none;
    width: 100%;
    position: static;
  }
  .settings-nav {
    flex-direction: row;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
  }
  .settings-nav::-webkit-scrollbar {
    display: none;
  }
  .settings-nav__tab {
    flex-shrink: 0;
  }
  .task-list-tabs__btn,
  .view-switcher__btn {
    white-space: nowrap;
    flex-shrink: 0;
  }
  .comment-list__item--reply {
    margin-left: 10px;
  }
  .field input:not([type=checkbox]):not([type=radio]),
  .field select,
  .field textarea,
  .form-input,
  .form-select,
  .task-list-filters__select,
  .task-list-filters__date,
  .task-list-filters__search,
  .comment-form textarea,
  .ai-chat__input {
    font-size: 16px;
  }
}
@media (max-width: 640px) {
  .dialog {
    width: 100vw;
    max-width: 100vw;
    margin: auto 0 0;
    border-radius: 16px 16px 0 0;
    border-bottom: none;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  }
  .dialog--wide {
    height: auto;
    max-height: calc(100dvh - 24px);
  }
  .field-row--2 {
    grid-template-columns: 1fr;
  }
  .danger-zone__row,
  .fm-toolbar,
  .roles-list__row {
    flex-wrap: wrap;
  }
  .feature-row {
    gap: 12px;
  }
  .feature-row__info {
    min-width: 0;
  }
  .data-table--stack {
    display: block;
    border: none;
    background: transparent;
    overflow: visible;
  }
  .data-table--stack thead {
    display: none;
  }
  .data-table--stack tbody {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .data-table--stack tr {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 12px 14px;
  }
  .data-table--stack td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0;
    border: none;
    font-size: 13px;
  }
  .data-table--stack td[data-label]::before {
    content: attr(data-label);
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
  }
  .fm-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  .auth-page {
    padding: 16px;
  }
  .auth-card {
    width: 100%;
    max-width: 360px;
    padding: 24px 20px;
  }
}
@media (pointer: coarse) {
  .btn {
    min-height: 42px;
  }
  .sidebar__link {
    padding: 10px 12px;
  }
  .sidebar__proj-item {
    padding: 8px 10px 8px 14px;
  }
  .sidebar__section-add {
    opacity: 1;
  }
  .at-row .at-del-btn,
  .comment-list__reply-btn,
  .attachment-card__remove,
  .relation-list__remove {
    opacity: 1;
  }
  .task-list-row__open {
    color: var(--color-text-muted);
  }
  .item-list__drag {
    display: block;
  }
}
