/* Colours and corners follow Sredify's default theme (dg-lite). */
:root {
  --bg: #fafafa; --card: #ffffff; --fg: #0a0a0a; --muted: #71717a;
  --border: #e4e4e7; --accent: #f4f4f5; --primary: #171717; --primary-fg: #fafafa;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
.wrap { max-width: 960px; margin: 0 auto; padding: 32px 20px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.account { display: flex; gap: 8px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--card); border-radius: 9999px; padding: 6px 12px; font-size: 13px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 1.5rem; padding: 24px; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.btn { background: var(--primary); color: var(--primary-fg); border: 0; border-radius: .75rem; padding: 12px 22px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { opacity: .9; }
.ghost { background: transparent; color: var(--fg); border: 1px solid var(--border); border-radius: .75rem; padding: 8px 14px; font: inherit; font-size: 13px; cursor: pointer; }
.ghost:hover { background: var(--accent); }
.btn:focus-visible, .ghost:focus-visible, select:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
h1 { font-size: 22px; margin: 0 0 4px; }
.sub { color: var(--muted); margin: 0; }
.row { display: flex; gap: 12px; align-items: end; justify-content: space-between; flex-wrap: wrap; margin-bottom: 20px; }
label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 6px; }
select { font: inherit; border: 1px solid var(--border); border-radius: .75rem; padding: 10px 12px; background: var(--card); min-width: 260px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.person { border: 1px solid var(--border); border-radius: 1rem; padding: 16px; text-align: center; background: var(--card); }
.person canvas { width: 72px; height: 72px; image-rendering: pixelated; border-radius: .75rem; display: block; margin: 0 auto 10px; }
.name { font-weight: 600; overflow-wrap: anywhere; }
.meta { color: var(--muted); font-size: 13px; }
.tag { display: inline-block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: top; margin-top: 8px; font-size: 12px; border-radius: 9999px; padding: 2px 10px; background: var(--accent); color: var(--muted); }
.gh { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 8px; font-size: 12px; line-height: 16px; color: #a1a1aa; white-space: nowrap; }
.gh svg { width: 14px; height: 14px; flex: none; }
.gh.linked { color: var(--fg); font-weight: 500; }
.former canvas { filter: grayscale(1); opacity: .6; }
.former .name { color: var(--muted); }
.connect { max-width: 440px; margin: 60px auto; text-align: center; }
.connect h1 { text-wrap: balance; }
.faces { margin-bottom: 16px; }
.faces canvas { width: 48px; height: 48px; image-rendering: pixelated; margin: 0 3px; border-radius: .5rem; }
.scopes { text-align: left; color: var(--muted); font-size: 13px; margin: 18px 0 22px; padding-left: 18px; }
.notice { background: var(--accent); border-radius: .75rem; padding: 10px 12px; font-size: 13px; text-align: left; }
.empty { color: var(--muted); background: var(--accent); border-radius: 1rem; padding: 16px; margin: 0; }
/* Reports */
.reports { margin-top: 16px; }
h2 { font-size: 18px; margin: 0 0 4px; }
.reports select { max-width: 420px; }
.report-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.pill { display: inline-block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; font-size: 12px; line-height: 18px; border-radius: 9999px; padding: 1px 10px; background: var(--accent); color: var(--muted); }
.pill.kind { background: var(--primary); color: var(--primary-fg); }
.pill.verdict { background: #dcfce7; color: #166534; }
.total { font-size: 22px; font-weight: 700; white-space: nowrap; }
.total .sub { font-size: 13px; font-weight: 400; }
.hrs { font-weight: 600; white-space: nowrap; flex: none; }
.hrs s { color: var(--muted); font-weight: 400; margin-right: 6px; }
.summary { margin: 12px 0 0; }
.label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: none; margin: 16px 0 8px; }
.items { display: flex; flex-direction: column; gap: 8px; }
.item { border: 1px solid var(--border); border-radius: 1rem; background: var(--card); }
.item > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 1rem; }
.item > summary::-webkit-details-marker { display: none; }
.item > summary::before { content: ""; flex: none; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; margin-right: 2px; }
.item[open] > summary::before { transform: rotate(45deg); }
.item > summary:hover { background: var(--accent); }
.item > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.item-head { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.item-title { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.item-head .pill { flex: none; max-width: 45%; }
.item-body { padding: 0 14px 14px 35px; }
.item-body > p { margin: 8px 0 0; }
.note { font-size: 13px; color: var(--muted); }
.note b { color: var(--fg); font-weight: 600; }
.note.edited { background: #fef9c3; color: #713f12; border-radius: .5rem; padding: 4px 8px; }
.note.edited b { color: #713f12; }
.tasks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.task { background: var(--accent); border-radius: .75rem; padding: 10px 12px; }
.task .line { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.task-name { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.task p { margin: 6px 0 0; }
.files { font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); overflow-wrap: anywhere; }
#report-empty .ghost { margin-left: 6px; }
.who-box { margin-top: 12px; border-top: 1px solid var(--border); }
.who-box .label { margin-top: 12px; }
.who-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.who { display: flex; align-items: center; gap: 10px; }
.who canvas { width: 32px; height: 32px; image-rendering: pixelated; border-radius: .5rem; flex: none; }
.who-name { display: flex; align-items: baseline; gap: 6px; min-width: 0; flex: 1; flex-wrap: wrap; }
.who-name .name { font-size: 14px; }
.login { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }
.who-nums { display: flex; align-items: baseline; gap: 10px; flex: none; }
.who-nums .hrs { cursor: help; }
.commits { font-size: 13px; color: var(--muted); white-space: nowrap; }
/* Fill / Rebalance */
.head-actions { display: flex; align-items: center; gap: 12px; }
.fill-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.fill-bar .hint { font-size: 12px; color: var(--muted); }
.btn.sm { padding: 8px 14px; font-size: 13px; }
.btn:disabled, .ghost:disabled { opacity: .45; cursor: default; }
.delta { font-size: 13px; font-weight: 600; white-space: nowrap; }
.delta.up { color: #15803d; }
.delta.down { color: #b91c1c; }
.arrow { color: var(--muted); font-size: 13px; }
.who-nums .hrs.was { color: var(--muted); font-weight: 400; }
.flag { font-size: 11px; line-height: 16px; border-radius: 9999px; padding: 1px 8px; background: #ffedd5; color: #9a3412; white-space: nowrap; }
.fill-sum { margin-top: 10px; background: var(--accent); border-radius: .75rem; padding: 10px 12px; font-size: 13px; }
.fill-sum b { font-weight: 600; }
.fill-sum ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
.fill-sum .note { margin: 6px 0 0; }
.who-box .notice, .item-body > .notice { margin-top: 10px; }
/* Desktop: eligible work rows show the title on one line (ellipsis, full text on hover) and no
   SR&ED test pill (the tests are in the open dropdown). Phone keeps the pill under the title. */
@media (min-width: 521px) {
  [data-testid="cl-work"] .item-head .pill { display: none; }
  [data-testid="cl-work"] .item-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
}
/* Evidence for these hours (evidence.js) */
.ev-box { margin-top: 14px; border-top: 1px solid var(--border); }
.ev-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.ev-top .label { margin: 0; }
.ev-cover { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.ev-cover b { color: var(--fg); font-weight: 600; }
.ev-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.ev-as { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin: 0; }
.ev-as select { min-width: 0; padding: 7px 10px; font-size: 13px; }
.ev-hint { font-size: 12px; color: var(--muted); }
.ev-box > .notice { margin-top: 10px; }
.ev-sec { margin-top: 14px; }
.ev-sec[data-open="0"] { margin-top: 6px; }
.ev-sec-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.ev-sec-h b { font-size: 13px; }
.ev-count { font-size: 12px; color: var(--muted); white-space: nowrap; }
.ev-fold { display: flex; align-items: center; gap: 10px; width: 100%; background: var(--card); border: 1px solid var(--border); border-radius: .75rem; padding: 10px 12px; font: inherit; font-size: 13px; color: var(--fg); cursor: pointer; text-align: left; }
.ev-fold:hover { background: var(--accent); }
.ev-fold:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ev-fold b { flex: 1; font-weight: 600; }
.ev-fold + .ev-list { margin-top: 6px; }
.ev-chev { flex: none; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); margin-right: 2px; transition: transform .15s; }
.ev-fold.open .ev-chev { transform: rotate(45deg); }
.ev-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.ev-card { border: 1px solid var(--border); border-radius: .75rem; padding: 10px 12px; background: var(--card); }
.ev-card.sug { border: 1px dashed #a1a1aa; background: #fcfcfc; }
.ev-card .ln { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ev-card .t { font-weight: 600; font-size: 14px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ev-card .m { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ev-card p { margin: 4px 0 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.ev-card p b { color: var(--fg); font-weight: 600; }
.ev-card a { color: var(--fg); }
.ev-pill { font-size: 11px; line-height: 16px; border-radius: 9999px; padding: 1px 8px; white-space: nowrap; flex: none; }
.ev-pill.sug { background: var(--accent); color: var(--muted); border: 1px dashed #a1a1aa; }
.ev-pill.ok { background: #dcfce7; color: #166534; }
.ev-pill.warn { background: #ffedd5; color: #9a3412; }
.ev-who { display: inline-flex; gap: 3px; vertical-align: middle; }
.ev-who canvas { width: 18px; height: 18px; border-radius: 5px; image-rendering: pixelated; }
.ev-acts { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.ev-acts .ghost, .ev-acts .btn { padding: 6px 12px; font-size: 12px; white-space: nowrap; }
.ev-byrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.ev-by { font-size: 12px; color: #166534; }
.ev-by span { color: var(--muted); }
.ev-link { background: none; border: 0; padding: 4px 0; font: inherit; font-size: 12px; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; flex: none; }
.ev-link:hover { color: var(--fg); }
.ev-remove { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.ev-remove input { flex: 1; min-width: 180px; font: inherit; font-size: 13px; border: 1px solid var(--border); border-radius: .5rem; padding: 6px 8px; }
.ev-remove .ghost { padding: 6px 12px; font-size: 12px; }
.sha { font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--accent); border-radius: 4px; padding: 1px 5px; color: var(--muted); overflow-wrap: anywhere; }
.ev-steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.ev-steps > li { position: relative; padding-left: 26px; }
.ev-steps > li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 1px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.ev-steps .t { font-size: 13px; font-weight: 600; }
.ev-steps p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.ev-edit { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; margin-top: 8px; font-size: 12px; color: var(--muted); }
.ev-edit input, .ev-edit textarea { font: inherit; font-size: 13px; color: var(--fg); border: 1px solid var(--border); border-radius: .5rem; padding: 6px 8px; background: var(--card); width: 100%; min-width: 0; }
.ev-edit input:not([type="checkbox"]) { height: 34px; }
.ev-edit input[type="checkbox"] { width: auto; }
.ev-edit textarea { min-height: 48px; resize: vertical; }
.ev-people { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--fg); font-size: 13px; }
.ev-people label { display: inline-flex; align-items: center; gap: 4px; margin: 0; color: var(--fg); font-size: 13px; }
footer { margin-top: 20px; color: var(--muted); font-size: 12px; text-align: center; }
@media (max-width: 520px) {
  .wrap { padding: 20px 14px; }
  .picker { width: 100%; }
  select { min-width: 0; width: 100%; }
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .person { padding: 12px; }
  .person canvas { width: 60px; height: 60px; }
  .reports select { max-width: none; }
  .item > summary { padding: 12px; gap: 8px; }
  .item-head { flex-wrap: wrap; row-gap: 4px; }
  .item-head .pill { max-width: 100%; }
  .item-body { padding: 0 12px 12px; }
  .tests-one { display: none; }
  .who { flex-wrap: wrap; }
  .who-nums { width: 100%; padding-left: 42px; flex-wrap: wrap; row-gap: 4px; }
  .fill-bar .btn, .fill-bar .ghost { flex: 1; }
  .fill-bar .hint { width: 100%; }
  .head-actions { width: 100%; justify-content: space-between; }
  .ev-bar .btn, .ev-bar .ghost { flex: 1; }
  .ev-as { width: 100%; }
  .ev-as select { flex: 1; }
  .ev-hint { width: 100%; }
  .ev-acts .ghost, .ev-acts .btn { flex: 1; }
  .ev-acts .wide { flex-basis: 100%; }
  .ev-edit { grid-template-columns: 1fr; }
  .ev-card .ln .t { flex-basis: 100%; }
  .ev-byrow { align-items: flex-start; }
}

/* privacy page */
.wrap.narrow { max-width: 760px; }
.privacy h2 { margin: 22px 0 6px; font-size: 16px; }
.privacy p, .privacy li { color: var(--fg); }
.privacy ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.privacy a, footer a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
