/* Synvolve brand tokens (from synvolve.solutions) */
:root {
  --bg: #080808;
  --bg-soft: #111111;
  --card: #171717;
  --card-soft: #1c1c1c;
  --ink: #f6f7f9;
  --ink-soft: #a0a4ab;
  --ink-dim: #6c6f76;
  --border: rgba(255,255,255,0.10);
  --border-strong: rgba(255,255,255,0.18);

  --cyan: #00b7c8;
  --cyan-deep: #007e9b;
  --violet: #7a3fa1;
  --rose: #b44c89;
  --orange: #ff9f1c;
  --yellow: #ffc12c;
  --danger: #ff5d6c;
  --ok: #2fd39a;

  --gradient: linear-gradient(120deg, var(--cyan) 0%, var(--violet) 55%, var(--orange) 100%);
  --gradient-soft: linear-gradient(120deg, rgba(0,183,200,0.18) 0%, rgba(122,63,161,0.18) 55%, rgba(255,159,28,0.18) 100%);
  --accent: #4a5fb8;
  --accent-hover: #5a6fd1;

  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 18px 36px -18px rgba(0,0,0,0.65);
  --shadow-hover: 0 1px 0 rgba(255,255,255,0.06) inset, 0 28px 54px -20px rgba(0,0,0,0.75);
  --topbar-h: 64px;
  --tabbar-h: 0px;
  --tint: 255,255,255;
  --glass: rgba(23,23,23,.78);
  --glass-col: rgba(23,23,23,.72);
  --glass-strong: rgba(17,17,17,.92);
  --backdrop: rgba(0,0,0,.6);
  --shadow-modal: 0 40px 80px -20px rgba(0,0,0,.8);
  --glow: 0.14;
  --icon-filter: invert(1);
  color-scheme: dark;
}
/* Light theme: follows the system unless the user picked a theme explicitly */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { 
    --bg: #f4f5f8;
    --bg-soft: #eceef3;
    --card: #ffffff;
    --card-soft: #f7f8fa;
    --ink: #12141a;
    --ink-soft: #4f5562;
    --ink-dim: #8a8f9b;
    --border: rgba(15,20,30,0.10);
    --border-strong: rgba(15,20,30,0.18);
    --cyan: #008c9b;
    --orange: #d27700;
    --yellow: #a87800;
    --danger: #d93649;
    --ok: #17a674;
    --gradient-soft: linear-gradient(120deg, rgba(0,183,200,0.14) 0%, rgba(122,63,161,0.12) 55%, rgba(255,159,28,0.14) 100%);
    --shadow: 0 1px 2px rgba(15,20,30,0.05), 0 12px 28px -18px rgba(15,20,30,0.25);
    --shadow-hover: 0 1px 2px rgba(15,20,30,0.06), 0 20px 40px -20px rgba(15,20,30,0.3);
    --tint: 15,20,30;
    --glass: rgba(255,255,255,.8);
    --glass-col: rgba(255,255,255,.7);
    --glass-strong: rgba(255,255,255,.92);
    --backdrop: rgba(15,20,30,.35);
    --shadow-modal: 0 40px 80px -20px rgba(15,20,30,.35);
    --glow: 0.10;
    --icon-filter: none;
    color-scheme: light;
   }
}
:root[data-theme="light"] { 
    --bg: #f4f5f8;
    --bg-soft: #eceef3;
    --card: #ffffff;
    --card-soft: #f7f8fa;
    --ink: #12141a;
    --ink-soft: #4f5562;
    --ink-dim: #8a8f9b;
    --border: rgba(15,20,30,0.10);
    --border-strong: rgba(15,20,30,0.18);
    --cyan: #008c9b;
    --orange: #d27700;
    --yellow: #a87800;
    --danger: #d93649;
    --ok: #17a674;
    --gradient-soft: linear-gradient(120deg, rgba(0,183,200,0.14) 0%, rgba(122,63,161,0.12) 55%, rgba(255,159,28,0.14) 100%);
    --shadow: 0 1px 2px rgba(15,20,30,0.05), 0 12px 28px -18px rgba(15,20,30,0.25);
    --shadow-hover: 0 1px 2px rgba(15,20,30,0.06), 0 20px 40px -20px rgba(15,20,30,0.3);
    --tint: 15,20,30;
    --glass: rgba(255,255,255,.8);
    --glass-col: rgba(255,255,255,.7);
    --glass-strong: rgba(255,255,255,.92);
    --backdrop: rgba(15,20,30,.35);
    --shadow-modal: 0 40px 80px -20px rgba(15,20,30,.35);
    --glow: 0.10;
    --icon-filter: none;
    color-scheme: light;
   }


* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
button, a, label, select, .tile, .project { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
body::before, body::after {
  content: ""; position: fixed; width: 720px; height: 720px; border-radius: 50%;
  filter: blur(110px); opacity: var(--glow); z-index: 0; pointer-events: none;
}
body::before { background: radial-gradient(circle, var(--cyan), transparent 70%); top: -260px; left: -200px; }
body::after  { background: radial-gradient(circle, var(--orange), transparent 70%); bottom: -280px; right: -220px; }

h1, h2, h3 { font-family: "Space Grotesk", "Manrope", sans-serif; letter-spacing: -0.01em; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.muted { color: var(--ink-soft); }
.grad { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Buttons & inputs ---------- */
.btn {
  border: 1px solid var(--border); background: var(--card); border-radius: 999px;
  padding: 9px 18px; font-weight: 700; font-size: 13.5px; white-space: nowrap;
  transition: background .2s, transform .2s, border-color .2s;
}
.btn:hover { background: var(--card-soft); border-color: var(--border-strong); }
.btn--primary { background: var(--accent); border-color: transparent; color: #fff; box-shadow: 0 8px 20px -8px rgba(74,95,184,.5); }
.btn--primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn--ghost { background: transparent; }
.btn--danger { color: var(--danger); background: transparent; border-color: rgba(255,93,108,.35); }
.btn--danger:hover { background: rgba(255,93,108,.1); }
.btn--block { width: 100%; padding: 12px; }
.btn--sm { padding: 6px 12px; font-size: 12.5px; }

label { display: grid; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
input, select, textarea {
  width: 100%; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px;
  padding: 11px 13px; font-size: 14px; outline: none; transition: border-color .2s, box-shadow .2s;
}
textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,183,200,.15); }
input:disabled, select:disabled, textarea:disabled { opacity: .7; }
input[type="date"]::-webkit-calendar-picker-indicator { filter: var(--icon-filter); opacity: .6; }
.form-error { color: var(--danger); font-size: 13px; min-height: 1em; margin: 0; }

/* ---------- Login ---------- */
.login { position: relative; z-index: 1; min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.login__card {
  width: min(400px, 100%); background: var(--card); border: 1px solid var(--border);
  border-radius: 28px; padding: 36px 28px; display: grid; gap: 14px; box-shadow: var(--shadow);
}
.login__logo { width: 72px; height: 72px; margin: 0 auto; }
.login__card h1 { text-align: center; font-size: 28px; }
.login__card .muted { text-align: center; margin: -6px 0 6px; }

#forgotForm h1 { text-align: center; font-size: 24px; }
#forgotStep { display: grid; gap: 14px; }
#forgotStep .muted { text-align: center; margin: 0; line-height: 1.5; }
.link-btn { border: 0; background: transparent; color: var(--ink-soft); font-weight: 600; font-size: 13px; padding: 4px; justify-self: center; }
.link-btn:hover { color: var(--cyan); }
.forgot-done { text-align: center; display: grid; gap: 6px; }
.forgot-done p { margin: 0; line-height: 1.5; }
.forgot-done__icon {
  width: 52px; height: 52px; margin: 0 auto 6px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gradient); color: #fff; font-size: 24px; font-weight: 800;
}

/* ---------- App shell ---------- */
.app { position: relative; z-index: 1; height: 100%; height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); flex: none; display: flex; align-items: center; gap: 16px;
  margin: 12px 12px 0; padding: 0 10px 0 18px;
  background: var(--glass); backdrop-filter: blur(16px);
  border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand img { width: 32px; height: 32px; }
.topbar__actions { margin-left: auto; display: flex; flex: none; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; padding: 0;
  border: 1px solid var(--border); background: var(--card); color: var(--ink-soft); transition: color .2s, border-color .2s;
}
.icon-btn:hover { color: var(--ink); border-color: var(--border-strong); }
.icon-btn .i-sun { display: none; }
:root[data-theme="dark"] .icon-btn .i-sun { display: block; }
:root[data-theme="dark"] .icon-btn .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .i-sun { display: block; }
  :root:not([data-theme="light"]) .icon-btn .i-moon { display: none; }
}
.user-chip {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--card);
  border-radius: 999px; padding: 4px 12px 4px 4px; font-weight: 700; font-size: 13px;
}
.user-chip:hover { border-color: var(--border-strong); }

.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font-size: 11.5px; font-weight: 800; color: #fff; background: var(--gradient);
}
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-edit { position: relative; border: 0; padding: 0; background: transparent; border-radius: 50%; flex: none; }
.avatar-edit:hover .avatar { filter: brightness(.8); }
.avatar-edit__cam {
  position: absolute; right: -2px; bottom: -2px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; background: var(--card); border: 1px solid var(--border-strong);
}
.avatar-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.avatar--sm { width: 22px; height: 22px; font-size: 9.5px; }

