.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.small { font-size: 13px; }
.narrow-only { display: none; }

.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 22px; padding: 18px 12px;
  border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; font-weight: 800; font-size: 17px; text-decoration: none; }
.nav { display: grid; gap: 3px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--radius); color: var(--muted); font-weight: 700; text-decoration: none; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--ink); }
.whoami { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 8px; min-width: 0; }
.whoami-name { font-weight: 700; line-height: 1.25; }

.main { min-width: 0; }
.page { padding: 26px clamp(16px, 3vw, 34px) 40px; display: grid; gap: 18px; max-width: 1320px; }
.page-head { display: flex; gap: 4px 14px; }
.page-head:not(.row) { flex-direction: column; }
.note { padding: 10px 14px; border-radius: var(--radius); background: var(--warn-soft); }

.count { margin-left: 8px; color: var(--muted); font-weight: 700; font-size: 14px; }

.quick-add { display: flex; gap: 10px; }
.quick-add input { flex: 1; min-width: 0; }

.group { display: grid; gap: 8px; }
.group-late h2 { color: var(--danger); }
.task-list { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.task-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(120px, auto); gap: 12px; align-items: center; width: 100%;
  padding: 11px 14px; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; cursor: pointer;
}
.task-row:last-child { border-bottom: 0; }
.task-row:hover { background: var(--surface-2); }
.task-row-main { display: grid; min-width: 0; }
.task-row-title { font-weight: 700; overflow-wrap: break-word; }
.task-row-meta { font-size: 13px; color: var(--muted); }

.prio { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.prio-low { background: transparent; box-shadow: inset 0 0 0 2px var(--muted); }
.prio-normal { background: var(--accent); }
.prio-high { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

.status { padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--surface-2); white-space: nowrap; }
.status-progress { background: var(--accent-soft); }
.status-review { background: var(--warn-soft); }
.due { font-size: 13px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.due-today { color: var(--warn); }
.due-late { color: var(--danger); }
.late { color: var(--danger); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; }
.filters select { width: auto; min-width: 190px; }

.board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 12px; align-items: start; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.column { display: grid; gap: 8px; padding: 10px; background: var(--surface-2); border-radius: 12px; min-height: 240px; align-content: start; scroll-snap-align: start; }
.column h2 { font-size: 14px; padding: 2px 4px; }
.column-cards { display: grid; gap: 8px; min-height: 180px; align-content: start; }
.column-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 13px; }
.column-cards:has(.card-holder) .column-empty { display: none; }

.card { display: grid; gap: 7px; padding: 11px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.card:hover { border-color: var(--muted); }
.card.draggable { cursor: grab; }
.card-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.card-project { font-size: 12px; color: var(--muted); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-title { font-weight: 700; line-height: 1.35; overflow-wrap: break-word; min-width: 0; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-right { display: flex; align-items: center; gap: 8px; }
.drag-source { display: none; }
.card-holder { border: 2px dashed var(--accent); border-radius: var(--radius); background: var(--accent-soft); }
.ghost { position: fixed; z-index: 900; left: 0; top: 0; pointer-events: none; box-shadow: var(--shadow); rotate: 1.5deg; opacity: .96; }

.dialog-side {
  width: min(640px, 100vw); height: 100dvh; max-height: 100dvh; margin: 0 0 0 auto; border-radius: 0; border-width: 0 0 0 1px; padding: 16px 22px 26px;
}
.task-panel { display: grid; gap: 16px; }
.panel-top { margin: -4px 0; }
.title-input { font-size: 20px; font-weight: 800; min-height: 0; line-height: 1.3; }
.task-title { font-size: 20px; overflow-wrap: break-word; }
.description { white-space: pre-wrap; overflow-wrap: break-word; }
.segmented { display: grid; grid-template-columns: repeat(4, 1fr); padding: 3px; gap: 3px; background: var(--surface-2); border-radius: var(--radius); }
.segmented button { min-height: 38px; padding: 4px 6px; background: none; border: 0; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--muted); }
.segmented button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / 14%); }
.segmented button:disabled { cursor: default; opacity: .5; }
.segmented button.active:disabled { opacity: 1; }
.props { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.value { display: flex; align-items: center; gap: 8px; min-height: 42px; }
.comments { display: grid; gap: 12px; }
.comment { display: flex; gap: 10px; }
.comment-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.comment-body { white-space: pre-wrap; overflow-wrap: break-word; min-width: 0; }
.history { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; }

.check { display: flex; align-items: center; gap: 9px; min-height: 34px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.check-list { display: grid; gap: 2px; max-height: 220px; overflow-y: auto; }

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.project-card { display: grid; gap: 10px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.project-open { text-decoration: none; display: grid; gap: 3px; }
.project-open:hover h2 { color: var(--accent); }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

.members { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.member { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.member:last-child { border-bottom: 0; }
.member-off { opacity: .6; }
.member-main { flex: 1; min-width: 170px; }
.member-name { font-weight: 700; }
.member-load { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.member-load b { color: var(--ink); }
.member-load .late b, .member-load .late { color: var(--danger); }
select.compact { width: auto; min-height: 30px; padding: 2px 8px; font-size: 13px; }

.settings { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.panel { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }

.auth { display: grid; place-items: center; min-height: 100dvh; padding: 16px; }
.auth-card { display: grid; gap: 16px; width: min(400px, 100%); padding: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.auth-card .brand { padding: 0; font-size: 20px; }
.full { min-height: 100dvh; align-content: center; }

@media (max-width: 760px) {
  .shell { display: block; padding-bottom: 66px; }
  .sidebar {
    position: fixed; z-index: 50; left: 0; right: 0; top: auto; bottom: 0; height: auto; padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
    background: var(--surface); border-right: 0; border-top: 1px solid var(--line); display: block;
  }
  .sidebar .brand, .whoami { display: none; }
  .nav { grid-template-columns: repeat(5, 1fr); }
  .nav-item { flex-direction: column; gap: 2px; padding: 5px 2px; font-size: 11px; text-align: center; white-space: nowrap; }
  .wide-only { display: none; }
  .narrow-only { display: inline; }
  .page { padding-top: 18px; }
  h1 { font-size: 22px; }
  .task-row { grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; }
  .task-row .status { display: none; }
  .task-row .due { grid-column: 2; white-space: normal; }
  .board { display: flex; margin: 0 -16px; padding: 0 16px 8px; scroll-snap-type: x mandatory; }
  .column { flex: 0 0 84%; }
  .filters select { flex: 1; min-width: 140px; }
  .props { grid-template-columns: 1fr; }
  .dialog-side { width: 100vw; border: 0; padding: 12px 16px 20px; margin: 0; }
  .member-load { width: 100%; padding-left: 40px; }
}
