/* Pillars preview components. Every color comes from the tokens defined in index.html. */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
a { color: var(--primary); }
h1, h2, h3, h4 { text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

/* ---------- tones (charts and accents) ---------- */
.pd-tone-primary { color: var(--primary); }
.pd-tone-ink { color: var(--ink); }
.pd-tone-success { color: var(--success); }
.pd-tone-warning { color: var(--warning); }
.pd-tone-danger { color: var(--danger); }
.pd-tone-soft { color: var(--soft); }
.pd-tone-body { color: var(--body); }

/* ---------- text helpers ---------- */
.pd-muted { color: var(--body); }
.pd-small { font-size: 13px; }
.pd-tiny { font-size: 12px; }
.pd-strong { font-weight: 700; color: var(--ink); }
.pd-num { font-variant-numeric: tabular-nums; }
.pd-mono { font-family: var(--mono); font-size: 12.5px; }
.pd-eyebrow { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--body); }
.pd-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.pd-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pd-h1 { margin: 0; font-size: 28px; line-height: 1.15; font-weight: 800; letter-spacing: -.015em; color: var(--ink); }
.pd-h2 { margin: 0; font-size: 20px; line-height: 1.25; font-weight: 800; letter-spacing: -.01em; color: var(--ink); }
.pd-h3 { margin: 0; font-size: 16px; line-height: 1.3; font-weight: 800; color: var(--ink); }
.pd-link { appearance: none; background: none; border: 0; padding: 0; color: var(--primary); font-weight: 700; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.pd-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.pd-icon { flex: none; vertical-align: middle; }

/* ---------- layout helpers ---------- */
.pd-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pd-stack--sm { gap: 8px; }
.pd-stack--lg { gap: 24px; }
.pd-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-width: 0; }
.pd-row--tight { gap: 6px; }
.pd-row--between { justify-content: space-between; }
.pd-spacer { flex: 1 1 auto; }
.pd-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.pd-grid > * { min-width: 0; }
.pd-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pd-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pd-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pd-split { display: grid; gap: 20px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.pd-split > * { min-width: 0; }
@media (max-width: 1100px) { .pd-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 960px) {
  .pd-split { grid-template-columns: minmax(0, 1fr); }
  .pd-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .pd-grid--2, .pd-grid--3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) { .pd-grid--4 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- app shell ---------- */
.pd-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.pd-rail {
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 22px;
  padding: 20px 14px 18px;
  background: var(--surface-2); border-right: 1px solid var(--hairline);
}
.pd-brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 16px; border-bottom: 1px solid var(--hairline); }
.pd-brand__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pd-brand__name { font-size: 18px; font-weight: 800; letter-spacing: -.01em; color: var(--ink); line-height: 1.1; }
.pd-brand__sub { font-size: 12px; color: var(--body); }
.pd-mark { display: block; flex: none; }
.pd-mark-bg { fill: var(--primary); }
.pd-mark-fg { fill: var(--on-primary); }
.pd-rail .pd-rail__close { display: none; }
.pd-nav { display: flex; flex-direction: column; gap: 14px; }
.pd-nav__section { display: flex; flex-direction: column; gap: 2px; }
.pd-nav__label { padding: 0 10px 4px; font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--body); }
.pd-nav__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.pd-nav__item {
  display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 7px 30px 7px 10px;
  border-radius: var(--radius-control); color: var(--ink); text-decoration: none; font-weight: 600;
  position: relative;
}
.pd-nav__item .pd-icon { color: var(--body); }
.pd-nav__item:hover { background: var(--tint); }
.pd-nav__item[aria-current="page"] { background: var(--surface); font-weight: 800; box-shadow: 0 1px 2px var(--shadow), inset 0 0 0 1px var(--hairline); }
.pd-nav__item[aria-current="page"] .pd-icon { color: var(--primary); }
.pd-nav__ext { margin-left: auto; color: var(--body); }
.pd-usercard { margin-top: auto; position: sticky; bottom: 0; z-index: 1; display: flex; flex-direction: column; gap: 8px; padding: 12px 8px 4px; border-top: 1px solid var(--hairline); background: var(--surface-2); }
.pd-usercard__who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pd-usercard__text { display: flex; flex-direction: column; min-width: 0; }
.pd-usercard__name { font-weight: 800; color: var(--ink); }
.pd-usercard__role { font-size: 12.5px; color: var(--body); }

