/* Shared PH palette. Tool/status colours match the v3 dark variants in v2.css.
   Opt-in only: the landing, application, help and the landing's sandboxed demo. */
body.v2.ph-themed[data-theme=light]{
  color-scheme:light;--v2-ground:#fafafa;--v2-surface:#fff;--v2-soft:#f3f4f3;
  --v2-ink:#191919;--v2-muted:#606860;--v2-action:#191919;--v2-hover:#343834;
  --v2-border:#e2e6e2;--v2-control:#858d85;--v3-on-action:#fff;--v3-focus:#256348;
  --ph-good:#246246;--ph-good-bg:#edf6ef;--ph-warn:#895018;--ph-warn-bg:#fcf2e5;
  --ph-blue:#345c9c;--ph-blue-bg:#eff4fc;
}
body.v2.ph-themed{background:var(--v2-ground);color:var(--v2-ink)}
.ph-themed .ph-theme-controls{padding-block:24px}
.ph-themed #ph-theme{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:36px;padding:6px 10px;border:1px solid var(--v2-control);border-radius:8px;background:var(--v2-surface);color:var(--v2-ink);font:500 12px/1.4 var(--sans);cursor:pointer}
.ph-themed #ph-theme:hover{background:var(--v2-soft)}
body.v2.ph-themed :focus-visible{outline:3px solid var(--v3-focus);outline-offset:3px}
body.v2.ph-themed[data-theme=light] button:not(.primary):hover{background:var(--v2-soft);color:var(--v2-ink)}
@media screen{
  body.v2.ph-themed[data-theme=dark]{
    color-scheme:dark;--v2-ground:#0b0c0e;--v2-surface:#15181c;--v2-soft:#1d2228;
    --v2-ink:#ececec;--v2-muted:#b9c0c9;--v2-action:#f2f1ed;--v2-hover:#dddfe4;
    --v2-border:rgb(255 255 255 / .10);--v2-control:#7d8997;--v3-on-action:#15181c;--v3-focus:#a4c9ff;
    --tool-days:#a4c9ff;--tool-deadlines:#e9c57d;--tool-costs:#9ad5b0;--tool-title:#ccb3f3;--tool-social:#f2b2a3;--topic-travel:#58d3dd;
    --status-green:#a8dbb9;--status-amber:#f0ce91;--status-red:#ffb3bc;--status-grey:#c0c8d1;
    --status-green-bg:#233a2e;--status-amber-bg:#3e3320;--status-red-bg:#432930;--status-grey-bg:#2c323b;
    --ph-good:var(--status-green);--ph-good-bg:var(--status-green-bg);
    --ph-warn:var(--status-amber);--ph-warn-bg:var(--status-amber-bg);
    --ph-blue:var(--tool-days);--ph-blue-bg:#243247;
    --ph-accent:var(--tool-costs);--ph-accent-soft:var(--status-green-bg);--ph-dark:var(--v2-surface);
    --ph-dot-green:#4ade80;--ph-dot-blue:#60a5fa;--ph-dot-amber:#fbbf24;
    --ph-highlight:inset 0 1px 0 rgb(255 255 255 / .05);
    --v2-shadow:var(--ph-highlight),0 16px 40px -24px #000;
    --anil-ink:var(--v2-ink);--anil-mid:var(--tool-days);--anil-wash:var(--v2-soft);--anil-pale:var(--v2-border);
    --error:var(--status-red);
  }
  .ph-themed[data-theme=dark] :is(h1,h2,h3,h4,.ph-kpi>strong,.ph-stat strong,.ph-demo-amount,.ph-demo-report-summary dd){color:#fff}
  .ph-themed[data-theme=dark] ::selection{background:var(--tool-days);color:var(--v3-on-action)}
  .ph-themed[data-theme=dark] .skip:focus{background:var(--v2-action);color:var(--v3-on-action)}
  .ph-themed[data-theme=dark] :is(.ph-card,.ph-kpi,.ph-close-hero,.ph-feature,.ph-request-card,.ph-admin-panel,.ph-demo-card){box-shadow:var(--ph-highlight);border-color:var(--v2-border)}
  .ph-themed[data-theme=dark] :is(.ph-product-window,.ph-screen,.tool-window,dialog,.v2-demo-frame){border-color:var(--v2-border);box-shadow:var(--ph-highlight),0 24px 64px -24px #000,0 0 40px -24px #a4c9ff33}
  .ph-themed[data-theme=dark] :is(.ph-local:before,.ph-window-status:before){background:var(--ph-dot-green)}
  .ph-themed[data-theme=dark] .ph-window-status:before{content:'';display:inline-block;width:6px;height:6px;border-radius:50%;margin-right:7px}
  .ph-themed[data-theme=dark] .ph-badge{background:var(--status-grey-bg);color:var(--status-grey)}
  .ph-themed[data-theme=dark] .ph-badge.good{background:var(--ph-good-bg);color:var(--ph-good);--ph-dot:var(--ph-dot-green)}
  .ph-themed[data-theme=dark] .ph-badge.medium{background:var(--ph-blue-bg);color:var(--ph-blue);--ph-dot:var(--ph-dot-blue)}
  .ph-themed[data-theme=dark] .ph-badge.warn{background:var(--ph-warn-bg);color:var(--ph-warn);--ph-dot:var(--ph-dot-amber)}
  .ph-themed[data-theme=dark] .ph-badge:is(.good,.medium,.warn)::before{content:'';display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--ph-dot);margin-right:6px;vertical-align:1px}
  .ph-themed[data-theme=dark] :is(.btn:not(.sec):not(.ph-secondary),button.primary,.ph-demo-primary){background:var(--v2-action);color:var(--v3-on-action);border-color:var(--v2-action)}
  .ph-themed[data-theme=dark] :is(.btn:not(.sec):not(.ph-secondary),button.primary,.ph-demo-primary):hover{background:var(--v2-hover);color:var(--v3-on-action)}
  .ph-themed[data-theme=dark] :is(.btn.sec,.ph-secondary){color:var(--v2-ink);border-color:var(--v2-control);background:transparent}
  .ph-themed[data-theme=dark] :is(.btn.sec,.ph-secondary):hover{background:var(--v2-soft)}
  .ph-themed[data-theme=dark] input::placeholder,.ph-themed[data-theme=dark] textarea::placeholder{color:var(--v2-muted);opacity:1}
  .ph-themed[data-theme=dark] :is(input,select,textarea,progress){accent-color:var(--tool-costs)}
  .ph-themed[data-theme=dark] progress{background:var(--v2-soft);color:var(--tool-costs)}
  .ph-themed[data-theme=dark] progress::-webkit-progress-bar{background:var(--v2-soft)}
  .ph-themed[data-theme=dark] progress::-webkit-progress-value{background:var(--tool-costs)}
  .ph-themed[data-theme=dark] progress::-moz-progress-bar{background:var(--tool-costs)}
  .ph-themed[data-theme=dark] :is(th,td){border-color:var(--v2-border)}
  .ph-themed[data-theme=dark] tbody tr:nth-child(even){background:rgb(255 255 255 / .025)}
  .ph-themed[data-theme=dark] :is(th,caption){color:var(--v2-muted)}
  .ph-themed[data-theme=dark] .ph-kpi>strong{font-variant-numeric:tabular-nums}
  .ph-themed[data-theme=dark] #ph-message:not(:empty):not([data-error=true]){background:var(--v2-soft);color:var(--v2-ink);border-color:var(--v2-control)}
  .ph-themed[data-theme=dark] :is(header.top,.ph-product-header){background:var(--v2-surface);color:var(--v2-ink);border-color:var(--v2-border)}
  .ph-themed[data-theme=dark] :is(.ph-product-brand,.ph-product-links a){color:var(--v2-ink)}
  .ph-themed[data-theme=dark] :is(.ph-product-brand span,.ph-product-links a+a::before,.ph-placeholder-note){color:var(--v2-muted)}
  .ph-themed[data-theme=dark] .ph-screen-placeholder{background:var(--v2-soft);color:var(--v2-muted)}
  .ph-themed[data-theme=dark] .ph-admin-panel{border:1px solid var(--v2-border)}
  .ph-themed[data-theme=dark] .ph-window-dots i{background:var(--v2-control)}
  .ph-themed[data-theme=dark] :is(#ph-roi-error,.msg.is-error){color:var(--status-red)}
  /* The interactive hero uses the same surfaces as the full application. */
  .ph-themed[data-theme=dark] .ph-hero-demo :is(button,.ph-demo-link,textarea){background:var(--v2-surface);color:var(--v2-ink);border-color:var(--v2-control)}
  .ph-themed[data-theme=dark] .ph-hero-demo :is(button,.ph-demo-link):hover{background:var(--v2-soft)}
  .ph-themed[data-theme=dark] .ph-hero-demo .ph-demo-primary{background:var(--v2-action);color:var(--v3-on-action);border-color:var(--v2-action)}
  .ph-themed[data-theme=dark] .ph-hero-demo .ph-demo-primary:hover{background:var(--v2-hover)}
  .ph-landing[data-theme=dark] .ph-hero-demo .ph-demo-output-links button{background:transparent;border-color:transparent;color:var(--v2-muted)}
  .ph-landing[data-theme=dark] .ph-hero-demo .ph-demo-output-links button:hover{background:var(--v2-soft);color:var(--v2-ink)}
  .ph-themed[data-theme=dark] :is(.ph-demo-toolbar,.ph-demo-statement,.ph-demo-review,.ph-demo-report-summary,.ph-demo-drop){background:var(--v2-soft);border-color:var(--v2-border)}
  .ph-themed[data-theme=dark] .ph-demo-card{background:var(--v2-surface)}
  .ph-themed[data-theme=dark] :is(.ph-demo-evidence,.ph-demo-diagnosis-stats){background:var(--ph-good-bg);border-color:var(--v2-border)}
  .ph-themed[data-theme=dark] .ph-demo-evidence.is-none{background:var(--v2-soft);border-color:var(--v2-border)}
  .ph-themed[data-theme=dark] :is(.ph-demo-coach,.ph-demo-ledger,.ph-demo-message,.ph-demo-finish,.ph-demo-shortcuts,.ph-demo-report,.ph-demo-report [data-demo-report]){border-color:var(--v2-border)}
  .ph-themed[data-theme=dark] :is(.ph-demo-progress span,.ph-demo-progress small,.ph-demo-coach li,.ph-demo-queue h3,.ph-demo-statement button small,.ph-demo-kicker,.ph-demo-note,.ph-demo-stamp,.ph-demo-report-summary dt,.ph-demo-diagnosis-stats dt,.ph-demo-drop p){color:var(--v2-muted)}
  .ph-landing[data-theme=dark] .ph-demo-track{background:var(--v2-soft)}
  .ph-landing[data-theme=dark] .ph-demo-assigned{background:var(--ph-good)}
  .ph-landing[data-theme=dark] .ph-demo-pending{background:var(--ph-warn)}
  .ph-landing[data-theme=dark] .ph-demo-toast{background:var(--v2-soft);color:var(--v2-ink);border-color:var(--v2-control)}
  .ph-themed[data-theme=dark] :is(.ph-demo-toolbar [aria-pressed=true],.ph-demo-statement button[aria-current]){background:var(--ph-good-bg);color:var(--ph-good);border-color:var(--ph-good)}
  .ph-themed[data-theme=dark] .ph-demo-coach [aria-current]{color:var(--ph-good)}
  .ph-themed[data-theme=dark] .ph-demo-coach [aria-current]>span:first-child{background:var(--ph-good);color:var(--v3-on-action);border-color:var(--ph-good)}
}
/* Print must never inherit the screen's dark palette, even after a toggle. */
@media print{
  body.v2.ph-themed[data-theme]{color-scheme:light;--v2-ground:#fff!important;--v2-surface:#fff!important;--v2-soft:#f4f4f4!important;--v2-ink:#111!important;--v2-muted:#333!important;--v2-border:#aaa!important;--v2-action:#111;--v2-control:#777;--ph-good:#246246;--ph-good-bg:#edf6ef;--ph-warn:#895018;--ph-warn-bg:#fcf2e5;--ph-blue:#345c9c;--ph-blue-bg:#eff4fc;background:#fff!important;color:#111!important}
  .ph-themed :is(#ph-theme,.ph-theme-controls){display:none!important}
}

/* PH-only theme. Reuse v3's dark tool/status palette on neutral layered surfaces.
   Screen rules cannot override the council report's light print palette. */
@media screen {
  body.v2:is(.ph-app,.ph-page:not(.ph-themed),.ph-demo)[data-theme=dark] {
    color-scheme:dark;
    --v2-ground:#0b0c0e;--v2-surface:#15181c;--v2-soft:#20252c;
    --v2-ink:#ececec;--v2-muted:#b9c0c9;--v2-action:#f2f1ed;--v2-hover:#dddfe4;
    --v2-border:rgb(255 255 255 / .10);--v2-control:#7d8997;
    --v3-on-action:#15181c;--v3-focus:#a4c9ff;
    --tool-days:#a4c9ff;--tool-deadlines:#e9c57d;--tool-costs:#9ad5b0;--tool-title:#ccb3f3;--tool-social:#f2b2a3;--topic-travel:#58d3dd;
    --status-green:#a8dbb9;--status-amber:#f0ce91;--status-red:#ffb3bc;--status-grey:#c0c8d1;
    --status-green-bg:#233a2e;--status-amber-bg:#3e3320;--status-red-bg:#432930;--status-grey-bg:#2c323b;
    --ph-good:var(--status-green);--ph-good-bg:var(--status-green-bg);
    --ph-warn:var(--status-amber);--ph-warn-bg:var(--status-amber-bg);
    --ph-blue:var(--tool-days);--ph-blue-bg:#21334c;
    --ph-good-dot:#4ade80;--ph-warn-dot:#fbbf24;--ph-blue-dot:#60a5fa;
    --anil-ink:var(--v2-ink);--anil-mid:var(--tool-days);--anil-wash:var(--v2-soft);--anil-pale:var(--v2-border);
    --v2-shadow:inset 0 1px rgb(255 255 255 / .04),0 16px 48px -16px #0009;
  }
  body.v2.ph-app[data-theme=light] {
    color-scheme:light;--v2-ground:#fafafa;--v2-surface:#fff;--v2-soft:#f3f4f3;
    --v2-ink:#191919;--v2-muted:#606860;--v2-action:#191919;--v2-hover:#343834;
    --v2-border:#e2e6e2;--v2-control:#858d85;--v3-focus:#256348;
  }
  .v2:is(.ph-app,.ph-page:not(.ph-themed),.ph-demo)[data-theme=dark] :is(h1,h2,h3,h4,.ph-kpi>strong,.ph-stat strong,.metric strong,.amount) {color:#fff}
  .v2:is(.ph-app,.ph-page:not(.ph-themed))[data-theme=dark] :is(.ph-card,.ph-kpi,.ph-close-hero,.ph-stat,dialog) {box-shadow:inset 0 1px rgb(255 255 255 / .04),0 6px 20px #0002}
  .v2:is(.ph-app,.ph-page:not(.ph-themed))[data-theme=dark] :is(.tool-window,.v2-workspace) {border-color:var(--v2-border);box-shadow:var(--v2-shadow),0 0 48px -24px #a4c9ff26}
  .v2:is(.ph-app,.ph-page:not(.ph-themed))[data-theme=dark] :is(.v2-demo-frame,.tool-panel) {background:var(--v2-surface)}
  .v2.ph-page:not(.ph-themed)[data-theme=light] :is(.ph-boundaries,.ph-boundaries strong) {color:#ececec}
  .v2.ph-page:not(.ph-themed)[data-theme=dark] .v2-method>div {background:var(--v2-surface);color:var(--v2-ink);border:1px solid var(--v2-border);box-shadow:var(--v2-shadow)}
  .v2.ph-page:not(.ph-themed)[data-theme=dark] .v2-method :is(p,a) {color:var(--v2-muted)}
  .v2.ph-page:not(.ph-themed)[data-theme=dark] header.top {background:rgb(21 24 28 / .96)}
  .v2.ph-page:not(.ph-themed)[data-theme=dark] :is(.brand,.foot-brand) .mark {color:var(--tool-days)}
  .v2:is(.ph-app,.ph-page:not(.ph-themed),.ph-demo)[data-theme=dark] :is(.btn:not(.sec),button.primary) {background:var(--v2-action);color:var(--v3-on-action);border-color:var(--v2-action)}
  .v2:is(.ph-app,.ph-page:not(.ph-themed),.ph-demo)[data-theme=dark] :is(.btn:not(.sec),button.primary):hover {background:var(--v2-hover)}
  .v2:is(.ph-app,.ph-page:not(.ph-themed))[data-theme=dark] .btn.sec:hover {background:var(--v2-soft)}
  .v2:is(.ph-app,.ph-page:not(.ph-themed))[data-theme=dark] :is(input,textarea)::placeholder {color:var(--v2-muted);opacity:1}
  .v2:is(.ph-app,.ph-page:not(.ph-themed))[data-theme=dark] :is(a,button,input,select,textarea,summary,[tabindex]):focus-visible {outline-color:var(--v3-focus)}
  .v2:is(.ph-app,.ph-page:not(.ph-themed))[data-theme=dark] :is(th,td) {border-color:var(--v2-border)}
  .v2:is(.ph-app,.ph-page:not(.ph-themed))[data-theme=dark] tbody tr:nth-child(even) {background:rgb(255 255 255 / .025)}
  .v2.ph-app[data-theme=dark] .ph-badge {color:var(--status-grey);background:var(--status-grey-bg)}
  .v2.ph-app[data-theme=dark] .ph-badge.good {color:var(--ph-good);background:var(--ph-good-bg);--ph-dot:var(--ph-good-dot)}
  .v2.ph-app[data-theme=dark] .ph-badge.medium {color:var(--ph-blue);background:var(--ph-blue-bg);--ph-dot:var(--ph-blue-dot)}
  .v2.ph-app[data-theme=dark] .ph-badge.warn {color:var(--ph-warn);background:var(--ph-warn-bg);--ph-dot:var(--ph-warn-dot)}
  .v2.ph-app[data-theme=dark] .ph-badge::before {content:'';display:inline-block;width:6px;height:6px;margin-right:6px;vertical-align:1px;border-radius:50%;background:var(--ph-dot,var(--status-grey))}
  .v2.ph-app[data-theme=dark] .ph-local::before {background:var(--ph-good-dot)}
  .v2.ph-app[data-theme=dark] #ph-message.ph-toast-viewport:not(:empty) {color:var(--v2-ink);background:var(--v2-soft);border-color:var(--v2-border);box-shadow:var(--v2-shadow)}
  .v2.ph-app[data-theme=dark] #ph-message[data-error=true] {color:var(--ph-warn);background:var(--ph-warn-bg);border-color:var(--ph-warn)}
}
/* Shared control, including the help page which has no application layout CSS. */
.v2:is(.ph-app,.ph-page:not(.ph-themed)) #ph-theme {display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:36px;padding:6px 10px;border:1px solid var(--v2-control);border-radius:8px;background:transparent;color:var(--v2-ink);font:500 12px/1.4 var(--sans);cursor:pointer}
.v2:is(.ph-app,.ph-page:not(.ph-themed)) #ph-theme:hover {background:var(--v2-soft)}
.v2.ph-page:not(.ph-themed) .ph-theme-toggle {margin-bottom:20px}
@media(max-width:700px){.v2.ph-app #ph-theme{padding:0 8px}}
@media print {
  .v2:is(.ph-app,.ph-page:not(.ph-themed)) #ph-theme {display:none!important}
  body.v2.ph-app[data-theme] {color-scheme:light;--v2-action:#111;--v2-hover:#333;--v3-on-action:#fff;--ph-good:#246246;--ph-good-bg:#edf6ef;--ph-warn:#895018;--ph-warn-bg:#fcf2e5;--ph-blue:#345c9c;--ph-blue-bg:#eff4fc}
}

/* Shared local file controls. */
.ph-file-control{position:relative;display:flex;align-items:center;flex-wrap:wrap;gap:10px;min-width:0;margin:8px 0 16px}.ph-file-control .ph-file-native{position:absolute!important;width:1px!important;height:1px!important;inset:auto!important;padding:0!important;margin:-1px!important;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.ph-file-control .ph-file-button{display:inline-flex;align-items:center;width:auto;margin:0;padding:10px 14px;border:1px solid var(--v2-control,currentColor);border-radius:6px;cursor:pointer;background:var(--v2-soft,transparent);color:var(--v2-ink,inherit);font-size:13px}.ph-file-native:focus-visible+.ph-file-button{outline:3px solid var(--v3-focus,#256348);outline-offset:3px}.ph-file-native:disabled+.ph-file-button{opacity:.5;cursor:not-allowed}.ph-file-name{min-width:0;overflow-wrap:anywhere;color:var(--v2-muted,inherit);font-size:13px}
body.v2.ph-themed [tabindex="-1"]:focus:not(:focus-visible){outline:none}
/* Application controls retain the same target size in both themes. */
.v2.ph-app #ph-theme{min-width:44px;min-height:44px;width:auto;height:44px}
@media(max-width:650px){.v2.ph-app #ph-theme{width:44px}}
@media screen{.v2.ph-app[data-theme=dark] button.ph-close-primary{background:#a8dbb9;color:#15181c;border-color:#a8dbb9}.v2.ph-app[data-theme=dark] button.ph-close-primary:hover{background:#bfe9cd}}

/* The landing is a single open product surface. These overrides stay here so
   the shared application's cards and status treatments are unaffected. */
body.v2.ph-landing[data-theme]{--v3-focus:var(--ph-good);--v2-hover:#e4e2dc}
body.v2.ph-landing :is(.ph-product-window,.ph-screen,.ph-demo-card,.ph-demo-toast){box-shadow:none;border:0}
body.v2.ph-landing .ph-product-header{background:var(--v2-ground);border:0}
body.v2.ph-landing :is(.ph-demo-toolbar,.ph-demo-statement,.ph-demo-review,.ph-demo-card,.ph-demo-evidence,.ph-demo-evidence.is-none,.ph-demo-diagnosis-stats,.ph-demo-drop){background:transparent;border:0;box-shadow:none}
body.v2.ph-landing .ph-hero-demo :is(button,.ph-demo-link){background:transparent;border:0;color:var(--v2-ink)}
body.v2.ph-landing .ph-hero-demo :is(button,.ph-demo-link):hover{background:transparent;color:var(--v2-ink);text-decoration:underline}
body.v2.ph-landing .ph-hero-demo .ph-demo-decision{border:1px solid var(--v2-control);text-decoration:none}
body.v2.ph-landing .ph-hero-demo .ph-demo-decision:hover{text-decoration:none}
body.v2.ph-landing .ph-demo-statement button[aria-current],body.v2.ph-landing .ph-demo-statement button[aria-current]:hover{background:var(--v2-soft);box-shadow:none;color:var(--v2-ink)}
body.v2.ph-landing .ph-demo-statement button[aria-current]>span{color:var(--ph-good)}
body.v2.ph-landing .ph-demo-toolbar [aria-pressed=true]{background:transparent;box-shadow:inset 0 -2px var(--ph-good);color:var(--v2-ink)}
body.v2.ph-landing .ph-demo-pagination button{padding-inline:0;color:var(--v2-muted)}
body.v2.ph-landing .ph-demo-toast{background:var(--v2-surface);color:var(--v2-ink)}
body.v2.ph-landing .ph-hero-demo button.ph-demo-decision.ph-demo-primary{background:var(--v2-soft);color:var(--v2-ink);border:1px solid var(--v2-control)}
body.v2.ph-landing .ph-hero-demo button.ph-demo-decision.ph-demo-primary:hover{background:var(--v2-soft);color:var(--v2-ink);border-color:var(--ph-good)}
body.v2.ph-landing ::selection{background:var(--ph-good);color:var(--v2-ground)}
body.v2.ph-landing :is(input,textarea){caret-color:var(--ph-good)}
body.v2.ph-landing .ph-hero-demo *{scrollbar-color:var(--v2-control) var(--v2-surface);scrollbar-width:thin}
body.v2.ph-landing .ph-hero-demo ::-webkit-scrollbar{width:8px;height:8px}
body.v2.ph-landing .ph-hero-demo ::-webkit-scrollbar-track{background:var(--v2-surface)}
body.v2.ph-landing .ph-hero-demo ::-webkit-scrollbar-thumb{background:var(--v2-control);border-radius:4px}
body.v2.ph-landing :is(dl,table,.ph-demo-amount,.ph-demo-progress,.ph-demo-statement,.ph-demo-outcome){font-variant-numeric:tabular-nums}
