/* Inter, served from this site (no Google Fonts: the Content-Security-Policy allows only our own files) */
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(fonts/inter-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --top-bg: rgb(21, 20, 20);
  --top: #455a71;
  --bg: #f4f7f8;
  --card: #ffffff;
  --ink: #1e2a3a;
  --muted: #6b7c8a;
  --line: #e4e9ec;
  --line-strong: #c9d3d9;
  --accent: #ef5b35;
  --brand-yellow: #ffce58;
  --head: #eef0f1;
  --nav-hover: #edf1f3;
  --a1: #cfe3dd;
  --a1t: #1e2a3a;
  --a2: #ebddae;
  --a2t: #1e2a3a;
  --a3: #e8a85f;
  --a3t: #1e2a3a;
  --a4: #b63a2b;
  --a4t: #ffffff;
  --a5: #dde3e5;
  --a5t: #1e2a3a;
  --flash: #fff0b8;
  --anav-h: 56px;
  --dev: #5b3fa6;
  --dev-bg: #ece6fa;
  --dev-line: #b9a6ea;
}
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    15px/1.5 Inter,
    "Segoe UI",
    "Helvetica Neue",
    Arial,
    system-ui,
    sans-serif;
  font-variant-numeric: tabular-nums;
}
button {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: calc(100vh - var(--anav-h));
}
.side {
  background: var(--card);
  border-right: 1px solid var(--line);
  padding: 18px 0;
  position: sticky;
  top: var(--anav-h);
  align-self: start;
  height: calc(100vh - var(--anav-h));
  overflow: auto;
}
/* Section headings: only the current section is expanded to show
   its categories; the others are collapsed to just the heading */
.sechead {
  appearance: none;
  background: none;
  border: 0;
  border-top: 1px solid var(--line);
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  cursor: pointer;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}
.sechead:first-child {
  border-top: 0;
}
.sechead:hover {
  background: var(--nav-hover);
}
.sechead .n {
  margin-left: auto;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}
.sechead svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.15s;
}
.sechead[aria-expanded="true"] svg {
  transform: rotate(90deg);
}
/* the expanded section's total is already on its "All" row */
.sechead[aria-expanded="true"] .n {
  visibility: hidden;
}
.tabs {
  display: flex;
  flex-direction: column;
  padding-bottom: 8px;
}
.tabs[hidden] {
  display: none;
}
.tab {
  appearance: none;
  background: none;
  border: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 22px;
  cursor: pointer;
  text-align: left;
  color: var(--ink);
  font-weight: 500;
  width: 100%;
}
.tab svg {
  width: 20px;
  height: 20px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--muted);
}
.tab .n {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}
.tab:hover {
  background: var(--nav-hover);
}
.tab[aria-selected="true"] {
  color: var(--accent);
  font-weight: 600;
}
.tab[aria-selected="true"] svg,
.tab[aria-selected="true"] .n {
  color: var(--accent);
}
.side .sidelink {
  display: block;
  padding: 11px 22px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: 0;
  width: 100%;
  text-align: left;
}
.side .sidelink:hover {
  background: var(--nav-hover);
}

main {
  padding: 22px 28px 64px;
  min-width: 0;
}
.hero h2 {
  margin: 0 0 4px;
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 700;
}
.hero h2 span {
  color: var(--accent);
}
.hero .scope {
  margin: 6px 0 0;
  color: var(--muted);
  max-width: 80ch;
}

.card {
  background: var(--card);
  border-radius: 8px;
  padding: 18px 20px;
}
.card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 16px;
  margin: 20px 0 22px;
}
.stat .lab {
  color: var(--muted);
  margin: 0;
}
.stat .num {
  font-size: 2.3rem;
  font-weight: 600;
  line-height: 1.2;
  margin: 2px 0 0;
}
.stat.red .num {
  color: var(--a4);
}
.stat .sub {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}