.pd-main-col { min-width: 0; display: flex; flex-direction: column; }
.pd-topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; gap: 12px; min-height: 60px;
  padding-block: 10px;
  padding-left: max(40px, env(safe-area-inset-left, 0px));
  padding-right: max(40px, env(safe-area-inset-right, 0px));
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--hairline);
}
.pd-topbar .pd-topbar__menu, .pd-topbar .pd-topbar__brand { display: none; }
.pd-topbar__crumb { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; color: var(--body); font-size: 13.5px; }
.pd-topbar__crumb strong { color: var(--ink); font-weight: 800; }
.pd-topbar__tools { display: flex; align-items: center; gap: 10px; flex: none; }
.pd-switcher { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--body); font-weight: 600; white-space: nowrap; }
.pd-switcher .pd-select { min-height: 36px; padding-block: 6px; font-weight: 700; color: var(--ink); max-width: 240px; }
.pd-bell { position: relative; }
.pd-bell__count {
  position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
  background: var(--danger); color: var(--surface); font-size: 10.5px; font-weight: 800; line-height: 17px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.pd-main {
  flex: 1; width: 100%; max-width: 1280px;
  padding-top: 28px; padding-bottom: 120px;
  padding-left: max(40px, env(safe-area-inset-left, 0px));
  padding-right: max(40px, env(safe-area-inset-right, 0px));
}
.pd-main:focus { outline: none; }
.pd-screen { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.pd-scrim { display: none; }

@media (max-width: 759.98px) {
  .pd-shell { grid-template-columns: minmax(0, 1fr); }
  .pd-rail {
    position: fixed; z-index: 60; top: 0; bottom: 0; left: 0; height: auto;
    width: min(300px, 86vw);
    padding-top: calc(18px + env(safe-area-inset-top, 0px));
    padding-left: max(14px, env(safe-area-inset-left, 0px));
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-104%); transition: transform .22s ease; box-shadow: 0 10px 40px var(--shadow-strong);
    visibility: hidden;
  }
  .is-nav-open .pd-rail { transform: none; visibility: visible; }
  .pd-rail .pd-rail__close { display: inline-flex; }
  .is-nav-open .pd-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: var(--scrim); }
  .pd-topbar {
    gap: 8px; min-height: 56px;
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
  }
  .pd-topbar .pd-topbar__menu, .pd-topbar .pd-topbar__brand { display: inline-flex; }
  .pd-topbar__crumb .pd-topbar__section { display: none; }
  .pd-switcher__label { display: none; }
  .pd-switcher { flex: 1 1 auto; min-width: 0; justify-content: flex-end; }
  .pd-switcher .pd-select { max-width: 210px; min-width: 0; width: 100%; font-size: 13px; }
  .pd-topbar__tools { flex: 1 1 auto; min-width: 0; justify-content: flex-end; }
  .pd-topbar__crumb { display: none; }
  .pd-topbar__comment-label { display: none; }
  .pd-main {
    padding-top: 20px;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
}
@media (prefers-reduced-motion: reduce) { .pd-rail { transition: none; } }

/* ---------- page header ---------- */
.pd-page-head { display: flex; flex-direction: column; gap: 10px; }
.pd-page-head__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pd-page-head__text { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1 1 320px; }
.pd-page-head__titleline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pd-page-head__sub { color: var(--body); font-size: 15px; max-width: 68ch; }
.pd-page-head__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pd-back { align-self: flex-start; }
@media (max-width: 759.98px) { .pd-h1 { font-size: 24px; } }

/* ---------- status chips (notes) ---------- */
.pd-chip {
  --chip: var(--body);
  display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px 0 8px;
  border-radius: 999px; border: 1px solid color-mix(in srgb, var(--chip) 45%, var(--surface));
  background: color-mix(in srgb, var(--chip) 12%, var(--surface));
  color: var(--ink); font-size: 12px; font-weight: 800; letter-spacing: .01em; white-space: nowrap; cursor: pointer;
}
.pd-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--chip); flex: none; }
.pd-chip--built { --chip: var(--success); }
.pd-chip--next { --chip: var(--primary); }
.pd-chip--planned { --chip: var(--warning); }
.pd-chip--linked { --chip: var(--body); }
span.pd-chip { cursor: default; }
html:not(.pd-notes-on) .pd-page-head .pd-chip { display: none; }
.pd-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--body); flex: none; }
.pd-dot--built { background: var(--success); }
.pd-dot--next { background: var(--primary); }
.pd-dot--planned { background: var(--warning); }
.pd-dot--linked { background: var(--body); }