/* ---------- Board ---------- */
.board {
  flex: 1; min-height: 0; display: grid; gap: 12px; padding: 12px;
  grid-template-columns: minmax(220px, 260px) repeat(3, minmax(260px, 1fr));
}
.col {
  min-height: 0; display: flex; flex-direction: column; gap: 10px;
  background: var(--glass-col); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow); backdrop-filter: blur(10px);
}
.col__head { display: flex; align-items: center; gap: 8px; padding: 2px 4px; min-height: 34px; }
.col__head h2 { font-size: 17px; }
.count {
  font-size: 12px; font-weight: 700; color: var(--ink-soft); background: rgba(var(--tint),.06);
  border-radius: 999px; padding: 2px 9px;
}

.add-btn {
  border: 1px dashed var(--border-strong); background: transparent; color: var(--ink-soft);
  border-radius: var(--radius-sm); padding: 10px; font-weight: 700; font-size: 13px;
  transition: color .2s, border-color .2s, background .2s;
}
.add-btn:hover { color: var(--ink); border-color: var(--cyan); background: rgba(0,183,200,.06); }

.project-list, .tiles { list-style: none; margin: 0; padding: 0 2px 4px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.project-list::-webkit-scrollbar, .tiles::-webkit-scrollbar { width: 6px; }
.project-list::-webkit-scrollbar-thumb, .tiles::-webkit-scrollbar-thumb { background: rgba(var(--tint),.1); border-radius: 6px; }

.project {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; font-weight: 600; transition: background .2s, border-color .2s;
}
.project:hover { background: rgba(var(--tint),.04); }
.project.is-active { background: var(--gradient-soft); border-color: var(--border-strong); }
.project__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-dim); flex: none; display: grid; place-items: center; }
.project.is-completed { color: var(--ink-soft); }
.project.is-completed .project__name { text-decoration: line-through; text-decoration-color: var(--ink-dim); }
.project.is-completed .project__dot { width: 16px; height: 16px; background: var(--ok); color: #0b0b0b; font-size: 10px; font-weight: 900; box-shadow: none; }
.project.is-active .project__dot { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.project__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project__edit { opacity: 0; border: 0; background: transparent; color: var(--ink-soft); padding: 2px 6px; border-radius: 8px; }
.project:hover .project__edit { opacity: 1; }
.project__edit:hover { background: rgba(var(--tint),.08); color: var(--ink); }

/* ---------- Tiles ---------- */
.tile {
  position: relative; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; cursor: pointer; transition: border-color .2s, transform .2s, box-shadow .2s;
  display: grid; gap: 6px;
}
.tile:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.tile__top { display: flex; align-items: flex-start; gap: 10px; }
.tile__title { flex: 1; font-weight: 700; font-size: 14.5px; line-height: 1.35; word-break: break-word; }
.tile__desc {
  color: var(--ink-soft); font-size: 13px; line-height: 1.45; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word;
}
.tile__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.tile.is-done { opacity: .55; }
.tile.is-done .tile__title { text-decoration: line-through; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700;
  border-radius: 999px; padding: 3px 9px; background: rgba(var(--tint),.06); color: var(--ink-soft);
}
.chip--overdue { background: rgba(255,93,108,.14); color: var(--danger); }
.chip--soon { background: rgba(255,193,44,.14); color: var(--yellow); }
.chip--progress { background: rgba(0,183,200,.14); color: var(--cyan); }
.chip--user { padding: 2px 9px 2px 2px; }

.prio { font-family: "Space Grotesk", sans-serif; font-size: 11.5px; font-weight: 700; border-radius: 8px; padding: 3px 7px; flex: none; }
.prio--low  { background: rgba(0,183,200,.14); color: var(--cyan); }
.prio--mid  { background: rgba(255,159,28,.14); color: var(--orange); }
.prio--high { background: rgba(255,93,108,.16); color: var(--danger); }

.check {
  width: 20px; height: 20px; flex: none; margin-top: 1px; border-radius: 50%;
  border: 2px solid var(--border-strong); background: transparent; display: grid; place-items: center; padding: 0;
  transition: border-color .2s, background .2s;
}
.check:hover { border-color: var(--ok); }
.check.is-done { background: var(--ok); border-color: var(--ok); }
.check.is-done::after { content: ""; width: 5px; height: 9px; border: solid #0b0b0b; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px,-1px); }

.empty { color: var(--ink-dim); text-align: center; font-size: 13px; padding: 24px 8px; }

/* ---------- Column filters ---------- */
.head-spacer { flex: 1; }
.filter-btn {
  position: relative; flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--ink-soft); padding: 0;
  transition: color .2s, border-color .2s, background .2s;
}
.filter-btn:hover, .filter-btn.is-open { color: var(--ink); border-color: var(--border-strong); }
.filter-btn.is-open { background: rgba(var(--tint),.08); }
.filter-btn.has-active { color: var(--cyan); border-color: rgba(0,183,200,.5); }
.filter-btn__n {
  position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: var(--gradient); color: #fff; font-size: 10px; font-weight: 800; line-height: 16px; text-align: center;
}
.filters {
  display: grid; gap: 8px; padding: 10px; border-radius: var(--radius-sm);
  background: var(--bg-soft); border: 1px solid var(--border); animation: filtersIn .18s ease;
}
@keyframes filtersIn { from { opacity: 0; transform: translateY(-4px); } }
.filters__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.filters label { gap: 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-dim); }
.filters select, .filters input { padding: 7px 9px; font-size: 13px; border-radius: 10px; background: var(--card); }
.filters__reset {
  justify-self: start; border: 0; background: transparent; color: var(--cyan); font-size: 12.5px; font-weight: 700; padding: 2px 0;
}
.filters__reset:disabled { color: var(--ink-dim); cursor: default; }
.empty .filters__reset { margin-top: 8px; }

/* ---------- Modal ---------- */
.modal {
  border: 1px solid var(--border-strong); border-radius: 24px; padding: 0; background: var(--card); color: var(--ink);
  width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); box-shadow: var(--shadow-modal);
}
.modal:focus { outline: none; }
.modal::backdrop { background: var(--backdrop); backdrop-filter: blur(4px); }
.modal__inner { padding: 24px; display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.modal__inner > * { min-width: 0; }
.modal__head { display: flex; align-items: center; gap: 10px; }
.modal__head h3 { font-size: 20px; flex: 1; }
.modal__close { border: 0; background: rgba(var(--tint),.06); width: 32px; height: 32px; border-radius: 50%; font-size: 18px; line-height: 1; }
.modal__foot { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
.modal__foot .spacer { flex: 1; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row--3 { grid-template-columns: 1fr 1fr 1fr; }
.meta-line { font-size: 12px; color: var(--ink-dim); }

.user-list { display: grid; gap: 8px; max-height: 50vh; overflow-y: auto; }
.user-row {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 14px;
}
.user-row.is-off { opacity: .5; }
.user-row__name { font-weight: 700; }
.user-row__email { font-size: 12px; color: var(--ink-soft); }
.user-row select { padding: 6px 8px; font-size: 12.5px; width: auto; }
.role-tag { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.members { display: grid; gap: 8px; }
.members__head { display: grid; gap: 2px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.members__list { display: grid; gap: 4px; max-height: 240px; overflow-y: auto; padding: 4px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; }
.member { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 9px; cursor: pointer; font-size: 13.5px; color: var(--ink); font-weight: 600; }
.member:hover { background: rgba(var(--tint),.04); }
.member { cursor: default; }
.member__name small { display: block; font-size: 11px; font-weight: 600; color: var(--ink-dim); }
.member__access { width: auto; padding: 6px 8px; font-size: 12.5px; border-radius: 9px; background: var(--card); }
.project__view { font-size: 12px; opacity: .7; }
.add-btn.is-readonly { cursor: default; border-style: solid; color: var(--ink-dim); }
.add-btn.is-readonly:hover { background: transparent; border-color: var(--border-strong); color: var(--ink-dim); }
.member__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member__role { font-size: 11.5px; color: var(--ink-dim); font-weight: 600; }
.member.is-admin .member__role { color: var(--cyan); }
details.add-user { border: 1px dashed var(--border-strong); border-radius: 14px; padding: 12px 14px; }
details.add-user summary { cursor: pointer; font-weight: 700; }
details.add-user[open] summary { margin-bottom: 12px; }
details.add-user form { display: grid; gap: 10px; }

/* ---------- Item card: form + activity ---------- */
.modal--wide { width: min(1120px, calc(100vw - 24px)); }
.modal__inner--card { padding: 14px 16px 16px; gap: 10px; }
/* Content that brings its own padded wrapper shouldn't get the outer padding too */
#modalBody:has(> .modal__inner) { padding: 0; }
.btn:disabled { opacity: .45; cursor: default; transform: none; box-shadow: none; }
.card-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.card-head .modal__close { margin-left: auto; flex: none; }
.card-meta { font-size: 12.5px; color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.kind-chip { flex: none; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 4px 9px; border-radius: 8px; }
.kind-chip--task { background: rgba(0,183,200,.14); color: var(--cyan); }
.kind-chip--plan { background: rgba(122,63,161,.18); color: #b98ad8; }
.kind-chip--idea { background: rgba(255,159,28,.14); color: var(--orange); }

.item-form { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.item-view > .item-form { max-height: min(68dvh, 640px); overflow-y: auto; padding-right: 4px; margin-right: -4px; }
.item-form__foot { position: sticky; bottom: 0; background: var(--card); padding: 6px 0 0; }
.title-input {
  font-family: "Space Grotesk", sans-serif; font-size: 21px; font-weight: 700; letter-spacing: -0.01em;
  background: transparent; border-color: transparent; padding: 6px 8px; margin: 0 -8px; width: calc(100% + 16px);
}
.title-input:hover:not(:disabled) { background: var(--bg-soft); }
.title-input:focus { background: var(--bg-soft); }
.title-input:disabled { opacity: 1; }
.props { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.prop { gap: 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-dim); }
.prop select, .prop .dp__field { padding: 8px 10px; font-size: 13.5px; border-radius: 10px; }
.prop .dp__field { gap: 8px; }
.desc-input { flex: 1 1 auto; min-height: 84px; resize: none; padding: 10px 12px; font-size: 14px; line-height: 1.55; overflow-y: auto; }
.item-form .form-error:empty { display: none; }
.item-form__foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 2px; }
.item-form__foot .spacer { flex: 1; }

.item-view { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 14px; min-height: 0; }
.activity {
  display: flex; flex-direction: column; gap: 8px; min-height: 0; height: min(68dvh, 640px);
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px;
}
.activity__head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.activity__head h4 { margin: 0; font-family: "Space Grotesk", sans-serif; font-size: 14px; flex: none; }
#subBtn { padding: 4px 10px; font-size: 12px; flex: none; }
#subBtn.is-on { border-color: rgba(0,183,200,.5); color: var(--cyan); }
.activity__subs { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; overflow: hidden; }
.activity__subs .meta-line { margin-right: 4px; white-space: nowrap; }
.activity__subs .avatar--sm { width: 20px; height: 20px; font-size: 8.5px; margin-left: -4px; box-shadow: 0 0 0 2px var(--bg-soft); }
.activity__subs .avatar--sm:first-of-type { margin-left: 0; }
.activity__log { list-style: none; margin: 0 -4px 0 0; padding: 2px 4px 0 0; overflow-y: auto; flex: 1; min-height: 80px; display: grid; gap: 10px; align-content: start; }
.ev { display: flex; gap: 8px; font-size: 13px; line-height: 1.45; color: var(--ink-soft); }
.ev b { color: var(--ink); font-weight: 700; }
.ev time { font-size: 11px; color: var(--ink-dim); }
.ev--created time, .ev--updated time { display: block; margin-top: 1px; }
.ev__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-dim); margin: 6px 7px 0 7px; flex: none; }
.ev--created .ev__dot { background: var(--cyan); }
.ev--updated .ev__dot { background: var(--violet); }
.ev__body { min-width: 0; flex: 1; }
.ev__changes { margin: 2px 0 0; padding-left: 14px; }
.ev__changes s { color: var(--ink-dim); }
.ev--comment .ev__meta time { display: inline; margin-left: 6px; }
.ev__text {
  margin-top: 3px; background: var(--card); border: 1px solid var(--border); border-radius: 4px 12px 12px 12px;
  padding: 7px 10px; color: var(--ink); white-space: pre-wrap; word-break: break-word;
}
.comment-form { position: relative; }
.comment-form textarea {
  min-height: 42px; max-height: 160px; resize: none; background: var(--card); padding: 10px 46px 10px 12px; line-height: 1.45; display: block;
}
.comment-form__send {
  position: absolute; right: 6px; bottom: 6px; width: 32px; height: 32px; border-radius: 9px; border: 0; padding: 0;
  display: grid; place-items: center; background: var(--accent); color: #fff; transition: background .2s, opacity .2s;
}
.comment-form__send:hover { background: var(--accent-hover); }
.comment-form textarea:placeholder-shown + .comment-form__send { opacity: .45; }

/* ---------- Date picker ---------- */
.dp { position: relative; }
.dp__field {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px;
  font-size: 14px; font-weight: 600; color: var(--ink); transition: border-color .2s, box-shadow .2s;
}
.dp__field svg { color: var(--cyan); flex: none; }
.dp__field.is-empty { color: var(--ink-dim); font-weight: 500; }
.dp__field:hover:not(:disabled) { border-color: var(--border-strong); }
.dp__field:focus-visible { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,183,200,.15); }
.dp__field.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(255,93,108,.15); }
.dp__field:disabled { opacity: .7; cursor: default; }
.dp__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cal {
  position: fixed; z-index: 1000; width: 300px; padding: 14px;
  background: var(--card); border: 1px solid var(--border-strong); border-radius: 18px;
  box-shadow: var(--shadow-modal); animation: filtersIn .15s ease;
}
.cal::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 3px; border-radius: 18px 18px 0 0; background: var(--gradient); opacity: .9;
}
.cal__head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.cal__title { flex: 1; text-align: center; font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 15px; }
.cal__title span { color: var(--ink-soft); font-weight: 600; }
.cal__nav {
  width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-soft);
  color: var(--ink); font-size: 18px; line-height: 1; padding: 0;
}
.cal__nav:hover { border-color: var(--cyan); color: var(--cyan); }
.cal__week, .cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal__week span { text-align: center; font-size: 11px; font-weight: 700; color: var(--ink-dim); text-transform: uppercase; padding: 4px 0 6px; }
.cal__day {
  aspect-ratio: 1; border: 0; border-radius: 10px; background: transparent; color: var(--ink);
  font-size: 13.5px; font-weight: 600; padding: 0; position: relative; transition: background .15s;
}
.cal__day:hover { background: rgba(var(--tint),.08); }
.cal__day.is-weekend { color: var(--ink-soft); }
.cal__day.is-past { color: var(--ink-dim); }
.cal__day.is-out { color: var(--ink-dim); opacity: .45; }
.cal__day.is-today { box-shadow: inset 0 0 0 1.5px var(--cyan); color: var(--cyan); }
.cal__day.is-selected { background: var(--gradient); color: #fff; box-shadow: 0 6px 16px -6px rgba(122,63,161,.6); opacity: 1; }
.cal__quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.cal__chip {
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--ink-soft); border-radius: 999px;
  padding: 5px 10px; font-size: 12px; font-weight: 700;
}
.cal__chip:hover { color: var(--ink); border-color: var(--cyan); }
.cal__chip--clear { color: var(--danger); margin-left: auto; }

/* ---------- Drag & drop ---------- */
.tile[draggable="true"] { cursor: grab; }
.tile.is-dragging { opacity: .4; }
.col.drop-ok { border-color: rgba(0,183,200,.45); border-style: dashed; }
.col.drop-hover { border-color: var(--cyan); background: rgba(0,183,200,.08); box-shadow: 0 0 0 3px rgba(0,183,200,.15), var(--shadow); }
.tile.is-flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 40% { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,183,200,.25); } }
.req { color: var(--danger); }