.ages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.wtile {
  appearance: none;
  position: relative;
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  background: var(--bg);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px 14px 12px 18px;
  transition:
    background 0.15s,
    border-color 0.15s,
    opacity 0.15s;
}
.wtile::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--c);
}
.wtile[data-age="0"] {
  --c: #7fb8a6;
}
.wtile[data-age="1"] {
  --c: #d9b44a;
}
.wtile[data-age="2"] {
  --c: #e8a85f;
}
.wtile[data-age="3"] {
  --c: var(--a4);
}
.wtile[data-age="4"] {
  --c: #a7b3ba;
}
.wtile .wn {
  display: block;
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.15;
}
.wtile[data-age="3"] .wn {
  color: var(--a4);
}
.wtile .wl {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}
.wtile:hover:not(:disabled) {
  background: var(--nav-hover);
  border-color: var(--line-strong);
}
.wtile:disabled {
  cursor: default;
  opacity: 0.45;
}
.wtile[aria-pressed="true"] {
  background: var(--card);
  border-color: var(--ink);
  box-shadow: 0 2px 8px rgba(30, 42, 58, 0.08);
}
.ages.has-filter .wtile[aria-pressed="false"]:not(:disabled) {
  opacity: 0.55;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  margin: 0 0 14px;
}
.field {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.field select,
.field input {
  font: inherit;
  color: var(--ink);
  font-weight: 600;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  padding: 6px 4px;
  border-radius: 0;
}
.field input {
  font-weight: 400;
  min-width: 260px;
}
.field input[type="date"] {
  min-width: 0;
  font-weight: 600;
}
.estfilter {
  display: none;
}
.ongoing .estfilter {
  display: flex;
}
.field.grow {
  flex: 1 1 280px;
}
.field.grow input {
  width: 100%;
}
.btn {
  appearance: none;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 7px 12px;
  cursor: pointer;
  font-weight: 600;
}
.btn:hover {
  border-color: var(--ink);
}
.status {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}
.status #count {
  margin-right: auto;
}

