:root {
  --bg: #f6f5f2;
  --card: #fff;
  --ink: #1c1b19;
  --mute: #6b6861;
  --line: #e3e0d9;
  --acc: #2f5de0;
  --ongoing: #2f5de0;
  --near: #b86f00;
  --over: #d93c2f;
  --nearidle: #9b3fd1;
  --done: #2a8a5a;
  --idle: #6f6c65;
  box-sizing: border-box;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161615;
    --card: #212120;
    --ink: #efede8;
    --mute: #a8a59d;
    --line: #33322f;
    --acc: #7b9cff;
    --ongoing: #7b9cff;
    --near: #f0ab3a;
    --over: #ff6b5e;
    --nearidle: #c98cf2;
    --done: #4ec88d;
    --idle: #a8a59d;
    color-scheme: dark;
  }
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  scroll-padding-top: env(safe-area-inset-top, 0px);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    15px/1.45 system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif;
}
main {
  max-width: 860px;
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px))
    calc(60px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
h1 {
  font-size: 21px;
  margin: 0;
  flex: 1;
}
h1 span {
  color: var(--acc);
}
h2 {
  font-size: 15px;
  margin: 18px 0 8px;
}
#header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.who {
  color: var(--mute);
  font-size: 13px;
}
button,
input,
select,
textarea,
a.button {
  font: inherit;
  color: var(--ink);
}
button,
a.button {
  cursor: pointer;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 11px;
  text-decoration: none;
  display: inline-block;
}
button.primary,
a.button.primary {
  background: var(--acc);
  border-color: var(--acc);
  color: #fff;
}
@media (prefers-color-scheme: dark) {
  /* White on the light blue is 2.6 to 1; dark text on it is well over 4.5 to 1. The colour stays. */
  button.primary,
  a.button.primary,
  .badge {
    color: #111;
  }
}
button.danger {
  border-color: var(--over);
  color: var(--over);
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
:focus-visible {
  outline: 3px solid var(--acc);
  outline-offset: 2px;
}
input,
select,
textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  width: 100%;
}
input[type='checkbox'] {
  width: auto;
}
input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.6;
}
[aria-invalid='true'] {
  border-color: var(--over);
}
.err {
  color: var(--over);
  font-size: 12px;
  min-height: 0;
  margin-top: 2px;
}
.inline-label {
  font-weight: 400;
  font-size: 12px;
  color: var(--mute);
}
.inline {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
/* "Assigned to me" and "All tickets": side by side on a wide screen, stacked everywhere else. */
.columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 18px;
  align-items: start;
}
.columns > section {
  min-width: 0;
}
.columns h2 {
  margin-top: 8px;
}
@media (min-width: 1025px) {
  /* The home page is wider than the ticket page so that two lists fit (Hem, 21 Nov 2026). */
  main.home {
    max-width: 1200px;
  }
  .columns {
    grid-template-columns: 1fr 1fr;
  }
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}
.stat b {
  font-size: 22px;
  display: block;
}
.stat span {
  color: var(--mute);
  font-size: 12px;
}
/* The lists are boards of cards: each card is about as wide as a card on a Jira Kanban column (250 to
   about 330 px) and as tall as its content (title up to three lines, tags, two small lines, a
   footer with the assignee). They wrap into as many across as the width allows. */