/* ---------- cards ---------- */
.pd-card {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-card);
  padding: 20px; min-width: 0; box-shadow: 0 1px 2px var(--shadow);
}
.pd-card--tint { background: var(--tint); border-color: color-mix(in srgb, var(--primary) 14%, var(--tint)); box-shadow: none; }
.pd-card--flush { padding: 0; overflow: hidden; }
.pd-card--plain { box-shadow: none; }
.pd-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pd-card--flush > .pd-card__head { margin: 0; padding: 16px 20px; border-bottom: 1px solid var(--hairline); }
.pd-card__title { margin: 0; font-size: 16px; font-weight: 800; color: var(--ink); line-height: 1.3; }
.pd-card__sub { font-size: 13px; color: var(--body); }
.pd-card__body { padding: 16px 20px; }
.pd-card__foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--hairline); }
.pd-card--flush > .pd-card__foot { margin: 0; padding: 12px 20px; }
.pd-card--interactive { cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; text-align: left; width: 100%; font: inherit; color: inherit; }
.pd-card--interactive:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--hairline)); box-shadow: 0 6px 18px var(--shadow); }
.pd-section-title { display: flex; align-items: baseline; gap: 8px; margin: 0; font-size: 16px; font-weight: 800; color: var(--ink); }
.pd-section-title .pd-count { font-size: 13px; font-weight: 700; color: var(--body); }

/* course band (colored header on course cards) */
.pd-band { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 76px; padding: 14px 16px; color: var(--surface); }
.pd-band--primary { background: var(--primary); color: var(--on-primary); }
.pd-band--ink { background: var(--ink); color: var(--surface); }
.pd-band--success { background: color-mix(in srgb, var(--success) 82%, var(--ink)); color: var(--surface); }
.pd-band--warning { background: color-mix(in srgb, var(--warning) 88%, var(--ink)); color: var(--surface); }
.pd-band__icon { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 10px; background: color-mix(in srgb, currentColor 18%, transparent); }

/* ---------- stat tiles ---------- */
.pd-stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.pd-stat { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-card); box-shadow: 0 1px 2px var(--shadow); min-width: 0; }
.pd-stat__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pd-stat__label { font-size: 12.5px; font-weight: 700; color: var(--body); }
.pd-stat__icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; background: var(--tint); color: var(--primary); }
.pd-stat__value { font-size: 30px; line-height: 1.05; font-weight: 800; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.pd-stat__hint { font-size: 12.5px; color: var(--body); }

/* ---------- buttons ---------- */
.pd-btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 8px 16px; border-radius: var(--radius-control); border: 1px solid transparent;
  font-weight: 700; font-size: 14px; line-height: 1.2; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.pd-btn:disabled, .pd-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.pd-btn--primary { background: var(--primary); color: var(--on-primary); }
.pd-btn--primary:hover:not(:disabled) { background: var(--primary-hover); }
.pd-btn--secondary { background: var(--surface); color: var(--ink); border-color: var(--hairline); box-shadow: 0 1px 1px var(--shadow); }
.pd-btn--secondary:hover:not(:disabled) { border-color: color-mix(in srgb, var(--primary) 40%, var(--hairline)); background: color-mix(in srgb, var(--tint) 50%, var(--surface)); }
.pd-btn--ghost { background: transparent; color: var(--body); }
.pd-btn--ghost:hover:not(:disabled) { background: var(--tint); color: var(--ink); }
.pd-btn--danger { background: var(--danger); color: var(--surface); }
.pd-btn--danger:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 86%, var(--ink)); }
.pd-btn--sm { min-height: 32px; padding: 5px 11px; font-size: 13px; gap: 6px; }
.pd-btn--lg { min-height: 46px; padding: 11px 20px; font-size: 15px; }
.pd-btn--block { width: 100%; }
.pd-icon-btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 38px; height: 38px; border-radius: var(--radius-control); border: 1px solid transparent; background: transparent;
  color: var(--ink); cursor: pointer;
}
.pd-icon-btn:hover:not(:disabled) { background: var(--tint); }
.pd-icon-btn:disabled { opacity: .45; cursor: not-allowed; }
.pd-icon-btn--sm { width: 30px; height: 30px; }
.pd-icon-btn--bordered { border-color: var(--hairline); background: var(--surface); }
html:not(.pd-comments-on) [data-comment-btn] { display: none !important; }