/* ---------- Notifications ---------- */
.bell { position: relative; }
.bell__n {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 800; line-height: 18px; text-align: center;
}
.notif-panel {
  position: fixed; z-index: 40; top: calc(var(--topbar-h) + 20px); right: 16px; width: min(400px, calc(100vw - 32px));
  max-height: min(70dvh, 560px); display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--border-strong); border-radius: 20px; box-shadow: var(--shadow-modal);
  overflow: hidden; animation: filtersIn .18s ease;
}
.notif__head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px 18px; }
.notif__head h4 { flex: 1; margin: 0; font-family: "Space Grotesk", sans-serif; font-size: 16px; }
.notif__push {
  margin: 0 12px 8px; padding: 10px 12px; border-radius: 12px; border: 1px dashed rgba(0,183,200,.5);
  background: rgba(0,183,200,.06); color: var(--cyan); font-weight: 700; font-size: 13px; text-align: left;
}
.notif__push--hint { border-style: solid; border-color: var(--border); background: var(--bg-soft); color: var(--ink-soft); font-weight: 600; }
.notif__list { list-style: none; margin: 0; padding: 0 6px 8px; overflow-y: auto; }
.notif { display: flex; gap: 10px; padding: 10px 12px; border-radius: 12px; cursor: pointer; font-size: 13px; line-height: 1.4; color: var(--ink-soft); }
.notif:hover { background: rgba(var(--tint),.05); }
.notif.is-unread { color: var(--ink); background: rgba(0,183,200,.07); }
.notif.is-unread .notif__text { font-weight: 600; }
.notif time { font-size: 11.5px; color: var(--ink-dim); }

