/* ─── Команда Эли · премиум-слой (брендбук dzhobava) ─── */

@font-face {
  font-family: 'Manrope';
  src: url('/static/fonts/Manrope-var.ttf') format('truetype');
  font-weight: 200 800;
  font-display: swap;
}

* { box-sizing: border-box; margin: 0; }
:root {
  --cream: #FAF7F2;
  --panel: #FFFFFF;
  --ink: #2A2336;
  --muted: #7A6F88;
  --line: #ECE4F2;
  --violet: #563D87;
  --violet-deep: #452F70;
  --lavender: #B395DB;
  --lavender-soft: #F0DCFF;
  --sage: #E6F4C6;
  --green: #24483E;
  --blue-soft: #D3E9FF;
  --blue: #2C69A2;
  --terra: #BD7363;
  --terra-soft: #F6E4DC;
  --shadow-soft: 0 1px 2px rgba(42,35,54,.04), 0 14px 36px -16px rgba(86,61,135,.14);
  --shadow-lift: 0 2px 4px rgba(42,35,54,.05), 0 22px 48px -18px rgba(86,61,135,.22);
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
}
body {
  font-family: 'Manrope', system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ─── Топбар ─── */
.topbar {
  display: flex; align-items: center; gap: 28px; padding: 14px 26px;
  background: rgba(253,247,235,.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand {
  font-weight: 800; font-size: 16px; letter-spacing: -0.02em;
  text-decoration: none; color: var(--violet);
}
.me { display: flex; align-items: center; gap: 10px; }
.me-line { display: flex; gap: 8px; align-items: center; font-size: 13.5px; }
.me-line b { font-weight: 700; }
.me-title {
  color: var(--violet); font-size: 11px; font-weight: 800;
  background: var(--lavender-soft); border-radius: 999px; padding: 3px 10px;
  white-space: nowrap;
}
.xpbar {
  width: 90px; height: 4px; background: rgba(42,35,54,.08); border-radius: 2px;
  overflow: hidden; flex-shrink: 0;
}
.xpbar-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--violet), var(--lavender));
  transition: width .8s var(--ease);
}
nav { margin-left: auto; display: flex; gap: 4px; }
nav a {
  color: var(--ink); text-decoration: none; font-size: 13.5px; font-weight: 600;
  padding: 7px 13px; border-radius: 999px;
  transition: background .35s var(--ease), color .35s var(--ease);
}
nav a:hover { background: var(--lavender-soft); color: var(--violet); }
main { padding: 22px 26px 60px; max-width: 1480px; margin: 0 auto; }

/* ─── Layout: сайдбар + доска ─── */
.layout { display: flex; gap: 22px; align-items: flex-start; }
.sidebar {
  width: 212px; flex-shrink: 0; position: sticky; top: 82px;
  display: flex; flex-direction: column; gap: 2px;
}
.side-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 13px; border-radius: 10px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--ink);
  border: 1px solid transparent;
  transition: background .35s var(--ease), color .35s var(--ease);
}
.side-item:hover { background: rgba(255,255,255,.75); }
.side-item.active {
  background: var(--panel); color: var(--violet);
  border-color: var(--line); box-shadow: var(--shadow-soft);
}
.side-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-badge {
  background: var(--terra); color: #fff; font-size: 10.5px; font-weight: 800;
  border-radius: 999px; min-width: 19px; height: 19px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
}
.side-act {
  border: 0; background: none; cursor: pointer; font-size: 12px;
  color: var(--muted); padding: 2px 3px; border-radius: 6px;
  transition: color .3s var(--ease);
}
.side-act:hover { color: var(--violet); }
.side-add {
  margin-top: 10px; border: 1px dashed var(--lavender); background: none;
  color: var(--violet); font: inherit; font-size: 13px; font-weight: 700;
  padding: 9px 13px; border-radius: 10px; cursor: pointer;
  transition: background .35s var(--ease), border-color .35s var(--ease);
}
.side-add:hover { background: var(--lavender-soft); border-color: var(--violet); }
.board-main { flex: 1; min-width: 0; }

/* ─── Табы видов ─── */
.view-tabs {
  display: inline-flex; gap: 2px; padding: 3px;
  background: rgba(42,35,54,.05); border-radius: 999px; margin-bottom: 14px;
}
.tab {
  border: 0; background: none; font: inherit; font-size: 13px; font-weight: 700;
  color: var(--muted); padding: 7px 18px; border-radius: 999px; cursor: pointer;
  transition: color .35s var(--ease), background .35s var(--ease), box-shadow .35s var(--ease);
}
.tab.active { background: var(--panel); color: var(--violet); box-shadow: var(--shadow-soft); }

