/* Kotorello — design tokens from "Kanban App.dc.html" (turn 1: светлый минимализм) */

:root {
  --bg:        #F2F1ED;
  --surface:   #FCFCFB;
  --surface-2: #FAF9F6;
  --white:     #FFFFFF;

  --ink:     #14130F;
  --ink-2:   #3C3931;
  --ink-3:   #4A463D;
  --muted:   #6E6A5F;
  --muted-2: #8A8578;
  --muted-3: #9C9788;
  --faint:   #B4AFA2;
  --faint-2: #C6C1B4;

  --line:      #E4E1DA;
  --line-2:    #EDEAE3;
  --line-3:    #F1EFE9;
  --line-card: #E7E4DD;
  --dash:      #DEDAD1;
  --sel:       #EFEDE6;

  --blue:   #6E93B8;
  --green:  #7BA37B;
  --gold:   #C9A24A;
  --purple: #8B7BA8;
  --rose:   #C07D82;

  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Helvetica Neue', Helvetica, Arial, system-ui, sans-serif;

  --r-sm: 4px; --r: 6px; --r-md: 7px; --r-lg: 8px; --r-xl: 10px;
  --shadow-1: 0 1px 2px rgba(20,19,15,.04);
  --shadow-2: 0 8px 28px rgba(20,19,15,.08);

  --sidebar-w: 248px;
  --topbar-h: 56px;
}

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

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

a { color: #2F5D8C; text-decoration: none; }
a:hover { color: var(--ink); text-decoration: underline; }

button, input, textarea, select { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 3px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 0 0 var(--r) 0;
}
.skip-link:focus { left: 0; }

.noscript {
  position: fixed; inset: 0; display: grid; place-items: center;
  background: var(--bg); font-size: 15px; padding: 24px; text-align: center;
}

/* ---------- primitives ---------- */

.mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted-3);
}
.mono-sm { font-family: var(--mono); font-size: 11px; color: var(--muted-3); letter-spacing: .04em; }

.label {
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted-2);
}

.dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }

.btn {
  appearance: none; cursor: pointer;
  font-size: 13px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--white); color: var(--ink-3);
  padding: 7px 13px; line-height: 1.4;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.btn:hover { border-color: var(--faint); background: var(--surface-2); }