.cols {
  display: grid;
  grid-template-columns: 4.2rem minmax(0, 1fr) 11.5rem 7.5rem 5.5rem 5rem 6.2rem;
  gap: 0 14px;
  padding: 11px 14px;
  background: var(--head);
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
}
.cols button {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-transform: inherit;
  text-align: left;
  cursor: pointer;
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.cols button:hover {
  color: var(--accent);
}
.cols button[aria-sort]::after {
  content: "\25B2";
  font-size: 0.7em;
}
.cols button[aria-sort="descending"]::after {
  content: "\25BC";
}
#list {
  margin-top: 6px;
}
.estcol {
  display: none;
}
.ongoing .cols,
.ongoing .rowbtn {
  grid-template-columns: 4rem minmax(0, 1fr) 7.5rem 5.5rem 5rem 4.8rem 7rem 6.2rem;
}
.ongoing .estcol {
  display: block;
}
.est,
.effort {
  color: var(--muted);
  font-style: italic;
}
.est.set,
.effort.set {
  color: var(--ink);
  font-style: normal;
  font-weight: 600;
}
.stat[data-goto] {
  cursor: pointer;
}
.stat[data-goto]:hover {
  box-shadow: 0 0 0 2px var(--accent);
}
.item {
  border-bottom: 1px solid var(--line);
}
.rowbtn {
  appearance: none;
  display: grid;
  grid-template-columns: 4.2rem minmax(0, 1fr) 11.5rem 7.5rem 5.5rem 5rem 6.2rem;
  gap: 0 14px;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 11px 14px;
  cursor: pointer;
  align-items: start;
}
.rowbtn:hover {
  background: #f7f9fa;
}
.ref {
  color: var(--muted);
  font-size: 0.85rem;
  padding-top: 1px;
}
.task {
  font-weight: 500;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
}
.tag {
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
  padding: 4px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  color: var(--muted);
  white-space: nowrap;
  /* a tag wider than its column wraps instead of widening the row */
  max-width: 100%;
}
.tcell .tag {
  white-space: normal;
  overflow-wrap: anywhere;
}
.tag.warn {
  border-color: var(--a4);
  color: var(--a4);
}
.tag.ong {
  background: var(--top);
  border-color: var(--top);
  color: #fff;
  font-weight: 600;
}
.tag.lab {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.tag.sug {
  border-color: var(--accent);
  color: var(--accent);
}
/* ---- user labels (stored by the labels API, not in this file) */
.tag.ulab {
  background: var(--head);
  border-color: var(--line-strong);
  color: var(--ink);
}
.ulab-edit {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.ulab-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  line-height: 1;
  padding: 3px 4px 3px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  background: var(--card);
  white-space: nowrap;
}
.ulab-x {
  appearance: none;
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--muted);
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  padding: 0 4px;
  border-radius: 99px;
}
.ulab-x:hover,
.ulab-x:focus-visible {
  color: var(--a4);
  background: var(--line);
}
.ulab-add {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.ulab-add input {
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 5px 8px;
  width: 14rem;
  max-width: 100%;
}
.ulab-add .btn {
  padding: 5px 10px;
}
.ulab-none {
  color: var(--muted);
}
.ulab-msg {
  flex-basis: 100%;
  color: var(--a4);
  font-size: 0.85rem;
  white-space: normal;
}
.ulab-msg:empty {
  display: none;
}
/* ---- task rows: not clickable; Details opens the side panel */
.trow {
  cursor: default;
}
.trow:hover {
  background: none;
}
.act {
  text-align: right;
}
.act-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.act-btn svg {
  width: 15px;
  height: 15px;
  flex: none;
}
.btn.sm {
  padding: 4px 10px;
  font-size: 0.85rem;
}
/* "+ Add": same button as View, orange text to mark it as a different action */
.btn.tl-add {
  color: var(--accent);
  white-space: nowrap;
  /* same text and width as a small button, but about as tall as a label chip */
  padding-top: 2px;
  padding-bottom: 2px;
  line-height: 1.2;
}
.btn.tl-add:hover,
.btn.tl-add:focus-visible {
  border-color: var(--accent);
}
/* ---- side panel: same layout as Ultima's SidePanel */
.sp {
  position: fixed;
  inset: 0;
  z-index: 1000;
}
.sp[hidden] {
  display: none;
}
.sp-ov {
  position: absolute;
  inset: 0;
  /* same as Ultima's import side panel (bg-black/40) */
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.3s ease-out;
}
.sp-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  /* same width as Ultima's import side panels */
  width: 550px;
  max-width: 95vw;
  display: flex;
  flex-direction: column;
  background: var(--card);
  color: var(--ink);
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 8px 10px -6px rgba(0, 0, 0, 0.1);
  transform: translateX(100%);
  transition: transform 0.3s ease-out;
}
.sp.on .sp-ov {
  opacity: 1;
}
.sp.on .sp-panel {
  transform: none;
}
.sp-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.sp-hd {
  min-width: 0;
}
.sp-head h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
}
.sp-ref {
  color: var(--muted);
  font-weight: 500;
  margin-right: 8px;
}
.sp-sub {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--muted);
}
.sp-x {
  appearance: none;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0 6px;
  margin-right: -6px;
  border-radius: 6px;
  cursor: pointer;
}
.sp-x:hover,
.sp-x:focus-visible {
  color: var(--accent);
}
.sp-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  font-size: 0.92rem;
}
.sp-tags {
  margin: 0 0 16px;
}
.sp-dl {
  margin: 0;
}
.sp-dl dt {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 14px;
}
.sp-dl dt:first-child {
  margin-top: 0;
}
.sp-dl dd {
  margin: 2px 0 0;
  white-space: pre-line;
}
.sp-body .ulab-msg {
  margin: -8px 0 14px;
}
/* ---- Freshdesk email threads in the side panel (from the "freshdesk" data block) */
.fd-h {
  margin: 24px 0 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
}
.fd-id {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
}
.fd-msgs {
  list-style: none;
  margin: 0;
  padding: 0;
}
.fd-msg {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 0 10px;
}
.fd-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 12px;
  font-size: 0.8rem;
}
.fd-from {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.fd-when {
  color: var(--muted);
  white-space: nowrap;
}
.fd-to {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}
.fd-text {
  margin-top: 8px;
  font-size: 0.85rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
/* long messages start collapsed, fading out at the bottom */
.fd-clamp {
  max-height: 14em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 65%, transparent);
  mask-image: linear-gradient(to bottom, #000 65%, transparent);
}
.fd-more {
  appearance: none;
  border: 0;
  background: none;
  margin-top: 4px;
  padding: 2px 0;
  font: inherit;
  font-size: 0.8rem;
  color: var(--accent);
  cursor: pointer;
}
.fd-more:hover {
  text-decoration: underline;
}
.fd-qbtn {
  display: block;
  color: var(--muted);
}
/* quoted history under a reply */
.fd-quoted {
  margin-top: 6px;
  padding-left: 10px;
  border-left: 3px solid var(--line-strong);
  color: var(--muted);
}
.fd-quoted[hidden] {
  display: none;
}
.fd-a {
  color: var(--top);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.fd-a:hover {
  color: var(--accent);
}
/* ---- attachments (from the API): under their message, or after the threads */
.at-files {
  list-style: none;
  margin: 10px 0 0;
  padding: 8px 0 0;
  border-top: 1px dashed var(--line);
}
.at-file + .at-file {
  margin-top: 8px;
}
.at-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}
.at-name {
  flex: 1;
  min-width: 0;
  color: var(--top);
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.at-name::before {
  content: "📎 ";
}
.at-name:hover {
  color: var(--accent);
}
.at-dl {
  flex: none;
  text-decoration: none;
  color: inherit;
}
/* images: a preview above the name, opens full size */
.at-thumb {
  display: block;
  margin-bottom: 4px;
}
.at-thumb img {
  display: block;
  max-width: 100%;
  max-height: 260px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
}
.at-h {
  margin: 24px 0 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
  font-weight: 600;
}
.at-h + .at-files {
  margin: 0;
  padding: 0;
  border: 0;
}
.at-msg {
  margin: 16px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.at-msg.bad {
  color: var(--accent);
}
.fd-none {
  color: var(--muted);
  font-style: italic;
}
/* ---- WhatsApp conversation in the side panel (from the "whatsapp" data block), styled like WhatsApp */
.tag.wa-tag {
  border-color: #25d366;
  color: #008069;
}
.wa {
  --wa-bg: #efeae2;
  --wa-in: #ffffff;
  --wa-out: #d9fdd3;
  --wa-ink: #111b21;
  --wa-sub: #667781;
  --wa-link: #027eb5;
  --wa-tick: #53bdeb;
  --wa-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  margin: 24px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.wa-chat {
  border: 1px solid #d1d7db;
  border-radius: 10px;
  overflow: hidden;
  color: var(--wa-ink);
  font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.wa-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #008069;
  color: #fff;
}
.wa-av {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #dfe5e7;
  color: #fff;
  display: grid;
  place-items: center;
}
.wa-av svg {
  width: 24px;
  height: 24px;
  fill: #aebac1;
}
.wa-hd {
  min-width: 0;
}
.wa-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}
.wa-head p {
  margin: 1px 0 0;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.82);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wa-msgs {
  list-style: none;
  margin: 0;
  padding: 10px 12px 14px;
  background-color: var(--wa-bg);
  /* faint doodle-like dots, like WhatsApp's wallpaper */
  background-image:
    radial-gradient(rgba(84, 101, 111, 0.07) 1.2px, transparent 1.3px),
    radial-gradient(rgba(84, 101, 111, 0.05) 1px, transparent 1.1px);
  background-size: 22px 22px, 34px 34px;
  background-position: 0 0, 11px 17px;
}
.wa-note,
.wa-day {
  display: flex;
  justify-content: center;
  margin: 10px 0 8px;
}
.wa-note span,
.wa-day span {
  padding: 5px 12px 6px;
  border-radius: 7.5px;
  font-size: 0.75rem;
  line-height: 1.4;
  text-align: center;
  box-shadow: var(--wa-shadow);
}
.wa-day span {
  background: #fff;
  color: #54656f;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.wa-note span {
  background: #ffeecd;
  color: #54656f;
  max-width: 85%;
}
.wa-m {
  display: flex;
  margin-top: 2px;
}
.wa-m.first {
  margin-top: 10px;
}
.wa-m.out {
  justify-content: flex-end;
}
.wa-b {
  position: relative;
  max-width: 85%;
  min-width: 90px;
  padding: 6px 9px 8px;
  border-radius: 7.5px;
  background: var(--wa-in);
  box-shadow: var(--wa-shadow);
  font-size: 0.875rem;
  line-height: 1.4;
}
.wa-m.out .wa-b {
  background: var(--wa-out);
}
/* the little tail on the first bubble of a run */
.wa-m.first .wa-b::before {
  content: "";
  position: absolute;
  top: 0;
  width: 8px;
  height: 13px;
  background: inherit;
}
.wa-m.in.first .wa-b {
  border-top-left-radius: 0;
}
.wa-m.in.first .wa-b::before {
  left: -8px;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}
.wa-m.out.first .wa-b {
  border-top-right-radius: 0;
}
.wa-m.out.first .wa-b::before {
  right: -8px;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}
.wa-who {
  display: block;
  margin-bottom: 2px;
  font-size: 0.8rem;
  font-weight: 600;
}
.wa-fwd {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 3px;
  color: var(--wa-sub);
  font-size: 0.78rem;
  font-style: italic;
}
.wa-fwd svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}
.wa-q {
  display: block;
  margin: 2px -4px 6px;
  padding: 5px 8px 6px 10px;
  border-left: 4px solid var(--qc, #06cf9c);
  border-radius: 6px;
  background: rgba(11, 20, 26, 0.05);
  font-size: 0.8rem;
  line-height: 1.35;
}
.wa-m.out .wa-q {
  background: rgba(37, 211, 102, 0.12);
}
.wa-q b {
  display: block;
  color: var(--qc, #06cf9c);
  font-weight: 600;
}
.wa-q span {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--wa-sub);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.wa-media {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 2px -5px 6px;
  min-width: 220px;
  height: 110px;
  border-radius: 6px;
  background: #dfe5e7;
  color: #54656f;
  font-size: 0.8rem;
}
.wa-m.out .wa-media {
  background: #c4e9bd;
}
.wa-media svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}
.wa-media.doc {
  justify-content: flex-start;
  height: auto;
  padding: 10px 12px;
}
.wa-t {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
/* room for the time, which floats into the last line like WhatsApp's */
.wa-t::after {
  content: "";
  display: inline-block;
  width: var(--wa-tw, 44px);
}
.wa-clamp {
  max-height: 13.5em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent);
  mask-image: linear-gradient(to bottom, #000 70%, transparent);
}
.wa-clamp::after {
  display: none;
}
.wa-more {
  appearance: none;
  border: 0;
  background: none;
  padding: 2px 0 0;
  font: inherit;
  font-size: 0.82rem;
  color: var(--wa-link);
  cursor: pointer;
}
.wa-more:hover {
  text-decoration: underline;
}
.wa-time {
  position: absolute;
  right: 8px;
  bottom: 4px;
  display: flex;
  align-items: center;
  gap: 3px;
  color: var(--wa-sub);
  font-size: 0.69rem;
  line-height: 1;
  white-space: nowrap;
}
.wa-m.out .wa-t {
  --wa-tw: 62px;
}
.wa-time svg {
  width: 16px;
  height: 11px;
  fill: var(--wa-tick);
}
.wa-a {
  color: var(--wa-link);
  text-decoration: none;
}
.wa-a:hover {
  text-decoration: underline;
}
.wa-at {
  color: var(--wa-link);
}
/* Stops the page scrolling behind the side panel. Only on html: overflow on
   body would make body a scroll container, and the sticky left menu would
   jump up by however far the page had been scrolled. */
html.sp-lock {
  overflow: hidden;
}
/* ---- "+ Add" popup */
#ul-dlg {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 18px 20px;
  width: min(26rem, calc(100vw - 32px));
  box-sizing: border-box;
  color: var(--ink);
}
#ul-dlg::backdrop {
  background: rgba(30, 42, 58, 0.35);
}
#ul-dlg h3 {
  margin: 0 0 4px;
}
#ul-dlg-task {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
}
#ul-dlg .ulab-edit {
  margin-bottom: 14px;
}
#ul-dlg .ulab-add {
  display: flex;
  gap: 10px;
  align-items: stretch; /* text box and Add button the same height */
}
#ul-dlg .ulab-add input {
  flex: 1;
  width: auto;
  padding: 6px 10px;
}
#ul-dlg .ulab-add .btn {
  padding: 6px 14px;
}
#ul-dlg-msg {
  margin: 8px 0 0;
}
#ul-dlg .row {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}
@media (prefers-reduced-motion: reduce) {
  .sp-ov,
  .sp-panel {
    transition: none;
  }
}
/* shown instead of the page while the tasks load (or can't be loaded) */
.data-msg {
  max-width: 640px;
  margin: 60px auto;
  padding: 0 16px;
  text-align: center;
  color: var(--muted);
}
.data-msg[hidden] {
  display: none;
}
.data-msg.bad {
  color: var(--a4);
}
main.no-data > #panel {
  display: none;
}
#ulab-status {
  font-size: 0.85rem;
}
#ulab-status.bad {
  color: var(--a4);
}
#tok-dlg {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 18px 20px;
  max-width: min(30rem, calc(100vw - 32px));
  color: var(--ink);
}
#tok-dlg::backdrop {
  background: rgba(30, 42, 58, 0.35);
}
#tok-dlg h3 {
  margin: 0 0 6px;
}
#tok-dlg p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
}
#tok-dlg label {
  display: block;
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: var(--muted);
}
#tok-dlg input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 4px;
  font: inherit;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 6px 8px;
}
#tok-dlg .row {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 6px;
}
@media print {
  .act,
  .tl-add,
  .sp,
  .ulab-add,
  .ulab-x,
  .ulab-msg,
  #b-token,
  #ulab-status {
    display: none !important;
  }
}
.req.unc {
  color: var(--muted);
  font-style: italic;
}
.date {
  color: var(--muted);
  font-size: 0.9rem;
}
.age {
  font-weight: 600;
}
.age.old {
  color: var(--a4);
}
.item.open .rowbtn {
  background: #fbf1ee;
}
.detail {
  display: none;
  padding: 6px 14px 16px calc(14px + 4.2rem + 14px);
  font-size: 0.92rem;
  background: #fbf1ee;
}
.item.open .detail {
  display: block;
}
.detail dl {
  margin: 0;
  display: grid;
  grid-template-columns: 12rem 1fr;
  gap: 6px 14px;
  max-width: 84ch;
}
.detail dt {
  color: var(--muted);
}
.detail dd {
  margin: 0;
  white-space: pre-line;
}
.link {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  font-weight: 500;
}
.item.flash {
  animation: flash 1.6s ease-out;
}
@keyframes flash {
  0%,
  40% {
    background: var(--flash);
  }
  100% {
    background: transparent;
  }
}
@media (prefers-reduced-motion: reduce) {
  .item.flash {
    animation: none;
    outline: 3px solid var(--flash);
  }
}
.empty {
  padding: 36px 12px;
  text-align: center;
  color: var(--muted);
}

