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

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

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

button { cursor: pointer; }

[hidden] { display: none !important; }

::selection {
  background: rgba(46, 66, 165, 0.2);
  color: var(--text);
}

.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  display: inline-block;
  vertical-align: middle;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  font-feature-settings: "liga";
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 20;
  user-select: none;
}

.icon-fill {
  font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 20;
}

#app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

body.modal-open { overflow: hidden; }

/* ---------- top bar ---------- */

.topbar {
  flex: 0 0 auto;
  min-height: var(--topbar-h);
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: env(safe-area-inset-top) max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left));
  z-index: 20;
  user-select: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.mark {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--gold);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.brand-name {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  color: #fff;
}

.brand-sub {
  font-size: 12px;
  font-weight: 400;
  color: var(--topbar-muted);
}

.search {
  flex: 0 0 auto;
  width: 208px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 4px 8px;
  color: var(--topbar-muted);
}

.search:hover,
.search:focus-within { background: rgba(255, 255, 255, 0.15); }

.search .material-symbols-outlined {
  font-size: 16px;
  color: var(--status-todo);
}

.search input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  padding: 2px 0;
  color: #fff;
  font-size: 12px;
  outline: none;
  box-shadow: none;
}

.search input::placeholder { color: var(--status-todo); }

.kbd {
  font-family: var(--mono);
  font-size: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--topbar-muted);
  border-radius: 4px;
  padding: 1px 4px;
}

.top-actions {
  flex: 0 0 auto;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.viewbar {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  gap: 2px;
  height: 44px;
  padding: 0 16px 0 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.viewbar::-webkit-scrollbar { display: none; }

.viewbar a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.viewbar a .material-symbols-outlined { font-size: 18px; }

.viewbar a:hover { color: var(--text); }

.viewbar a[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.viewbar a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 4px;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.primary-btn:hover { background: var(--accent-hover); }

.primary-btn .material-symbols-outlined { font-size: 16px; }

.icon-btn {
  position: relative;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--topbar-muted);
  padding: 0;
}

.icon-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--status-blocked);
  box-shadow: 0 0 0 2px var(--navy);
}

.v-rule {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.16);
  margin: 0 2px;
}

.me {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #334155;
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast {
  position: fixed;
  top: 68px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  background: var(--navy);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
}

.popover,
.menu {
  position: fixed;
  z-index: 40;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(4, 18, 54, 0.12);
  min-width: 200px;
  padding: 4px;
}

.popover p,
.menu button,
.menu .menu-note {
  margin: 0;
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.popover p {
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.45;
}

.menu button:hover:not(:disabled) { background: var(--canvas); }

.menu button:disabled {
  color: var(--text-secondary);
  opacity: 0.6;
  cursor: not-allowed;
}

.menu .danger { color: var(--status-blocked); }

.menu-note {
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 11px;
}

/* ---------- view frame ---------- */

.view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.soon {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 24px 80px;
  width: min(640px, 100%);
  margin: 0 auto;
}

.soon h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.soon p {
  margin: 0;
  color: var(--text-secondary);
}

.bottomnav { display: none; }

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

.board-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.filters {
  flex: 0 0 auto;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}

.filters-inner {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
}

.chip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.chip-label {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.chip-label .material-symbols-outlined { font-size: 14px; }

.chip-label.quiet {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.chip-label.quiet .material-symbols-outlined { font-size: 13px; }

.chips {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.chip[aria-pressed="true"] {
  background: rgba(46, 66, 165, 0.1);
  color: var(--accent);
  border-color: var(--accent);
}

.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.seg {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 500;
}

.seg:hover {
  background: var(--canvas);
  color: var(--text);
}

.seg[aria-pressed="true"] {
  background: var(--text);
  color: #fff;
  font-weight: 600;
}

.legend {
  margin-left: auto;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-secondary);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.legend i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: block;
  font-style: normal;
}

.board-frame {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.board-scroll {
  flex: 1;
  min-height: 0;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px;
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  overflow-x: auto;
  overflow-y: hidden;
}

.column {
  flex: 1 0 250px;
  width: 280px;
  max-width: 320px;
  min-width: 250px;
  min-height: 0;
  max-height: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--col, var(--status-todo));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.column-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 10px 10px 14px;
  border-bottom: 1px solid var(--border);
}

.column-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.column-title h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}

.count {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
}

.column .icon-btn {
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
}

.column .icon-btn:hover {
  color: var(--text);
  background: var(--canvas);
}

.column .icon-btn .material-symbols-outlined { font-size: 16px; }

.rename-input {
  width: 140px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 4px 6px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--accent);
}

.column-cards {
  flex: 1 1 auto;
  min-height: 48px;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.column-cards::-webkit-scrollbar { width: 5px; }
.column-cards::-webkit-scrollbar-track { background: transparent; }
.column-cards::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}
.column-cards::-webkit-scrollbar-thumb:hover { background: var(--status-todo); }

.empty-col {
  margin: 0;
  padding: 8px 2px 2px;
  font-size: 12px;
  color: var(--text-secondary);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
}

.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-hover);
}

