.personal-dashboard {
  --panel: var(--color-gray-800);
  --rule: var(--color-gray-700);
  --subtle: var(--color-gray-400);
  --green: #9cddbd; --green-wash: #203c34; --blue: #acd2ff; --blue-wash: #233e60;
  --amber: #f6d18f; --amber-wash: #403522; --red: #ffb6bd; --red-wash: #45242b;
  --violet: #c5b4ed; --violet-wash: #363242;
  --mono: ui-monospace, Menlo, monospace;
  flex: 1;
  overflow: auto;
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-wrap: anywhere;
  color-scheme: dark;
}
.personal-dashboard:has(dialog[open]) { overflow: hidden; }
.personal-dashboard :is(a, button, input, summary):focus-visible { outline: 2px solid var(--color-blue-400); outline-offset: 3px; }
.personal-dashboard button {
  cursor: pointer; border: 1px solid var(--rule); border-radius: 7px;
  background: var(--panel); padding: 8px 12px; font: inherit;
}
.personal-dashboard button:hover { background: var(--rule); }
.dash-wrap { max-width: 1340px; margin: auto; padding: 28px 4.4% 55px; }
.dash-meta { font: 11px/1.45 var(--mono); color: var(--subtle); }
.dash-sliders { display: inline-block; vertical-align: middle; }
.dash-body { min-width: 0; }

/* Section labels */
.dash-lbl-row { display: flex; align-items: center; min-height: 30px; gap: 8px; margin-bottom: 10px; }
.dash-lbl { font: 600 11px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--subtle); }
.dash-lbl em { font-style: normal; color: var(--color-gray-200); margin-left: 6px; }
.personal-dashboard .dash-pick { margin-left: auto; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; color: var(--subtle); }
.personal-dashboard .dash-pick:hover { color: var(--color-gray-200); }
.dash-all { margin-left: auto; font: 11px/1.45 var(--mono); color: var(--color-blue-400); }
.dash-all:hover { text-decoration: underline; }