.btn:active { transform: translateY(.5px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.btn-primary { background: var(--ink); color: var(--surface); border-color: var(--ink); font-weight: 500; }
.btn-primary:hover { background: #2A2823; border-color: #2A2823; color: var(--surface); }

.btn-danger { color: var(--rose); border-color: transparent; background: transparent; padding-left: 0; }
.btn-danger:hover { background: transparent; border-color: transparent; text-decoration: underline; color: var(--rose); }

.btn-ghost { border-color: transparent; background: transparent; color: var(--muted-3); }
.btn-ghost:hover { background: var(--sel); border-color: transparent; color: var(--ink-3); }

.btn-block { width: 100%; text-align: center; padding: 13px; font-size: 14px; }

.input, .textarea, .select {
  width: 100%;
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 12px 14px; font-size: 14px; background: var(--white); color: var(--ink);
  transition: border-color .12s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--ink); border-width: 1.5px; padding: 11.5px 13.5px;
}
.textarea { min-height: 70px; line-height: 1.5; resize: vertical; }
.select { appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23B4AFA2' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}

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

.avatar {
  border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; line-height: 1; user-select: none;
  width: 28px; height: 28px;
}
.avatar-xs { width: 22px; height: 22px; font-size: 9px; }
.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.avatar-md { width: 32px; height: 32px; font-size: 11px; }
.avatar-lg { width: 60px; height: 60px; font-size: 18px; }

.stack { display: flex; }
.stack .avatar { border: 2px solid var(--surface); }
.stack .avatar + .avatar { margin-left: -8px; }

.tag {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 20px; padding: 7px 13px;
  font-size: 13px; background: var(--white); cursor: pointer;
}
.tag:hover { border-color: var(--faint); }
.tag .caret { color: var(--faint); }

.badge {
  font-family: var(--mono); font-size: 10px; color: var(--muted-3);
  border: 1px solid var(--line-card); border-radius: var(--r-sm); padding: 2px 6px;
  letter-spacing: .04em;
}

.divider-v { width: 1px; height: 22px; background: var(--line-2); flex: none; }

/* ---------- logo ---------- */

.logo { position: relative; padding-top: 9px; flex: none; display: inline-block; }
.logo .ear { position: absolute; top: 0; width: 7px; height: 7px; background: var(--ink); }
.logo .ear-l { left: 3px; clip-path: polygon(0% 100%, 18% 0%, 100% 88%); }
.logo .ear-r { left: 17px; clip-path: polygon(100% 100%, 82% 0%, 0% 88%); }
.logo .word { font-size: 15px; font-weight: 500; letter-spacing: -.01em; line-height: 1.1; color: var(--ink); }

.logo-sm { padding-top: 8px; }
.logo-sm .ear { width: 6px; height: 6px; }
.logo-sm .ear-l { left: 3px; }
.logo-sm .ear-r { left: 15px; }
.logo-sm .word { font-size: 13px; }

.logo-lg { padding-top: 11px; }
.logo-lg .ear { width: 9px; height: 9px; }
.logo-lg .ear-l { left: 4px; }
.logo-lg .ear-r { left: 22px; }
.logo-lg .word { font-size: 19px; }

/* ---------- app shell ---------- */

.shell {
  height: 100dvh;
  display: flex;
  background: var(--surface);
}

.sidebar {
  width: var(--sidebar-w); flex: none;
  border-right: 1px solid var(--line-2);
  display: flex; flex-direction: column;
  background: var(--surface-2);
}
.sidebar-head {
  height: var(--topbar-h); flex: none;
  display: flex; align-items: center; padding: 0 18px;
  border-bottom: 1px solid var(--line-2);
}
.nav { padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-title { padding: 0 8px 8px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: var(--r); font-size: 14px; color: var(--ink-3);
  background: none; border: 0; width: 100%; text-align: left; cursor: pointer;
  text-decoration: none;
}
.nav-item:hover { background: #F4F2EC; color: var(--ink); text-decoration: none; }
.nav-item.is-active { background: var(--sel); color: var(--ink); font-weight: 500; }
.nav-boards { padding: 6px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; overflow-y: auto; }
.nav-boards-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 8px; }
.sidebar-foot {
  border-top: 1px solid var(--line-2); padding: 12px;
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit;
  background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; cursor: pointer;
}
.sidebar-foot:hover { background: #F4F2EC; text-decoration: none; color: inherit; }
.sidebar-foot .name { font-size: 13px; font-weight: 500; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: var(--topbar-h); flex: none;
  border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; gap: 16px;
}
.topbar h1 { font-size: 17px; font-weight: 500; letter-spacing: -.01em; margin: 0; }
.topbar-left { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 14px; }

.search {
  width: 200px; padding: 6px 12px; font-size: 13px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--white);
}

.content { flex: 1; min-height: 0; overflow: auto; padding: 26px 24px; }

/* ---------- board ---------- */

.board-scroller {
  flex: 1; min-height: 0;
  display: flex; gap: 12px; padding: 22px 24px; align-items: flex-start;
  overflow-x: auto; overflow-y: hidden;
}

.column {
  width: 240px; flex: none; max-height: 100%;
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  overflow: hidden; display: flex; flex-direction: column;
}
.column-head {
  padding: 11px 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  color: #fff; flex: none;
}
.column-head .title { font-size: 13px; font-weight: 500; color: #fff; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.column-head .count { font-family: var(--mono); font-size: 11px; color: rgba(255,255,255,.8); }
.column-head .col-menu {
  background: none; border: 0; color: rgba(255,255,255,.8); cursor: pointer; padding: 0 2px; line-height: 1; font-size: 14px;
}
.column-body {
  display: flex; flex-direction: column; gap: 8px; padding: 12px;
  overflow-y: auto; min-height: 46px;
}
.column.is-dropping { border-color: var(--ink); }
.column.is-dropping .column-body { background: rgba(20,19,15,.03); }

/* шапка колонки — ручка для смены порядка колонок */
.column-head[draggable="true"] { cursor: grab; }
.column-head[draggable="true"]:active { cursor: grabbing; }
.column.is-col-dragging { opacity: .45; }

.card {
  background: var(--white); border: 1px solid var(--line-card); border-radius: var(--r);
  padding: 12px 13px; font-size: 14px; line-height: 1.35;
  text-align: left; width: 100%; cursor: pointer; display: block;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.card:hover { border-color: var(--faint); box-shadow: var(--shadow-1); }
.card.is-done { color: var(--muted); }
.card.is-dragging { opacity: .4; }
.card-meta { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.card-meta .mono-sm { font-size: 10px; }

.add-inline {
  font-size: 13px; color: var(--muted-3); padding: 6px 3px; text-align: left;
  background: none; border: 0; cursor: pointer; border-radius: var(--r-sm);
}
.add-inline:hover { color: var(--ink-3); }

.column-new {
  width: 132px; flex: none; align-self: flex-start;
  border: 1px dashed var(--dash); border-radius: var(--r-lg); padding: 14px;
  font-size: 13px; line-height: 1.35; color: var(--muted-3);
  background: none; cursor: pointer; text-align: left;
}
.column-new:hover { border-color: var(--faint); color: var(--ink-3); }

/* ---------- boards grid ---------- */

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

.board-card {
  border: 1px solid var(--line-card); border-radius: var(--r-lg); overflow: hidden;
  background: var(--white); text-align: left; cursor: pointer; padding: 0; display: block;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.board-card:hover { border-color: var(--faint); box-shadow: var(--shadow-1); }
.board-card .stripe { height: 6px; }
.board-card .body { padding: 16px; display: flex; flex-direction: column; gap: 26px; }
.board-card .name { font-size: 15px; font-weight: 500; }
.board-card .sub { font-size: 13px; color: var(--muted-2); }
.board-card .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.board-new {
  border: 1px dashed var(--dash); border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--muted-3); min-height: 132px;
  background: none; cursor: pointer;
}
.board-new:hover { border-color: var(--faint); color: var(--ink-3); }

.section { display: flex; flex-direction: column; gap: 14px; }
.section + .section { border-top: 1px solid var(--line-2); padding-top: 24px; margin-top: 26px; }

.row-list { display: flex; flex-direction: column; }
.row-item {
  display: flex; align-items: center; gap: 14px; padding: 12px 0;
  border-bottom: 1px solid var(--line-3); font-size: 14px;
  background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; cursor: pointer;
}
.row-item:last-child { border-bottom: 0; }
.row-item:hover { background: var(--surface-2); }
.row-item .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-item .where { font-size: 13px; color: var(--muted-2); }

/* ---------- tables (members / logs / matrix) ---------- */

.table { display: flex; flex-direction: column; }
.table .thead, .table .trow { display: grid; gap: 16px; align-items: center; }
.table .thead {
  padding-bottom: 11px; border-bottom: 1px solid var(--line-2);
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-3);
}
.table .trow { padding: 14px 0; border-bottom: 1px solid var(--line-3); font-size: 13px; }
.table .trow:last-child { border-bottom: 0; }

.members-cols { grid-template-columns: 1.5fr 1fr 180px 130px 40px; }
.logs-cols { grid-template-columns: 130px 190px 1fr 190px 140px; }
.matrix-cols { grid-template-columns: 1fr 60px 60px 60px 70px; gap: 8px; }

.person { display: flex; align-items: center; gap: 11px; min-width: 0; }
.person .pname { font-size: 14px; font-weight: 500; }
.person .pmail { font-size: 12px; color: var(--muted-2); }

.role-cards { display: flex; gap: 14px; flex-wrap: wrap; }
.role-card {
  flex: 1 1 200px; border: 1px solid var(--line-card); border-radius: var(--r-lg);
  padding: 16px; background: var(--white); display: flex; flex-direction: column; gap: 8px;
}
.role-card .rname { font-size: 14px; font-weight: 500; }
.role-card .rdesc { font-size: 13px; line-height: 1.5; color: var(--muted); }

.log-group { display: flex; flex-direction: column; }
.log-group + .log-group { margin-top: 20px; }
.log-group .glabel {
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted-3); padding-bottom: 8px;
}
.log-row { border-top: 1px solid var(--line-3); border-bottom: 0 !important; padding: 11px 0 !important; }
.log-time { font-family: var(--mono); font-size: 12px; color: var(--muted); }

.matrix .trow { padding: 10px 0; border-top: 1px solid var(--line-3); border-bottom: 0; }
.matrix .no { color: var(--faint-2); }

/* ---------- auth ---------- */

.auth-page { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.auth-card {
  width: 520px; max-width: 100%; min-height: 540px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
  display: flex; flex-direction: column; justify-content: center; padding: 48px 60px; gap: 28px;
  position: relative;
}
/* невидимый угол: пять быстрых кликов — ссылка для входа владельцу сервиса */
.owner-corner { position: absolute; top: 0; right: 0; width: 56px; height: 56px; user-select: none; }
.auth-card h1 { font-size: 24px; font-weight: 500; letter-spacing: -.02em; margin: 6px 0 0; }
.auth-card .lede { font-size: 14px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.auth-note {
  border: 1px solid var(--line-2); background: var(--surface-2); border-radius: var(--r-lg);
  padding: 16px; display: flex; flex-direction: column; gap: 8px;
}
.auth-fine { font-size: 13px; line-height: 1.5; color: var(--muted-2); text-wrap: pretty; }
.auth-error { font-size: 13px; color: var(--rose); }

/* ---------- modal ---------- */

.overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(20,19,15,.34);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 20px; overflow-y: auto;
  animation: fade .14s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

.modal {
  width: 560px; max-width: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
  overflow: hidden; box-shadow: var(--shadow-2);
  animation: pop .16s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }

.modal-wide { width: 880px; }
.modal-head {
  min-height: 46px; border-bottom: 1px solid var(--line-2); background: var(--surface-2);
  display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 20px;
}
.modal-head .right { display: flex; align-items: center; gap: 14px; }
.modal-close {
  background: none; border: 0; font-size: 18px; line-height: 1; color: var(--muted-3);
  cursor: pointer; padding: 4px 2px;
}
.modal-close:hover { color: var(--ink); }
.modal-accent { height: 4px; }
.modal-body { padding: 24px 26px 26px; display: flex; flex-direction: column; gap: 22px; }
.modal-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  border-top: 1px solid var(--line-2); padding-top: 18px;
}
.modal-foot .hint { font-size: 13px; color: var(--muted-2); }
.modal-foot .actions { display: flex; gap: 10px; }

.modal-split { display: flex; align-items: stretch; }
.modal-split .primary { flex: 1; min-width: 0; padding: 26px 28px 30px; display: flex; flex-direction: column; gap: 24px; }
.modal-split .aside {
  width: 264px; flex: none; border-left: 1px solid var(--line-2); background: var(--surface-2);
  padding: 26px 22px; display: flex; flex-direction: column; gap: 22px;
}

.block { display: flex; flex-direction: column; gap: 9px; }
.block-sep { border-top: 1px solid var(--line-2); padding-top: 20px; }

/* task attachments */
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.shot { display: flex; flex-direction: column; gap: 7px; }
.shot .frame {
  height: 126px; border: 1px solid var(--line-card); border-radius: var(--r-md); overflow: hidden;
  background: repeating-linear-gradient(45deg, #F4F3EF 0 7px, #FAF9F6 7px 14px);
  display: flex; align-items: center; justify-content: center; position: relative;
  cursor: zoom-in; padding: 0;
}
.shot .frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot .cap { font-family: var(--mono); font-size: 10px; color: var(--muted-3); display: flex; justify-content: space-between; gap: 6px; }
.shot .cap span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shot .cap button { background: none; border: 0; color: var(--faint); cursor: pointer; font: inherit; }
.shot .cap button:hover { color: var(--rose); }
.shot .frame.file-preview, .comment .shot-thumb.file-preview {
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px;
  padding: 10px; background: var(--surface-2); color: var(--ink-2); text-decoration: none; cursor: pointer;
}
.comment .shot-thumb.file-preview { min-height: 98px; }
.shot .frame.file-preview:hover, .comment .shot-thumb.file-preview:hover { border-color: var(--ink); }
.file-badge, .draft-pdf {
  display: inline-block; border-radius: var(--r-sm); padding: 7px 10px;
  background: var(--ink); color: #fff; font: 600 12px var(--mono); letter-spacing: .04em;
}
.file-name { max-width: 100%; max-height: 2.8em; overflow: hidden; overflow-wrap: anywhere; text-align: center; font-size: 11px; line-height: 1.4; }

.dropzone {
  height: 126px; border: 1px dashed var(--dash); border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 0 12px;
  font-size: 13px; line-height: 1.4; color: var(--muted-3);
  background: none; cursor: pointer; width: 100%;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--ink); color: var(--ink-3); }

.comment { display: flex; gap: 11px; }
.comment .who { font-size: 13px; }
.comment .who strong { font-weight: 500; }
.comment .who span { color: var(--muted-2); }
.comment .text { font-size: 14px; line-height: 1.5; color: var(--ink-2); white-space: pre-wrap; }
.comment .shot-thumb { width: 150px; border: 1px solid var(--line-card); border-radius: var(--r); overflow: hidden; padding: 0; background: none; cursor: zoom-in; }
.comment .shot-thumb img { width: 100%; display: block; }

/* файл, приложенный к комментарию до отправки */
.comment-draft {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2);
  padding: 8px 10px;
}
.comment-draft img { width: 54px; height: 36px; object-fit: cover; border-radius: var(--r-sm); flex: none; }
.comment-draft .mono-sm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comment-draft button { font-size: 12px; padding: 4px 8px; }

.history { display: flex; flex-direction: column; gap: 9px; font-size: 12px; line-height: 1.45; color: var(--muted); }
.history strong { color: var(--ink); font-weight: 400; }

.choice {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  border: 1px solid var(--line-card); border-radius: var(--r-lg); padding: 14px;
  background: var(--white); cursor: pointer;
}
.choice:hover { border-color: var(--faint); }
.choice.is-on { border-color: var(--ink); }
.choice .radio { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--dash); flex: none; }
.choice.is-on .radio { border: 5px solid var(--ink); }
.choice .ctitle { font-size: 14px; font-weight: 500; }
.choice .cdesc { font-size: 13px; color: var(--muted); }

.switch {
  width: 38px; height: 22px; border-radius: 11px; background: var(--line); padding: 2px;
  display: flex; border: 0; cursor: pointer; flex: none; transition: background .14s ease;
}
.switch .knob { width: 18px; height: 18px; border-radius: 50%; background: var(--surface); transition: transform .14s ease; }
.switch.is-on { background: var(--ink); }
.switch.is-on .knob { transform: translateX(16px); }

.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.lightbox {
  position: fixed; inset: 0; z-index: 60; background: rgba(20,19,15,.8);
  display: grid; place-items: center; padding: 40px; cursor: zoom-out;
}
.lightbox img { max-width: 100%; max-height: 100%; border-radius: var(--r-lg); }

.toast-root {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--ink); color: var(--surface); font-size: 13px;
  padding: 10px 16px; border-radius: var(--r); box-shadow: var(--shadow-2);
  animation: pop .16s ease;
}

.empty {
  border: 1px dashed var(--dash); border-radius: var(--r-lg);
  padding: 40px 24px; text-align: center; color: var(--muted-3); font-size: 14px; line-height: 1.6;
}

/* ---------- API и интеграции ---------- */

code {
  font-family: var(--mono); font-size: 12px;
  background: var(--sel); border-radius: var(--r-sm); padding: 2px 5px;
  color: var(--ink-2); word-break: break-all;
}

pre {
  font-family: var(--mono); font-size: 12px; line-height: 1.6;
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-md);
  padding: 14px 16px; margin: 0; overflow-x: auto; color: var(--ink-2);
  white-space: pre; tab-size: 2;
}
pre code { background: none; padding: 0; }

.token-list { display: flex; flex-direction: column; gap: 14px; }

.token {
  border: 1px solid var(--line-card); border-radius: var(--r-lg); background: var(--white);
  overflow: hidden;
}
.token.is-revoked { opacity: .6; background: var(--surface-2); }

.token-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 16px; border-bottom: 1px solid var(--line-3); flex-wrap: wrap;
}
.token-name { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; flex-wrap: wrap; }
.token-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.token-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px; padding: 16px;
}
.token-fact { display: flex; flex-direction: column; gap: 5px; min-width: 0; font-size: 13px; }
.token-fact > span:last-child { color: var(--ink-2); overflow-wrap: anywhere; }