.card:hover h3 { color: var(--accent); }

.card.is-alert { border-color: rgba(227, 29, 28, 0.35); }

.card.is-done {
  background: rgba(245, 246, 247, 0.75);
  opacity: 0.85;
}

.card.is-done:hover {
  background: #fff;
  opacity: 1;
}

.card.is-lifting {
  position: fixed;
  z-index: 35;
  margin: 0;
  pointer-events: none;
  cursor: grabbing;
  opacity: 0.95;
  transform: rotate(2deg);
  box-shadow: 0 18px 40px rgba(4, 18, 54, 0.2);
  outline: 2px solid rgba(46, 66, 165, 0.3);
}

.card-top,
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-top { margin-bottom: 8px; }

.dept {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
}

.card.is-alert .dept {
  color: var(--status-blocked);
  background: #fdecec;
  border-color: rgba(227, 29, 28, 0.2);
}

.card.is-done .dept { background: #fff; }

.pri-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.pri-dot.p1 { background: var(--status-blocked); }
.pri-dot.p2 { background: var(--gold); }
.pri-dot.p3 { background: var(--status-todo); }

.done-check {
  color: var(--status-done);
  font-size: 15px;
}

.card h3 {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
}

.card.is-done h3 {
  color: var(--text-secondary);
  text-decoration: line-through;
}

.flag {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  margin: -4px 0 10px;
  font-size: 11px;
  line-height: 1.35;
}

.flag .material-symbols-outlined { font-size: 13px; margin-top: 1px; }
.flag.alert { color: var(--status-blocked); }
.flag.note { color: var(--text-secondary); }

.card-foot {
  padding-top: 8px;
  border-top: 1px solid #eef1f4;
}

.card.is-done .card-foot { border-top-color: #e2e5ea; }

.due {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.due .material-symbols-outlined {
  font-size: 13px;
  color: var(--status-todo);
}

.avatars { display: flex; align-items: center; }

.avatar {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  box-shadow: 0 0 0 2px #fff;
}

.avatar + .avatar { margin-left: -6px; }

.drop-slot {
  height: 80px;
  border: 2px dashed rgba(46, 66, 165, 0.4);
  background: rgba(46, 66, 165, 0.04);
  border-radius: var(--radius);
  color: rgba(46, 66, 165, 0.75);
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.drop-slot .material-symbols-outlined { font-size: 16px; }

.column-add {
  flex: 0 0 auto;
  padding: 8px;
  border-top: 1px solid var(--border);
  background: rgba(245, 246, 247, 0.5);
}

.add-card {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.add-card:hover {
  color: var(--accent);
  background: #fff;
}

.add-card .material-symbols-outlined { font-size: 16px; }

.add-column {
  flex: 0 0 112px;
  width: 112px;
  min-height: 112px;
  align-self: flex-start;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px;
}

.add-column:hover {
  border-color: rgba(46, 66, 165, 0.6);
  background: #fff;
  color: var(--accent);
}

.add-column .material-symbols-outlined { font-size: 22px; }

.add-column-form {
  flex: 0 0 180px;
  width: 180px;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  background: #fff;
}

.add-column-form .text-btn { align-self: flex-start; }

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

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(4, 18, 54, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px;
  overflow-y: auto;
}

.modal {
  width: min(672px, 100%);
  margin: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 48px rgba(4, 18, 54, 0.18);
}

.modal-head,
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 24px;
}

.modal-head { border-bottom: 1px solid var(--border); }

.crumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.crumb .here {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font-weight: 600;
}

.crumb .here .material-symbols-outlined { font-size: 15px; }

.crumb code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-secondary);
}

.modal-tools { display: flex; align-items: center; gap: 2px; }

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.form-label .material-symbols-outlined { font-size: 14px; }

.field,
.select,
.area {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
  font-size: 12px;
}

.field:focus,
.select:focus,
.area:focus,
.rename-input:focus,
.add-column-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.title-field {
  font-size: 16px;
  font-weight: 700;
  background: var(--canvas);
  padding: 8px 12px;
}

.title-field:focus { background: #fff; }

.title-field.is-invalid { border-color: var(--status-blocked); }

.field-error {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--status-blocked);
}

.area {
  min-height: 84px;
  resize: vertical;
  line-height: 1.5;
  padding: 12px;
}

.meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.prios {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pri {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
}

.pri[aria-checked="true"] { font-weight: 600; }

.pri.p1[aria-checked="true"] {
  color: var(--status-blocked);
  background: #fdecec;
  border-color: rgba(227, 29, 28, 0.45);
}

.pri.p2[aria-checked="true"] {
  color: var(--text);
  background: #fbf7ef;
  border-color: var(--gold);
}

.pri.p3[aria-checked="true"] {
  color: var(--text);
  background: var(--canvas);
  border-color: var(--status-todo);
}

.dates {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dates .field {
  font-family: var(--mono);
  min-width: 0;
}

.arrow {
  color: var(--text-secondary);
  font-family: var(--mono);
  flex: 0 0 auto;
}

.assignees {
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.person-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 8px 4px 4px;
  font-size: 12px;
  font-weight: 600;
}

.person-pill .avatar {
  width: 16px;
  height: 16px;
  font-size: 8px;
  box-shadow: none;
  color: #fff;
}

.pill-x {
  border: 0;
  background: transparent;
  color: inherit;
  width: 16px;
  height: 16px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pill-x .material-symbols-outlined { font-size: 13px; }
.pill-x:hover { color: var(--status-blocked); }

.dashed {
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dashed:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.dashed .material-symbols-outlined { font-size: 14px; }

.picker {
  position: relative;
  flex: 1 0 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  padding: 4px;
}

.picker button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 600;
}

.picker button:hover { background: var(--canvas); }

.picker-empty {
  margin: 0;
  padding: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.modal-foot {
  background: var(--canvas);
  border-top: 1px solid var(--border);
}

.edited {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-secondary);
}

.foot-actions { display: flex; align-items: center; gap: 8px; }

.text-btn,
.ghost-btn {
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
}

.text-btn {
  border: 0;
  background: transparent;
  color: var(--text-secondary);
}

.text-btn:hover { color: var(--text); }

.ghost-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
}

.ghost-btn:hover {
  color: var(--text);
  background: var(--canvas);
}

.danger-btn {
  border: 0;
  background: var(--status-blocked);
  color: #fff;
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
}

.confirm-copy {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

/* ---------- mobile ---------- */

@media (max-width: 767px) {
  body { overflow: hidden; }

  .topbar {
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: calc(8px + env(safe-area-inset-top)) 16px 10px;
  }

  .brand-sub,
  .kbd,
  .viewbar,
  .top-actions .primary-btn .label { display: none; }

  .search {
    order: 5;
    flex: 1 0 100%;
    width: auto;
  }

  .top-actions .icon-btn,
  .top-actions .primary-btn,
  .me {
    width: 44px;
    height: 44px;
  }

  .top-actions .primary-btn { justify-content: center; padding: 0; }

  .legend { display: none; }

  .filters-inner { padding: 0 16px; }

  .board-scroll {
    scroll-snap-type: x mandatory;
    padding: 16px 16px 24px;
    gap: 12px;
  }

  .column,
  .add-column,
  .add-column-form {
    flex: 0 0 calc(100vw - 32px);
    width: calc(100vw - 32px);
    max-width: none;
    scroll-snap-align: center;
    scroll-snap-stop: always;
  }

  .add-card,
  .seg,
  .chip,
  .column .icon-btn {
    min-height: 44px;
  }

  .chip { padding: 0 14px; }

  .meta { grid-template-columns: 1fr; }

  .modal-head,
  .modal-foot,
  .modal-body { padding-left: 16px; padding-right: 16px; }

  .modal-foot { flex-wrap: wrap; }

  .bottomnav {
    display: flex;
    flex: 0 0 auto;
    background: var(--navy);
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .bottomnav::-webkit-scrollbar { display: none; }

  .bottomnav a {
    flex: 0 0 auto;
    min-width: 76px;
    min-height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 8px 10px;
    color: var(--topbar-muted);
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    text-align: center;
  }

  .bottomnav a .material-symbols-outlined { font-size: 20px; }

  .bottomnav a[aria-current="page"] {
    color: var(--gold);
    box-shadow: inset 0 2px 0 var(--gold);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .card.is-lifting { transform: none; }
}

/* ---------- shared pages ---------- */

.mono { font-family: var(--mono); }

.page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--canvas);
}

.page-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.page-head h1,
.area-block h2,
.area-card h3,
.st-card h2 {
  margin: 0;
  font-weight: 700;
  color: var(--text);
}

.page-head h1 { font-size: 20px; }
.page-head p { margin: 4px 0 0; color: var(--text-secondary); font-size: 12px; }
.page-scroll { flex: 1; min-height: 0; overflow: auto; padding: 16px 24px 32px; }

.split { flex: 1; min-height: 0; display: flex; }

/* main table */
.mt-searchbox {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--canvas);
  padding: 6px 10px;
  min-width: 220px;
}
.mt-searchbox input {
  border: 0;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 12px;
  box-shadow: none;
}
.mt-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; }
.mt-group-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.mt-badge { color: #fff; font-size: 12px; font-weight: 700; border-radius: 4px; padding: 2px 8px; }
.mt-wrap { overflow-x: auto; }
.mt-grid {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) 88px 120px 72px 80px 150px 80px;
  gap: 8px;
  align-items: center;
  min-width: 920px;
  padding: 0 12px;
}
.mt-cols { height: 32px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-secondary); background: var(--canvas); }
.mt-row { min-height: 40px; border-top: 1px solid var(--border); font-size: 13px; }
.mt-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.mt-title span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-comments { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-size: 11px; font-weight: 600; }
.mt-comments .material-symbols-outlined { font-size: 12px; }
.mt-status { border: 0; background: var(--canvas); border-radius: 4px; font-size: 12px; font-weight: 600; padding: 4px; }
.pri-pill { font-size: 11px; font-weight: 700; text-align: center; border-radius: 4px; padding: 4px 0; }
.pri-pill.p1 { color: var(--status-blocked); background: #fdecec; }
.pri-pill.p2 { color: var(--text); background: #fbf7ef; }
.pri-pill.p3 { color: var(--text-secondary); background: var(--canvas); }
.mt-bar { position: relative; height: 20px; background: var(--canvas); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.mt-bar i { display: block; height: 100%; background: var(--accent); }
.mt-bar em { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-style: normal; font-family: var(--mono); font-size: 10px; color: var(--text); }
.mt-bar em.on-fill { color: #fff; clip-path: inset(0 calc(100% - var(--fill, 0%)) 0 0); }
.mt-money { font-family: var(--mono); font-size: 12px; text-align: right; }

/* areas */
.area-block { margin-bottom: 22px; }
.area-block header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.area-block h2 { font-size: 16px; }
.area-block header p { margin: 0; color: var(--text-secondary); font-size: 12px; }
.area-block .count { margin-left: auto; }
.avatar.lg { width: 28px; height: 28px; font-size: 11px; }
.area-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.area-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.area-card-top, .area-mile, .area-progress div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.area-card h3 { font-size: 16px; }
.area-card p { margin: 8px 0 0; color: var(--text-secondary); font-size: 12px; }
.health { font-size: 11px; font-weight: 700; text-transform: capitalize; border-radius: 999px; padding: 2px 8px; }
.health.on-track { color: var(--status-done); background: #eef8f2; }
.health.at-risk { color: #8a5a12; background: #fbf7ef; }
.health.delayed { color: var(--status-blocked); background: #fdecec; }
.area-mile { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-secondary); }
.area-mile span:nth-child(2) { flex: 1; min-width: 0; }
.area-mile .mono { white-space: nowrap; }
.area-mile .material-symbols-outlined { font-size: 14px; }
.area-progress { margin-top: 10px; font-size: 12px; color: var(--text-secondary); }
.track { height: 6px; background: var(--canvas); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.track i { display: block; height: 100%; background: var(--status-done); }
.track i.at-risk { background: var(--gold); }
.track i.delayed { background: var(--status-blocked); }

/* timeline */
.tl-tools, .tl-zoom { display: flex; align-items: center; gap: 6px; }
.tl-zoom { background: var(--canvas); border: 1px solid var(--border); border-radius: 6px; padding: 2px; }
.tl-zoom button { border: 0; background: transparent; border-radius: 4px; padding: 4px 8px; font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: capitalize; }
.tl-zoom button[aria-pressed="true"] { background: var(--surface); color: var(--text); }
.tl-board { flex: 1; min-height: 0; overflow: auto; background: var(--surface); }
.tl-head, .tl-row, .tl-proj { display: flex; align-items: center; }
.tl-head { position: sticky; top: 0; z-index: 2; background: var(--surface); border-bottom: 1px solid var(--border); height: 36px; }
.tl-day { flex: none; font-family: var(--mono); font-size: 10px; color: var(--text-secondary); }
.tl-day.is-today { color: var(--accent); font-weight: 700; }
.tl-day.is-end { background: var(--canvas); }
.tl-canvas { position: relative; }
.tl-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); z-index: 1; }
.tl-proj { width: 100%; text-align: left; gap: 6px; background: var(--canvas); border: 0; border-bottom: 1px solid var(--border); padding: 8px 12px; font-weight: 700; }
.tl-row { position: relative; height: 36px; border-bottom: 1px solid var(--border); }
.tl-name { width: 220px; flex: none; padding: 0 12px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.tl-bar { position: absolute; top: 8px; height: 20px; border-radius: 4px; color: var(--text); font-size: 11px; font-weight: 600; line-height: 20px; padding: 0 6px; overflow: hidden; white-space: nowrap; }
.tl-empty { padding: 8px 12px 8px 220px; color: var(--text-secondary); font-size: 12px; }

/* stats */
.st-body { display: flex; flex-direction: column; gap: 16px; }
.st-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.st-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: grid; grid-template-columns: 1fr auto; }
.st-kpi span { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-secondary); }
.st-kpi strong { grid-column: 1; font-size: 28px; }
.st-kpi.hot strong { color: var(--status-blocked); }
.st-kpi.ok strong { color: var(--status-done); }
.st-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; }
.st-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.st-card h2 { font-size: 14px; margin-bottom: 12px; }
.st-bar { margin-bottom: 10px; font-size: 12px; }
.st-bar .track { height: 16px; }
.st-bar .track i { background: var(--accent); }
.st-donut { position: relative; width: 140px; height: 140px; margin: 8px auto; }
.st-donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.st-donut div { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; color: var(--text-secondary); }
.st-donut .mono { font-size: 22px; font-weight: 700; color: var(--text); }
.st-legend { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.st-legend li { display: flex; align-items: center; gap: 8px; }
.st-legend i { width: 8px; height: 8px; border-radius: 99px; }
.st-legend .mono { margin-left: auto; }

/* login */
.login { min-height: 100dvh; display: flex; flex-direction: column; background: var(--canvas); }
.login-bar { display: flex; gap: 8px; align-items: center; padding: 16px 24px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; color: var(--text); }
.login-dot { width: 6px; height: 6px; border-radius: 99px; background: var(--gold); }
.login main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-hover); padding: 32px; display: flex; flex-direction: column; gap: 12px; }
.login-card h1 { margin: 0; text-align: center; font-size: 32px; font-weight: 900; color: var(--navy); }
.login-rule { display: block; width: 40px; height: 4px; border-radius: 99px; background: var(--gold); margin: 0 auto; }
.login-card > p { margin: 0; text-align: center; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; }
.login-pass { position: relative; }
.login-pass .field { width: 100%; padding-right: 40px; }
.login-pass button { position: absolute; right: 8px; top: 8px; border: 0; background: transparent; color: var(--text-secondary); }
.login-err { margin: 0; color: var(--status-blocked); font-size: 12px; }
.login-go, .login-sso { width: 100%; justify-content: center; min-height: 44px; }
.login-sso { margin-top: 4px; }

@media (max-width: 767px) {
  .page-head { padding-left: 16px; padding-right: 16px; }
  .page-scroll { padding: 12px 16px 24px; }
  .split, .st-grid, .st-kpis { display: flex; flex-direction: column; }
  .st-kpis { display: grid; grid-template-columns: 1fr 1fr; }
  .tl-name { width: 140px; }
}

/* list */
.ls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 24px;
  background: var(--canvas);
  border-bottom: 1px solid var(--border);
}
.ls-bar-left, .ls-bar-right, .ls-pills, .ls-metrics, .ls-project, .ls-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ls-pills { gap: 6px; }
.ls-pill {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  border-radius: var(--radius);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
}
.ls-pill.is-on { background: var(--text); color: #fff; border-color: var(--text); }
.ls-toggle { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.ls-toggle input { width: 16px; height: 16px; accent-color: var(--accent); }
.ls-dept {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
}
.ls-metrics {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-secondary);
}
.ls-total { font-weight: 700; color: var(--text); }
.ls-dot { color: var(--border-strong); }
.ls-metric.doing { color: #8a5a12; }
.ls-metric.blocked { color: var(--status-blocked); }
.ls-metric.done { color: var(--status-done); }
.ls-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; }
.ls-table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 880px; }
.ls-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--canvas);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.ls-table td { padding: 6px 10px; border-top: 1px solid var(--border); vertical-align: middle; height: 40px; }
.ls-table tbody tr:hover { background: #f8fafc; }
.ls-table tr.is-picked { background: rgba(46, 66, 165, 0.06); }
.ls-check { width: 36px; text-align: center; }
.ls-check input { accent-color: var(--accent); }
.ls-title { font-weight: 600; color: var(--text); }
.ls-project i { width: 6px; height: 6px; border-radius: 99px; display: inline-block; }
.ls-muted { color: var(--text-secondary); font-size: 11px; }
.ls-empty { padding: 24px !important; text-align: center; color: var(--text-secondary); }
.ls-status, .ls-pri {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--canvas);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 6px;
  color: var(--text);
}
.ls-status.todo { color: #475569; background: #f1f5f9; }
.ls-status.doing { color: #8a5a12; background: #fbf7ef; border-color: #ead9b0; }
.ls-status.blocked { color: var(--status-blocked); background: #fdecec; border-color: #f6c9c9; }
.ls-status.done { color: var(--status-done); background: #eef8f2; border-color: #cfe8d8; }
.ls-pri.p1 { color: var(--status-blocked); background: #fdecec; }
.ls-pri.p2 { color: #8a5a12; background: #fbf7ef; }
.ls-pri.p3 { color: var(--text-secondary); }

@media (max-width: 900px) {
  .ls-bar { padding-left: 16px; padding-right: 16px; }
}
