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

:root {
  /* The Static Dev — base palette (dark, the suite's default). Token names and
     values match GitPulse and Prettify. Light overrides live in html.light. */
  --ink: #13161C;
  --surface: #1C212B;
  --surface-2: #232934;
  --border: #2A303C;
  --border-strong: #767A83;
  --text: #E7E9EE;
  --muted: #8B93A1;
  --spark: #F2B33D;
  /* GitDash's own colour (logo, bottom-left tile): progress bars, the
     "in progress" dot, focus rings and the primary button. The same in both
     themes, so text on it is a literal dark (see .btn-p). */
  --accent: #F43F5E;
  /* Warning text ("Overdue"): --spark is too pale on a light surface. */
  --spark-text: #F2B33D;
  --danger: #f87171;
  --danger-bg: rgba(248,113,113,0.12);
  --danger-border: rgba(248,113,113,0.3);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  --sans: var(--mono);
  --radius: 8px;
}

html.light {
  --ink: #EEF0F3;
  --surface: #FFFFFF;
  --surface-2: #EEF0F3;
  --border: #D8DCE3;
  --border-strong: #82868E;
  --text: #1A1E27;
  --muted: #5B6472;
  --spark-text: #8F610A;
  --danger: #b91c1c;
  --danger-bg: rgba(220,38,38,0.08);
  --danger-border: rgba(220,38,38,0.25);
}

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s, color .3s;
}

a { color: inherit; }
a:focus-visible, button:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.hidden { display: none !important; }
.visually-hidden, .sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Layout */
.container { max-width: 72rem; margin: 0 auto; }
.site-header { padding: 48px 16px 24px; text-align: center; }
.main { padding: 16px 16px 0; }
.foot { padding: 0 16px 96px; }
@media (min-width: 640px) {
  .site-header { padding: 64px 24px 32px; }
  .main { padding: 16px 24px 0; }
  .foot { padding: 0 24px 96px; }
}
@media (min-width: 1024px) {
  .site-header { padding: 64px 32px 32px; }
  .main { padding: 16px 32px 0; }
  .foot { padding: 0 32px 96px; }
}

/* Header: logo, title and subtitle centred, as in the other tools of the suite */
.brand { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text); transition: opacity .15s; }
.brand:hover { opacity: 0.82; }
.brand-logo { width: 44px; height: 44px; display: block; flex-shrink: 0; }
.brand-title { font-size: 36px; font-weight: 300; letter-spacing: -0.02em; line-height: 1; }
@media (min-width: 640px) { .brand-title { font-size: 44px; } }
.brand-subtitle { margin-top: 12px; font-size: 13px; color: var(--muted); letter-spacing: 0.01em; }
@media (min-width: 640px) { .brand-subtitle { font-size: 15px; } }
.clock { display: flex; align-items: center; justify-content: center; gap: 4px 14px; flex-wrap: wrap; margin-top: 20px; font-size: 13px; color: var(--muted); }
.clock time { font-size: 22px; font-weight: 300; color: var(--text); letter-spacing: -0.01em; }
.wx { display: inline-flex; align-items: center; gap: 6px; }
.wx svg { width: 18px; height: 18px; flex-shrink: 0; }
.wx-t { color: var(--text); }

