:root {
  color-scheme: light;
  --ink: #18181B;
  --secondary: #52525B;
  --muted: #71717A;
  --line: #E4E4E7;
  --canvas: #FAFAFA;
  --shadow: 0 1px 2px rgba(9, 9, 11, 0.04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: -0.011em;
}

button, input, select { font-family: inherit; }

.num, .age, .mono { font-variant-numeric: tabular-nums; }

.dq {
  max-width: 1020px;
  margin: 0 auto;
  padding: 20px 20px 32px;
}

.toolbar { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 600;
}

.lede {
  margin: 6px 0 0;
  max-width: 68ch;
  color: var(--secondary);
  font-size: 14px;
}

.toolbar-row, .quick-add, .inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field span { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0.01em; }
.field-grow { flex: 1 1 240px; }

input[type="search"],
input[type="text"],
input[type="date"],
select,
.note-input {
  height: 36px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.note-input { font-weight: 500; }

input:focus, select:focus, .note-input:focus {
  outline: 2px solid rgba(0, 0, 0, 0.18);
  border-color: transparent;
}

.btn {
  height: 32px;
  border-radius: 8px;
  border: 0;
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--line);
}

.btn:hover { background: #F4F4F5; }

.btn-warm {
  background: #A34B30;
  color: #FDF9F5;
  border: 1px solid #A34B30;
  box-shadow: none;
}

.btn-warm:hover { background: #7D3620; color: #FDF9F5; }

.btn-dark {
  background: var(--ink);
  color: #fff;
  box-shadow: none;
}

.btn-dark:hover { background: #424245; color: #fff; }

.roster { position: relative; }

.roster-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 6;
  min-width: 210px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(9, 9, 11, 0.12);
}

.roster-panel label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.roster-panel label:hover { background: var(--canvas); }

.roster-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 2px 0 12px;
}

.signed-in {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.roster-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-quiet {
  height: 28px;
  padding: 0 10px;
  background: transparent;
  color: var(--secondary);
  box-shadow: none;
  font-size: 12px;
}

.btn-quiet:hover { background: rgba(0, 0, 0, 0.04); }

.switch-panel { left: 0; right: auto; min-width: 180px; }

.switch-opt {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 7px 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
}

.switch-opt.is-on { font-weight: 600; }
.switch-opt:hover { background: var(--canvas); }

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 12px;
  font-weight: 500;
  color: var(--secondary);
  white-space: nowrap;
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  flex: none;
}

.sync-link {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sync-link:hover { color: var(--ink); }

.hello {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  text-align: left;
  background: #FFFFFF;
  border: 1px solid #E4E4E7;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(9, 9, 11, 0.04);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.tile-top { display: flex; align-items: center; gap: 12px; }

.tile.is-away {
  background: #FFFFFF;
  border: 1px solid #BBF7D0;
  box-shadow: 0 1px 2px rgba(9, 9, 11, 0.04);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  background: #f0ddd4;
  color: #8d5344;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

.av-omar { background: #dbeafe; color: #1d4ed8; }
.av-priya { background: #efe4ff; color: #6d28d9; }
.av-jules { background: #d9f5e3; color: #15803d; }
.av-ren { background: #ffe8a3; color: #a16207; }

.who { min-width: 0; }
.who h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.022em;
}

.you-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  margin-top: 3px;
  padding: 0 7px;
  border-radius: 6px;
  background: #18181B;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
}

.meta {
  margin: 3px 0 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--secondary);
}

.away-line {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #9a624f;
}

.away-badge {
  margin: auto -14px -14px auto;
  align-self: flex-end;
  background: none;
  color: #15803D;
  border: 0;
  border-radius: 0;
  padding: 0;
  font-size: 12px;
  font-weight: 500;
  text-align: right;
}

.clear {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.signals { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.sig-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ico { width: 15px; height: 15px; display: block; flex: none; }

.sig {
  position: relative;
  height: 32px;
  padding: 0 10px 0 9px;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s ease;
}

.sig-tip {
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  z-index: 4;
  width: max-content;
  max-width: 220px;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
}

.sig:hover .sig-tip,
.sig:focus-visible .sig-tip { opacity: 1; }

.sig:hover { transform: scale(1.05); }
.sig-needs { background: transparent; color: #D97706; }
.sig-progress, .sig-prep { background: transparent; color: #15803D; }
.sig-shop { background: transparent; color: #3F3F46; }
.sig-quiet { background: transparent; color: #BE123C; }
.sig-warn, .sig-warn:hover { background: transparent; color: #BE123C; box-shadow: none; }
.sig-warn.is-seen, .sig-warn.is-seen:hover { background: transparent; color: #a8a29e; }
.sig:hover.sig-needs,
.sig:hover.sig-progress,
.sig:hover.sig-prep,
.sig:hover.sig-shop,
.sig:hover.sig-quiet { background: transparent; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 2px 7px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}

.pill-wait { background: #f6eee8; color: #8d5344; border-color: #f0e4da; }
.pill-partner { background: #eff6ff; color: #1d4ed8; border-color: #dbeafe; }
.pill-quiet { background: #f4f4f5; color: #52525b; border-color: #e4e4e7; }
.pill-check { background: #fefce8; color: #a16207; border-color: #fef08a; }
.pill-noted { background: #eff6ff; color: #1d4ed8; border-color: #dbeafe; }
.pill-away { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.pill-prep { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }

.empty {
  grid-column: 1 / -1;
  color: var(--muted);
  padding: 24px 4px;
}

.quick-add {
  margin-top: 20px;
  padding: 18px 22px;
  background: #fff;
  border: 1px solid #E4E4E7;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(9, 9, 11, 0.04);
}

.quick-add h2 {
  width: 100%;
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
}

.quick-add .field-person { flex: 0 0 168px; }

.quick-add select {
  appearance: none;
  padding: 0 32px 0 12px;
  line-height: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2371717A' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 10px 6px;
}

.quick-add .btn-primary { height: 36px; align-self: end; }

.inline-form[hidden],
.away-banner[hidden] { display: none; }

.modal-back {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: rgba(9, 9, 11, 0.45);
  backdrop-filter: blur(8px);
}

.modal-back[hidden] { display: none; }

.modal-stage {
  position: relative;
  /* leaves a 60px margin each side for the person arrows */
  width: min(1320px, 100% - 120px);
}

.modal {
  container: dq / inline-size;
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: min(84vh, 860px);
  overflow: hidden;
  background: #FFFFFF;
  border: 1px solid #E4E4E7;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(9, 9, 11, 0.12);
}

.modal:focus { outline: none; }

.person-sheet {
  overflow: auto;
  background: #FFFFFF;
  border-radius: 12px 12px 0 0;
  padding: 0 32px;
}

.person-sheet.is-away { background: #FFFFFF; }
.modal:has(.person-sheet.is-away) { border-color: #BBF7D0; }

.team-next {
  flex: none;
  background: #fff;
  padding: 14px 32px 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.team-kicker {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--muted);
}

.edge {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #1d1d1f;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.16);
  cursor: pointer;
}

.edge:hover { transform: scale(1.06); }
.edge-prev { left: -56px; top: 50%; transform: translateY(-50%); }
.edge-next { right: -56px; top: 50%; transform: translateY(-50%); }
.edge-prev:hover, .edge-next:hover { transform: translateY(-50%) scale(1.06); }
.edge-x { top: 14px; right: 14px; width: 36px; height: 36px; }

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

.jump {
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--secondary);
  cursor: pointer;
}

.jump.is-active { background: #A34B30; color: #FDF9F5; border-color: #A34B30; }
.jump:hover:not(.is-active) { background: #f5f5f7; }

.person-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 34px 8px 14px;
}

.person-head h2 { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -0.03em; }
.name-line { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; min-width: 0; }
.person-head .away-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  flex: none;
  margin: 0;
}
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.filter-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 8px; }

.chip {
  height: 30px;
  border-radius: 999px;
  border: 1px solid #E6E1DA;
  background: transparent;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.chip:hover { border-color: #C9BFB3; }
.chip-num { font-variant-numeric: tabular-nums; font-weight: 600; opacity: 0.8; }

.chip-all { color: #3F3A35; }
.chip-needs, .chip-warn { color: #B45309; }
.chip-progress, .chip-prep, .chip-shop { color: #3F3F46; }
.chip-progress .ico { color: #10B981; }
.chip-shop .ico { color: #71717A; }

.chip.is-on { border-color: #A34B30; color: #A34B30; font-weight: 600; box-shadow: none; }
.chip.is-on .ico { color: currentColor; }

.away-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 14px 8px;
  padding: 10px 12px;
  background: #fff;
  color: #7a5348;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(140, 96, 80, 0.22);
  font-size: 13px;
  font-weight: 600;
}

.ooo-tick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  background: #FFFFFF;
  border: 1px solid #A34B30;
  box-shadow: none;
  color: #A34B30;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.ooo-tick:has(input:checked) {
  background: #A34B30;
  color: #FDF9F5;
  border-color: #A34B30;
}

.ooo-tick input { accent-color: #A34B30; }

.btn-primary {
  background: #A34B30;
  color: #FDF9F5;
  border: 1px solid #A34B30;
  box-shadow: none;
  font-weight: 500;
}

.btn-primary:hover { background: #7D3620; color: #FDF9F5; }

.ooo-plan {
  margin: 0 14px 10px;
  padding: 12px;
  background: #fff;
  border-radius: 16px;
}

.ooo-until {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #1C1917;
  white-space: nowrap;
}

.ooo-until input {
  height: 28px;
  border-radius: 8px;
  border: 1px solid #E4E4E7;
  background: #fff;
  color: #1C1917;
  font: inherit;
  font-weight: 500;
  padding: 0 8px;
}

.ooo-end {
  height: 28px;
  padding: 0 12px;
  border: 1px solid #E4E4E7;
  border-radius: 8px;
  background: transparent;
  color: #18181B;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.ooo-end:hover { background: #F4F4F5; }

.inline-form { padding: 0 14px 10px; }
.ooo-plan.inline-form { padding: 12px; }
.inline-form .check { flex-direction: row; align-items: center; gap: 6px; height: 36px; font-size: 13px; font-weight: 600; color: var(--ink); }

.group-label {
  margin: 0;
  padding: 14px 18px 4px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.col-head, .row {
  display: grid;
  grid-template-columns: 95px 150px minmax(240px, 1.5fr) 142px 96px minmax(190px, 1fr) 44px;
  gap: 12px;
  align-items: start;
}

.col-head.is-cover-head,
.row.is-cover {
  grid-template-columns: 95px 150px minmax(240px, 1.5fr) 136px 142px 96px minmax(190px, 1fr) 44px;
}

.col-head { align-items: center; }

/* Side quests: own lean table, no Jira key and no Status */
.col-head.is-sq-head,
.row.is-sq {
  grid-template-columns: 95px minmax(240px, 1.5fr) 150px 96px minmax(190px, 1fr) 44px;
}

.col-head.is-sq-cover-head,
.row.is-sq-cover {
  grid-template-columns: 95px minmax(240px, 1.5fr) 150px 136px 96px minmax(190px, 1fr) 44px;
}

.group-label-sq { margin-top: 10px; }

/* Optional Jira key on side quests */
.field-key { flex: 0 0 140px; }
.field-key input { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12.5px; text-transform: uppercase; }
.field-key input::placeholder { text-transform: none; }
input[aria-invalid="true"] { border-color: #B45309; outline: 2px solid rgba(180, 83, 9, 0.2); }
.sq-key-input {
  display: block;
  width: 100%;
  height: 24px;
  padding: 0 6px;
  border: 1px dashed #D6D1C8;
  border-radius: 6px;
  background: transparent;
  color: #A34B30;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
}
.sq-key-input::placeholder { color: #A39B91; font-family: inherit; font-weight: 500; text-transform: none; letter-spacing: 0; }
.sq-key-input:hover { border-color: #B8B1A6; }
.sq-key-input:focus { background: #fff; border-style: solid; border-color: #A34B30; outline: none; }
.row.is-sq .key-cell { padding-top: 1px; }

/* Customer name folded under the key (or title) when its column is hidden */
.cust-inline {
  display: none;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  color: #8A8279;
  white-space: normal;
}


.col-head {
  padding: 4px 14px 6px;
  border-bottom: 1px solid #E4E4E7;
}

.sort-btn, .col-note {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--secondary);
  text-align: left;
}

.col-center { text-align: center; }

.sort-btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.sort-btn:hover, .sort-btn.is-active { color: var(--ink); }
.sort-arrow { font-size: 11px; letter-spacing: 0; color: #B3ABA1; }
.sort-btn.is-active .sort-arrow { color: #A34B30; }

.updated-col {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: left;
  padding-right: 12px;
  line-height: 28px; /* same first-line box as the pills */
}

.col-head .sort-btn { min-width: 0; }

.cover-col { display: flex; align-items: flex-start; min-width: 0; }
.status-col { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }

/* One pill for Status and Cover */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  height: 28px;
  margin: 0;
  padding: 0 8px 0 11px;
  border: 0;
  border-radius: 9999px;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: filter 0.12s ease, box-shadow 0.12s ease;
}

.pill-static { padding: 0 11px; cursor: default; }
.pill-static:hover { filter: none; }
.pill-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pill-chev { flex: none; opacity: 0.7; }
.pill:hover { filter: brightness(0.97); }
.pill:focus-visible, .pill[aria-expanded="true"] { outline: none; box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px #A34B30; }

.pill-needs, .pill-unassigned { background: #FCEBDB; color: #A0480F; }
.pill-progress { background: #E3F0E6; color: #2B6A3F; }
.pill-shop, .pill-person { background: #F0EEEA; color: #55504A; }

.pill-menu {
  position: fixed;
  z-index: 60;
  min-width: 176px;
  padding: 4px;
  background: #FFFFFF;
  border: 1px solid #E4E0DA;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(30, 27, 24, 0.16);
}
.pill-menu[hidden] { display: none; }

.pill-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: #1E1B18;
  text-align: left;
  cursor: pointer;
}
.pill-opt:hover, .pill-opt:focus-visible { background: #F6F3EE; outline: none; }
.pill-opt.is-on { font-weight: 600; }
.pill-opt.is-on::after { content: ""; margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: #A34B30; }

.pill-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; }
.pill-dot-needs, .pill-dot-unassigned { background: #E08A3C; }
.pill-dot-progress { background: #4FA46B; }
.pill-dot-shop, .pill-dot-person { background: #A8A29B; }

.row {
  padding: 12px 14px;
  min-height: 52px;
  border-bottom: 1px solid #EFEBE5;
  border-radius: 0;
}

.row:hover { background: #FBF8F4; }

.row.is-cover {
  margin: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #EFEBE5;
  border-radius: 0;
  box-shadow: none;
}

.row.is-cover:hover { background: #FBF8F4; }

.row.is-prep { box-shadow: none; }
.row.is-prep:hover { background: #FBF8F4; }

.row.is-cover.is-prep {
  background: #FFFFFF;
  box-shadow: none;
}

.cover-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 158px 44px 32px;
  gap: 10px;
  align-items: start;
}

.cover-tools {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.note-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.note-list li {
  padding: 6px 8px;
  border-radius: 10px;
  background: #f6efe9;
  color: #7a5348;
  font-size: 13px;
}

.note-list strong { font-weight: 600; }

.item-link {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}

.item-link:hover .item-title { text-decoration: underline; text-underline-offset: 2px; }

.item-title {
  font-size: 14px;
  font-weight: 500;
  color: #18181B;
  line-height: 1.375; /* leading-snug */
  display: block;
  white-space: normal;
  overflow-wrap: break-word;
}

/* First three columns share one top edge and one first-line box */
.key-cell, .customer-cell, .title-cell { padding-top: 5px; min-width: 0; }
.title-cell .item-link { display: block; min-width: 0; }

.key-cell { white-space: nowrap; }

.key-link {
  display: block;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  line-height: 19px;
  letter-spacing: -0.02em;
  color: #A34B30;
  background: none;
  padding: 0;
  text-decoration: none;
}

.key-link:hover { text-decoration: underline; text-underline-offset: 2px; }



.customer-cell {
  font-size: 13px;
  font-weight: 500;
  line-height: 19px;
  color: #4A4540;
  overflow-wrap: break-word;
}

/* R&D: plain micro-label under the Jira key, same quiet treatment as other secondary text. No pill, no underline. */
.rd-label {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
  padding: 0;
  background: transparent;
  color: #78716C;
  font-size: 11px;
  font-weight: 500;
  line-height: 16px;
}
.rd-label.is-acked { color: #A8A29E; }
.rd-label .rd-link,
.rd-label .rd-link:hover { color: inherit; font-size: inherit; font-weight: inherit; text-decoration: none; }
.rd-tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.rd-tick:hover { background: rgba(120, 113, 108, 0.16); }
.rd-tick svg { width: 12px; height: 12px; display: block; }

.when { font-size: 12.5px; color: #71717A; font-weight: 500; }



.tick {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #3d6f86;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}

.tick:hover { color: var(--ink); }
.customer { color: #71717A; font-size: 12.5px; font-weight: 500; }
.sep { font-size: 12.5px; color: #71717A; font-weight: 500; }


.note-col { display: flex; align-items: flex-start; gap: 4px; min-width: 0; margin-top: 0; }
.note-col .note-input {
  flex: 1 1 auto;
  display: block;
  min-width: 0;
  width: 100%;
  height: 68px; /* exactly 3 visible lines: 3 x 18 + padding + border */
  margin: 0;
  padding: 6px 9px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
  color: #1E1B18;
  background: #F7F6F2;
  border: 1px solid transparent;
  border-radius: 8px;
  box-shadow: none;
  resize: none;
  overflow-y: auto;
  overflow-wrap: break-word;
}

.note-col .note-input::placeholder { color: #A39B91; font-weight: 400; opacity: 1; }
.note-col .note-input:not(:focus):hover { background: #F2EFE9; }
.note-col .note-input.is-stale { border-color: #F0D9A8; }

.note-col .note-input:focus {
  background: #FFFFFF;
  border-color: #A34B30;
  outline: none;
}

.note-stale { flex: none; color: #B45309; }
.note-stale .ico { width: 15px; height: 15px; }

.age {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
  color: #71717A;
}

.age.is-old {
  color: #D97706;
  font-weight: 600;
  background: transparent;
  padding: 0;
}

.pill-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }

.noted {
  border: 0;
  background: transparent;
  color: #1d4ed8;
  padding: 0 2px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.noted:hover { color: var(--ink); }

.note-meta { margin: 4px 0 0; font-size: 11.5px; color: var(--muted); }

.act {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  cursor: pointer;
}

.act-icon {
  position: relative;
  width: 24px;
  height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.act-icon svg { display: block; flex: none; }

/* zz button: dead-center in its cell, horizontally and vertically */
.col-act {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
}

.act-tip {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}

.act-icon:hover .act-tip,
.act-icon:focus-visible .act-tip { opacity: 1; }

.act:hover { background: #f6efe9; }

.chip-num { font-variant-numeric: tabular-nums; }

.none { margin: 0; padding: 4px 14px 12px; color: var(--muted); font-size: 13px; }

.drawer-toggle {
  width: calc(100% - 24px);
  margin: 10px 12px 8px;
  background: #F4F4F5;
  border: 1px solid #E4E4E7;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #1C1917;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-hint { font-size: 12px; font-weight: 500; color: #71717A; }
.drawer-toggle:hover { background: #E4E4E7; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 30;
  transform: translateX(-50%);
  max-width: min(440px, 92vw);
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
}

.toast[hidden] { display: none; }

@media (max-width: 1000px) {
  .modal-stage { width: 100%; }
  .edge-prev, .edge-next { top: auto; bottom: -52px; transform: none; }
  .edge-prev { left: calc(50% - 46px); }
  .edge-next { right: calc(50% - 46px); }
  .edge-prev:hover, .edge-next:hover { transform: scale(1.06); }
}

/* The dialog is the container: the table adapts to the dialog width, not the screen. */
@container dq (max-width: 1129px) {
  .person-sheet { padding: 0 20px; }
  .team-next { padding-left: 20px; padding-right: 20px; }

  .col-head, .row { gap: 10px; grid-template-columns: 90px 110px minmax(160px, 1.5fr) 130px 76px minmax(140px, 1fr) 40px; }
  .col-head.is-sq-head, .row.is-sq { grid-template-columns: 90px minmax(160px, 1.5fr) 110px 76px minmax(140px, 1fr) 40px; }
  .updated-col { padding-right: 0; }
}

@container dq (max-width: 1274px) {
  .person-sheet.is-away { padding: 0 20px; }
  .modal:has(.person-sheet.is-away) .team-next { padding-left: 20px; padding-right: 20px; }
  .is-away .col-head.is-cover-head, .is-away .row.is-cover { gap: 10px; grid-template-columns: 90px 110px minmax(160px, 1.5fr) 128px 130px 76px minmax(140px, 1fr) 40px; }
  .is-away .col-head.is-sq-cover-head, .is-away .row.is-sq-cover { gap: 10px; grid-template-columns: 90px minmax(160px, 1.5fr) 110px 128px 76px minmax(140px, 1fr) 40px; }
}

/* Customer folds under the key / title */
@container dq (max-width: 869px) {
  .col-cust, .customer-cell { display: none; }
  .cust-inline { display: block; }

  .col-head, .row { grid-template-columns: 90px minmax(160px, 1.5fr) 130px 76px minmax(140px, 1fr) 40px; }
  .col-head.is-sq-head, .row.is-sq { grid-template-columns: 90px minmax(160px, 1.5fr) 76px minmax(140px, 1fr) 40px; }
}

@container dq (max-width: 999px) {
  .is-away .col-cust, .is-away .customer-cell { display: none; }
  .is-away .cust-inline { display: block; }

  .is-away .col-head.is-cover-head, .is-away .row.is-cover { grid-template-columns: 90px minmax(140px, 1.4fr) 128px 130px 76px minmax(120px, 1fr) 40px; }
  .is-away .col-head.is-sq-cover-head, .is-away .row.is-sq-cover { grid-template-columns: 90px minmax(140px, 1.4fr) 128px 76px minmax(120px, 1fr) 40px; }
}

/* Narrow dialogs: one stacked card per ticket */
@container dq (max-width: 749px) {
  .col-head { display: none; }
  .row, .row.is-cover, .row.is-sq, .row.is-sq-cover { grid-template-columns: 1fr; gap: 6px; }
  .cover-tools { grid-template-columns: 1fr; }
  .col-act { justify-self: start; align-self: start; }
  .sq-key-input { max-width: 140px; }
  .customer-cell { display: none; }
  .cust-inline { display: block; }
}

@container dq (max-width: 839px) {
  .is-away .col-head { display: none; }
  .is-away .row, .is-away .row.is-cover, .is-away .row.is-sq-cover { grid-template-columns: 1fr; gap: 6px; }
  .is-away .col-act { justify-self: start; align-self: start; }
}
}