/* ---------- Settings ---------- */
.setting { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 14px; }
.setting > div { flex: 1; min-width: 0; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: rgba(var(--tint),.15); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + span { background: var(--cyan); }
.switch input:checked + span::after { transform: translateX(18px); }

.setting--col { flex-direction: column; align-items: stretch; gap: 8px; }
.setting--col > div { flex: none; }
.notify-projects { display: grid; gap: 0; max-height: 220px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.notify-row { display: flex; align-items: center; gap: 10px; padding: 6px 2px; font-size: 13.5px; font-weight: 600; color: var(--ink); text-transform: none; letter-spacing: 0; }
.notify-row > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Password reset ---------- */
.pw-field { display: flex; gap: 8px; }
.pw-field input { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .04em; }
.pw-result {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px;
  background: var(--bg-soft); border: 1px solid var(--border-strong);
}
.pw-result code { flex: 1; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 18px; font-weight: 700; letter-spacing: .06em; user-select: all; word-break: break-all; }
.reset-requests { display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(255,159,28,.4); background: rgba(255,159,28,.08); }
.reset-request { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.reset-request > span { flex: 1; min-width: 0; }
.notif__key { width: 22px; height: 22px; flex: none; display: grid; place-items: center; font-size: 15px; }
.notif--reset.is-unread { background: rgba(255,159,28,.10); }

/* ---------- Topbar: search & my tasks ---------- */
.search-trigger {
  flex: 1; max-width: 460px; margin-left: 12px; display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--ink-dim); border-radius: 999px;
  padding: 8px 8px 8px 14px; font-size: 13.5px; font-weight: 500; text-align: left; transition: border-color .2s, color .2s;
}
.search-trigger:hover { border-color: var(--border-strong); color: var(--ink-soft); }
.search-trigger__text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
kbd {
  font-family: inherit; font-size: 11px; font-weight: 700; color: var(--ink-soft); padding: 2px 7px;
  border-radius: 6px; border: 1px solid var(--border-strong); background: var(--card);
}
.mytasks-btn { display: inline-flex; align-items: center; gap: 8px; position: relative; }
.mytasks-btn__n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: rgba(0,183,200,.16); color: var(--cyan); font-size: 11.5px; font-weight: 800; line-height: 20px; text-align: center; }
.mytasks-btn__n.is-overdue { background: var(--danger); color: #fff; }

/* ---------- My tasks ---------- */
.modal--list { width: min(680px, calc(100vw - 24px)); }
.mt-group { display: grid; gap: 4px; }
.mt-group__title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); padding: 8px 4px 4px; }
.mt-group__title span { color: var(--ink-dim); margin-left: 4px; }
.mt-group--overdue .mt-group__title { color: var(--danger); }
.mt-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--bg-soft); transition: border-color .2s, background .2s;
}
.mt-row:hover, .mt-row:focus-visible { border-color: var(--border-strong); background: var(--card-soft); outline: none; }
.mt-row__main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.mt-row__title { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-row__meta { font-size: 12px; color: var(--ink-dim); }
.mt-progress { color: var(--cyan); font-weight: 700; }

/* ---------- Search ---------- */
.modal--search { width: min(720px, calc(100vw - 24px)); margin-top: 10vh; margin-bottom: auto; }
.search { display: flex; flex-direction: column; max-height: 70dvh; }
.search__bar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--ink-dim); }
.search__bar input { flex: 1; border: 0; background: transparent; padding: 4px 0; font-size: 16px; box-shadow: none; }
.search__bar input:focus { box-shadow: none; }
.search__results { overflow-y: auto; padding: 6px 8px 10px; }
.sr-title { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-dim); padding: 10px 8px 4px; }
.sr-row { display: flex; gap: 10px; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px; border-radius: 10px; align-items: flex-start; }
.sr-row:hover, .sr-row:focus-visible { background: rgba(var(--tint),.06); outline: none; }
.sr-icon { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; background: rgba(var(--tint),.07); font-size: 13px; font-weight: 800; }
.sr-icon--task { color: var(--cyan); background: rgba(0,183,200,.14); }
.sr-icon--plan { color: #b98ad8; background: rgba(122,63,161,.18); }
.sr-icon--idea { color: var(--orange); background: rgba(255,159,28,.14); }
.sr-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.sr-name { font-weight: 700; font-size: 14px; color: var(--ink); }
.sr-name.is-done { text-decoration: line-through; color: var(--ink-dim); }
.sr-meta { font-size: 12px; color: var(--ink-dim); }
.sr-snippet { font-size: 12.5px; color: var(--ink-soft); line-height: 1.4; }
mark { background: rgba(255,193,44,.3); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- Card sections: checklist & files ---------- */
.sec-head { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-dim); margin-bottom: 6px; }
.sec-head__btn { margin-left: auto; cursor: pointer; text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--cyan); font-weight: 700; }
.sec-head__btn:hover { text-decoration: underline; }
.cl__count { color: var(--ink-soft); }
.cl__count.is-full { color: var(--ok); }
.cl__bar { height: 4px; border-radius: 4px; background: rgba(var(--tint),.08); overflow: hidden; margin-bottom: 6px; }
.cl__bar span { display: block; height: 100%; background: var(--gradient); border-radius: 4px; transition: width .3s; }
.cl__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.cl__item { display: flex; align-items: center; gap: 8px; padding: 4px 4px; border-radius: 8px; font-size: 13.5px; }
.cl__item:hover { background: rgba(var(--tint),.04); }
.cl__item .check { width: 18px; height: 18px; margin: 0; }
.cl__item .check.is-done::after { width: 4px; height: 8px; }
.cl__text { flex: 1; min-width: 0; word-break: break-word; cursor: text; }
.cl__item.is-done .cl__text { text-decoration: line-through; color: var(--ink-dim); }
.cl__del { opacity: 0; border: 0; background: transparent; color: var(--ink-dim); font-size: 16px; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.cl__item:hover .cl__del { opacity: 1; }
.cl__del:hover { color: var(--danger); }
.cl__edit, .cl__add { padding: 6px 9px; font-size: 13.5px; border-radius: 9px; }
.cl__add { margin-top: 4px; background: transparent; border-style: dashed; }
.cl__add:focus { border-style: solid; background: var(--bg-soft); }

.files__grid { display: flex; flex-wrap: wrap; gap: 8px; }
.files__empty { font-size: 12.5px; color: var(--ink-dim); padding: 10px; border: 1px dashed var(--border-strong); border-radius: 10px; text-align: center; }
.file { position: relative; }
.file > a {
  display: flex; align-items: center; gap: 8px; max-width: 220px; padding: 6px 10px 6px 6px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--ink); text-decoration: none;
}
.file > a:hover { border-color: var(--border-strong); }
.file__ext { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; flex: none; font-size: 10px; font-weight: 800; color: #fff; background: var(--gradient); }
.file__info { min-width: 0; display: grid; }
.file__name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file__size { font-size: 11px; color: var(--ink-dim); }
.file--img > a { padding: 0; width: 76px; height: 76px; overflow: hidden; }
.file--img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file__del {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; padding: 0; line-height: 1;
  border: 1px solid var(--border-strong); background: var(--card); color: var(--ink-soft); font-size: 13px; opacity: 0; transition: opacity .15s;
}
.file:hover .file__del { opacity: 1; }
.file__del:hover { color: var(--danger); }
.uploading { font-size: 12px; color: var(--cyan); margin-top: 6px; }
.item-view.is-dropping { outline: 2px dashed var(--cyan); outline-offset: 4px; border-radius: 14px; }

/* comments: files, mentions, attach */
.ev__files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ev__files .file--img > a { width: 120px; height: 90px; }
.mention { color: var(--cyan); font-weight: 700; }
.mention.is-me { background: rgba(0,183,200,.14); border-radius: 4px; padding: 0 3px; }
.comment-form textarea { padding-left: 40px; }
.comment-form__attach {
  position: absolute; left: 6px; bottom: 6px; width: 30px; height: 32px; display: grid; place-items: center; cursor: pointer;
  color: var(--ink-dim); border-radius: 8px; text-transform: none; letter-spacing: 0;
}
.comment-form__attach:hover { color: var(--cyan); background: rgba(var(--tint),.05); }
.pending-files { display: flex; flex-wrap: wrap; gap: 6px; }
.pending-files:not(:empty) { margin-bottom: 6px; }
.pending { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 4px 3px 9px; border-radius: 999px; background: var(--card); border: 1px solid var(--border); }
.pending.is-uploading { color: var(--ink-dim); }
.pending button { border: 0; background: transparent; color: var(--ink-dim); font-size: 14px; line-height: 1; padding: 0 4px; }
.mention-pop {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 5; display: grid; gap: 2px; padding: 6px;
  background: var(--card); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow-modal);
}
.mention-opt { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 6px 8px; border-radius: 8px; text-align: left; font-weight: 600; font-size: 13.5px; }
.mention-opt.is-active, .mention-opt:hover { background: rgba(0,183,200,.12); }