.board-tools { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; flex-wrap: wrap; }
.week-top { font-size: 13px; color: var(--muted); font-weight: 600; }
.mine-toggle { font-size: 13.5px; color: var(--muted); user-select: none; font-weight: 600; }
.mine-toggle input { accent-color: var(--violet); }

/* ─── Кнопки ─── */
.btn-primary {
  background: var(--violet); color: #fff; border: 0; border-radius: 999px;
  padding: 9px 20px; font: inherit; font-size: 13.5px; font-weight: 700;
  cursor: pointer; text-decoration: none; display: inline-block;
  box-shadow: 0 8px 20px -8px rgba(86,61,135,.5);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .35s var(--ease);
}
.btn-primary:hover { background: var(--violet-deep); transform: translateY(-1px); box-shadow: 0 12px 26px -8px rgba(86,61,135,.55); }
.btn-primary:active { transform: scale(.98); }
.btn-danger {
  background: none; border: 1px solid var(--terra); color: var(--terra);
  border-radius: 999px; padding: 9px 18px; font: inherit; font-size: 13.5px;
  font-weight: 700; cursor: pointer;
  transition: background .35s var(--ease), color .35s var(--ease);
}
.btn-danger:hover { background: var(--terra-soft); }

/* ─── Доска ─── */
.board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.column {
  border: 1px solid var(--line); border-radius: 18px; padding: 10px;
  min-height: 320px; background: rgba(255,255,255,.55);
}
.col-head {
  font-size: 11px; font-weight: 800; color: var(--muted);
  text-transform: uppercase; letter-spacing: .14em; padding: 8px 10px 10px;
}
.col-head span {
  font-weight: 700; color: var(--violet); background: rgba(255,255,255,.9);
  border-radius: 999px; padding: 1px 8px; margin-left: 4px;
  border: 1px solid var(--line);
}
.col-list { display: flex; flex-direction: column; gap: 9px; min-height: 200px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card-task {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 14px; cursor: pointer;
  box-shadow: var(--shadow-soft);
  animation: rise .45s var(--ease) both;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.col-list .card-task:nth-child(2) { animation-delay: .04s; }
.col-list .card-task:nth-child(3) { animation-delay: .08s; }
.col-list .card-task:nth-child(4) { animation-delay: .12s; }
.col-list .card-task:nth-child(n+5) { animation-delay: .16s; }
.card-task:hover {
  border-color: var(--lavender); transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}
.card-title { font-size: 14.5px; font-weight: 600; margin-bottom: 9px; line-height: 1.4; letter-spacing: -0.01em; }
.card-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; flex-wrap: wrap; }
.avatar {
  width: 23px; height: 23px; border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--lavender));
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 9.5px; font-weight: 800; letter-spacing: .02em;
}
.deadline { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.deadline-soon { color: var(--violet); font-weight: 800; }
.deadline-over { color: var(--terra); font-weight: 800; }
.ccount { color: var(--muted); font-weight: 600; }
.chip-project {
  background: var(--lavender-soft); color: var(--violet);
  border-radius: 999px; padding: 2px 9px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .02em;
}
.movers { margin-left: auto; display: none; gap: 3px; }
.mv {
  border: 1px solid var(--line); background: var(--panel); border-radius: 8px;
  cursor: pointer; padding: 1px 9px; color: var(--muted); font-size: 13px;
  transition: color .3s var(--ease), border-color .3s var(--ease);
}
.mv:hover { color: var(--violet); border-color: var(--lavender); }

/* ─── Неделя ─── */
.week-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.week-nav button {
  border: 1px solid var(--line); background: var(--panel); border-radius: 999px;
  font: inherit; font-size: 13px; font-weight: 700; color: var(--ink);
  padding: 6px 14px; cursor: pointer;
  transition: color .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease);
}
.week-nav button:hover { color: var(--violet); border-color: var(--lavender); transform: translateY(-1px); }
.week-range { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.day {
  background: rgba(255,255,255,.6); border: 1px solid var(--line);
  border-radius: 14px; padding: 10px; min-height: 180px;
}
.day.today {
  border-color: var(--lavender); background: var(--panel);
  box-shadow: var(--shadow-soft);
}
.day-head {
  font-size: 10.5px; font-weight: 800; color: var(--muted);
  text-transform: uppercase; letter-spacing: .12em; margin-bottom: 9px;
}
.day.today .day-head { color: var(--violet); }
.mini-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 7px 9px; font-size: 12px; font-weight: 600; cursor: pointer;
  margin-bottom: 6px; box-shadow: var(--shadow-soft);
  transition: transform .3s var(--ease), border-color .3s var(--ease);
}
.mini-card:hover { transform: translateY(-1px); border-color: var(--lavender); }
.mini-title { line-height: 1.35; }
.mini-meta { display: flex; align-items: center; gap: 7px; margin-top: 6px; }
.mini-meta .avatar { width: 19px; height: 19px; font-size: 8px; }
.dim { opacity: .45; }