.relcols,
.relrow {
  grid-template-columns: 9rem 1fr 6rem;
}
.relrow .desc {
  font-weight: 500;
  white-space: pre-line;
}
.relrow .cnt {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: right;
}
.relcols span:last-child {
  text-align: right;
}
.tag.plat {
  background: var(--head);
  border-color: var(--line-strong);
  color: var(--ink);
}
.tag.dep {
  background: var(--head);
  border-color: var(--line-strong);
  color: var(--ink);
}
.reldetail {
  padding-left: 14px;
}
/* tasks inside a week */
.rtk {
  display: grid;
  grid-template-columns: 3.6rem minmax(0, 1fr) 9rem 5.5rem 7rem 6.2rem;
  gap: 0 14px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  align-items: start;
}
.rtk:first-child {
  border-top: 0;
}
.rtk.rhead {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  padding-top: 4px;
}
.rtk .effort,
.rtk .acted {
  font-size: 0.9rem;
}
.rtk .acted {
  color: var(--muted);
}
.rtk.dim {
  opacity: 0.6;
}
.rtk .ml {
  display: none;
}
.relnotes {
  padding: 8px 0 4px;
  border-top: 1px solid var(--line);
}
.relnotes:first-child {
  border-top: 0;
}
.relnotes .lab {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.9rem;
}
.relnotes ul {
  margin: 0;
  padding-left: 1.2rem;
}