.token-deliveries { border-top: 1px solid var(--line-3); padding: 4px 16px 12px; background: var(--surface-2); }
.deliveries-cols { grid-template-columns: 150px 130px 100px 1fr 110px; }

.secret {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--white);
  padding: 10px 12px;
}
.secret code { flex: 1; background: none; padding: 0; font-size: 13px; }

.docs { display: flex; flex-direction: column; gap: 22px; }
.doc-block { display: flex; flex-direction: column; gap: 10px; }
.doc-block h3 { font-size: 15px; font-weight: 500; margin: 0; letter-spacing: -.01em; }
.doc-block p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--muted); text-wrap: pretty; }

/* ---------- инстансы (владелец сервиса) ---------- */

.instances-cols { grid-template-columns: 1.6fr 90px 130px 130px 130px 1fr 190px; }
.instances-cols .pname { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.trow.is-off { opacity: .62; }
.trow.is-off .pname { text-decoration: line-through; text-decoration-thickness: 1px; }

.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.total-card {
  border: 1px solid var(--line-card); border-radius: var(--r-lg); background: var(--white);
  padding: 16px; display: flex; flex-direction: column; gap: 6px;
}
.total-card .num { font-size: 26px; font-weight: 500; letter-spacing: -.02em; }

@media (max-width: 860px) {
  .instances-cols { grid-template-columns: 1fr !important; }
  .trow.instances-cols > div { padding: 2px 0; }
}

.readonly-banner {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border-bottom: 1px solid var(--line-2);
  padding: 9px 24px; font-size: 13px; color: var(--muted);
}

/* ---------- лайтинг ---------- */

.btn-bolt { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); }