/* Pulse strip */
.dash-pulse { display: grid; grid-template-columns: 1.5fr repeat(4, minmax(0, 1fr)); background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; margin-bottom: 26px; }
.dash-pulse > a { padding: 13px 18px; min-width: 0; display: block; }
.dash-pulse > a + a { border-left: 1px solid var(--rule); }
.dash-pulse > a:hover { background: #ffffff08; }
.dash-k { font: 600 11px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--subtle); }
.dash-v { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; font-size: 22px; font-weight: 650; letter-spacing: -.03em; white-space: nowrap; }
.dash-v small { font: 400 12px/1.4 -apple-system, BlinkMacSystemFont, sans-serif; letter-spacing: 0; color: var(--subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-pulse > a:first-child .dash-v { flex-wrap: wrap; row-gap: 0; }
.dash-pulse .ok .dash-v { color: var(--green); }
.dash-pulse .bad { background: var(--red-wash); }
.dash-pulse .bad .dash-v { color: var(--red); }
.dash-pulse .warn .dash-v { color: var(--amber); }
.dash-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; align-self: center; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 25%, transparent); }
.dash-slots { display: inline-flex; gap: 4px; align-self: center; }
.dash-slots i { width: 14px; height: 6px; border-radius: 2px; background: #80acff; }
.dash-slots i.free { background: var(--color-gray-600); }

/* Columns: ≥1366 main + rail; below, the rail stacks */
.dash-cols { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 26px; align-items: start; }
.dash-col > section + section { margin-top: 26px; }

/* Needs you */
.dash-inbox { display: grid; gap: 8px; }
.dash-item { --tone: var(--amber); --wash: var(--amber-wash); display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 13px 14px 13px 16px; border: 1px solid var(--rule); border-left: 3px solid var(--tone); border-radius: 12px; background: var(--panel); }
.dash-item.red { --tone: var(--red); --wash: var(--red-wash); }
.dash-item.violet { --tone: var(--violet); --wash: var(--violet-wash); }
.dash-item:hover { background: #263142; }
.dash-ico { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--wash); color: var(--tone); }
.dash-ico svg { width: 18px; height: 18px; }
.dash-item .dash-t { display: block; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:is(.dash-item, .dash-run, .dash-next) .dash-t:hover, .dash-proj:hover .dash-n, .dash-ship:hover .dash-t { text-decoration: underline; }
.dash-s { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 12px; color: var(--subtle); white-space: nowrap; overflow: hidden; }
.dash-s > * { flex: none; }
.dash-s > :last-child { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dash-kind { color: var(--tone); font-weight: 600; }
.dash-why { margin-top: 5px; font: 12px/1.45 var(--mono); color: var(--color-gray-300); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-acts { display: flex; gap: 6px; align-items: center; }
.dash-form { display: contents; }
.personal-dashboard .dash-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 7px 13px; border-radius: 7px; border: 1px solid var(--rule); background: var(--color-gray-900); font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.personal-dashboard .dash-btn:hover { background: var(--rule); }
.personal-dashboard .dash-btn.primary { background: var(--color-blue-600); border-color: var(--color-blue-600); color: var(--color-white); }
.personal-dashboard .dash-btn.primary:hover { background: var(--color-blue-700); }
.personal-dashboard .dash-btn.ghost { border-color: transparent; background: transparent; color: var(--subtle); padding-inline: 9px; }
.personal-dashboard .dash-btn.ghost:hover { color: var(--color-gray-200); background: var(--rule); }
.dash-backlog { margin-top: 8px; }
.dash-backlog summary { list-style: none; cursor: pointer; width: fit-content; font-size: 12px; color: var(--color-blue-400); padding: 4px 0; }
.dash-backlog summary::-webkit-details-marker { display: none; }
.dash-backlog .dash-inbox { margin-top: 8px; }
.dash-backlog:not([open]) .when-open, .dash-backlog[open] .when-closed { display: none; }
.dash-clear { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 12px; color: var(--subtle); }
.dash-clear .dash-ico { background: var(--green-wash); color: var(--green); width: 30px; height: 30px; }

/* Panels, Running */
.dash-panel { background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
.dash-run { display: grid; grid-template-columns: 22px minmax(0, 1fr) 196px 64px; gap: 14px; align-items: center; padding: 14px 16px; }
:is(.dash-run, .dash-next, .dash-proj) + :is(.dash-run, .dash-next, .dash-proj, .dash-panel-more) { border-top: 1px solid var(--rule); }
:is(.dash-run, .dash-next, .dash-proj):hover { background: #ffffff06; }
.dash-pv { display: inline-grid; place-items: center; flex: none; color: var(--color-gray-200); }
.dash-pv-icon { width: 18px; height: 18px; }
.dash-pv-icon.sm { width: 14px; height: 14px; }
:is(.dash-run, .dash-next) .dash-t { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:is(.dash-run, .dash-next) .dash-s { gap: 8px; margin-top: 2px; }
.dash-activity { margin-top: 4px; font: 11px/1.45 var(--mono); color: var(--subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-activity b { color: var(--color-gray-300); font-weight: 400; }
.dash-track, .dash-tlabels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
.dash-track span { height: 5px; border-radius: 1px; background: #475566; }
.dash-track [data-segment="completed"] { background: #78d5aa; }
.dash-track :is([data-segment="running"], [data-segment="active"]) { background: #80acff; box-shadow: 0 0 0 2px #80acff33; }
.dash-track :is([data-segment="error"], [data-segment="rejected"]) { background: #ff929c; }
.dash-track [data-segment="blocked"] { background: #f5c16b; }
.dash-track [data-segment="waiting"] { background: repeating-linear-gradient(90deg, #80acff 0 3px, #475566 3px 6px); }
.dash-track [data-segment="skipped"] { background: transparent; border: 1px dashed #748195; }
.dash-tlabels { margin-top: 5px; font: 10px/1 var(--mono); color: var(--color-gray-500); }
.dash-tlabels .now { color: var(--blue); font-weight: 600; }
.dash-el { text-align: right; font: 12px/1.3 var(--mono); color: var(--color-gray-300); }
.dash-el small { display: block; white-space: nowrap; color: var(--color-gray-500); font-size: 10px; }
.dash-empty-row { padding: 16px; color: var(--subtle); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.dash-empty-row b { white-space: nowrap; color: var(--color-gray-200); font-weight: 600; }
.dash-panel-more { display: block; padding: 10px 16px; font-size: 12px; color: var(--color-blue-400); }
.dash-panel-more:hover { text-decoration: underline; }

/* Up next */
.dash-next { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 16px; }
.dash-ord { font: 12px var(--mono); color: var(--color-gray-500); text-align: right; }
.dash-next.wait { opacity: .62; }
.dash-chip { font: 600 11px/1 -apple-system, sans-serif; padding: 4px 8px; border-radius: 20px; background: #2c3544; color: var(--color-gray-300); white-space: nowrap; }
.dash-chip.amber { background: var(--amber-wash); color: var(--amber); }
.dash-chip.blue { background: var(--blue-wash); color: var(--blue); }
.dash-chip.red { background: var(--red-wash); color: var(--red); }

/* Projects */
.dash-proj { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; }
.dash-tile { display: grid; width: 30px; height: 30px; }
.dash-n { font-weight: 650; }
.dash-f { font-size: 12px; color: var(--color-gray-300); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.dash-proj.idle .dash-f { color: var(--subtle); }
.dash-bar { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.dash-bar progress { flex: 1; min-width: 0; height: 4px; appearance: none; border: 0; border-radius: 4px; background: var(--rule); overflow: hidden; }
.dash-bar progress::-webkit-progress-bar { background: var(--rule); }
.dash-bar progress::-webkit-progress-value { background: #78d5aa; }
.dash-bar progress::-moz-progress-bar { background: #78d5aa; }

/* Shipped */
.dash-day { font: 600 10px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--color-gray-500); padding: 12px 14px 4px; }
.dash-ship { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 14px; font-size: 12px; color: var(--subtle); }
.dash-ship:last-child { padding-bottom: 12px; }
.dash-ck { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #203029; color: #a3e1bd; font-size: 11px; }
.dash-ship .dash-t { display: block; font-size: 13px; color: var(--color-gray-100); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Empty selection + picker dialog */
.dash-first { display: grid; place-items: center; min-height: 200px; border: 1px dashed var(--rule); border-radius: 12px; }
.dash-first .dash-sliders { margin-right: 4px; }
.personal-dashboard dialog { margin: auto; width: min(410px,90vw); max-height: 90dvh; border: 1px solid var(--rule); border-radius: 15px; padding: 23px; color: inherit; background: var(--panel); box-shadow: 0 24px 80px #0008; }
.personal-dashboard dialog::backdrop { background: rgb(0 0 0 / 75%); }
.personal-dashboard h2 { font-size: 22px; font-weight: 600; letter-spacing: -.035em; margin-bottom: 10px; }
.personal-dashboard dialog label { min-height: 44px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--rule); }
.personal-dashboard input { accent-color: var(--color-blue-500); margin: 0 3px 0 4px; }
.dash-actions { display: flex; justify-content: end; gap: 8px; margin-top: 18px; }
.personal-dashboard .dash-save { color: var(--color-white); background: var(--color-blue-600); }
.personal-dashboard .dash-save:hover { background: var(--color-blue-700); }

/* Below 1366 the main column (viewport − 256px sidebar) is too narrow for the 380px rail */
@media (max-width: 1365px) {
  .dash-cols { grid-template-columns: minmax(0, 1fr); }
  .dash-rail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
  .dash-rail > section + section { margin-top: 0; }
}
@media (max-width: 1023px) {
  .dash-pulse { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .dash-pulse > a { grid-column: span 2; }
  .dash-pulse > a:nth-child(-n+2) { grid-column: span 3; }
  .dash-pulse > a:nth-child(3) { border-left: 0; }
  .dash-pulse > a:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .dash-run { grid-template-columns: 22px minmax(0, 1fr) 64px; }
  .dash-run .dash-el { grid-row: 1; grid-column: 3; align-self: start; }
  .dash-run .dash-prog { grid-row: 2; grid-column: 2 / -1; }
  .dash-rail { grid-template-columns: minmax(0, 1fr); }
  .dash-rail > section + section { margin-top: 26px; }
}
/* Sidebar becomes an overlay below md */
@media (max-width: 767px) {
  .dash-wrap { padding: 16px 16px 40px; }
  .dash-pulse { grid-template-columns: 1fr 1fr; margin-bottom: 20px; }
  .dash-pulse > a, .dash-pulse > a:nth-child(-n+2) { grid-column: auto; padding: 11px 14px; }
  .dash-pulse > a:nth-child(1) { grid-column: 1 / -1; }
  .dash-pulse > a:nth-child(2), .dash-pulse > a:nth-child(4) { border-left: 0; }
  .dash-pulse > a:nth-child(3), .dash-pulse > a:nth-child(5) { border-left: 1px solid var(--rule); }
  .dash-pulse > a:nth-child(n+2) { border-top: 1px solid var(--rule); }
  .dash-v { font-size: 19px; }
  .dash-cols { gap: 20px; }
  .dash-col > section + section, .dash-rail > section + section { margin-top: 20px; }
  .dash-item { grid-template-columns: 32px minmax(0, 1fr); gap: 11px; padding: 12px; }
  .dash-item .dash-ico { width: 32px; height: 32px; }
  :is(.dash-item, .dash-next) .dash-t, .dash-item .dash-why { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .dash-item .dash-s { flex-wrap: wrap; white-space: normal; row-gap: 2px; }
  .dash-item .dash-acts { grid-column: 1 / -1; }
  .personal-dashboard .dash-item .dash-btn { min-height: 44px; flex: 1; }
  .personal-dashboard .dash-item .dash-btn.ghost { flex: none; min-width: 44px; }
  .dash-run { padding: 13px 14px; gap: 10px 12px; }
  .dash-next { padding: 12px 14px; min-height: 52px; }
  .dash-proj { min-height: 56px; }
  .personal-dashboard .dash-pick { width: 44px; height: 44px; margin-block: -7px; }
}
