/*
 * GitDash — tool stylesheet.
 *
 * Loaded after the suite's shared package (vendor/thestaticdev-ui/css/
 * tokens.css + components.css), which provides the palette, layout, brand
 * header, buttons, banners, settings card, form controls, tooltip, spinner
 * and footer. This file only holds GitDash's colour, the places where
 * GitDash deliberately differs from the suite, and its own components.
 */

:root {
  /* GitDash's own colour (logo, bottom-left tile): progress bars, the
     "in progress" dot, focus rings and the primary button. #13161C on
     #F43F5E is 4.93:1, the default --on-accent, so nothing else to set. */
  --accent: #F43F5E;
}

/* ── Where GitDash differs from the suite ────────────────────────────── */

a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Wider page and tighter vertical rhythm: a dashboard, not a single tool. */
.container { max-width: 72rem; }
.site-header { padding: 48px 16px 24px; }
.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 extras: clock and weather under the subtitle */
.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: 22px; height: 22px; flex-shrink: 0; }
.wx-t { font-size: 22px; font-weight: 300; letter-spacing: -0.01em; color: var(--text); margin-right: 4px; } /* same look as the time */

/* Buttons: disabled via aria-disabled (stays focusable), bigger on touch,
   spinning icon while loading. */
.btn[aria-disabled="true"] { opacity: 0.6; cursor: default; }
.btn-p[aria-disabled="true"]:hover { opacity: 0.6; }
@media (pointer: coarse) { .btn { min-height: 44px; } }
.btn.is-busy .ic { animation: rot 1s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.ic, .btn .ic { width: 14px; height: 14px; display: block; } /* the suite default in buttons is 13px */
.ic-lock { width: 13px; height: 13px; display: block; }

.err:empty { display: none; }

/* "A new version is available": bottom left, clear of the theme toggle on the right */
.update { position: fixed; z-index: 60; left: 16px; bottom: 16px; right: 96px; max-width: 30rem; display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding: 12px 16px; background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,0.25); font-size: 13px; }
.update:empty { display: none; }
.update-actions { display: flex; gap: 8px; }

/* Settings: several sections in one card */
.slbl { margin: 20px 0 12px; }
.stg > .slbl:first-of-type { margin-top: 0; }
select:disabled { opacity: 0.7; }

/* Loading: padded block by default, inline variant for small spots */
.spin { padding: 28px; }
.spin-t { margin-left: 6px; font-size: 11px; color: var(--muted); }
.spin-inline { padding: 4px 0; justify-content: flex-start; }
@media (prefers-reduced-motion: reduce) { .sd { animation: none; opacity: 1; } }

/* 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); }

/* Settings card contents */
.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; }

/* Demo banner */
.demo { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin: 16px 0; padding: 12px 16px; background: var(--surface); border: 1px dashed var(--spark-text); border-radius: var(--radius); font-size: 13px; line-height: 1.5; }
.demo strong { color: var(--spark-text); font-weight: 500; }
.badge-demo { color: var(--spark-text); border-color: var(--spark-text); }
a.ext:not([href]) { cursor: default; }
a.ext:not([href]):hover { text-decoration: none; }

/* Project list in Settings */
.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-pct { color: var(--text); font-weight: 500; }
.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[href]:hover, .grp li a.issue[href]:focus-visible { text-decoration: none; }
.grp li a.issue[href]:hover .iid, .grp li a.issue[href]:hover .it,
.grp li a.issue[href]:focus-visible .iid, .grp li a.issue[href]:focus-visible .it { text-decoration: underline; text-underline-offset: 3px; }
.grp-done li a.issue[href]:hover .it, .grp-done li a.issue[href]: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); }