.rules {
  margin-top: 22px;
}
.rules summary {
  cursor: pointer;
  font-weight: 700;
  text-transform: uppercase;
}
.rules ul,
.rules ol {
  margin: 6px 0 14px;
  padding-left: 1.2rem;
  max-width: 84ch;
}
.rules li {
  margin: 4px 0;
}
.rules h4 {
  margin: 14px 0 2px;
  font-size: 0.95rem;
}
footer {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 18px;
}

/* Up to 1199px wide (e.g. inside Ultima on a 1024px screen) the left menu
   would leave the task table too little room, so it moves to the top: section
   headings in one row, the current section's categories underneath. */
@media screen and (max-width: 1199px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .side {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0;
  }
  .side .sidelink {
    display: none;
  }
  .side {
    display: flex;
    flex-wrap: wrap;
  }
  .sechead,
  .sechead:first-child {
    order: 0;
    flex: 1 1 auto;
    width: auto;
    justify-content: center;
    border-top: 0;
    padding: 12px 10px;
    font-size: 0.85rem;
    white-space: nowrap;
  }
  .sechead .n,
  .sechead svg {
    display: none;
  }
  .sechead[aria-expanded="true"] {
    color: var(--accent);
    box-shadow: inset 0 -3px 0 var(--accent);
  }
  .tabs {
    order: 1;
    flex: 1 1 100%;
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 0;
    border-top: 1px solid var(--line);
    background: var(--bg);
  }
  .tab {
    padding: 12px 16px;
    width: auto;
    white-space: nowrap;
  }
  .tab svg {
    display: none;
  }
  .tab[aria-selected="true"] {
    box-shadow: inset 0 -3px 0 var(--accent);
  }
}
@media screen and (max-width: 900px) {
  main {
    padding: 18px 16px 56px;
  }
  .cols {
    display: none;
  }
  .rowbtn {
    grid-template-columns: 1fr auto auto;
    grid-template-areas: "ref age act" "task task task" "req date date" "effort effort effort";
    gap: 2px 10px;
  }
  .rowbtn .act,
  .rtk .act {
    grid-area: act;
  }
  .rowbtn .ref {
    grid-area: ref;
  }
  .rowbtn .age {
    grid-area: age;
    text-align: right;
  }
  .rowbtn .tcell {
    grid-area: task;
  }
  .rowbtn .req {
    grid-area: req;
    font-size: 0.9rem;
  }
  .rowbtn .date {
    grid-area: date;
    text-align: right;
  }
  .ongoing .rowbtn {
    grid-template-columns: 1fr auto auto;
    grid-template-areas: "ref age act" "task task task" "req date date" "effort est est";
  }
  .rowbtn .effort {
    grid-area: effort;
    font-size: 0.9rem;
  }
  .rowbtn .est {
    grid-area: est;
    font-size: 0.9rem;
    text-align: right;
  }
  .detail {
    padding-left: 14px;
  }
  .detail dl {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .detail dt {
    margin-top: 8px;
  }
  .relrow {
    grid-template-columns: 1fr auto;
    grid-template-areas: "date cnt" "desc desc";
  }
  .relrow .date {
    grid-area: date;
    text-align: left;
  }
  .relrow .cnt {
    grid-area: cnt;
  }
  .relrow .tcell {
    grid-area: desc;
  }
  .rtk {
    grid-template-columns: 1fr auto auto;
    grid-template-areas: "ref acted act" "task task task" "req effort effort";
    gap: 2px 10px;
  }
  .rtk.rhead {
    display: none;
  }
  .rtk .ml {
    display: inline;
  }
  .rtk .ref {
    grid-area: ref;
  }
  .rtk .acted {
    grid-area: acted;
    text-align: right;
  }
  .rtk .tcell {
    grid-area: task;
  }
  .rtk .req {
    grid-area: req;
    font-size: 0.9rem;
  }
  .rtk .effort {
    grid-area: effort;
    text-align: right;
  }
}
/* Work in progress has two more columns than All Tasks. When the table's
   card is too narrow for them (e.g. inside Ultima's iframe, next to its
   menu), stack each row as on small screens. This is based on the card's
   width rather than the screen's, because the iframe is narrower than the screen. */
.tasks-card {
  container: tasks / inline-size;
}
@media screen {
  @container tasks (max-width: 58rem) {
    .ongoing .cols {
      display: none;
    }
    .ongoing .rowbtn {
      grid-template-columns: minmax(0, 1fr) auto auto;
      grid-template-areas: "ref age act" "task task task" "req date date" "effort est est";
      gap: 2px 10px;
    }
    .ongoing .rowbtn .act {
      grid-area: act;
    }
    .ongoing .rowbtn .ref {
      grid-area: ref;
    }
    .ongoing .rowbtn .age {
      grid-area: age;
      text-align: right;
    }
    .ongoing .rowbtn .tcell {
      grid-area: task;
    }
    .ongoing .rowbtn .req {
      grid-area: req;
      font-size: 0.9rem;
    }
    .ongoing .rowbtn .date {
      grid-area: date;
      text-align: right;
    }
    .ongoing .rowbtn .effort {
      grid-area: effort;
      font-size: 0.9rem;
    }
    .ongoing .rowbtn .est {
      grid-area: est;
      font-size: 0.9rem;
      text-align: right;
    }
  }
}
@media print {
  :root {
    --bg: #fff;
  }
  .anav,
  .side,
  .controls,
  .btn,
  .rules {
    display: none !important;
  }
  .shell {
    display: block;
  }
  main {
    padding: 0;
  }
  .ages {
    pointer-events: none;
  }
  .detail {
    display: block !important;
    padding-top: 0;
    padding-bottom: 8px;
    font-size: 10px;
  }
  .detail dl {
    grid-template-columns: 9rem 1fr;
    gap: 2px 10px;
  }
  body {
    font-size: 11px;
  }
  .item {
    break-inside: avoid;
  }
  .card {
    break-inside: auto;
  }
}

/* ======== Admin page additions ======== */
/* the shared admin header stays on top while the page scrolls; the left menu sticks below it */
.anav {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--anav-h);
}
.fatal {
  margin: 24px 16px;
  padding: 12px 14px;
  border: 1px solid var(--a4);
  color: var(--a4);
}
.wait-card {
  margin-bottom: 22px;
}
.wait-scope {
  color: var(--muted);
  margin: 0;
}
.rel-none {
  margin: 0;
  color: var(--muted);
}
.chk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
}
.chk input {
  margin: 0;
}