/* ---------- badges ---------- */
.pd-badge {
  --badge: var(--body);
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap; line-height: 1;
  border: 1px solid color-mix(in srgb, var(--badge) 32%, transparent);
  background: color-mix(in srgb, var(--badge) 10%, var(--surface));
  color: color-mix(in srgb, var(--badge) 62%, var(--ink));
}
.pd-badge--neutral { --badge: var(--body); }
.pd-badge--info { --badge: var(--primary); }
.pd-badge--success { --badge: var(--success); }
.pd-badge--warning { --badge: var(--warning); }
.pd-badge--danger { --badge: var(--danger); }
.pd-badge .pd-icon { width: 12px; height: 12px; }

/* ---------- avatars and people ---------- */
.pd-avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--tint); color: var(--primary); font-weight: 800; font-size: 12.5px; letter-spacing: .02em;
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--tint));
}
.pd-avatar--sm { width: 26px; height: 26px; font-size: 10.5px; }
.pd-avatar--lg { width: 56px; height: 56px; font-size: 18px; }
.pd-avatar--muted { background: var(--surface-2); color: var(--body); border-color: var(--hairline); }
.pd-person { display: inline-flex; align-items: center; gap: 10px; min-width: 0; text-align: left; }
.pd-person__text { display: flex; flex-direction: column; min-width: 0; }
.pd-person__name { font-weight: 700; color: var(--ink); }
.pd-person__meta { font-size: 12.5px; color: var(--body); }
button.pd-person { appearance: none; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
button.pd-person:hover .pd-person__name { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- tables ---------- */
.pd-table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--radius-card); background: var(--surface); box-shadow: 0 1px 2px var(--shadow); }
.pd-card .pd-table-wrap, .pd-table-wrap--bare { border: 0; border-radius: 0; box-shadow: none; }
.pd-table { width: 100%; min-width: 560px; border-collapse: collapse; text-align: left; font-size: 14px; }
.pd-table--compact { min-width: 0; }
.pd-table th, .pd-table td { padding: 12px 14px; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
.pd-table thead th { padding-block: 10px; font-size: 12.5px; font-weight: 700; color: var(--body); background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); white-space: nowrap; }
.pd-table tbody tr:last-child > * { border-bottom: 0; }
.pd-table tbody tr:hover > * { background: color-mix(in srgb, var(--tint) 40%, var(--surface)); }
.pd-table tbody th { font-weight: 700; color: var(--ink); }
.pd-table__num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pd-table__actions { text-align: right; white-space: nowrap; }
.pd-table__actions > * + * { margin-left: 6px; }
.pd-table .pd-progress { min-width: 90px; }
.pd-table tr.is-muted > * { color: var(--body); }

/* ---------- toolbar, forms ---------- */
.pd-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; padding: 14px 16px; background: var(--tint); border-radius: var(--radius-card); }
.pd-toolbar .pd-field { min-width: 160px; flex: 0 1 220px; }
.pd-search { position: relative; display: flex; align-items: center; min-width: 0; flex: 1 1 240px; }
.pd-search .pd-icon { position: absolute; left: 11px; color: var(--body); pointer-events: none; }
.pd-search .pd-input { padding-left: 36px; width: 100%; }
.pd-form { display: grid; gap: 16px; }
.pd-form-row { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 600px) { .pd-form-row { grid-template-columns: minmax(0, 1fr); } }
.pd-field { display: grid; gap: 6px; min-width: 0; }
.pd-field__label { font-size: 13px; font-weight: 700; color: var(--ink); }
.pd-field__hint { font-size: 12.5px; color: var(--body); }
.pd-field__error { font-size: 13px; color: var(--danger); font-weight: 600; }
.pd-input, .pd-select, .pd-textarea {
  width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--hairline); border-radius: var(--radius-control);
  background: var(--surface); color: var(--ink); font-size: 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.pd-textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.pd-select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--body) 50%), linear-gradient(135deg, var(--body) 50%, transparent 50%);
  background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.pd-input::placeholder, .pd-textarea::placeholder { color: var(--body); opacity: .85; }