#mine,
#all {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 8px;
}
#mine > .empty,
#all > .empty,
#mine > .sr-only,
#all > .sr-only {
  grid-column: 1 / -1;
}
.row {
  background: color-mix(in srgb, var(--c) 26%, var(--card));
  border: 1px solid var(--c);
  border-left: 6px solid var(--c);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 0;
  min-width: 0;
  flex-direction: column;
  align-items: stretch;
  display: flex;
  gap: 6px;
}
.row .b {
  min-width: 0;
}
.row .t {
  display: flex;
  align-items: center;
}
.clamp {
  min-width: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.row .m {
  margin-top: 0;
}
.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}
.assignee {
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 12px;
}
.assignee-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.avatar {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--c);
  background: var(--card);
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
}
.t {
  font-weight: 600;
  word-break: break-word;
  overflow-wrap: anywhere;
  color: var(--ink);
  text-decoration: none;
}
.t:hover {
  text-decoration: underline;
}
.m {
  color: var(--mute);
  font-size: 12px;
  margin-top: 2px;
}
.pending {
  white-space: pre-line;
}
.tag {
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--c);
  color: var(--c);
  border-radius: 99px;
  padding: 1px 7px;
  white-space: nowrap;
}
.tag.muted {
  --c: var(--mute);
}
.mv {
  display: flex;
  flex-direction: row;
  gap: 4px;
  flex: none;
}
.mv button {
  padding: 0 7px;
  font-size: 11px;
  /* WCAG 2.2 asks 24 by 24 at least; phones and touch screens get 44 below. */
  min-width: 24px;
  min-height: 24px;
}
.s-ongoing {
  --c: var(--ongoing);
}
.s-near {
  --c: var(--near);
}
.s-overdue {
  --c: var(--over);
}
.s-nearidle {
  --c: var(--nearidle);
}
.s-done {
  --c: var(--done);
}
.s-notstarted,
.s-deleted {
  --c: var(--idle);
}
.note {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  color: var(--mute);
}
.note button,
.note a {
  margin-left: 8px;
}
.empty {
  text-align: center;
  color: var(--mute);
  padding: 18px;
}
#ov {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 30;
}
#dr {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 100%);
  background: var(--bg);
  overflow: auto;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px
    calc(40px + env(safe-area-inset-bottom, 0px));
  z-index: 31;
  border-left: 1px solid var(--line);
}
.bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.bar-title {
  flex: 1;
  font-size: 17px;
}
.sv {
  font-size: 12px;
  color: var(--mute);
}
.by {
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
}
.f {
  margin-bottom: 10px;
  position: relative;
}
.f label {
  display: block;
  font-size: 12px;
  color: var(--mute);
  margin-bottom: 3px;
}
.g2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.dates {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 10px;
}
.results {
  display: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 3px;
  position: absolute;
  left: 0;
  right: 0;
  z-index: 10;
}
.results.open {
  display: block;
}
.results div {
  padding: 8px 10px;
  cursor: pointer;
}
.results div:hover {
  background: var(--bg);
}
.att {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.att a {
  color: var(--acc);
  word-break: break-all;
}
.log,
.by,
.m,
.note,
.cm small,
.att span {
  overflow-wrap: anywhere;
}
.log {
  font-size: 13px;
  border-left: 2px solid var(--line);
  padding: 0 0 8px 10px;
  margin-left: 4px;
  position: relative;
}
.log::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--acc);
}
.log small,
.cm small {
  color: var(--mute);
  display: block;
}
.cm {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 6px;
  font-size: 14px;
}
.cm-text {
  white-space: pre-wrap;
  word-break: break-word;
}
.delete-box {
  margin-top: 18px;
}
#pg:not([hidden]) {
  border-top: 6px solid var(--c);
  padding-top: 12px;
}
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 50;
  max-width: 90vw;
}
#toast.on {
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media (max-width: 640px) {
  .g2 {
    grid-template-columns: 1fr;
  }
  main {
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
    padding-right: max(10px, env(safe-area-inset-right, 0px));
    padding-left: max(10px, env(safe-area-inset-left, 0px));
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  /* The create panel fills the screen on a phone, including the 561 to 640 gap (spec 10.2). */
  #dr {
    width: 100%;
    border-left: 0;
  }
  /* 16 px stops iOS from zooming in when a field gets focus (spec 10.2). */
  input,
  select,
  textarea {
    font-size: 16px;
  }
}
@media (min-width: 641px) and (max-width: 1024px) {
  main {
    max-width: 720px;
  }
}
/* Touch targets: at least 44 by 44 on a phone-sized window or with a touch screen (spec 10.2). */
@media (max-width: 640px), (pointer: coarse) {
  button,
  a.button,
  input,
  select {
    min-height: 44px;
  }
  button,
  a.button {
    min-width: 44px;
  }
  .t,
  .note a,
  .att a,
  .by a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    min-width: 44px;
  }
  .att {
    min-height: 44px;
  }
  .mv button {
    min-width: 44px;
    min-height: 44px;
  }
  .results div {
    display: flex;
    align-items: center;
    min-height: 44px;
  }
  .inline-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
  }
  input[type='checkbox'] {
    min-width: 24px;
    min-height: 24px;
    width: 24px;
    height: 24px;
  }
}

/* Words for screen readers only. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* A message that stays until the person closes it (plan R24): a failure must not vanish. */
#alert {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(560px, calc(100% - 20px));
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  color: var(--ink);
  border: 2px solid var(--over);
  border-radius: 10px;
  padding: 10px 12px;
  z-index: 60;
}
#alert span {
  flex: 1;
  overflow-wrap: anywhere;
}

/* The grey rows shown while the list loads: the same height as a ticket row, so nothing jumps. */
.skeleton {
  height: 120px;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--line), var(--card), var(--line));
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

/* Decision 8, built as a switch (READABLE_LABELS): the small label text in the normal text colour.
   The stripe, border and tint keep the state colour. Off until Hem says yes. */
[data-readable='on'] .tag,
[data-readable='on'] .tag.muted,
[data-readable='on'] .row .m {
  color: var(--ink);
}

/* The one place the prototype's list showed a person nothing: an empty pick list. */
.results .none {
  color: var(--mute);
  cursor: default;
}
.results div[aria-selected='true'] {
  background: var(--bg);
  outline: 2px solid var(--acc);
  outline-offset: -2px;
}

/* The bell and the notice list */
.bell-wrap {
  position: relative;
}
#bell {
  position: relative;
}
.badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 9px;
  background: var(--over);
  color: #fff;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
}
.bell-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  width: min(380px, calc(100vw - 32px));
  max-height: min(70vh, 520px);
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.bell-panel .empty {
  padding: 22px 14px;
}
.notice {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 14px 10px 26px;
  position: relative;
  background: transparent;
}
.notice:last-child {
  border-bottom: 0;
}
.notice.unread {
  font-weight: 600;
}
.notice.unread::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--acc);
}
.notice small {
  display: block;
  font-weight: 400;
  color: var(--mute);
  margin-top: 2px;
}
code {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 4px;
  font-size: 0.92em;
}