/* Action bar */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.hdr-r { display: flex; align-items: center; gap: 8px; }
.ts { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.ic { width: 14px; height: 14px; display: block; }
.ic-lock { width: 13px; height: 13px; display: block; }

.btn { display: inline-flex; align-items: center; gap: 5px; background: var(--surface); color: var(--muted); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 6px 11px; min-height: 36px; font-size: 12px; font-family: var(--mono); cursor: pointer; transition: color .15s, border-color .15s, background-color .15s; }
.btn:hover { color: var(--text); border-color: var(--text); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.6; cursor: default; }
@media (pointer: coarse) { .btn { min-height: 44px; } }
/* Fixed dark text, not var(--ink): --accent does not change with the theme, so
   its paired text can't either. #13161C on #F43F5E is 4.93:1 (white is 3.67:1). */
.btn-p { background: var(--accent); color: #13161C; border-color: transparent; font-weight: 500; }
.btn-p:hover { background: var(--accent); color: #13161C; border-color: transparent; opacity: 0.85; }
.btn-p[aria-disabled="true"]:hover { opacity: 0.6; }
.btn.is-busy .ic { animation: rot 1s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* Error */
.err:empty { display: none; }
.err { background: var(--danger-bg); border: 1px solid var(--danger-border); border-radius: var(--radius); color: var(--danger); font-size: 12px; padding: 8px 12px; margin-bottom: 12px; }

/* Settings */
.stg { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.slbl { font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 20px 0 12px; }
.stg > .slbl:first-of-type { margin-top: 0; }
.sg { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 639px) { .sg { grid-template-columns: 1fr; } }
.pf { display: flex; flex-direction: column; gap: 8px; border: 0; min-width: 0; }
.ph { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; margin-bottom: 2px; padding: 0; }
.hint { font-size: 11px; color: var(--muted); line-height: 1.5; }
.hint.is-err { color: var(--danger); }
.hint.is-ok { color: var(--text); }

.chk { display: flex; align-items: center; gap: 10px; min-height: 48px; font-size: 13px; cursor: pointer; }
.chk input { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--accent); cursor: pointer; }
.radios { display: flex; gap: 20px; }

.tip { position: relative; display: inline-flex; }
/* Real 48x48 hit target; the visible "?" stays a small 14px dot. */
.tbtn { width: 48px; height: 48px; margin: -14px 0; padding: 0; border: none; background: transparent; cursor: help; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tbtn-dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--border-strong); font-size: 9px; font-weight: 500; color: var(--muted); font-family: var(--mono); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.tbox { display: block; max-width: calc(100vw - 64px); position: absolute; left: 30px; top: 0; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 10px 12px; width: 220px; z-index: 50; font-size: 11px; font-weight: 400; line-height: 1.65; color: var(--text); box-shadow: 0 8px 24px rgba(0,0,0,0.25); }
.tbox b { display: block; font-weight: 500; margin-bottom: 5px; }
.tbox ol { padding-left: 16px; list-style: decimal; }
.tbox li { margin-bottom: 2px; color: var(--muted); }
.tbox code { font-family: var(--mono); font-size: 10px; background: var(--ink); padding: 1px 4px; border-radius: 3px; }
.tbox[hidden] { display: none; }

input[type="text"], input[type="password"], input[type="number"], select { background: var(--ink); border: 1px solid var(--border-strong); border-radius: var(--radius); color: var(--text); font-family: var(--mono); font-size: 12px; padding: 7px 10px; min-height: 48px; width: 100%; outline: 2px solid transparent; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
select:disabled { opacity: 0.7; }

.plist { border: 1px solid var(--border); border-radius: var(--radius); background: var(--ink); max-height: 18rem; overflow-y: auto; }
.prow { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 13px; }
.prow:last-child { border-bottom: 0; }
.prow:hover { background: var(--surface-2); }
.prow input { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--accent); cursor: pointer; }
.prow-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow-grp { color: var(--muted); }
.plist-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plist-tools .hint { margin-left: auto; }
.emp-s { padding: 16px; font-size: 12px; color: var(--muted); }
.cfg-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

/* Summary */
#sRow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
@media (max-width: 639px) { #sRow { grid-template-columns: repeat(2, 1fr); } }
.sc { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column-reverse; }
.sc dd { margin: 0; }
.sn { font-family: var(--mono); font-size: 28px; font-weight: 500; line-height: 1; margin-bottom: 4px; }
.sn-warn { color: var(--spark-text); }
.sl { font-size: 11px; color: var(--muted); letter-spacing: 0.05em; text-transform: uppercase; }

/* Project grid */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.card-wide { grid-column: 1 / -1; }
@media (max-width: 767px) { .grid { grid-template-columns: minmax(0, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.card-hd { padding: 14px 16px 10px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-hd-t { min-width: 0; }
.card-acts { display: flex; gap: 6px; flex-shrink: 0; }
.card-size { flex-shrink: 0; min-height: 36px; }
.card-pin[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.card-pin[aria-pressed="true"] svg { fill: currentColor; }
.card-size[aria-pressed="true"] { color: var(--text); border-color: var(--text); }
@media (max-width: 767px) { .card-size { display: none; } } /* one column: nothing to widen */
.card-title { font-size: 15px; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.card-wide .card-title { font-size: 18px; }
.card-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.badge { display: inline-block; flex-shrink: 0; font-size: 10px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--border-strong); border-radius: 4px; padding: 1px 6px; line-height: 1.5; }
.prow .badge { margin-left: 8px; }
.card-sub { margin-top: 3px; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.card-err { padding: 0 16px 14px; font-size: 12px; color: var(--danger); }
.panel-msg .icon-btn { margin-left: 8px; vertical-align: middle; }
.card-ft { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); }
.card-ft-r { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* External links: an arrow appears on hover and focus */
a.ext { text-decoration: none; }
a.ext:hover, a.ext:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.ext-ic { width: 0.85em; height: 0.85em; margin-left: 2px; vertical-align: -1px; opacity: 0; transition: opacity .15s; }
a.ext:hover .ext-ic, a.ext:focus-visible .ext-ic { opacity: 1; }
.card-foot-link { color: var(--text); }

/* Milestones */
.ms-list { list-style: none; border-top: 1px solid var(--border); }
.ms { border-bottom: 1px solid var(--border); }
.ms:last-child { border-bottom: 0; }
.ms-row { display: flex; align-items: stretch; }
.ms-tog { flex-shrink: 0; width: 48px; min-height: 48px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: color .15s; }
.ms-tog:hover { color: var(--text); }
.ms-tog:focus-visible { outline-offset: -2px; }
.ms-tog svg { width: 16px; height: 16px; transition: transform .15s; }
.ms-tog[aria-expanded="true"] svg { transform: rotate(90deg); }
.ms-main { flex: 1; min-width: 0; padding: 10px 16px 10px 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; }
.ms-title { font-size: 13px; font-weight: 500; overflow-wrap: anywhere; min-width: 0; }
.ms-count { font-size: 12px; color: var(--muted); white-space: nowrap; }
.ms-bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.ms-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.ms-due { grid-column: 1 / -1; font-size: 11px; color: var(--muted); }
.ms-due.is-late { color: var(--spark-text); font-weight: 500; }
.ms-panel { padding: 4px 16px 16px 48px; }
@media (max-width: 479px) { .ms-panel { padding-left: 16px; } }

.groups { display: grid; gap: 14px; }
.card-wide .groups { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 767px) { .card-wide .groups { grid-template-columns: minmax(0, 1fr); } }
.grp-h { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.grp-n { margin-left: auto; font-weight: 400; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dot-prog { background: var(--accent); }
.dot-todo { border: 2px solid var(--border-strong); }
.dot-done { background: var(--muted); opacity: 0.6; }
.grp ul { list-style: none; }
/* Fixed columns (#iid | title | assignees | arrow) so the initials line up on one vertical in every row */
.grp li a.issue { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 0.85em; column-gap: 8px; align-items: baseline; padding: 5px 0; font-size: 12px; line-height: 1.45; }
/* Underline only the text on hover: an underline on the link itself would also run under the initials */
.grp li a.issue:hover, .grp li a.issue:focus-visible { text-decoration: none; }
.grp li a.issue:hover .iid, .grp li a.issue:hover .it,
.grp li a.issue:focus-visible .iid, .grp li a.issue:focus-visible .it { text-decoration: underline; text-underline-offset: 3px; }
.grp-done li a.issue:hover .it, .grp-done li a.issue:focus-visible .it { text-decoration: underline line-through; }
.grp li a.issue .ext-ic { grid-column: 4; margin-left: 0; align-self: center; }
.grp li a.issue .iid { color: var(--muted); flex-shrink: 0; }
.grp li a.issue .it { min-width: 0; overflow-wrap: anywhere; }
.grp-done .it { text-decoration: line-through; color: var(--muted); }
.avs { grid-column: 3; display: inline-flex; justify-self: end; align-self: center; }
.av { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong); font-size: 10px; font-weight: 500; letter-spacing: 0; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.av + .av { margin-left: -6px; box-shadow: -2px 0 0 var(--surface); }
.grp-done .av { color: var(--muted); }
.icon-btn { padding: 6px 9px; }
.grp-empty { font-size: 12px; color: var(--muted); padding: 5px 0; }
.grp-more { padding: 5px 0; font-size: 11px; color: var(--muted); }
.grp-more a { color: var(--text); }
.panel-msg { font-size: 12px; color: var(--muted); padding: 6px 0; }
.panel-msg.is-err { color: var(--danger); }
.empty-card { grid-column: 1 / -1; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 28px; text-align: center; color: var(--muted); font-size: 13px; }
.no-ms { padding: 12px 16px 14px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); }

/* Loading dots */
.spin { display: flex; align-items: center; gap: 5px; justify-content: center; padding: 28px; }
.spin-t { margin-left: 6px; font-size: 11px; color: var(--muted); }
.spin-inline { padding: 4px 0; justify-content: flex-start; }
.sd { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: sp 1s ease-in-out infinite; }
.sd:nth-child(2) { animation-delay: .15s; }
.sd:nth-child(3) { animation-delay: .3s; }
@keyframes sp { 0%,80%,100% { opacity: .25; transform: scale(.7); } 40% { opacity: 1; transform: scale(1); } }
.emp { padding: 28px; text-align: center; color: var(--muted); font-size: 13px; }

/* Footer */
.site-footer { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--border); text-align: center; color: var(--muted); }
.footer-privacy { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; font-size: 13px; flex-direction: column; }
.privacy-icon { flex-shrink: 0; margin-top: 1px; }
.footer-copy { font-size: 13px; }
.footer-version { font-size: 11px; margin-top: 8px; font-family: var(--mono); }

/* Respect the user's motion preference */
@media (prefers-reduced-motion: reduce) {
  .sd { animation: none; opacity: 1; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