.pd-input:focus, .pd-select:focus, .pd-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
.pd-input[aria-invalid="true"], .pd-select[aria-invalid="true"], .pd-textarea[aria-invalid="true"] { border-color: var(--danger); }
.pd-check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; line-height: 1.4; }
.pd-check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--primary); flex: none; }
.pd-switch { appearance: none; position: relative; width: 36px; height: 20px; border-radius: 999px; background: var(--hairline); border: 0; cursor: pointer; flex: none; transition: background-color .15s ease; margin: 0; }
.pd-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px var(--shadow-strong); transition: transform .15s ease; }
.pd-switch:checked, .pd-switch[aria-checked="true"] { background: var(--primary); }
.pd-switch:checked::after, .pd-switch[aria-checked="true"]::after { transform: translateX(16px); }
fieldset.pd-fieldset { border: 1px solid var(--hairline); border-radius: var(--radius-card); padding: 14px 16px; margin: 0; min-width: 0; }
fieldset.pd-fieldset > legend { padding: 0 6px; font-weight: 800; font-size: 13px; color: var(--ink); }

/* ---------- tabs ---------- */
.pd-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--hairline); overflow-x: auto; scrollbar-width: thin; }
.pd-tab {
  appearance: none; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  display: inline-flex; align-items: center; gap: 7px; padding: 10px 12px; font-weight: 700; color: var(--body); cursor: pointer; white-space: nowrap;
}
.pd-tab:hover { color: var(--ink); }
.pd-tab[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }
.pd-tab__count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--body); font-size: 11.5px; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.pd-tab[aria-selected="true"] .pd-tab__count { background: var(--tint); color: var(--primary); }
.pd-segment { display: inline-flex; padding: 3px; gap: 2px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--hairline); }
.pd-segment .pd-tab { border: 0; margin: 0; padding: 6px 12px; border-radius: 6px; }
.pd-segment .pd-tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px var(--shadow); }

/* ---------- alerts ---------- */
.pd-alert {
  --alert: var(--primary);
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: var(--radius-card);
  border: 1px solid color-mix(in srgb, var(--alert) 30%, var(--surface));
  background: color-mix(in srgb, var(--alert) 8%, var(--surface)); color: var(--ink);
}
.pd-alert > .pd-icon { color: var(--alert); margin-top: 2px; }
.pd-alert__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pd-alert__title { font-weight: 800; }
.pd-alert__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pd-alert--info { --alert: var(--primary); }
.pd-alert--success { --alert: var(--success); }
.pd-alert--warning { --alert: var(--warning); }
.pd-alert--danger { --alert: var(--danger); }

/* ---------- empty state ---------- */
.pd-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 40px 20px; color: var(--body); }
.pd-empty__icon { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 14px; background: var(--tint); color: var(--primary); margin-bottom: 4px; }
.pd-empty__title { font-size: 16px; font-weight: 800; color: var(--ink); }
.pd-empty__body { max-width: 46ch; }
.pd-empty__action { margin-top: 8px; }

/* ---------- lists and timelines ---------- */
.pd-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pd-list__item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--hairline); min-width: 0; }
.pd-list__item:last-child { border-bottom: 0; }
.pd-list__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pd-timeline { list-style: none; margin: 0; padding: 0 0 0 18px; display: flex; flex-direction: column; gap: 14px; position: relative; }
.pd-timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--hairline); border-radius: 2px; }
.pd-timeline__item { position: relative; display: flex; flex-direction: column; gap: 2px; }
.pd-timeline__item::before { content: ""; position: absolute; left: -18px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--soft); }
.pd-timeline__item--success::before { border-color: var(--success); background: var(--success); }
.pd-timeline__item--warning::before { border-color: var(--warning); }
.pd-timeline__item--danger::before { border-color: var(--danger); }
.pd-timeline__item--info::before { border-color: var(--primary); }
.pd-divider { display: flex; align-items: center; gap: 12px; color: var(--body); font-size: 12.5px; font-weight: 700; }
.pd-divider::before, .pd-divider::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }
.pd-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; }
.pd-kv dt { color: var(--body); font-size: 13px; }
.pd-kv dd { margin: 0; color: var(--ink); font-weight: 600; min-width: 0; }