/* dev-only things: a purple tag and a small "dev" marker, so they are never mistaken for what customers see */
.dev-mark {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--dev);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  vertical-align: 1px;
}
.dev-badge {
  flex: none;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--dev-bg);
  border: 1px solid var(--dev-line);
  color: var(--dev);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.tag.ulab.dev {
  background: var(--dev-bg);
  border-color: var(--dev-line);
  color: var(--dev);
}
.tag.ulab.dev .dev-mark {
  margin-left: 6px;
}
.ulab-chip.dev {
  background: var(--dev-bg);
  border-color: var(--dev-line);
  color: var(--dev);
}
.tag.asg {
  border-color: var(--top);
  color: var(--top);
}
.tag.asg::before {
  content: "\2192\00a0";
}
.tag.cmt {
  color: var(--muted);
  border-style: dashed;
}
#ul-dlg .ulab-add {
  flex-wrap: wrap;
}
.ulab-dev {
  flex-basis: 100%;
}

/* ---- side panel: Assigned, Comments, Attachments */
.ac,
.cm,
.at {
  margin: 24px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.ac-h,
.cm-h,
.at .at-h {
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  font-size: 0.95rem;
  font-weight: 600;
}
.cm-count {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.85rem;
}
.ac .ulab-msg,
.cm .ulab-msg {
  margin: 8px 0 0;
}
.ac-none,
.cm-none {
  margin: 0 0 10px;
  color: var(--muted);
}
.ac-none.bad,
.cm-none.bad {
  color: var(--a4);
}
.ac-add {
  margin-top: 10px;
}
.cm-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}
.cm-item {
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}
.cm-item.dev,
.cm-item.editing {
  border-color: var(--dev-line);
}
.cm-item.dev {
  background: var(--dev-bg);
}
.cm-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-size: 0.8rem;
}
.cm-by {
  font-weight: 600;
}
.cm-when {
  color: var(--muted);
}
.cm-acts {
  margin-left: auto;
  display: inline-flex;
  gap: 4px;
}
.cm-link {
  appearance: none;
  background: none;
  border: 0;
  padding: 2px 6px;
  font: inherit;
  font-size: 0.8rem;
  color: var(--top);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.cm-link:hover:not(:disabled) {
  color: var(--accent);
}
.cm-link.del:hover:not(:disabled) {
  color: var(--a4);
}
.cm-link:disabled {
  opacity: 0.5;
  cursor: default;
}
.cm-body {
  margin-top: 6px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.cm-form textarea {
  display: block;
  width: 100%;
  margin-top: 8px;
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 7px 9px;
  resize: vertical;
}
.cm-form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}
.cm-btns {
  display: inline-flex;
  gap: 8px;
}
.btn.cm-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.btn.cm-primary:hover {
  border-color: var(--accent);
}
.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

/* attachments: the dev-only mark, the toggle, uploads */
.at-file.dev {
  padding: 6px 8px;
  border: 1px solid var(--dev-line);
  border-radius: 8px;
  background: var(--dev-bg);
}
.at-tools {
  margin-top: 4px;
}
.at-ups {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  font-size: 0.85rem;
}
.at-up {
  color: var(--muted);
}
.at-up.bad {
  color: var(--a4);
}
.at-up-name {
  font-weight: 600;
  color: var(--ink);
}
.at-up-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 12px;
}
.at-pick {
  position: relative;
  display: inline-block;
}
.at-pick.off {
  opacity: 0.55;
}
.at-pick input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  cursor: pointer;
}
.at-pick:focus-within {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.at-hint {
  font-size: 0.8rem;
  color: var(--muted);
}
.at-msg.bad {
  color: var(--a4);
}

/* the page's own confirmation dialog */
.confirm {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(30, 42, 58, 0.45);
}
.confirm[hidden] {
  display: none;
}
.confirm-box {
  width: 100%;
  max-width: 360px;
  padding: 20px;
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}
.confirm-box h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}
.confirm-box p {
  margin: 0 0 16px;
  color: var(--muted);
}
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.btn.danger {
  background: var(--a4);
  border-color: var(--a4);
  color: #fff;
}