/* tiles & notifications */
.chip--ok { background: rgba(47,211,154,.14); color: var(--ok); }
.notif--mention.is-unread { background: rgba(0,183,200,.12); }
.notif--overdue.is-unread { background: rgba(255,93,108,.10); }

/* ---------- View switcher ---------- */
.seg { display: flex; flex: none; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--ink-soft); font-size: 12.5px; font-weight: 700; padding: 5px 12px; border-radius: 999px; white-space: nowrap; transition: background .2s, color .2s; }
.seg button:hover { color: var(--ink); }
.seg button.is-active { background: rgba(var(--tint),.1); color: var(--ink); }
.viewbar { display: flex; align-items: center; gap: 10px; margin: 10px 12px 0; }
.views {
  position: relative; display: inline-flex; gap: 2px; padding: 4px;
  background: var(--glass); backdrop-filter: blur(16px); border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow);
}
.views__glider {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: 0; border-radius: 999px; pointer-events: none;
  background: var(--gradient-soft); border: 1px solid var(--border-strong);
  box-shadow: 0 6px 18px -10px rgba(0,183,200,.6), inset 0 1px 0 rgba(var(--tint),.06);
  transition: transform .32s cubic-bezier(.3,.7,.2,1), width .32s cubic-bezier(.3,.7,.2,1);
}
.views button {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent;
  padding: 8px 16px; border-radius: 999px; color: var(--ink-soft); font-size: 13.5px; font-weight: 700; white-space: nowrap; transition: color .2s;
}
.views button svg { color: var(--ink-dim); transition: color .2s, transform .2s; }
.views button:hover { color: var(--ink); }
.views button:hover svg { transform: translateY(-1px); }
.views button.is-active { color: var(--ink); }
.views button.is-active svg { color: var(--cyan); }
.views button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.viewbar__project { display: none; width: auto; padding: 6px 10px; font-size: 13px; border-radius: 999px; }
.view { display: none; min-height: 0; min-width: 0; }
.board[data-view="kanban"] .col:not([data-col="projects"]),
.board[data-view="calendar"] .col:not([data-col="projects"]),
.board[data-view="dashboard"] .col { display: none; }
.board[data-view="kanban"] #kanbanView,
.board[data-view="calendar"] #calendarView { display: flex; grid-column: 2 / -1; }
.board[data-view="dashboard"] #dashboardView { display: block; grid-column: 1 / -1; }
.view--kanban, .view--calendar {
  flex-direction: column; gap: 10px; background: var(--glass-col); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); backdrop-filter: blur(10px); overflow: hidden;
}
.view--dashboard { overflow-y: auto; position: relative; padding-bottom: 12px; }

/* ---------- Tags ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; line-height: 1;
  padding: 4px 8px; border-radius: 999px; color: var(--ink);
  background: color-mix(in srgb, var(--tag) 18%, transparent); border: 1px solid color-mix(in srgb, var(--tag) 40%, transparent);
}
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--tag); }
.tile__tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag-row { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: -4px; }
.tag-add { border: 1px dashed var(--border-strong); background: transparent; color: var(--ink-dim); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; }
.tag-add:hover { color: var(--cyan); border-color: var(--cyan); }
.tag-picker {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; width: 280px; padding: 8px;
  background: var(--card); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow-modal);
}
.tag-picker__input { padding: 8px 10px; font-size: 13.5px; border-radius: 9px; margin-bottom: 6px; }
.tag-picker__list { display: grid; gap: 1px; max-height: 240px; overflow-y: auto; }
.tag-opt { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 13.5px; font-weight: 600; }
.tag-opt:hover { background: rgba(var(--tint),.06); }
.tag-opt__check { width: 14px; color: var(--cyan); font-weight: 800; }
.tag-opt__dot, .tag-opt__color { width: 12px; height: 12px; border-radius: 50%; background: var(--tag); border: 0; padding: 0; flex: none; }
.tag-opt__color { cursor: pointer; box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--border-strong); }
.tag-opt__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-opt__del { opacity: 0; border: 0; background: transparent; color: var(--ink-dim); font-size: 15px; padding: 0 4px; }
.tag-opt:hover .tag-opt__del { opacity: 1; }
.tag-opt__del:hover { color: var(--danger); }
.tag-opt--new { color: var(--cyan); }

/* ---------- Kanban ---------- */
.kb-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kb-toolbar h2 { font-size: 17px; margin-right: auto; }
.kb-toolbar input, .kb-toolbar select { width: auto; padding: 7px 10px; font-size: 13px; border-radius: 10px; }
.kb-toolbar input { width: 200px; }
.kb { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.kb-col { display: flex; flex-direction: column; gap: 8px; min-height: 0; padding: 10px; border-radius: 16px; background: var(--bg-soft); border: 1px solid var(--border); transition: border-color .2s, background .2s; }
.kb-col.drop-hover { border-color: var(--cyan); background: rgba(0,183,200,.06); }
.kb-col__head { display: flex; align-items: center; gap: 8px; font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 14.5px; padding: 2px 4px; }
.kb-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-dim); }
.kb-col--in_progress .kb-dot { background: var(--cyan); }
.kb-col--done .kb-dot { background: var(--ok); }
.kb-list { flex: 1; min-height: 60px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 2px; }
.kb-list .tile[draggable="true"] { cursor: grab; }