/* ---------- charts ---------- */
.pd-progress { display: block; width: 100%; height: 8px; overflow: visible; }
.pd-progress--sm { height: 6px; }
.pd-progress--lg { height: 10px; }
.pd-progress__track { fill: var(--surface-2); stroke: var(--hairline); stroke-width: 0; }
.pd-progress__fill { fill: currentColor; }
.pd-progress-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pd-progress-row .pd-progress { flex: 1; }
.pd-progress-row__value { font-size: 12.5px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; }
.pd-bars { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.pd-bars__row { display: grid; grid-template-columns: minmax(90px, 34%) minmax(0, 1fr) 52px; align-items: center; gap: 12px; }
.pd-bars__label { font-size: 13px; font-weight: 600; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-bars__value { font-size: 13px; font-weight: 800; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.pd-bars__track { display: block; width: 100%; height: 10px; }
.pd-bars__bg { fill: var(--surface-2); }
.pd-bars__fill { fill: currentColor; }
@media (max-width: 480px) { .pd-bars__row { grid-template-columns: minmax(0, 1fr) 46px; } .pd-bars__label { grid-column: 1 / -1; } }
.pd-donut { margin: 0; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.pd-donut svg { flex: none; }
.pd-donut__track { stroke: var(--surface-2); }
.pd-donut__seg { stroke: currentColor; }
.pd-donut__value { fill: var(--ink); font-weight: 800; font-size: 8.5px; font-family: var(--font); }
.pd-donut__sub { fill: var(--body); font-weight: 700; font-size: 3.6px; font-family: var(--font); }
.pd-legend-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pd-legend-list li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); }
.pd-legend-list .pd-legend-swatch { width: 10px; height: 10px; border-radius: 3px; background: currentColor; flex: none; }
.pd-legend-list .pd-legend-value { margin-left: auto; padding-left: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pd-columns { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.pd-columns__plot { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; align-items: end; border-bottom: 1px solid var(--hairline); padding-bottom: 2px; }
.pd-columns__col { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.pd-columns__value { font-size: 12px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.pd-columns__bar { display: block; width: 100%; max-width: 44px; }
.pd-columns__bar rect { fill: currentColor; }
.pd-columns__labels { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; }
.pd-columns__label { font-size: 12px; color: var(--body); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- dialog ---------- */
#pd-dialog-root { position: fixed; inset: 0; z-index: 80; }
.pd-dialog-backdrop {
  position: absolute; inset: 0; background: var(--scrim); display: flex; align-items: center; justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  animation: pd-fade .14s ease;
}
.pd-dialog {
  width: 100%; max-width: 560px; max-height: calc(100dvh - 32px); display: flex; flex-direction: column;
  background: var(--surface); border-radius: 12px; border: 1px solid var(--hairline); box-shadow: 0 24px 60px var(--shadow-strong);
  animation: pd-rise .18s ease; min-width: 0;
}
.pd-dialog:focus { outline: none; }
.pd-dialog--sm { max-width: 420px; }
.pd-dialog--lg { max-width: 760px; }
.pd-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--hairline); background: color-mix(in srgb, var(--surface-2) 50%, var(--surface)); border-radius: 12px 12px 0 0; }
.pd-dialog__title { margin: 0; font-size: 17px; font-weight: 800; color: var(--ink); }
.pd-dialog__body { padding: 20px; overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 16px; }
.pd-dialog__foot, .pd-dialog-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; }
.pd-dialog__foot { padding: 14px 20px; border-top: 1px solid var(--hairline); background: color-mix(in srgb, var(--surface-2) 50%, var(--surface)); border-radius: 0 0 12px 12px; }
.pd-dialog-actions { margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--hairline); }
@keyframes pd-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pd-rise { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }

/* ---------- toasts ---------- */
#pd-toasts {
  position: fixed; z-index: 90; right: max(20px, env(safe-area-inset-right, 0px)); bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; max-width: calc(100vw - 32px);
}
.pd-toast {
  --toast: var(--primary);
  pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 380px;
  padding: 11px 14px; border-radius: 10px; background: var(--ink); color: var(--surface);
  box-shadow: 0 10px 30px var(--shadow-strong); font-weight: 600; animation: pd-rise .18s ease;
}
.pd-toast .pd-icon { color: var(--toast); }
.pd-toast--success { --toast: var(--success); }
.pd-toast--warning { --toast: var(--warning); }
.pd-toast--danger { --toast: var(--danger); }
.pd-toast--info { --toast: var(--primary); }
@media (max-width: 759.98px) { #pd-toasts { left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); align-items: stretch; } .pd-toast { max-width: none; } }

/* ---------- notes layer ---------- */
#pd-layer { position: fixed; inset: 0; z-index: 85; pointer-events: none; overflow: hidden; }
.pd-pin {
  --pin: var(--body);
  position: absolute; left: 0; top: 0; pointer-events: auto;
  display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0;
  border-radius: 50%; border: 2px solid var(--surface); background: var(--pin); color: var(--surface);
  box-shadow: 0 2px 6px var(--shadow-strong); cursor: help;
}
.pd-pin .pd-icon { width: 11px; height: 11px; }
.pd-pin--built { --pin: var(--success); }
.pd-pin--next { --pin: var(--primary); }
.pd-pin--planned { --pin: var(--warning); }
.pd-pin--linked { --pin: var(--body); }
.pd-pin--dot { width: 20px; height: 20px; border: 0; background: transparent; box-shadow: none; }
.pd-pin--dot::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--pin); box-shadow: 0 0 0 2px var(--surface-2); }
.pd-pin--dot .pd-icon { display: none; }
.pd-pin:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.pd-pin.is-pulse::before {
  content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 3px solid var(--pin);
  animation: pd-pulse 1.1s ease-out 4;
}
@keyframes pd-pulse { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pd-pin.is-pulse::before { animation: none; transform: scale(1.2); opacity: .7; } }
.pd-notecard {
  position: fixed; z-index: 95; width: 300px; max-width: calc(100vw - 24px); pointer-events: auto;
  display: flex; flex-direction: column; gap: 8px; padding: 14px 16px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--hairline); border-radius: 10px;
  box-shadow: 0 16px 40px var(--shadow-strong); text-align: left; font-size: 13.5px; line-height: 1.45; font-weight: 400; letter-spacing: 0; text-transform: none;
}
.pd-notecard__tour { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); }
.pd-notecard__say { font-size: 14.5px; font-weight: 700; color: var(--ink); padding-bottom: 8px; border-bottom: 1px solid var(--hairline); }
.pd-notecard__title { font-weight: 800; font-size: 14.5px; }
.pd-notecard__body { color: var(--body); }
.pd-notecard .pd-btn { align-self: flex-start; margin-top: 2px; }
.pd-notecard .pd-chip { align-self: flex-start; cursor: default; }
html:not(.pd-notes-on) #pd-layer { display: none; }