/* ─── Модалка ─── */
dialog {
  border: 1px solid var(--line); border-radius: 18px; padding: 0;
  width: min(580px, 92vw);
  background: var(--panel);
  box-shadow: 0 30px 80px -24px rgba(42,35,54,.3);
}
dialog::backdrop { background: rgba(42,35,54,.4); backdrop-filter: blur(6px); }
.modal-body {
  background: var(--panel); border-radius: 18px; padding: 22px;
  display: flex; flex-direction: column; gap: 12px;
}
.modal-body input, .modal-body textarea, .modal-body select {
  font: inherit; font-size: 14px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 10px; width: 100%;
  background: var(--panel); color: var(--ink);
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.modal-body input:focus, .modal-body textarea:focus, .modal-body select:focus {
  outline: none; border-color: var(--lavender);
  box-shadow: 0 0 0 3px rgba(179,149,219,.22);
}
.modal-body input[name="title"] { font-weight: 700; font-size: 15px; }
.modal-title {
  font-weight: 800; font-size: 18px; letter-spacing: -0.02em; margin-bottom: 2px;
}
.modal-row { display: flex; gap: 12px; flex-wrap: wrap; }
.modal-row > * { flex: 1; min-width: 130px; }

/* Поля с лейблами */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label, .field > .field-label {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .1em; color: var(--muted);
}
.field small { font-size: 11.5px; color: var(--muted); }
.field-switch { flex: 0 0 auto; min-width: auto; }
.field-switch .switch { margin-top: 4px; }

/* Селекты с собственной стрелкой */
.modal-body select, .stack select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath fill='%237A6F88' d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80A8 8 0 0 1 53.66 90.34L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  background-size: 12px; padding-right: 34px; cursor: pointer;
}

/* Сегментед-контрол сложности */
.seg {
  display: inline-flex; gap: 2px; padding: 3px;
  background: rgba(42,35,54,.05); border-radius: 999px; width: max-content;
}
.seg button {
  border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 700;
  color: var(--muted); padding: 6px 14px; border-radius: 999px; cursor: pointer;
  transition: color .35s var(--ease), background .35s var(--ease), box-shadow .35s var(--ease);
}
.seg button.active { background: var(--panel); color: var(--violet); box-shadow: var(--shadow-soft); }