/* «Вселенная» — ссылка на карту пространства, поэтому это <a>, а не кнопка.
   В шапке она иконкой: подпись увела бы место у «Доступа» и «Новой задачи». */
.btn-orbit {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 7px 9px; color: var(--muted); text-decoration: none;
}
.btn-orbit:hover { color: var(--ink); text-decoration: none; }

/* та же иконка в шапке «Лайтинга» на телефоне */
.lite-orbit { display: inline-flex; align-items: center; color: var(--muted); text-decoration: none; }
.lite-orbit:hover { color: var(--ink); text-decoration: none; }

.lighting-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.lighting-side { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lighting-head { display: flex; flex-direction: column; gap: 3px; padding-bottom: 6px; }
.lighting-space { padding: 10px 2px 4px; }
.lighting-board {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 42px;
  border: 1px solid var(--line-card); border-radius: var(--r); background: var(--white);
  padding: 10px 12px; font-size: 14px; color: var(--ink-3); text-align: left; cursor: pointer;
}
.lighting-board:hover { border-color: var(--faint); }
.lighting-board.is-on { border-color: var(--ink); color: var(--ink); font-weight: 500; }
.lighting-board .bname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lighting-empty { font-size: 13px; color: var(--muted-2); padding: 8px 2px; }

.lighting-form {
  display: flex; flex-direction: column; gap: 12px;
  border-top: 1px solid var(--line-2); padding-top: 18px;
}
.lighting-target { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 14px; color: var(--ink-3); }
/* в форме быстрой постановки дропзона — узкая полоска, а не окно на пол-экрана */
.lighting-form .dropzone { height: 58px; }
.lighting-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lighting-foot .actions { display: flex; gap: 10px; }
.lighting-think { display: flex; align-items: center; gap: 9px; font-size: 14px; cursor: pointer; }
.lighting-think input { width: 17px; height: 17px; accent-color: var(--ink); cursor: pointer; }
.lighting-hint { font-size: 13px; line-height: 1.5; color: var(--muted-2); }
.lighting-pickme { border-top: 1px solid var(--line-2); padding-top: 18px; }

.lighting-phone {
  display: flex; flex-direction: column; gap: 10px;
  border-top: 1px solid var(--line-2); padding-top: 18px;
}
.lighting-phone-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lighting-phone-row .actions { display: flex; gap: 10px; }
.lighting-url { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lighting-url code {
  flex: 1; min-width: 220px; overflow-x: auto; white-space: nowrap;
  font-family: var(--mono); font-size: 12px; color: var(--ink-3);
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: 9px 11px;
}

/* тот же «Лайтинг» отдельной страницей — /pwa/, иконка на телефоне */
.lite { min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
.lite-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) 18px 12px;
  border-bottom: 1px solid var(--line-2); background: var(--surface);
}
.lite-body {
  flex: 1; display: flex; flex-direction: column; gap: 18px;
  padding: 18px 18px calc(28px + env(safe-area-inset-bottom));
  max-width: 900px; width: 100%; margin: 0 auto;
}
.lite-card {
  display: flex; flex-direction: column; gap: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 22px 20px;
}
.lite-sent {
  display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted);
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface-2); padding: 10px 12px;
}