/* ---------- Calendar ---------- */
.cal-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cal-toolbar .seg { margin-left: 0; }
.cal-nav { display: flex; align-items: center; gap: 8px; margin-right: auto; }
.cal-nav h2 { font-size: 18px; min-width: 150px; text-align: center; }
.cal-legend { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-soft); }
.cal-key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 6px; }
.cal-key--task { background: rgba(0,183,200,.5); }
.cal-key--plan { background: rgba(122,63,161,.6); }
.cal-key--overdue { background: var(--danger); }
.cal-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: auto repeat(6, minmax(0, 1fr)); gap: 4px; overflow-y: auto; }
.cal-wd { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-dim); text-align: center; padding: 2px 0 4px; }
.cal-day {
  min-height: 92px; display: flex; flex-direction: column; gap: 3px; padding: 5px; border-radius: 10px;
  background: var(--bg-soft); border: 1px solid var(--border); overflow: hidden; cursor: default; transition: border-color .15s, background .15s;
}
.cal-day.is-out { opacity: .45; }
.cal-day.is-weekend { background: rgba(var(--tint),.02); }
.cal-day.is-today { border-color: var(--cyan); box-shadow: inset 0 0 0 1px var(--cyan); }
.cal-day.is-expanded { overflow: visible; z-index: 2; height: auto; }
.cal-day.drop-hover { border-color: var(--cyan); background: rgba(0,183,200,.08); }
.cal-day__num { font-size: 12px; font-weight: 700; color: var(--ink-soft); pointer-events: none; }
.cal-day.is-today .cal-day__num { color: var(--cyan); }
.cal-item {
  display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--cyan); border-radius: 5px;
  padding: 3px 6px; font-size: 11.5px; font-weight: 600; color: var(--ink); background: rgba(0,183,200,.12);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: none;
}
.cal-item:hover { filter: brightness(1.15); }
.cal-item--plan { border-left-color: #a46ad0; background: rgba(122,63,161,.18); }
.cal-item.is-overdue { border-left-color: var(--danger); background: rgba(255,93,108,.14); }
.cal-item.is-done { text-decoration: line-through; color: var(--ink-dim); opacity: .7; }
.cal-item[draggable="true"] { cursor: grab; }
.cal-more { border: 0; background: transparent; color: var(--ink-soft); font-size: 11px; font-weight: 700; text-align: left; padding: 0 4px; }
.cal-more:hover { color: var(--cyan); }
.cal-agenda { display: none; }

/* ---------- Dashboard ---------- */
.dash-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.dash-toolbar h2 { font-size: 20px; margin-right: auto; }
.dash-toolbar select { width: auto; padding: 8px 12px; font-size: 13.5px; border-radius: 999px; }
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.kpi { background: var(--glass-col); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); }
.kpi__value { font-family: "Space Grotesk", sans-serif; font-size: 34px; font-weight: 700; line-height: 1.1; color: var(--ink); }
.kpi__label { font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-top: 2px; }
.kpi__hint { font-size: 11.5px; color: var(--ink-dim); margin-top: 4px; }
.kpi--progress { box-shadow: inset 3px 0 0 var(--cyan), var(--shadow); }
.kpi--good { box-shadow: inset 3px 0 0 var(--ok), var(--shadow); }
.kpi--bad { box-shadow: inset 3px 0 0 var(--danger), var(--shadow); }
.kpi--bad .kpi__hint { color: var(--danger); font-weight: 700; }
.kpi--warn { box-shadow: inset 3px 0 0 var(--yellow), var(--shadow); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; }
.dash-card { background: var(--glass-col); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.dash-card--wide { grid-column: 1 / -1; }
.dash-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.dash-card__head h3 { font-size: 15px; margin-right: auto; }
.bars { position: relative; display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 6px; height: 200px; padding: 0 0 22px 28px; }
.bars__grid { position: absolute; left: 0; right: 0; top: 0; bottom: 22px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.bars__grid span { font-size: 10.5px; color: var(--ink-dim); border-top: 1px solid var(--border); padding-top: 0; line-height: 0; height: 0; display: flex; align-items: center; width: 100%; }
.bars__grid span:last-child { border-top-color: var(--border-strong); }
.bar { position: relative; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; outline: none; cursor: default; }
.bar::after { content: ""; position: absolute; inset: 0 -3px -22px; } /* bigger hover target */
.bar__fill { width: 100%; max-width: 26px; margin: 0 auto; background: var(--cyan); border-radius: 4px 4px 0 0; min-height: 2px; transition: filter .15s; }
.bar__fill.is-zero { background: var(--border-strong); }
.bar:hover .bar__fill, .bar:focus .bar__fill { filter: brightness(1.2); }
.bar__x { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font-size: 10.5px; color: var(--ink-dim); }
.bar__x.is-today { color: var(--ink); font-weight: 800; }
.bar-tip {
  position: absolute; transform: translate(-50%, -100%); pointer-events: none; z-index: 5; white-space: nowrap;
  background: var(--card-soft); border: 1px solid var(--border-strong); border-radius: 8px; padding: 5px 9px; font-size: 12px; font-weight: 700; box-shadow: var(--shadow);
}
.dash-list { display: grid; gap: 6px; max-height: 236px; overflow-y: auto; }
.dash-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-soft); }
.dash-row:hover { border-color: var(--border-strong); }
.dash-row__main { flex: 1; min-width: 0; display: grid; }
.dash-row__title { font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-soft); }
.legend__key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 6px; }
.legend__key--progress, .load__seg--progress { background: var(--cyan); }
.legend__key--todo, .load__seg--todo { background: color-mix(in srgb, var(--cyan) 35%, transparent); }
.load { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.load th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-dim); padding: 0 8px 8px; }
.load td { padding: 8px; border-top: 1px solid var(--border); color: var(--ink); font-variant-numeric: tabular-nums; }
.load tr.is-link { cursor: pointer; }
.load tr.is-link:hover td { background: rgba(var(--tint),.03); }
.load__who { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.load__barcol { width: 34%; }
.load__bar { display: flex; gap: 2px; height: 10px; }
.load__seg { height: 100%; border-radius: 3px; }
.load__seg:empty[style*="width:0%"] { display: none; }
.load__bad { color: var(--danger); font-weight: 800; }

/* ---------- Update banner ---------- */
.update-bar {
  position: fixed; left: 50%; bottom: calc(20px + var(--tabbar-h)); transform: translateX(-50%); z-index: 200;
  display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 18px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border-strong); box-shadow: var(--shadow-modal); font-weight: 700; font-size: 14px;
  animation: filtersIn .25s ease;
}

/* =====================================================================
   Phones & touch screens
   ===================================================================== */

/* Touch devices: no hover, so controls that appear on hover are always visible,
   and "lift on hover" effects are switched off (they get stuck after a tap) */
@media (hover: none), (pointer: coarse) {
  .project__edit, .cl__del, .file__del, .tag-opt__del { opacity: 1; }
  .tile:hover { transform: none; box-shadow: none; border-color: var(--border); }
  .btn--primary:hover { transform: none; }
  .views button:hover svg { transform: none; }
  .kb-move { display: flex; }
}
.kb-move { display: none; gap: 6px; margin-top: 4px; }
.kb-move button {
  flex: 1; border: 1px solid var(--border-strong); background: var(--bg-soft); color: var(--ink-soft);
  border-radius: 10px; padding: 8px 6px; font-size: 12.5px; font-weight: 700;
}
.kb-move button:active { background: rgba(0,183,200,.12); color: var(--cyan); }

/* Sheet grabber */
.modal::before {
  content: ""; display: none; width: 40px; height: 5px; border-radius: 3px; background: var(--border-strong);
  margin: 8px auto 0; position: sticky; top: 8px; z-index: 3;
}