/* ---------- presenter bar ---------- */
.pd-presenter {
  position: fixed; z-index: 88; left: 50%; transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 4px; padding: 5px;
  max-width: calc(100vw - 24px);
  background: color-mix(in srgb, var(--surface) 94%, transparent); color: var(--ink);
  border: 1px solid var(--hairline); border-radius: 999px; box-shadow: 0 8px 28px var(--shadow-strong);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: 12.5px; font-weight: 700;
}
.pd-pbtn {
  appearance: none; display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 11px; border-radius: 999px;
  border: 0; background: transparent; color: var(--ink); cursor: pointer; font-weight: 700; font-size: 12.5px; white-space: nowrap;
}
.pd-pbtn:hover:not(:disabled) { background: var(--tint); }
.pd-pbtn:disabled { opacity: .4; cursor: default; }
.pd-pbtn--icon { width: 32px; padding: 0; justify-content: center; }
.pd-pbtn .pd-switch { width: 28px; height: 16px; pointer-events: none; }
.pd-pbtn .pd-switch::after { width: 12px; height: 12px; }
.pd-pbtn .pd-switch[aria-checked="true"]::after { transform: translateX(12px); }
.pd-presenter__sep { width: 1px; height: 20px; background: var(--hairline); flex: none; }
.pd-legend { display: flex; align-items: center; gap: 10px; padding: 0 8px; white-space: nowrap; }
.pd-legend__item { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.pd-legend__label { color: var(--body); font-weight: 600; }
.pd-tourpos { padding: 0 4px; font-variant-numeric: tabular-nums; color: var(--body); white-space: nowrap; }
@media (max-width: 759.98px) {
  .pd-legend__label, .pd-pbtn__label { display: none; }
  .pd-legend { gap: 8px; padding: 0 4px; }
}
@media (max-width: 400px) { .pd-presenter { gap: 2px; } .pd-pbtn { padding: 0 8px; } }
@media (max-width: 759.98px) { html.pd-nav-is-open .pd-presenter { display: none; } }

/* ---------- sign-in ---------- */
.pd-signin {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding-block: 40px 110px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background:
    radial-gradient(1200px 500px at 85% -10%, color-mix(in srgb, var(--primary) 9%, transparent), transparent 70%),
    var(--canvas);
}
.pd-signin__wrap { width: 100%; max-width: 1020px; display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 28px; align-items: stretch; }
@media (max-width: 860px) { .pd-signin__wrap { grid-template-columns: minmax(0, 1fr); max-width: 480px; } }
.pd-signin__card { display: flex; flex-direction: column; gap: 18px; padding: 30px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px; box-shadow: 0 18px 50px var(--shadow); min-width: 0; }
.pd-signin__brand { display: flex; align-items: center; gap: 12px; }
.pd-signin__name { font-size: 22px; font-weight: 800; letter-spacing: -.015em; color: var(--ink); line-height: 1.1; }
.pd-signin__tag { font-size: 13px; color: var(--body); }
.pd-signin__head { display: flex; flex-direction: column; gap: 6px; }
.pd-google { position: relative; }
.pd-google__g { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--on-primary); color: var(--primary); font-weight: 800; font-size: 13px; }
.pd-devlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pd-devuser {
  appearance: none; width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; text-align: left;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 10px; cursor: pointer; color: var(--ink);
  transition: border-color .15s ease, background-color .15s ease;
}
.pd-devuser:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--hairline)); background: color-mix(in srgb, var(--tint) 45%, var(--surface)); }
.pd-devuser__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pd-devuser__name { font-weight: 800; }
.pd-devuser__meta { font-size: 12.5px; color: var(--body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-devuser > .pd-icon { color: var(--body); }
.pd-welcome {
  display: flex; flex-direction: column; gap: 18px; padding: 32px; border-radius: 14px; min-width: 0;
  background: var(--ink); color: var(--surface); position: relative; overflow: hidden;
}
.pd-welcome::after {
  content: ""; position: absolute; right: -60px; bottom: -80px; width: 260px; height: 260px; border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 40%, transparent); filter: blur(10px); opacity: .55; pointer-events: none;
}
.pd-welcome > * { position: relative; z-index: 1; }
.pd-welcome .pd-eyebrow { color: color-mix(in srgb, var(--surface) 70%, var(--ink)); }
.pd-welcome__title { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 800; letter-spacing: -.015em; color: var(--surface); }
.pd-welcome__lead { font-size: 15.5px; line-height: 1.6; color: color-mix(in srgb, var(--surface) 86%, var(--ink)); max-width: 56ch; }
.pd-welcome__keys { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pd-welcome__keys li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; align-items: center; }
.pd-welcome__keys .pd-chip { background: color-mix(in srgb, var(--chip) 22%, var(--ink)); border-color: color-mix(in srgb, var(--chip) 55%, var(--ink)); color: var(--surface); cursor: default; }
.pd-welcome__keys p { font-size: 13.5px; color: color-mix(in srgb, var(--surface) 78%, var(--ink)); }
.pd-welcome__tips { margin-top: auto; padding-top: 16px; border-top: 1px solid color-mix(in srgb, var(--surface) 16%, var(--ink)); font-size: 13px; color: color-mix(in srgb, var(--surface) 72%, var(--ink)); }
.pd-kbd { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 5px; border: 1px solid color-mix(in srgb, currentColor 40%, transparent); font-weight: 800; font-size: 12px; text-align: center; }
@media (max-width: 600px) { .pd-welcome__keys li { grid-template-columns: minmax(0, 1fr); } .pd-welcome__keys .pd-chip { justify-self: start; } }
@media (max-width: 860px) { .pd-welcome { padding: 24px; } .pd-signin__card { padding: 22px; } .pd-signin { align-items: flex-start; padding-top: 20px; } }

/* ---------- placeholder, refused, error ---------- */
.pd-placeholder { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 32px; border-style: dashed; background: color-mix(in srgb, var(--surface-2) 40%, var(--surface)); box-shadow: none; }
.pd-placeholder__icon, .pd-refused__icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 12px; background: var(--tint); color: var(--primary); }
.pd-refused { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 32px; max-width: 640px; }
.pd-refused__icon { color: var(--ink); background: var(--surface-2); }

/* ---------- notices ---------- */
.pd-notice { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 12px; border-radius: 8px; border: 1px solid var(--hairline); background: var(--surface); text-align: left; cursor: pointer; color: var(--ink); }
.pd-notice:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--hairline)); }
.pd-notice.is-unread { background: color-mix(in srgb, var(--tint) 60%, var(--surface)); }
.pd-notice__icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; background: var(--tint); color: var(--primary); flex: none; }
.pd-notice__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