/* Свитч «Срочно» */
.switch { position: relative; display: inline-block; width: 44px; height: 26px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-track {
  position: absolute; inset: 0; background: var(--line); border-radius: 999px;
  transition: background .3s var(--ease); pointer-events: none;
}
.switch-track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(42,35,54,.3);
  transition: transform .3s var(--ease);
}
.switch input:checked + .switch-track { background: var(--violet); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.modal-actions { display: flex; gap: 8px; margin-top: 4px; }
.btn-ghost {
  border: 1px solid var(--line); background: none; color: var(--muted);
  border-radius: 999px; padding: 9px 18px; font: inherit; font-size: 13.5px;
  font-weight: 700; cursor: pointer;
  transition: color .3s var(--ease), border-color .3s var(--ease);
}
.btn-ghost:hover { color: var(--ink); border-color: var(--lavender); }
.comments { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.comment { background: var(--cream); border-radius: 10px; padding: 9px 12px; font-size: 13px; }
.comment b { color: var(--violet); }
.cdate { color: var(--muted); font-size: 11px; margin-left: 6px; }
.comment-add { display: flex; gap: 8px; }
.comment-add button {
  border: 0; background: var(--violet); color: #fff; border-radius: 10px;
  padding: 0 16px; cursor: pointer; font-size: 14px;
  transition: background .3s var(--ease);
}
.comment-add button:hover { background: var(--violet-deep); }

/* ─── Карточки-страницы (профиль, команда) ─── */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 24px; margin-bottom: 16px; max-width: 580px;
  box-shadow: var(--shadow-soft);
}
.card h2 { font-weight: 800; font-size: 21px; letter-spacing: -0.02em; }
.card h3 { font-weight: 800; font-size: 16px; letter-spacing: -0.01em; margin-bottom: 6px; }
.card p { color: var(--muted); font-size: 14px; line-height: 1.55; }
.card p b { color: var(--ink); }
.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.stack input {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; font-size: 14px;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.stack input:focus { outline: none; border-color: var(--lavender); box-shadow: 0 0 0 3px rgba(179,149,219,.22); }
.stack label { font-size: 13.5px; color: var(--muted); font-weight: 600; }
.bind-code {
  font-size: 22px; letter-spacing: 4px; color: var(--violet);
  font-weight: 800;
}
.team-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.team-table th {
  text-align: left; padding: 8px 6px; font-size: 10.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .12em; color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.team-table td { text-align: left; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.team-table button {
  border: 1px solid var(--line); background: none; border-radius: 999px;
  font: inherit; font-size: 12px; font-weight: 700; color: var(--muted);
  padding: 4px 12px; cursor: pointer;
  transition: color .3s var(--ease), border-color .3s var(--ease);
}
.team-table button:hover { color: var(--violet); border-color: var(--lavender); }

/* ─── Вход ─── */
.login-body {
  display: grid; place-items: center; min-height: 100vh;
  font-family: 'Manrope', system-ui, sans-serif;
  background: var(--cream);
}
.login-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 36px 32px; width: min(380px, 90vw);
  display: flex; flex-direction: column; gap: 13px;
  box-shadow: var(--shadow-lift);
  animation: rise .6s var(--ease) both;
}
.login-card h1 {
  font-weight: 800; font-size: 24px; letter-spacing: -0.02em;
  color: var(--ink); margin-bottom: 4px;
}
.login-card input {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; font-size: 14.5px;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.login-card input:focus { outline: none; border-color: var(--lavender); box-shadow: 0 0 0 3px rgba(179,149,219,.22); }
.login-card button {
  background: var(--violet); color: #fff; border: 0; border-radius: 999px;
  padding: 12px; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
  box-shadow: 0 10px 24px -8px rgba(86,61,135,.5);
  transition: transform .35s var(--ease), background .35s var(--ease);
}
.login-card button:hover { background: var(--violet-deep); transform: translateY(-1px); }
.login-card button:active { transform: scale(.98); }
.login-error { color: var(--terra); font-size: 13px; min-height: 1em; font-weight: 600; }

/* ─── Иконки (Phosphor, окрашиваются через маску) ─── */
.ico {
  display: inline-block; width: 15px; height: 15px; background: currentColor;
  -webkit-mask: var(--u) center / contain no-repeat;
  mask: var(--u) center / contain no-repeat;
  vertical-align: -2px; flex-shrink: 0;
}
.ico-flame   { --u: url('/static/icons/flame-fill.svg'); }
.ico-chat    { --u: url('/static/icons/chat-circle.svg'); }
.ico-send    { --u: url('/static/icons/paper-plane-right-fill.svg'); }
.ico-pencil  { --u: url('/static/icons/pencil-simple.svg'); }
.ico-trash   { --u: url('/static/icons/trash.svg'); }
.ico-caret-l { --u: url('/static/icons/caret-left.svg'); }
.ico-caret-r { --u: url('/static/icons/caret-right.svg'); }
.urgent-flag { color: var(--terra); width: 14px; height: 14px; margin-right: 6px; }
.ccount { display: inline-flex; align-items: center; gap: 3px; }
.ccount .ico { width: 13px; height: 13px; }
.mv .ico { width: 11px; height: 11px; vertical-align: -1px; }
.week-btn .ico { width: 12px; height: 12px; }
.comment-add button { display: inline-flex; align-items: center; }
.comment-add button .ico { width: 16px; height: 16px; }
.side-act .ico { width: 13px; height: 13px; }

/* ─── Точки сложности ─── */
.diff { display: inline-flex; gap: 3.5px; align-items: center; }
.diff i {
  width: 6.5px; height: 6.5px; border-radius: 50%;
  background: transparent; border: 1.5px solid var(--lavender);
}
.diff i.on { background: var(--violet); border-color: var(--violet); }

/* ─── Топ недели ─── */
.week-top { display: inline-flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-left: auto; }
.week-label {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .12em; color: var(--muted); margin-right: 3px;
}
.week-top b { font-weight: 800; color: var(--violet); }
.rank {
  width: 17px; height: 17px; border-radius: 50%; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800;
}
.rank-1 { background: var(--violet); }
.rank-2 { background: var(--lavender); }
.rank-3 { background: var(--muted); }
.week-sep { width: 8px; }

/* ─── Профиль ─── */
.profile-grid { display: flex; flex-direction: column; gap: 0; max-width: 580px; }
.profile-hero {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 18px;
  align-items: center; max-width: none;
}
.avatar-lg { width: 58px; height: 58px; font-size: 24px; grid-row: span 2; }
.profile-who h2 { margin: 0; }
.profile-title {
  font-size: 11px; font-weight: 800; color: var(--violet);
  background: var(--lavender-soft); border-radius: 999px; padding: 3px 10px;
  display: inline-block; margin-top: 4px;
}
.level-progress { grid-column: 1 / -1; margin-top: 16px; }
.level-progress-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12.5px; margin-bottom: 7px; gap: 12px;
}
.level-xp { font-weight: 800; color: var(--violet); font-variant-numeric: tabular-nums; }
.level-next { color: var(--muted); }
.xpbar-wide { width: 100%; height: 8px; border-radius: 4px; background: var(--lavender-soft); }
.tg-ok { color: var(--violet); font-weight: 600; }
.bind-row { margin-top: 4px; }
code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px;
  background: var(--lavender-soft); color: var(--violet);
  border-radius: 6px; padding: 2px 7px;
}
.form-msg { font-size: 13px; min-height: 1em; font-weight: 600; }
.form-msg.ok { color: var(--violet); }
.form-msg.err { color: var(--terra); }
.check-row {
  display: flex; gap: 8px; align-items: center;
  font-size: 13.5px; color: var(--muted); font-weight: 600;
}
.check-row input { accent-color: var(--violet); }
.card-wide { max-width: 760px; }
.tg-chip {
  font-size: 11px; font-weight: 700; border-radius: 999px; padding: 3px 10px;
  background: var(--line); color: var(--muted); white-space: nowrap;
}
.tg-chip.on { background: var(--lavender-soft); color: var(--violet); }
.td-xp { font-variant-numeric: tabular-nums; font-weight: 700; }
.td-title { color: var(--muted); }
.reset-pw { white-space: nowrap; }

/* ─── Прочее ─── */
[hidden] { display: none !important; }

@media (max-width: 900px) {
  main { padding: 14px 14px 40px; }
  dialog {
    width: 100vw; max-width: 100vw; margin: auto 0 0;
    border-radius: 18px 18px 0 0; padding: 0;
  }
  .modal-body {
    border-radius: 18px 18px 0 0; max-height: 88dvh; overflow-y: auto;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  }
  .modal-row { flex-direction: column; gap: 11px; }
  .modal-row > * { min-width: 0; }
  .modal-actions { flex-wrap: wrap; }
  .profile-hero { grid-template-columns: auto 1fr; }
  .card { padding: 18px; }
  .team-table .td-title { display: none; }
  .team-table th:nth-child(3) { display: none; }
  .layout { flex-direction: column; gap: 12px; }
  .sidebar {
    width: 100%; position: static; flex-direction: row; overflow-x: auto;
    padding-bottom: 4px; gap: 6px;
  }
  .side-item { flex-shrink: 0; }
  .side-add { margin-top: 0; flex-shrink: 0; }
  .board { grid-template-columns: 1fr; }
  .column { min-height: auto; }
  .week { grid-template-columns: 1fr; }
  .day { min-height: auto; }
  .movers { display: inline-flex; }
  .me { display: none; }
  .topbar { gap: 12px; padding: 12px 14px; }
  .brand { white-space: nowrap; font-size: 17px; }
  nav { overflow-x: auto; }
  nav a { padding: 7px 9px; flex-shrink: 0; }
}
@media (hover: none) { .movers { display: inline-flex; } }