@media (max-width: 820px) {
  /* iOS zooms into any field with font-size < 16px — keep all inputs at 16px */
  input, select, textarea, .dp__field, .search__bar input { font-size: 16px !important; }

  /* Bigger touch targets */
  .filter-btn, .modal__close, .icon-btn, .cal__nav { width: 40px; height: 40px; }
  .check { width: 24px; height: 24px; position: relative; }
  .check::before { content: ""; position: absolute; inset: -10px; }
  .cl__item .check { width: 22px; height: 22px; }
  .cl__item { padding: 6px 4px; }
  .cl__del { font-size: 20px; padding: 4px 10px; }
  .file__del { width: 26px; height: 26px; font-size: 15px; }
  .add-btn { padding: 12px; font-size: 14px; }
  .project { padding: 14px 12px; font-size: 15px; }
  .project__edit { padding: 6px 10px; font-size: 16px; }
  .btn--sm { padding: 8px 14px; font-size: 13px; }
  .seg button { padding: 8px 12px; font-size: 13px; }

  /* Tiles: a bit roomier text, readable chips */
  .tile { padding: 12px 13px; }
  .tile__title { font-size: 15px; }
  .chip { font-size: 12px; padding: 4px 9px; }

  .kb-move { display: flex; }

  /* Top bar & view bar */
  #installBtn { display: none !important; }
  .viewbar__project { display: block; flex: 1; min-width: 0; }
  body[data-view="board"][data-tab="projects"] .viewbar__project, body[data-view="dashboard"] .viewbar__project { display: none; }
  .viewbar__project { font-weight: 700; border-radius: 999px; padding: 9px 34px 9px 14px; }

  /* Bottom tab bar with icons and counts */
  .tabbar { padding: 6px 6px env(safe-area-inset-bottom); }
  .tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; padding: 6px 0; }
  .tabbar button svg { opacity: .7; }
  .tabbar button.is-active svg { opacity: 1; color: var(--cyan); }
  .tabbar__n { position: absolute; top: 4px; left: calc(50% + 8px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px; font-style: normal;
    background: rgba(var(--tint),.12); color: var(--ink-soft); font-size: 10.5px; font-weight: 800; line-height: 17px; }
  .tabbar__n:empty { display: none; }
  .tabbar button.is-active .tabbar__n { background: var(--cyan); color: #04161a; }

  /* Bottom sheets */
  .modal { padding-top: 0; overscroll-behavior: contain; }
  .modal::before { display: block; }
  .modal__inner { padding-top: 10px; }
  .card-head { flex-wrap: nowrap; }
  .item-form__foot { padding-bottom: 4px; }
  .activity__log { max-height: none; }
  .comment-form textarea { padding-top: 11px; padding-bottom: 11px; }
  .tag-picker { width: min(320px, calc(100vw - 40px)); }

  /* Every other sheet: the action buttons stay stuck to the bottom of the screen */
  .modal:not(.modal--wide) .modal__inner { padding-left: 16px; padding-right: 16px; padding-bottom: 0; }
  .modal:not(.modal--wide) .modal__foot {
    position: sticky; bottom: 0; z-index: 3; margin: 6px -16px 0; padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
    background: var(--card); border-top: 1px solid var(--border); box-shadow: 0 -10px 20px -14px rgba(0,0,0,.6);
  }
  .modal:not(.modal--wide) .modal__foot .btn { padding: 11px 18px; font-size: 14px; }
  .modal:not(.modal--wide) .modal__inner > :last-child:not(.modal__foot):not(form) { margin-bottom: calc(16px + env(safe-area-inset-bottom)); }

  /* Date picker opens as its own bottom sheet */
  .cal.cal--sheet { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: 100%; border-radius: 22px 22px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
  .cal--sheet .cal__day { font-size: 15px; }
  .cal--sheet .cal__chip { padding: 8px 12px; font-size: 13px; }

  /* Notifications: a full-width sheet under the top bar */
  .notif-panel { max-height: calc(100dvh - var(--topbar-h) - var(--tabbar-h) - 40px - env(safe-area-inset-top)); }
  .notif { padding: 12px; font-size: 14px; }

  /* Lists in modals */
  .mt-row, .sr-row, .dash-row { padding: 12px; }
  .user-row { grid-template-columns: auto 1fr; row-gap: 8px; }
  .user-row > select, .user-row > div:last-child { grid-column: 1 / -1; }
  .user-row > div:last-child { display: flex; gap: 6px; }
  .user-row > div:last-child .btn { flex: 1; }
  .member { flex-wrap: wrap; }
  .member__access { margin-left: auto; }
  .setting:not(.setting--col) { flex-wrap: wrap; }
  .setting:not(.setting--col) > div { flex: 1 1 100%; }
  .profile-users { margin-bottom: 4px; }
  .trash-row { flex-wrap: wrap; }
  .trash-row__actions { width: 100%; }
  .trash-row__actions .btn { flex: 1; }

  .offline-bar { top: calc(var(--topbar-h) + 64px + env(safe-area-inset-top)); max-width: calc(100vw - 24px); overflow: hidden; text-overflow: ellipsis; }

  /* Update banner fits small screens */
  .update-bar { left: 12px; right: 12px; transform: none; justify-content: space-between; font-size: 13px; padding-left: 14px; }

  /* Login */
  .login__card { padding: 28px 20px; border-radius: 24px; }
}

/* Very narrow phones (iPhone SE / mini) */
@media (max-width: 380px) {
  .topbar { gap: 6px; padding: 0 4px 0 10px; }
  .topbar .icon-btn, .search-trigger { width: 34px; height: 34px; }
  .mytasks-btn { padding: 6px 8px; }
  .tabbar button span { font-size: 10.5px; }
  .props { grid-template-columns: 1fr; }
}

/* Phone in landscape: keep the top bar compact */
@media (max-height: 500px) and (orientation: landscape) {
  :root { --topbar-h: 48px; }
  .tabbar { height: calc(52px + env(safe-area-inset-bottom)); }
  .tabbar button span { display: none; }
}

/* ---------- Trash ---------- */
.trash-btn {
  margin-top: auto; display: flex; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--ink-dim);
  font-size: 13px; font-weight: 700; padding: 10px 12px; border-radius: 12px; flex: none;
}
.trash-btn:hover { color: var(--ink); background: rgba(var(--tint),.05); }
.trash__tabs { align-self: flex-start; flex-wrap: wrap; border-radius: 14px; }
.trash__list { display: grid; gap: 8px; max-height: 60dvh; overflow-y: auto; }
.trash-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg-soft); border: 1px solid var(--border); }
.trash-row__main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.trash-row__title { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trash-row__title a { color: inherit; }
.trash-row__left { color: var(--yellow); font-weight: 700; }
.trash-row__actions { display: flex; gap: 6px; flex: none; }

/* ---------- Card tabs (phones only) ---------- */
.card-tabs { display: none; }

/* ---------- Offline ---------- */
.offline-bar {
  position: fixed; top: calc(var(--topbar-h) + 22px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 60;
  padding: 7px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap;
  background: rgba(255,159,28,.16); color: var(--orange); border: 1px solid rgba(255,159,28,.4); backdrop-filter: blur(12px);
  box-shadow: var(--shadow); pointer-events: none;
}
.tile.is-pending { border-style: dashed; }
.chip--pending { background: rgba(255,159,28,.14); color: var(--orange); }
.ev.is-pending { opacity: .7; }

/* ---------- Backups ---------- */
.backup-status { display: grid; gap: 4px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-soft); }
.backup-status.is-ok { border-color: rgba(47,211,154,.4); }
.backup-status.is-warn { border-color: rgba(255,193,44,.45); }
.backup-list { display: grid; gap: 8px; max-height: 50dvh; overflow-y: auto; }
code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: rgba(var(--tint),.06); padding: 1px 5px; border-radius: 5px; word-break: break-all; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--tabbar-h)); transform: translate(-50%, 20px);
  background: var(--card-soft); border: 1px solid var(--border-strong); border-radius: 999px;
  padding: 10px 18px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { color: var(--danger); }
.toast.has-action { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 18px; }
.toast button { border: 0; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; padding: 7px 14px; border-radius: 999px; }

/* ---------- Tab bar (mobile) ---------- */
.tabbar { display: none; }
.tabbar--kanban { display: none !important; }

@media (max-width: 1100px) and (min-width: 821px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .board { grid-template-columns: 220px repeat(3, minmax(220px, 1fr)); overflow-x: auto; }
}

