/* Screen-level styling. Grouped by screen; everything uses the tokens, so dark mode and RTL are free. */

.hide-sm { }
@media (max-width: 759px) { .hide-sm { display: none; } }
.between { justify-content: space-between; }
.clamp-1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--border-strong); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
.stagger > * { animation: fade-up var(--d-slow) var(--ease-out) both; }
.stagger > *:nth-child(2) { animation-delay: 50ms; } .stagger > *:nth-child(3) { animation-delay: 100ms; }
.stagger > *:nth-child(4) { animation-delay: 150ms; } .stagger > *:nth-child(5) { animation-delay: 200ms; } .stagger > *:nth-child(6) { animation-delay: 250ms; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-3); }
.section-head h2 { font-size: var(--fs-lg); font-weight: 700; }

/* ------------------------------------------------------------------ project pieces */
.stagebar { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; }
.stagebar .seg-cell { height: 6px; border-radius: 3px; background: var(--surface-3); position: relative; }
.stagebar .seg-cell.ok { background: var(--success); }
.stagebar .seg-cell.wait { background: var(--attn); }
.stagebar .seg-cell.run { background: var(--primary); animation: pulse-seg 1.6s ease-in-out infinite; }
.stagebar .seg-cell.fail { background: var(--danger); }
@keyframes pulse-seg { 50% { opacity: .45; } }
.stage-tile { display: inline-grid; place-items: center; flex: none; border-radius: 11px; color: var(--c); background: color-mix(in srgb, var(--c) 13%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 22%, transparent); }
[data-theme="dark"] .stage-tile { color: color-mix(in srgb, var(--c) 55%, #fff); }
.chip-stage { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); letter-spacing: .02em; direction: ltr; }
.due { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-sm); color: var(--text-3); }
.due-attn { color: var(--attn-text); font-weight: 600; } .due-danger { color: var(--danger-text); font-weight: 600; }

.pcard { display: flex; flex-direction: column; gap: 14px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); text-decoration: none; color: inherit; position: relative; overflow: hidden; transition: transform var(--d-base) var(--ease-out), box-shadow var(--d-base), border-color var(--d-base); }
.pcard::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: var(--accent, var(--primary)); }
.pcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--border-strong); }
.pcard-top { display: flex; gap: 10px; align-items: flex-start; }
.pcard-client { display: flex; align-items: center; gap: 7px; font-size: var(--fs-sm); color: var(--text-3); margin-bottom: 2px; }
.pcard-name { font-size: var(--fs-lg); font-weight: 700; line-height: 1.35; }
.pcard-stage { display: flex; gap: 10px; align-items: center; }
.pcard-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--divider); }

.qlist { display: flex; flex-direction: column; }
.qrow { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--divider); transition: background var(--d-fast); }
.qlist .qrow:first-child { border-top: 0; }
.qrow:hover { background: var(--surface-2); }
.qrow-main { min-width: 0; }
.qrow-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.qrow-link { color: var(--text); text-decoration: none; } .qrow-link:hover { color: var(--primary-text); text-decoration: underline; text-underline-offset: 3px; }
.qrow-sub { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--text-2); margin-top: 3px; min-width: 0; }
.qrow-cta { flex: none; }
.qrow-failed .stage-tile { --c: var(--danger); }
@media (max-width: 759px) { .qrow { flex-wrap: wrap; padding: 14px 16px; } .qrow-cta { width: 100%; } .qrow-cta .btn { width: 100%; } }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--sp-6); align-items: start; }
@media (max-width: 1180px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }

.feed { list-style: none; display: flex; flex-direction: column; }
.feed li { display: flex; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--divider); }
.feed li:first-child { border-top: 0; }
.cost-card { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.gauge-wrap { position: relative; width: 170px; height: 112px; flex: none; }
.gauge-num { position: absolute; inset-inline: 0; bottom: 6px; text-align: center; line-height: 1.2; }
.gauge-num b { font-size: var(--fs-xl); display: block; } .gauge-num span { font-size: var(--fs-xs); color: var(--text-3); }

.notif { display: flex; gap: 12px; padding: 12px; border-radius: var(--r-md); text-decoration: none; color: var(--text); border: 1px solid var(--border); background: var(--surface); }
.notif:hover { background: var(--surface-2); }
.notif-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--primary); }
.notif-attn .notif-dot { background: var(--attn); } .notif-danger .notif-dot { background: var(--danger); } .notif-success .notif-dot { background: var(--success); }

/* phase F: a name with no spaces (a long URL, 118 letters) must wrap inside its card, not widen the page */
.grow { min-width: 0; }
.qrow-title, .qrow-sub, .qrow-title > *, .qrow-sub > *, .obj-head, .pcard h3, .pcard-title { min-width: 0; overflow-wrap: anywhere; }
