/*
 * James unified desktop system
 * Visual baseline: james-final-desktop-design.work.html
 * Desktop only. Mobile styles and application behaviour remain in styles.css.
 */
@font-face {
  font-family: "James Editorial CN";
  src: url("./assets/fonts/source-han-serif/SourceHanSerifCN-VF.ttf.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}

/* Work queue clarity: real status filters, one semantic summary line, no nested x-scroll. */
.projects-filter-segments {
  display: none;
}

@media (min-width: 821px) {
  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-toolbar {
    grid-template-columns: minmax(310px, .95fr) minmax(260px, 1.6fr) minmax(150px, .72fr) auto;
  }

  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-filter {
    position: relative;
    padding: 0 7px 0 11px;
    display: flex;
    align-items: center;
  }

  body.p4-framework #view-work .projects-filter-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-width: 1px !important;
    min-height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
  }

  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-filter-segments {
    min-width: 0;
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
    padding: 3px;
    border-radius: 8px;
    background: var(--p4-surface-2);
  }

  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-filter-segments button {
    min-width: 0;
    min-height: 30px;
    padding: 0 8px;
    overflow: hidden;
    color: var(--p4-text-2);
    border: 0;
    border-radius: 6px;
    background: transparent;
    box-shadow: none;
    font: 550 12px/1 var(--projects-sans, var(--p4-ui));
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-filter-segments button:is(:hover, :focus-visible) {
    color: var(--p4-text);
    outline: 0;
    background: color-mix(in srgb, var(--p4-surface) 72%, transparent);
  }

  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-filter-segments button.is-active {
    color: var(--p4-text);
    background: var(--p4-surface);
    box-shadow: 0 1px 3px rgba(30, 40, 33, .1);
  }

  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-list-heading {
    justify-content: flex-start;
  }

  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work #work-list {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work :is(.projects-record, .projects-record-main, .projects-record-copy, .projects-record-context) {
    min-width: 0;
    max-width: 100%;
  }

  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-record-context {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
  }

  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-record-update {
    min-width: 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    color: var(--p4-text-3);
    font: 500 11.5px/1.3 var(--projects-sans, var(--p4-ui));
    white-space: nowrap;
  }

  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-record-update > span {
    flex: 0 0 auto;
    color: var(--p4-text-2);
    font-weight: 650;
  }

  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-record-update > span::after,
  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-record-update > b::after,
  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-record-update > time::after {
    margin-left: 6px;
    color: var(--p4-line-strong);
    content: "·";
  }

  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-record-update > b,
  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-record-update > time {
    flex: 0 0 auto;
    color: var(--p4-text-3);
    font: inherit;
  }

  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-record-update > em {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    color: var(--p4-text-2);
    font-style: normal;
    text-overflow: ellipsis;
  }

  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-record-status {
    justify-self: start;
    padding: 3px 7px;
    gap: 5px;
    font-size: 11.5px;
    line-height: 1.2;
  }

  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-record-status::before {
    width: 5px;
    height: 5px;
    flex-basis: 5px;
  }

  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-record-main > time {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    white-space: nowrap;
  }

  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-record-main > time b {
    font: inherit;
  }

  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-record-main > time.is-overdue {
    color: var(--p4-danger);
    font-weight: 600;
  }

  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-record-main > time.is-overdue span {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
  }
}

@media (min-width: 821px) and (max-width: 1500px) {
  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-pilot-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-health-panel {
    display: none;
  }
}

/* Global UI polish: use quiet vector chevrons instead of text arrows. */
.nav-connection-icon,
.nav-connection-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.nav-connection-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[data-chevron] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

[data-chevron]::after,
.ui-card-chevron::after,
.ui-forward-icon::after {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  content: "";
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
}

.ui-card-chevron,
.ui-forward-icon {
  display: grid;
  place-items: center;
  font-size: 0;
}

.ui-back-icon,
.ui-back-link {
  position: relative;
}

.ui-back-icon {
  font-size: 0 !important;
}

.ui-back-icon::before,
.ui-back-link::before {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  content: "";
  border-left: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}

.ui-back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

[data-expand-indicator] {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

[data-expand-indicator]::after,
.ui-disclosure-chevron::after {
  width: 7px;
  height: 7px;
  content: "";
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.ui-disclosure-chevron {
  width: 12px;
  height: 12px;
  display: grid;
  place-items: center;
  font-size: 0;
  transition: transform .18s ease;
}

.integration-card.is-expanded .ui-disclosure-chevron {
  transform: rotate(180deg);
}

.flow-connector {
  width: 22px;
  height: 1px;
  position: relative;
  display: block;
  flex: 0 0 22px;
  background: currentColor;
  opacity: .42;
}

.flow-connector::after {
  width: 3px;
  height: 3px;
  position: absolute;
  top: -1px;
  right: 0;
  content: "";
  border-radius: 50%;
  background: currentColor;
}

@media (min-width: 821px) {
  body.p4-framework.desktop-retained-ui[data-theme] :is(
    .p4-page-hero h2,
    .p4-view-hero h2,
    .projects-pilot-lead h2,
    .page-lead h2,
    .chat-intro h2,
    #view-meetings .meeting-hero h2
  ) {
    font-family: var(--p4-ui) !important;
  }

  body.p4-framework.desktop-retained-ui[data-theme] :is(
    #view-meetings h3,
    #view-automation h3,
    #view-integrations h3
  ) {
    font-family: var(--p4-ui) !important;
    font-weight: 600 !important;
    letter-spacing: -.012em;
  }
}

/* Mobile route closure: compact headings, responsive meeting data and consistent cards. */
@media (max-width: 820px) {
  body.p4-framework[data-theme] {
    overflow-x: hidden;
  }

  body.p4-framework[data-theme] :is(
    #view-meetings,
    #view-automation,
    #view-integrations
  ) {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }

  body.p4-framework[data-theme] :is(
    .page-lead,
    #view-meetings .meeting-page-lead,
    .p4-page-hero,
    .p4-view-hero
  ) h2 {
    margin: 8px 0 7px !important;
    font-family: var(--p4-ui) !important;
    font-size: clamp(25px, 7vw, 29px) !important;
    font-weight: 650 !important;
    line-height: 1.18 !important;
    letter-spacing: -.025em !important;
  }

  body.p4-framework[data-theme] :is(
    .page-lead,
    #view-meetings .meeting-page-lead,
    .p4-page-hero,
    .p4-view-hero
  ) > p {
    margin-top: 0 !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
  }

  body.p4-framework[data-theme] :is(
    #view-meetings h3,
    #view-automation h3,
    #view-integrations h3
  ) {
    font-family: var(--p4-ui) !important;
    font-weight: 600 !important;
    letter-spacing: -.012em !important;
  }

  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-page-lead {
    padding: 12px 2px 10px !important;
  }

  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-hero {
    padding: 18px 15px !important;
  }

  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-hero h2 {
    margin: 12px 0 7px !important;
    font-family: var(--p4-ui) !important;
    font-size: 24px !important;
    font-weight: 650 !important;
    line-height: 1.2 !important;
  }

  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-hero-meta > div,
  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-block {
    padding: 16px 14px !important;
  }

  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-block-head h3,
  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-reference-heading h3 {
    font-size: 19px !important;
    line-height: 1.3 !important;
  }

  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-metrics article {
    min-height: 96px !important;
    padding: 13px !important;
  }

  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-metrics strong {
    font-size: 24px !important;
  }

  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-timeline {
    display: grid !important;
    grid-auto-flow: column;
    grid-auto-columns: minmax(238px, 82vw);
    grid-template-columns: none !important;
    gap: 9px !important;
    overflow-x: auto !important;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline proximity;
    scrollbar-width: thin;
  }

  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-timeline article {
    min-width: 0 !important;
    min-height: 104px !important;
    padding: 15px 13px !important;
    scroll-snap-align: start;
  }

  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-timeline strong {
    margin-top: 9px !important;
    font-size: 16px !important;
  }

  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-timeline small,
  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-item > p,
  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-proposal p {
    font-size: 14px !important;
    line-height: 1.6 !important;
  }

  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-matrix-scroll {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-matrix,
  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-matrix tbody,
  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-matrix tr,
  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-matrix td {
    width: 100%;
    min-width: 0;
    display: block;
  }

  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-matrix thead {
    display: none;
  }

  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-matrix tr {
    margin-bottom: 9px;
    padding: 5px 11px;
    border: 1px solid var(--p4-line);
    border-radius: 10px;
    background: var(--p4-surface-2);
  }

  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-matrix td {
    padding: 8px 0 !important;
    display: grid;
    grid-template-columns: minmax(82px, .42fr) minmax(0, 1fr);
    gap: 10px;
    border: 0;
    border-bottom: 1px solid var(--p4-line);
    font-size: 13px !important;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }

  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-matrix td:last-child {
    border-bottom: 0;
  }

  body.p4-framework.meetings-reference-active[data-theme] #view-meetings .meeting-matrix td::before {
    content: attr(data-label);
    color: var(--p4-text-3);
    font-size: 11px;
    font-weight: 650;
  }

  body.p4-framework.automation-reference-active[data-theme] #view-automation .automation-connections {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid var(--p4-line);
    border-radius: 13px;
    background: var(--p4-surface);
  }

  body.p4-framework.automation-reference-active[data-theme] #view-automation .automation-connections > .section-heading {
    margin: 0 0 12px;
    align-items: center;
  }

  body.p4-framework.automation-reference-active[data-theme] #view-automation .automation-connections h3 {
    margin-top: 0;
    font-size: 19px !important;
  }

  body.p4-framework.automation-reference-active[data-theme] #view-automation .automation-connection-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body.p4-framework.automation-reference-active[data-theme] #view-automation .automation-connection-card {
    width: 100%;
    min-width: 0;
    min-height: 94px;
    padding: 12px;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 8px;
    gap: 9px;
    align-items: center;
    color: var(--p4-text);
    text-align: left;
    text-decoration: none;
    border: 1px solid var(--p4-line);
    border-radius: 10px;
    background: var(--p4-surface-2);
    box-shadow: none;
  }

  body.p4-framework.automation-reference-active[data-theme] #view-automation .automation-connection-card:active {
    background: var(--p4-accent-soft);
  }

  body.p4-framework.automation-reference-active[data-theme] #view-automation .automation-connection-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--p4-accent-soft);
    font-family: var(--p4-ui);
    font-size: 11px;
  }

  body.p4-framework.automation-reference-active[data-theme] #view-automation .automation-connection-card strong {
    font-family: var(--p4-ui) !important;
    font-size: 14px;
    font-weight: 650;
  }

  body.p4-framework.automation-reference-active[data-theme] #view-automation .automation-connection-card div > span {
    margin-top: 4px;
    font-size: 11px;
    white-space: nowrap;
  }

  body.p4-framework.automation-reference-active[data-theme] #view-automation .automation-connection-card small {
    display: none;
  }

  body.p4-framework.automation-reference-active[data-theme] #view-automation .automation-connection-card > b {
    width: 8px;
    color: var(--p4-text-3);
  }

  body.p4-framework.connections-reference-active[data-theme] #view-integrations .integration-lead {
    padding-bottom: 14px;
  }

  body.p4-framework.connections-reference-active[data-theme] #view-integrations .integration-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  body.p4-framework.connections-reference-active[data-theme] #view-integrations .integration-card {
    min-width: 0;
    padding: 16px !important;
    border-radius: 12px;
  }

  body.p4-framework.connections-reference-active[data-theme] #view-integrations .integration-card-head {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 10px !important;
    align-items: start !important;
  }

  body.p4-framework.connections-reference-active[data-theme] #view-integrations .integration-card-head > div {
    min-width: 0;
    grid-row: 1 / span 2;
  }

  body.p4-framework.connections-reference-active[data-theme] #view-integrations .integration-card-head h3 {
    margin: 4px 0 2px;
    font-size: 18px !important;
    line-height: 1.3;
    overflow-wrap: anywhere;
  }

  body.p4-framework.connections-reference-active[data-theme] #view-integrations .integration-card-head p,
  body.p4-framework.connections-reference-active[data-theme] #view-integrations .integration-card > p {
    font-size: 13px;
    line-height: 1.6;
  }

  body.p4-framework.connections-reference-active[data-theme] #view-integrations .connection-state {
    grid-column: 2;
    grid-row: 1;
    white-space: nowrap;
  }

  body.p4-framework.connections-reference-active[data-theme] #view-integrations .integration-card-toggle {
    min-width: 72px;
    min-height: 36px !important;
    padding: 0 10px !important;
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    white-space: nowrap;
  }

  body.p4-framework.connections-reference-active[data-theme] #view-integrations .integration-card-body {
    min-width: 0;
    margin-top: 13px;
  }

  body.p4-framework.connections-reference-active[data-theme] #view-integrations :is(
    .integration-actions,
    .integration-permissions
  ) {
    min-width: 0;
    gap: 7px;
  }

  body.p4-framework.connections-reference-active[data-theme] #view-integrations .integration-actions > * {
    min-width: 0;
    flex: 1 1 132px;
    justify-content: center;
    white-space: nowrap;
  }

  body.p4-framework.connections-reference-active[data-theme] #view-integrations .douyin-form :is(input, textarea, select) {
    width: 100%;
    min-width: 0;
  }
}

/* Unified linked-resource drawer and finite-list controls. */
@media (min-width: 821px) {
  body.p4-framework[data-theme] .resource-drawer {
    width: min(620px, 48vw);
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0 0 0 auto;
    padding: 0;
    color: var(--p4-ink);
    border: 0;
    border-left: 1px solid var(--p4-line);
    background: var(--p4-surface);
    box-shadow: -24px 0 60px rgba(7, 16, 10, .16);
  }

  body.p4-framework[data-theme] .resource-drawer::backdrop {
    background: color-mix(in srgb, var(--p4-rail) 46%, transparent);
    backdrop-filter: blur(2px);
  }

  .resource-drawer-shell {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .resource-drawer-head {
    padding: 28px 30px 22px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 1px solid var(--p4-line);
  }

  body.p4-framework[data-theme] .resource-drawer-head h2 {
    margin: 7px 0 6px;
    color: var(--p4-ink) !important;
    font: 520 30px/1.2 var(--p4-editorial);
  }

  .resource-drawer-head p {
    margin: 0;
    color: var(--p4-text-2);
    font-size: 13px;
    line-height: 1.55;
  }

  .resource-drawer-close {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    color: var(--p4-text-2);
    border: 1px solid var(--p4-line);
    border-radius: 50%;
    background: transparent;
    font-size: 22px;
  }

  .resource-toolbar {
    padding: 16px 30px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px 110px auto;
    gap: 8px;
    border-bottom: 1px solid var(--p4-line);
    background: var(--p4-surface-2);
  }

  .resource-toolbar input,
  .resource-toolbar select,
  .resource-add-panel input {
    width: 100%;
    min-height: 40px;
    padding: 0 12px;
    color: var(--p4-ink);
    border: 1px solid var(--p4-line-strong);
    border-radius: 9px;
    background: var(--p4-surface);
    font: 500 13px/1.3 var(--p4-ui);
  }

  .resource-toolbar button,
  .resource-list-footer button,
  .resource-project-work,
  .finite-list-more {
    min-height: 40px;
    padding: 0 14px;
    color: var(--p4-text-2);
    border: 1px solid var(--p4-line-strong);
    border-radius: 9px;
    background: var(--p4-surface);
    font: 650 12px/1 var(--p4-ui);
  }

  .resource-list {
    min-height: 0;
    padding: 0 30px;
    flex: 1;
    overflow: auto;
  }

  .resource-row {
    min-height: 100px;
    padding: 14px 0;
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--p4-line);
  }

  .resource-preview {
    width: 72px;
    height: 60px;
    display: grid;
    place-items: center;
    gap: 3px;
    color: var(--p4-text-3);
    border: 1px solid var(--p4-line);
    border-radius: 9px;
    background: var(--p4-surface-2);
    overflow: hidden;
    font-size: 9px;
  }

  .resource-preview svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
  }

  .resource-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .resource-copy {
    min-width: 0;
    display: grid;
    gap: 5px;
  }

  .resource-copy > div {
    display: flex;
    gap: 8px;
    color: var(--p4-text-3);
    font-size: 11px;
  }

  .resource-copy > div span {
    color: var(--p4-accent-ink);
  }

  .resource-copy strong {
    color: var(--p4-ink);
    font-size: 14px;
    line-height: 1.4;
  }

  .resource-url {
    max-width: 100%;
    margin: 0;
    color: var(--p4-text-3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
  }

  .resource-row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .resource-row-actions button,
  .resource-open {
    min-height: 34px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    color: var(--p4-text-2);
    border: 1px solid var(--p4-line);
    border-radius: 8px;
    background: transparent;
    font-size: 11px;
  }

  .resource-list-footer {
    padding: 12px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--p4-text-3);
    border-top: 1px solid var(--p4-line);
    font-size: 12px;
  }

  .resource-empty {
    margin: 22px 0;
    padding: 28px;
    color: var(--p4-text-2);
    text-align: center;
    border: 1px dashed var(--p4-line-strong);
    border-radius: 12px;
  }

  .resource-empty strong {
    display: block;
    margin-bottom: 6px;
    color: var(--p4-ink);
    font-size: 15px;
  }

  .resource-empty p {
    margin: 0;
    font-size: 12px;
  }

  .resource-add-panel {
    margin: 0 30px 18px;
    border: 1px solid var(--p4-line);
    border-radius: 11px;
    background: var(--p4-surface-2);
  }

  .resource-add-panel > summary {
    min-height: 44px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    color: var(--p4-ink);
    list-style: none;
    font-size: 13px;
    font-weight: 650;
  }

  .resource-add-panel form {
    padding: 14px;
    display: grid;
    gap: 12px;
    border-top: 1px solid var(--p4-line);
  }

  .resource-add-panel label {
    display: grid;
    gap: 6px;
    color: var(--p4-text-2);
    font-size: 12px;
  }

  .resource-add-panel p {
    margin: 0;
    color: var(--p4-text-3);
    font-size: 11px;
  }

  .resource-project-work {
    margin: 0 30px 28px;
  }

  .meeting-hero-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }

  .resource-context-button {
    min-height: 36px;
    padding: 0 13px;
    color: var(--p4-text-2);
    border: 1px solid var(--p4-line-strong);
    border-radius: 9px;
    background: var(--p4-surface);
    font: 650 12px/1 var(--p4-ui);
  }

  .finite-list-more {
    width: 100%;
    margin-top: 12px;
  }

  .finite-list-status {
    padding: 12px 0 2px;
    color: var(--p4-text-3);
    text-align: center;
    font-size: 11px;
  }
}

/* P3 local acceptance: durable chat workspace + naturally sized connections. */
@media (min-width: 821px) {
  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat {
    height: calc(100dvh - 78px);
    min-height: 620px;
    padding: 22px 31px 30px;
    overflow: hidden;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .chat-layout {
    height: 100%;
    padding: 0;
    grid-template-columns: minmax(0, 1fr) 224px;
    gap: 14px;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .chat-panel {
    height: 100%;
    min-height: 0;
    display: flex;
    overflow: hidden;
    flex-direction: column;
    border: 1px solid var(--p4-line);
    border-radius: 14px;
    background: var(--p4-surface);
    box-shadow: 0 16px 38px rgba(48, 46, 38, .055);
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .chat-intro {
    min-height: 0;
    padding: 20px 22px 17px;
    flex: 0 0 auto;
    border-bottom: 1px solid var(--p4-line);
    background: var(--p4-surface);
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .chat-intro::after {
    display: none;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .chat-intro .hero-kicker {
    color: var(--p4-text-3);
    font: 700 9px/1.2 "Cascadia Code", Consolas, monospace;
    letter-spacing: .15em;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .chat-intro h2 {
    margin: 7px 0 3px;
    color: var(--p4-text-1);
    font-family: var(--reference-editorial);
    font-size: 30px;
    font-weight: 400;
    line-height: 1.12;
    letter-spacing: -.025em;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .chat-intro p {
    margin: 0;
    color: var(--p4-text-2);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.55;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .prompt-chips {
    margin-top: 12px;
    gap: 7px;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .prompt-chips button {
    min-height: 31px;
    padding: 0 11px;
    color: var(--p4-text-2);
    border: 1px solid var(--p4-line-strong);
    border-radius: 8px;
    background: var(--p4-canvas);
    font-size: 11px;
    font-weight: 650;
    box-shadow: none;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat.chat-has-messages .chat-intro {
    min-height: 54px;
    padding: 10px 17px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 13px;
    align-content: center;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat.chat-has-messages .chat-intro .hero-kicker {
    grid-row: 1 / 3;
    align-self: center;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat.chat-has-messages .chat-intro h2 {
    margin: 0;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat.chat-has-messages .chat-intro p {
    font-size: 10px;
    line-height: 1.35;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat.chat-has-messages .prompt-chips {
    display: none;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .message-list {
    min-height: 0;
    margin: 0;
    padding: 18px 20px;
    display: flex;
    overflow-y: auto;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 13px;
    background: var(--p4-canvas);
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .chat-empty-state {
    width: min(420px, 82%);
    margin: auto;
    padding: 30px 28px;
    display: grid;
    justify-items: center;
    gap: 7px;
    color: var(--p4-text-2);
    text-align: center;
    border: 1px dashed var(--p4-line-strong);
    border-radius: 12px;
    background: color-mix(in srgb, var(--p4-surface) 66%, transparent);
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .chat-empty-state span {
    color: var(--p4-text-3);
    font: 700 9px/1.2 "Cascadia Code", Consolas, monospace;
    letter-spacing: .14em;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .chat-empty-state strong {
    color: var(--p4-text-1);
    font-size: 15px;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .chat-empty-state p {
    margin: 0;
    font-size: 11px;
    line-height: 1.55;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .message {
    width: fit-content;
    max-width: min(76%, 760px);
    margin: 0;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 9px;
    align-items: start;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .message.user {
    margin-left: auto;
    grid-template-columns: minmax(0, 1fr) 28px;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .message.user .avatar {
    grid-column: 2;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .message.user .bubble {
    grid-column: 1;
    grid-row: 1;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .avatar {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    color: var(--p4-text-2);
    border: 1px solid var(--p4-line-strong);
    border-radius: 8px;
    background: var(--p4-surface);
    font: 700 9px/1 "Cascadia Code", Consolas, monospace;
    box-shadow: none;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .message.assistant .avatar {
    color: var(--p4-accent-ink);
    border-color: color-mix(in srgb, var(--p4-accent) 54%, var(--p4-line));
    background: var(--p4-accent-soft);
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .bubble {
    padding: 10px 12px;
    color: var(--p4-text-1);
    border: 1px solid var(--p4-line);
    border-radius: 10px;
    background: var(--p4-surface);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.65;
    box-shadow: none;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .message.user .bubble {
    border-color: color-mix(in srgb, var(--p4-accent) 38%, var(--p4-line));
    background: var(--p4-accent-soft);
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .composer {
    position: relative;
    bottom: auto;
    z-index: 8;
    margin: 0;
    padding: 11px 13px 12px;
    display: grid;
    overflow: visible;
    flex: 0 0 auto;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    border: 0;
    border-top: 1px solid var(--p4-line);
    border-radius: 0;
    background: var(--p4-surface);
    box-shadow: 0 -10px 24px rgba(48, 46, 38, .035);
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .composer textarea {
    min-height: 52px;
    max-height: 126px;
    padding: 12px 13px;
    grid-column: 1 / -1;
    color: var(--p4-text-1);
    border: 1px solid var(--p4-line-strong);
    border-radius: 9px;
    background: var(--p4-canvas);
    font-size: 13px;
    line-height: 1.55;
    box-shadow: none;
    resize: none;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .composer textarea:focus {
    border-color: var(--p4-accent);
    outline: 2px solid color-mix(in srgb, var(--p4-accent) 22%, transparent);
    outline-offset: 1px;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .chat-tools {
    min-width: 0;
    display: flex;
    grid-column: 1;
    gap: 7px;
    align-items: center;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .voice-dock {
    min-height: 34px;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 7px;
    align-items: center;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .voice-toggle {
    min-height: 34px;
    padding: 0 10px 0 7px;
    gap: 7px;
    color: var(--p4-text-2);
    border: 1px solid var(--p4-line);
    border-radius: 8px;
    background: var(--p4-canvas);
    box-shadow: none;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .voice-toggle b {
    font-size: 11px;
    font-weight: 700;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .voice-orb {
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    background: var(--p4-accent);
    box-shadow: none;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .voice-orb i {
    width: 5px;
    height: 8px;
    border-width: 1.5px;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .voice-orb::after {
    bottom: 4px;
    width: 9px;
    height: 5px;
    border-width: 1.5px;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .voice-copy {
    max-width: 150px;
    min-width: 0;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .voice-copy strong {
    overflow: hidden;
    display: block;
    color: var(--p4-text-3);
    font-size: 10px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .voice-copy small {
    display: none;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .voice-interrupt {
    min-height: 32px;
    padding: 0 9px;
    border-radius: 8px;
    font-size: 10px;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .voice-settings {
    position: relative;
    min-height: 34px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .voice-settings > summary {
    min-height: 34px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    color: var(--p4-text-2);
    border: 1px solid var(--p4-line);
    border-radius: 8px;
    background: var(--p4-canvas);
    font-size: 10px;
    font-weight: 700;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .voice-settings[open] {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 13px;
    z-index: 30;
    width: min(540px, calc(100% - 26px));
    max-height: min(440px, calc(100dvh - 190px));
    padding: 14px;
    overflow-y: auto;
    border: 1px solid var(--p4-line-strong);
    border-radius: 12px;
    background: var(--p4-surface);
    box-shadow: 0 20px 48px rgba(31, 30, 25, .16);
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .voice-settings[open] > summary {
    width: fit-content;
    margin-bottom: 12px;
    border-color: var(--p4-accent);
    background: var(--p4-accent-soft);
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .voice-settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .voice-settings-grid label {
    gap: 4px;
    color: var(--p4-text-2);
    font-size: 10px;
    font-weight: 650;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .voice-settings select {
    min-height: 34px;
    border-color: var(--p4-line);
    border-radius: 8px;
    background: var(--p4-canvas);
    font-size: 11px;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .voice-shortcuts {
    margin-top: 11px;
    gap: 6px;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .voice-shortcuts button {
    min-height: 30px;
    padding: 0 9px;
    border-radius: 7px;
    font-size: 10px;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .voice-settings-foot {
    margin-top: 10px;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .composer-actions {
    min-width: max-content;
    display: flex;
    grid-column: 2;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .composer-actions small {
    color: var(--p4-text-3);
    font-size: 9px;
    font-weight: 550;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .send-button {
    min-width: 76px;
    min-height: 38px;
    padding: 0 12px;
    color: var(--p4-accent-ink);
    border: 1px solid var(--p4-accent);
    border-radius: 8px;
    background: var(--p4-accent-soft);
    box-shadow: none;
    font-size: 11px;
    font-weight: 800;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .chat-side {
    min-height: 0;
    align-content: start;
    gap: 10px;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .chat-side section {
    min-height: 0;
    padding: 16px;
    border: 1px solid var(--p4-line);
    border-radius: 12px;
    background: var(--p4-surface);
    box-shadow: none;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .chat-side strong {
    color: var(--p4-text-1);
    font-family: var(--reference-editorial);
    font-size: 30px;
    font-weight: 400;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .chat-side p {
    margin: 5px 0 0;
    color: var(--p4-text-2);
    font-size: 11px;
    line-height: 1.55;
  }

  body.p4-framework.connections-reference-active.desktop-retained-ui[data-theme] {
    --connections-card-bg: color-mix(in srgb, var(--p4-surface) 94%, var(--p4-canvas));
  }

  body.p4-framework.connections-reference-active.desktop-retained-ui[data-theme]::after {
    display: none !important;
  }

  body.p4-framework.connections-reference-active.desktop-retained-ui[data-theme] #view-integrations {
    padding: 20px 38px 48px;
  }

  body.p4-framework.connections-reference-active.desktop-retained-ui[data-theme] #view-integrations .integration-lead {
    max-width: none;
    padding: 0 0 15px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 24px;
    align-items: end;
    border-bottom: 1px solid var(--p4-line);
  }

  body.p4-framework.connections-reference-active.desktop-retained-ui[data-theme] #view-integrations .integration-lead > div {
    display: none;
  }

  body.p4-framework.connections-reference-active.desktop-retained-ui[data-theme] #view-integrations .integration-lead h2 {
    margin: 0;
    grid-column: 1;
    grid-row: 1;
    font-size: 32px;
    line-height: 1.1;
  }

  body.p4-framework.connections-reference-active.desktop-retained-ui[data-theme] #view-integrations .integration-lead p {
    max-width: 490px;
    margin: 0 0 2px;
    grid-column: 2;
    grid-row: 1;
    text-align: right;
    font-size: 11px;
    line-height: 1.55;
  }

  body.p4-framework.connections-reference-active.desktop-retained-ui[data-theme] #view-integrations .integration-grid {
    padding: 14px 0 0;
    display: grid;
    align-items: start;
    grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
    gap: 12px;
  }

  body.p4-framework.connections-reference-active.desktop-retained-ui[data-theme] #view-integrations .integration-card {
    min-height: 0;
    height: auto;
    padding: 17px 18px;
    align-self: start;
    overflow: visible;
    border: 1px solid var(--p4-line);
    border-radius: 12px;
    background: var(--connections-card-bg);
    box-shadow: none;
  }

  body.p4-framework.connections-reference-active.desktop-retained-ui[data-theme] #view-integrations .integration-card::after {
    display: none !important;
  }

  body.p4-framework.connections-reference-active.desktop-retained-ui[data-theme] #view-integrations .integration-card-head {
    min-height: 0;
    margin-bottom: 12px;
    padding-bottom: 10px;
    align-items: center;
    border-bottom: 1px solid var(--p4-line);
  }

  body.p4-framework.connections-reference-active.desktop-retained-ui[data-theme] #view-integrations .integration-card-head h3 {
    margin: 3px 0 0;
    font-family: inherit;
    font-size: 15px;
    font-weight: 750;
    letter-spacing: 0;
  }

  body.p4-framework.connections-reference-active.desktop-retained-ui[data-theme] #view-integrations .integration-card-head p,
  body.p4-framework.connections-reference-active.desktop-retained-ui[data-theme] #view-integrations .integration-card > p {
    margin-top: 4px;
    color: var(--p4-text-2);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.55;
  }

  body.p4-framework.connections-reference-active.desktop-retained-ui[data-theme] #view-integrations .connection-state {
    min-height: 25px;
    padding: 3px 8px;
    color: var(--p4-text-2);
    border: 1px solid var(--p4-line);
    border-radius: 999px;
    background: var(--p4-canvas);
    font-size: 10px;
    font-weight: 700;
  }

  body.p4-framework.connections-reference-active.desktop-retained-ui[data-theme] #view-integrations .connection-state.ready {
    color: var(--p4-success);
    border-color: color-mix(in srgb, var(--p4-success) 30%, var(--p4-line));
    background: color-mix(in srgb, var(--p4-success) 8%, var(--p4-surface));
  }

  body.p4-framework.connections-reference-active.desktop-retained-ui[data-theme] #view-integrations .integration-permissions {
    margin: 10px 0 13px;
    gap: 5px;
  }

  body.p4-framework.connections-reference-active.desktop-retained-ui[data-theme] #view-integrations .integration-permissions span {
    padding: 4px 7px;
    color: var(--p4-text-2);
    border-color: var(--p4-line);
    border-radius: 6px;
    background: var(--p4-canvas);
    font-size: 10px;
    font-weight: 600;
  }

  body.p4-framework.connections-reference-active.desktop-retained-ui[data-theme] #view-integrations .push-preferences {
    margin: 10px 0 13px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 12px;
    border-top: 1px solid var(--p4-line);
    border-bottom: 1px solid var(--p4-line);
  }

  body.p4-framework.connections-reference-active.desktop-retained-ui[data-theme] #view-integrations .push-preferences label {
    min-height: 36px;
    padding: 0;
    display: flex;
    gap: 8px;
    align-items: center;
    color: var(--p4-text-2);
    border: 0;
    border-bottom: 1px solid var(--p4-line);
    border-radius: 0;
    background: transparent;
    font-size: 11px;
    font-weight: 600;
  }

  body.p4-framework.connections-reference-active.desktop-retained-ui[data-theme] #view-integrations .push-preferences label:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  body.p4-framework.connections-reference-active.desktop-retained-ui[data-theme] #view-integrations .push-preferences input {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    accent-color: var(--p4-accent);
  }

  body.p4-framework.connections-reference-active.desktop-retained-ui[data-theme] #view-integrations .integration-actions {
    margin-top: 11px;
    gap: 7px;
  }

  body.p4-framework.connections-reference-active.desktop-retained-ui[data-theme] #view-integrations .integration-actions > *,
  body.p4-framework.connections-reference-active.desktop-retained-ui[data-theme] #view-integrations .douyin-form button {
    min-height: 34px;
    padding: 0 11px;
    border-radius: 8px;
    font-size: 11px;
    box-shadow: none;
  }

  body.p4-framework.connections-reference-active.desktop-retained-ui[data-theme] #view-integrations .douyin-form {
    gap: 9px;
  }

  body.p4-framework.connections-reference-active.desktop-retained-ui[data-theme] #view-integrations .douyin-form label {
    gap: 4px;
    color: var(--p4-text-2);
    font-size: 11px;
    font-weight: 650;
  }

  body.p4-framework.connections-reference-active.desktop-retained-ui[data-theme] #view-integrations .douyin-form input,
  body.p4-framework.connections-reference-active.desktop-retained-ui[data-theme] #view-integrations .douyin-form textarea,
  body.p4-framework.connections-reference-active.desktop-retained-ui[data-theme] #view-integrations .douyin-form select {
    min-height: 36px;
    padding: 8px 10px;
    color: var(--p4-text-1);
    border-color: var(--p4-line-strong);
    border-radius: 8px;
    background: var(--p4-canvas);
    font-size: 12px;
  }

  body.p4-framework.connections-reference-active.desktop-retained-ui[data-theme] #view-integrations .douyin-form small,
  body.p4-framework.connections-reference-active.desktop-retained-ui[data-theme] #view-integrations .integration-note {
    color: var(--p4-text-3);
    font-size: 10px;
    font-weight: 500;
    line-height: 1.55;
  }

  body.p4-framework.connections-reference-active.desktop-retained-ui[data-theme] #view-integrations #mail-connect-form {
    padding: 12px;
    border: 1px solid var(--p4-line);
    border-radius: 9px;
    background: var(--p4-canvas);
  }

  body.p4-framework.connections-reference-active.desktop-retained-ui[data-theme] #view-integrations #mail-connect-form .primary-button {
    width: fit-content;
    min-width: 126px;
  }
}

:root {
  --jd-ink: #151713;
  --jd-soft: #31352f;
  --jd-paper: #f7f3e9;
  --jd-surface: rgba(252, 250, 244, 0.82);
  --jd-white: rgba(255, 255, 255, 0.68);
  --jd-line: #ddd6c8;
  --jd-line-strong: #c9c0af;
  --jd-muted: #646a61;
  --jd-lime: #c8ff2e;
  --jd-green: #75a91b;
  --jd-amber: #efa916;
  --jd-red: #ed4a40;
  --jd-blue: #6a93c9;
  --jd-display: "New York", "Iowan Old Style", Baskerville, "Palatino Linotype",
    "Songti SC", STSong, serif;
  --jd-ui: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Segoe UI",
    sans-serif;
  --jd-mono: "SFMono-Regular", "SF Mono", "Cascadia Mono", Consolas, monospace;
  --jd-radius: 16px;
  --jd-shadow: 0 18px 52px rgba(28, 30, 23, 0.055);
}

@media (min-width: 821px) {
  * { box-sizing: border-box; }
  html { background: var(--jd-paper); }
  body.desktop-retained-ui[data-theme] {
    min-width: 1040px;
    margin: 0;
    color: var(--jd-ink);
    background:
      radial-gradient(circle at 28% 4%, rgba(255,255,255,.88), transparent 33%),
      radial-gradient(circle at 88% 22%, rgba(226,215,187,.18), transparent 31%),
      var(--jd-paper);
    background-attachment: fixed;
    font-family: var(--jd-ui);
    font-size: 14px;
    font-weight: 450;
    line-height: 1.55;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: auto;
    animation: none;
  }
  body.desktop-retained-ui[data-theme]::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: .17;
    pointer-events: none;
    content: "";
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.84' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.045'/%3E%3C/svg%3E");
  }
  body.desktop-retained-ui[data-theme],
  body.desktop-retained-ui[data-theme] button,
  body.desktop-retained-ui[data-theme] input,
  body.desktop-retained-ui[data-theme] textarea,
  body.desktop-retained-ui[data-theme] select {
    font-family: var(--jd-ui);
    font-weight: 500;
  }
  body.desktop-retained-ui[data-theme] button {
    font-weight: 500;
  }
  body.desktop-retained-ui[data-theme] small {
    font-weight: 500;
    line-height: 1.55;
  }
  body.desktop-retained-ui[data-theme] .summer-scene { display: none; }

  /* Shell */
  body.desktop-retained-ui[data-theme] .app-shell {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    min-height: 100vh;
  }
  body.desktop-retained-ui[data-theme] .sidebar {
    position: sticky;
    z-index: 40;
    top: 0;
    width: 104px;
    height: 100vh;
    margin: 0;
    padding: 19px 11px 17px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #fff;
    border: 0;
    border-radius: 0;
    background:
      radial-gradient(circle at 52% 7%, rgba(255,255,255,.065), transparent 27%),
      linear-gradient(180deg, #121412, #080a08);
    box-shadow: none;
  }
  body.desktop-retained-ui[data-theme] .sidebar::after { display: none; }
  body.desktop-retained-ui[data-theme] .nav-item {
    position: relative;
    width: 100%;
    min-height: 64px;
    padding: 8px 2px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 5px;
    color: #b9bdb6;
    border: 0;
    border-radius: 14px;
    background: transparent;
    box-shadow: none;
    text-align: center;
    transform: none;
  }
  body.desktop-retained-ui[data-theme] .nav-item:hover {
    color: #fff;
    background: rgba(255,255,255,.065);
  }
  body.desktop-retained-ui[data-theme] .nav-item.is-active {
    color: var(--jd-lime);
    background: rgba(200,255,46,.105);
    box-shadow: inset 2px 0 0 var(--jd-lime);
  }
  body.desktop-retained-ui[data-theme] .nav-item.is-active::after {
    position: absolute;
    left: 9px;
    top: 50%;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--jd-lime);
    transform: translateY(-50%);
    content: "";
  }
  body.desktop-retained-ui[data-theme] .nav-icon {
    display: block;
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
  }
  body.desktop-retained-ui[data-theme] .nav-item b {
    color: inherit;
    font-size: 14px;
    font-weight: 560;
    letter-spacing: .01em;
  }
  body.desktop-retained-ui[data-theme] .privacy-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--jd-lime);
    box-shadow: 0 0 0 4px rgba(200,255,46,.11);
  }

  body.desktop-retained-ui[data-theme] .workspace {
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    padding: 0;
  }
  body.desktop-retained-ui[data-theme] .workspace-header {
    position: sticky;
    z-index: 35;
    top: 0;
    min-height: 76px;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid rgba(201,192,175,.58);
    background: rgba(247,243,233,.89);
    backdrop-filter: blur(24px) saturate(1.05);
  }
  body.desktop-retained-ui[data-theme] .app-chrome {
    min-height: 76px;
    padding: 0 38px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  body.desktop-retained-ui[data-theme] .chrome-signals { display: flex; gap: 9px; }
  body.desktop-retained-ui[data-theme] .chrome-signal {
    width: 12px;
    height: 12px;
    border: 0;
    box-shadow: 0 0 0 3px rgba(21,23,19,.035), inset 0 1px 1px rgba(255,255,255,.7);
  }
  body.desktop-retained-ui[data-theme] .chrome-brand { grid-column: 2; color: var(--jd-ink); }
  body.desktop-retained-ui[data-theme] .chrome-brand strong {
    position: relative;
    color: var(--jd-ink);
    font: 500 28px/1 var(--jd-display);
    letter-spacing: -.03em;
  }
  body.desktop-retained-ui[data-theme] .chrome-brand strong::after {
    position: absolute;
    right: -9px;
    bottom: 2px;
    width: 8px;
    height: 4px;
    border-right: 2px solid var(--jd-green);
    border-bottom: 2px solid var(--jd-green);
    transform: rotate(42deg);
    content: "";
  }
  body.desktop-retained-ui[data-theme] .chrome-review {
    grid-column: 3;
    justify-self: end;
    width: 40px;
    height: 40px;
    color: var(--jd-ink);
    border: 1px solid var(--jd-line-strong);
    border-radius: 50%;
    background: rgba(252,250,244,.78);
    box-shadow: none;
  }
  body.desktop-retained-ui[data-theme] .chrome-review > span { color: var(--jd-green); }
  body.desktop-retained-ui[data-theme] .chrome-review b { color: #fff; background: var(--jd-ink); }
  body.desktop-retained-ui[data-theme] .topbar {
    position: absolute;
    z-index: 2;
    top: 0;
    right: 88px;
    min-height: 76px;
    padding: 0;
    border: 0;
    background: transparent;
  }
  body.desktop-retained-ui[data-theme] .topbar-title { display: none; }
  body.desktop-retained-ui[data-theme] .topbar-tools { gap: 8px; }
  body.desktop-retained-ui[data-theme] .install-app,
  body.desktop-retained-ui[data-theme] .model-picker,
  body.desktop-retained-ui[data-theme] .status-pill {
    min-height: 38px;
    color: var(--jd-ink);
    border: 1px solid var(--jd-line);
    border-radius: 10px;
    background: rgba(252,250,244,.78);
    box-shadow: none;
  }
  body.desktop-retained-ui[data-theme] .install-app { padding: 8px 11px; }
  body.desktop-retained-ui[data-theme] .model-picker { padding: 3px 5px 3px 11px; }
  body.desktop-retained-ui[data-theme] .model-picker span {
    color: var(--jd-muted);
    font: 600 13px/1 var(--jd-mono);
    letter-spacing: .12em;
  }
  body.desktop-retained-ui[data-theme] .model-picker select {
    min-width: 96px;
    padding: 7px 27px 7px 8px;
    border: 0;
    background-color: transparent;
    font-size: 14px;
    font-weight: 620;
  }
  body.desktop-retained-ui[data-theme] .status-pill { padding: 9px 10px; font-size: 14px; }

  /* Shared visual language */
  body.desktop-retained-ui[data-theme] .view {
    width: min(100%, 1480px);
    margin: 0 auto;
    padding: 38px 52px 68px;
    color: var(--jd-ink);
  }
  body.desktop-retained-ui[data-theme] .view:not(.is-active) { display: none !important; }
  body.desktop-retained-ui[data-theme] .eyebrow,
  body.desktop-retained-ui[data-theme] .hero-kicker,
  body.desktop-retained-ui[data-theme] .mini-label {
    color: #6c7169;
    font: 600 12px/1.45 var(--jd-mono);
    letter-spacing: .17em;
  }
  body.desktop-retained-ui[data-theme] .page-lead,
  body.desktop-retained-ui[data-theme] .chat-intro { max-width: none; padding: 10px 0 28px; }
  body.desktop-retained-ui[data-theme] .page-lead h2,
  body.desktop-retained-ui[data-theme] .chat-intro h2,
  body.desktop-retained-ui[data-theme] .summer-hero h2 {
    margin: 11px 0 9px;
    color: var(--jd-ink);
    font: 500 clamp(42px, 4.2vw, 60px)/1.05 var(--jd-display);
    letter-spacing: -.035em;
  }
  body.desktop-retained-ui[data-theme] .page-lead p,
  body.desktop-retained-ui[data-theme] .chat-intro p,
  body.desktop-retained-ui[data-theme] .summer-hero p {
    max-width: 800px;
    color: #686d65;
    font-size: 14px;
    line-height: 1.65;
  }
  body.desktop-retained-ui[data-theme] .summer-sheet,
  body.desktop-retained-ui[data-theme] .integration-card,
  body.desktop-retained-ui[data-theme] .automation-card,
  body.desktop-retained-ui[data-theme] .memory-card,
  body.desktop-retained-ui[data-theme] .auth-card {
    color: var(--jd-ink);
    border: 1px solid var(--jd-line);
    border-radius: var(--jd-radius);
    background: var(--jd-surface);
    box-shadow: var(--jd-shadow);
    backdrop-filter: blur(12px);
    transform: none;
  }
  body.desktop-retained-ui[data-theme] .summer-sheet:hover,
  body.desktop-retained-ui[data-theme] .integration-card:hover,
  body.desktop-retained-ui[data-theme] .automation-card:hover { transform: none; box-shadow: var(--jd-shadow); }
  body.desktop-retained-ui[data-theme] h1,
  body.desktop-retained-ui[data-theme] h2,
  body.desktop-retained-ui[data-theme] h3,
  body.desktop-retained-ui[data-theme] h4 { color: var(--jd-ink); }
  body.desktop-retained-ui[data-theme] input,
  body.desktop-retained-ui[data-theme] textarea,
  body.desktop-retained-ui[data-theme] select {
    color: var(--jd-ink);
    border: 1px solid var(--jd-line-strong);
    border-radius: 9px;
    background: rgba(255,255,255,.72);
    box-shadow: none;
  }
  body.desktop-retained-ui[data-theme] input:focus,
  body.desktop-retained-ui[data-theme] textarea:focus,
  body.desktop-retained-ui[data-theme] select:focus {
    outline: 2px solid rgba(105,165,29,.18);
    outline-offset: 1px;
    border-color: var(--jd-green);
  }
  body.desktop-retained-ui[data-theme] .primary-button {
    color: #172000;
    border: 1px solid #a8d716;
    border-radius: 9px;
    background: linear-gradient(180deg, #d8ff61, var(--jd-lime));
    box-shadow: 0 2px 0 #7d9f12;
    font-weight: 650;
  }
  body.desktop-retained-ui[data-theme] .ghost-button,
  body.desktop-retained-ui[data-theme] .mini-button,
  body.desktop-retained-ui[data-theme] .text-button {
    color: var(--jd-ink);
    border: 1px solid var(--jd-line-strong);
    border-radius: 9px;
    background: rgba(252,250,244,.76);
    box-shadow: none;
  }
  body.desktop-retained-ui[data-theme] .text-link { color: #557f13; }
  body.desktop-retained-ui[data-theme] .work-source,
  body.desktop-retained-ui[data-theme] .work-project,
  body.desktop-retained-ui[data-theme] .classification,
  body.desktop-retained-ui[data-theme] .work-item-type {
    padding: 4px 8px;
    color: #50564e;
    border: 1px solid var(--jd-line-strong);
    border-radius: 999px;
    background: transparent;
    font: 600 13px/1 var(--jd-mono);
  }

  /* Today */
  body.desktop-retained-ui[data-theme] #view-dashboard {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, .68fr);
    gap: 20px;
    align-items: start;
  }
  body.desktop-retained-ui[data-theme] #view-dashboard > .summer-hero { grid-column: 1 / -1; }
  body.desktop-retained-ui[data-theme] .summer-hero {
    position: relative;
    min-height: 0;
    margin: 0;
    padding: 10px 0 25px;
    color: var(--jd-ink);
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }
  body.desktop-retained-ui[data-theme] .summer-hero::before { display: none; }
  body.desktop-retained-ui[data-theme] .summer-hero h2 { font-size: clamp(50px, 5vw, 70px); }
  body.desktop-retained-ui[data-theme] .hero-actions { margin-top: 21px; gap: 8px; }
  body.desktop-retained-ui[data-theme] .hero-actions button { min-height: 40px; padding: 9px 14px; }
  body.desktop-retained-ui[data-theme] .workspace-date {
    top: 13px;
    right: 0;
    width: 74px;
    height: 74px;
    color: #fff;
    border: 0;
    border-radius: 13px;
    background: var(--jd-ink);
    font: 550 14px/1.5 var(--jd-mono);
  }
  body.desktop-retained-ui[data-theme] .work-overview-card { grid-column: 1; margin: 0; overflow: hidden; }
  body.desktop-retained-ui[data-theme] .work-overview-head { padding: 23px 26px 17px; }
  body.desktop-retained-ui[data-theme] .work-overview-head h3 {
    margin: 7px 0 3px;
    font: 500 33px/1.1 var(--jd-display);
    letter-spacing: -.025em;
  }
  body.desktop-retained-ui[data-theme] .work-overview-head p { color: var(--jd-muted); font-size: 14px; }
  body.desktop-retained-ui[data-theme] .work-overview-tabs {
    padding: 0 26px 15px;
    gap: 7px;
    overflow-x: auto;
    border-bottom: 1px solid var(--jd-line);
  }
  body.desktop-retained-ui[data-theme] .work-overview-tabs button {
    min-height: 34px;
    padding: 7px 10px;
    white-space: nowrap;
    border: 1px solid var(--jd-line);
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
    font-size: 13px;
  }
  body.desktop-retained-ui[data-theme] .work-overview-tabs button.is-active {
    color: var(--jd-ink);
    border-color: #a7d414;
    background: rgba(200,255,46,.28);
  }
  body.desktop-retained-ui[data-theme] .work-overview-tabs b {
    min-width: 20px;
    height: 20px;
    margin-left: 6px;
    color: #fff;
    border-radius: 999px;
    background: var(--jd-ink);
    font: 650 12px/20px var(--jd-ui);
  }
  body.desktop-retained-ui[data-theme] .work-overview-row.item-card {
    min-height: 82px;
    padding: 14px 26px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--jd-line);
    background: transparent;
  }
  body.desktop-retained-ui[data-theme] .work-overview-row.item-card:hover { background: rgba(255,255,255,.35); }
  body.desktop-retained-ui[data-theme] .work-overview-signal {
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
    border-width: 1.5px;
    box-shadow: 0 0 0 5px rgba(240,173,22,.09);
  }
  body.desktop-retained-ui[data-theme] .work-overview-signal::before { width: 9px; height: 9px; }
  body.desktop-retained-ui[data-theme] .work-overview-main { align-items: center; }
  body.desktop-retained-ui[data-theme] .work-overview-copy strong { font-size: 14px; font-weight: 620; }
  body.desktop-retained-ui[data-theme] .work-overview-copy small { color: var(--jd-muted); font-size: 14px; }
  body.desktop-retained-ui[data-theme] .work-overview-tail { color: #596157; font-size: 14px; }
  body.desktop-retained-ui[data-theme] .work-capture > summary { padding: 16px 26px; }
  body.desktop-retained-ui[data-theme] #view-dashboard > .metric-grid { grid-column: 2; grid-row: 2; }
  body.desktop-retained-ui[data-theme] .metric-grid {
    gap: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    border: 1px solid var(--jd-line);
    border-radius: var(--jd-radius);
    background: var(--jd-surface);
    box-shadow: var(--jd-shadow);
    overflow: hidden;
  }
  body.desktop-retained-ui[data-theme] .metric-card {
    min-height: 71px;
    padding: 13px 17px;
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    align-items: center;
    border: 0;
    border-bottom: 1px solid var(--jd-line);
    border-radius: 0;
    background: transparent;
  }
  body.desktop-retained-ui[data-theme] .metric-card:last-child { border-bottom: 0; }
  body.desktop-retained-ui[data-theme] .metric-card span { font-size: 14px; font-weight: 610; }
  body.desktop-retained-ui[data-theme] .metric-card strong {
    grid-row: 1 / span 2;
    grid-column: 2;
    font: 500 31px/1 var(--jd-display);
  }
  body.desktop-retained-ui[data-theme] .metric-card small { color: var(--jd-muted); font-size: 13px; }
  body.desktop-retained-ui[data-theme] #view-dashboard > .global-inbox-card,
  body.desktop-retained-ui[data-theme] #view-dashboard > .factory-pulse-card,
  body.desktop-retained-ui[data-theme] #view-dashboard > .data-source-card,
  body.desktop-retained-ui[data-theme] #view-dashboard > .time-ledger-entry { grid-column: 1 / -1; margin-top: 0; }
  body.desktop-retained-ui[data-theme] .global-inbox-head,
  body.desktop-retained-ui[data-theme] .factory-pulse-head { padding: 21px 24px 17px; }
  body.desktop-retained-ui[data-theme] .global-inbox-head h3 { font-size: 21px; }
  body.desktop-retained-ui[data-theme] .global-inbox-head p { color: var(--jd-muted); font-size: 14px; }
  body.desktop-retained-ui[data-theme] .global-inbox-counter { color: var(--jd-ink); border-left-color: var(--jd-lime); }
  body.desktop-retained-ui[data-theme] .global-inbox-counter strong { color: var(--jd-green); }
  body.desktop-retained-ui[data-theme] .global-inbox-flow { color: #686e65; background: rgba(21,23,19,.035); }
  body.desktop-retained-ui[data-theme] .factory-pulse-head h3 { font: 500 30px/1.1 var(--jd-display); }
  body.desktop-retained-ui[data-theme] .time-ledger-entry { background: var(--jd-surface); }

  /* Meetings */
  body.desktop-retained-ui[data-theme] #view-meetings {
    display: grid;
    grid-template-columns: 340px minmax(0,1fr);
    gap: 0;
    width: min(100%, 1520px);
    min-height: calc(100vh - 76px);
    padding: 0;
  }
  body.desktop-retained-ui[data-theme] #view-meetings .meeting-page-lead {
    grid-column: 1;
    padding: 36px 28px 21px 8px;
  }
  body.desktop-retained-ui[data-theme] #view-meetings .meeting-page-lead h2 {
    font-family: var(--jd-ui);
    font-size: 32px;
    font-weight: 650;
    letter-spacing: -.025em;
  }
  body.desktop-retained-ui[data-theme] #view-meetings .meeting-page-lead p { font-size: 13px; }
  body[data-theme="control-room"] #view-meetings .meeting-layout {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 340px minmax(0,1fr);
    gap: 0;
    align-items: stretch;
    border-top: 1px solid var(--jd-line);
  }
  body[data-theme="control-room"] #view-meetings .meeting-index-panel {
    position: static !important;
    visibility: visible !important;
    width: auto;
    height: auto;
    max-height: none;
    min-height: 620px;
    padding: 21px 27px 40px 8px;
    overflow: visible;
    border: 0;
    border-right: 1px solid var(--jd-line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    transform: none !important;
    pointer-events: auto !important;
  }
  body.desktop-retained-ui[data-theme] .meeting-list { gap: 8px; }
  body.desktop-retained-ui[data-theme] .meeting-list button,
  body.desktop-retained-ui[data-theme] .meeting-list-item {
    min-height: 79px;
    padding: 13px 14px;
    border: 1px solid var(--jd-line);
    border-radius: 12px;
    background: rgba(252,250,244,.56);
  }
  body.desktop-retained-ui[data-theme] .meeting-list button.is-active,
  body.desktop-retained-ui[data-theme] .meeting-list-item.is-active {
    border-color: #a8d716;
    background: rgba(200,255,46,.075);
  }
  body[data-theme="control-room"] #view-meetings .meeting-detail {
    min-height: 680px;
    padding: 37px 39px 50px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }
  body.desktop-retained-ui[data-theme] .meeting-detail h2,
  body.desktop-retained-ui[data-theme] .meeting-detail h3 { font-family: var(--jd-ui); letter-spacing: -.025em; }
  body.desktop-retained-ui[data-theme] .meeting-detail h2 { font-size: 31px; }
  body.desktop-retained-ui[data-theme] .meeting-action-row,
  body.desktop-retained-ui[data-theme] .meeting-risk-row {
    border: 1px solid var(--jd-line);
    border-radius: 12px;
    background: rgba(255,255,255,.45);
  }

  /* Projects */
  body.desktop-retained-ui[data-theme] #view-work { width: min(100%,1480px); }
  body.desktop-retained-ui[data-theme] #view-work .page-lead { padding-bottom: 21px; }
  body.desktop-retained-ui[data-theme] .work-layout { gap: 17px; align-items: start; }
  body.desktop-retained-ui[data-theme] #view-work .create-panel { background: var(--jd-surface); }
  body.desktop-retained-ui[data-theme] #view-work .create-panel > summary { min-height: 68px; padding: 16px 21px; }
  body.desktop-retained-ui[data-theme] #view-work .create-panel:not([open]) { grid-column: 1 / -1; }
  body.desktop-retained-ui[data-theme] .work-form { gap: 13px; }
  body.desktop-retained-ui[data-theme] .work-form label { gap: 7px; color: #555c53; font-size: 13px; }
  body.desktop-retained-ui[data-theme] .work-form input,
  body.desktop-retained-ui[data-theme] .work-form textarea,
  body.desktop-retained-ui[data-theme] .work-form select { min-height: 42px; padding: 11px 12px; }
  body.desktop-retained-ui[data-theme] .filter-bar { padding: 0 0 12px; border: 0; background: transparent; }
  body.desktop-retained-ui[data-theme] .work-list { gap: 9px; }
  body.desktop-retained-ui[data-theme] .work-card,
  body.desktop-retained-ui[data-theme] .work-card--unified {
    position: relative;
    padding: 18px 20px 18px 24px;
    border: 1px solid var(--jd-line);
    border-radius: 13px;
    background: var(--jd-surface);
    box-shadow: none;
  }
  body.desktop-retained-ui[data-theme] .work-card::before { width: 3px; border-radius: 3px 0 0 3px; }
  body.desktop-retained-ui[data-theme] .work-card h3 {
    margin: 13px 0 8px;
    font-family: var(--jd-ui);
    font-size: 17px;
    font-weight: 640;
  }
  body.desktop-retained-ui[data-theme] .work-card-summary { color: var(--jd-muted); font-size: 13px; }
  body.desktop-retained-ui[data-theme] .work-actions { margin-top: 13px; }

  /* Review */
  body.desktop-retained-ui[data-theme] #view-drafts .draft-create,
  body.desktop-retained-ui[data-theme] #view-drafts .draft-queue { border-radius: var(--jd-radius); }
  body.desktop-retained-ui[data-theme] #view-drafts .draft-create { margin-bottom: 16px; }
  body.desktop-retained-ui[data-theme] .draft-tabs button,
  body.desktop-retained-ui[data-theme] .draft-bulk-actions button { border-radius: 999px; box-shadow: none; }
  body.desktop-retained-ui[data-theme] .draft-group,
  body.desktop-retained-ui[data-theme] .draft-item {
    border-color: var(--jd-line);
    border-radius: 13px;
    background: rgba(255,255,255,.44);
  }

  /* Conversation */
  body.desktop-retained-ui[data-theme] .chat-layout { gap: 18px; }
  body.desktop-retained-ui[data-theme] .chat-panel,
  body.desktop-retained-ui[data-theme] .voice-panel {
    border: 1px solid var(--jd-line);
    border-radius: var(--jd-radius);
    background: var(--jd-surface);
    box-shadow: var(--jd-shadow);
  }
  body.desktop-retained-ui[data-theme] .message {
    border: 1px solid var(--jd-line);
    border-radius: 15px;
    background: rgba(255,255,255,.68);
  }
  body.desktop-retained-ui[data-theme] .message.user { background: rgba(200,255,46,.08); }
  body.desktop-retained-ui[data-theme] .composer {
    border-color: var(--jd-line);
    border-radius: 13px;
    background: rgba(255,255,255,.72);
  }
  body[data-theme="control-room"] #view-chat .chat-intro h2 {
    color: var(--jd-ink);
    font-family: var(--jd-display);
    font-weight: 500;
    letter-spacing: -.028em;
  }
  body[data-theme="control-room"] #view-chat .send-button {
    color: var(--jd-ink);
    border-color: var(--jd-line-strong);
    border-radius: 10px;
    background: var(--jd-lime);
    box-shadow: none;
  }
  body[data-theme="control-room"] #view-chat .send-button:hover {
    color: var(--jd-ink);
    background: #d3ff55;
  }
  body[data-theme="control-room"] #view-chat .chat-side section,
  body[data-theme="control-room"] #view-chat .chat-rule {
    border-color: var(--jd-line);
    border-radius: var(--jd-radius);
    background: var(--jd-surface);
    box-shadow: var(--jd-shadow);
  }

  /* Connections, automation, preferences, time */
  body.desktop-retained-ui[data-theme] .integration-grid,
  body.desktop-retained-ui[data-theme] .automation-grid { gap: 13px; }
  body.desktop-retained-ui[data-theme] .integration-card,
  body.desktop-retained-ui[data-theme] .automation-card { padding: 21px; }
  body.desktop-retained-ui[data-theme] .integration-card h3,
  body.desktop-retained-ui[data-theme] .automation-card h3 { font-size: 18px; font-weight: 650; }
  body.desktop-retained-ui[data-theme] .automation-master {
    color: var(--jd-ink);
    border: 1px solid var(--jd-line);
    border-radius: var(--jd-radius);
    background: var(--jd-surface);
    box-shadow: var(--jd-shadow);
  }
  body.desktop-retained-ui[data-theme] .automation-history-item {
    border-color: var(--jd-line);
    border-radius: 12px;
    background: rgba(255,255,255,.45);
  }
  body.desktop-retained-ui[data-theme] .memory-card,
  body.desktop-retained-ui[data-theme] #view-memory .summer-sheet { padding: 23px; }
  body.desktop-retained-ui[data-theme] .time-ledger-shell,
  body.desktop-retained-ui[data-theme] .time-calendar-card,
  body.desktop-retained-ui[data-theme] .time-editor-card {
    border-color: var(--jd-line);
    background: var(--jd-surface);
    box-shadow: var(--jd-shadow);
  }

  /* Unified details */
  body.desktop-retained-ui[data-theme] dialog.mail-reader {
    width: min(980px, calc(100vw - 128px));
    max-width: 980px;
    max-height: calc(100vh - 40px);
    color: var(--jd-ink);
    border: 1px solid var(--jd-line-strong);
    border-radius: 23px;
    background: #fcfaf4;
    box-shadow: 0 30px 100px rgba(18,20,16,.24);
  }
  body.desktop-retained-ui[data-theme] dialog::backdrop {
    background: rgba(20,22,18,.34);
    backdrop-filter: blur(6px);
  }
  body.desktop-retained-ui[data-theme] .mail-reader-shell { background: transparent; }
  body.desktop-retained-ui[data-theme] .mail-reader-head,
  body.desktop-retained-ui[data-theme] .mail-reader-title {
    border-bottom: 1px solid var(--jd-line);
    background: transparent;
  }
  body.desktop-retained-ui[data-theme] .mail-reader-title h2,
  body.desktop-retained-ui[data-theme] #task-detail-title {
    color: var(--jd-ink);
    font: 500 clamp(30px,3vw,42px)/1.16 var(--jd-display);
    letter-spacing: -.027em;
  }
  body.desktop-retained-ui[data-theme] .mail-reader-close {
    color: var(--jd-ink);
    border: 1px solid var(--jd-line-strong);
    background: #fcfaf4;
  }
  body.desktop-retained-ui[data-theme] .task-edit-grid { padding: 21px 25px 27px; gap: 12px; }
  body.desktop-retained-ui[data-theme] .task-edit-grid label,
  body.desktop-retained-ui[data-theme] .task-edit-source,
  body.desktop-retained-ui[data-theme] .task-activity-history,
  body.desktop-retained-ui[data-theme] .work-detail-advanced {
    padding: 14px 15px;
    border: 1px solid var(--jd-line);
    border-radius: 13px;
    background: rgba(255,255,255,.52);
  }
  body.desktop-retained-ui[data-theme] .task-edit-grid input,
  body.desktop-retained-ui[data-theme] .task-edit-grid textarea,
  body.desktop-retained-ui[data-theme] .task-edit-grid select {
    border: 1px solid var(--jd-line-strong);
    border-radius: 8px;
    background: rgba(255,255,255,.76);
  }
  body.desktop-retained-ui[data-theme] .task-detail-actions,
  body.desktop-retained-ui[data-theme] .mail-reader-actions {
    border-top: 1px solid var(--jd-line);
    background: rgba(247,243,233,.95);
  }
  body.desktop-retained-ui[data-theme] .mail-result-row {
    border-color: var(--jd-line);
    border-radius: 12px;
    background: rgba(255,255,255,.57);
  }

  @media (max-width: 1180px) {
    body.desktop-retained-ui[data-theme] .view { padding-right: 32px; padding-left: 32px; }
    body.desktop-retained-ui[data-theme] .topbar { right: 76px; }
    body.desktop-retained-ui[data-theme] .status-cluster { display: none; }
    body.desktop-retained-ui[data-theme] #view-dashboard { grid-template-columns: 1fr; }
    body.desktop-retained-ui[data-theme] #view-dashboard > .metric-grid,
    body.desktop-retained-ui[data-theme] #view-dashboard > .work-overview-card { grid-column: 1; grid-row: auto; }
    body.desktop-retained-ui[data-theme] .metric-grid { grid-template-columns: repeat(3,1fr); }
    body.desktop-retained-ui[data-theme] .metric-card { border-right: 1px solid var(--jd-line); }
    body.desktop-retained-ui[data-theme] .meeting-layout,
    body.desktop-retained-ui[data-theme] #view-meetings { grid-template-columns: 300px minmax(0,1fr); }
  }
}

/* P4 — one James, full workspace framework */
:root {
  --p4-bg: #eef1ee;
  --p4-rail: #e5e9e5;
  --p4-rail-2: #dce2dd;
  --p4-surface: #f8faf7;
  --p4-surface-2: #f0f3ef;
  --p4-ink: #172019;
  --p4-text-2: #4f5c53;
  --p4-text-3: #748078;
  --p4-line: #d6ddd7;
  --p4-line-strong: #bec9c1;
  --p4-accent: #b7db54;
  --p4-accent-ink: #30440e;
  --p4-accent-soft: #eaf4cf;
  --p4-warning: #e9ac2e;
  --p4-danger: #db5a50;
  --p4-success: #7ba63a;
  --p4-shadow: 0 18px 44px rgba(28, 44, 33, .055);
  --p4-radius: 18px;
  --p4-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    "PingFang SC", "Microsoft YaHei UI", sans-serif;
  --p4-editorial: "James Editorial CN", "Songti SC", STSong, serif;
}

body[data-theme="paper"] {
  --p4-bg: #f4f0e7;
  --p4-rail: #eae4d8;
  --p4-rail-2: #ded6c8;
  --p4-surface: #fcfaf4;
  --p4-surface-2: #f5f1e8;
  --p4-ink: #1d211d;
  --p4-text-2: #596058;
  --p4-text-3: #7b8179;
  --p4-line: #ddd6c9;
  --p4-line-strong: #c8beae;
  --p4-accent: #bedf4e;
  --p4-accent-soft: #edf5d4;
}

body[data-theme="night"] {
  --p4-bg: #111713;
  --p4-rail: #171e19;
  --p4-rail-2: #202922;
  --p4-surface: #19211b;
  --p4-surface-2: #202a23;
  --p4-ink: #edf2ed;
  --p4-text-2: #b4c0b7;
  --p4-text-3: #849087;
  --p4-line: #2f3b32;
  --p4-line-strong: #46564a;
  --p4-accent: #b8dc57;
  --p4-accent-ink: #1f2c09;
  --p4-accent-soft: #2c3820;
  --p4-shadow: 0 20px 50px rgba(0, 0, 0, .2);
}

@media (min-width: 821px) {
  body.desktop-retained-ui[data-theme] {
    min-width: 1080px;
    color: var(--p4-ink);
    background: var(--p4-bg);
    font: 500 14px/1.58 var(--p4-ui);
    transition: background .2s ease, color .2s ease;
  }
  body.desktop-retained-ui[data-theme]::before,
  body.desktop-retained-ui[data-theme] .summer-scene { display: none; }
  body.desktop-retained-ui[data-theme] .app-shell {
    display: grid;
    grid-template-columns: 228px minmax(0, 1fr);
    min-height: 100vh;
  }
  body.desktop-retained-ui[data-theme] .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 228px;
    height: 100vh;
    padding: 0;
    overflow: visible;
    color: var(--p4-ink);
    background: var(--p4-rail);
    border-right: 1px solid var(--p4-line);
  }
  .p4-shell-nav {
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  body.desktop-retained-ui[data-theme] .p4-brand {
    width: auto;
    height: 92px;
    margin: 0;
    padding: 0 24px;
    display: flex;
    justify-content: flex-start;
    gap: 13px;
    color: var(--p4-ink);
    border-bottom: 1px solid var(--p4-line);
  }
  .p4-brand > span:last-child { display: grid; gap: 1px; }
  .p4-brand strong {
    font-size: 13px;
    font-weight: 760;
    letter-spacing: .16em;
  }
  .p4-brand small {
    color: var(--p4-text-3);
    font: 650 8px/1.2 var(--jd-mono);
    letter-spacing: .08em;
  }
  .p4-brand-mark {
    position: relative;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
  }
  .p4-brand-mark b {
    position: relative;
    z-index: 2;
    font: 500 23px/1 var(--p4-editorial);
  }
  .p4-brand-mark i {
    position: absolute;
    width: 18px;
    height: 18px;
    border: 1px solid var(--p4-line-strong);
    border-radius: 6px;
  }
  .p4-brand-mark i:nth-child(1) { top: 0; left: 0; background: var(--p4-accent); border-color: var(--p4-accent); }
  .p4-brand-mark i:nth-child(2) { right: 0; bottom: 0; }
  .p4-brand-mark i:nth-child(3) { right: 0; top: 0; opacity: .55; }
  .p4-nav-scroll {
    flex: 1;
    min-height: 0;
    padding: 23px 14px 14px;
    overflow-y: auto;
  }
  .p4-nav-label {
    display: block;
    margin: 0 10px 9px;
    color: var(--p4-text-3);
    font: 700 9px/1 var(--jd-mono);
    letter-spacing: .16em;
    text-transform: uppercase;
  }
  .p4-nav-label:not(:first-child) { margin-top: 28px; }
  .p4-nav-list { display: grid; gap: 4px; }
  body.desktop-retained-ui[data-theme] .p4-nav-item,
  .p4-more-menu .nav-item {
    position: relative;
    width: 100%;
    min-height: 42px;
    padding: 0 11px;
    display: grid;
    grid-template-columns: 25px minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    color: var(--p4-text-2);
    text-align: left;
    border: 0;
    border-radius: 10px;
    background: transparent;
  }
  body.desktop-retained-ui[data-theme] .p4-nav-item:hover,
  body.desktop-retained-ui[data-theme] .p4-nav-item.is-active,
  .p4-more-menu .nav-item:hover {
    color: var(--p4-ink);
    background: var(--p4-surface);
  }
  body.desktop-retained-ui[data-theme] .p4-nav-item.is-active::before {
    position: absolute;
    left: -14px;
    width: 3px;
    height: 22px;
    content: "";
    border-radius: 0 4px 4px 0;
    background: var(--p4-accent);
  }
  body.desktop-retained-ui[data-theme] .p4-nav-item .nav-icon {
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    color: var(--p4-text-3);
    font: 500 17px/1 var(--p4-ui);
  }
  body.desktop-retained-ui[data-theme] .p4-nav-item b,
  .p4-more-menu .nav-item b {
    font-size: 13px;
    font-weight: 620;
  }
  .p4-nav-count {
    min-width: 22px;
    padding: 2px 6px;
    color: var(--p4-accent-ink);
    font-size: 10px;
    text-align: center;
    border-radius: 99px;
    background: var(--p4-accent-soft);
  }
  .p4-more { margin-top: 22px; border-top: 1px solid var(--p4-line); }
  .p4-more > summary {
    min-height: 44px;
    padding: 0 11px;
    display: flex;
    align-items: center;
    gap: 13px;
    color: var(--p4-text-2);
    cursor: pointer;
    list-style: none;
  }
  .p4-more > summary::-webkit-details-marker { display: none; }
  .p4-more > summary span { letter-spacing: .12em; }
  .p4-more > summary b { font-size: 13px; font-weight: 620; }
  .p4-more-menu { display: grid; gap: 2px; padding: 2px 0 8px; }
  .p4-more-menu .nav-item { grid-template-columns: 25px minmax(0, 1fr); }
  .p4-nav-footer {
    padding: 14px;
    border-top: 1px solid var(--p4-line);
  }
  .p4-appearance-entry,
  .p4-logout {
    width: 100%;
    min-height: 40px;
    padding: 0 11px;
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--p4-text-2);
    border: 0;
    border-radius: 10px;
    background: transparent;
  }
  .p4-appearance-entry:hover,
  .p4-logout:hover { color: var(--p4-ink); background: var(--p4-surface); }
  .p4-appearance-entry b,
  .p4-logout b { font-size: 12px; font-weight: 620; }
  .p4-private {
    margin-top: 10px;
    padding: 10px 11px 2px;
    display: flex;
    align-items: center;
    gap: 9px;
    border-top: 1px solid var(--p4-line);
  }
  .p4-private i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--p4-success);
  }
  .p4-private span { display: grid; }
  .p4-private b { font-size: 10px; font-weight: 650; }
  .p4-private small { color: var(--p4-text-3); font-size: 9px; }

  body.desktop-retained-ui[data-theme] .workspace {
    width: auto;
    max-width: none;
    min-width: 0;
    margin: 0;
    grid-column: 2;
    background: var(--p4-bg);
  }
  body.desktop-retained-ui[data-theme] .workspace-header {
    position: sticky;
    z-index: 30;
    top: 0;
    height: 72px;
    border-bottom: 1px solid var(--p4-line);
    background: color-mix(in srgb, var(--p4-bg) 92%, transparent);
    backdrop-filter: blur(18px);
  }
  body.desktop-retained-ui[data-theme] .app-chrome {
    height: 72px;
    padding: 0 34px;
    display: grid;
    grid-template-columns: minmax(250px, 1fr) auto minmax(250px, 1fr);
    border: 0;
    background: transparent;
  }
  body.desktop-retained-ui[data-theme] .chrome-brand {
    color: var(--p4-ink);
  }
  body.desktop-retained-ui[data-theme] .chrome-brand strong {
    font-family: var(--p4-editorial);
    font-size: 20px;
    font-weight: 520;
  }
  body.desktop-retained-ui[data-theme] .chrome-brand strong > small {
    margin-left: 2px;
    color: var(--p4-text-3);
    font: 700 8px/1 var(--jd-mono);
    letter-spacing: .12em;
  }
  .p4-top-logo-mark {
    position: relative;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    margin-right: 2px;
  }
  .p4-top-logo-mark i {
    position: absolute;
    width: 13px;
    height: 13px;
    border: 1px solid var(--p4-line-strong);
    border-radius: 4px;
  }
  .p4-top-logo-mark i:first-child { top: 0; left: 0; background: var(--p4-accent); border-color: var(--p4-accent); }
  .p4-top-logo-mark i:nth-child(2) { right: 0; bottom: 0; }
  .p4-top-logo-mark b { position: relative; z-index: 2; font-size: 15px; }
  body.desktop-retained-ui[data-theme] .chrome-brand-sprout { stroke: var(--p4-ink); }
  body.desktop-retained-ui[data-theme] .chrome-signals {
    display: flex;
    align-items: center;
    gap: 18px;
  }
  body.desktop-retained-ui[data-theme] .chrome-signal {
    display: inline-flex;
    align-items: center;
    gap: 7px;
  }
  body.desktop-retained-ui[data-theme] .chrome-signal::after {
    content: attr(data-short-label);
    color: var(--p4-text-2);
    font-size: 11px;
    font-weight: 580;
    white-space: nowrap;
  }
  body.desktop-retained-ui[data-theme] .today-top-actions { color: var(--p4-text-2); }
  body.desktop-retained-ui[data-theme] .today-model-picker,
  body.desktop-retained-ui[data-theme] .today-focus-toggle {
    min-height: 34px;
    border-color: var(--p4-line);
    background: var(--p4-surface);
  }
  .p4-theme-button {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: var(--p4-text-2);
    border: 1px solid var(--p4-line);
    border-radius: 10px;
    background: var(--p4-surface);
  }
  body.desktop-retained-ui[data-theme] .topbar { display: none; }
  body.desktop-retained-ui[data-theme] .view {
    width: min(1420px, calc(100vw - 228px));
    max-width: none;
    margin: 0 auto;
    padding: 42px 44px 72px;
  }
  body[data-density="compact"].desktop-retained-ui[data-theme] .view { padding: 28px 34px 52px; }

  .p4-today { display: block; }
  body.today-pilot-active[data-theme] #view-dashboard > :not(.p4-today) { display: none !important; }
  .p4-page-hero,
  .p4-view-hero {
    margin-bottom: 28px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
  }
  .p4-page-hero h2,
  .p4-view-hero h2 {
    margin: 10px 0 10px;
    color: var(--p4-ink);
    font: 450 clamp(42px, 4vw, 62px)/1.08 var(--p4-editorial);
    letter-spacing: -.035em;
  }
  .p4-page-hero p,
  .p4-view-hero p {
    max-width: 700px;
    margin: 0;
    color: var(--p4-text-2);
    font-size: 14px;
  }
  .p4-view-hero h2 { font-size: clamp(36px, 3.2vw, 50px); }
  .p4-kicker {
    color: var(--p4-text-3);
    font: 700 9px/1.3 var(--jd-mono);
    letter-spacing: .16em;
  }
  .p4-today-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(310px, .82fr);
    gap: 18px;
  }
  .p4-today-primary,
  .p4-today-secondary { display: grid; align-content: start; gap: 18px; }
  .p4-card {
    min-width: 0;
    color: var(--p4-ink);
    border: 1px solid var(--p4-line);
    border-radius: var(--p4-radius);
    background: var(--p4-surface);
    box-shadow: var(--p4-shadow);
  }
  .p4-brief-card { min-height: 268px; padding: 26px 28px; }
  .p4-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
  }
  .p4-card-heading h3,
  .p4-section-heading h3,
  .p4-policy-card h3 {
    margin: 6px 0 0;
    color: var(--p4-ink);
    font: 530 23px/1.2 var(--p4-editorial);
  }
  .p4-freshness {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--p4-text-3);
    font-size: 10px;
    white-space: nowrap;
  }
  .p4-freshness i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--p4-success);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--p4-success) 12%, transparent);
  }
  .p4-brief-copy {
    max-width: 850px;
    margin: 28px 0 24px;
    color: var(--p4-text-2);
    font-size: 16px;
    line-height: 1.75;
  }
  .p4-source-row { display: flex; flex-wrap: wrap; gap: 7px; }
  .p4-source-chip {
    padding: 6px 9px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--p4-text-2);
    border: 1px solid var(--p4-line);
    border-radius: 99px;
    background: var(--p4-surface-2);
    font-size: 10px;
  }
  .p4-source-chip i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--p4-success);
  }
  .p4-source-chip.is-attention i { background: var(--p4-warning); }
  .p4-source-chip.is-limited i { background: var(--p4-text-3); }
  .p4-source-chip b { font-weight: 750; }
  .p4-card-actions,
  .p4-view-actions { margin-top: 26px; display: flex; gap: 9px; align-items: center; }
  .p4-primary,
  .p4-secondary {
    min-height: 39px;
    padding: 0 15px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 650;
  }
  .p4-primary {
    color: var(--p4-accent-ink);
    border: 1px solid color-mix(in srgb, var(--p4-accent) 82%, #778c35);
    background: var(--p4-accent);
  }
  .p4-primary:hover { filter: brightness(.96); }
  .p4-secondary {
    color: var(--p4-text-2);
    border: 1px solid var(--p4-line);
    background: transparent;
  }
  .p4-secondary:hover { color: var(--p4-ink); background: var(--p4-surface-2); }
  .p4-priority { min-height: 254px; padding: 25px 28px; border-left: 1px solid var(--p4-accent); }
  .p4-priority-state,
  .p4-agent-policy {
    padding: 6px 10px;
    color: var(--p4-accent-ink);
    border-radius: 99px;
    background: var(--p4-accent-soft);
    font-size: 10px;
    font-weight: 700;
  }
  .p4-priority-content { margin-top: 24px; }
  .p4-priority-project {
    color: var(--p4-text-3);
    font-size: 11px;
    font-weight: 650;
  }
  .p4-priority-content h4 {
    margin: 7px 0 8px;
    font: 520 26px/1.25 var(--p4-editorial);
  }
  .p4-priority-content > p { margin: 0 0 12px; color: var(--p4-text-2); }
  .p4-priority-meta {
    margin-bottom: 19px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    color: var(--p4-text-3);
    font-size: 11px;
  }
  .p4-section-heading {
    margin: 9px 2px 13px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
  }
  .p4-text-link {
    padding: 4px 0;
    color: var(--p4-text-2);
    border: 0;
    background: transparent;
    font-size: 11px;
  }
  .p4-text-link:hover { color: var(--p4-accent-ink); }
  .p4-run-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .p4-run-result {
    min-height: 76px;
    padding: 14px 15px;
    display: grid;
    grid-template-columns: 31px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    border: 1px solid var(--p4-line);
    border-radius: 12px;
    background: var(--p4-surface);
  }
  .p4-run-result > span { color: var(--p4-text-3); font: 500 15px/1 var(--p4-editorial); }
  .p4-run-result div { min-width: 0; display: grid; gap: 4px; }
  .p4-run-result b { overflow: hidden; font-size: 12px; font-weight: 640; text-overflow: ellipsis; white-space: nowrap; }
  .p4-run-result small { color: var(--p4-text-3); font-size: 10px; }
  .p4-run-result.is-failed { border-left: 1px solid var(--p4-danger); }
  .p4-project-pulse,
  .p4-schedule-card,
  .p4-agent-summary { padding: 21px 22px; }
  .p4-project-mini {
    width: 100%;
    padding: 15px 0 13px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 12px;
    text-align: left;
    border: 0;
    border-bottom: 1px solid var(--p4-line);
    background: transparent;
  }
  .p4-project-mini:last-child { border-bottom: 0; padding-bottom: 0; }
  .p4-project-mini span { display: grid; gap: 3px; }
  .p4-project-mini b { font-size: 12px; }
  .p4-project-mini small { color: var(--p4-text-3); font-size: 10px; }
  .p4-project-mini > strong { font: 500 20px/1 var(--p4-editorial); }
  .p4-project-mini > strong.is-risk { color: var(--p4-warning); }
  .p4-project-mini > i {
    height: 3px;
    grid-column: 1 / -1;
    overflow: hidden;
    border-radius: 99px;
    background: var(--p4-line);
  }
  .p4-project-mini > i em { display: block; height: 100%; background: var(--p4-accent); }
  .p4-schedule-card { box-shadow: none; }
  .p4-schedule-item {
    width: 100%;
    padding: 13px 0;
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 12px;
    color: var(--p4-ink);
    text-align: left;
    border: 0;
    border-bottom: 1px solid var(--p4-line);
    background: transparent;
  }
  .p4-schedule-item:last-child { border-bottom: 0; }
  .p4-schedule-item > span { color: var(--p4-text-3); font: 650 10px/1.4 var(--jd-mono); }
  .p4-schedule-item div { display: grid; gap: 3px; }
  .p4-schedule-item b { font-size: 11px; }
  .p4-schedule-item small { color: var(--p4-text-3); font-size: 10px; }
  .p4-agent-summary > div:last-child { margin-top: 11px; }
  #p4-agent-summary { margin-top: 12px; display: grid; gap: 0; }
  #p4-agent-summary > div {
    padding: 9px 0;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--p4-line);
  }
  #p4-agent-summary > div:last-child { border-bottom: 0; }
  #p4-agent-summary span { color: var(--p4-text-2); font-size: 11px; }
  #p4-agent-summary b { font-size: 10px; font-weight: 680; }
  .p4-empty { margin: 0; padding: 18px; color: var(--p4-text-3); border: 1px dashed var(--p4-line-strong); border-radius: 12px; }

  .p4-view-hero { margin-bottom: 30px; }
  .p4-view-actions { margin: 0; }
  .p4-brief-layout { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(300px, .72fr); gap: 18px; }
  .p4-full-brief { min-height: 0; padding: 30px 34px; align-self: start; }
  .p4-brief-document {
    margin-top: 32px;
    color: var(--p4-text-2);
    font-size: 15px;
    line-height: 1.9;
    white-space: pre-wrap;
  }
  .p4-brief-sidebar { display: grid; align-content: start; gap: 18px; }
  .p4-brief-sidebar .p4-card { padding: 22px; }
  .p4-source-ledger { margin-top: 14px; display: grid; }
  .p4-source-ledger article {
    padding: 13px 0;
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr);
    gap: 3px 10px;
    border-bottom: 1px solid var(--p4-line);
  }
  .p4-source-ledger article:last-child { border-bottom: 0; }
  .p4-source-ledger article > i { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--p4-success); }
  .p4-source-ledger article.is-attention > i { background: var(--p4-warning); }
  .p4-source-ledger article.is-limited > i { background: var(--p4-text-3); }
  .p4-source-ledger div { display: grid; }
  .p4-source-ledger b { font-size: 11px; }
  .p4-source-ledger small,
  .p4-source-ledger time { color: var(--p4-text-3); font-size: 9px; }
  .p4-source-ledger time { grid-column: 2; }
  .p4-brief-rule p { color: var(--p4-text-2); font-size: 12px; }
  .p4-project-summary { margin-bottom: 18px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
  .p4-project-summary article {
    min-height: 92px;
    padding: 16px 18px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    border: 1px solid var(--p4-line);
    border-radius: 14px;
    background: var(--p4-surface);
  }
  .p4-project-summary strong { font: 470 38px/1 var(--p4-editorial); }
  .p4-project-summary span { color: var(--p4-text-3); font-size: 10px; }
  .p4-project-map { padding: 25px 26px; }
  .p4-muted { color: var(--p4-text-3); font-size: 10px; }
  #p4-project-map-list { margin-top: 16px; }
  .p4-project-row {
    width: 100%;
    min-height: 86px;
    padding: 12px 4px;
    display: grid;
    grid-template-columns: 48px minmax(190px, 1.2fr) minmax(120px, .7fr) minmax(150px, .8fr) 24px;
    align-items: center;
    gap: 16px;
    color: var(--p4-ink);
    text-align: left;
    border: 0;
    border-bottom: 1px solid var(--p4-line);
    background: transparent;
  }
  .p4-project-row:hover { background: var(--p4-surface-2); }
  .p4-project-index { color: var(--p4-text-3); font: 500 17px/1 var(--p4-editorial); }
  .p4-project-name { display: grid; gap: 5px; }
  .p4-project-name b { font: 520 18px/1.2 var(--p4-editorial); }
  .p4-project-name small { color: var(--p4-text-3); font-size: 10px; }
  .p4-project-health { display: flex; align-items: center; gap: 7px; color: var(--p4-text-2); font-size: 10px; }
  .p4-project-health i { width: 7px; height: 7px; border-radius: 50%; background: var(--p4-success); }
  .p4-project-health.is-attention i { background: var(--p4-danger); }
  .p4-project-progress { display: grid; grid-template-columns: 35px minmax(80px, 1fr); align-items: center; gap: 9px; }
  .p4-project-progress > b { font-size: 10px; }
  .p4-project-progress > i { height: 3px; overflow: hidden; border-radius: 99px; background: var(--p4-line); }
  .p4-project-progress em { display: block; height: 100%; background: var(--p4-accent); }

  .p4-agent-hero {
    padding: 31px 34px;
    align-items: center;
    color: #edf3ee;
    border-radius: 18px;
    background: #17201a;
  }
  .p4-agent-hero h2,
  .p4-agent-hero p { color: inherit; }
  .p4-agent-hero p { color: #b9c5bc; }
  .p4-lifecycle {
    margin-bottom: 18px;
    padding: 17px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--p4-line);
    border-radius: 14px;
    background: var(--p4-surface);
  }
  .p4-lifecycle span { display: flex; align-items: center; gap: 7px; }
  .p4-lifecycle span i {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    color: var(--p4-text-3);
    border: 1px solid var(--p4-line);
    border-radius: 50%;
    font: 650 8px/1 var(--jd-mono);
  }
  .p4-lifecycle span.is-gate i { color: var(--p4-accent-ink); border-color: var(--p4-accent); background: var(--p4-accent); }
  .p4-lifecycle b { font-size: 10px; }
  .p4-lifecycle > em { color: var(--p4-line-strong); font-style: normal; }
  .p4-capability-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .p4-capability-card {
    min-height: 226px;
    padding: 22px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-content: start;
    color: var(--p4-ink);
    border: 1px solid var(--p4-line);
    border-radius: 15px;
    background: var(--p4-surface);
  }
  .p4-capability-number { color: var(--p4-text-3); font: 500 16px/1 var(--p4-editorial); }
  .p4-capability-card > div { display: flex; align-items: center; gap: 6px; color: var(--p4-text-3); font-size: 9px; }
  .p4-capability-card > div i { width: 6px; height: 6px; border-radius: 50%; background: var(--p4-success); }
  .p4-capability-card.is-attention > div i { background: var(--p4-warning); }
  .p4-capability-card.is-limited > div i { background: var(--p4-text-3); }
  .p4-capability-card h3 { grid-column: 1 / -1; margin: 24px 0 8px; font: 530 20px/1.2 var(--p4-editorial); }
  .p4-capability-card p { grid-column: 1 / -1; margin: 0; color: var(--p4-text-2); font-size: 11px; }
  .p4-capability-card footer {
    margin-top: 23px;
    padding-top: 13px;
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--p4-line);
  }
  .p4-capability-card footer b { font-size: 9px; }
  .p4-capability-card footer button { color: var(--p4-text-2); border: 0; background: transparent; font-size: 10px; }
  .p4-policy-card { margin-top: 18px; padding: 24px; display: grid; grid-template-columns: minmax(230px, .7fr) 1.5fr; gap: 24px; }
  .p4-policy-list { display: flex; flex-wrap: wrap; align-content: center; gap: 8px; }
  .p4-policy-list span { padding: 7px 10px; color: var(--p4-text-2); border: 1px solid var(--p4-line); border-radius: 99px; background: var(--p4-surface-2); font-size: 10px; }

  /* Existing route content inherits the same system. */
  body.desktop-retained-ui[data-theme] #view-work,
  body.desktop-retained-ui[data-theme] #view-meetings,
  body.desktop-retained-ui[data-theme] #view-drafts,
  body.desktop-retained-ui[data-theme] #view-chat,
  body.desktop-retained-ui[data-theme] #view-integrations,
  body.desktop-retained-ui[data-theme] #view-automation,
  body.desktop-retained-ui[data-theme] #view-memory,
  body.desktop-retained-ui[data-theme] #view-time {
    color: var(--p4-ink);
  }
  body.desktop-retained-ui[data-theme] :is(
    .summer-sheet, .work-list-panel, .meeting-detail, .meeting-list-panel,
    .integration-card, .automation-now, .automation-connections, .generator-card,
    .manual-draft-card, .chat-panel, .time-ledger
  ) {
    border-color: var(--p4-line);
    background: var(--p4-surface);
    box-shadow: var(--p4-shadow);
  }
  body.desktop-retained-ui[data-theme] :is(input, textarea, select) {
    color: var(--p4-ink);
    border-color: var(--p4-line-strong);
    background: var(--p4-surface);
  }
  body.desktop-retained-ui[data-theme] :is(.eyebrow, small, .muted, .empty-note) { color: var(--p4-text-3); }
  body.desktop-retained-ui[data-theme] :is(.view h2, .view h3) { color: var(--p4-ink); }

  .p4-appearance-panel {
    position: fixed;
    z-index: 120;
    top: 0;
    right: 0;
    width: 370px;
    height: 100vh;
    padding: 28px;
    color: var(--p4-ink);
    overflow-y: auto;
    border-left: 1px solid var(--p4-line);
    background: var(--p4-surface);
    box-shadow: -24px 0 70px rgba(21, 35, 25, .12);
  }
  .p4-appearance-panel[hidden],
  .p4-panel-backdrop[hidden] { display: none; }
  .p4-appearance-panel header { display: flex; justify-content: space-between; align-items: flex-start; }
  .p4-appearance-panel h2 { margin: 7px 0 0; font: 520 28px/1.2 var(--p4-editorial); }
  .p4-appearance-panel header button {
    width: 34px; height: 34px; color: var(--p4-text-2); border: 1px solid var(--p4-line); border-radius: 10px; background: transparent;
  }
  .p4-appearance-panel > p { margin: 18px 0 30px; color: var(--p4-text-2); font-size: 11px; }
  .p4-appearance-panel > section { margin-top: 27px; }
  .p4-setting-label { margin-bottom: 12px; display: grid; gap: 3px; }
  .p4-setting-label b { font-size: 12px; }
  .p4-setting-label small { color: var(--p4-text-3); font-size: 10px; }
  .p4-theme-choices { display: grid; gap: 7px; }
  .p4-theme-choices button {
    min-height: 62px;
    padding: 10px 12px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    color: var(--p4-ink);
    text-align: left;
    border: 1px solid var(--p4-line);
    border-radius: 12px;
    background: var(--p4-surface-2);
  }
  .p4-theme-choices button.is-selected { border-color: var(--p4-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--p4-accent) 20%, transparent); }
  .p4-theme-choices i { width: 38px; height: 38px; border-radius: 9px; border: 1px solid #d5dcd6; background: linear-gradient(135deg, #e7ebe7 50%, #f8faf7 50%); }
  .p4-theme-choices button:first-child i { background: linear-gradient(135deg, #e9e2d5 50%, #fcfaf4 50%); }
  .p4-theme-choices button:last-child i { background: linear-gradient(135deg, #151c17 50%, #263027 50%); }
  .p4-theme-choices span { display: grid; gap: 2px; }
  .p4-theme-choices b { font-size: 11px; }
  .p4-theme-choices small { color: var(--p4-text-3); font-size: 9px; }
  .p4-density-choices { padding: 3px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; border: 1px solid var(--p4-line); border-radius: 10px; background: var(--p4-surface-2); }
  .p4-density-choices button { min-height: 34px; color: var(--p4-text-2); border: 0; border-radius: 7px; background: transparent; font-size: 11px; }
  .p4-density-choices button.is-selected { color: var(--p4-ink); background: var(--p4-surface); box-shadow: 0 2px 7px rgba(20,35,25,.06); }
  .p4-accessibility-settings { display: grid; }
  .p4-accessibility-settings label { padding: 13px 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--p4-line); }
  .p4-accessibility-settings label span { display: grid; gap: 3px; }
  .p4-accessibility-settings b { font-size: 11px; }
  .p4-accessibility-settings small { color: var(--p4-text-3); font-size: 9px; }
  .p4-accessibility-settings input { width: 34px; height: 18px; accent-color: var(--p4-accent); }
  .p4-panel-backdrop { position: fixed; z-index: 110; inset: 0; border: 0; background: rgba(16, 24, 19, .2); backdrop-filter: blur(2px); }
  body.p4-reduce-motion *,
  body.p4-reduce-motion *::before,
  body.p4-reduce-motion *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  body.p4-high-contrast { --p4-text-2: color-mix(in srgb, var(--p4-ink) 83%, transparent); --p4-text-3: color-mix(in srgb, var(--p4-ink) 67%, transparent); }
}

@media (min-width: 821px) and (max-width: 1180px) {
  body.desktop-retained-ui[data-theme] .app-shell { grid-template-columns: 190px minmax(0, 1fr); }
  body.desktop-retained-ui[data-theme] .sidebar { width: 190px; }
  body.desktop-retained-ui[data-theme] .view { width: calc(100vw - 190px); padding-right: 28px; padding-left: 28px; }
  .p4-today-grid,
  .p4-brief-layout { grid-template-columns: 1fr; }
  .p4-today-secondary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .p4-project-pulse,
  .p4-schedule-card,
  .p4-agent-summary { min-width: 0; }
  .p4-capability-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Global brand continuity: keep the approved James C-mark on legacy pages too. */
@media (min-width: 821px) {
  body.desktop-legacy-ui[data-theme] .nav-icon { display: none; }
}

.today-reference-pilot { display: none; }
.today-support-zone { display: contents; }
.today-support-heading { display: none; }
.today-model-picker { display: none; }
.today-top-actions { display: contents; }
.today-focus-toggle,
.today-top-divider,
.today-account-entry { display: none; }

@media (min-width: 821px) {
  body.today-pilot-active[data-theme] .workspace-header {
    height: 90px;
    border-bottom: 1px solid var(--jd-line);
    background: rgba(248, 245, 236, .92);
    backdrop-filter: blur(18px);
  }
  body.today-pilot-active[data-theme] .app-chrome {
    height: 90px;
    padding: 0 88px 0 72px;
    grid-template-columns: minmax(390px, 1fr) auto minmax(390px, 1fr);
  }
  body.today-pilot-active[data-theme] .chrome-signals {
    gap: 43px;
    align-items: center;
    transform: translateY(5px);
  }
  body.today-pilot-active[data-theme] .chrome-signal {
    width: auto;
    height: 24px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #4b4f48;
    border: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
  }
  body.today-pilot-active[data-theme] .chrome-signal::before {
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    content: "";
    border-radius: 50%;
    background: var(--jd-green);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .06);
  }
  body.today-pilot-active[data-theme] #chrome-alert-signal::before { background: var(--jd-green); }
  body.today-pilot-active[data-theme] #chrome-alert-signal.is-active::before { background: var(--jd-red); }
  body.today-pilot-active[data-theme] #chrome-review-signal::before { background: #d5d0c1; }
  body.today-pilot-active[data-theme] #chrome-review-signal.is-active::before { background: var(--jd-amber); }
  body.today-pilot-active[data-theme] #chrome-system-signal::before { background: var(--jd-green); }
  body.today-pilot-active[data-theme] .chrome-signal::after {
    max-width: 150px;
    overflow: hidden;
    color: #3f433d;
    content: attr(aria-label);
    font-size: 13px;
    font-weight: 520;
    letter-spacing: .01em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.today-pilot-active[data-theme] .chrome-brand strong {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font: 400 19px/1 var(--today-sans, var(--jd-ui));
    letter-spacing: -.035em;
  }
  body.today-pilot-active[data-theme] .chrome-brand {
    transform: translate(-30px, 5px);
  }
  body.today-pilot-active[data-theme] .chrome-brand-sprout {
    width: 27px;
    height: 29px;
    overflow: visible;
    fill: none;
    stroke: #20241f;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.3;
  }
  body.today-pilot-active[data-theme] .chrome-brand strong::before { display: none; }
  body.today-pilot-active[data-theme] .chrome-brand strong::after { display: none; }
  body.today-pilot-active[data-theme] .chrome-review {
    justify-self: end;
    width: 42px;
    height: 42px;
    padding: 0;
    border-color: #bfb8a9;
    background: rgba(255, 255, 255, .34);
  }
  body.today-pilot-active[data-theme] .chrome-review > span {
    display: grid;
    place-items: center;
    width: 23px;
    height: 23px;
    color: var(--jd-ink);
    font-size: 15px;
  }
  body.today-pilot-active[data-theme] .chrome-review b {
    position: absolute;
    top: -4px;
    right: -3px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    display: grid;
    place-items: center;
    font-size: 11px;
    border-radius: 999px;
  }
  body.today-pilot-active[data-theme] .topbar {
    top: 24px;
    right: 98px;
    width: auto;
    height: 42px;
    padding: 0;
    background: transparent;
  }
  body.today-pilot-active[data-theme] .topbar-title,
  body.today-pilot-active[data-theme] .install-app,
  body.today-pilot-active[data-theme] .status-cluster { display: none !important; }
  body.today-pilot-active[data-theme] .model-picker {
    min-width: 150px;
    height: 42px;
    padding: 4px 8px 4px 13px;
    border-color: var(--jd-line);
    background: rgba(255,255,255,.38);
  }
  body.today-pilot-active[data-theme] .model-picker span { color: var(--jd-muted); }

  body.today-pilot-active[data-theme] .sidebar {
    width: 104px;
    padding-top: 21px;
    background: #070907;
  }
  body.today-pilot-active[data-theme] .nav-item {
    min-height: 64px;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  body.today-pilot-active[data-theme] .nav-item.is-active {
    color: #fff;
    background: transparent;
    box-shadow: none;
  }
  body.today-pilot-active[data-theme] .nav-item.is-active::after {
    top: 10px;
    left: 5px;
    width: 7px;
    height: 7px;
    border: 0;
    border-radius: 50%;
    background: var(--jd-lime);
    transform: none;
  }
  body.today-pilot-active[data-theme] .nav-item::before { display: none !important; }
  body.today-pilot-active[data-theme] .nav-icon { color: #f3f3ee; }
  body.today-pilot-active[data-theme] .nav-item.is-active .nav-icon { color: var(--jd-lime); }

  body.today-pilot-active[data-theme] #view-dashboard {
    width: 100%;
    max-width: none;
    min-height: calc(100vh - 90px);
    padding: 27px 88px 52px 72px;
    display: block;
  }
  body.today-pilot-active[data-theme] .today-reference-pilot {
    min-height: 0;
    display: block;
  }
  body.today-pilot-active[data-theme] .today-pilot-hero {
    height: 176px;
    display: flex;
    align-items: flex-start;
  }
  body.today-pilot-active[data-theme] .today-pilot-date {
    color: #31352f;
    font: 600 12px/1 var(--jd-mono);
    letter-spacing: .24em;
  }
  body.today-pilot-active[data-theme] .today-pilot-hero h2 {
    margin: 16px 0 19px;
    color: #0c0e0b;
    font: 400 66px/1 var(--today-editorial, var(--jd-display));
    letter-spacing: -.035em;
  }
  body.today-pilot-active[data-theme] .today-pilot-hero p {
    margin: 0;
    color: #656960;
    font-size: 14px;
    letter-spacing: .02em;
  }
  body.today-pilot-active[data-theme] .today-pilot-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 387px;
    gap: 52px;
    align-items: start;
  }
  body.today-pilot-active[data-theme] .today-pilot-main {
    min-width: 0;
    display: grid;
    gap: 26px;
  }
  body.today-pilot-active[data-theme] .today-priority-card {
    min-height: 152px;
    padding: 0;
    position: relative;
    overflow: hidden;
    border: 0;
    border-top: 1px solid var(--jd-line-strong);
    border-bottom: 1px solid var(--jd-line-strong);
    border-radius: 0;
    background: rgba(255,255,255,.16);
  }
  body.today-pilot-active[data-theme] .today-priority-card::before {
    position: absolute;
    inset: 24px auto auto 0;
    width: 4px;
    height: 104px;
    content: "";
    background: linear-gradient(180deg, #b7df00, #8bbb00);
  }
  body.today-pilot-active[data-theme] .today-priority-label {
    display: block;
    margin: 0 0 10px;
    color: #5d625a;
    font: 600 11px/1.2 var(--jd-mono);
    letter-spacing: .16em;
  }
  body.today-pilot-active[data-theme] .today-priority-body {
    width: 100%;
    min-height: 150px;
    padding: 22px 18px 20px 31px;
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
    gap: 20px;
    align-items: center;
    color: var(--jd-ink);
    text-align: left;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  body.today-pilot-active[data-theme] .today-priority-kind {
    min-width: 72px;
    padding: 7px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: #53594f;
    border: 1px solid #aeb2a8;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 620;
    letter-spacing: .04em;
  }
  body.today-pilot-active[data-theme] .today-priority-kind i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--jd-amber);
  }
  body.today-pilot-active[data-theme] .today-priority-kind.signal-green i,
  body.today-pilot-active[data-theme] .today-priority-kind.is-clear i { background: var(--jd-green); }
  body.today-pilot-active[data-theme] .today-priority-kind.signal-red i { background: var(--jd-red); }
  body.today-pilot-active[data-theme] .today-priority-copy {
    min-width: 0;
  }
  body.today-pilot-active[data-theme] .today-priority-body h3 {
    margin: 0 0 6px;
    font: 500 28px/1.15 var(--jd-display);
    letter-spacing: -.035em;
  }
  body.today-pilot-active[data-theme] .today-priority-body p {
    margin: 0;
    color: #656960;
    font-size: 14px;
  }
  body.today-pilot-active[data-theme] .today-priority-open {
    min-width: 88px;
    padding: 9px 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    color: #343a32;
    border: 0;
    border-bottom: 1px solid #8f9589;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .025em;
  }
  body.today-pilot-active[data-theme] .today-priority-open:hover {
    color: #587e12;
    border-bottom-color: #78a51b;
    transform: none;
  }
  body.today-pilot-active[data-theme] .today-priority-open i {
    font-size: 17px;
    font-style: normal;
  }
  body.today-pilot-active[data-theme] .today-priority-empty .today-priority-body {
    grid-template-columns: auto minmax(0,1fr);
  }
  body.today-pilot-active[data-theme] .today-priority-meta {
    margin: 11px 0 0;
    color: #676b63;
    font-size: 12px;
    letter-spacing: .015em;
  }
  body.today-pilot-active[data-theme] .today-next-card {
    min-height: 142px;
    overflow: hidden;
    border: 1px solid var(--jd-line-strong);
    border-radius: 3px;
    background: rgba(255,255,255,.26);
  }
  body.today-pilot-active[data-theme] .today-next-card > header {
    min-height: 50px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--jd-line);
  }
  body.today-pilot-active[data-theme] .today-next-card > header span {
    font: 600 12px/1 var(--jd-mono);
    letter-spacing: .22em;
  }
  body.today-pilot-active[data-theme] .today-next-card > header b {
    color: var(--jd-muted);
    font-size: 14px;
    font-weight: 560;
  }
  body.today-pilot-active[data-theme] .today-work-route {
    width: 100%;
    min-height: 90px;
    padding: 15px 20px;
    display: grid;
    grid-template-columns: 86px minmax(0,1fr) 38px;
    gap: 17px;
    align-items: center;
    color: var(--jd-ink);
    text-align: left;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  body.today-pilot-active[data-theme] .today-work-route:hover {
    background: rgba(238, 241, 218, .42);
    transform: none;
  }
  body.today-pilot-active[data-theme] .today-work-route > span {
    min-width: 0;
    display: grid;
    gap: 4px;
  }
  body.today-pilot-active[data-theme] .today-work-route > span:first-child {
    padding-right: 16px;
    border-right: 1px solid var(--jd-line);
  }
  body.today-pilot-active[data-theme] .today-work-route b {
    font: 500 30px/1 var(--jd-display);
  }
  body.today-pilot-active[data-theme] .today-work-route strong {
    font-size: 15px;
    font-weight: 650;
  }
  body.today-pilot-active[data-theme] .today-work-route small {
    color: #676c64;
    font-size: 13px;
    line-height: 1.55;
  }
  body.today-pilot-active[data-theme] .today-work-route i {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid #777d72;
    border-radius: 50%;
    font-size: 16px;
    font-style: normal;
  }
  body.today-pilot-active[data-theme] .today-next-row {
    min-height: 62px;
    padding: 0 15px 0 20px;
    display: grid;
    grid-template-columns: 34px 20px 90px minmax(0,1fr);
    gap: 12px;
    align-items: center;
    border-bottom: 1px solid var(--jd-line);
  }
  body.today-pilot-active[data-theme] .today-next-row:last-child { border-bottom: 0; }
  body.today-pilot-active[data-theme] .today-next-index {
    color: #4d524b;
    font: 500 14px/1 var(--jd-display);
  }
  body.today-pilot-active[data-theme] .today-next-signal {
    width: 17px;
    height: 17px;
    border: 2px solid var(--jd-amber);
    border-radius: 50%;
  }
  body.today-pilot-active[data-theme] .today-next-signal.signal-green { border-color: var(--jd-green); background: var(--jd-green); }
  body.today-pilot-active[data-theme] .today-next-signal.signal-red { border-color: var(--jd-red); background: var(--jd-red); }
  body.today-pilot-active[data-theme] .today-next-project {
    padding: 5px 10px;
    overflow: hidden;
    font-size: 13px;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 1px solid #a8aa9f;
    border-radius: 999px;
  }
  body.today-pilot-active[data-theme] .today-next-row button {
    min-width: 0;
    padding: 9px 0;
    display: grid;
    grid-template-columns: minmax(170px, auto) minmax(0,1fr) 36px;
    gap: 14px;
    align-items: center;
    color: var(--jd-ink);
    text-align: left;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  body.today-pilot-active[data-theme] .today-next-row button:hover { transform: translateX(2px); }
  body.today-pilot-active[data-theme] .today-next-row strong {
    overflow: hidden;
    font-size: 13px;
    font-weight: 620;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.today-pilot-active[data-theme] .today-next-row small {
    overflow: hidden;
    color: #666b63;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.today-pilot-active[data-theme] .today-next-row i {
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    border: 1px solid #454943;
    border-radius: 50%;
    font-size: 16px;
    font-style: normal;
  }
  body.today-pilot-active[data-theme] .today-next-more {
    width: 100%;
    min-height: 42px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    color: #4f554a;
    border: 0;
    border-top: 1px solid var(--jd-line);
    border-radius: 0;
    background: rgba(237, 241, 213, .42);
    box-shadow: none;
    font-size: 13px;
    font-weight: 560;
  }
  body.today-pilot-active[data-theme] .today-next-more:hover {
    color: #273000;
    background: rgba(224, 234, 167, .58);
    transform: none;
  }
  body.today-pilot-active[data-theme] .today-next-empty {
    min-height: 258px;
    padding: 20px;
    display: flex;
    gap: 22px;
    align-items: center;
  }
  body.today-pilot-active[data-theme] .today-next-empty > span {
    color: #b7b1a5;
    font: 500 42px/1 var(--jd-display);
  }
  body.today-pilot-active[data-theme] .today-next-empty strong { display: block; font: 500 22px/1.2 var(--jd-display); }
  body.today-pilot-active[data-theme] .today-next-empty small { color: var(--jd-muted); font-size: 14px; }

  body.today-pilot-active[data-theme] .today-pilot-rail {
    display: grid;
    gap: 18px;
    transform: none;
  }
  body.today-pilot-active[data-theme] .today-status-stack { display: grid; gap: 10px; }
  body.today-pilot-active[data-theme] .today-status-card {
    position: relative;
    min-height: 78px;
    padding: 11px 20px;
    display: grid;
    grid-template-columns: 76px minmax(0,1fr);
    gap: 14px;
    align-items: center;
    color: #242923;
    text-align: left;
    border: 1px solid var(--jd-line);
    border-radius: 4px;
    background: rgba(255,255,255,.28);
    box-shadow: none;
    cursor: default;
  }
  body.today-pilot-active[data-theme] .today-status-card::before {
    position: absolute;
    top: 16px;
    right: 17px;
    width: 7px;
    height: 7px;
    content: "";
    border-radius: 50%;
    background: var(--jd-green);
  }
  body.today-pilot-active[data-theme] .today-status-card.tone-ink {
    color: #242923;
    background: rgba(255,255,255,.28);
  }
  body.today-pilot-active[data-theme] .today-status-card.tone-ink::before { background: var(--jd-amber); }
  body.today-pilot-active[data-theme] .today-status-card.tone-red {
    color: #242923;
    background: rgba(255,255,255,.28);
  }
  body.today-pilot-active[data-theme] .today-status-card.tone-red::before { background: var(--jd-red); }
  body.today-pilot-active[data-theme] .today-status-card > strong {
    font: 500 56px/.9 var(--jd-display);
    letter-spacing: -.05em;
  }
  body.today-pilot-active[data-theme] .today-status-card span { display: grid; gap: 7px; }
  body.today-pilot-active[data-theme] .today-status-card b { font-size: 15px; }
  body.today-pilot-active[data-theme] .today-status-card small { opacity: .8; font-size: 14px; }
  body.today-pilot-active[data-theme] .today-automation-card {
    min-height: 250px;
    padding: 18px 20px;
    border: 1px solid var(--jd-line-strong);
    border-radius: 3px;
    background: rgba(255,255,255,.26);
  }
  body.today-pilot-active[data-theme] .today-automation-card > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  body.today-pilot-active[data-theme] .today-automation-card h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 650;
  }
  body.today-pilot-active[data-theme] .today-automation-card .text-link {
    padding: 0;
    font-size: 14px;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  body.today-pilot-active[data-theme] .today-pulse-track {
    height: 45px;
    margin: 4px 0 0;
    padding: 0 4px 10px;
    display: flex;
    gap: 5px;
    align-items: flex-end;
    border-bottom: 0;
  }
  body.today-pilot-active[data-theme] .today-pulse-track i {
    width: 5px;
    height: 5px;
    flex: 1;
    border-radius: 50%;
    background: #cdc8bc;
  }
  body.today-pilot-active[data-theme] .today-pulse-track i:nth-child(3n) { transform: translateY(-6px); }
  body.today-pilot-active[data-theme] .today-pulse-track i:nth-child(5n) { transform: translateY(4px); }
  body.today-pilot-active[data-theme] .today-pulse-track .tone-good { background: #8bb500; }
  body.today-pilot-active[data-theme] .today-pulse-track .tone-attention { background: var(--jd-amber); }
  body.today-pilot-active[data-theme] .today-pulse-track .tone-risk { background: var(--jd-red); }
  body.today-pilot-active[data-theme] .today-pulse-axis {
    height: 26px;
    padding: 0 2px 7px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    color: #5d625a;
    border-bottom: 1px solid var(--jd-line);
    font-size: 11px;
    line-height: 1;
  }
  body.today-pilot-active[data-theme] .today-pulse-summary { display: grid; gap: 8px; }
  body.today-pilot-active[data-theme] .today-pulse-summary article {
    min-height: 82px;
    padding: 9px 12px;
    display: grid;
    grid-template-columns: 44px minmax(0,1fr);
    gap: 12px;
    align-items: center;
    border: 1px solid var(--jd-line);
    border-radius: 3px;
  }
  body.today-pilot-active[data-theme] .today-pulse-state {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #e7f1b2;
  }
  body.today-pilot-active[data-theme] .today-pulse-state::after { content: "⌁"; font-size: 18px; }
  body.today-pilot-active[data-theme] .today-pulse-state.is-attention { background: #f8e6ad; }
  body.today-pilot-active[data-theme] .today-pulse-state.is-risk { background: #f7c8c0; }
  body.today-pilot-active[data-theme] .today-pulse-summary strong { display: block; font-size: 14px; }
  body.today-pilot-active[data-theme] .today-pulse-summary small { display: block; margin-top: 3px; color: var(--jd-muted); font-size: 13px; }

  body.today-pilot-active[data-theme] .today-project-strip { display: none !important; }
  body.today-pilot-active[data-theme] .today-project-strip > header {
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  body.today-pilot-active[data-theme] .today-project-strip h3 {
    margin: 0;
    font: 500 20px/1 var(--jd-display);
  }
  body.today-pilot-active[data-theme] .today-project-strip .text-link {
    padding: 0;
    font-size: 14px;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  body.today-pilot-active[data-theme] #today-project-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 22px;
  }
  body.today-pilot-active[data-theme] .today-project-card {
    min-height: 92px;
    padding: 15px 18px;
    display: grid;
    grid-template-columns: 54px minmax(0,1fr) 42px;
    gap: 13px;
    align-items: center;
    color: var(--jd-ink);
    text-align: left;
    border: 1px solid var(--jd-line-strong);
    border-radius: 3px;
    background: rgba(255,255,255,.25);
    box-shadow: none;
  }
  body.today-pilot-active[data-theme] button.today-project-card:hover { transform: translateY(-2px); }
  body.today-pilot-active[data-theme] .today-project-card > span {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border: 1px solid #8f9389;
    border-radius: 50%;
    font: 500 22px/1 var(--jd-display);
  }
  body.today-pilot-active[data-theme] .today-project-card strong { display: block; font: 500 16px/1.1 var(--jd-display); }
  body.today-pilot-active[data-theme] .today-project-card small { display: block; margin-top: 4px; color: var(--jd-muted); font-size: 13px; }
  body.today-pilot-active[data-theme] .today-project-card div > i,
  body.today-pilot-active[data-theme] .today-project-card progress {
    width: 100%;
    height: 4px;
    margin-top: 10px;
    display: block;
    overflow: hidden;
    appearance: none;
    border: 0;
    border-radius: 999px;
    background: #dedbd2;
  }
  body.today-pilot-active[data-theme] .today-project-card progress::-webkit-progress-bar {
    border-radius: inherit;
    background: #dedbd2;
  }
  body.today-pilot-active[data-theme] .today-project-card progress::-webkit-progress-value {
    border-radius: inherit;
    background: #9cc800;
  }
  body.today-pilot-active[data-theme] .today-project-card progress::-moz-progress-bar {
    border-radius: inherit;
    background: #9cc800;
  }
  body.today-pilot-active[data-theme] .today-project-card div > i b {
    height: 100%;
    display: block;
    background: #9cc800;
  }
  body.today-pilot-active[data-theme] .today-project-card > em {
    font-size: 13px;
    font-style: normal;
  }
  body.today-pilot-active[data-theme] .today-project-card.is-empty { opacity: .72; }

  body.today-pilot-active[data-theme] #view-dashboard > .today-reference-pilot ~ .summer-hero,
  body.today-pilot-active[data-theme] #view-dashboard > .today-reference-pilot ~ .work-overview-card,
  body.today-pilot-active[data-theme] #view-dashboard > .today-reference-pilot ~ .metric-grid {
    display: none !important;
  }
  body.today-pilot-active[data-theme] #view-dashboard > .global-inbox-card,
  body.today-pilot-active[data-theme] #view-dashboard > .factory-pulse-card,
  body.today-pilot-active[data-theme] #view-dashboard > .data-source-card,
  body.today-pilot-active[data-theme] #view-dashboard > .time-ledger-entry {
    margin-top: 22px;
  }
}

@media (min-width: 821px) {
  body.today-pilot-active[data-theme] {
    --today-editorial: "James Editorial CN", "STSong", "Noto Serif SC", "SimSun", serif;
    --today-sans: "Noto Sans SC", "Microsoft YaHei UI", "DengXian", sans-serif;
    font-family: var(--today-sans);
    font-synthesis: none;
    text-rendering: optimizeLegibility;
  }
  body.today-pilot-active[data-theme] button,
  body.today-pilot-active[data-theme] input,
  body.today-pilot-active[data-theme] select,
  body.today-pilot-active[data-theme] textarea {
    font-family: var(--today-sans);
  }
  body.today-pilot-active[data-theme] .today-pilot-hero h2 {
    font-family: var(--today-editorial);
    font-size: 71px;
    font-weight: 350;
    line-height: 1.02;
    letter-spacing: -.035em;
    font-kerning: normal;
    line-break: strict;
  }
  body.today-pilot-active[data-theme] .today-pilot-hero p {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.75;
    letter-spacing: .035em;
  }
  body.today-pilot-active[data-theme] .today-pilot-date,
  body.today-pilot-active[data-theme] .today-priority-label,
  body.today-pilot-active[data-theme] .today-next-card > header span {
    font-family: var(--today-sans);
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: .2em;
  }
  body.today-pilot-active[data-theme] .today-priority-body h3 {
    font-family: var(--today-editorial);
    font-weight: 400;
    line-height: 1.16;
    letter-spacing: -.025em;
    font-kerning: normal;
  }
  body.today-pilot-active[data-theme] .today-priority-body p,
  body.today-pilot-active[data-theme] .today-priority-meta {
    font-weight: 400;
    line-height: 1.65;
    letter-spacing: .025em;
  }
  body.today-pilot-active[data-theme] .today-next-row strong {
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: .01em;
  }
  body.today-pilot-active[data-theme] .today-next-row small,
  body.today-pilot-active[data-theme] .today-pulse-summary small,
  body.today-pilot-active[data-theme] .today-project-card small {
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: .025em;
  }
  body.today-pilot-active[data-theme] .today-status-card > strong {
    font-family: var(--today-editorial);
    font-weight: 400;
    line-height: .9;
  }
  body.today-pilot-active[data-theme] .today-status-card b,
  body.today-pilot-active[data-theme] .today-automation-card h3 {
    font-weight: 500;
    line-height: 1.45;
    letter-spacing: .01em;
  }
  body.today-pilot-active[data-theme] .today-status-card small {
    font-weight: 400;
    line-height: 1.55;
    letter-spacing: .025em;
  }
  body.today-pilot-active[data-theme] .today-project-strip h3,
  body.today-pilot-active[data-theme] .today-project-card strong,
  body.today-pilot-active[data-theme] .today-next-empty strong {
    font-family: var(--today-editorial);
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: -.015em;
  }
  body.today-pilot-active[data-theme] .chrome-brand strong {
    font-family: var(--today-sans);
    font-weight: 400;
    letter-spacing: -.035em;
  }

  body.today-pilot-active[data-theme] .app-shell {
    grid-template-columns: 104px minmax(0, 1fr);
  }
  body.today-pilot-active[data-theme] .workspace {
    background-image:
      linear-gradient(to right, transparent 18px, rgba(141, 135, 122, .21) 18px, rgba(141, 135, 122, .21) 19px, transparent 19px),
      linear-gradient(to right, transparent 37px, rgba(141, 135, 122, .15) 37px, rgba(141, 135, 122, .15) 38px, transparent 38px),
      linear-gradient(to left, transparent 28px, rgba(141, 135, 122, .15) 28px, rgba(141, 135, 122, .15) 29px, transparent 29px),
      linear-gradient(to left, transparent 48px, rgba(141, 135, 122, .21) 48px, rgba(141, 135, 122, .21) 49px, transparent 49px);
    background-repeat: no-repeat;
    background-size: 100% 100%;
  }
  body.today-pilot-active[data-theme] .sidebar {
    width: 104px;
    padding: 25px 11px 18px;
  }
  body.today-pilot-active[data-theme] .nav-item {
    width: 100%;
    min-height: 66px;
    padding: 7px 4px;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 28px auto;
    gap: 4px;
    place-items: center;
  }
  body.today-pilot-active[data-theme] .nav-icon {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    font-family: "Segoe UI Symbol", "Noto Sans Symbols", sans-serif;
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
  }
  body.today-pilot-active[data-theme] .nav-item b {
    max-width: 68px;
    overflow: hidden;
    font-family: var(--today-sans);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: .08em;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.today-pilot-active[data-theme] .nav-item.is-active::after {
    top: 15px;
    left: 5px;
    width: 6px;
    height: 6px;
  }
}

@media (min-width: 821px) {
  body.today-pilot-active[data-theme] .app-chrome {
    grid-template-columns: minmax(360px, 1fr) auto minmax(360px, 1fr);
  }
  body.today-pilot-active[data-theme] .chrome-signal::after {
    content: attr(data-short-label);
  }
  body.today-pilot-active[data-theme] .chrome-brand strong {
    font-size: 19px;
  }
  body.today-pilot-active[data-theme] .topbar {
    display: none !important;
  }
  body.today-pilot-active[data-theme] .today-top-actions {
    grid-column: 3;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 27px;
    transform: translate(-21px, 5px);
  }
  body.today-pilot-active[data-theme] .today-focus-toggle {
    min-width: 132px;
    height: 34px;
    padding: 0 0 0 15px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 18px;
    color: #3e433c;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: .035em;
  }
  body.today-pilot-active[data-theme] .today-focus-toggle:hover {
    color: var(--jd-ink);
    transform: none;
  }
  body.today-pilot-active[data-theme] .today-focus-toggle i {
    width: 32px;
    height: 17px;
    padding: 2px;
    position: relative;
    display: block;
    border: 1px solid #c8c2b5;
    border-radius: 999px;
    background: #e4e0d6;
  }
  body.today-pilot-active[data-theme] .today-focus-toggle i::after {
    width: 11px;
    height: 11px;
    position: absolute;
    top: 2px;
    left: 2px;
    content: "";
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.14);
    transition: transform .18s ease;
  }
  body.today-pilot-active[data-theme] .today-focus-toggle[aria-pressed="true"] i {
    border-color: #8aac27;
    background: #a8d437;
  }
  body.today-pilot-active[data-theme] .today-focus-toggle[aria-pressed="true"] i::after {
    transform: translateX(15px);
  }
  body.today-pilot-active[data-theme] .today-top-divider {
    width: 1px;
    height: 23px;
    display: block;
    background: #bdb7aa;
  }
  body.today-pilot-active[data-theme] .chrome-review {
    width: 34px;
    height: 34px;
    position: relative;
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
  }
  body.today-pilot-active[data-theme] .chrome-review:hover {
    background: rgba(255,255,255,.45);
    transform: none;
  }
  body.today-pilot-active[data-theme] .chrome-review > span {
    width: 20px;
    height: 22px;
    position: relative;
    font-size: 0;
  }
  body.today-pilot-active[data-theme] .chrome-review > span::before {
    width: 13px;
    height: 14px;
    position: absolute;
    top: 2px;
    left: 3px;
    content: "";
    border: 1.5px solid #20231f;
    border-bottom: 0;
    border-radius: 8px 8px 3px 3px;
  }
  body.today-pilot-active[data-theme] .chrome-review > span::after {
    width: 16px;
    height: 1px;
    position: absolute;
    top: 16px;
    left: 2px;
    content: "";
    background: #20231f;
    box-shadow: 7px 3px 0 -2px #20231f;
  }
  body.today-pilot-active[data-theme] .chrome-review b {
    top: -4px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 3px;
    color: #fff;
    background: var(--jd-green);
    font-size: 11px;
    font-weight: 700;
  }
  body.today-pilot-active[data-theme] .chrome-review.is-clear b {
    width: 6px;
    min-width: 6px;
    height: 6px;
    top: 2px;
    right: 1px;
    padding: 0;
    overflow: hidden;
    color: transparent;
  }
  body.today-pilot-active[data-theme] .today-account-entry {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    color: var(--jd-ink);
    border: 1px solid #85897f;
    border-radius: 50%;
    background: rgba(255,255,255,.28);
    box-shadow: none;
  }
  body.today-pilot-active[data-theme] .today-account-entry:hover {
    border-color: var(--jd-ink);
    background: rgba(255,255,255,.55);
    transform: none;
  }
  body.today-pilot-active[data-theme] .today-account-entry span {
    font-family: var(--today-editorial);
    font-size: 16px;
    font-weight: 400;
    line-height: 1;
  }

  body.today-pilot-active.today-focus-mode[data-theme] .today-pilot-grid {
    width: min(980px, 100%);
    margin-inline: auto;
    display: block;
  }
  body.today-pilot-active.today-focus-mode[data-theme] .today-pilot-main {
    width: 100%;
  }
  body.today-pilot-active.today-focus-mode[data-theme] .today-pilot-rail,
  body.today-pilot-active.today-focus-mode[data-theme] .today-project-strip,
  body.today-pilot-active.today-focus-mode[data-theme] .today-reference-pilot ~ * {
    display: none !important;
  }
}

/* P3 Projects pilot: desktop-only, reference image 2. */
@media (min-width: 821px) {
  body.projects-pilot-active[data-theme] {
    --projects-editorial: "James Editorial CN", "STSong", "Noto Serif SC", "SimSun", serif;
    --projects-sans: "Noto Sans SC", "Microsoft YaHei UI", "DengXian", sans-serif;
    font-family: var(--projects-sans);
    font-synthesis: none;
    text-rendering: optimizeLegibility;
  }
  body.projects-pilot-active[data-theme] button,
  body.projects-pilot-active[data-theme] input,
  body.projects-pilot-active[data-theme] select,
  body.projects-pilot-active[data-theme] textarea {
    font-family: var(--projects-sans);
  }
  body.projects-pilot-active[data-theme] .app-shell {
    grid-template-columns: 96px minmax(0, 1fr);
  }
  body.projects-pilot-active[data-theme] .sidebar {
    width: 96px;
    padding: 25px 11px 18px;
    background: #070907;
  }
  body.projects-pilot-active[data-theme] .nav-item {
    width: 100%;
    min-height: 66px;
    padding: 7px 4px;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 28px auto;
    gap: 4px;
    place-items: center;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  body.projects-pilot-active[data-theme] .nav-icon {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    color: #f3f3ee;
    font-family: "Segoe UI Symbol", "Noto Sans Symbols", sans-serif;
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
  }
  body.projects-pilot-active[data-theme] .nav-item b {
    max-width: 68px;
    overflow: hidden;
    color: #f3f3ee;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: .08em;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.projects-pilot-active[data-theme] .nav-item.is-active .nav-icon,
  body.projects-pilot-active[data-theme] .nav-item.is-active b {
    color: var(--jd-lime);
  }
  body.projects-pilot-active[data-theme] .nav-item.is-active {
    background: transparent;
    box-shadow: none;
  }
  body.projects-pilot-active[data-theme] .nav-item::before {
    display: none !important;
  }
  body.projects-pilot-active[data-theme] .nav-item.is-active::after {
    top: 15px;
    left: 5px;
    width: 6px;
    height: 6px;
    background: var(--jd-lime);
  }

  body.projects-pilot-active[data-theme] .app-chrome {
    grid-template-columns: minmax(300px, 1fr) auto minmax(300px, 1fr);
  }
  body.projects-pilot-active[data-theme] .chrome-signals {
    visibility: hidden;
  }
  body.projects-pilot-active[data-theme] .chrome-brand strong {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-family: var(--projects-editorial);
    font-size: 22px;
    font-weight: 400;
    letter-spacing: -.025em;
  }
  body.projects-pilot-active[data-theme] .chrome-brand strong::before {
    color: #20241f;
    content: "♧";
    font-family: var(--projects-editorial);
    font-weight: 400;
    line-height: 1;
    font-size: 26px;
    transform: rotate(-12deg);
  }
  body.projects-pilot-active[data-theme] .chrome-brand strong::after { display: none; }
  body.projects-pilot-active[data-theme] .topbar {
    display: none !important;
  }
  body.projects-pilot-active[data-theme] .today-top-actions {
    grid-column: 3;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 14px;
  }
  body.projects-pilot-active[data-theme] .today-focus-toggle,
  body.projects-pilot-active[data-theme] .today-top-divider {
    display: none;
  }
  body.projects-pilot-active[data-theme] .chrome-review {
    width: 34px;
    height: 34px;
    position: relative;
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
  }
  body.projects-pilot-active[data-theme] .chrome-review > span {
    width: 20px;
    height: 22px;
    position: relative;
    font-size: 0;
  }
  body.projects-pilot-active[data-theme] .chrome-review > span::before {
    width: 13px;
    height: 14px;
    position: absolute;
    top: 2px;
    left: 3px;
    content: "";
    border: 1.5px solid #20231f;
    border-bottom: 0;
    border-radius: 8px 8px 3px 3px;
  }
  body.projects-pilot-active[data-theme] .chrome-review > span::after {
    width: 16px;
    height: 1px;
    position: absolute;
    top: 16px;
    left: 2px;
    content: "";
    background: #20231f;
    box-shadow: 7px 3px 0 -2px #20231f;
  }
  body.projects-pilot-active[data-theme] .chrome-review b {
    top: -4px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 3px;
    color: #fff;
    background: var(--jd-green);
    font-size: 11px;
    font-weight: 700;
  }
  body.projects-pilot-active[data-theme] .chrome-review.is-clear b {
    width: 6px;
    min-width: 6px;
    height: 6px;
    top: 2px;
    right: 1px;
    padding: 0;
    overflow: hidden;
    color: transparent;
  }
  body.projects-pilot-active[data-theme] .today-account-entry {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    color: var(--jd-ink);
    border: 1px solid #85897f;
    border-radius: 50%;
    background: rgba(255,255,255,.28);
    box-shadow: none;
  }
  body.projects-pilot-active[data-theme] .today-account-entry span {
    font-family: var(--projects-editorial);
    font-size: 16px;
    font-weight: 400;
  }

  body.projects-pilot-active[data-theme] #view-work {
    width: 100%;
    padding: 36px 54px 52px;
  }
  body.projects-pilot-active[data-theme] .projects-pilot-lead {
    padding: 0 0 28px;
  }
  body.projects-pilot-active[data-theme] .projects-pilot-lead .eyebrow {
    display: none;
  }
  body.projects-pilot-active[data-theme] .projects-pilot-lead h2 {
    margin: 0;
    font-family: var(--projects-editorial);
    font-size: clamp(54px, 4vw, 66px);
    font-weight: 350;
    line-height: 1.04;
    letter-spacing: -.035em;
  }
  body.projects-pilot-active[data-theme] .projects-pilot-lead p {
    margin: 12px 0 0;
    color: #666960;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.7;
    letter-spacing: .035em;
  }
  body.projects-pilot-active[data-theme] .projects-toolbar {
    margin-bottom: 24px;
    display: grid;
    grid-template-columns: 164px minmax(280px, 1fr) 142px;
    gap: 12px;
  }
  body.projects-pilot-active[data-theme] .projects-filter,
  body.projects-pilot-active[data-theme] .projects-search {
    min-width: 0;
    height: 48px;
    padding: 0 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--jd-muted);
    border: 1px solid var(--jd-line);
    border-radius: 12px;
    background: rgba(255,255,255,.31);
  }
  body.projects-pilot-active[data-theme] .projects-filter > span,
  body.projects-pilot-active[data-theme] .projects-search > span {
    color: var(--jd-ink);
    font-size: 20px;
    line-height: 1;
  }
  body.projects-pilot-active[data-theme] .projects-filter select,
  body.projects-pilot-active[data-theme] .projects-search input {
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 0;
    color: var(--jd-ink);
    border: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
    font-size: 14px;
  }
  body.projects-pilot-active[data-theme] .projects-search input::placeholder {
    color: #a7a399;
  }
  body.projects-pilot-active[data-theme] .projects-create-button {
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: #1a1d16;
    border: 1px solid #a8ce20;
    border-radius: 12px;
    background: linear-gradient(135deg, #d0fa40, #a8d90c);
    box-shadow: 0 8px 22px rgba(129,165,15,.14);
    font-size: 13px;
    font-weight: 540;
  }
  body.projects-pilot-active[data-theme] .projects-create-button:hover {
    filter: saturate(1.08);
    transform: translateY(-1px);
  }
  body.projects-pilot-active[data-theme] #work-create-panel {
    position: relative;
    z-index: 2;
    top: auto;
    max-height: none;
    margin: -10px 0 24px;
    overflow: visible;
    border: 1px solid var(--jd-line);
    border-radius: 14px;
    background: rgba(255,255,255,.48);
  }
  body.projects-pilot-active[data-theme] #work-create-panel:not([open]) {
    display: none;
  }
  body.projects-pilot-active[data-theme] #work-create-panel > summary {
    min-height: 68px;
    padding: 15px 20px;
  }
  body.projects-pilot-active[data-theme] #work-create-panel .work-form {
    padding: 2px 20px 22px;
  }
  body.projects-pilot-active[data-theme] .projects-pilot-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 326px;
    gap: 28px;
    align-items: stretch;
  }
  body.projects-pilot-active[data-theme] .work-list-panel {
    min-width: 0;
    position: relative;
  }
  body.projects-pilot-active[data-theme] .projects-list-heading {
    min-height: 26px;
    padding: 0 0 8px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #787c73;
    font-size: 13px;
    font-weight: 540;
    letter-spacing: .18em;
  }
  body.projects-pilot-active[data-theme] .projects-list-heading strong {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .04em;
  }
  body.projects-pilot-active[data-theme] .work-list {
    min-height: 496px;
    position: relative;
    display: grid;
    align-content: start;
    gap: 12px;
  }
  body.projects-pilot-active[data-theme] .projects-record {
    min-width: 0;
    position: relative;
    z-index: 1;
    padding-left: 24px;
  }
  body.projects-pilot-active[data-theme] .projects-track-dot {
    width: 10px;
    height: 10px;
    position: absolute;
    z-index: 2;
    top: 34px;
    left: 0;
    border: 2px solid var(--jd-paper);
    border-radius: 50%;
    background: #b9b3a7;
    box-shadow: 0 0 0 1px #c8c1b4;
  }
  body.projects-pilot-active[data-theme] .projects-record.status-green .projects-track-dot { background: var(--jd-green); }
  body.projects-pilot-active[data-theme] .projects-record.status-yellow .projects-track-dot { background: var(--jd-amber); }
  body.projects-pilot-active[data-theme] .projects-record.status-red .projects-track-dot { background: var(--jd-red); }
  body.projects-pilot-active[data-theme] .projects-record-main {
    width: 100%;
    min-height: 78px;
    padding: 12px 15px;
    display: grid;
    grid-template-columns: 48px minmax(110px, 145px) 84px minmax(170px, 1fr) 88px 82px 54px;
    gap: 10px;
    align-items: center;
    color: var(--jd-ink);
    border: 1px solid var(--jd-line);
    border-radius: 13px;
    background: rgba(255,255,255,.28);
    box-shadow: none;
    text-align: left;
  }
  body.projects-pilot-active[data-theme] .projects-record-main:hover {
    border-color: var(--jd-line-strong);
    background: rgba(255,255,255,.52);
    transform: translateX(2px);
  }
  body.projects-pilot-active[data-theme] .projects-record-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    color: #fff;
    border-radius: 50%;
    background: linear-gradient(145deg, #a9d81b, #77a311);
    font-family: var(--projects-editorial);
    font-size: 20px;
    font-weight: 400;
  }
  body.projects-pilot-active[data-theme] .projects-record.status-yellow .projects-record-icon {
    background: linear-gradient(145deg, #f2b329, #d88a00);
  }
  body.projects-pilot-active[data-theme] .projects-record.status-red .projects-record-icon {
    background: linear-gradient(145deg, #f6665c, #d93631);
  }
  body.projects-pilot-active[data-theme] .projects-record-project {
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.projects-pilot-active[data-theme] .projects-record-type,
  body.projects-pilot-active[data-theme] .projects-record-status {
    width: fit-content;
    max-width: 100%;
    padding: 5px 9px;
    overflow: hidden;
    border: 1px solid #d9d2c4;
    border-radius: 999px;
    color: #5f625b;
    background: rgba(255,255,255,.38);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.projects-pilot-active[data-theme] .projects-record-copy {
    min-width: 0;
  }
  body.projects-pilot-active[data-theme] .projects-record-copy strong {
    display: block;
    overflow: hidden;
    font-family: var(--projects-editorial);
    font-size: 16px;
    font-weight: 450;
    line-height: 1.25;
    letter-spacing: -.012em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.projects-pilot-active[data-theme] .projects-record-copy small {
    display: block;
    margin-top: 5px;
    overflow: hidden;
    color: var(--jd-muted);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.projects-pilot-active[data-theme] .projects-record-status.status-green {
    color: #587c16;
    border-color: #c8d7aa;
    background: #f4f9e8;
  }
  body.projects-pilot-active[data-theme] .projects-record-status.status-yellow {
    color: #9b6b04;
    border-color: #ead8ab;
    background: #fff8e5;
  }
  body.projects-pilot-active[data-theme] .projects-record-status.status-red {
    color: #c33e35;
    border-color: #efc0ba;
    background: #fff1ef;
  }
  body.projects-pilot-active[data-theme] .projects-record-main time {
    color: #6d7068;
    font-size: 14px;
    text-align: center;
  }
  body.projects-pilot-active[data-theme] .projects-record-main time.is-overdue {
    color: #b53b33;
    font-weight: 650;
  }
  body.projects-pilot-active[data-theme] .projects-record-open {
    color: #32352f;
    font-size: 14px;
    text-align: right;
  }
  body.projects-pilot-active[data-theme] .projects-empty-timeline {
    min-height: 260px;
    margin-left: 24px;
    padding: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 17px;
    color: #7a7d74;
    border: 1px solid var(--jd-line);
    border-radius: 14px;
    background: rgba(255,255,255,.2);
    text-align: left;
  }
  body.projects-pilot-active[data-theme] .projects-empty-timeline > span {
    font-family: var(--projects-editorial);
    font-size: 48px;
    font-weight: 300;
  }
  body.projects-pilot-active[data-theme] .projects-empty-timeline strong {
    color: #4d514a;
    font-family: var(--projects-editorial);
    font-size: 20px;
    font-weight: 400;
  }
  body.projects-pilot-active[data-theme] .projects-empty-timeline p {
    margin: 6px 0 0;
    font-size: 14px;
    line-height: 1.6;
  }
  body.projects-pilot-active[data-theme] .projects-health-panel {
    min-height: 522px;
    padding: 22px 20px 18px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--jd-line);
    border-radius: 14px;
    background: rgba(255,255,255,.26);
  }
  body.projects-pilot-active[data-theme] .projects-health-heading {
    padding-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--jd-line);
  }
  body.projects-pilot-active[data-theme] .projects-health-heading > div {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  body.projects-pilot-active[data-theme] .projects-health-heading h3 {
    margin: 0;
    font-family: var(--projects-editorial);
    font-size: 18px;
    font-weight: 450;
  }
  body.projects-pilot-active[data-theme] .projects-health-heading button,
  body.projects-pilot-active[data-theme] .projects-health-reminder button {
    padding: 0;
    color: #719715;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-size: 13px;
  }
  body.projects-pilot-active[data-theme] .projects-health-overall {
    padding: 20px 0 18px;
    display: grid;
    gap: 7px;
    border-bottom: 1px solid var(--jd-line);
  }
  body.projects-pilot-active[data-theme] .projects-health-overall > span {
    color: #70746b;
    font-size: 14px;
  }
  body.projects-pilot-active[data-theme] .projects-health-overall > strong {
    font-family: var(--projects-editorial);
    font-size: 34px;
    font-weight: 350;
    line-height: 1;
  }
  body.projects-pilot-active[data-theme] .projects-health-overall > i,
  body.projects-pilot-active[data-theme] .projects-health-row > i,
  body.projects-pilot-active[data-theme] .projects-health-overall > progress,
  body.projects-pilot-active[data-theme] .projects-health-row > progress {
    width: 100%;
    height: 6px;
    display: block;
    overflow: hidden;
    appearance: none;
    border: 0;
    border-radius: 999px;
    background: #ece7da;
  }
  body.projects-pilot-active[data-theme] .projects-health-overall > progress::-webkit-progress-bar,
  body.projects-pilot-active[data-theme] .projects-health-row > progress::-webkit-progress-bar {
    border-radius: inherit;
    background: #ece7da;
  }
  body.projects-pilot-active[data-theme] .projects-health-overall > progress::-webkit-progress-value,
  body.projects-pilot-active[data-theme] .projects-health-row > progress::-webkit-progress-value {
    border-radius: inherit;
    background: linear-gradient(90deg, #81ad13, #b2df21);
  }
  body.projects-pilot-active[data-theme] .projects-health-overall > progress::-moz-progress-bar,
  body.projects-pilot-active[data-theme] .projects-health-row > progress::-moz-progress-bar {
    border-radius: inherit;
    background: linear-gradient(90deg, #81ad13, #b2df21);
  }
  body.projects-pilot-active[data-theme] .projects-health-overall > i b,
  body.projects-pilot-active[data-theme] .projects-health-row > i b {
    height: 100%;
    display: block;
    border-radius: inherit;
    background: linear-gradient(90deg, #81ad13, #b2df21);
  }
  body.projects-pilot-active[data-theme] .projects-health-overall small {
    color: #8b8e85;
    font-size: 11px;
  }
  body.projects-pilot-active[data-theme] .projects-health-list {
    display: grid;
  }
  body.projects-pilot-active[data-theme] .projects-health-row {
    padding: 15px 0;
    display: grid;
    gap: 7px;
    border-bottom: 1px solid rgba(221,214,200,.72);
  }
  body.projects-pilot-active[data-theme] .projects-health-row > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  body.projects-pilot-active[data-theme] .projects-health-row strong {
    overflow: hidden;
    font-size: 14px;
    font-weight: 540;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.projects-pilot-active[data-theme] .projects-health-row span {
    color: #696c65;
    font-family: var(--projects-editorial);
    font-size: 16px;
  }
  body.projects-pilot-active[data-theme] .projects-health-row small {
    color: #7b7f76;
    font-size: 11px;
  }
  body.projects-pilot-active[data-theme] .projects-health-row.tone-yellow > i b { background: var(--jd-amber); }
  body.projects-pilot-active[data-theme] .projects-health-row.tone-red > i b { background: var(--jd-red); }
  body.projects-pilot-active[data-theme] .projects-health-row.tone-yellow > progress::-webkit-progress-value { background: var(--jd-amber); }
  body.projects-pilot-active[data-theme] .projects-health-row.tone-red > progress::-webkit-progress-value { background: var(--jd-red); }
  body.projects-pilot-active[data-theme] .projects-health-row.tone-yellow > progress::-moz-progress-bar { background: var(--jd-amber); }
  body.projects-pilot-active[data-theme] .projects-health-row.tone-red > progress::-moz-progress-bar { background: var(--jd-red); }
  body.projects-pilot-active[data-theme] .projects-health-empty {
    margin: 0;
    padding: 28px 0;
    color: #8a8d85;
    font-size: 14px;
    line-height: 1.6;
  }
  body.projects-pilot-active[data-theme] .projects-health-reminder {
    margin-top: auto;
    padding: 14px;
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 7px 9px;
    border: 1px solid var(--jd-line);
    border-radius: 11px;
    background: rgba(255,255,255,.24);
  }
  body.projects-pilot-active[data-theme] .projects-health-reminder.has-overdue {
    border-color: #e4c98c;
    background: #fff7df;
  }
  body.projects-pilot-active[data-theme] .projects-health-reminder > span {
    color: var(--jd-amber);
    font-size: 20px;
  }
  body.projects-pilot-active[data-theme] .projects-health-reminder strong {
    font-size: 13px;
    font-weight: 540;
  }
  body.projects-pilot-active[data-theme] .projects-health-reminder p {
    margin: 4px 0 0;
    color: #7a7e75;
    font-size: 11px;
    line-height: 1.5;
  }
  body.projects-pilot-active[data-theme] .projects-health-reminder button {
    grid-column: 2;
    justify-self: end;
  }
}

/* P3 reference rail and calibrated desktop palette.
 * The original navigation remains untouched for mobile and non-reference views.
 */
@media (min-width: 821px) {
  body:is(.today-pilot-active, .projects-pilot-active)[data-theme] {
    --jd-paper: #f8f4e9;
    --jd-line: #ded8cb;
    --jd-line-strong: #cbc4b5;
    --jd-lime: #c0d50c;
    --jd-green: #96aa21;
    --jd-amber: #e9b00a;
    --jd-red: #dd473b;
    background:
      radial-gradient(circle at 28% 4%, rgba(255,255,255,.62), transparent 34%),
      radial-gradient(circle at 88% 22%, rgba(226,215,187,.16), transparent 31%),
      var(--jd-paper);
  }
  body:is(.today-pilot-active, .projects-pilot-active)[data-theme] .workspace-header {
    background: rgba(248, 244, 233, .94);
  }
  body:is(.today-pilot-active, .projects-pilot-active)[data-theme] .sidebar {
    position: sticky;
    background:
      radial-gradient(circle at 52% 7%, rgba(255,255,255,.025), transparent 27%),
      linear-gradient(180deg, #030403, #010201);
  }
  body.today-pilot-active[data-theme] .today-status-card.tone-ink {
    background: rgba(255,255,255,.28);
  }
  body.today-pilot-active[data-theme] .today-status-card:not(.tone-ink):not(.tone-red) {
    background: rgba(255,255,255,.28);
  }
  body.today-pilot-active[data-theme] .today-status-card.tone-red {
    background: rgba(255,255,255,.28);
  }
  body.today-pilot-active[data-theme] .today-priority-card::before {
    background: linear-gradient(180deg, #b8d507, #9fc000);
  }
  body:not(.model-switch-visible)[data-theme] .topbar .model-picker {
    display: none !important;
  }
  body.model-switch-visible:not(.today-pilot-active)[data-theme] .topbar .model-picker {
    min-width: 132px;
    min-height: 34px;
    padding: 3px 5px 3px 10px;
    border: 1px solid #cfc8bb;
    border-radius: 3px;
    background: rgba(250,247,238,.78);
    box-shadow: none;
  }
  body.model-switch-visible:not(.today-pilot-active)[data-theme] .topbar .model-picker > span {
    color: #74786f;
    font-family: var(--jd-ui);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .12em;
  }
  body.model-switch-visible:not(.today-pilot-active)[data-theme] .topbar .model-picker select {
    min-width: 78px;
    padding: 5px 22px 5px 7px;
    color: #252822;
    background-color: transparent;
    font-size: 14px;
    font-weight: 500;
  }
  body.today-pilot-active[data-theme] .today-model-picker {
    min-width: 112px;
    height: 32px;
    padding: 2px 4px 2px 9px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 5px;
    align-items: center;
    color: #363a34;
    border: 1px solid #cec7ba;
    border-radius: 3px;
    background: rgba(250,247,238,.72);
  }
  body.today-pilot-active[data-theme] .today-model-picker > span {
    color: #777b72;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .08em;
  }
  body.today-pilot-active[data-theme] .today-model-picker select {
    width: 100%;
    min-width: 0;
    padding: 4px 18px 4px 4px;
    color: #252822;
    border: 0;
    outline: 0;
    background-color: transparent;
    font-size: 13px;
    font-weight: 500;
  }
  body.today-pilot-active[data-theme] .today-model-picker:focus-within,
  body.model-switch-visible:not(.today-pilot-active)[data-theme] .topbar .model-picker:focus-within {
    border-color: #94a623;
    box-shadow: 0 0 0 2px rgba(150,170,33,.12);
  }
}

/* P3 shared reference shell for every remaining desktop route.
 * The selectors deliberately exclude the two already calibrated direct-reference pilots.
 */
@media (min-width: 821px) {
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] {
    --reference-editorial: "James Editorial CN", "STSong", "Noto Serif SC", "SimSun", serif;
    --reference-sans: "Noto Sans SC", "Microsoft YaHei UI", "DengXian", sans-serif;
    --jd-paper: #f8f4e9;
    --jd-line: #ded8cb;
    --jd-line-strong: #cbc4b5;
    --jd-lime: #c0d50c;
    --jd-green: #96aa21;
    --jd-amber: #e9b00a;
    --jd-red: #dd473b;
    min-width: 1040px;
    font-family: var(--reference-sans);
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    background:
      radial-gradient(circle at 28% 4%, rgba(255,255,255,.62), transparent 34%),
      radial-gradient(circle at 88% 22%, rgba(226,215,187,.16), transparent 31%),
      var(--jd-paper);
  }
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] button,
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] input,
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] select,
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] textarea {
    font-family: var(--reference-sans);
  }
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .app-shell {
    grid-template-columns: 96px minmax(0, 1fr);
  }
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .sidebar {
    position: sticky;
    width: 96px;
    padding: 25px 11px 18px;
    overflow: hidden;
    background:
      radial-gradient(circle at 52% 7%, rgba(255,255,255,.025), transparent 27%),
      linear-gradient(180deg, #030403, #010201);
  }

  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .workspace-header {
    height: 78px;
    min-height: 78px;
    border-bottom: 1px solid var(--jd-line);
    background: rgba(248,244,233,.94);
    backdrop-filter: blur(18px);
  }
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .app-chrome {
    min-height: 78px;
    padding: 0 54px 0 48px;
    grid-template-columns: minmax(310px, 1fr) auto minmax(310px, 1fr);
  }
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .chrome-signals {
    display: flex;
    gap: 28px;
    align-items: center;
  }
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .chrome-signal {
    width: auto;
    height: 24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #454942;
    border: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
  }
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .chrome-signal::before {
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    content: "";
    border-radius: 50%;
    background: var(--jd-green);
    box-shadow: 0 0 0 1px rgba(0,0,0,.06);
  }
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] #chrome-alert-signal.is-active::before {
    background: var(--jd-red);
  }
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] #chrome-review-signal::before {
    background: #d5d0c1;
  }
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] #chrome-review-signal.is-active::before {
    background: var(--jd-amber);
  }
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .chrome-signal::after {
    max-width: 132px;
    overflow: hidden;
    content: attr(data-short-label);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .01em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .chrome-brand {
    grid-column: 2;
    color: var(--jd-ink);
  }
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .chrome-brand strong {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--jd-ink);
    font: 400 22px/1 var(--reference-editorial);
    letter-spacing: -.025em;
  }
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .chrome-brand-sprout {
    width: 24px;
    height: 27px;
    overflow: visible;
    fill: none;
    stroke: #20241f;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.3;
  }
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .chrome-brand strong::before,
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .chrome-brand strong::after {
    display: none;
  }
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .today-top-actions {
    grid-column: 3;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 14px;
  }
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .today-focus-toggle,
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .today-top-divider,
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .today-model-picker {
    display: none;
  }
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .chrome-review {
    position: relative;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .chrome-review > span {
    width: 20px;
    height: 22px;
    position: relative;
    color: transparent;
    font-size: 0;
  }
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .chrome-review > span::before {
    width: 13px;
    height: 14px;
    position: absolute;
    top: 2px;
    left: 3px;
    content: "";
    border: 1.5px solid #20231f;
    border-bottom: 0;
    border-radius: 8px 8px 3px 3px;
  }
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .chrome-review > span::after {
    width: 16px;
    height: 1px;
    position: absolute;
    top: 16px;
    left: 2px;
    content: "";
    background: #20231f;
    box-shadow: 7px 3px 0 -2px #20231f;
  }
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .chrome-review b {
    top: -4px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 3px;
    color: #fff;
    background: var(--jd-green);
    font-size: 11px;
    font-weight: 700;
  }
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .chrome-review.is-clear b {
    width: 6px;
    min-width: 6px;
    height: 6px;
    top: 2px;
    right: 1px;
    padding: 0;
    overflow: hidden;
    color: transparent;
  }
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .today-account-entry {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    color: var(--jd-ink);
    border: 1px solid #85897f;
    border-radius: 50%;
    background: rgba(255,255,255,.28);
    box-shadow: none;
  }
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .today-account-entry span {
    font-family: var(--reference-editorial);
    font-size: 16px;
    font-weight: 400;
  }
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .topbar {
    display: none;
  }
  body.desktop-reference-active.chat-reference-active.model-switch-visible[data-theme] .topbar {
    position: absolute;
    z-index: 45;
    top: 22px;
    right: 154px;
    min-height: 34px;
    display: flex !important;
    padding: 0;
    border: 0;
    background: transparent;
  }
  body.desktop-reference-active.chat-reference-active.model-switch-visible[data-theme] .topbar-title,
  body.desktop-reference-active.chat-reference-active.model-switch-visible[data-theme] .install-app,
  body.desktop-reference-active.chat-reference-active.model-switch-visible[data-theme] .status-cluster {
    display: none !important;
  }

  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .view {
    width: min(100%, 1440px);
    padding: 38px 52px 64px;
  }
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .page-lead {
    padding: 4px 0 28px;
  }
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .page-lead h2,
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .chat-intro h2 {
    margin: 12px 0 10px;
    font-family: var(--reference-editorial);
    font-size: clamp(44px, 4.1vw, 62px);
    font-weight: 350;
    line-height: 1.05;
    letter-spacing: -.035em;
  }
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .page-lead p,
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .chat-intro p {
    color: #686d65;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.75;
    letter-spacing: .025em;
  }
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .summer-sheet,
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .integration-card,
  body.desktop-reference-active:not(.today-pilot-active):not(.projects-pilot-active)[data-theme] .automation-card {
    border: 1px solid var(--jd-line);
    border-radius: 4px;
    background: rgba(255,255,255,.28);
    box-shadow: 0 14px 34px rgba(30,31,24,.035);
    backdrop-filter: none;
  }
}

/* P3 Meetings / action confirmation: direct reference image 3. */
@media (min-width: 821px) {
  body.meetings-reference-active[data-theme] #view-meetings {
    position: relative;
    width: 100%;
    max-width: none;
    min-height: calc(100vh - 78px);
    padding: 0;
    display: grid;
    grid-template-columns: 0 minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    gap: 0;
    transition: grid-template-columns .2s ease;
  }
  body.meetings-reference-active[data-theme] #view-meetings.meeting-index-open {
    grid-template-columns: 394px minmax(0, 1fr);
  }
  body.meetings-reference-active[data-theme] #view-meetings:not(.meeting-index-open) .meeting-page-lead,
  body.meetings-reference-active[data-theme] #view-meetings:not(.meeting-index-open) .meeting-index-panel {
    width: 0;
    min-width: 0;
    padding-right: 0;
    padding-left: 0;
    overflow: hidden;
    visibility: hidden !important;
    opacity: 0;
    border-right-color: transparent;
    pointer-events: none !important;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-page-lead {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    padding: 41px 34px 25px 46px;
    border-right: 1px solid var(--jd-line);
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-page-lead .eyebrow {
    display: none;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-page-lead h2 {
    margin: 0 0 15px;
    font-family: var(--reference-editorial);
    font-size: 35px;
    font-weight: 420;
    line-height: 1.15;
    letter-spacing: -.03em;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-page-lead p {
    max-width: 310px;
    margin: 0;
    color: #70746c;
    font-size: 14px;
    line-height: 1.75;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-layout {
    display: contents;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-index-panel {
    position: static !important;
    grid-column: 1;
    grid-row: 2;
    width: auto;
    height: auto;
    min-height: 0;
    max-height: none;
    padding: 7px 34px 46px 46px;
    overflow: visible;
    visibility: visible !important;
    border: 0;
    border-right: 1px solid var(--jd-line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transform: none !important;
    pointer-events: auto !important;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-index-panel > .section-heading {
    min-height: 26px;
    margin: 0 0 9px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-index-panel > .section-heading .eyebrow,
  body.meetings-reference-active[data-theme] #view-meetings .meeting-index-panel > .section-heading h3 {
    display: none;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-count {
    display: none;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-index-close {
    display: none;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-list {
    display: grid;
    gap: 19px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-list-group {
    display: grid;
    gap: 8px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-list-group h4 {
    margin: 0;
    color: #74786f;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-list-item {
    width: 100%;
    min-height: 74px;
    padding: 9px 13px;
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr) 18px;
    gap: 13px;
    align-items: center;
    color: var(--jd-ink);
    text-align: left;
    border: 1px solid var(--jd-line);
    border-radius: 4px;
    background: rgba(255,255,255,.24);
    box-shadow: none;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-list-item:hover {
    border-color: var(--jd-line-strong);
    background: rgba(255,255,255,.42);
    transform: none;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-list-item.is-active {
    border-color: #aed01a;
    background: rgba(200,213,12,.055);
    box-shadow: inset 0 0 0 1px rgba(192,213,12,.08);
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-list-date {
    min-height: 48px;
    padding-right: 11px;
    display: grid;
    align-content: center;
    gap: 4px;
    border-right: 1px solid var(--jd-line);
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-list-date b {
    color: #5e625b;
    font-size: 13px;
    font-weight: 500;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-list-date small {
    color: #777b73;
    font-size: 13px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-list-copy {
    min-width: 0;
    display: block;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-list-copy strong {
    margin: 0;
    display: block;
    overflow: hidden;
    font-family: var(--reference-editorial);
    font-size: 16px;
    font-weight: 430;
    line-height: 1.4;
    letter-spacing: -.01em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-list-copy small {
    margin-top: 5px;
    display: block;
    overflow: hidden;
    color: #777b73;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-list-arrow {
    color: #4b4f49;
    font-family: var(--reference-editorial);
    font-size: 23px;
    line-height: 1;
  }

  body.meetings-reference-active[data-theme] #view-meetings .meeting-detail {
    grid-column: 1 / -1;
    grid-row: 1 / span 2;
    min-width: 0;
    min-height: calc(100vh - 78px);
    padding: 39px 88px 54px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  body.meetings-reference-active[data-theme] #view-meetings.meeting-index-open .meeting-detail {
    grid-column: 2;
    padding: 39px 62px 54px 45px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-detail > .empty-note {
    min-height: 640px;
    display: grid;
    place-items: center;
    color: #8a8e85;
    border: 1px solid var(--jd-line);
    background: rgba(255,255,255,.18);
  }

  body.meetings-reference-active[data-theme] #view-meetings .meeting-empty-state {
    width: min(620px, 100%);
    margin: clamp(70px, 13vh, 128px) auto 0;
    padding: 38px 40px;
    color: var(--p4-ink);
    border: 1px solid var(--p4-line);
    border-radius: 14px;
    background: var(--p4-surface);
    box-shadow: 0 18px 48px rgba(31, 50, 40, .05);
  }

  body.meetings-reference-active[data-theme] #view-meetings .meeting-empty-state h3 {
    margin: 14px 0 9px;
    font: 560 31px/1.2 var(--p4-editorial);
    letter-spacing: -.025em;
  }

  body.meetings-reference-active[data-theme] #view-meetings .meeting-empty-state > p {
    max-width: 480px;
    margin: 0;
    color: var(--p4-text-2);
    font-size: 13px;
    line-height: 1.75;
  }

  body.meetings-reference-active[data-theme] #view-meetings .meeting-empty-state ul {
    margin: 25px 0;
    padding: 0;
    display: grid;
    gap: 11px;
    list-style: none;
  }

  body.meetings-reference-active[data-theme] #view-meetings .meeting-empty-state li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--p4-text-2);
    font-size: 12px;
  }

  body.meetings-reference-active[data-theme] #view-meetings .meeting-empty-state li i {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: var(--p4-accent);
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-hero {
    padding: 0 0 25px;
    color: var(--jd-ink);
    border-bottom: 1px solid var(--jd-line);
    background: transparent;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-hero-project {
    width: fit-content;
    min-height: 42px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #242720;
    border: 1px solid var(--jd-line);
    border-radius: 5px;
    background: rgba(255,255,255,.3);
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-hero-project > span {
    color: var(--jd-lime);
    font-size: 20px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-hero-project strong {
    font-size: 13px;
    font-weight: 520;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-hero h2 {
    margin: 19px 0 16px;
    color: #0d0f0c;
    font-family: var(--reference-editorial);
    font-size: 31px;
    font-weight: 430;
    line-height: 1.18;
    letter-spacing: -.025em;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-hero-summary {
    max-width: 920px;
    margin: -5px 0 17px;
    color: #4f554d;
    font-size: 15px;
    line-height: 1.8;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-hero-meta {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    color: #6f736b;
    background: transparent;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-hero-meta > div {
    padding: 0 18px;
    display: flex;
    align-items: center;
    gap: 5px;
    border-right: 1px solid var(--jd-line);
    background: transparent;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-hero-meta > div:first-child {
    padding-left: 0;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-hero-meta > div:last-child {
    border-right: 0;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-hero-meta dt,
  body.meetings-reference-active[data-theme] #view-meetings .meeting-hero-meta dd {
    margin: 0;
    font-size: 14px;
    font-weight: 400;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-reference-highlights,
  body.meetings-reference-active[data-theme] #view-meetings .meeting-reference-actions {
    padding-top: 22px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-reference-heading {
    min-height: 25px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-reference-heading h3 {
    margin: 0;
    font-family: var(--reference-editorial);
    font-size: 20px;
    font-weight: 450;
    line-height: 1.3;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-reference-heading h3 span {
    color: #73776f;
    font-family: var(--reference-sans);
    font-size: 14px;
    font-weight: 400;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-reference-highlights ol {
    margin: 0;
    padding: 0;
    display: grid;
    gap: 5px;
    counter-reset: meeting-highlight;
    list-style: none;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-reference-highlights li {
    min-height: 36px;
    padding-left: 42px;
    position: relative;
    display: grid;
    align-content: center;
    color: #242720;
    font-size: 14px;
    line-height: 1.65;
    counter-increment: meeting-highlight;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-reference-highlights li::before {
    position: absolute;
    top: 3px;
    left: 0;
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    color: #22251f;
    border-radius: 50%;
    background: #e9e5dc;
    content: counter(meeting-highlight);
    font-family: var(--reference-editorial);
    font-size: 13px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-reference-highlights li small {
    color: #777b73;
    font-size: 14px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-action-filters {
    display: flex;
    gap: 4px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-action-filters button {
    min-height: 29px;
    padding: 0 10px;
    color: #6f736b;
    border: 1px solid var(--jd-line);
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
    font-size: 13px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-action-filters button.is-active {
    color: #283000;
    border-color: #bccd6d;
    background: #eef1cf;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-action-list {
    display: grid;
    gap: 7px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-action-row {
    overflow: hidden;
    border: 1px solid var(--jd-line);
    border-radius: 5px;
    background: rgba(255,255,255,.27);
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-action-main {
    min-height: 72px;
    padding: 9px 10px 9px 13px;
    display: grid;
    grid-template-columns: 24px 20px minmax(170px, 1fr) 112px 70px 132px;
    gap: 9px;
    align-items: center;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-select {
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-select input {
    width: 17px;
    height: 17px;
    margin: 0;
    appearance: none;
    border: 1px solid #a9ada4;
    border-radius: 50%;
    background: transparent;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-select input:checked {
    border-color: #88a814;
    background: radial-gradient(circle, #9dbd1c 0 4px, transparent 5px);
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-linked-mark {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    color: #fff;
    border-radius: 50%;
    background: var(--jd-green);
    font-size: 13px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-action-index {
    color: #343831;
    font-family: var(--reference-editorial);
    font-size: 15px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-action-copy {
    min-width: 0;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-action-copy strong {
    display: block;
    overflow: hidden;
    font-size: 14px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-action-copy small {
    margin-top: 3px;
    display: block;
    overflow: hidden;
    color: #81857c;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-action-owner {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-action-owner small {
    color: #767a72;
    font-size: 13px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-action-owner strong {
    overflow: hidden;
    font-size: 14px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-action-status {
    color: #767a72;
    font-size: 14px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-action-confirm {
    min-height: 36px;
    padding: 0 11px;
    color: #1b2100;
    border: 1px solid #a8c92d;
    border-radius: 4px;
    background: linear-gradient(135deg, #d3f246, #b4d914);
    box-shadow: none;
    font-size: 14px;
    font-weight: 520;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-action-confirm.is-linked {
    color: #343831;
    border-color: var(--jd-line-strong);
    background: rgba(255,255,255,.32);
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-action-row > details {
    border-top: 1px solid var(--jd-line);
    background: rgba(255,255,255,.18);
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-action-row > details > summary {
    padding: 8px 14px;
    color: #70746c;
    font-size: 13px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-action-row > details > :not(summary) {
    margin-right: 14px;
    margin-left: 14px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-confirm-bar {
    margin-top: 8px;
    padding: 9px 0 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    border: 0;
    background: transparent;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-confirm-bar span {
    color: #777b73;
    font-size: 13px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-confirm-bar .primary-button {
    min-height: 36px;
    box-shadow: none;
    font-size: 14px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-data-display,
  body.meetings-reference-active[data-theme] #view-meetings .meeting-context-display {
    margin-top: 29px;
    padding-top: 24px;
    border-top: 1px solid var(--jd-line);
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-supporting-heading {
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px 14px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-supporting-heading .eyebrow {
    width: 100%;
    color: #7a7e76;
    font-size: 13px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-supporting-heading h3 {
    margin: 0;
    font-family: var(--reference-editorial);
    font-size: 20px;
    font-weight: 450;
    line-height: 1.3;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-supporting-heading small {
    color: #747970;
    font-size: 14px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    border: 0;
    background: transparent;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-metrics article {
    min-height: 106px;
    padding: 15px;
    border: 1px solid var(--jd-line);
    border-top: 1px solid #98a09a;
    border-radius: 4px;
    background: rgba(255,255,255,.28);
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-metrics article.tone-risk { border-top-color: var(--jd-red); }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-metrics article.tone-pending { border-top-color: var(--jd-amber); }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-metrics article.tone-good { border-top-color: var(--jd-green); }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-metrics span {
    color: #70766d;
    font-size: 14px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-metrics strong {
    margin: 9px 0;
    font-family: var(--reference-editorial);
    font-size: 26px;
    font-weight: 450;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-metrics small {
    color: #5f655c;
    font-size: 14px;
    line-height: 1.55;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-block {
    padding: 24px 0;
    border-bottom: 1px solid var(--jd-line);
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-block-head {
    margin-bottom: 15px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-block-head h3 {
    margin: 4px 0;
    font-family: var(--reference-editorial);
    font-size: 20px;
    font-weight: 450;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-timeline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 7px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-timeline article {
    min-height: 118px;
    padding: 16px 13px;
    border: 1px solid var(--jd-line);
    border-top: 1px solid #9ea39b;
    border-radius: 4px;
    background: rgba(255,255,255,.22);
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-timeline article::before {
    display: none;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-timeline time {
    color: #767b72;
    font: 600 13px/1 var(--jd-mono);
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-timeline strong {
    margin: 15px 0 8px;
    font-size: 15px;
    font-weight: 600;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-timeline small {
    color: #62685f;
    font-size: 14px;
    line-height: 1.55;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-matrix-scroll {
    border: 1px solid var(--jd-line-strong);
    border-radius: 4px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-matrix th {
    color: #f8f4e9;
    background: #171a16;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-matrix th,
  body.meetings-reference-active[data-theme] #view-meetings .meeting-matrix td {
    padding: 11px 12px;
    border-color: var(--jd-line);
    font-size: 13px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-matrix tbody tr:nth-child(even) {
    background: rgba(237,234,223,.62);
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-note {
    font-size: 13px;
    line-height: 1.7;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-context-block {
    padding-top: 0;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-context-block .meeting-item-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-item {
    padding: 17px;
    border: 1px solid var(--jd-line);
    border-left: 3px solid #858b82;
    border-radius: 4px;
    background: rgba(255,255,255,.28);
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-item.kind-decision { border-left-color: var(--jd-amber); }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-item.kind-risk { border-left-color: var(--jd-red); }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-item h4 {
    margin: 10px 0 7px;
    font-size: 16px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-item > p {
    color: #343934;
    font-size: 14px;
    line-height: 1.75;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-item-meta {
    color: #747970;
    font-size: 13px;
    line-height: 1.55;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-source {
    margin: 18px 0 0;
    overflow: hidden;
    border: 1px solid var(--jd-line);
    border-radius: 4px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-source summary {
    padding: 13px 15px;
    color: #4f554d;
    background: rgba(238,235,225,.68);
    font-size: 13px;
  }
  body.meetings-reference-active[data-theme] .meeting-index-toggle {
    position: absolute;
    z-index: 12;
    top: 40px;
    left: 18px;
    width: 40px;
    min-width: 40px;
    min-height: 34px;
    padding: 6px;
    display: inline-grid;
    grid-template-columns: 1fr;
    align-items: center;
    gap: 7px;
    color: #555b52;
    border: 1px solid #aeb3a8;
    border-radius: 999px;
    background: #faf7ef;
    box-shadow: 0 6px 20px rgba(31, 34, 27, .06);
    font-size: 12px;
    font-weight: 620;
    transition: left .2s ease, border-color .15s ease, background .15s ease;
  }
  body.meetings-reference-active[data-theme] #view-meetings.meeting-index-open .meeting-index-toggle {
    left: 376px;
    width: auto;
    min-width: 84px;
    padding: 7px 11px;
    grid-template-columns: auto auto;
    transform: translateX(-50%);
  }
  body.meetings-reference-active[data-theme] .meeting-index-toggle:hover {
    border-color: #878e82;
    background: #fffdf8;
    transform: none;
  }
  body.meetings-reference-active[data-theme] #view-meetings.meeting-index-open .meeting-index-toggle:hover {
    transform: translateX(-50%);
  }
  body.meetings-reference-active[data-theme] .meeting-index-toggle i {
    color: #769b10;
    font-size: 15px;
    font-style: normal;
  }
  body.meetings-reference-active[data-theme] .meeting-index-context {
    margin-top: 22px;
    padding-top: 17px;
    display: grid;
    gap: 11px;
    border-top: 1px solid var(--jd-line);
  }
  body.meetings-reference-active[data-theme] .meeting-index-context > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  body.meetings-reference-active[data-theme] .meeting-index-context article {
    padding: 11px;
    border: 1px solid var(--jd-line);
    background: rgba(255,255,255,.22);
  }
  body.meetings-reference-active[data-theme] .meeting-index-context strong,
  body.meetings-reference-active[data-theme] .meeting-index-context small {
    display: block;
  }
  body.meetings-reference-active[data-theme] .meeting-index-context small {
    margin-top: 3px;
    color: #747a71;
    font-size: 12px;
  }
  body.meetings-reference-active[data-theme] .meeting-index-context > button {
    min-height: 36px;
    color: #4d534b;
    border: 1px solid #b5b9af;
    background: transparent;
    box-shadow: none;
  }
  body.meetings-reference-active[data-theme] .meeting-cockpit-toolbar {
    display: none;
  }
}

/* P3 Automation / connections: direct reference image 4. */
@media (min-width: 821px) {
  body.automation-reference-active[data-theme] #view-automation {
    width: 100%;
    max-width: none;
    padding: 31px 54px 60px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-lead {
    padding: 0 0 23px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-lead .eyebrow {
    display: none;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-lead h2 {
    margin: 0 0 7px;
    font-family: var(--reference-editorial);
    font-size: 42px;
    font-weight: 410;
    line-height: 1.08;
    letter-spacing: -.03em;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-lead p {
    margin: 0;
    color: #70746c;
    font-size: 13px;
    line-height: 1.6;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-now {
    margin: 0 0 22px;
    padding: 0;
    color: var(--jd-ink);
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-reference-overview {
    display: grid;
    grid-template-columns: minmax(360px, .9fr) minmax(520px, 1.35fr);
    gap: 22px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-reference-brief,
  body.automation-reference-active[data-theme] #view-automation .automation-reference-health,
  body.automation-reference-active[data-theme] #view-automation .automation-update-diagnostics {
    min-height: 214px;
    overflow: hidden;
    border: 1px solid var(--jd-line-strong);
    border-radius: 4px;
    background: rgba(255,255,255,.25);
    box-shadow: 0 12px 30px rgba(30,31,24,.035);
  }
  body.automation-reference-active[data-theme] #view-automation .automation-reference-brief > header,
  body.automation-reference-active[data-theme] #view-automation .automation-reference-health > header {
    min-height: 66px;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-reference-health > header > div {
    display: flex;
    align-items: center;
    gap: 11px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-reference-brief > header {
    justify-content: flex-start;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-reference-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    color: #2d330f;
    border-radius: 50%;
    background: #e9efb7;
    font-size: 18px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-reference-brief h3,
  body.automation-reference-active[data-theme] #view-automation .automation-reference-health h3 {
    margin: 0;
    font-family: var(--reference-editorial);
    font-size: 20px;
    font-weight: 430;
    letter-spacing: -.015em;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-reference-health .text-link {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-size: 13px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-reference-metrics {
    padding: 4px 20px 19px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  body.automation-reference-active[data-theme] #view-automation .automation-reference-metrics article {
    min-height: 66px;
    padding: 8px 17px;
    display: grid;
    align-content: center;
    gap: 3px;
    border-right: 1px solid var(--jd-line);
  }
  body.automation-reference-active[data-theme] #view-automation .automation-reference-metrics article:last-child {
    border-right: 0;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-reference-metrics span {
    color: #6f736b;
    font-size: 13px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-reference-metrics strong {
    font-family: var(--reference-editorial);
    font-size: 28px;
    font-weight: 380;
    line-height: 1;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-reference-metrics .has-attention strong {
    color: #bd3d33;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-reference-brief-copy {
    min-height: 56px;
    padding: 11px 21px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-top: 1px solid var(--jd-line);
  }
  body.automation-reference-active[data-theme] #view-automation .automation-reference-brief-copy p {
    margin: 0;
    overflow: hidden;
    color: #6f736b;
    font-size: 13px;
    line-height: 1.5;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-reference-brief-copy button {
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-size: 13px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-reference-pulse {
    min-height: 43px;
    padding: 6px 22px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--jd-line);
  }
  body.automation-reference-active[data-theme] #view-automation .automation-reference-pulse i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d4d0c6;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-reference-pulse i.is-good {
    background: #5e8f12;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-reference-pulse i.is-attention {
    background: var(--jd-amber);
  }
  body.automation-reference-active[data-theme] #view-automation .automation-reference-pulse i.is-risk {
    background: var(--jd-red);
  }
  body.automation-reference-active[data-theme] #view-automation .automation-reference-health-body {
    min-height: 83px;
    padding: 12px 22px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-reference-health-body > div {
    padding-right: 20px;
    border-right: 1px solid var(--jd-line);
  }
  body.automation-reference-active[data-theme] #view-automation .automation-reference-health-body > div + div {
    padding: 0 0 0 20px;
    border-right: 0;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-reference-health-body > div > span {
    color: #71756d;
    font-size: 13px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-reference-health-body p {
    margin: 6px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-reference-health-body strong {
    overflow: hidden;
    font-size: 14px;
    font-weight: 520;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-reference-health-body small {
    flex: 0 0 auto;
    color: #7d8178;
    font-size: 11px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-reference-health-body .has-risk strong {
    color: #c43f35;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-update-diagnostics {
    min-height: 0;
    border-radius: 4px;
    background: rgba(255,255,255,.25);
    box-shadow: 0 12px 30px rgba(30,31,24,.035);
  }
  body.automation-reference-active[data-theme] #view-automation .automation-update-diagnostics > header {
    min-height: 58px;
    padding: 10px 22px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-update-diagnostics h3 {
    font-family: var(--reference-editorial);
    font-size: 18px;
    font-weight: 430;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-update-metrics {
    border-color: var(--jd-line);
  }
  body.automation-reference-active[data-theme] #view-automation .automation-update-metrics article {
    padding: 10px 20px;
    border-color: var(--jd-line);
  }
  body.automation-reference-active[data-theme] #view-automation .automation-update-metrics strong {
    font-family: var(--reference-editorial);
    font-size: 24px;
    font-weight: 380;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-update-diagnostics > footer {
    min-height: 42px;
    padding: 8px 22px;
  }

  body.automation-reference-active[data-theme] #view-automation .automation-control {
    min-height: 96px;
    margin: 22px 0 0;
    padding: 14px 19px;
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 116px minmax(410px, 1.25fr);
    gap: 17px;
    align-items: center;
    border-radius: 4px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-control-copy .eyebrow {
    display: none;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-control-copy h3 {
    margin: 0 0 5px;
    font-family: var(--reference-editorial);
    font-size: 18px;
    font-weight: 430;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-control-copy p {
    margin: 0;
    color: #73776f;
    font-size: 13px;
    line-height: 1.5;
  }
  body.automation-reference-active[data-theme] #view-automation #automation-master-toggle {
    min-height: 38px;
    box-shadow: none;
    font-size: 14px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-quiet-form {
    display: grid;
    grid-template-columns: 1fr 1fr 104px;
    gap: 8px;
    align-items: end;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-quiet-form label {
    display: grid;
    gap: 4px;
    color: #74786f;
    font-size: 11px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-quiet-form input,
  body.automation-reference-active[data-theme] #view-automation .automation-quiet-form button {
    min-height: 36px;
    padding: 0 10px;
    font-size: 13px;
  }

  body.automation-reference-active[data-theme] #view-automation .automation-grid {
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-secondary-rules {
    border: 1px solid var(--jd-line);
    border-radius: 4px;
    background: rgba(255,255,255,.2);
  }
  body.automation-reference-active[data-theme] #view-automation .automation-secondary-rules > summary {
    min-height: 42px;
    padding: 0 17px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #686d65;
    font-size: 13px;
    cursor: pointer;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-secondary-rules > summary b {
    min-width: 21px;
    height: 21px;
    display: grid;
    place-items: center;
    color: #2c310f;
    border-radius: 50%;
    background: #e6edb0;
    font-size: 11px;
    font-weight: 500;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-secondary-list {
    padding: 0 10px 10px;
    display: grid;
    gap: 10px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-rule {
    min-height: 114px;
    padding: 13px 17px;
    display: grid;
    grid-template-columns: 58px minmax(280px, 1.4fr) 105px minmax(150px, .75fr) 212px;
    gap: 15px;
    align-items: center;
    border-radius: 4px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-rule-icon {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    color: #283000;
    border-radius: 50%;
    background: #e9efb7;
    font-family: var(--reference-editorial);
    font-size: 19px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-rule:nth-child(2) .automation-rule-icon {
    background: #f8e7b3;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-rule-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-rule-head > div {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-rule h3 {
    margin: 0;
    font-family: var(--reference-editorial);
    font-size: 17px;
    font-weight: 440;
    line-height: 1.2;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-rule-head > small {
    color: #74786f;
    font-size: 11px;
    white-space: nowrap;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-state {
    padding: 4px 7px;
    color: #5d7917;
    border: 0;
    border-radius: 999px;
    background: #e6f1d8;
    font-size: 11px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-state:not(.is-on) {
    color: #8b6207;
    background: #f8edce;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-rule-copy > p {
    min-height: 0;
    margin: 7px 0 0;
    color: #72766e;
    font-size: 13px;
    line-height: 1.55;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-rule-stat,
  body.automation-reference-active[data-theme] #view-automation .automation-rule-boundary {
    min-height: 66px;
    padding: 5px 14px;
    display: grid;
    align-content: center;
    gap: 4px;
    border-left: 1px solid var(--jd-line);
  }
  body.automation-reference-active[data-theme] #view-automation .automation-rule-stat span,
  body.automation-reference-active[data-theme] #view-automation .automation-rule-boundary span {
    color: #74786f;
    font-size: 11px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-rule-stat strong {
    font-family: var(--reference-editorial);
    font-size: 22px;
    font-weight: 380;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-rule-stat small,
  body.automation-reference-active[data-theme] #view-automation .automation-rule-boundary small {
    color: #858980;
    font-size: 11px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-rule-boundary strong {
    overflow: hidden;
    font-size: 13px;
    font-weight: 520;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-rule-actions {
    display: grid;
    grid-template-columns: 68px 92px 38px;
    gap: 7px;
    align-items: center;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-rule-actions button {
    min-height: 34px;
    padding: 0 8px;
    box-shadow: none;
    font-size: 13px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-rule-actions .text-link {
    color: #65770f;
    border: 0;
    background: transparent;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-history {
    margin: 17px 0 0;
    padding: 17px 20px;
    border-radius: 4px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-history .section-heading {
    margin-bottom: 0;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-history h3 {
    margin: 4px 0 0;
    font-family: var(--reference-editorial);
    font-size: 20px;
    font-weight: 430;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-connections h3 {
    margin: 0;
    font-family: var(--reference-editorial);
    font-size: 20px;
    font-weight: 430;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-history .text-link {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-run-list {
    margin-top: 9px;
  }

  body.automation-reference-active[data-theme] #view-automation .automation-connections {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--jd-line);
  }
  body.automation-reference-active[data-theme] #view-automation .automation-connections > .section-heading {
    margin: 0 0 13px;
    padding-inline: 20px;
    align-items: end;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-connections .text-link {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-connection-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-connection-card {
    min-height: 93px;
    padding: 13px 15px;
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr) 18px;
    gap: 12px;
    align-items: center;
    color: var(--jd-ink);
    text-align: left;
    text-decoration: none;
    border: 1px solid var(--jd-line);
    border-radius: 4px;
    background: rgba(255,255,255,.25);
    box-shadow: none;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-connection-card:hover {
    border-color: var(--jd-line-strong);
    background: rgba(255,255,255,.42);
    transform: translateY(-1px);
  }
  body.automation-reference-active[data-theme] #view-automation .automation-connection-card.is-informational:hover {
    transform: none;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-connection-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    color: #2b310d;
    border-radius: 50%;
    background: #e9efb7;
    font-family: var(--reference-editorial);
    font-size: 15px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-connection-card > div {
    min-width: 0;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-connection-card strong {
    display: block;
    font-family: var(--reference-editorial);
    font-size: 15px;
    font-weight: 430;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-connection-card div > span {
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #777b73;
    font-size: 11px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-connection-card div > span i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--jd-amber);
  }
  body.automation-reference-active[data-theme] #view-automation .automation-connection-card div > span.is-connected i {
    background: #56890f;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-connection-card small {
    margin-top: 4px;
    display: block;
    color: #858980;
    font-size: 11px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-connection-card > b {
    color: #3e423c;
    font-family: var(--reference-editorial);
    font-size: 22px;
    font-weight: 400;
  }
}

/* P3 derived desktop routes: the four references remain the component DNA. */
@media (min-width: 821px) {
  body.review-reference-active[data-theme] #view-drafts,
  body.connections-reference-active[data-theme] #view-integrations,
  body.time-reference-active[data-theme] #view-time,
  body.memory-reference-active[data-theme] #view-memory {
    width: 100%;
    max-width: none;
    padding: 34px 54px 60px;
  }
  body.review-reference-active[data-theme] #view-drafts .page-lead h2,
  body.connections-reference-active[data-theme] #view-integrations .page-lead h2,
  body.time-reference-active[data-theme] #view-time .page-lead h2,
  body.memory-reference-active[data-theme] #view-memory .page-lead h2 {
    margin: 0 0 8px;
    font-family: var(--reference-editorial);
    font-size: 44px;
    font-weight: 400;
    line-height: 1.08;
    letter-spacing: -.032em;
  }
  body.review-reference-active[data-theme] #view-drafts .page-lead .eyebrow,
  body.connections-reference-active[data-theme] #view-integrations .page-lead .eyebrow,
  body.time-reference-active[data-theme] #view-time .page-lead .eyebrow,
  body.memory-reference-active[data-theme] #view-memory .page-lead .eyebrow {
    display: none;
  }

  body.review-reference-active[data-theme] #view-drafts .draft-compose-panel,
  body.review-reference-active[data-theme] #view-drafts .draft-queue {
    border-radius: 4px;
    background: rgba(255,255,255,.27);
  }
  body.review-reference-active[data-theme] #view-drafts .draft-compose-panel {
    margin-bottom: 16px;
  }
  body.review-reference-active[data-theme] #view-drafts .draft-compose-panel > summary {
    min-height: 49px;
    padding: 0 17px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--jd-ink);
    border-radius: 4px;
    font-size: 14px;
  }
  body.review-reference-active[data-theme] #view-drafts .draft-compose-panel > summary small {
    color: #7a7e75;
    font-size: 11px;
  }
  body.review-reference-active[data-theme] #view-drafts .communication-grid {
    padding: 0 17px 17px;
    gap: 12px;
  }
  body.review-reference-active[data-theme] #view-drafts .generator-card,
  body.review-reference-active[data-theme] #view-drafts .manual-draft-card {
    border: 1px solid var(--jd-line);
    border-radius: 4px;
    background: rgba(255,255,255,.22);
  }
  body.review-reference-active[data-theme] #view-drafts .draft-queue {
    min-height: 430px;
    padding: 19px 20px;
  }
  body.review-reference-active[data-theme] #view-drafts .draft-queue .section-heading {
    margin-bottom: 13px;
    padding-bottom: 13px;
    border-bottom: 1px solid var(--jd-line);
  }
  body.review-reference-active[data-theme] #view-drafts .draft-queue h3 {
    margin: 4px 0 0;
    font-family: var(--reference-editorial);
    font-size: 20px;
    font-weight: 430;
  }
  body.review-reference-active[data-theme] #view-drafts .safe-note {
    color: #b2463c;
    border-color: #e4bbb5;
    background: #fff1ee;
    font-size: 11px;
  }
  body.review-reference-active[data-theme] #view-drafts .draft-filter-bar {
    gap: 5px;
  }
  body.review-reference-active[data-theme] #view-drafts .draft-filter {
    min-height: 29px;
    padding: 0 10px;
    color: #666b63;
    border: 1px solid var(--jd-line);
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
    font-size: 13px;
  }
  body.review-reference-active[data-theme] #view-drafts .draft-filter.is-active {
    color: #2c320f;
    border-color: #bdcf69;
    background: #edf1ce;
  }
  body.review-reference-active[data-theme] #view-drafts .draft-group,
  body.review-reference-active[data-theme] #view-drafts .draft-item {
    border-radius: 4px;
    background: rgba(255,255,255,.25);
  }

  body.connections-reference-active[data-theme] #view-integrations .integration-lead {
    padding-bottom: 23px;
  }
  body.connections-reference-active[data-theme] #view-integrations .integration-lead p {
    margin: 0;
    color: #70746c;
    font-size: 13px;
  }
  body.connections-reference-active[data-theme] #view-integrations .integration-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
  }
  body.connections-reference-active[data-theme] #view-integrations .integration-card {
    min-height: 224px;
    padding: 19px 20px;
    border-radius: 4px;
  }
  body.connections-reference-active[data-theme] #view-integrations .integration-card-head {
    min-height: 49px;
    padding-bottom: 11px;
    border-bottom: 1px solid var(--jd-line);
  }
  body.connections-reference-active[data-theme] #view-integrations .integration-card-head h3 {
    margin: 4px 0 2px;
    font-family: var(--reference-editorial);
    font-size: 19px;
    font-weight: 430;
    letter-spacing: -.015em;
  }
  body.connections-reference-active[data-theme] #view-integrations .integration-card-head p,
  body.connections-reference-active[data-theme] #view-integrations .integration-card > p {
    color: #73776f;
    font-size: 13px;
    line-height: 1.6;
  }
  body.connections-reference-active[data-theme] #view-integrations .connection-state {
    border-radius: 999px;
    font-size: 11px;
  }
  body.connections-reference-active[data-theme] #view-integrations .integration-permissions {
    gap: 5px;
  }
  body.connections-reference-active[data-theme] #view-integrations .integration-permissions span {
    padding: 5px 8px;
    color: #60655d;
    border: 1px solid var(--jd-line);
    border-radius: 999px;
    background: rgba(255,255,255,.24);
    font-size: 11px;
  }
  body.connections-reference-active[data-theme] #view-integrations .integration-actions {
    gap: 7px;
  }
  body.connections-reference-active[data-theme] #view-integrations .integration-actions > *,
  body.connections-reference-active[data-theme] #view-integrations .douyin-form button {
    min-height: 35px;
    padding: 0 11px;
    box-shadow: none;
    font-size: 13px;
  }
  body.connections-reference-active[data-theme] #view-integrations .douyin-form {
    gap: 9px;
  }
  body.connections-reference-active[data-theme] #view-integrations .douyin-form label {
    gap: 5px;
    color: #666b63;
    font-size: 13px;
  }
  body.connections-reference-active[data-theme] #view-integrations .douyin-form input,
  body.connections-reference-active[data-theme] #view-integrations .douyin-form textarea,
  body.connections-reference-active[data-theme] #view-integrations .douyin-form select {
    min-height: 38px;
    padding: 9px 10px;
    font-size: 14px;
  }

  body.time-reference-active[data-theme] #view-time .time-page-lead,
  body.memory-reference-active[data-theme] #view-memory .page-lead {
    padding-bottom: 22px;
  }
  body.time-reference-active[data-theme] #view-time .time-ledger,
  body.memory-reference-active[data-theme] #view-memory .summer-sheet {
    border-radius: 4px;
  }
  body.time-reference-active[data-theme] #view-time .time-ledger {
    padding: 20px;
  }
  body.time-reference-active[data-theme] #view-time .time-ledger-head h3,
  body.memory-reference-active[data-theme] #view-memory .section-heading h3 {
    font-family: var(--reference-editorial);
    font-weight: 430;
  }
  body.time-reference-active[data-theme] #view-time .time-summary > div,
  body.time-reference-active[data-theme] #view-time .time-calendar,
  body.time-reference-active[data-theme] #view-time .time-record-form {
    border-color: var(--jd-line);
    border-radius: 4px;
    background: rgba(255,255,255,.25);
  }
  body.memory-reference-active[data-theme] #view-memory .memory-grid {
    gap: 14px;
  }
  body.memory-reference-active[data-theme] #view-memory .summer-sheet {
    padding: 20px;
  }
  body.memory-reference-active[data-theme] #view-memory .memory-suggestions button {
    border-color: var(--jd-line);
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
  }

  body.chat-reference-active[data-theme] #view-chat {
    width: 100%;
    max-width: none;
    padding: 64px 52px 54px;
  }
  body.chat-reference-active[data-theme] #view-chat .chat-layout {
    grid-template-columns: minmax(0, 1fr) 244px;
    gap: 18px;
  }
  body.chat-reference-active[data-theme] #view-chat .chat-panel,
  body.chat-reference-active[data-theme] #view-chat .chat-side section {
    border-radius: 4px;
    background: rgba(255,255,255,.27);
  }
  body.chat-reference-active[data-theme] #view-chat .chat-intro {
    min-height: 267px;
    padding: 48px 45px 36px;
  }
  body.chat-reference-active[data-theme] #view-chat .chat-intro h2 {
    margin: 16px 0 8px;
    font-family: var(--reference-editorial);
    font-size: 50px;
    font-weight: 380;
  }
  body.chat-reference-active[data-theme] #view-chat .prompt-chips button {
    min-height: 35px;
    border-color: var(--jd-line-strong);
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
    font-size: 13px;
  }
  body.chat-reference-active[data-theme] #view-chat .voice-dock,
  body.chat-reference-active[data-theme] #view-chat .voice-settings,
  body.chat-reference-active[data-theme] #view-chat .composer {
    border-color: var(--jd-line);
    border-radius: 4px;
    background: rgba(255,255,255,.24);
  }

  body.desktop-reference-active[data-theme] .auth-gate {
    align-items: center;
    justify-content: center;
    color: var(--jd-ink);
    background:
      linear-gradient(90deg, #030403 0 96px, transparent 96px),
      radial-gradient(circle at 40% 8%, rgba(255,255,255,.72), transparent 34%),
      var(--jd-paper);
  }
  body.desktop-reference-active[data-theme] .auth-card {
    width: min(510px, calc(100vw - 160px));
    padding: 38px 42px;
    color: var(--jd-ink);
    border: 1px solid var(--jd-line-strong);
    border-radius: 4px;
    background: rgba(255,255,255,.42);
    box-shadow: 0 24px 70px rgba(22,24,19,.1);
  }
  body.desktop-reference-active[data-theme] .auth-card::after {
    display: none;
  }
  body.desktop-reference-active[data-theme] .auth-card h1 {
    margin: 18px 0 10px;
    font-family: var(--reference-editorial);
    font-size: 42px;
    font-weight: 400;
    letter-spacing: -.03em;
  }
  body.desktop-reference-active[data-theme] .auth-card p {
    color: #6d7169;
    font-size: 13px;
    line-height: 1.7;
  }
  body.desktop-reference-active[data-theme] .auth-sun {
    color: #11130f;
    background: var(--jd-lime);
  }
}

/* Final shell calibration shared by the two direct-reference pilots. */
@media (min-width: 821px) {
  body.today-pilot-active[data-theme] .app-shell {
    grid-template-columns: 96px minmax(0, 1fr);
  }
  body.today-pilot-active[data-theme] .sidebar {
    width: 96px;
  }
  body.projects-pilot-active[data-theme] .workspace-header {
    height: 78px;
    min-height: 78px;
    background: rgba(248,244,233,.94);
  }
  body.projects-pilot-active[data-theme] .app-chrome {
    min-height: 78px;
    padding: 0 54px 0 48px;
    grid-template-columns: minmax(310px, 1fr) auto minmax(310px, 1fr);
  }
  body.projects-pilot-active[data-theme] .chrome-signals {
    display: flex;
    visibility: visible;
    gap: 28px;
    align-items: center;
  }
  body.projects-pilot-active[data-theme] .chrome-signal {
    width: auto;
    height: 24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #454942;
    border: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
  }
  body.projects-pilot-active[data-theme] .chrome-signal::before {
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    content: "";
    border-radius: 50%;
    background: var(--jd-green);
  }
  body.projects-pilot-active[data-theme] #chrome-alert-signal.is-active::before {
    background: var(--jd-red);
  }
  body.projects-pilot-active[data-theme] #chrome-review-signal::before {
    background: #d5d0c1;
  }
  body.projects-pilot-active[data-theme] #chrome-review-signal.is-active::before {
    background: var(--jd-amber);
  }
  body.projects-pilot-active[data-theme] .chrome-signal::after {
    max-width: 132px;
    overflow: hidden;
    content: attr(data-short-label);
    font-size: 14px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.projects-pilot-active[data-theme] .chrome-brand {
    transform: none;
  }
  body.projects-pilot-active[data-theme] .chrome-brand strong {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 0;
  }
  body.projects-pilot-active[data-theme] .chrome-brand-sprout {
    width: 28px;
    height: 31px;
    display: block;
    overflow: visible;
    fill: none;
    stroke: #58770e;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.4;
  }
  body.projects-pilot-active[data-theme] .chrome-brand strong > span::after {
    color: var(--jd-ink);
    content: "james";
    font: 400 25px/1 var(--projects-editorial);
    letter-spacing: -.025em;
  }
  body.projects-pilot-active[data-theme] .chrome-brand strong::before,
  body.projects-pilot-active[data-theme] .chrome-brand strong::after {
    display: none;
  }
}

/* P3 desktop-width acceptance: keep the reference shell usable down to the
 * existing mobile boundary without changing the <= 820px mobile interface.
 */
@media (min-width: 821px) and (max-width: 1180px) {
  body.desktop-reference-active[data-theme] {
    min-width: 0 !important;
  }
  body.desktop-reference-active[data-theme] .app-chrome {
    padding-right: 24px;
    padding-left: 24px;
    grid-template-columns: minmax(210px, 1fr) auto minmax(210px, 1fr);
  }
  body.desktop-reference-active[data-theme] .chrome-signals {
    gap: 14px;
  }
  body.desktop-reference-active[data-theme] .chrome-signal::after {
    max-width: 92px;
  }
  body.desktop-reference-active[data-theme] .today-top-actions {
    gap: 8px;
  }
  body.desktop-reference-active[data-theme] .today-account-entry {
    width: 32px;
    height: 32px;
  }

  body.review-reference-active[data-theme] #view-drafts,
  body.connections-reference-active[data-theme] #view-integrations,
  body.time-reference-active[data-theme] #view-time,
  body.memory-reference-active[data-theme] #view-memory {
    padding-right: 30px;
    padding-left: 30px;
  }
  body.connections-reference-active[data-theme] #view-integrations .integration-grid {
    grid-template-columns: 1fr;
  }
  body.chat-reference-active[data-theme] #view-chat {
    padding-right: 30px;
    padding-left: 30px;
  }
  body.chat-reference-active[data-theme] #view-chat .chat-layout {
    grid-template-columns: minmax(0, 1fr) 210px;
  }

  body.automation-reference-active[data-theme] #view-automation {
    padding-right: 30px;
    padding-left: 30px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-reference-overview {
    grid-template-columns: minmax(300px, .9fr) minmax(0, 1.35fr);
  }
  body.automation-reference-active[data-theme] #view-automation .automation-control {
    grid-template-columns: minmax(220px, 1fr) 104px minmax(330px, 1.2fr);
    gap: 11px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-rule {
    grid-template-columns: 50px minmax(230px, 1.35fr) 88px minmax(120px, .7fr) 198px;
    gap: 10px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-rule-actions {
    grid-template-columns: 62px 84px 34px;
    gap: 5px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-connection-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 821px) and (max-width: 980px) {
  body.desktop-reference-active[data-theme] .app-chrome {
    grid-template-columns: minmax(120px, 1fr) auto minmax(168px, 1fr);
  }
  body.desktop-reference-active[data-theme] .chrome-signals {
    gap: 9px;
  }
  body.desktop-reference-active[data-theme] .chrome-signal::after {
    display: none;
  }
  body.desktop-reference-active[data-theme] .chrome-signal {
    gap: 0;
  }
  body.desktop-reference-active[data-theme] .chrome-brand strong {
    font-size: 20px;
    white-space: nowrap;
  }
  body.desktop-reference-active:not(.projects-pilot-active)[data-theme] .chrome-brand strong > span {
    font-size: 0;
  }
  body.desktop-reference-active:not(.projects-pilot-active)[data-theme] .chrome-brand strong > span::after {
    content: "james";
    font: 400 18px/1 var(--reference-editorial, var(--jd-display));
    letter-spacing: -.02em;
  }
  body.projects-pilot-active[data-theme] .chrome-brand strong {
    font-size: 0;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-control {
    grid-template-columns: minmax(0, 1fr) 104px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-reference-overview {
    grid-template-columns: minmax(0, 1fr);
  }
  body.automation-reference-active[data-theme] #view-automation .automation-quiet-form {
    grid-column: 1 / -1;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-rule {
    grid-template-columns: 44px minmax(0, 1fr) 82px 184px;
  }
  body.automation-reference-active[data-theme] #view-automation .automation-rule-boundary {
    display: none;
  }
  body.chat-reference-active[data-theme] #view-chat .chat-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  body.chat-reference-active[data-theme] #view-chat .chat-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.projects-pilot-active[data-theme] #view-work {
    padding-right: 30px;
    padding-left: 30px;
  }
  body.projects-pilot-active[data-theme] .projects-pilot-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  body.projects-pilot-active[data-theme] .projects-record-main {
    padding-right: 12px;
    padding-left: 12px;
    grid-template-columns: 42px minmax(72px, 105px) 70px minmax(125px, 1fr) 74px 66px 42px;
    gap: 6px;
  }
  body.today-pilot-active[data-theme] #view-dashboard {
    padding-right: 30px;
    padding-left: 30px;
  }
  body.today-pilot-active[data-theme] .today-pilot-hero {
    height: 150px;
  }
  body.today-pilot-active[data-theme] .today-pilot-hero h2 {
    font-size: 54px;
  }
  body.today-pilot-active[data-theme] .today-pilot-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-context-block .meeting-item-list {
    grid-template-columns: minmax(0, 1fr);
  }
  body.today-pilot-active[data-theme] .today-pilot-rail {
    gap: 18px;
    transform: none;
  }
  body.today-pilot-active[data-theme] .today-status-stack {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  body.today-pilot-active[data-theme] .today-status-card {
    min-height: 78px;
    padding: 10px 12px;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 8px;
  }
  body.today-pilot-active[data-theme] .today-status-card > strong {
    font-size: 34px;
  }
  body.today-pilot-active[data-theme] .today-status-card b {
    font-size: 13px;
  }
  body.today-pilot-active[data-theme] .today-status-card small {
    font-size: 11px;
  }
  body.today-pilot-active[data-theme] .today-automation-card {
    min-height: 245px;
  }
  body.today-pilot-active[data-theme] .today-project-strip {
    margin-top: 24px;
  }
  body.meetings-reference-active[data-theme] #view-meetings {
    grid-template-columns: 0 minmax(0, 1fr);
  }
  body.meetings-reference-active[data-theme] #view-meetings.meeting-index-open {
    grid-template-columns: 260px minmax(0, 1fr);
  }
  body.meetings-reference-active[data-theme] #view-meetings.meeting-index-open .meeting-index-toggle {
    left: 248px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-page-lead {
    padding-right: 22px;
    padding-left: 24px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-index-panel {
    padding-right: 20px;
    padding-left: 24px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-detail {
    padding-right: 24px;
    padding-left: 24px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-action-main {
    grid-template-columns: 20px 20px minmax(0, 1fr) 108px;
    grid-template-rows: auto auto;
    gap: 5px 8px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-select,
  body.meetings-reference-active[data-theme] #view-meetings .meeting-linked-mark {
    grid-column: 1;
    grid-row: 1 / span 2;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-action-index {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-action-copy {
    grid-column: 3;
    grid-row: 1;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-action-owner {
    grid-column: 3;
    grid-row: 2;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-action-status {
    grid-column: 4;
    grid-row: 2;
    text-align: center;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-action-confirm {
    grid-column: 4;
    grid-row: 1;
  }
}

/* Desktop readability floor for retained functional surfaces. */
@media (min-width: 821px) {
  body.desktop-retained-ui[data-theme] .quick-task-form label > span,
  body.desktop-retained-ui[data-theme] .global-inbox-counter span,
  body.desktop-retained-ui[data-theme] .global-inbox-type span,
  body.desktop-retained-ui[data-theme] .global-inbox-type i,
  body.desktop-retained-ui[data-theme] .factory-pulse-metrics span,
  body.desktop-retained-ui[data-theme] .time-entry-balance small,
  body.desktop-retained-ui[data-theme] .time-entry-balance i,
  body.desktop-retained-ui[data-theme] .meeting-kind,
  body.desktop-retained-ui[data-theme] .draft-group-head span,
  body.desktop-retained-ui[data-theme] .draft-channel,
  body.desktop-retained-ui[data-theme] .approval-state,
  body.desktop-retained-ui[data-theme] .voice-settings output,
  body.desktop-retained-ui[data-theme] .time-day-tags i {
    font-size: 11px;
    font-weight: 600;
  }

  body.desktop-retained-ui[data-theme] .quick-capture-form label,
  body.desktop-retained-ui[data-theme] .quick-capture-form small,
  body.desktop-retained-ui[data-theme] .global-inbox-flow span,
  body.desktop-retained-ui[data-theme] .global-inbox-flow i,
  body.desktop-retained-ui[data-theme] .global-inbox-copy small,
  body.desktop-retained-ui[data-theme] .global-inbox-copy summary,
  body.desktop-retained-ui[data-theme] .global-inbox-copy pre,
  body.desktop-retained-ui[data-theme] .factory-pulse-state,
  body.desktop-retained-ui[data-theme] .factory-pulse-foot p,
  body.desktop-retained-ui[data-theme] .connection-disclosure summary b,
  body.desktop-retained-ui[data-theme] .source-state,
  body.desktop-retained-ui[data-theme] .source-note,
  body.desktop-retained-ui[data-theme] .time-entry-copy small,
  body.desktop-retained-ui[data-theme] .generator-card .work-form small,
  body.desktop-retained-ui[data-theme] .draft-summary-meta small,
  body.desktop-retained-ui[data-theme] .draft-recipient,
  body.desktop-retained-ui[data-theme] .draft-foot small,
  body.desktop-retained-ui[data-theme] .mini-button,
  body.desktop-retained-ui[data-theme] .voice-copy small,
  body.desktop-retained-ui[data-theme] .voice-interrupt,
  body.desktop-retained-ui[data-theme] .voice-settings summary,
  body.desktop-retained-ui[data-theme] .voice-shortcuts button,
  body.desktop-retained-ui[data-theme] .voice-switch span,
  body.desktop-retained-ui[data-theme] .voice-settings-foot .mini-button,
  body.desktop-retained-ui[data-theme] .voice-settings > small,
  body.desktop-retained-ui[data-theme] .memory-suggestions button {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
  }

  body.desktop-retained-ui[data-theme] .global-inbox-flow {
    font-size: 11px;
    font-weight: 600;
  }

  body.chat-reference-active[data-theme] #view-chat .voice-copy small {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
  }

  body.desktop-retained-ui[data-theme] .global-inbox-copy summary,
  body.desktop-retained-ui[data-theme] .factory-pulse-foot p,
  body.desktop-retained-ui[data-theme] .source-note,
  body.desktop-retained-ui[data-theme] .draft-recipient,
  body.desktop-retained-ui[data-theme] .draft-foot small,
  body.desktop-retained-ui[data-theme] .voice-copy small,
  body.desktop-retained-ui[data-theme] .voice-settings > small {
    color: var(--jd-muted);
  }

  body.desktop-retained-ui[data-theme] .factory-alert-list .empty-note,
  body.desktop-retained-ui[data-theme] .draft-summary-main strong,
  body.desktop-retained-ui[data-theme] .draft-summary-main p,
  body.desktop-retained-ui[data-theme] .voice-toggle b {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.55;
  }

  body.memory-reference-active[data-theme] #view-memory .memory-card > div {
    color: var(--jd-muted);
    font: 600 11px/1.4 var(--jd-mono);
  }
  body.memory-reference-active[data-theme] #view-memory .memory-card > div span,
  body.memory-reference-active[data-theme] #view-memory .memory-card > div small {
    font-size: 11px;
    font-weight: 600;
  }
  body.memory-reference-active[data-theme] #view-memory .memory-card p {
    font-size: 14px;
    font-weight: 450;
    line-height: 1.65;
  }
}

/* P3 next release: mobile information architecture and restrained James shell. */
.mobile-meeting-index-trigger,
.meeting-index-toggle,
.meeting-index-context {
  display: none;
}
body.today-pilot-active[data-theme] .today-project-strip {
  display: none !important;
}

@media (max-width: 820px) {
  body.today-pilot-active[data-theme] .today-support-zone {
    display: none;
  }

  body[data-theme="control-room"] {
    background-color: #f4f0e6;
    background-image: none;
  }
  body[data-theme="control-room"] .workspace {
    padding-right: max(14px, env(safe-area-inset-right));
    padding-left: max(14px, env(safe-area-inset-left));
  }
  body[data-theme="control-room"] .workspace-header {
    min-height: 0;
    margin-right: calc(-1 * max(14px, env(safe-area-inset-right)));
    margin-left: calc(-1 * max(14px, env(safe-area-inset-left)));
    padding-right: max(14px, env(safe-area-inset-right));
    padding-left: max(14px, env(safe-area-inset-left));
    overflow: visible;
    border-bottom: 1px solid #d2cec3;
    background: rgba(247, 243, 233, .94);
    backdrop-filter: blur(18px);
  }
  body[data-theme="control-room"] .app-chrome {
    min-height: calc(58px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 0 0;
    grid-template-columns: minmax(58px, 1fr) auto minmax(58px, 1fr);
    border-bottom: 1px solid rgba(210, 206, 195, .7);
  }
  body[data-theme="control-room"] .chrome-signals {
    gap: 6px;
  }
  body[data-theme="control-room"] .chrome-signal {
    width: 8px;
    height: 8px;
    box-shadow: none;
  }
  body[data-theme="control-room"] .chrome-brand strong {
    display: inline-flex;
    align-items: center;
    gap: 7px;
  }
  body[data-theme="control-room"] .chrome-brand-sprout {
    width: 22px;
    height: 24px;
    flex: 0 0 22px;
    overflow: visible;
    fill: none;
    stroke: #20241f;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.3;
  }
  body[data-theme="control-room"] .chrome-brand strong::before,
  body[data-theme="control-room"] .chrome-brand strong::after {
    display: none;
  }
  body[data-theme="control-room"] .chrome-review {
    width: 36px;
    height: 36px;
    color: #282c27;
    border: 1px solid #c3bfb4;
    background: rgba(255, 255, 255, .42);
    box-shadow: none;
  }
  body[data-theme="control-room"] .chrome-review > span {
    color: #282c27;
  }
  body[data-theme="control-room"] .chrome-review > b {
    border-color: #f7f3e9;
    background: #8baa15;
  }
  body[data-theme="control-room"] .topbar {
    min-height: 64px;
    height: 64px;
    border-bottom: 0;
  }
  body[data-theme="control-room"] .mobile-menu-toggle,
  body[data-theme="control-room"] #mobile-back:not([hidden]) {
    min-width: 42px;
    width: 42px;
    min-height: 42px;
    height: 42px;
    border: 1px solid #c9c5ba;
    border-radius: 8px;
    background: rgba(255, 255, 255, .34);
    box-shadow: none;
  }
  body[data-theme="control-room"] .model-picker {
    min-width: 106px;
    min-height: 42px;
    border-color: #c9c5ba;
    border-radius: 8px;
    background: rgba(255, 255, 255, .34);
    box-shadow: none;
  }
  body[data-theme="control-room"] .sidebar {
    width: min(320px, 86vw);
    background: #090b09;
    box-shadow: 28px 0 70px rgba(8, 10, 8, .24);
  }
  body[data-theme="control-room"] .nav-item {
    border-radius: 7px;
  }
  body[data-theme="control-room"] .nav-item.is-active {
    color: #eff2e8;
    background: rgba(200, 255, 46, .075);
    box-shadow: inset 3px 0 #b9e11b;
  }
  body[data-theme="control-room"] .view {
    padding-top: 22px;
  }
  body[data-theme="control-room"] .page-lead,
  body[data-theme="control-room"] .chat-intro {
    padding: 0 2px 18px;
  }
  body[data-theme="control-room"] .summer-sheet,
  body[data-theme="control-room"] .integration-card,
  body[data-theme="control-room"] .automation-card,
  body[data-theme="control-room"] .chat-panel,
  body[data-theme="control-room"] .voice-panel,
  body[data-theme="control-room"] .time-ledger,
  body[data-theme="control-room"] .memory-card,
  body[data-theme="control-room"] .create-panel,
  body[data-theme="control-room"] .draft-item,
  body[data-theme="control-room"] .work-card {
    border: 1px solid #d0ccc1;
    border-radius: 8px;
    background: rgba(255, 255, 255, .30);
    box-shadow: none;
  }
  body[data-theme="control-room"] button,
  body[data-theme="control-room"] input,
  body[data-theme="control-room"] select,
  body[data-theme="control-room"] textarea {
    box-shadow: none;
  }
  body[data-theme="control-room"] input,
  body[data-theme="control-room"] select,
  body[data-theme="control-room"] textarea {
    border-color: #c9c5ba;
    border-radius: 8px;
    background: rgba(255, 255, 255, .52);
  }
  body[data-theme="control-room"] .primary-button,
  body[data-theme="control-room"] .send-button {
    color: #20241d;
    border-color: #aeca18;
    border-radius: 8px;
    background: #c6ef2e;
    box-shadow: none;
  }
  body[data-theme="control-room"] .ghost-button,
  body[data-theme="control-room"] .mini-button {
    border-color: #c7c3b8;
    border-radius: 8px;
    background: rgba(255, 255, 255, .25);
    box-shadow: none;
  }
  body[data-theme="control-room"] .filter-bar,
  body[data-theme="control-room"] .draft-filter-bar,
  body[data-theme="control-room"] .meeting-action-filters,
  body[data-theme="control-room"] .automation-reference-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  body[data-theme="control-room"] .filter-bar::-webkit-scrollbar,
  body[data-theme="control-room"] .draft-filter-bar::-webkit-scrollbar,
  body[data-theme="control-room"] .meeting-action-filters::-webkit-scrollbar,
  body[data-theme="control-room"] .automation-reference-tabs::-webkit-scrollbar {
    display: none;
  }

  /* Today stays concise; My Work remains the only full execution queue. */
  body.today-pilot-active[data-theme] #view-dashboard {
    width: 100%;
    max-width: none;
    min-height: 0;
    padding: 22px 0 36px;
    display: block;
  }
  body.today-pilot-active[data-theme] .today-reference-pilot {
    min-height: 0;
    display: block;
  }
  body.today-pilot-active[data-theme] #view-dashboard > .summer-hero,
  body.today-pilot-active[data-theme] #view-dashboard > .work-overview-card,
  body.today-pilot-active[data-theme] #view-dashboard > .global-inbox-card,
  body.today-pilot-active[data-theme] #view-dashboard > .factory-pulse-card,
  body.today-pilot-active[data-theme] #view-dashboard > .metric-grid,
  body.today-pilot-active[data-theme] #view-dashboard > .data-source-card,
  body.today-pilot-active[data-theme] #view-dashboard > .time-ledger-entry {
    display: none;
  }
  body.today-pilot-active[data-theme] .today-pilot-hero {
    min-height: 126px;
    padding: 6px 3px 20px;
    display: flex;
    align-items: flex-start;
  }
  body.today-pilot-active[data-theme] .today-pilot-hero h2 {
    margin-top: 12px;
    margin-bottom: 10px;
  }
  body.today-pilot-active[data-theme] .today-pilot-hero p {
    margin: 0;
    color: #666b63;
  }
  body.today-pilot-active[data-theme] .today-pilot-grid,
  body.today-pilot-active[data-theme] .today-pilot-main,
  body.today-pilot-active[data-theme] .today-pilot-rail {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    transform: none;
  }
  body.today-pilot-active[data-theme] .today-priority-card {
    min-height: 0;
    overflow: hidden;
    border: 1px solid #c8c4b8;
    border-left: 1px solid #add312;
    border-radius: 8px;
    background: rgba(255, 255, 255, .34);
  }
  body.today-pilot-active[data-theme] .today-priority-card::before {
    display: none;
  }
  body.today-pilot-active[data-theme] .today-priority-body,
  body.today-pilot-active[data-theme] .today-priority-empty .today-priority-body {
    min-height: 0;
    padding: 20px 18px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  body.today-pilot-active[data-theme] .today-priority-open {
    width: fit-content;
    min-width: 0;
    justify-content: flex-start;
    border: 0;
    border-bottom: 1px solid #8b9186;
    border-radius: 0;
    background: transparent;
  }
  body.today-pilot-active[data-theme] .today-next-card {
    min-height: 0;
    overflow: hidden;
    border: 1px solid #d0ccc1;
    border-radius: 8px;
    background: rgba(255, 255, 255, .26);
  }
  body.today-pilot-active[data-theme] .today-next-card > header {
    min-height: 45px;
    padding: 0 16px;
    border-bottom: 1px solid #d8d4ca;
  }
  body.today-pilot-active[data-theme] .today-next-row,
  body.today-pilot-active[data-theme] .today-next-more,
  body.today-pilot-active[data-theme] .today-next-empty {
    display: none;
  }
  body.today-pilot-active[data-theme] .today-work-route {
    width: 100%;
    min-height: 92px;
    padding: 15px 16px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    color: #222720;
    text-align: left;
    border: 0;
    background: transparent;
  }
  body.today-pilot-active[data-theme] .today-work-route > span {
    display: grid;
    gap: 3px;
  }
  body.today-pilot-active[data-theme] .today-work-route > span:first-child {
    min-width: 46px;
    padding-right: 12px;
    border-right: 1px solid #d3cfc4;
  }
  body.today-pilot-active[data-theme] .today-work-route small {
    color: #747970;
  }
  body.today-pilot-active[data-theme] .today-work-route i {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid #8b9086;
    border-radius: 50%;
    font-style: normal;
  }
  body.today-pilot-active[data-theme] .today-status-stack {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }
  body.today-pilot-active[data-theme] .today-status-card,
  body.today-pilot-active[data-theme] .today-status-card.tone-ink,
  body.today-pilot-active[data-theme] .today-status-card.tone-red {
    position: relative;
    min-width: 0;
    min-height: 82px;
    padding: 13px 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    color: #222720;
    text-align: left;
    border: 1px solid #d0ccc1;
    border-radius: 8px;
    background: rgba(255, 255, 255, .28);
    box-shadow: none;
  }
  body.today-pilot-active[data-theme] .today-status-card::before {
    position: absolute;
    top: 13px;
    right: 10px;
    width: 6px;
    height: 6px;
    content: "";
    border-radius: 50%;
    background: #8aaa11;
  }
  body.today-pilot-active[data-theme] .today-status-card.tone-ink::before {
    background: #d2a800;
  }
  body.today-pilot-active[data-theme] .today-status-card.tone-red::before {
    background: #d24e43;
  }
  body.today-pilot-active[data-theme] .today-status-card span {
    display: grid;
    gap: 3px;
  }
  body.today-pilot-active[data-theme] .today-status-card small,
  body.today-pilot-active[data-theme] .today-status-card i {
    display: none;
  }
  body.today-pilot-active[data-theme] .today-automation-card {
    min-height: 0;
    padding: 17px;
    border: 1px solid #d0ccc1;
    border-radius: 8px;
    background: rgba(255, 255, 255, .26);
  }
  body.today-pilot-active[data-theme] .today-pulse-track {
    height: 38px;
  }
  body.today-pilot-active[data-theme] .today-pulse-summary {
    grid-template-columns: minmax(0, 1fr);
  }
  body.today-pilot-active[data-theme] .today-pulse-summary article {
    min-height: 68px;
    border-color: #d7d3c8;
    background: rgba(255, 255, 255, .22);
  }
  body.today-pilot-active[data-theme] .today-project-strip {
    margin-top: 22px;
  }
  body.today-pilot-active[data-theme] #today-project-cards {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  body.today-pilot-active[data-theme] #today-project-cards::-webkit-scrollbar {
    display: none;
  }
  body.today-pilot-active[data-theme] .today-project-card {
    min-width: min(310px, calc(100vw - 44px));
    border-color: #d0ccc1;
    border-radius: 8px;
    background: rgba(255, 255, 255, .26);
    box-shadow: none;
  }

  /* Meeting detail is primary; the list and action context live in a drawer. */
  body.meetings-reference-active[data-theme] #view-meetings {
    width: 100%;
    max-width: none;
    min-height: 0;
    padding: 22px 0 38px;
    display: block;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-page-lead {
    padding: 0 2px 14px;
    border: 0;
  }
  body.meetings-reference-active[data-theme] .mobile-meeting-index-trigger {
    width: 100%;
    min-height: 46px;
    margin-bottom: 14px;
    padding: 8px 13px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 9px;
    color: #3b4039;
    text-align: left;
    border: 1px solid #cbc7bc;
    border-radius: 8px;
    background: rgba(255, 255, 255, .28);
  }
  body.meetings-reference-active[data-theme] .mobile-meeting-index-trigger b {
    min-width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #2b320f;
    background: rgba(193, 225, 50, .32);
  }
  body.meetings-reference-active[data-theme] .mobile-meeting-index-trigger i {
    color: #6b7168;
    font-style: normal;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-layout {
    display: block;
    border: 0;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-index-panel {
    position: fixed !important;
    z-index: 42;
    top: 0;
    left: 0;
    width: min(330px, 88vw);
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    max-height: none;
    padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
    overflow-y: auto;
    visibility: hidden !important;
    border: 0;
    border-right: 1px solid #2f332c;
    border-radius: 0;
    background: #11130f;
    box-shadow: 26px 0 70px rgba(8, 10, 8, .28);
    transform: translateX(-102%) !important;
    pointer-events: none !important;
  }
  body.meetings-reference-active[data-theme] #view-meetings.meeting-index-open .meeting-index-panel {
    visibility: visible !important;
    transform: translateX(0) !important;
    pointer-events: auto !important;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-index-panel .meeting-index-close {
    display: grid;
    color: #f1f3eb;
    border-color: #565b50;
    background: #1d2019;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-index-panel .meeting-list-group h4,
  body.meetings-reference-active[data-theme] #view-meetings .meeting-index-panel .section-heading,
  body.meetings-reference-active[data-theme] #view-meetings .meeting-index-panel .eyebrow {
    color: #aeb3a7;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-index-panel .meeting-list-item {
    color: #f1f3eb;
    border-color: #3d4138;
    background: #1a1d17;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-index-panel .meeting-list-item.is-active {
    border-color: #a9ce18;
    background: rgba(195, 231, 47, .08);
    box-shadow: inset 3px 0 #b6df1b;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-index-panel .meeting-list-date {
    border-right-color: #3d4138;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-index-panel .meeting-list-date b,
  body.meetings-reference-active[data-theme] #view-meetings .meeting-index-panel .meeting-list-copy strong {
    color: #f1f3eb;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-index-panel .meeting-list-date small,
  body.meetings-reference-active[data-theme] #view-meetings .meeting-index-panel .meeting-list-copy small {
    color: #aeb3a7;
  }
  body.meetings-reference-active[data-theme] .meeting-index-context {
    margin-top: 18px;
    padding-top: 16px;
    display: grid;
    gap: 10px;
    border-top: 1px solid #3d4138;
  }
  body.meetings-reference-active[data-theme] .meeting-index-context > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  body.meetings-reference-active[data-theme] .meeting-index-context article {
    padding: 12px;
    color: #f1f3eb;
    border: 1px solid #3d4138;
    border-radius: 7px;
    background: #1a1d17;
  }
  body.meetings-reference-active[data-theme] .meeting-index-context strong,
  body.meetings-reference-active[data-theme] .meeting-index-context small {
    display: block;
  }
  body.meetings-reference-active[data-theme] .meeting-index-context small {
    margin-top: 4px;
    color: #aeb3a7;
  }
  body.meetings-reference-active[data-theme] .meeting-index-context > button {
    min-height: 42px;
    color: #e8ece0;
    border: 1px solid #565b50;
    border-radius: 7px;
    background: #22261e;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-detail {
    width: 100%;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-hero {
    padding: 20px 18px;
    color: #222720;
    border: 1px solid #d0ccc1;
    border-radius: 8px 8px 0 0;
    background: rgba(255, 255, 255, .28);
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-hero-meta {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    background: transparent;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-hero-meta > div {
    border-top: 1px solid #d6d2c7;
    background: transparent;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-reference-highlights,
  body.meetings-reference-active[data-theme] #view-meetings .meeting-reference-actions,
  body.meetings-reference-active[data-theme] #view-meetings .meeting-context-display {
    padding-right: 16px;
    padding-left: 16px;
    border-right: 1px solid #d0ccc1;
    border-left: 1px solid #d0ccc1;
    background: rgba(255, 255, 255, .22);
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-context-display {
    border-bottom: 1px solid #d0ccc1;
    border-radius: 0 0 8px 8px;
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-action-row {
    border-color: #d5d1c6;
    border-radius: 7px;
    background: rgba(255, 255, 255, .34);
  }
  body.meetings-reference-active[data-theme] #view-meetings .meeting-action-confirm {
    border-radius: 7px;
  }
  .meeting-index-backdrop {
    background: rgba(10, 12, 9, .45);
    backdrop-filter: blur(2px);
  }
}

/* P3 Today refinement — one editorial work surface, one compact signal band. */
@media (min-width: 821px) {
  body.today-pilot-active[data-theme] #view-dashboard {
    padding-bottom: 64px;
  }

  body.today-pilot-active[data-theme] .today-pilot-hero {
    height: 148px;
  }

  body.today-pilot-active[data-theme] .today-pilot-grid {
    grid-template-columns: minmax(0, 1fr) 352px;
    gap: 32px;
  }

  body.today-pilot-active[data-theme] .today-pilot-main {
    gap: 16px;
  }

  body.today-pilot-active[data-theme] .today-priority-card,
  body.today-pilot-active[data-theme] .today-priority-body {
    min-height: 198px;
  }

  body.today-pilot-active[data-theme] .today-priority-card::before {
    top: 28px;
    height: 142px;
  }

  body.today-pilot-active[data-theme] .today-priority-body {
    padding: 26px 24px 24px 34px;
  }

  body.today-pilot-active[data-theme] .today-next-card {
    min-height: 118px;
  }

  body.today-pilot-active[data-theme] .today-next-card > header {
    min-height: 44px;
  }

  body.today-pilot-active[data-theme] .today-work-route {
    min-height: 72px;
    padding-block: 10px;
  }

  body.today-pilot-active[data-theme] .today-pilot-rail {
    gap: 12px;
  }

  body.today-pilot-active[data-theme] .today-status-stack {
    gap: 7px;
  }

  body.today-pilot-active[data-theme] .today-status-card {
    min-height: 68px;
    padding-block: 8px;
    border-color: rgba(112, 116, 105, .26);
    background:
      linear-gradient(90deg, rgba(190, 213, 79, .06), transparent 34%),
      rgba(255, 255, 255, .22);
  }

  body.today-pilot-active[data-theme] .today-status-card.tone-ink,
  body.today-pilot-active[data-theme] .today-status-card.tone-red {
    background:
      linear-gradient(90deg, rgba(190, 213, 79, .06), transparent 34%),
      rgba(255, 255, 255, .22);
  }

  body.today-pilot-active[data-theme] .today-automation-card {
    min-height: 152px;
    padding: 14px 17px;
    background:
      radial-gradient(circle at 88% 10%, rgba(188, 216, 42, .09), transparent 36%),
      rgba(255, 255, 255, .22);
  }

  body.today-pilot-active[data-theme] .today-pulse-track {
    height: 28px;
    margin-top: 2px;
    padding-bottom: 5px;
  }

  body.today-pilot-active[data-theme] .today-pulse-axis {
    height: 20px;
    padding-bottom: 5px;
  }

  body.today-pilot-active[data-theme] .today-pulse-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  body.today-pilot-active[data-theme] .today-pulse-summary article {
    min-height: 56px;
    padding: 7px 9px;
    grid-template-columns: 31px minmax(0, 1fr);
    gap: 9px;
    border-color: rgba(112, 116, 105, .22);
    background: rgba(255, 255, 255, .18);
  }

  body.today-pilot-active[data-theme] .today-pulse-state {
    width: 28px;
    height: 28px;
  }

  body.today-pilot-active[data-theme] .today-support-zone {
    margin-top: 36px;
    padding-top: 24px;
    display: grid;
    grid-template-columns: minmax(0, 1.52fr) minmax(330px, .78fr);
    gap: 14px;
    border-top: 1px solid var(--jd-line-strong);
  }

  body.today-pilot-active[data-theme] .today-support-heading {
    min-height: 70px;
    padding: 0 2px 12px;
    grid-column: 1 / -1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 40px;
  }

  body.today-pilot-active[data-theme] .today-support-heading > div {
    position: relative;
    padding-left: 15px;
  }

  body.today-pilot-active[data-theme] .today-support-heading > div::before {
    position: absolute;
    inset: 1px auto 2px 0;
    width: 1px;
    content: "";
    background: var(--jd-lime);
  }

  body.today-pilot-active[data-theme] .today-support-heading span {
    display: block;
    margin-bottom: 9px;
    color: #656a61;
    letter-spacing: .2em;
  }

  body.today-pilot-active[data-theme] .today-support-heading h3,
  body.today-pilot-active[data-theme] .today-support-heading p {
    margin: 0;
  }

  body.today-pilot-active[data-theme] .today-support-heading p {
    max-width: 440px;
    padding-top: 21px;
    color: #6d716a;
    text-align: right;
  }

  body.today-pilot-active[data-theme] .today-support-zone > .summer-sheet {
    margin: 0;
    overflow: hidden;
    border: 1px solid rgba(112, 116, 105, .29);
    border-radius: 5px;
    background:
      linear-gradient(135deg, rgba(255, 255, 255, .29), rgba(255, 255, 255, .12)),
      rgba(248, 246, 237, .62);
    box-shadow: none;
  }

  body.today-pilot-active[data-theme] .today-support-zone > .metric-grid {
    display: none !important;
  }

  body.today-pilot-active[data-theme] .today-support-zone > .global-inbox-card {
    grid-column: 1;
  }

  body.today-pilot-active[data-theme] .today-support-zone > .factory-pulse-card {
    grid-column: 2;
  }

  body.today-pilot-active[data-theme] .global-inbox-head,
  body.today-pilot-active[data-theme] .factory-pulse-head {
    min-height: 90px;
    padding: 16px 18px 13px;
    align-items: flex-start;
    border-bottom: 1px solid rgba(112, 116, 105, .22);
  }

  body.today-pilot-active[data-theme] .global-inbox-head p {
    max-width: 650px;
  }

  body.today-pilot-active[data-theme] .global-inbox-counter {
    min-width: 74px;
    padding: 3px 0 3px 17px;
    border-left: 1px solid var(--jd-lime);
  }

  body.today-pilot-active[data-theme] .global-inbox-flow {
    display: none;
  }

  body.today-pilot-active[data-theme] .global-inbox-item {
    min-height: 104px;
    padding: 13px 16px;
    grid-template-columns: 76px minmax(0, 1fr) 92px;
    gap: 14px;
    align-items: center;
    border-top: 0;
    background: rgba(255, 255, 255, .08);
  }

  body.today-pilot-active[data-theme] .global-inbox-copy p {
    margin-block: 3px;
  }

  body.today-pilot-active[data-theme] .global-inbox-copy details {
    margin-top: 4px;
  }

  body.today-pilot-active[data-theme] .global-inbox-actions {
    gap: 6px;
  }

  body.today-pilot-active[data-theme] .global-inbox-actions button {
    min-height: 36px;
    padding: 6px 10px;
    border-radius: 4px;
  }

  body.today-pilot-active[data-theme] .factory-pulse-head {
    min-height: 90px;
  }

  body.today-pilot-active[data-theme] .factory-pulse-body {
    padding: 13px 15px 9px;
    display: block;
  }

  body.today-pilot-active[data-theme] .factory-pulse-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  body.today-pilot-active[data-theme] .factory-pulse-metrics > div {
    min-height: 58px;
    padding: 8px 4px;
    border-color: rgba(112, 116, 105, .20);
    background: rgba(255, 255, 255, .14);
  }

  body.today-pilot-active[data-theme] .factory-alert-list {
    margin-top: 8px;
  }

  body.today-pilot-active[data-theme] .factory-alert-list .empty-note,
  body.today-pilot-active[data-theme] .factory-all-clear {
    min-height: 42px;
    margin: 0;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    border-color: rgba(112, 116, 105, .20);
  }

  body.today-pilot-active[data-theme] .factory-pulse-foot {
    min-height: 42px;
    padding: 8px 15px 11px;
  }

  body.today-pilot-active[data-theme] .today-support-zone > .data-source-card,
  body.today-pilot-active[data-theme] .today-support-zone > .time-ledger-entry {
    min-height: 78px;
  }

  body.today-pilot-active[data-theme] .today-support-zone > .data-source-card {
    grid-column: 1;
  }

  body.today-pilot-active[data-theme] .today-support-zone .connection-disclosure > summary {
    min-height: 76px;
    padding: 12px 18px;
  }

  body.today-pilot-active[data-theme] .today-support-zone > .time-ledger-entry {
    grid-column: 2;
    padding: 12px 16px;
    border-left: 1px solid rgba(173, 211, 18, .88);
  }

  body.today-pilot-active[data-theme] .today-support-zone .time-entry-balance {
    background: rgba(183, 214, 49, .11);
  }
}

/* Shared desktop rail rhythm: primary cluster, overflow boundary, anchored utility. */
@media (min-width: 821px) {
}

/* P4 final cascade guard: legacy page-specific rules must not resize the new shell. */
@media (min-width: 821px) {
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .app-shell {
    grid-template-columns: 228px minmax(0, 1fr);
  }
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 228px;
    height: 100vh;
    padding: 0;
    color: var(--p4-ink);
    overflow: visible;
    border-right: 1px solid var(--p4-line);
    background: var(--p4-rail);
  }
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .workspace {
    width: auto;
    max-width: none;
    min-width: 0;
    margin: 0;
    grid-column: 2;
    background: var(--p4-bg);
  }
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .workspace-header {
    left: 228px;
    width: auto;
    height: 72px;
    border-bottom: 1px solid var(--p4-line);
    background: color-mix(in srgb, var(--p4-bg) 92%, transparent);
  }
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .app-chrome {
    height: 72px;
    padding: 0 34px;
    grid-template-columns: minmax(250px, 1fr) auto minmax(250px, 1fr);
    border: 0;
    background: transparent;
  }
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .view {
    width: min(1420px, calc(100vw - 228px));
    max-width: none;
    margin: 0 auto;
    padding: 42px 44px 72px;
  }
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-shell-nav { display: flex; }
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-brand {
    width: auto;
    height: 92px;
    margin: 0;
    padding: 0 24px;
    display: flex;
    justify-content: flex-start;
    gap: 13px;
    color: var(--p4-ink);
    border-bottom: 1px solid var(--p4-line);
  }
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-brand > .p4-brand-mark {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid !important;
  }
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-brand > span:not(.p4-brand-mark) {
    min-width: 0;
    display: grid !important;
    gap: 1px;
  }
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-brand > .mobile-menu-close {
    display: none;
  }
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-nav-scroll {
    padding: 23px 14px 14px;
  }
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-nav-item,
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-more-menu .nav-item {
    width: 100%;
    min-height: 42px;
    padding: 0 11px;
    display: grid;
    grid-template-columns: 25px minmax(0, 1fr) auto;
    gap: 7px;
    color: var(--p4-text-2);
    background: transparent;
  }
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-nav-item.is-active {
    color: var(--p4-ink);
    background: var(--p4-surface);
  }
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-nav-item .nav-icon {
    width: 25px;
    height: 25px;
    color: var(--p4-text-3);
  }
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-nav-item b {
    width: auto;
    max-width: none;
    display: block;
    overflow: visible;
    color: inherit;
    font-size: 13px;
    text-overflow: clip;
  }
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-more {
    min-height: 0;
    margin-top: 22px;
    padding-top: 0;
    border-top: 1px solid var(--p4-line);
  }
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-more::before { display: none; }
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-nav-footer {
    position: static;
    height: auto;
    padding: 14px;
    border-top: 1px solid var(--p4-line);
  }
  body.today-pilot-active.desktop-retained-ui[data-theme] #view-dashboard {
    display: block;
    grid-template-columns: none;
    gap: 0;
  }
  body.today-pilot-active.desktop-retained-ui[data-theme] #view-dashboard > :not(.p4-today) {
    display: none !important;
  }
  body.desktop-retained-ui[data-theme] .p4-today {
    display: block !important;
    visibility: visible;
    opacity: 1;
  }
  body.desktop-retained-ui[data-theme] .p4-work-capture {
    margin: 12px 0 18px;
    overflow: hidden;
    border: 1px solid var(--p4-line);
    border-radius: 14px;
    background: var(--p4-surface);
    box-shadow: none;
  }
  body.desktop-retained-ui[data-theme] .p4-work-capture > summary {
    min-height: 52px;
    padding: 0 17px;
    display: flex;
    align-items: center;
    color: var(--p4-text-2);
    font-size: 12px;
  }
  body.desktop-retained-ui[data-theme] .p4-work-capture .work-capture-body {
    padding: 18px;
    border-top: 1px solid var(--p4-line);
  }
  body.desktop-retained-ui[data-theme] .p4-confirmation-inbox {
    margin: 18px 0;
    border-color: var(--p4-line);
    background: var(--p4-surface);
    box-shadow: var(--p4-shadow);
  }
}

@media (min-width: 821px) and (max-width: 1180px) {
  body.desktop-retained-ui.desktop-reference-active[data-theme] .app-shell {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  body.desktop-retained-ui.desktop-reference-active[data-theme] .sidebar { width: 190px; }
  body.desktop-retained-ui.desktop-reference-active[data-theme] .workspace-header { left: 190px; }
  body.desktop-retained-ui.desktop-reference-active[data-theme] .view {
    width: calc(100vw - 190px);
    padding: 30px 28px 56px;
  }
}

/* P4 confirmed blueprint
 * Exact visual baseline: docs/previews/p4/james-redesign-v2-themes.png
 * Functional data remains live; only the confirmed geometry and visual language are applied.
 */
@media (min-width: 821px) {
  body.p4-framework[data-theme="studio"] {
    --p4-bg: #eff3f0;
    --p4-canvas: #eff3f0;
    --p4-surface: #fbfcfa;
    --p4-surface-2: #e6ece8;
    --p4-surface-3: #d9e2dc;
    --p4-rail: #e8eeea;
    --p4-rail-active: #d8e3dc;
    --p4-text: #17231c;
    --p4-text-2: #4e5e55;
    --p4-text-3: #728179;
    --p4-line: #cfd9d2;
    --p4-line-strong: #aebcb2;
    --p4-accent: #47795f;
    --p4-accent-soft: #d9e9df;
    --p4-accent-ink: #224d39;
    --p4-warning: #b27a14;
    --p4-warning-soft: #f0e5ca;
    --p4-danger: #b75650;
    --p4-success: #588265;
    --p4-shadow: 0 7px 24px rgba(43, 65, 53, .055);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] {
    min-width: 1180px;
    background: var(--p4-canvas);
    font-family: "Segoe UI Variable", "Microsoft YaHei UI", "PingFang SC", sans-serif;
    font-size: 14px;
    line-height: 1.55;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .app-shell {
    min-height: 100vh;
    grid-template-columns: 196px minmax(0, 1fr);
    background: var(--p4-canvas);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 196px;
    padding: 26px 18px 20px;
    color: var(--p4-text);
    background: var(--p4-rail);
    border-right: 1px solid color-mix(in srgb, var(--p4-text) 8%, transparent);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-shell-nav {
    height: 100%;
    display: flex;
    flex-direction: column;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-brand {
    width: auto;
    height: 61.375px !important;
    min-height: 48px;
    margin: 0;
    padding: 0 10px;
    display: flex !important;
    align-items: center;
    gap: 12px;
    color: var(--p4-text);
    border: 0;
    background: transparent;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-brand > .p4-brand-mark {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid !important;
    place-items: center;
    border: 1px solid #b5c3ba;
    border-radius: 12px;
    background: transparent;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-brand-mark svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.55;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-brand-mark .brand-signal {
    fill: var(--p4-accent);
    stroke: none;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-brand-mark rect {
    fill: currentColor;
    stroke: none;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-brand > span:last-child {
    display: grid !important;
    gap: 2px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-brand strong {
    color: var(--p4-text);
    font: 650 15px/1.2 "Segoe UI Variable", "Microsoft YaHei UI", sans-serif;
    letter-spacing: .08em;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-brand small {
    color: var(--p4-text-3);
    font-size: 10px;
    letter-spacing: .12em;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-nav-scroll {
    flex: 1;
    padding: 0;
    overflow: visible;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-nav-label {
    margin: 44px 12px 10px;
    color: #87948c;
    font: 600 10px/1 "Cascadia Code", Consolas, monospace;
    letter-spacing: .16em;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-nav-list {
    display: grid;
    gap: 4px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-mobile-more {
    display: none;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-nav-item {
    min-height: 46px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 0;
    border-radius: 10px;
    color: var(--p4-text-3);
    background: transparent;
    text-align: left;
    transition: color 180ms ease, background 180ms ease;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-nav-item:hover {
    color: var(--p4-text);
    background: color-mix(in srgb, var(--p4-text) 5%, transparent);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-nav-item.is-active {
    color: var(--p4-text);
    background: var(--p4-rail-active);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-nav-item .nav-icon,
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-appearance-entry .nav-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    color: currentColor;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-nav-item .nav-icon svg,
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-appearance-entry .nav-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-nav-item.is-active .nav-icon {
    color: var(--p4-accent);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-nav-item b {
    color: inherit;
    font-size: 13px;
    font-weight: 600;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-nav-count {
    min-width: 20px;
    height: 20px;
    margin-left: auto;
    padding: 0 6px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #eff6f1;
    background: var(--p4-accent);
    font: 700 10px/1 "Cascadia Code", Consolas, monospace;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-nav-footer {
    position: static;
    padding: 0;
    display: grid;
    gap: 0;
    border: 0;
    background: transparent;
    transform: translateY(39px);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-appearance-entry {
    min-height: 46px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--p4-text-2);
    border: 0;
    border-radius: 10px;
    background: transparent;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-appearance-entry b {
    font-size: 13px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-profile {
    height: 52px;
    min-height: 52px;
    margin-top: 33px;
    padding: 6px 9px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--p4-text);
    border: 0;
    border-top: 1px solid #c8d2cb;
    background: transparent;
    text-align: left;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-profile-avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid #aebcb2;
    border-radius: 50%;
    font: 500 14px/1 Georgia, serif;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-profile > span:last-child {
    display: grid;
    gap: 2px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-profile b { font-size: 12px; }
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-profile small {
    color: var(--p4-text-3);
    font-size: 10px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .workspace {
    margin-left: 0;
    min-width: 0;
    width: calc(100vw - 196px);
    background: var(--p4-canvas);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .workspace-header {
    left: 196px;
    width: calc(100vw - 196px);
    height: 72px;
    min-height: 72px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .app-chrome {
    height: 72px;
    min-height: 72px;
    padding: 0 34px;
    display: grid;
    grid-template-columns: minmax(300px, 1fr) auto minmax(300px, 1fr);
    align-items: center;
    color: var(--p4-text);
    border-bottom: 1px solid var(--p4-line);
    background: color-mix(in srgb, var(--p4-canvas) 94%, transparent);
    backdrop-filter: blur(18px);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .chrome-signals {
    display: flex;
    align-items: center;
    gap: 20px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .chrome-signal {
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .chrome-signal::before {
    content: "";
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: var(--p4-success);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--p4-success) 12%, transparent);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .chrome-signal::after {
    content: attr(data-short-label);
    color: var(--p4-text-2);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] #chrome-alert-signal.is-active::before {
    background: var(--p4-danger);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--p4-danger) 12%, transparent);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] #chrome-review-signal.is-active::before {
    background: var(--p4-warning);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--p4-warning) 12%, transparent);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] #chrome-system-signal:not(.is-active)::before {
    background: var(--p4-danger);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .chrome-brand {
    position: static;
    transform: none;
    display: flex;
    align-items: center;
    justify-self: center;
    gap: 9px;
    color: var(--p4-text);
    text-decoration: none;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .chrome-brand strong {
    display: block;
    color: var(--p4-text);
    font: 650 14px/1 "Segoe UI Variable", "Microsoft YaHei UI", sans-serif;
    letter-spacing: .09em;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-top-logo-mark {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: var(--p4-accent);
    stroke-width: 1.55;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-top-logo-mark .brand-signal {
    fill: var(--p4-accent);
    stroke: none;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-top-logo-mark rect {
    fill: currentColor;
    stroke: none;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .today-top-actions {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .today-focus-toggle,
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-theme-button,
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .chrome-review {
    position: relative;
    min-width: 38px;
    min-height: 38px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--p4-text-2);
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-theme-button {
    width: auto !important;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .today-focus-toggle:hover,
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-theme-button:hover,
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .chrome-review:hover {
    border-color: var(--p4-line);
    background: var(--p4-surface);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .today-focus-toggle svg,
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-theme-button svg,
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .chrome-review svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .chrome-review b {
    position: absolute;
    top: 1px;
    right: 1px;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    color: white;
    background: var(--p4-warning);
    font: 700 8px/1 "Cascadia Code", Consolas, monospace;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .chrome-review.is-clear b {
    display: none;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .view {
    width: calc(100vw - 196px);
    min-height: calc(100vh - 72px);
    padding: 30px 31px 48px;
    background: var(--p4-canvas);
  }

  body.p4-framework.today-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-dashboard {
    width: calc(100vw - 196px);
    min-height: calc(100vh - 72px);
    padding: 30px 31px 48px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-today {
    width: min(1380px, 100%);
    margin: 0 auto;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-page-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 32px;
    align-items: end;
    margin: 0;
    padding: 0;
    border: 0;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-page-hero .p4-kicker,
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-kicker {
    color: var(--p4-text-3);
    font: 650 11px/1 "Cascadia Code", Consolas, monospace;
    letter-spacing: .14em;
    text-transform: uppercase;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-page-hero .p4-kicker {
    display: block;
    line-height: 1.55;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-page-hero h2 {
    margin: 3px 0 5px;
    color: var(--p4-text);
    font: 620 38px/1.2 "Segoe UI Variable", "Microsoft YaHei UI", sans-serif;
    letter-spacing: -.05em;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-page-hero p {
    margin: 0;
    color: var(--p4-text-2);
    font-size: 12px;
  }


  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-command {
    min-height: 46px;
    margin-top: 18px;
    padding: 0 13px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--p4-text-2);
    border: 1px solid var(--p4-line-strong);
    border-radius: 10px;
    background: var(--p4-field);
    box-shadow: none;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-command:hover {
    border-color: color-mix(in srgb, var(--p4-accent) 38%, var(--p4-line-strong));
    background: var(--p4-field-hover);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-command:focus-within {
    border-color: var(--p4-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--p4-accent) 18%, transparent);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-command svg {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-command > input#p4-command-input {
    width: auto;
    min-width: 0;
    height: 100%;
    flex: 1 1 auto;
    padding: 0;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    color: var(--p4-text-1);
    background: transparent !important;
    box-shadow: none !important;
    appearance: none;
    -webkit-appearance: none;
    font: 500 14px/1.45 var(--projects-sans, var(--p4-ui));
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-command > input#p4-command-input:is(:hover, :focus, :focus-visible) {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-global-search-results {
    margin-top: 6px;
    overflow: hidden;
    color: var(--p4-text-2);
    border: 1px solid var(--p4-line-strong);
    border-radius: 10px;
    background: var(--p4-surface);
    box-shadow: var(--p4-shadow);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-global-search-results > header {
    min-height: 36px;
    padding: 0 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--p4-line);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-global-search-results > header strong {
    color: var(--p4-text-1);
    font: 600 12px/1.2 var(--projects-sans, var(--p4-ui));
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-global-search-results > header small,
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-global-search-result small {
    color: var(--p4-text-3);
    font: 500 11px/1.35 var(--projects-sans, var(--p4-ui));
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-global-search-list {
    max-height: 328px;
    overflow-y: auto;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-global-search-result {
    width: 100%;
    min-height: 58px;
    padding: 9px 13px;
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr) minmax(92px, auto);
    align-items: center;
    gap: 11px;
    color: var(--p4-text-1);
    border: 0;
    border-bottom: 1px solid var(--p4-line);
    background: transparent;
    text-align: left;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-global-search-result:last-child {
    border-bottom: 0;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-global-search-result:hover,
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-global-search-result:focus-visible {
    outline: 0;
    background: var(--p4-field-hover);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-global-search-kind {
    width: fit-content;
    padding: 4px 7px;
    color: var(--p4-text-2);
    border: 1px solid var(--p4-line);
    border-radius: 999px;
    background: var(--p4-field);
    font: 600 11px/1 var(--projects-sans, var(--p4-ui));
    white-space: nowrap;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-global-search-copy,
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-global-search-meta {
    min-width: 0;
    display: grid;
    gap: 3px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-global-search-copy strong {
    overflow: hidden;
    color: var(--p4-text-1);
    font: 600 13px/1.25 var(--projects-sans, var(--p4-ui));
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-global-search-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-global-search-meta {
    justify-items: end;
    text-align: right;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-global-search-meta b {
    color: var(--p4-accent-contrast);
    font: 600 11px/1.2 var(--projects-sans, var(--p4-ui));
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-global-search-empty {
    margin: 0;
    padding: 14px 13px;
    color: var(--p4-text-3);
    font: 500 12px/1.5 var(--projects-sans, var(--p4-ui));
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-command span {
    color: var(--p4-text-3);
    font: 600 9px/1 "Cascadia Code", Consolas, monospace;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-command kbd {
    padding: 3px 6px;
    color: var(--p4-text-3);
    border: 1px solid var(--p4-line);
    border-radius: 5px;
    background: var(--p4-canvas);
    font: 600 9px/1 "Cascadia Code", Consolas, monospace;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-confirmed-grid {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 12px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-card {
    min-width: 0;
    color: var(--p4-text);
    border: 1px solid var(--p4-line);
    border-radius: 15px;
    background: var(--p4-surface);
    box-shadow: var(--p4-shadow);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-brief-card {
    grid-column: span 8;
    min-height: 214.21875px;
    padding: 21px 24px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 126px;
    gap: 26px;
    overflow: hidden;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-brief-main {
    min-width: 0;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-brief-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-brief-chip {
    min-height: 28px;
    padding: 0 11px;
    display: inline-flex;
    align-items: center;
    color: var(--p4-accent-ink);
    border: 1px solid color-mix(in srgb, var(--p4-accent) 42%, var(--p4-line));
    border-radius: 14px;
    background: var(--p4-accent-soft);
    font: 700 10px/1 "Cascadia Code", Consolas, monospace;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-freshness {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--p4-text-3);
    font-size: 9px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-freshness i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--p4-success);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-brief-copy {
    max-width: 730px;
    margin: 19px 0 7px;
    color: var(--p4-text);
    font: 500 22px/1.42 "James Editorial CN", "Songti SC", STSong, serif;
    letter-spacing: -.025em;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-brief-note {
    max-width: 760px;
    margin: 0;
    color: var(--p4-text-2);
    font-size: 11px;
    line-height: 1.65;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-card-actions {
    margin-top: 19px;
    display: flex;
    gap: 7px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-primary,
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-secondary {
    min-height: 40px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-primary {
    color: #eff6f1;
    border: 1px solid var(--p4-accent);
    background: var(--p4-accent);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-secondary {
    color: var(--p4-text-2);
    border: 1px solid var(--p4-line);
    background: transparent;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-source-row {
    min-width: 126px;
    padding-left: 26px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 7px;
    border-left: 1px solid var(--p4-line);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-source-orbit {
    position: relative;
    width: 82px;
    height: 82px;
    padding: 0;
    display: grid;
    place-items: center;
    align-content: center;
    color: var(--p4-accent-ink);
    border: 1px solid var(--p4-line-strong);
    border-radius: 50%;
    background: var(--p4-accent-soft);
    font: 650 11px/1.2 "Cascadia Code", Consolas, monospace;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-source-orbit strong,
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-source-orbit span {
    display: block;
    font: inherit;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-source-orbit i {
    position: absolute;
    width: 9px;
    height: 9px;
    border: 2px solid var(--p4-surface);
    border-radius: 50%;
    background: var(--p4-accent);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-source-orbit i:first-of-type { left: 2px; top: 9px; }
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-source-orbit i:last-of-type {
    right: 4px;
    bottom: 7px;
    background: var(--p4-warning);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-source-row > small {
    color: var(--p4-text-3);
    font-size: 8px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-priority {
    grid-column: span 4;
    min-height: 214.21875px;
    padding: 20px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-card-heading h3 {
    margin: 2px 0 0;
    color: var(--p4-text);
    font-size: 17px;
    font-weight: 650;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-decision-badge {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--p4-warning);
    font-size: 10px;
    font-weight: 800;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-decision-badge i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--p4-warning);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--p4-warning) 12%, transparent);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-priority-state {
    color: var(--p4-text-3);
    background: transparent;
    font: 600 10px/1 "Cascadia Code", Consolas, monospace;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-priority-content {
    display: grid;
    grid-template-rows: auto auto 1fr;
    align-content: start;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-priority-content h4 {
    margin: 19px 0 5px;
    color: var(--p4-text);
    font: 500 18px/1.45 "James Editorial CN", "Songti SC", STSong, serif;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-priority-content p {
    margin: 0;
    color: var(--p4-text-3);
    font-size: 10px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-priority-content footer {
    align-self: end;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-run-section {
    grid-column: 1 / -1;
    min-height: 76px;
    padding: 10px 18px;
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-run-title strong {
    display: block;
    font-size: 12px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-run-title span {
    color: var(--p4-text-3);
    font-size: 9px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-run-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-run-result {
    min-height: 52px;
    padding: 8px 11px;
    display: grid;
    grid-template-columns: 27px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    border: 0;
    border-left: 1px solid var(--p4-line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-run-result > span {
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    color: var(--p4-accent-ink);
    border-radius: 8px;
    background: var(--p4-accent-soft);
    font: 700 9px/1 "Cascadia Code", Consolas, monospace;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-run-result b {
    display: block;
    font-size: 10px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-run-result small {
    color: var(--p4-text-3);
    font-size: 8px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-activity-card {
    grid-column: span 5;
    min-height: 292px;
    padding: 17px 20px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-project-pulse {
    grid-column: span 4;
    min-height: 292px;
    padding: 17px 20px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-schedule-card {
    grid-column: span 3;
    min-height: 292px;
    padding: 17px 20px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-text-link {
    color: var(--p4-accent-ink);
    border: 0;
    background: transparent;
    font-size: 9px;
    font-weight: 750;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-activity-list {
    margin-top: 13px;
    display: grid;
    gap: 9px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-activity-item {
    min-height: 46px;
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) auto;
    gap: 9px;
    align-items: start;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-activity-item > i {
    width: 8px;
    height: 8px;
    margin-top: 4px;
    border: 2px solid var(--p4-surface);
    border-radius: 50%;
    background: var(--p4-success);
    box-shadow: 0 0 0 1px var(--p4-line-strong);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-activity-item.is-attention > i {
    background: var(--p4-warning);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-activity-item b {
    display: block;
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-activity-item p {
    margin: 2px 0 0;
    overflow: hidden;
    color: var(--p4-text-3);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-activity-item time {
    color: var(--p4-text-3);
    font: 600 8px/1 "Cascadia Code", Consolas, monospace;
    white-space: nowrap;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] #p4-project-pulse {
    margin-top: 13px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-project-mini {
    min-height: 57px;
    padding: 9px 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 10px;
    align-items: center;
    color: var(--p4-text);
    border: 1px solid var(--p4-line);
    border-radius: 9px;
    background: var(--p4-canvas);
    text-align: left;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-project-mini + .p4-project-mini {
    margin-top: 7px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-project-mini span {
    display: grid;
    gap: 2px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-project-mini b { font-size: 10px; }
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-project-mini small {
    color: var(--p4-text-3);
    font-size: 8px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-project-mini > strong {
    color: var(--p4-text-2);
    font: 650 9px/1 "Cascadia Code", Consolas, monospace;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-project-mini > strong.is-risk {
    color: var(--p4-warning);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-project-mini > i {
    grid-column: 1 / -1;
    height: 3px;
    overflow: hidden;
    border-radius: 2px;
    background: var(--p4-line);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-project-mini > i em {
    display: block;
    height: 100%;
    background: var(--p4-accent);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-project-mini > progress,
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-project-progress > progress {
    width: 100%;
    height: 3px;
    overflow: hidden;
    appearance: none;
    border: 0;
    border-radius: 99px;
    background: var(--p4-line);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-project-mini > progress {
    grid-column: 1 / -1;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] progress::-webkit-progress-bar {
    background: var(--p4-line);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] progress::-webkit-progress-value {
    background: var(--p4-accent);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] progress::-moz-progress-bar {
    background: var(--p4-accent);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-schedule-count {
    color: var(--p4-text-3);
    font: 600 10px/1 "Cascadia Code", Consolas, monospace;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] #p4-next-runs {
    margin-top: 10px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-schedule-item {
    min-height: 51px;
    padding: 0;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 7px;
    align-items: center;
    color: var(--p4-text);
    border: 0;
    border-bottom: 1px solid var(--p4-line);
    background: transparent;
    text-align: left;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-schedule-item:last-child {
    border-bottom: 0;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-schedule-item > span {
    color: var(--p4-accent-ink);
    font: 650 9px/1 "Cascadia Code", Consolas, monospace;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-schedule-item b {
    display: block;
    font-size: 10px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-schedule-item small {
    color: var(--p4-text-3);
    font-size: 8px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-agent-summary {
    grid-column: 1 / -1;
    min-height: 58px;
    padding: 6px 16px;
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr) 120px;
    gap: 7px;
    align-items: center;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-agent-title strong {
    display: block;
    font-size: 11px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-agent-title span {
    color: var(--p4-text-3);
    font-size: 9px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] #p4-agent-summary {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] #p4-agent-summary > div {
    min-height: 42px;
    padding: 6px 8px;
    display: grid;
    align-content: center;
    border: 1px solid var(--p4-line);
    border-radius: 8px;
    background: var(--p4-canvas);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] #p4-agent-summary span {
    color: var(--p4-text-2);
    font-size: 9px;
    font-weight: 700;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] #p4-agent-summary b {
    color: var(--p4-success);
    font-size: 8px;
    font-weight: 600;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-agent-entry {
    min-height: 40px;
    color: var(--p4-accent-ink);
    border: 1px solid var(--p4-accent);
    border-radius: 8px;
    background: var(--p4-accent-soft);
    font-size: 9px;
    font-weight: 800;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-empty {
    margin: 18px 0 0;
    color: var(--p4-text-3);
    font-size: 10px;
  }

  body.p4-framework[data-view]:not([data-view="dashboard"]):not([data-view="chat"]) .p4-model-setting {
    display: none;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active.today-focus-mode[data-theme] .p4-command,
  body.p4-framework.desktop-retained-ui.desktop-reference-active.today-focus-mode[data-theme] .p4-run-section,
  body.p4-framework.desktop-retained-ui.desktop-reference-active.today-focus-mode[data-theme] .p4-activity-card,
  body.p4-framework.desktop-retained-ui.desktop-reference-active.today-focus-mode[data-theme] .p4-project-pulse,
  body.p4-framework.desktop-retained-ui.desktop-reference-active.today-focus-mode[data-theme] .p4-schedule-card,
  body.p4-framework.desktop-retained-ui.desktop-reference-active.today-focus-mode[data-theme] .p4-agent-summary {
    display: none !important;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active.today-focus-mode[data-theme] .p4-brief-card,
  body.p4-framework.desktop-retained-ui.desktop-reference-active.today-focus-mode[data-theme] .p4-priority {
    grid-column: span 6;
  }
}

/* P4 global acceptance pass: one calm desktop density and honest empty states. */
@media (min-width: 821px) {
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .sidebar {
    overflow: hidden;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-nav-scroll {
    padding-bottom: 14px;
    overflow-y: auto;
    scrollbar-width: none;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-nav-scroll::-webkit-scrollbar {
    display: none;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-nav-footer {
    flex: 0 0 auto;
    transform: none;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-profile {
    margin-top: 12px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-nav-label {
    margin: 24px 12px 9px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-mobile-more {
    margin: 20px 8px 0;
    display: block;
    border-top: 1px solid color-mix(in srgb, var(--p4-text) 10%, transparent);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-mobile-more > summary {
    min-height: 45px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--p4-text-3);
    cursor: pointer;
    list-style: none;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-mobile-more > summary::-webkit-details-marker {
    display: none;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-mobile-more > summary span {
    width: 20px;
    color: var(--p4-accent);
    font-size: 16px;
    letter-spacing: .08em;
    text-align: center;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-mobile-more > summary b {
    font-size: 13px;
    font-weight: 600;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-mobile-more.contains-active > summary,
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-mobile-more[open] > summary {
    color: var(--p4-text);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-more-menu {
    padding: 2px 0 6px;
    display: grid;
    gap: 3px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-more-menu .nav-item {
    width: 100%;
    min-height: 39px;
    padding: 0 7px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--p4-text-3);
    border: 0;
    border-radius: 8px;
    background: transparent;
    text-align: left;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-more-menu .nav-item:hover,
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-more-menu .nav-item.is-active {
    color: var(--p4-text);
    background: var(--p4-rail-active);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-more-menu .nav-item.is-active .p4-more-icon {
    color: var(--p4-accent);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-more-menu .nav-item b {
    font-size: 12px;
    font-weight: 600;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-more-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-more-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.55;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-view-hero {
    margin-bottom: 20px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-view-hero h2 {
    font-size: clamp(34px, 3vw, 42px);
    line-height: 1.08;
  }

  body.review-reference-active[data-theme] #view-drafts,
  body.connections-reference-active[data-theme] #view-integrations,
  body.time-reference-active[data-theme] #view-time,
  body.memory-reference-active[data-theme] #view-memory {
    padding-top: 28px;
  }

  body.review-reference-active[data-theme] #view-drafts .page-lead,
  body.connections-reference-active[data-theme] #view-integrations .page-lead,
  body.time-reference-active[data-theme] #view-time .page-lead,
  body.memory-reference-active[data-theme] #view-memory .page-lead {
    margin-bottom: 18px;
    padding-bottom: 0;
  }

  body.review-reference-active[data-theme] #view-drafts .page-lead h2,
  body.connections-reference-active[data-theme] #view-integrations .page-lead h2,
  body.time-reference-active[data-theme] #view-time .page-lead h2,
  body.memory-reference-active[data-theme] #view-memory .page-lead h2 {
    font-size: 37px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-full-brief {
    min-height: 0;
    padding: 27px 30px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-brief-document {
    margin-top: 23px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-functional-empty {
    min-height: 184px;
    padding: 27px 29px;
    display: grid;
    align-content: center;
    justify-items: start;
    gap: 8px;
    color: var(--p4-text);
    border: 1px solid var(--p4-line);
    border-left: 1px solid var(--p4-accent);
    border-radius: 10px;
    background:
      linear-gradient(112deg, color-mix(in srgb, var(--p4-accent) 7%, transparent), transparent 42%),
      var(--p4-surface);
    box-shadow: none;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-functional-empty .p4-kicker {
    color: var(--p4-text-3);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-functional-empty > strong {
    color: var(--p4-text);
    font-size: 18px;
    font-weight: 650;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-functional-empty > p {
    max-width: 620px;
    margin: 0 0 4px;
    color: var(--p4-text-2);
    font-size: 13px;
    line-height: 1.65;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-functional-empty .p4-secondary {
    min-height: 34px;
    padding: 0 13px;
    border-radius: 7px;
    font-size: 12px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-project-map {
    padding: 22px 24px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-project-empty {
    margin-top: 14px;
  }

  body.projects-pilot-active[data-theme] .projects-pilot-layout {
    align-items: start;
  }

  body.projects-pilot-active[data-theme] .projects-empty-timeline {
    min-height: 176px;
    padding: 30px 34px;
  }

  body.projects-pilot-active[data-theme] .projects-health-panel {
    min-height: 0;
  }

  body.review-reference-active[data-theme] #view-drafts .draft-queue {
    min-height: 300px;
  }

  body.review-reference-active[data-theme] #view-drafts .draft-queue .p4-functional-empty {
    min-height: 190px;
    margin-top: 16px;
  }

  body.memory-reference-active[data-theme] #view-memory .memory-grid {
    align-items: start;
  }

  body.memory-reference-active[data-theme] #view-memory #memory-list .p4-functional-empty {
    min-height: 246px;
  }

  body.meetings-reference-active[data-theme] #view-meetings .meeting-detail {
    padding-top: 32px;
  }

  body.meetings-reference-active[data-theme] #view-meetings .meeting-empty-state {
    width: 100%;
    max-width: none;
    min-height: 282px;
    margin: 0;
    padding: 31px 34px;
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(360px, .72fr);
    grid-template-rows: auto auto 1fr auto;
    column-gap: 54px;
    align-content: center;
    border-radius: 10px;
    box-shadow: none;
  }

  body.meetings-reference-active[data-theme] #view-meetings .meeting-empty-state > .eyebrow {
    grid-column: 1;
  }

  body.meetings-reference-active[data-theme] #view-meetings .meeting-empty-state h3 {
    grid-column: 1;
    margin-top: 12px;
  }

  body.meetings-reference-active[data-theme] #view-meetings .meeting-empty-state > p {
    grid-column: 1;
  }

  body.meetings-reference-active[data-theme] #view-meetings .meeting-empty-state ul {
    grid-column: 2;
    grid-row: 1 / span 4;
    align-self: center;
    margin: 0;
    padding: 24px 26px;
    border: 1px solid var(--p4-line);
    border-radius: 9px;
    background: color-mix(in srgb, var(--p4-canvas) 65%, transparent);
  }

  body.meetings-reference-active[data-theme] #view-meetings .meeting-empty-state > button {
    grid-column: 1;
    justify-self: start;
    margin-top: 19px;
  }

  body.agent-center-active[data-theme] #view-agent .p4-agent-hero {
    position: relative;
    overflow: hidden;
    color: var(--p4-text);
    border: 1px solid var(--p4-line);
    border-radius: 12px;
    background:
      linear-gradient(112deg, color-mix(in srgb, var(--p4-accent) 11%, transparent), transparent 45%),
      var(--p4-surface);
    box-shadow: none;
  }

  body.agent-center-active[data-theme] #view-agent .p4-agent-hero::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 1px;
    content: "";
    background: var(--p4-accent);
  }

  body.agent-center-active[data-theme] #view-agent .p4-agent-hero p {
    color: var(--p4-text-2);
  }
}

/* P4 complete theme contract.
 * Every desktop route and native form control consumes the same semantic tokens.
 */
@media (min-width: 821px) {
  html:has(body.p4-framework[data-theme="paper"]) {
    color-scheme: light;
    background: #f5f1e8;
  }

  html:has(body.p4-framework[data-theme="studio"]) {
    color-scheme: light;
    background: #eff3f0;
  }

  html:has(body.p4-framework[data-theme="night"]) {
    color-scheme: dark;
    background: #0d1310;
  }

  body.p4-framework[data-theme="paper"] {
    --p4-bg: #f5f1e8;
    --p4-canvas: #f5f1e8;
    --p4-surface: #fffdf8;
    --p4-surface-2: #f1ece2;
    --p4-surface-3: #e6ded1;
    --p4-rail: #eee8dc;
    --p4-rail-active: #dfd6c7;
    --p4-text: #24231f;
    --p4-text-1: #24231f;
    --p4-ink: #24231f;
    --p4-text-2: #5e5d55;
    --p4-text-3: #7d7c73;
    --p4-line: #ded6c8;
    --p4-line-strong: #c2b7a6;
    --p4-accent: #a9ce38;
    --p4-accent-soft: #eaf3cc;
    --p4-accent-ink: #42580e;
    --p4-accent-contrast: #1d2908;
    --p4-warning: #b77f18;
    --p4-warning-soft: #f3e8cd;
    --p4-danger: #b6544e;
    --p4-success: #638541;
    --p4-field: #fffef9;
    --p4-field-hover: #faf6ed;
    --p4-field-disabled: #eae3d8;
    --p4-placeholder: #929187;
    --p4-shadow: 0 9px 28px rgba(58, 48, 34, .065);
  }

  body.p4-framework[data-theme="studio"] {
    --p4-text-1: #17231c;
    --p4-ink: #17231c;
    --p4-accent-contrast: #13261c;
    --p4-field: #ffffff;
    --p4-field-hover: #f5f8f6;
    --p4-field-disabled: #e0e7e2;
    --p4-placeholder: #849189;
  }

  body.p4-framework[data-theme="night"] {
    --p4-bg: #0d1310;
    --p4-canvas: #0d1310;
    --p4-surface: #151d18;
    --p4-surface-2: #1b2520;
    --p4-surface-3: #243129;
    --p4-rail: #090e0b;
    --p4-rail-active: #1c2b23;
    --p4-text: #edf4ef;
    --p4-text-1: #edf4ef;
    --p4-ink: #edf4ef;
    --p4-text-2: #c2cec6;
    --p4-text-3: #93a198;
    --p4-line: #29372f;
    --p4-line-strong: #43554a;
    --p4-accent: #b4dc52;
    --p4-accent-soft: #26361f;
    --p4-accent-ink: #d8efa9;
    --p4-accent-contrast: #172107;
    --p4-warning: #e3ad43;
    --p4-warning-soft: #3b301b;
    --p4-danger: #dd7269;
    --p4-success: #8eb778;
    --p4-field: #111915;
    --p4-field-hover: #17211b;
    --p4-field-disabled: #202923;
    --p4-placeholder: #738278;
    --p4-shadow: 0 12px 36px rgba(0, 0, 0, .24);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] {
    color: var(--p4-text);
    background: var(--p4-canvas) !important;
    scrollbar-color: var(--p4-line-strong) var(--p4-canvas);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .workspace,
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .view {
    color: var(--p4-text);
    background: transparent !important;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] :is(
    .p4-card,
    .summer-sheet,
    .integration-card,
    .automation-card,
    .automation-now,
    .automation-connections,
    .memory-card,
    .auth-card,
    .chat-panel,
    .chat-side section,
    .projects-toolbar,
    .projects-record-list,
    .projects-health-panel,
    .projects-health-card,
    .projects-empty-timeline,
    .meeting-empty-state,
    .meeting-context-block,
    .meeting-item-card,
    .draft-compose-panel,
    .draft-queue,
    .draft-group,
    .draft-card,
    .generator-card,
    .manual-draft-card,
    .work-capture,
    .global-inbox-card,
    .time-ledger,
    .time-calendar,
    .time-record-form,
    .p4-appearance-panel
  ) {
    color: var(--p4-text);
    border-color: var(--p4-line) !important;
    background: var(--p4-surface) !important;
    box-shadow: var(--p4-shadow);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] :is(
    .p4-command,
    .p4-run-result,
    .p4-source-ledger article,
    .p4-project-row,
    .p4-project-mini,
    .p4-schedule-item,
    .projects-record-main,
    .projects-health-summary,
    .meeting-action,
    .meeting-source-row,
    .draft-summary,
    .draft-body,
    .memory-suggestions button,
    .integration-permissions span,
    .push-preferences,
    .automation-rule,
    .automation-connection-card,
    .time-summary > div,
    .calendar-grid > *,
    .p4-accessibility-settings label
  ) {
    border-color: var(--p4-line) !important;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] :is(
    .view h1,
    .view h2,
    .view h3,
    .view h4,
    .p4-appearance-panel h2,
    .p4-setting-label b
  ) {
    color: var(--p4-text) !important;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] :is(
    .page-lead p,
    .chat-intro p,
    .integration-card p,
    .automation-card p,
    .p4-appearance-panel > p,
    .p4-setting-label small,
    .empty-note,
    .muted
  ) {
    color: var(--p4-text-2) !important;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]),
    textarea,
    select:not([data-model-picker])
  ) {
    color: var(--p4-text-1) !important;
    caret-color: var(--p4-accent);
    border: 1px solid var(--p4-line-strong) !important;
    border-radius: 8px;
    background: var(--p4-field) !important;
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--p4-text) 3%, transparent) !important;
    transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]),
    textarea,
    select:not([data-model-picker])
  ):hover:not(:disabled) {
    border-color: color-mix(in srgb, var(--p4-accent) 42%, var(--p4-line-strong)) !important;
    background: var(--p4-field-hover) !important;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]),
    textarea,
    select:not([data-model-picker])
  ):focus,
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]),
    textarea,
    select
  ):focus-visible {
    border-color: var(--p4-accent) !important;
    outline: 0 !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--p4-accent) 20%, transparent) !important;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] :is(input, textarea)::placeholder {
    color: var(--p4-placeholder) !important;
    opacity: 1;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] :is(input, textarea, select):disabled {
    color: var(--p4-text-3) !important;
    border-color: var(--p4-line) !important;
    background: var(--p4-field-disabled) !important;
    cursor: not-allowed;
    opacity: .82;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] select option {
    color: var(--p4-text-1);
    background: var(--p4-field);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] input:-webkit-autofill,
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] input:-webkit-autofill:hover,
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--p4-text-1);
    box-shadow: 0 0 0 1000px var(--p4-field) inset !important;
    transition: background-color 9999s ease-out;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] :is(
    input[type="checkbox"],
    input[type="radio"],
    input[type="range"]
  ) {
    accent-color: var(--p4-accent);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] input[type="file"] {
    color: var(--p4-text-2);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] input[type="file"]::file-selector-button {
    min-height: 34px;
    margin-right: 10px;
    padding: 0 12px;
    color: var(--p4-text);
    border: 1px solid var(--p4-line-strong);
    border-radius: 7px;
    background: var(--p4-surface-2);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] :is(
    .ghost-button,
    .mini-button,
    .text-button,
    .p4-secondary,
    .draft-filter,
    .draft-bulk-button,
    .integration-actions > button,
    .voice-settings > summary,
    .voice-shortcuts button
  ) {
    color: var(--p4-text);
    border-color: var(--p4-line-strong) !important;
    background: var(--p4-surface-2) !important;
    box-shadow: none;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] :is(
    .primary-button,
    .p4-primary,
    .draft-bulk-button.is-primary,
    .p4-lifecycle span.is-gate i
  ) {
    color: var(--p4-accent-contrast) !important;
    border-color: color-mix(in srgb, var(--p4-accent) 78%, var(--p4-line-strong)) !important;
    background: var(--p4-accent) !important;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] :is(
    button,
    summary,
    [role="button"]
  ):focus-visible {
    outline: 2px solid var(--p4-accent);
    outline-offset: 2px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] dialog {
    color: var(--p4-text);
    border-color: var(--p4-line);
    background: var(--p4-surface);
    box-shadow: 0 22px 70px rgba(0, 0, 0, .28);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] dialog::backdrop {
    background: color-mix(in srgb, var(--p4-canvas) 70%, transparent);
    backdrop-filter: blur(5px);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] :is(
    .task-detail-head,
    .task-detail-body,
    .task-detail-actions,
    .mail-reader-head,
    .mail-reader-body,
    .mail-reader-actions
  ) {
    color: var(--p4-text);
    border-color: var(--p4-line) !important;
    background: var(--p4-surface) !important;
  }

  body.p4-framework[data-theme="night"] .p4-panel-backdrop {
    background: rgba(2, 7, 4, .7);
  }

  body.p4-framework[data-theme="night"] :is(.p4-theme-choices i, .p4-profile-avatar) {
    border-color: var(--p4-line-strong);
  }

  body.p4-framework[data-theme="night"] input:is([type="date"], [type="time"], [type="datetime-local"])::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: .72;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] :is(
    .projects-filter,
    .projects-search,
    .model-picker,
    .p4-model-setting > label,
    .projects-health-reminder
  ) {
    color: var(--p4-text);
    border-color: var(--p4-line-strong) !important;
    background: var(--p4-surface-2) !important;
    box-shadow: none !important;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] :is(
    .projects-filter > span,
    .projects-search > span,
    .model-picker > span,
    .work-form label,
    .douyin-form label,
    .automation-quiet-form label,
    .time-record-form label,
    .task-edit-form label
  ) {
    color: var(--p4-text-2) !important;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .draft-compose-panel > summary {
    color: var(--p4-text) !important;
    border-color: var(--p4-line) !important;
    background: var(--p4-surface-2) !important;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .draft-compose-panel > summary > span {
    color: var(--p4-text) !important;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .draft-compose-panel > summary > small {
    color: var(--p4-text-3) !important;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .draft-filter.is-active {
    color: var(--p4-accent-ink) !important;
    border-color: color-mix(in srgb, var(--p4-accent) 48%, var(--p4-line)) !important;
    background: var(--p4-accent-soft) !important;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .model-picker select {
    color: var(--p4-text-1) !important;
    background-color: transparent !important;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active.model-switch-visible:not(.today-pilot-active)[data-theme] .topbar .model-picker {
    position: relative;
    height: 42px;
    min-width: 194px;
    padding: 0 38px 0 14px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    border: 1px solid var(--p4-line-strong) !important;
    border-radius: 10px;
    background: var(--p4-surface-2) !important;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active.model-switch-visible:not(.today-pilot-active)[data-theme] .topbar .model-picker::after {
    content: "";
    position: absolute;
    right: 15px;
    width: 8px;
    height: 8px;
    border-right: 1.5px solid var(--p4-text-2);
    border-bottom: 1.5px solid var(--p4-text-2);
    transform: translateY(-2px) rotate(45deg);
    pointer-events: none;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active.model-switch-visible:not(.today-pilot-active)[data-theme] .topbar .model-picker > span {
    padding-right: 12px;
    border-right: 1px solid var(--p4-line);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active.model-switch-visible:not(.today-pilot-active)[data-theme] .topbar .model-picker select {
    min-width: 0;
    padding: 0;
    border: 0 !important;
    border-radius: 0;
    outline: 0 !important;
    appearance: none;
    background: transparent !important;
    box-shadow: none !important;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-chat .chat-intro {
    min-height: 56px !important;
    padding: 10px 18px !important;
    display: flex;
    align-items: center;
    gap: 16px;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-chat .chat-intro .prompt-chips {
    margin-top: 0;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-chat.chat-has-messages .chat-intro {
    min-height: 38px !important;
    padding: 8px 16px !important;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-chat.chat-has-messages .chat-intro .hero-kicker {
    grid-row: auto;
  }
}

/* Phase 1: bounded work queue, full-page detail/resources, compact integrations */
@media (min-width: 821px) {
  body.p4-framework.item-detail-open[data-theme] {
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work {
    min-height: calc(100vh - 72px);
  }

  body.p4-framework.projects-pilot-active[data-theme] .projects-toolbar {
    --work-toolbar-control-height: 46px;
    position: sticky;
    top: 82px;
    z-index: 12;
    grid-template-columns: minmax(150px, .72fr) minmax(260px, 1.6fr) minmax(150px, .72fr) auto;
    margin-bottom: 14px;
    box-shadow: 0 8px 18px color-mix(in srgb, var(--p4-canvas) 84%, transparent);
  }

  body.p4-framework.projects-pilot-active[data-theme] :is(
    .projects-filter,
    .projects-search,
    .projects-sort
  ) {
    height: var(--work-toolbar-control-height);
    min-height: var(--work-toolbar-control-height);
    padding: 0 13px;
    gap: 9px;
    color: var(--p4-text-2);
    border: 1px solid var(--p4-line-strong);
    border-radius: 10px;
    background: var(--p4-field);
    box-shadow: none;
    transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
  }

  body.p4-framework.projects-pilot-active[data-theme] :is(
    .projects-filter,
    .projects-search,
    .projects-sort
  ):hover {
    border-color: color-mix(in srgb, var(--p4-accent) 38%, var(--p4-line-strong));
    background: var(--p4-field-hover);
  }

  body.p4-framework.projects-pilot-active[data-theme] :is(
    .projects-filter,
    .projects-search,
    .projects-sort
  ):focus-within {
    border-color: var(--p4-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--p4-accent) 18%, transparent);
  }

  body.p4-framework.projects-pilot-active[data-theme] :is(
    .projects-filter,
    .projects-search,
    .projects-sort
  ) > span {
    flex: 0 0 auto;
    color: var(--p4-text-2);
    font-size: 16px;
    line-height: 1;
  }

  body.p4-framework.projects-pilot-active[data-theme] :is(
    .projects-filter select,
    .projects-search input,
    .projects-sort select
  ) {
    width: 100%;
    min-width: 0;
    height: 100%;
    min-height: 0;
    padding: 0 !important;
    color: var(--p4-text-1) !important;
    border: 0 !important;
    border-radius: 0;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font: 500 14px/1.45 var(--projects-sans);
  }

  body.p4-framework.projects-pilot-active[data-theme] :is(
    .projects-filter select,
    .projects-search input,
    .projects-sort select
  ):is(:hover, :focus, :focus-visible) {
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body.p4-framework.projects-pilot-active[data-theme] .projects-sort {
    display: flex;
    align-items: center;
  }

  body.p4-framework.projects-pilot-active[data-theme] .projects-create-button {
    height: var(--work-toolbar-control-height);
    min-height: var(--work-toolbar-control-height);
    padding: 0 17px;
    color: #f7faf7;
    border: 1px solid color-mix(in srgb, var(--p4-accent-contrast) 86%, var(--p4-accent));
    border-radius: 10px;
    background: color-mix(in srgb, var(--p4-accent-contrast) 86%, var(--p4-accent));
    box-shadow: none;
    font: 600 14px/1.45 var(--projects-sans);
    white-space: nowrap;
    transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
  }

  body.p4-framework.projects-pilot-active[data-theme] .projects-create-button:hover {
    color: #f7faf7;
    border-color: color-mix(in srgb, var(--p4-accent-contrast) 72%, var(--p4-accent));
    background: color-mix(in srgb, var(--p4-accent-contrast) 72%, var(--p4-accent));
    box-shadow: none;
    filter: none;
    transform: none;
  }

  body.p4-framework.projects-pilot-active[data-theme] .projects-create-button:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--p4-accent) 22%, transparent);
  }

  body.p4-framework.projects-pilot-active[data-theme] .projects-record .projects-track-dot {
    display: none;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-main {
    min-height: 78px;
    padding: 8px 12px;
    grid-template-columns: 40px minmax(110px, 145px) 78px minmax(190px, 1fr) 86px 76px 50px;
    gap: 8px;
    color: var(--p4-text);
    border-color: var(--p4-line);
    background: var(--p4-surface-2);
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .work-list {
    gap: 8px;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-icon {
    width: 38px;
    height: 38px;
    font-size: 17px;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-project {
    font-size: 13px;
    font-weight: 650;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work :is(
    .projects-record-type,
    .projects-record-status
  ) {
    padding: 4px 8px;
    font-size: 12.5px;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-copy strong {
    font-size: 15px;
    font-weight: 520;
    line-height: 1.24;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-copy small {
    margin-top: 2px;
    font-size: 12.5px;
    line-height: 1.3;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-context {
    min-width: 0;
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-next {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: var(--p4-text-2);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-resource {
    max-width: 150px;
    min-width: 0;
    height: 22px;
    padding: 0 7px;
    flex: 0 1 150px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--p4-text-2);
    border: 1px solid var(--p4-line);
    border-radius: 999px;
    background: var(--p4-surface);
    font: 550 11.5px/1 var(--projects-sans);
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-resource[hidden] {
    display: none;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-resource-icon {
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
    display: inline-grid;
    place-items: center;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-resource-icon svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-resource-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-resource b {
    margin-left: auto;
    color: var(--p4-text-3);
    font: inherit;
    white-space: nowrap;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work :is(
    .projects-record-main time,
    .projects-record-open
  ) {
    font-size: 13px;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-main:hover {
    border-color: var(--p4-line-strong);
    background: var(--p4-field-hover);
  }

  body.p4-framework.projects-pilot-active[data-theme] .projects-record-icon,
  body.p4-framework.projects-pilot-active[data-theme] .projects-record.status-yellow .projects-record-icon,
  body.p4-framework.projects-pilot-active[data-theme] .projects-record.status-red .projects-record-icon {
    color: var(--p4-text-2);
    border: 1px solid var(--p4-line-strong);
    background: var(--p4-surface-2);
    box-shadow: none;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work :is(
    .projects-filter,
    .projects-search,
    .projects-sort
  ) {
    height: var(--work-toolbar-control-height);
    min-height: var(--work-toolbar-control-height);
    padding: 0 13px;
    gap: 9px;
    border: 1px solid var(--p4-line-strong);
    border-radius: 10px;
    background: var(--p4-field);
    box-shadow: none;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work :is(
    #work-filter,
    #work-search,
    #work-sort
  ) {
    width: 100%;
    min-width: 0;
    height: 100%;
    min-height: 0;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font: 500 14px/1.45 var(--projects-sans);
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work :is(
    #work-filter,
    #work-search,
    #work-sort
  ):is(:hover, :focus, :focus-visible) {
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  body.p4-framework.projects-pilot-active[data-theme] #view-work :is(
    .projects-filter,
    .projects-search,
    .projects-sort
  ) {
    background: var(--p4-surface) !important;
    font-family: var(--projects-sans);
  }
  body.p4-framework.projects-pilot-active[data-theme] #view-work :is(
    .projects-filter,
    .projects-search,
    .projects-sort
  ):focus-within {
    border-color: var(--p4-accent) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--p4-accent) 18%, transparent) !important;
  }

  /* The work search must remain one control even when the pilot body flag is absent. */
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-search {
    height: 46px;
    min-height: 46px;
    padding: 0 13px;
    gap: 9px;
    color: var(--p4-text-2);
    border: 1px solid var(--p4-line-strong);
    border-radius: 10px;
    background: var(--p4-field);
    box-shadow: none;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-search input {
    width: 100%;
    min-width: 0;
    height: 100%;
    min-height: 0;
    padding: 0 !important;
    color: var(--p4-text-1) !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font: 500 14px/1.45 var(--projects-sans, var(--p4-ui));
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-search:focus-within {
    border-color: var(--p4-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--p4-accent) 18%, transparent);
  }
  body.p4-framework.projects-pilot-active[data-theme] .work-list-panel {
    height: clamp(460px, 56vh, 600px);
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid var(--p4-line);
    border-radius: 14px;
    background: var(--p4-surface);
    box-shadow: var(--p4-shadow);
  }

  body.p4-framework.projects-pilot-active[data-theme] #work-list {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  body.p4-framework.projects-pilot-active[data-theme] .projects-list-heading {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--p4-surface);
  }

  body.p4-framework.projects-pilot-active[data-theme] .work-list-footer {
    min-height: 48px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: var(--p4-text-3);
    border-top: 1px solid var(--p4-line);
    background: var(--p4-surface-2);
  }

  body.p4-framework.projects-pilot-active[data-theme] .work-list-footer small {
    font-size: 12px;
  }

  body.p4-framework.projects-pilot-active[data-theme] .work-list-footer button {
    min-height: 32px;
    white-space: nowrap;
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-workspace {
    display: block;
    padding: 14px 0 80px;
  }

  body.p4-framework.item-detail-open[data-theme] .item-detail-page,
  body.p4-framework.item-detail-open[data-theme] .task-detail-shell {
    width: 100%;
    max-width: none;
    margin: 0;
    color: var(--p4-text);
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  body.p4-framework.item-detail-open[data-theme] .task-detail-shell > .mail-reader-head {
    min-height: 54px;
    padding: 0 2px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 0 !important;
    background: transparent !important;
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-back {
    padding: 0;
    color: var(--p4-text-2);
    border: 0;
    background: transparent;
    font-weight: 650;
  }

  body.p4-framework.item-detail-open[data-theme] .task-detail-navigation {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--p4-text-2);
    font-size: 12px;
    white-space: nowrap;
  }

  body.p4-framework.item-detail-open[data-theme] .task-detail-navigation .ghost-button {
    min-height: 34px;
    padding: 6px 10px;
  }

  body.p4-framework.item-detail-open[data-theme] .task-edit-form {
    display: grid;
    gap: 16px;
  }

  body.p4-framework.item-detail-open[data-theme] :is(
    .task-edit-grid label,
    .task-edit-source,
    .task-activity-history,
    .work-detail-advanced
  ) {
    color: var(--p4-text);
    border-color: var(--p4-line);
    background: var(--p4-surface);
  }

  body.p4-framework.item-detail-open[data-theme] .task-detail-title {
    padding: 26px 30px;
    border: 1px solid var(--p4-line);
    border-radius: 14px;
    background: var(--p4-surface);
    box-shadow: var(--p4-shadow);
  }

  body.p4-framework.item-detail-open[data-theme] .task-detail-title h2 {
    max-width: 980px;
    margin: 12px 0 8px;
    color: var(--p4-text);
    font: 520 clamp(34px, 3.1vw, 52px)/1.12 var(--p4-editorial);
    letter-spacing: -.025em;
  }

  body.p4-framework.item-detail-open[data-theme] .task-detail-title p {
    margin: 0;
    color: var(--p4-text-2);
    font-size: 14px;
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-summary {
    position: sticky;
    top: 82px;
    z-index: 10;
    padding: 11px 16px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    border: 1px solid var(--p4-line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--p4-surface) 94%, transparent);
    backdrop-filter: blur(16px);
    box-shadow: var(--p4-shadow);
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-summary > span {
    min-width: 0;
    padding: 2px 14px;
    display: grid;
    gap: 3px;
    border-right: 1px solid var(--p4-line);
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-summary > span:last-child {
    border-right: 0;
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-summary small {
    color: var(--p4-text-3);
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-summary strong {
    overflow: hidden;
    color: var(--p4-text);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-grid,
  body.p4-framework.item-detail-open[data-theme] .work-resource-summary {
    padding: 22px;
    border: 1px solid var(--p4-line);
    border-radius: 14px;
    background: var(--p4-surface);
  }

  body.p4-framework.item-detail-open[data-theme] .work-next-step,
  body.p4-framework.item-detail-open[data-theme] .work-detail-advanced {
    border: 1px solid var(--p4-line);
    border-radius: 10px;
    background: var(--p4-surface-2);
  }

  body.p4-framework.item-detail-open[data-theme] .work-next-step > summary {
    min-height: 54px;
    padding: 10px 14px;
    display: grid;
    grid-template-columns: 94px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    color: var(--p4-text);
    cursor: pointer;
  }

  body.p4-framework.item-detail-open[data-theme] .work-next-step > summary strong {
    overflow: hidden;
    font-size: 13px;
    font-weight: 560;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.p4-framework.item-detail-open[data-theme] .work-next-step[open] > summary strong {
    display: none;
  }

  body.p4-framework.item-detail-open[data-theme] .work-next-step label {
    display: block;
    padding: 0 14px 14px;
  }

  body.p4-framework.item-detail-open[data-theme] .work-resource-summary-head,
  body.p4-framework.item-detail-open[data-theme] .work-resource-summary-head > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  body.p4-framework.item-detail-open[data-theme] .work-resource-summary h3 {
    margin: 2px 0 0;
    font-size: 18px;
  }

  body.p4-framework.item-detail-open[data-theme] .work-resource-preview-list {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  body.p4-framework.item-detail-open[data-theme] .work-resource-preview-list a {
    min-width: 0;
    padding: 12px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    color: var(--p4-text);
    border: 1px solid var(--p4-line);
    border-radius: 9px;
    background: var(--p4-surface-2);
  }

  body.p4-framework.item-detail-open[data-theme] .work-resource-icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
  }

  body.p4-framework.item-detail-open[data-theme] .work-resource-preview-list a > span:nth-child(2) {
    min-width: 0;
    display: grid;
    gap: 3px;
  }

  body.p4-framework.item-detail-open[data-theme] .work-resource-preview-list strong,
  body.p4-framework.item-detail-open[data-theme] .work-resource-preview-list small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.p4-framework.item-detail-open[data-theme] .work-resource-preview-list small,
  body.p4-framework.item-detail-open[data-theme] .work-resource-empty,
  body.p4-framework.item-detail-open[data-theme] .work-resource-loading {
    color: var(--p4-text-3);
    font-size: 12px;
  }

  body.p4-framework.item-detail-open[data-theme] .task-detail-actions {
    position: sticky;
    bottom: 12px;
    z-index: 12;
    margin-top: 2px;
    border: 1px solid var(--p4-line) !important;
    border-radius: 12px;
    box-shadow: 0 16px 34px rgba(0, 0, 0, .12);
  }

  body.p4-framework.resource-workspace-open[data-theme] .resource-workspace {
    position: fixed;
    inset: 72px 0 0 196px;
    z-index: 45;
    display: block;
    overflow-y: auto;
    color: var(--p4-text);
    background: var(--p4-canvas);
  }

  body.p4-framework.resource-workspace-open[data-theme] .resource-page {
    width: min(1180px, calc(100% - 64px));
    max-width: none;
    margin: 0 auto;
    padding: 30px 0 70px;
    background: transparent;
    box-shadow: none;
  }

  body.p4-framework.resource-workspace-open[data-theme] .resource-breadcrumb {
    margin-bottom: 18px;
    color: var(--p4-text-2);
  }

  body.p4-framework.resource-workspace-open[data-theme] :is(.resource-drawer-head, .resource-toolbar, .resource-row, .resource-list-footer, .resource-add-panel) {
    color: var(--p4-text);
    border-color: var(--p4-line);
    background: var(--p4-surface);
  }

  body.p4-framework.connections-reference-active[data-theme] .integration-grid {
    align-items: start;
  }

  body.p4-framework.connections-reference-active[data-theme] .integration-card {
    min-height: 0 !important;
  }

  body.p4-framework.connections-reference-active[data-theme] .integration-card-head {
    gap: 12px;
  }

  body.p4-framework.connections-reference-active[data-theme] .integration-card-toggle {
    min-height: 34px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--p4-text-2);
    border: 1px solid var(--p4-line);
    border-radius: 8px;
    background: var(--p4-surface-2);
  }

  body.p4-framework.connections-reference-active[data-theme] .integration-card-toggle i {
    font-style: normal;
    transition: transform .18s ease;
  }

  body.p4-framework.connections-reference-active[data-theme] .integration-card.is-expanded .integration-card-toggle i {
    transform: rotate(180deg);
  }

  body.p4-framework.connections-reference-active[data-theme] .integration-card-body {
    margin-top: 16px;
    display: grid;
    gap: 14px;
  }
}

@media (min-width: 821px) {
  body.p4-framework.resource-workspace-open[data-theme] .resource-page,
  body.p4-framework.resource-workspace-open[data-theme] .resource-drawer-shell {
    min-height: 100%;
    height: auto;
    display: block;
    overflow: visible;
  }

  body.p4-framework.resource-workspace-open[data-theme] .resource-drawer-close {
    display: none;
  }

  body.p4-framework.resource-workspace-open[data-theme] .resource-list {
    min-height: 190px;
    padding: 0;
    overflow: visible;
  }

  body.p4-framework.resource-workspace-open[data-theme] .resource-list-footer {
    margin-top: 0;
  }

  body.p4-framework.resource-workspace-open[data-theme] .resource-add-panel {
    margin-top: 12px;
  }

  body.p4-framework.connections-reference-active[data-theme] .integration-card-body[hidden] {
    display: none !important;
  }

  body.p4-framework.connections-reference-active[data-theme] [data-integration-key="mail"].is-expanded {
    grid-column: 1 / -1;
  }

  body.p4-framework.connections-reference-active[data-theme] #mail-feed {
    grid-template-columns: minmax(0, 1fr);
  }

  body.p4-framework.connections-reference-active[data-theme] #mail-feed > section {
    width: 100%;
    min-width: 0;
  }

  body.p4-framework.connections-reference-active[data-theme] #mail-digest-content {
    max-width: 78ch;
    font-size: 13px;
    line-height: 1.75;
  }

  body.p4-framework[data-theme] .p4-live-brief-updates {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--p4-line);
  }

  body.p4-framework[data-theme] .p4-live-brief-updates[hidden] {
    display: none !important;
  }

  body.p4-framework[data-theme] .p4-live-brief-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
  }

  body.p4-framework[data-theme] .p4-live-brief-list article {
    max-width: 78ch;
    padding: 12px 14px;
    border-left: 2px solid var(--p4-accent);
    background: var(--p4-surface-2);
  }

  body.p4-framework[data-theme] .p4-live-brief-list :is(strong, p, small) {
    display: block;
  }

  body.p4-framework[data-theme] .p4-live-brief-list p {
    margin: 5px 0;
    line-height: 1.65;
  }

  body.p4-framework[data-theme] .p4-live-brief-list small {
    color: var(--p4-text-2);
  }
}

/* Global desktop readability closure: keep the existing James shell, reduce display noise,
 * and give every operational form control the same quiet field language. */
@media (min-width: 821px) {
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-brief-card {
    min-height: 232px;
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 20px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-brief-copy {
    max-width: 64ch;
    margin: 16px 0 8px;
    font: 500 17px/1.58 "James Editorial CN", "Songti SC", STSong, serif;
    letter-spacing: -.012em;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-brief-note,
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-activity-item p,
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-project-mini small {
    font-size: 12px;
    line-height: 1.55;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-activity-item b,
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-project-mini b,
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-run-result b {
    font-size: 12px;
    font-weight: 600;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-nav-footer {
    padding: 10px 0 16px;
    background: var(--p4-rail);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-profile {
    min-width: 0;
    margin-top: 10px;
    padding: 8px 10px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-profile > span:last-child {
    min-width: 0;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-profile :is(b, small) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.p4-framework.desktop-retained-ui[data-theme] .view:not(#view-chat) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]), select, textarea):not(#p4-command-input) {
    min-height: 42px;
    padding: 9px 12px;
    color: var(--p4-text);
    border: 1px solid var(--p4-line-strong);
    border-radius: 9px;
    background: var(--p4-surface);
    box-shadow: none;
    font: 500 14px/1.5 var(--projects-sans, var(--p4-ui));
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
  }

  body.p4-framework.desktop-retained-ui[data-theme] .view:not(#view-chat) textarea:not(#p4-command-input) {
    min-height: 88px;
    resize: vertical;
  }

  body.p4-framework.desktop-retained-ui[data-theme] .view:not(#view-chat) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]), select, textarea):not(#p4-command-input):is(:hover, :focus-visible) {
    border-color: var(--p4-accent);
    outline: 0;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--p4-accent) 14%, transparent);
  }

  body.p4-framework.desktop-retained-ui[data-theme] .view:not(#view-chat) :is(label, .task-edit-source) > span {
    color: var(--p4-text-2);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .01em;
  }

  @media (max-width: 1180px) {
    body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] {
      min-width: 0;
    }

    body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-confirmed-grid {
      grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-brief-card,
    body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-priority,
    body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-activity-card,
    body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-project-pulse,
    body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-schedule-card {
      grid-column: span 6;
    }
  }
}

/* P3 bounded UI closure: restrained type, semantic rows, compact item editor. */
@media (min-width: 821px) {
  body.p4-framework.desktop-retained-ui[data-theme] :is(
    .p4-page-hero h2,
    .p4-view-hero h2,
    .projects-pilot-lead h2,
    .page-lead h2,
    .chat-intro h2
  ) {
    font-size: clamp(28px, 2.25vw, 34px) !important;
    font-weight: 500 !important;
    line-height: 1.16 !important;
    letter-spacing: -.018em !important;
  }

  body.p4-framework.desktop-retained-ui[data-theme] :is(
    .page-lead p,
    .p4-page-hero p,
    .p4-view-hero p,
    .projects-pilot-lead p,
    .chat-intro p
  ) {
    font-size: 14px !important;
    font-weight: 430 !important;
    line-height: 1.6 !important;
    letter-spacing: 0 !important;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-status::before {
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    border-radius: 50%;
    background: currentColor;
    content: "";
  }

  body.p4-framework.item-detail-open[data-theme] .task-edit-form {
    gap: 12px;
  }

  body.p4-framework.item-detail-open[data-theme] .task-detail-title {
    min-height: 92px;
    padding: 17px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
  }

  body.p4-framework.item-detail-open[data-theme] .task-detail-title h2 {
    margin: 4px 0 5px;
    font: 600 22px/1.28 var(--projects-sans);
    letter-spacing: -.012em;
  }

  body.p4-framework.item-detail-open[data-theme] .task-detail-title p {
    font-size: 12.5px;
    font-weight: 430;
    line-height: 1.5;
  }

  body.p4-framework.item-detail-open[data-theme] .task-detail-title-actions {
    flex: 0 0 auto;
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-grid {
    padding: 18px 20px 20px;
    display: grid;
    grid-template-columns: 1.4fr .8fr .9fr 1fr;
    gap: 13px;
  }

  body.p4-framework.item-detail-open[data-theme] .work-current-overview,
  body.p4-framework.item-detail-open[data-theme] .work-current-fields,
  body.p4-framework.item-detail-open[data-theme] .item-update-composer,
  body.p4-framework.item-detail-open[data-theme] .item-update-timeline {
    color: var(--p4-text);
    border-color: var(--p4-line);
    background: var(--p4-surface);
  }

  body.p4-framework.item-detail-open[data-theme] .work-current-overview-grid {
    border-color: var(--p4-line);
    background: var(--p4-line);
  }

  body.p4-framework.item-detail-open[data-theme] .work-current-overview-grid > div {
    background: var(--p4-field);
  }

  body.p4-framework.item-detail-open[data-theme] .work-current-fields-grid {
    display: grid;
    grid-template-columns: 1.4fr .8fr .9fr 1fr;
    gap: 13px;
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-grid > label,
  body.p4-framework.item-detail-open[data-theme] .work-current-fields-grid > label {
    min-width: 0;
    padding: 0;
    display: grid;
    gap: 7px;
    color: var(--p4-text-2);
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-grid > label > span,
  body.p4-framework.item-detail-open[data-theme] .work-current-fields-grid > label > span,
  body.p4-framework.item-detail-open[data-theme] .work-detail-advanced-grid label > span {
    color: var(--p4-text-2);
    font: 600 12px/1.35 var(--projects-sans);
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-grid > label > :is(input, select),
  body.p4-framework.item-detail-open[data-theme] .work-current-fields-grid > label > :is(input, select),
  body.p4-framework.item-detail-open[data-theme] .work-detail-advanced-grid label > :is(input, select) {
    height: 44px;
    min-height: 44px;
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-grid :is(input, textarea, select),
  body.p4-framework.item-detail-open[data-theme] .work-detail-advanced-grid :is(input, textarea, select) {
    padding: 9px 12px;
    color: var(--p4-text);
    border: 1px solid var(--p4-line-strong);
    border-radius: 9px;
    background: var(--p4-field);
    box-shadow: none;
    font: 500 14px/1.5 var(--projects-sans);
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-grid textarea {
    min-height: 82px;
    resize: vertical;
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-grid > .task-edit-wide {
    grid-column: 1 / -1;
  }

  body.p4-framework.item-detail-open[data-theme] .work-current-fields-grid > .task-edit-wide {
    grid-column: 1 / -1;
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-extras {
    grid-column: 1 / -1;
    color: var(--p4-text);
    border: 1px solid var(--p4-line);
    border-radius: 10px;
    background: var(--p4-surface-2);
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-extras > summary {
    min-height: 52px;
    padding: 8px 14px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 18px;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    list-style: none;
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-extras > summary::-webkit-details-marker {
    display: none;
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-extras > summary::after {
    color: var(--p4-text-3);
    content: "+";
    font-size: 18px;
    font-weight: 400;
    text-align: center;
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-extras[open] > summary::after {
    content: "−";
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-extras > summary > span {
    font: 650 14px/1.35 var(--projects-sans);
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-extras > summary > small {
    overflow: hidden;
    color: var(--p4-text-3);
    font: 500 12px/1.35 var(--projects-sans);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-extras-body {
    padding: 0 12px 12px;
    display: grid;
    gap: 10px;
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-extras .work-resource-summary {
    padding: 11px 12px;
    border: 1px solid var(--p4-line);
    border-radius: 9px;
    background: var(--p4-surface);
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-extras .work-resource-summary h3 {
    margin: 2px 0 0;
    font-size: 14px;
    font-weight: 650;
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-extras .work-resource-empty,
  body.p4-framework.item-detail-open[data-theme] .work-detail-extras .work-resource-loading {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.45;
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-advanced-grid {
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 11px;
    border: 1px solid var(--p4-line);
    border-radius: 9px;
    background: var(--p4-surface);
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-advanced-grid label {
    min-width: 0;
    padding: 0;
    display: grid;
    gap: 6px;
    color: var(--p4-text-2);
    border: 0;
    background: transparent;
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-advanced-grid .task-edit-wide {
    grid-column: 1 / -1;
  }

  body.p4-framework.item-detail-open[data-theme] .work-detail-extra-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
  }

  body.p4-framework.item-detail-open[data-theme] .task-detail-actions[hidden] {
    display: none !important;
  }

  body.p4-framework.item-detail-open[data-theme] .task-detail-actions {
    min-height: 58px;
    padding: 8px 12px 8px 16px;
  }

  body.p4-framework.item-detail-open[data-theme] .task-detail-actions > span {
    font-size: 12px;
  }
}

@media (max-width: 820px) {
  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record {
    padding-left: 0;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-track-dot {
    display: none;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-main {
    width: 100%;
    min-height: 118px;
    padding: 12px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    grid-template-areas:
      "icon project status"
      "icon copy copy"
      "type type time";
    align-items: center;
    gap: 7px 10px;
    color: var(--p4-text);
    text-align: left;
    border: 1px solid var(--p4-line);
    border-radius: 12px;
    background: var(--p4-surface);
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-icon {
    width: 36px;
    height: 36px;
    grid-area: icon;
    display: grid;
    place-items: center;
    color: var(--p4-text-2);
    border: 1px solid var(--p4-line-strong);
    border-radius: 50%;
    background: var(--p4-surface-2);
    font-family: var(--projects-editorial);
    font-size: 16px;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-project {
    min-width: 0;
    grid-area: project;
    overflow: hidden;
    font-size: 13px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-type {
    width: fit-content;
    grid-area: type;
    color: var(--p4-text-3);
    font-size: 11.5px;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-status {
    grid-area: status;
    font-size: 11.5px;
    white-space: nowrap;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-copy {
    min-width: 0;
    grid-area: copy;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-copy strong,
  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-copy strong {
    font-size: 14px;
    font-weight: 580;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-copy small {
    margin-top: 2px;
    color: var(--p4-text-3);
    font-size: 11.5px;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-context {
    min-width: 0;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-next {
    min-width: 0;
    flex: 1 1 auto;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-resource {
    max-width: 108px;
    min-width: 0;
    height: 20px;
    padding: 0 6px;
    flex: 0 1 108px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    overflow: hidden;
    color: var(--p4-text-2);
    border: 1px solid var(--p4-line);
    border-radius: 999px;
    background: var(--p4-surface-2);
    font-size: 10.5px;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-resource[hidden],
  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-open {
    display: none;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-resource-icon,
  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-resource-icon svg {
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    fill: none;
    stroke: currentColor;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-resource-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-resource b {
    display: none;
  }

  body.p4-framework.projects-pilot-active[data-theme] #view-work .projects-record-main time {
    grid-area: time;
    color: var(--p4-text-3);
    font-size: 11.5px;
    text-align: right;
  }
}

/* Work-page polish: keep the dense operational queue readable without changing other routes. */
@media (min-width: 821px) {
  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] .p4-more-menu .nav-item b {
    max-width: none;
    color: inherit;
  }

  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-list-heading {
    padding-right: 14px;
  }

  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work #work-count {
    color: var(--p4-text-2);
    font: 500 13px/1.2 var(--projects-sans, var(--p4-ui));
    letter-spacing: 0;
    white-space: nowrap;
  }

  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-record-main {
    padding-inline: 14px;
    grid-template-columns: 38px minmax(118px, 160px) 68px minmax(210px, 1fr) 88px 70px 26px;
    gap: 7px;
  }

  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-record-copy :is(strong, small),
  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-record-main time {
    font-family: var(--projects-sans, var(--p4-ui));
    letter-spacing: 0;
  }

  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-record-copy strong {
    font-size: 14px;
    font-weight: 600;
  }

  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-record-open {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: var(--p4-text-2);
    font-size: 0;
    text-align: center;
  }

  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-record-open::after {
    width: 7px;
    height: 7px;
    content: "";
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(-45deg);
  }
}

/* Desktop conversation layout: flat thread rail beside the message canvas. */
@media (min-width: 821px) {
  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .chat-layout {
    grid-template-columns: 248px minmax(0, 1fr);
    gap: 12px;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .conversation-rail {
    grid-column: 1;
    grid-row: 1;
    height: 100%;
    border: 1px solid var(--p4-line);
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(48, 46, 38, .035);
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .chat-panel {
    grid-column: 2;
    grid-row: 1;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .chat-thread-menu,
  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .chat-thread-new,
  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .conversation-rail-close,
  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .conversation-backdrop {
    display: none !important;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .chat-threadbar {
    min-height: 48px;
    flex: 0 0 48px;
    grid-template-columns: minmax(0, 1fr);
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .chat-threadbar > div {
    justify-items: start;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .chat-intro[hidden] {
    display: none !important;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .message-list {
    padding-top: 14px;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .composer {
    padding: 8px 11px 9px;
    gap: 6px 10px;
  }

  body.p4-framework.chat-reference-active.desktop-retained-ui[data-theme] #view-chat .composer textarea {
    min-height: 44px;
    max-height: 88px;
    padding: 10px 11px;
  }
}

@media (min-width: 821px) {
  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-record-main {
    width: 100%;
    grid-template-columns: 38px minmax(112px, 152px) minmax(280px, 1fr) 84px 92px 26px;
  }

  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-record-type {
    display: none;
  }

  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-record-context {
    display: flex;
    justify-content: flex-start;
  }

  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work .projects-record-resource {
    max-width: 128px;
    flex: 0 1 128px;
    order: -1;
  }

  body.p4-framework.projects-pilot-active.desktop-retained-ui.desktop-reference-active[data-theme] #view-work :is(.projects-record-next, .projects-record-update) {
    min-width: 0;
    flex: 1 1 auto;
  }
}

/* Dashboard and memory-page balance: reduce hollow cards and reveal secondary controls only when useful. */
@media (min-width: 821px) {
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-confirmed-grid {
    align-items: start;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] :is(
    .p4-activity-card,
    .p4-project-pulse,
    .p4-schedule-card
  ) {
    align-self: start;
    min-height: 292px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-schedule-item {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-schedule-item > span {
    white-space: nowrap;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-agent-summary {
    min-height: 64px;
    grid-template-columns: 176px minmax(0, 1fr) 112px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] #p4-agent-summary > div {
    min-height: 38px;
    padding: 4px 10px;
    border: 0;
    border-left: 1px solid var(--p4-line);
    border-radius: 0;
    background: transparent;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] #p4-agent-summary > div:first-child {
    border-left: 0;
  }

  body.memory-reference-active[data-theme] #view-memory {
    padding-top: 24px;
  }

  body.memory-reference-active[data-theme] #view-memory .page-lead {
    margin-bottom: 16px;
  }

  body.p4-framework.memory-reference-active.desktop-retained-ui[data-theme] #view-memory .page-lead h2 {
    font-size: 30px !important;
  }

  body.memory-reference-active[data-theme] #view-memory .memory-grid {
    gap: 16px;
    align-items: start;
  }

  body.memory-reference-active[data-theme] #view-memory .summer-sheet {
    padding: 22px;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(48, 46, 38, .035);
  }

  body.memory-reference-active[data-theme] #view-memory .chat-settings-panel > summary {
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--p4-line);
    border-radius: 8px;
    background: var(--p4-field);
  }

  body.memory-reference-active[data-theme] #view-memory #memory-form .primary-button {
    width: auto;
    min-width: 180px;
    justify-self: end;
    padding-inline: 22px;
  }

  body.memory-reference-active[data-theme] #view-memory .memory-suggestions {
    margin-top: 18px;
    padding-top: 16px;
  }
}

@media (min-width: 1181px) {
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-activity-card {
    grid-column: span 4;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-project-pulse {
    grid-column: span 5;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-schedule-card {
    grid-column: span 3;
  }
}

@media (min-width: 1100px) {
  body.memory-reference-active[data-theme] #view-memory .memory-grid {
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
    grid-template-rows: auto auto;
  }

  body.memory-reference-active[data-theme] #view-memory .memory-grid > section:nth-child(1) {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  body.memory-reference-active[data-theme] #view-memory .memory-grid > section:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
  }

  body.memory-reference-active[data-theme] #view-memory .memory-grid > section:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
  }
}

@media (min-width: 821px) and (max-width: 1099px) {
  body.memory-reference-active[data-theme] #view-memory .memory-grid {
    grid-template-columns: 1fr;
  }

  body.memory-reference-active[data-theme] #view-memory .memory-grid > section {
    grid-column: 1;
    grid-row: auto;
  }
}

/* P5 interface integrity: mobile controls remain reliably tappable without changing desktop density. */
@media (max-width: 820px) {
  body.p4-framework[data-theme] .p4-page-hero h2 {
    max-width: 100%;
    text-wrap: balance;
  }

  body.p4-framework[data-theme] :is(
    .app-chrome .chrome-brand,
    .app-chrome button,
    .p4-primary,
    .p4-secondary,
    .p4-text-link,
    .text-link,
    .ghost-button,
    .mini-button,
    .conversation-tabs button,
    .conversation-rail-head > button,
    .conversation-item-action,
    .chat-thread-menu,
    .chat-thread-new,
    .chat-load-older,
    .voice-shortcuts button,
    .memory-suggestions button,
    .voice-switch,
    .p4-source-orbit,
    .p4-agent-entry,
    [data-work-filter-option],
    [data-work-health-all],
    summary
  ) {
    min-width: 44px;
    min-height: 44px;
  }

  body.p4-framework[data-theme] :is(
    input[type="search"],
    input[type="date"],
    input[type="time"],
    input[type="range"],
    select
  ) {
    min-height: 44px;
  }

  body.p4-framework[data-theme] :is(.p4-text-link, .text-link) {
    padding-block: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  body.p4-framework[data-theme] .p4-profile {
    cursor: default;
  }
}

/* P5 visual-system closure: one operational type system, calmer hierarchy,
 * compact clear states, and structural mobile adaptation. Business behavior
 * and route ownership remain unchanged. */
body.p4-framework[data-theme] {
  --j-type-page: 600 2rem/1.18 var(--p4-ui);
  --j-type-section: 600 1.25rem/1.3 var(--p4-ui);
  --j-type-item: 600 1rem/1.45 var(--p4-ui);
  --j-type-body: 450 .875rem/1.6 var(--p4-ui);
  --j-type-control: 600 .875rem/1.4 var(--p4-ui);
  --j-type-meta: 550 .75rem/1.45 var(--p4-ui);
  --j-space-1: 4px;
  --j-space-2: 8px;
  --j-space-3: 12px;
  --j-space-4: 16px;
  --j-space-5: 20px;
  --j-space-6: 24px;
  --j-space-8: 32px;
}

body.p4-framework[data-theme="studio"] {
  --p4-text-3: #59685f;
  --p4-warning: #8a5b06;
}

body.p4-framework[data-theme] :is(.view, dialog) :is(h1, h2, h3, h4),
body.p4-framework[data-theme] :is(.p4-card-heading, .section-heading) :is(h2, h3, h4) {
  font-family: var(--p4-ui);
  text-wrap: balance;
}

body.p4-framework[data-theme] :is(
  .p4-page-hero h2,
  .p4-view-hero h2,
  .projects-pilot-lead h2,
  .page-lead h2,
  .chat-intro h2
) {
  font: var(--j-type-page) !important;
  letter-spacing: -.018em !important;
}

body.p4-framework[data-theme] :is(
  .p4-card-heading h3,
  .section-heading h3,
  .work-overview-head h3,
  .automation-reference-brief h3,
  .automation-reference-health h3,
  .automation-control h3,
  .automation-history h3,
  .automation-connections h3
) {
  font: var(--j-type-section) !important;
  letter-spacing: -.01em;
}

body.p4-framework[data-theme] :is(
  .page-lead > div:has(> .eyebrow),
  .p4-page-hero .p4-kicker,
  .p4-view-hero .p4-kicker,
  .p4-card-heading .p4-kicker,
  .p4-card-heading .eyebrow,
  .section-heading .eyebrow
) {
  display: none;
}

body.p4-framework[data-theme] :is(.p4-primary, .p4-secondary, .primary-button, .ghost-button) {
  font: var(--j-type-control);
}

body.p4-framework[data-theme="studio"] :is(.p4-primary, .primary-button) {
  color: #fff !important;
}

body.p4-framework[data-theme] :is(
  .p4-freshness,
  .p4-priority-state,
  .p4-brief-note,
  .p4-run-title span,
  .p4-run-result small,
  .p4-project-mini small,
  .p4-schedule-item > span,
  .p4-schedule-item small,
  #p4-agent-summary b,
  .p4-source-ledger time,
  .p4-project-summary span,
  .p4-muted,
  .p4-project-name small,
  .p4-capability-card > div,
  .p4-capability-card p,
  .p4-capability-card footer b,
  .p4-capability-card footer button,
  .work-overview-copy small,
  .work-overview-tail,
  .projects-record-update,
  .automation-reference-metrics span,
  .automation-reference-health-body > div > span,
  .automation-reference-health-body small,
  .automation-update-diagnostics small,
  .automation-update-diagnostics footer,
  .automation-rule-head > small,
  .automation-rule-stat small,
  .automation-rule-boundary small
) {
  color: var(--p4-text-3);
  font-family: var(--p4-ui);
  font-size: 12px;
  font-weight: 550;
  line-height: 1.45;
  letter-spacing: 0;
}

/* The complete brief is the only reading surface that keeps the editorial
 * family. Navigation, controls, labels and operational cards stay in UI sans. */
body.p4-framework[data-theme] .p4-brief-document,
body.p4-framework[data-theme] .p4-brief-document :is(h3, h4, p) {
  font-family: var(--p4-editorial);
}

body.p4-framework[data-theme] .p4-brief-document {
  font-size: 15.5px;
  font-weight: 450;
  line-height: 1.82;
}

body.p4-framework[data-theme] .p4-brief-document :is(.p4-brief-dateline, .p4-brief-item-index, .p4-brief-item-meta, .p4-brief-item-source) {
  font-family: var(--p4-ui);
}

body.p4-framework[data-theme] ::selection {
  color: var(--p4-text);
  background: color-mix(in srgb, var(--p4-accent) 28%, transparent);
}

@media (min-width: 821px) {
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .view {
    font: var(--j-type-body);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] :is(
    .p4-today,
    #view-brief,
    #view-projects,
    #view-agent,
    #view-work,
    #view-automation,
    #view-memory,
    #view-time,
    #view-drafts,
    #view-integrations
  ) {
    max-width: 1480px;
    margin-inline: auto;
  }

  /* Today is a decision cockpit: decision first, brief second, support below. */
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-confirmed-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--j-space-4);
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-priority {
    grid-column: 1 / -1;
    order: -3;
    min-height: 0;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-brief-card {
    grid-column: 1 / -1;
    order: -2;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-run-section {
    grid-column: span 7;
    order: -1;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-activity-card {
    grid-column: span 5;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-project-pulse {
    grid-column: span 7;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-schedule-card {
    grid-column: span 5;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-agent-summary {
    grid-column: 1 / -1;
    min-height: 0;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] :is(
    .p4-priority,
    .p4-activity-card,
    .p4-project-pulse,
    .p4-schedule-card,
    .p4-agent-summary
  ) {
    padding: var(--j-space-5) var(--j-space-6);
  }

  /* Empty means checked and clear, not an abandoned canvas. */
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] :is(
    .p4-functional-empty,
    .meeting-empty-state,
    .projects-empty-timeline,
    .work-overview-empty,
    .p4-empty
  ) {
    min-height: 0 !important;
    max-width: 760px;
    padding: 24px 26px !important;
    align-content: center;
    justify-content: start;
    text-align: left;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .meeting-empty-state {
    margin: 32px auto 0 32px;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] :is(
    .p4-functional-empty > strong,
    .meeting-empty-state h3,
    .projects-empty-timeline h3,
    .empty-panel strong
  ) {
    font: var(--j-type-section) !important;
  }

  /* Settings lead with the durable memory task; voice remains available on demand. */
  body.memory-reference-active[data-theme] #view-memory .chat-settings-card {
    grid-row: auto;
  }

  body.memory-reference-active[data-theme] #view-memory .chat-settings-panel:not([open]) {
    padding-bottom: 0;
  }

  body.memory-reference-active[data-theme] #view-memory .chat-settings-panel > summary {
    font: var(--j-type-control);
  }

  /* A short result set should not imitate a full, empty viewport. */
  body.p4-framework.projects-pilot-active[data-theme] .work-list-panel:has(#work-list > .projects-record:only-child) {
    height: auto;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-brief-copy {
    font: var(--j-type-section);
    letter-spacing: -.012em;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-priority-content h4 {
    font: var(--j-type-item) !important;
  }
}

@media (max-width: 820px) {
  body.p4-framework[data-theme] {
    --j-type-page: 650 1.75rem/1.16 var(--p4-ui);
    --j-type-section: 650 1.25rem/1.3 var(--p4-ui);
    --j-type-item: 650 1rem/1.45 var(--p4-ui);
    --j-type-body: 450 .9375rem/1.62 var(--p4-ui);
    --j-type-control: 600 .875rem/1.4 var(--p4-ui);
    --j-type-meta: 550 .75rem/1.45 var(--p4-ui);
  }

  body.p4-framework[data-theme] .view {
    font: var(--j-type-body);
  }

  body.p4-framework[data-theme] :is(
    .p4-page-hero h2,
    .p4-view-hero h2,
    .projects-pilot-lead h2,
    .page-lead h2,
    .chat-intro h2
  ) {
    max-width: 18ch;
    font: var(--j-type-page) !important;
    text-wrap: balance;
  }

  body.p4-framework[data-theme] :is(
    .p4-card-heading h3,
    .section-heading h3,
    .work-overview-head h3,
    .automation-reference-brief h3,
    .automation-reference-health h3
  ) {
    font: var(--j-type-section) !important;
  }

  /* Automation becomes three scannable surfaces instead of one long card. */
  body.automation-reference-active[data-theme] #view-automation .automation-now {
    padding: 0;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none;
  }

  body.automation-reference-active[data-theme] #view-automation .automation-reference-overview {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  body.automation-reference-active[data-theme] #view-automation :is(
    .automation-reference-brief,
    .automation-reference-health,
    .automation-update-diagnostics
  ) {
    min-width: 0;
    padding: 18px 16px;
    border: 1px solid var(--p4-line);
    border-radius: 14px;
    background: var(--p4-surface);
    box-shadow: var(--p4-shadow);
  }

  body.automation-reference-active[data-theme] #view-automation .automation-reference-metrics {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  body.automation-reference-active[data-theme] #view-automation .automation-reference-metrics article {
    min-width: 0;
    padding: 12px 8px;
    text-align: center;
  }

  body.automation-reference-active[data-theme] #view-automation .automation-reference-brief-copy p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
  }

  body.automation-reference-active[data-theme] #view-automation .automation-reference-health-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  body.automation-reference-active[data-theme] #view-automation .automation-reference-health-body > div + div {
    padding-top: 14px;
    border-top: 1px solid var(--p4-line);
    border-left: 0;
  }

  body.automation-reference-active[data-theme] #view-automation .automation-update-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.automation-reference-active[data-theme] #view-automation .automation-control {
    padding: 18px 16px;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  body.automation-reference-active[data-theme] #view-automation #automation-master-toggle {
    width: 100%;
  }

  /* Work reaches the list after three compact control rows, not five. */
  body.projects-pilot-active[data-theme] #view-work .projects-pilot-lead {
    padding-bottom: 14px;
  }

  body.projects-pilot-active[data-theme] #view-work .projects-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
  }

  body.projects-pilot-active[data-theme] #view-work .projects-search {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  body.projects-pilot-active[data-theme] #view-work .projects-filter {
    grid-column: 1;
    grid-row: 2;
  }

  body.projects-pilot-active[data-theme] #view-work .projects-sort {
    grid-column: 2;
    grid-row: 2;
  }

  body.projects-pilot-active[data-theme] #view-work .projects-create-button {
    grid-column: 1 / -1;
    grid-row: 3;
    width: 100%;
  }

  body.projects-pilot-active[data-theme] #view-work :is(.projects-filter, .projects-sort, .projects-search, .projects-create-button) {
    min-width: 0;
    min-height: 46px;
  }

  /* Long conversations keep a usable reading viewport above fixed mobile nav. */
  body.chat-reference-active[data-theme] #view-chat .chat-panel {
    min-height: calc(100dvh - 176px);
  }

  body.chat-reference-active[data-theme] #view-chat .message-list {
    min-height: 240px;
    scroll-padding-block: 20px 150px;
  }

  body.chat-reference-active[data-theme] #view-chat .composer {
    padding: 12px;
  }

  /* Mobile empty states remain positive, compact, and left aligned. */
  body.p4-framework[data-theme] :is(
    .p4-functional-empty,
    .meeting-empty-state,
    .projects-empty-timeline,
    .work-overview-empty,
    .p4-empty
  ) {
    min-height: 0 !important;
    padding: 20px 18px !important;
    text-align: left;
  }

  /* Decision and current brief stay above supporting health on a narrow screen. */
  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-priority {
    order: -2;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-brief-card {
    order: -1;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-brief-copy {
    font: var(--j-type-section);
    letter-spacing: -.012em;
  }

  body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] .p4-priority-content h4 {
    font: var(--j-type-item) !important;
  }

  body.memory-reference-active[data-theme] #view-memory .chat-settings-panel > summary {
    font: var(--j-type-control);
  }

  body.memory-reference-active[data-theme] #view-memory .chat-settings-card:has(.chat-settings-panel:not([open])) {
    min-height: 0;
    padding-bottom: 18px;
  }
}

/* Personal project decisions stay in Projects; Today keeps only the brief and execution state. */
body.p4-framework.desktop-retained-ui.desktop-reference-active[data-theme] #view-dashboard .p4-priority {
  display: none !important;
}

/* 0.23.15: operational readability and long-page continuity. */
body.p4-framework[data-theme] .view :is(
  small,
  time,
  .eyebrow,
  .p4-kicker,
  .safe-note,
  .meeting-state,
  .work-source,
  .work-overview-tail,
  .work-overview-detail-panel dt,
  .automation-run-origin,
  .automation-rule-recovery,
  .automation-update-diagnostics footer,
  .automation-update-metrics span,
  .automation-update-metrics small,
  .automation-workflow-path > header small,
  .automation-workflow-path li > small,
  .global-inbox-flow,
  .global-inbox-counter span,
  .draft-channel,
  .draft-recipient,
  .p4-freshness,
  .p4-source-chip,
  .p4-agent-policy,
  .p4-priority-meta,
  .p4-muted,
  .p4-project-health,
  .p4-policy-list span,
  .resource-copy > div,
  .resource-url,
  .resource-list-footer
) {
  font-size: 12px !important;
  line-height: 1.5;
}

body.p4-framework[data-theme] .view :is(button, input, select, textarea, summary) {
  font-size: 14px;
}

body.chat-reference-active[data-theme] #view-chat :is(
  .conversation-item p,
  .conversation-rail p,
  .avatar,
  .voice-interrupt
),
body.projects-pilot-active[data-theme] #view-work :is(
  .projects-record-type,
  .projects-record-status,
  .projects-health-card p,
  .projects-health-reminder p
),
body.automation-reference-active[data-theme] #view-automation :is(
  .automation-workflow-path li > span,
  .automation-state,
  .automation-connection-card .is-pending,
  .automation-connection-card .is-ready,
  .automation-run-status
) {
  font-size: 12px !important;
  line-height: 1.45;
}

body.chat-reference-active[data-theme] #view-chat .message-text {
  white-space: normal;
}

body.chat-reference-active[data-theme] #view-chat .message-text > :first-child {
  margin-top: 0;
}

body.chat-reference-active[data-theme] #view-chat .message-text > :last-child {
  margin-bottom: 0;
}

body.chat-reference-active[data-theme] #view-chat .message-text p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.7;
}

body.chat-reference-active[data-theme] #view-chat .chat-markdown-heading {
  margin: 14px 0 7px;
  color: inherit;
  font-family: var(--p4-ui);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

body.chat-reference-active[data-theme] #view-chat .chat-markdown-list {
  margin: 8px 0 12px;
  padding-inline-start: 22px;
  display: grid;
  gap: 5px;
}

body.chat-reference-active[data-theme] #view-chat .message-text blockquote {
  margin: 10px 0 12px;
  padding: 7px 0 7px 12px;
  color: var(--p4-text-2);
  border-left: 1px solid var(--p4-accent);
}

body.chat-reference-active[data-theme] #view-chat .message.user .message-text blockquote {
  color: inherit;
  border-left-color: rgba(255, 255, 255, .6);
}

body.automation-reference-active[data-theme] #view-automation .automation-reference-pulse i.is-history-failure {
  background: #a9a28f;
  box-shadow: 0 0 0 2px rgba(169, 162, 143, .13);
}

.meeting-local-nav {
  display: none;
}

body.meetings-reference-active[data-theme] #view-meetings :is(
  #meeting-highlights,
  #meeting-actions,
  #meeting-context
) {
  scroll-margin-top: 92px;
}

@media (max-width: 820px) {
  body.memory-reference-active[data-theme] #view-memory .summer-sheet,
  body.memory-reference-active[data-theme] #view-memory .memory-card {
    border-radius: 12px;
  }

  body.memory-reference-active[data-theme] #view-memory #memory-form .primary-button {
    width: 100%;
    min-width: 0;
    justify-self: stretch;
    color: #fff;
    border-color: var(--p4-accent-ink);
    border-radius: 10px;
    background: var(--p4-accent-ink);
  }

  body.memory-reference-active[data-theme] #view-memory .chat-settings-card {
    min-height: 0 !important;
    padding: 16px !important;
  }

  body.memory-reference-active[data-theme] #view-memory :is(
    .voice-settings-grid label,
    .voice-settings-grid output,
    .voice-switch span,
    #memory-form > label
  ) {
    font-size: 12px !important;
    line-height: 1.5;
  }

  body.memory-reference-active[data-theme] #view-memory .memory-card > div,
  body.memory-reference-active[data-theme] #view-memory .memory-card > div :is(span, small) {
    font: 600 12px/1.45 var(--jd-mono) !important;
  }

  body.memory-reference-active[data-theme] #view-memory .memory-card p {
    font-size: 14px !important;
    line-height: 1.65;
  }

  body.memory-reference-active[data-theme] #view-memory .memory-suggestions button {
    border-radius: 10px;
  }

  body.automation-reference-active[data-theme] #view-automation .automation-reference-brief-copy p {
    -webkit-line-clamp: 4;
  }

  body.automation-reference-active[data-theme] #view-automation .automation-reference-icon {
    display: none;
  }

  body.automation-reference-active[data-theme] #view-automation :is(
    .automation-reference-brief > header,
    .automation-reference-health > header
  ) {
    min-height: 0;
    padding: 0 0 14px;
  }

  body.automation-reference-active[data-theme] #view-automation .automation-workflow-path ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  body.automation-reference-active[data-theme] #view-automation .automation-workflow-path li {
    min-height: 68px;
    padding: 7px 8px 8px 30px;
    border-top: 0;
    border-left: 1px solid var(--p4-line);
  }

  body.automation-reference-active[data-theme] #view-automation .automation-workflow-path li:last-child {
    grid-column: 1 / -1;
  }

  body.meetings-reference-active[data-theme] #view-meetings .meeting-local-nav {
    position: sticky;
    z-index: 6;
    top: 58px;
    margin: 0 -2px 12px;
    padding: 6px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    border: 1px solid var(--p4-line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--p4-bg) 92%, transparent);
    box-shadow: 0 8px 20px rgba(40, 54, 46, .07);
    backdrop-filter: blur(12px);
  }

  body.meetings-reference-active[data-theme] #view-meetings .meeting-detail {
    overflow: visible;
  }

  body.meetings-reference-active[data-theme] #view-meetings .meeting-local-nav button {
    min-width: 0;
    min-height: 44px;
    padding: 0 10px;
    color: var(--p4-text-2);
    border: 0;
    border-radius: 8px;
    background: transparent;
  }

  body.meetings-reference-active[data-theme] #view-meetings .meeting-local-nav button:focus-visible {
    color: var(--p4-accent-ink);
    outline: 2px solid var(--p4-accent);
    outline-offset: -2px;
    background: var(--p4-accent-soft);
  }

  body.meetings-reference-active[data-theme] #view-meetings :is(
    #meeting-highlights,
    #meeting-actions,
    #meeting-context
  ) {
    scroll-margin-top: 120px;
  }

  body.projects-pilot-active[data-theme] #view-work :is(
    .projects-record-meta,
    .projects-record-source,
    .projects-record-update,
    .work-overview-copy small,
    .work-overview-tail
  ) {
    font-size: 12px !important;
    line-height: 1.5;
  }

  body.chat-reference-active[data-theme] #view-chat .message-list {
    max-height: none;
  }
}

/* 0.23.16 candidate: close the remaining operational microtype gaps without
 * changing the established James hierarchy or mobile information density. */
body.p4-framework[data-theme] :is(
  .p4-brand small,
  .p4-nav-label,
  .p4-nav-count,
  .p4-profile small
) {
  font-size: 11px !important;
  line-height: 1.35;
}

body.p4-framework[data-theme] :is(
  .p4-primary,
  .p4-secondary,
  .p4-text-link
) {
  font-size: 14px !important;
  line-height: 1.4;
}

body.p4-framework[data-theme] :is(
  .p4-brief-chip,
  .p4-source-orbit strong,
  .p4-source-orbit span,
  .p4-run-result > span,
  .p4-project-mini > strong,
  .p4-schedule-count,
  .p4-brief-dateline,
  .p4-brief-conclusion > span,
  .p4-brief-section-heading > span,
  .p4-brief-item-index,
  .p4-brief-item-meta > span,
  .p4-brief-item-source > span,
  .p4-project-progress > b,
  .automation-rule-stat > span,
  .automation-rule-boundary > span,
  .integration-card-head p,
  .integration-note,
  .integration-permissions > span,
  .connection-state,
  #voice-status
) {
  font-size: 12px !important;
  line-height: 1.45;
}

body.p4-framework[data-theme] :is(
  .p4-lifecycle span > i,
  .p4-lifecycle b,
  .p4-capability-card > div,
  .p4-capability-card footer b,
  .p4-capability-card footer button
) {
  font-size: 12px !important;
  line-height: 1.4;
}