@media (max-width: 820px) {
  :root { --topbar-h: 56px; --tabbar-h: calc(64px + env(safe-area-inset-bottom)); }
  .topbar { margin: calc(8px + env(safe-area-inset-top)) 8px 0; padding: 0 6px 0 12px; gap: 10px; }
    .user-chip .user-chip__name { display: none; }
  .user-chip { padding: 4px; }
  #usersBtn { padding: 8px 12px; }
  .board { display: block; padding: 8px 8px calc(var(--tabbar-h) + 8px); }
  .col { display: none; height: 100%; }
  .board[data-tab="projects"] .col[data-col="projects"],
  .board[data-tab="tasks"] .col[data-col="tasks"],
  .board[data-tab="plans"] .col[data-col="plans"],
  .board[data-tab="ideas"] .col[data-col="ideas"] { display: flex; }
  .project__edit { opacity: 1; }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr);
    height: var(--tabbar-h); padding: 8px 8px env(safe-area-inset-bottom);
    background: var(--glass-strong); backdrop-filter: blur(16px); border-top: 1px solid var(--border);
  }
  .tabbar button { border: 0; background: transparent; color: var(--ink-dim); font-weight: 700; font-size: 13px; border-radius: 14px; }
  .tabbar button.is-active { color: var(--ink); background: var(--gradient-soft); }
  .row, .row--3 { grid-template-columns: 1fr; }
  .item-view { grid-template-columns: 1fr; }
  .activity { height: auto; max-height: none; }
  .activity__log { max-height: 50dvh; }
  .modal__inner--card { padding: 12px 12px calc(14px + env(safe-area-inset-bottom)); }
  /* Item card on phones: a full-height sheet with Details / History tabs */
  .modal--wide { height: 92dvh; }
  .modal--wide { overflow: hidden; }
  .modal--wide #modalBody { height: calc(100% - 13px); }
  .modal--wide .modal__inner--card { height: 100%; display: flex; flex-direction: column; min-height: 0; padding-bottom: 0; }
  .modal__inner--card > * { min-width: 0; max-width: 100%; }
  .modal { overflow-x: hidden; }
  .card-tabs {
    display: flex; flex: none; padding: 3px; gap: 2px; border-radius: 12px; background: var(--bg-soft); border: 1px solid var(--border);
  }
  .card-tabs button {
    flex: 1; border: 0; background: transparent; color: var(--ink-soft); font-weight: 700; font-size: 14px; padding: 9px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  }
  .card-tabs button.is-active { background: var(--card); color: var(--ink); box-shadow: 0 1px 0 rgba(var(--tint),.06) inset, 0 4px 12px -6px rgba(0,0,0,.5); }
  .card-tabs__n { font-size: 12px; color: var(--cyan); }
  .modal--wide .item-view { display: block; flex: 1; min-height: 0; }
  .item-view[data-pane="details"] .activity, .item-view[data-pane="activity"] > .item-form { display: none; }
  /* Details pane: scrolls on its own, spans the full sheet width (no sideways shift), actions stuck to the bottom */
  .item-view > .item-form {
    height: 100%; max-height: none; overflow-y: auto; overflow-x: hidden;
    margin: 0 -12px; padding: 2px 12px 0;
  }
  .item-view > .item-form .item-form__foot {
    position: sticky; bottom: 0; z-index: 3; margin: auto -12px 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: var(--card); border-top: 1px solid var(--border); box-shadow: 0 -10px 20px -14px rgba(0,0,0,.6);
  }
  .item-view > .item-form .item-form__foot .btn { padding: 11px 18px; font-size: 14px; }
  .item-view > .item-form .item-form__foot .btn--primary { min-width: 120px; }
  .item-view > .activity {
    height: 100%; max-height: none; border: 0; background: transparent; padding: 0; border-radius: 0; gap: 10px;
  }
  .activity__head { padding-top: 2px; }
  .activity__log { flex: 1; min-height: 0; max-height: none; gap: 14px; padding-bottom: 6px; }
  .ev { font-size: 14px; }
  .ev__text { font-size: 14.5px; line-height: 1.5; padding: 9px 12px; }
  .ev__files .file--img > a { width: 140px; height: 105px; }
  .item-view > .activity .comment-form {
    position: relative; margin: 0 -12px; padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
    background: var(--card); border-top: 1px solid var(--border);
  }
  .item-view > .activity .comment-form textarea { background: var(--bg-soft); border-radius: 22px; min-height: 44px; }
  .item-view > .activity .comment-form__send { border-radius: 50%; width: 34px; height: 34px; right: 17px; bottom: calc(15px + env(safe-area-inset-bottom)); }
  .item-view > .activity .comment-form__attach { left: 18px; bottom: calc(16px + env(safe-area-inset-bottom)); }
  /* Phone top bar: logo + icon buttons only, so everything fits in 360px */
  .brand > span { display: none; }
  #usersBtn { display: none; }
  .topbar__actions { gap: 6px; }
  .topbar .icon-btn { width: 36px; height: 36px; }
  /* Views on phones */
  .viewbar { margin: 8px 8px 0; gap: 6px; }
  .views button { padding: 8px 12px; }
  .views button span { display: none; }
  body[data-view="kanban"] .viewbar__project, body[data-view="calendar"] .viewbar__project { display: block; flex: 1; min-width: 0; }
  .board:not([data-view="board"]) .col { display: none !important; }
  .board[data-view="kanban"] #kanbanView, .board[data-view="calendar"] #calendarView, .board[data-view="dashboard"] #dashboardView { height: 100%; }
  body:not([data-view="board"]) .tabbar { display: none; }
  body:not([data-view="board"]) { --tabbar-h: 0px; }
  .view--kanban, .view--calendar { padding: 10px; }
  .kb-toolbar h2 { display: none; }
  .kb-toolbar input { width: 100%; }
  .kb-toolbar select { flex: 1; }
  /* Kanban on phones: one column at a time, switched from the bottom bar (like the Board) */
  .kb { display: block; }
  .kb-col { display: none; height: 100%; border: 0; background: transparent; padding: 0; }
  .kb[data-kb-tab="todo"] .kb-col--todo, .kb[data-kb-tab="in_progress"] .kb-col--in_progress, .kb[data-kb-tab="done"] .kb-col--done { display: flex; }
  body[data-view="kanban"] .tabbar--kanban { display: grid !important; grid-template-columns: repeat(3, 1fr); }
  body[data-view="kanban"] { --tabbar-h: calc(64px + env(safe-area-inset-bottom)); }
  body[data-view="kanban"] .board { padding-bottom: calc(var(--tabbar-h) + 8px); }
  .cal-grid { display: none; }
  .cal-legend { display: none; }
  .cal-nav h2 { min-width: 0; font-size: 16px; }
  .cal-agenda { display: grid; gap: 10px; overflow-y: auto; flex: 1; align-content: start; }
  .cal-agenda__day { display: grid; gap: 4px; }
  .cal-agenda__day.is-today .cal-agenda__date { color: var(--cyan); }
  .cal-agenda__date { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
  .cal-agenda .cal-item { font-size: 13.5px; padding: 8px 10px; white-space: normal; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi__value { font-size: 28px; }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-toolbar { flex-wrap: wrap; }
  .load__barcol { display: none; }
  .load th, .load td { padding-left: 4px; padding-right: 4px; font-size: 12.5px; }
  .search-trigger { flex: 0 0 auto; margin-left: auto; padding: 0; width: 38px; height: 38px; justify-content: center; border-radius: 50%; }
  .search-trigger__text, .search-trigger__kbd, .mytasks-btn__text { display: none; }
  .mytasks-btn { padding: 8px 10px; }
  .modal--search { margin-top: 0; width: 100vw; max-height: 92dvh; }
  .props { grid-template-columns: 1fr 1fr; }
  .title-input { font-size: 19px; }
  .modal--wide { width: 100vw; }
  .notif-panel { right: 8px; left: 8px; width: auto; top: calc(var(--topbar-h) + 16px + env(safe-area-inset-top)); }
  .user-row { grid-template-columns: auto 1fr; }
  .user-row > :nth-child(3), .user-row > :nth-child(4) { grid-column: span 1; }
  .modal { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 24px 24px 0 0; }
  .modal__inner { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}