/* ---------- mobile (1l) ---------- */

.mobile-tabs, .mobile-nav, .mobile-head { display: none; }

@media (max-width: 860px) {
  .sidebar { display: none; }

  .mobile-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 18px 12px; border-bottom: 1px solid var(--line-2); flex: none;
  }

  .topbar {
    height: auto; min-height: 0; padding: 14px 18px 12px;
    align-items: flex-start; flex-direction: column; gap: 8px; border-bottom: 0;
  }
  .topbar h1 { font-size: 18px; letter-spacing: -.015em; }
  .topbar-right { width: 100%; flex-wrap: wrap; }
  .search { width: 100%; }

  .content { padding: 16px 18px 90px; }

  .mobile-tabs {
    display: flex; gap: 8px; padding: 6px 18px 14px;
    border-bottom: 1px solid var(--line-2); overflow-x: auto; flex: none;
    scrollbar-width: none;
  }
  .mobile-tabs::-webkit-scrollbar { display: none; }
  .mobile-tab {
    display: flex; align-items: center; gap: 7px; flex: none;
    border: 1px solid var(--line-card); border-radius: 18px; padding: 8px 13px;
    font-size: 13px; color: var(--muted); background: var(--white); cursor: pointer;
  }
  .mobile-tab.is-active { border-color: var(--ink); color: var(--ink); font-weight: 500; }

  .board-scroller { display: block; padding: 16px 18px 90px; overflow-y: auto; }
  .column {
    width: 100%; max-height: none; border: 0; background: none;
    display: flex; flex-direction: column; gap: 10px;
  }
  .column:not(.is-mobile-active) { display: none; }
  .column-head { display: none; }
  .column-body { padding: 0; gap: 10px; overflow: visible; }
  .card { padding: 16px; font-size: 15px; line-height: 1.4; min-height: 48px; }
  .add-inline { border: 1px dashed var(--dash); border-radius: var(--r-lg); padding: 16px; font-size: 14px; }
  .column-new { display: none; }

  .mobile-nav {
    display: flex; justify-content: space-around; align-items: stretch;
    border-top: 1px solid var(--line-2); background: var(--surface);
    padding: 12px 0 max(20px, env(safe-area-inset-bottom));
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  }
  .mobile-nav a {
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    min-height: 44px; justify-content: center; flex: 1; text-decoration: none; color: var(--muted-2); font-size: 11px;
  }
  .mobile-nav a .glyph { width: 20px; height: 20px; border-radius: 5px; background: var(--line); }
  .mobile-nav a.is-active { color: var(--ink); }
  .mobile-nav a.is-active .glyph { background: var(--ink); }

  .overlay { padding: 0; align-items: stretch; }
  .modal, .modal-wide { width: 100%; max-width: 100%; border: 0; border-radius: 0; min-height: 100dvh; }
  .modal-split { flex-direction: column; }
  .modal-split .aside { width: 100%; border-left: 0; border-top: 1px solid var(--line-2); }
  .modal-body { padding: 20px 18px 32px; }
  .modal-split .primary { padding: 20px 18px 24px; }

  .auth-card { min-height: 0; padding: 32px 24px; border: 0; border-radius: 0; background: transparent; }

  .table .thead { display: none; }
  .table .trow, .members-cols, .logs-cols {
    grid-template-columns: 1fr !important; gap: 8px; padding: 16px 0;
  }
  .matrix-cols { grid-template-columns: 1fr 44px 44px 44px 52px !important; gap: 6px; font-size: 12px; }
  .matrix .thead { display: grid !important; font-size: 9px; }

  .token-head { flex-direction: column; align-items: flex-start; }
  .token-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .deliveries-cols { grid-template-columns: 1fr !important; }
  pre { font-size: 11px; padding: 12px; }

  .role-cards { flex-direction: column; }
  .boards-grid { grid-template-columns: 1fr; }

  .lighting-grid { grid-template-columns: 1fr; gap: 22px; }
  .lighting-foot { flex-direction: column; align-items: stretch; }
  .lighting-foot .actions { justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

@media print {
  .sidebar, .mobile-nav, .topbar-right, .toast-root { display: none !important; }
  body { background: #fff; }
}

/* SHAKIROVA STUDIO board 48: readable ink for the preview palette. */
:is(.column[data-column="179"],
.column[data-column="180"],
.column[data-column="181"],
.column[data-column="182"],
.column[data-column="183"],
.column[data-column="184"]) .column-head {color:#17213B;}
:is(.column[data-column="179"],
.column[data-column="180"],
.column[data-column="181"],
.column[data-column="182"],
.column[data-column="183"],
.column[data-column="184"]) .column-head :is(.title,.count,.col-menu) {color:inherit;}
