/* mobile + popover + board aesthetics from the proposed redesign */
html, body { max-width: 100%; }
body { overflow-x: hidden; }

.orgbar-end { flex-shrink: 0; }
.popover { position: fixed; z-index: 200; max-width: calc(100vw - 24px); }

/* ---- board: column wash + quieter cards ---- */
.board { gap: 14px; align-items: stretch; }
.col {
  border-radius: 14px;
  padding: 14px 12px 16px;
  background: #eceef1;
  border: 1px solid transparent;
}
.col[data-status="not_started"] { background: #eceef2; }
.col[data-status="in_progress"] { background: #f3eee4; }
.col[data-status="implemented"] { background: #e7f0ea; }
.col[data-status="na"] { background: #eef0f2; }
.col-head {
  padding: 2px 6px 10px;
  align-items: baseline;
}
.col-head .name {
  font-size: 11px;
  letter-spacing: .08em;
  font-weight: 700;
  color: #5c6573;
}
.col[data-status="in_progress"] .col-head .name { color: #8a5a18; }
.col[data-status="implemented"] .col-head .name { color: #2d6a4f; }
.col-head .count {
  margin-left: auto;
  background: transparent;
  color: inherit;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  padding: 0;
}
.col[data-status="not_started"] .col-head {
  border-bottom: 2px solid #c5cad3;
  margin-bottom: 10px;
}
.col[data-status="in_progress"] .col-head {
  border-bottom: 2px solid #c9842a;
  margin-bottom: 10px;
}
.col[data-status="implemented"] .col-head {
  border-bottom: 2px solid #3d8f68;
  margin-bottom: 10px;
}
.col[data-status="na"] .col-head {
  border-bottom: 2px solid #cfd3d8;
  margin-bottom: 10px;
}
.col-cards { gap: 12px; }
.col-cards > .listmeta {
  display: block;
  padding: 18px 8px;
  color: #7a8494;
  font-weight: 500;
}

.card {
  gap: 8px;
  border-radius: 12px;
  border: 1px solid rgba(24, 32, 48, .08);
  box-shadow: 0 1px 2px rgba(24, 32, 48, .04);
  padding: 12px 12px 12px 14px;
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
  min-height: 0;
  height: auto;
}
.card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: #c5cad3;
}
.col[data-status="in_progress"] .card::before { background: #c9842a; }
.col[data-status="implemented"] .card::before { background: #3d8f68; }
.col[data-status="na"] .card::before { background: #b8bec8; }
.card .title {
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.35;
}
.card .chips { gap: 6px; }
.card .chip {
  background: var(--surface2);
  border-color: var(--line);
  padding: 3px 8px;
  color: var(--muted2);
}
.card .chip.dashed {
  color: var(--muted);
  background: var(--surface);
  border-style: dashed;
  border-color: var(--dash);
}
.card .chip.red {
  color: var(--red);
  background: var(--red-bg);
  border-color: var(--red-line);
}
.card .chip.green {
  color: var(--green);
  background: var(--green-bg);
  border-color: var(--green-line);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .card .idchip { color: #8d95a6; }
  :root:not([data-theme="light"]) .col-head .name { color: #8d95a6; }
}
:root[data-theme="dark"] .card .idchip { color: #8d95a6; }
:root[data-theme="dark"] .col-head .name { color: #8d95a6; }
.card .idchip {
  background: transparent;
  border: 0;
  padding: 0;
  color: #7b8492;
  font-size: 11px;
}
.card .foot { margin-top: 2px; }
.avatar-btn {
  background: transparent;
  border-color: transparent;
  padding: 0;
}
.pill { font-size: 10.5px; font-weight: 700; letter-spacing: .01em; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .col[data-status="not_started"] { background: #1e2229; }
  :root:not([data-theme="light"]) .col[data-status="in_progress"] { background: #2a241c; }
  :root:not([data-theme="light"]) .col[data-status="implemented"] { background: #1c2722; }
  :root:not([data-theme="light"]) .col[data-status="na"] { background: #1d2127; }
  :root:not([data-theme="light"]) .card {
    background: #2a3038;
    border-color: rgba(255,255,255,.06);
  }
}
:root[data-theme="dark"] .col[data-status="not_started"] { background: #1e2229; }
:root[data-theme="dark"] .col[data-status="in_progress"] { background: #2a241c; }
:root[data-theme="dark"] .col[data-status="implemented"] { background: #1c2722; }
:root[data-theme="dark"] .col[data-status="na"] { background: #1d2127; }
:root[data-theme="dark"] .card {
  background: #2a3038;
  border-color: rgba(255,255,255,.06);
}

@media (max-width: 900px) {
  .pagehead,
  .filterbar,
  .boardwrap,
  .wrap {
    padding-left: 12px;
    padding-right: 12px;
  }
  .pagehead { padding-top: 12px; }
  .pagehead h1 { font-size: 20px; }

  .topbar {
    height: auto;
    min-height: 52px;
    padding: 8px 10px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .orgbar {
    height: 48px;
    padding: 0 10px;
    gap: 8px;
    flex-wrap: nowrap;
  }
  .org-search { display: none; }
  .switcher { max-width: none; flex: 1 1 auto; }
  .switcher-org { display: none; }
  .assessbar { top: 0; padding-left: 12px; padding-right: 12px; }
  .brand-name { font-size: 14px; }
  .tabs {
    gap: 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { white-space: nowrap; }

  .filterbar { padding-top: 12px; padding-bottom: 12px; }
  .filterbar .search { width: 100%; min-width: 0; }
  .filterbar select { max-width: 100%; }

  .boardwrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 24px;
  }
  .board {
    flex-direction: row;
    flex-wrap: nowrap;
    width: 100%;
    align-items: stretch;
  }
  .col {
    flex: 1 1 0;
    min-width: 0;
  }
  .density-toggle { display: none; }
  .col-cards { max-height: none; }
  .lane .board { width: 100%; }

  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat .value { font-size: 26px; }
  .famgrid { grid-template-columns: 1fr; gap: 12px; }

  .row {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
    min-height: 0;
  }
  .row .id,
  .row .due { width: auto; }
  .row .rtitle { white-space: normal; }

  .auth { padding: 12px !important; max-width: 100%; }
  .panel { padding: 16px; }

  .modal-backdrop { padding: 8px; align-items: stretch; }
  .modal { width: 100%; max-width: 100%; border-radius: 10px; }
  .modal h2 { font-size: 18px; padding-left: 14px; padding-right: 14px; }
  .modal-top, .modal-body { padding-left: 14px; padding-right: 14px; }
  .modal-body {
    flex-direction: column;
    gap: 16px;
  }
  .modal-rail { width: 100%; }
  .evrow { flex-wrap: wrap; }
}

@media (max-width: 700px) {
  .boardwrap { overflow-x: auto; }
  .board {
    width: max-content;
    align-items: flex-start;
  }
  .col {
    flex: 0 0 min(260px, calc(100vw - 32px));
    width: min(260px, calc(100vw - 32px));
    min-width: min(260px, calc(100vw - 32px));
  }
}
@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr; }
  .topbar .signout { padding: 5px 8px; }
  .menu-btn span { /* keep the word Menu — that was the point */ }
}
