/* PatientLead Health | Artifacts visual system
   File: assets/plh-artifacts/plh-artifacts.css
   Scope: Artifact pages only (plh-page-artifact)
*/

/* NOTE (2026-02-03):
   Rogue width cap affects:
   - /navigator/hemiplegic-migraine-dashboard/appointment-anchor/
   - /navigator/hemiplegic-migraine-dashboard/decision-ledger/

   Symptom:
   .plh-wrap computes much narrower (w ~286) than other artifacts (w ~704),
   even with identical --plh-max. This indicates a parent/container constraint,
   not an artifact CSS issue.

   Confirmed by DevTools chain: ast-container and site-content widths differ
   page-to-page while .plh-wrap max-width stays the same.

   Future fix path:
   1) Verify both rogue pages use the same page template as the other artifacts.
   2) Verify the same Astra layout setting applies (content layout, boxed/full width).
   3) If template is the same, check for page-level meta overrides or builder wrappers.
   4) If still constrained, isolate artifacts with a dedicated template that hard-sets
      the Astra container width contract on artifact pages only.
*/

/* =========================
   Design system override (intentional)

   This file is the Artifact *visual system* layer.
   It is intentionally enqueued AFTER the runtime surface CSS
   (`assets/plh-artifacts/runtime/plh-artifact-surface.css`).

   Keep this file as the single source of truth for artifact look-and-feel
   (spacing, typography, cards, buttons) so all artifacts stay consistent.
========================= */

/* =========================
   1) Tokens and base
========================= */

.plh-page-artifact{
  --plh-text: #2b4142;
  /* WCAG: 0.82 on white ≈ 6.21:1; on #f4f7f4 (section bg) ≈ 6.04:1 — comfortable AA (was 0.75 / ~5.00:1 marginal) */
  --plh-muted: rgba(43,65,66,0.82);
  /* WCAG: 0.65 on white ≈ 3.97:1; on #f4f7f4 ≈ 3.78:1 — large text + UI only (was 0.58 / ~3.12:1) */
  --plh-faint: rgba(43,65,66,0.65);

  --plh-bg: #ebf0eb;
  --plh-card: #ffffff;
  --plh-border: rgba(43,65,66,0.18);

  --plh-sage: #a3b9a3;
  --plh-teal: #3c5c5e;

  /* Brand actions */
  --plh-cta: #c2552a;   /* strong */
  --plh-cta2: #c97f6d;  /* softer */
  --plh-cta-deep: #864232;

  --plh-radius: 18px;
  --plh-radius-sm: 12px;

  --plh-shadow: 0 6px 18px rgba(43,65,66,0.06);

  --plh-max: 800px;
  --plh-gutter: clamp(18px, 3.2vw, 36px);

  --plh-space-1: 8px;
  --plh-space-2: 12px;
  --plh-space-3: 16px;
  --plh-space-4: 22px;
  --plh-space-5: 30px;
}

.plh-page-artifact,
.plh-page-artifact *{
  box-sizing: border-box;
}

.plh-page-artifact{
  color: var(--plh-text);
  background: var(--plh-bg);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  line-height: 1.55;
}

/* Make the PLH internal wrapper own width on artifact pages */
.plh-page-artifact .plh-wrap{
  display: block;
  float: none;
  clear: both;
  width: 100%;
  max-width: var(--plh-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--plh-gutter);
  padding-right: var(--plh-gutter);
}

/* Ensure the artifact shell itself is a stable, centerable block */
.plh-page-artifact #plh-artifact-shell{
  display: block;
  float: none;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* =========================
   2) Headroom and hero
========================= */

/* The page header block you already render as .plh-hero */
.plh-page-artifact .plh-hero{
  padding-top: 34px;
  padding-bottom: 22px;
}

/* Increase spacing under the hero rule so the first card is not glued to it */
.plh-page-artifact .plh-hero + .plh-rule{
  margin-top: 10px;
  margin-bottom: 22px;
}

/* WCAG: 12px kicker is normal text, needs 4.5:1. Faint (0.58) = 3.12:1 FAIL.
   Promoted to muted (0.75) = 4.64:1. */
.plh-page-artifact .plh-kicker{
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
  color: var(--plh-muted);
}

.plh-page-artifact .plh-h1,
.plh-page-artifact h1{
  font-size: clamp(30px, 3.2vw, 40px);
  line-height: 1.12;
  margin: 10px 0 10px 0;
  font-weight: 800;
  color: var(--plh-text);
}

.plh-page-artifact .plh-subhead,
.plh-page-artifact .plh-hero p{
  max-width: 72ch;
  color: var(--plh-muted);
  margin-top: 10px;
  margin-bottom: 0;
}

/* =========================
   3) Rules and rhythm
========================= */

.plh-page-artifact .plh-rule{
  border: 0;
  border-top: 1px solid rgba(43,65,66,0.14);
  margin: 18px 0;
}

/* Keep consistent vertical rhythm between blocks */
.plh-page-artifact .plh-hero,
.plh-page-artifact section,
.plh-page-artifact .plh-interactive{
  margin-bottom: 18px;
}

/* =========================
   4) Card system (surface and builder)
========================= */

.plh-page-artifact .plh-artifact-surface,
.plh-page-artifact .plh-int,
.plh-page-artifact .plh-artifact-section{
  background: var(--plh-card);
  border: 1px solid var(--plh-border);
  border-radius: var(--plh-radius);
  box-shadow: var(--plh-shadow);
}

/* Rapid access container */
.plh-page-artifact .plh-artifact-surface{
  padding: 18px 18px 16px 18px;
}

/* Builder wrapper */
.plh-page-artifact .plh-int{
  padding: 0;
  overflow: hidden;
}

/* Builder header section (inside .plh-int) */
.plh-page-artifact .plh-int-head{
  padding: 18px 20px 14px 20px;
  border-bottom: 1px solid rgba(43,65,66,0.12);
  background:
    linear-gradient(
      to bottom,
      rgba(163,185,163,0.12),
      rgba(163,185,163,0.05)
    );
}

/* Builder body */
.plh-page-artifact .plh-int-body{
  padding: 18px 20px 20px 20px;
}

/* Builder title treatment */
.plh-page-artifact .plh-int-head .plh-kicker{
  margin-bottom: 6px;
}

.plh-page-artifact .plh-int-head h2,
.plh-page-artifact .plh-int-head h3{
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 800;
}

/* =========================
   5) Rapid access typography and layout
========================= */

.plh-page-artifact .plh-artifact-surface [data-plh-surface-body]{
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.plh-page-artifact .plh-surface-block{
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(235,240,235,0.70);
  border: 1px solid rgba(43,65,66,0.10);
}

.plh-page-artifact .plh-surface-label{
  font-size: 13px;
  font-weight: 800;
  color: rgba(43,65,66,0.88);
  margin-bottom: 6px;
}

.plh-page-artifact .plh-surface-line,
.plh-page-artifact .plh-surface-empty{
  font-size: 14px;
  color: var(--plh-muted);
}

.plh-page-artifact .plh-surface-block ul{
  margin: 8px 0 0 18px;
  padding: 0;
}

.plh-page-artifact .plh-surface-block li{
  margin: 6px 0;
  color: var(--plh-muted);
}

/* =========================
   6) Buttons (Copy summary, Hide builder, etc.)
========================= */

/* Rapid Access Surface action buttons
   The runtime surface CSS is intentionally neutral.
   This file owns the look-and-feel for surface actions.
*/
.plh-page-artifact [data-plh-surface-actions] button,
.plh-page-artifact [data-plh-surface-actions] .plh-btn,
.plh-page-artifact [data-plh-surface-actions] [role="button"]{
  appearance: none;
  /* WCAG 1.4.11: interactive border raised from 0.22 (~1.43:1) to 0.30 (~3.09:1) */
  border: 1px solid rgba(43,65,66,0.30);
  background: #ffffff;
  color: rgba(43,65,66,0.92);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}

/* Primary surface actions (Copy summary, Show/Hide builder) */
.plh-page-artifact [data-plh-surface-copy],
.plh-page-artifact [data-plh-surface-toggle]{
  background: var(--plh-cta);
  border-color: var(--plh-cta);
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
}

.plh-page-artifact [data-plh-surface-copy]:hover,
.plh-page-artifact [data-plh-surface-toggle]:hover{
  background: var(--plh-cta-deep);
  border-color: var(--plh-cta-deep);
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
}

/* Pressed/active state for toggles (support both aria and data attrs) */
.plh-page-artifact [data-plh-surface-toggle][aria-pressed="true"],
.plh-page-artifact [data-plh-surface-toggle][data-active="1"],
.plh-page-artifact [data-plh-surface-toggle].is-active{
  background: var(--plh-cta2);
  border-color: rgba(201,127,109,0.55);
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
}

/* WCAG 1.4.11: focus ring corrected to 3.5:1 (was ~1.13:1 at rgba(201,127,109,0.22)) */
.plh-page-artifact [data-plh-surface-actions] button:focus-visible,
.plh-page-artifact [data-plh-surface-actions] [role="button"]:focus-visible,
.plh-page-artifact [data-plh-surface-actions] .plh-btn:focus-visible{
  outline: 3px solid var(--plh-focus-ring, rgba(43, 107, 90, 0.65));
  outline-offset: 3px;
  box-shadow: none;
}

/* Action row container */
.plh-page-artifact .plh-artifact-actions,
.plh-page-artifact [data-plh-surface-actions]{
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 8px;
}

/* Normalize buttons across artifacts
   WCAG 1.4.11: interactive border raised from 0.22 to 0.30 (~3.09:1) */

.plh-page-artifact button,
.plh-page-artifact .plh-btn{
  appearance: none;
  border: 1px solid rgba(43,65,66,0.30);
  background: #ffffff;
  color: rgba(43,65,66,0.92);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

/* === FIX: Save button is a <div role="button">, not a <button> === */

.plh-page-artifact .plh-artifact-actions .plh-btn{
  appearance: none;
  border: 1px solid rgba(43,65,66,0.30);
  background: #ffffff;
  color: rgba(43,65,66,0.92);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}

/* Primary action (Save) */
.plh-page-artifact .plh-artifact-actions .plh-btn.plh-btn-primary{
  background: var(--plh-cta) !important;
  border-color: var(--plh-cta) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

.plh-page-artifact .plh-artifact-actions .plh-btn.plh-btn-primary:hover{
  background: var(--plh-cta-deep) !important;
  border-color: var(--plh-cta-deep) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* Secondary action (Clear draft) */
.plh-page-artifact .plh-artifact-actions .plh-btn:not(.plh-btn-primary),
.plh-page-artifact .plh-artifact-actions button:not([data-primary="1"]):not([data-plh-primary]){
  background: #ffffff !important;
  border-color: rgba(43,65,66,0.30) !important;
  color: rgba(43,65,66,0.92) !important;
  -webkit-text-fill-color: rgba(43,65,66,0.92) !important;
}

.plh-page-artifact .plh-artifact-actions .plh-btn:not(.plh-btn-primary):hover,
.plh-page-artifact .plh-artifact-actions button:not([data-primary="1"]):not([data-plh-primary]):hover{
  border-color: rgba(43,65,66,0.32) !important;
}


/* Ensure the Save (submit) action is readable in its default state.
   Some theme rules can force transparent/white text on buttons.
   Scope to artifact pages only. */
.plh-page-artifact .plh-artifact-actions button[type="submit"],
.plh-page-artifact .plh-artifact-actions input[type="submit"],
.plh-page-artifact .plh-int-actions button[type="submit"],
.plh-page-artifact .plh-int-actions input[type="submit"],
.plh-page-artifact form button[type="submit"],
.plh-page-artifact form input[type="submit"]{
  background: var(--plh-cta);
  border-color: var(--plh-cta);
  color: #fff;
  -webkit-text-fill-color: #fff;
}


.plh-page-artifact .plh-artifact-actions button[type="submit"]:hover,
.plh-page-artifact .plh-artifact-actions input[type="submit"]:hover,
.plh-page-artifact .plh-int-actions button[type="submit"]:hover,
.plh-page-artifact .plh-int-actions input[type="submit"]:hover,
.plh-page-artifact form button[type="submit"]:hover,
.plh-page-artifact form input[type="submit"]:hover{
  background: var(--plh-cta-deep);
  border-color: var(--plh-cta-deep);
  color: #fff;
  -webkit-text-fill-color: #fff;
}

/* Some artifacts render the bottom action buttons without type="submit".
   Treat the first action button as primary (Save), and keep the second as secondary (Clear draft).
   Use !important because Astra/PMPRO styles can override button text color. */
.plh-page-artifact .plh-int-actions{
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  align-items: center;
  margin-top: 18px;
}

.plh-page-artifact .plh-int-actions button:first-child,
.plh-page-artifact .plh-int-actions input[type="button"]:first-child{
  background: var(--plh-cta) !important;
  border-color: var(--plh-cta) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

.plh-page-artifact .plh-int-actions button:first-child:hover,
.plh-page-artifact .plh-int-actions input[type="button"]:first-child:hover{
  background: var(--plh-cta-deep) !important;
  border-color: var(--plh-cta-deep) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

/* Keep secondary action readable (some themes set transparent text on outline buttons) */
.plh-page-artifact .plh-int-actions button:nth-child(2),
.plh-page-artifact .plh-int-actions input[type="button"]:nth-child(2){
  background: #fff !important;
  border-color: rgba(43,65,66,0.30) !important;
  color: rgba(43,65,66,0.92) !important;
  -webkit-text-fill-color: rgba(43,65,66,0.92) !important;
}

.plh-page-artifact .plh-int-actions button:nth-child(2):hover,
.plh-page-artifact .plh-int-actions input[type="button"]:nth-child(2):hover{
  border-color: rgba(43,65,66,0.32) !important;
}

/* Secondary alternative, if you later want a softer action button */
.plh-page-artifact button[data-tone="soft"]{
  background: rgba(201,127,109,0.18);
  border-color: rgba(201,127,109,0.35);
  color: rgba(43,65,66,0.92);
}

/* =========================
   7) Form sections and fields
========================= */

.plh-page-artifact .plh-artifact-form{
  display: grid;
  gap: 18px;
}

/* Help text structure (parsed from schema help) */
.plh-page-artifact .plh-help-subhead{
  margin: 10px 0 6px;
  font-weight: 800;
  color: rgba(43,65,66,0.88);
}

.plh-page-artifact .plh-help-list{
  margin: 8px 0 12px 18px;
  padding: 0;
}

.plh-page-artifact .plh-help-list li{
  margin: 6px 0;
  /* WCAG: raised from 0.78 (~5.41:1 on #f4f7f4) to 0.84 (~6.38:1) */
  color: rgba(43,65,66,0.84);
}

/* Field wrapper spacing */
.plh-page-artifact .plh-field,
.plh-page-artifact .plh-artifact-grid{
  width: 100%;
}

.plh-page-artifact .plh-artifact-grid{
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

/* Labels */
.plh-page-artifact label{
  font-size: 13px;
  font-weight: 800;
  color: rgba(43,65,66,0.86);
}

/* Preserve line breaks and bullet-style formatting in help text */
.plh-page-artifact .plh-artifact-grid .plh-small{
  white-space: pre-line;
}

/* Inputs and textareas */
.plh-page-artifact input[type="text"],
.plh-page-artifact input[type="email"],
.plh-page-artifact input[type="search"],
.plh-page-artifact textarea{
  width: 100%;
  border: 1px solid rgba(43,65,66,0.18);
  background: rgba(235,240,235,0.55);
  border-radius: 14px;
  padding: 12px 12px;
  color: rgba(43,65,66,0.92);
  font-size: 14px;
  line-height: 1.35;
  outline: none;
}

/* WCAG 1.4.11: focus ring corrected to 3.5:1 (was ~1.13:1 at rgba(201,127,109,0.20)) */
.plh-page-artifact input[type="text"]:focus-visible,
.plh-page-artifact input[type="email"]:focus-visible,
.plh-page-artifact input[type="search"]:focus-visible,
.plh-page-artifact textarea:focus-visible{
  outline: 3px solid var(--plh-focus-ring, rgba(43, 107, 90, 0.65));
  outline-offset: 2px;
  box-shadow: none;
  background: rgba(255,255,255,0.92);
}

/* Placeholder — raised for readability */
.plh-page-artifact ::placeholder{
  color: rgba(43,65,66,0.62);
}

/* List-item UI inside some sections (Add another / Remove)
   IMPORTANT: Only style these controls when we can reliably detect their wrappers.
   Do NOT globally style `.plh-artifact-grid button` here, because it can catch the
   wrong button and produce unreadable text (seen when Remove gets treated as primary).
*/

/* Containers (when present) */
.plh-page-artifact .plh-add-row,
.plh-page-artifact .plh-row-actions{
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* Typical intent: Remove sits left, Add sits right */
.plh-page-artifact .plh-row-actions{ justify-content: flex-start; }
.plh-page-artifact .plh-add-row{ justify-content: flex-end; }

/* Base styling for list action buttons ONLY inside the known wrappers */
.plh-page-artifact .plh-add-row button,
.plh-page-artifact .plh-row-actions button{
  appearance: none;
  border: 1px solid rgba(43,65,66,0.30) !important;
  background: #ffffff !important;
  color: rgba(43,65,66,0.92) !important;
  -webkit-text-fill-color: rgba(43,65,66,0.92) !important;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}

.plh-page-artifact .plh-add-row button:hover,
.plh-page-artifact .plh-row-actions button:hover{
  border-color: rgba(43,65,66,0.32) !important;
}

/* WCAG 1.4.11: focus ring corrected to 3.5:1 */
.plh-page-artifact .plh-add-row button:focus-visible,
.plh-page-artifact .plh-row-actions button:focus-visible{
  outline: 3px solid var(--plh-focus-ring, rgba(43, 107, 90, 0.65));
  outline-offset: 3px;
  box-shadow: none;
}

/* Add controls: primary */
.plh-page-artifact .plh-add-row button{
  background: var(--plh-cta) !important;
  border-color: var(--plh-cta) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

.plh-page-artifact .plh-add-row button:hover{
  background: var(--plh-cta-deep) !important;
  border-color: var(--plh-cta-deep) !important;
}

/* Remove controls: secondary outline (explicit, to defeat theme overrides) */
.plh-page-artifact .plh-row-actions button{
  background: #ffffff !important;
  border-color: rgba(43,65,66,0.30) !important;
  color: rgba(43,65,66,0.92) !important;
  -webkit-text-fill-color: rgba(43,65,66,0.92) !important;
}

/* =========================
   Refinement Step 1: Section anchoring
   Goal: make each section feel like a distinct cognitive unit

   Why you may not have seen a change:
   Some artifacts render a very light/flat section header. Styling only the
   header container can be visually subtle inside an already-white card.

   This pass anchors the *whole section card* with a left accent bar and a
   soft top tint, then (when present) styles the section-head wrapper.
========================= */

/* Anchor the entire section card (works even if section-head markup varies) */
.plh-page-artifact .plh-artifact-section{
  position: relative;
  padding: 20px 20px 18px 34px;
  background:
    linear-gradient(
      to bottom,
      rgba(163,185,163,0.12),
      rgba(255,255,255,1) 140px
    );
}

.plh-page-artifact .plh-artifact-section{
  border-color: rgba(43,65,66,0.16);
}

.plh-page-artifact .plh-artifact-section::before{
  content: "";
  position: absolute;
  left: 16px;
  top: 20px;
  bottom: 20px;
  width: 4px;
  border-radius: 999px;
  background: rgba(163,185,163,0.95);
}

/* If a dedicated section-head wrapper exists, give it a clearer header feel */
.plh-page-artifact .plh-artifact-section-head{
  position: relative;
  display: block;
  padding: 12px 12px 10px 0;
  margin: 0 0 12px 0;
}

.plh-page-artifact .plh-artifact-section-head{
  margin-bottom: 10px;
}

.plh-page-artifact .plh-artifact-section-head + .plh-artifact-grid{
  margin-top: 8px;
}

/* Kicker + title hierarchy inside anchored header */
.plh-page-artifact .plh-artifact-section-head .plh-kicker{
  margin: 0 0 6px 0;
  letter-spacing: 0.10em;
}

.plh-page-artifact .plh-artifact-section-head h3,
.plh-page-artifact .plh-artifact-section-head h4,
.plh-page-artifact .plh-artifact-section-head .plh-h3,
.plh-page-artifact .plh-artifact-section-head .plh-h4{
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* Tighten the explanatory text so it reads like a header note */
.plh-page-artifact .plh-artifact-section-head p{
  margin: 6px 0 0 0;
  /* Uses --plh-muted token (0.82 → ~6.04:1 on #f4f7f4) */
  color: var(--plh-muted);
  max-width: 78ch;
  font-size: 14px;
}

/* =========================
   Refinement Step 3: Field area polish
   Goal: make builder sections feel as composed as Rapid Access
========================= */

/* Give each field grid a quiet panel background within a section card */
.plh-page-artifact .plh-artifact-section .plh-artifact-grid{
  background: rgba(235,240,235,0.55);
  border: 1px solid rgba(43,65,66,0.10);
  border-radius: 14px;
  padding: 12px 14px;
}

/* Keep labels readable and aligned inside the panel */
.plh-page-artifact .plh-artifact-section .plh-artifact-grid label{
  margin: 0;
}

/* Inputs inside the grid should sit cleanly on the panel */
.plh-page-artifact .plh-artifact-section .plh-artifact-grid input[type="text"],
.plh-page-artifact .plh-artifact-section .plh-artifact-grid input[type="email"],
.plh-page-artifact .plh-artifact-section .plh-artifact-grid input[type="search"],
.plh-page-artifact .plh-artifact-section .plh-artifact-grid textarea{
  background: rgba(255,255,255,0.92);
}

/* =========================
   Refinement Step 2: Hierarchy polish
   Goal: make headings, kickers, and supporting text read cleanly and consistently
========================= */

/* Global heading polish on artifact pages */
.plh-page-artifact h1,
.plh-page-artifact .plh-h1{
  letter-spacing: -0.012em;
}

/* Rapid access title line */
.plh-page-artifact .plh-artifact-surface h3,
.plh-page-artifact .plh-artifact-surface h2{
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: rgba(43,65,66,0.92);
}

/* Builder header title */
.plh-page-artifact .plh-int-head h2,
.plh-page-artifact .plh-int-head h3{
  letter-spacing: -0.012em;
}

/* SECTION kicker consistency
   WCAG: 11px kicker is normal text, needs 4.5:1. Was 0.46 (~2.48:1 FAIL).
   Promoted to muted (0.75, ~4.64:1). */
.plh-page-artifact .plh-artifact-section .plh-kicker{
  font-size: 11px;
  letter-spacing: 0.11em;
  color: var(--plh-muted);
}

/* Section title consistency */
.plh-page-artifact .plh-artifact-section h3,
.plh-page-artifact .plh-artifact-section h4{
  color: rgba(43,65,66,0.94);
}

/* Supporting paragraph text within sections */
.plh-page-artifact .plh-artifact-section p{
  /* WCAG: raised from 0.78 (~5.41:1 on #f4f7f4) to 0.84 (~6.38:1) */
  color: rgba(43,65,66,0.84);
  font-size: 14px;
  line-height: 1.55;
}

/* Sub-labels within a section (often bolded prompt lines) */
.plh-page-artifact .plh-artifact-section strong{
  color: rgba(43,65,66,0.90);
}

/* Label and field spacing polish */
.plh-page-artifact .plh-artifact-grid label{
  display: inline-block;
  margin-bottom: 6px;
}

/* Inputs should align and read as one system */
.plh-page-artifact input[type="text"],
.plh-page-artifact input[type="email"],
.plh-page-artifact input[type="search"],
.plh-page-artifact textarea{
  font-size: 14px;
}

/* Slightly soften the placeholder to reduce visual noise — raised for readability */
.plh-page-artifact ::placeholder{
  color: rgba(43,65,66,0.62);
}

/* =========================
   8) Dynamic visual enhancement - More vibrant, engaging design
========================= */

/* Enhanced section spacing - more breathing room between major elements */
.plh-page-artifact .plh-artifact-section + .plh-artifact-section{
  margin-top: 32px;
}

/* Better visual separation for the hero area */
.plh-page-artifact .plh-hero{
  margin-bottom: 36px;
  background: linear-gradient(to bottom, rgba(236,209,203,0.15), rgba(235,240,235,0.3));
  padding: 32px 24px !important;
  border-radius: 16px;
  border-left: 4px solid #c97f6d;
}

/* Vibrant card definition with stronger shadows */
.plh-page-artifact .plh-artifact-surface,
.plh-page-artifact .plh-int,
.plh-page-artifact .plh-artifact-section{
  box-shadow: 0 4px 16px rgba(43,65,66,0.12), 0 8px 32px rgba(43,65,66,0.06);
  border: 1px solid rgba(163,185,163,0.25);
}

/* Stronger, more vibrant left accent on section cards */
.plh-page-artifact .plh-artifact-section::before{
  width: 5px;
  background: linear-gradient(
    to bottom,
    #c2552a,
    #c97f6d,
    #a3b9a3
  );
  box-shadow: 0 0 8px rgba(194,85,42,0.3);
}

/* Dynamic section header with color accent */
.plh-page-artifact .plh-artifact-section-head{
  background: linear-gradient(to right, rgba(236,209,203,0.12), rgba(236,209,203,0.02));
  border-bottom: 2px solid rgba(201,127,109,0.25);
  padding: 14px 16px 14px 0;
  margin: -4px -4px 20px -4px;
  border-radius: 8px 8px 0 0;
}

/* Vibrant section titles with color */
.plh-page-artifact .plh-artifact-section-head h3,
.plh-page-artifact .plh-artifact-section-head h4,
.plh-page-artifact .plh-artifact-section-head .plh-h3,
.plh-page-artifact .plh-artifact-section-head .plh-h4{
  color: #2b4142;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Add a subtle color accent to kickers */
.plh-page-artifact .plh-artifact-section .plh-kicker{
  color: #c2552a;
  font-weight: 700;
}

/* More space around form fields for better readability */
.plh-page-artifact .plh-artifact-form{
  gap: 24px;
}

/* Enhanced rapid access surface with color accent */
.plh-page-artifact .plh-artifact-surface{
  border-left: 4px solid #a3b9a3;
  background: linear-gradient(to bottom, rgba(163,185,163,0.04), #ffffff);
}

.plh-page-artifact .plh-artifact-surface + .plh-int,
.plh-page-artifact .plh-artifact-surface + .plh-artifact-section{
  margin-top: 32px;
}

/* Better button group spacing */
.plh-page-artifact .plh-artifact-actions,
.plh-page-artifact [data-plh-surface-actions]{
  margin-top: 20px;
  gap: 14px;
}

/* Enhanced hover states for buttons */
.plh-page-artifact button:hover,
.plh-page-artifact .plh-btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(43,65,66,0.15);
  transition: all 0.2s ease;
}

/* =========================
   9) Mobile polish - Enhanced responsive experience
========================= */

/* Tablet and smaller laptops */
@media (max-width: 980px){
  .plh-page-artifact {
    --plh-radius: 16px;
    --plh-radius-sm: 10px;
  }

  .plh-page-artifact .plh-hero{
    padding-top: 26px;
    padding-bottom: 18px;
  }

  .plh-page-artifact .plh-h1,
  .plh-page-artifact h1{
    font-size: clamp(26px, 3vw, 34px);
  }

  .plh-page-artifact .plh-int-head{
    padding: 16px 16px 12px 16px;
  }

  .plh-page-artifact .plh-int-head h2,
  .plh-page-artifact .plh-int-head h3{
    font-size: 22px;
  }

  .plh-page-artifact .plh-int-body{
    padding: 16px;
  }

  .plh-page-artifact .plh-artifact-surface{
    padding: 16px;
  }

  .plh-page-artifact .plh-artifact-section{
    padding: 18px 18px 16px 30px;
  }

  /* Button spacing */
  .plh-page-artifact .plh-artifact-actions,
  .plh-page-artifact [data-plh-surface-actions]{
    gap: 8px;
    flex-wrap: wrap;
  }
}

/* Mobile (small screens) */
@media (max-width: 600px){
  .plh-page-artifact {
    --plh-radius: 14px;
    --plh-radius-sm: 8px;
    --plh-gutter: 16px;
  }

  /* Hero section */
  .plh-page-artifact .plh-hero{
    padding-top: 22px;
    padding-bottom: 14px;
  }

  .plh-page-artifact .plh-kicker{
    font-size: 11px;
    letter-spacing: 0.06em;
  }

  .plh-page-artifact .plh-h1,
  .plh-page-artifact h1{
    font-size: clamp(24px, 5vw, 28px);
    margin: 8px 0;
  }

  .plh-page-artifact .plh-subhead,
  .plh-page-artifact .plh-hero p{
    font-size: 14px;
    line-height: 1.6;
  }

  /* Cards and sections */
  .plh-page-artifact .plh-int-head{
    padding: 14px 14px 12px 14px;
  }

  .plh-page-artifact .plh-int-head h2,
  .plh-page-artifact .plh-int-head h3{
    font-size: 20px;
  }

  .plh-page-artifact .plh-int-head .plh-kicker{
    margin-bottom: 4px;
  }

  .plh-page-artifact .plh-int-body{
    padding: 14px;
  }

  .plh-page-artifact .plh-artifact-surface{
    padding: 14px;
  }

  /* Section cards: mobile-optimized */
  .plh-page-artifact .plh-artifact-section{
    padding: 16px 14px 14px 26px;
  }

  .plh-page-artifact .plh-artifact-section::before{
    left: 12px;
    top: 16px;
    bottom: 16px;
    width: 3px;
  }

  .plh-page-artifact .plh-artifact-section-head{
    padding: 10px 10px 8px 0;
    margin-bottom: 10px;
  }

  .plh-page-artifact .plh-artifact-section-head h3,
  .plh-page-artifact .plh-artifact-section-head h4,
  .plh-page-artifact .plh-artifact-section-head .plh-h3,
  .plh-page-artifact .plh-artifact-section-head .plh-h4{
    font-size: 17px;
  }

  .plh-page-artifact .plh-artifact-section-head p{
    font-size: 13px;
  }

  /* Form elements */
  .plh-page-artifact .plh-artifact-form{
    gap: 16px;
  }

  .plh-page-artifact .plh-artifact-grid{
    padding: 10px 12px;
  }

  .plh-page-artifact label{
    font-size: 12px;
  }

  .plh-page-artifact input[type="text"],
  .plh-page-artifact input[type="email"],
  .plh-page-artifact input[type="search"],
  .plh-page-artifact textarea{
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 12px;
  }

  /* Buttons: better touch targets */
  .plh-page-artifact button,
  .plh-page-artifact .plh-btn{
    padding: 10px 12px;
    font-size: 13px;
    min-height: 40px;
  }

  /* Action rows: stack on mobile if needed */
  .plh-page-artifact .plh-artifact-actions,
  .plh-page-artifact [data-plh-surface-actions]{
    gap: 8px;
    flex-wrap: wrap;
    justify-content: stretch;
  }

  .plh-page-artifact .plh-artifact-actions button,
  .plh-page-artifact [data-plh-surface-actions] button,
  .plh-page-artifact .plh-artifact-actions .plh-btn,
  .plh-page-artifact [data-plh-surface-actions] .plh-btn{
    flex: 1 1 auto;
    min-width: 120px;
  }

  .plh-page-artifact .plh-int-actions{
    flex-direction: column;
    align-items: stretch;
  }

  .plh-page-artifact .plh-int-actions button,
  .plh-page-artifact .plh-int-actions .plh-btn{
    width: 100%;
  }

  /* Rapid Access surface */
  .plh-page-artifact .plh-surface-block{
    padding: 10px 12px;
    border-radius: 12px;
  }

  .plh-page-artifact .plh-surface-label{
    font-size: 12px;
  }

  .plh-page-artifact .plh-surface-line,
  .plh-page-artifact .plh-surface-empty{
    font-size: 13px;
  }

  /* Artifact workspace frame */
  .plh-page-artifact #artifact-start{
    padding: 20px 16px 24px 16px;
    border-radius: 22px;
    margin-top: 18px;
  }

  .plh-page-artifact #artifact-start::before{
    border-radius: 22px;
  }
}

/* Extra small mobile (iPhone SE, etc.) */
@media (max-width: 375px){
  .plh-page-artifact {
    --plh-gutter: 14px;
  }

  .plh-page-artifact .plh-h1,
  .plh-page-artifact h1{
    font-size: 22px;
  }

  .plh-page-artifact .plh-int-head h2,
  .plh-page-artifact .plh-int-head h3{
    font-size: 18px;
  }

  .plh-page-artifact .plh-artifact-section{
    padding: 14px 12px 12px 22px;
  }

  .plh-page-artifact .plh-artifact-section::before{
    left: 10px;
    top: 14px;
    bottom: 14px;
  }

  .plh-page-artifact .plh-artifact-section-head h3,
  .plh-page-artifact .plh-artifact-section-head h4{
    font-size: 16px;
  }

  /* Buttons: slightly smaller on very small screens */
  .plh-page-artifact button,
  .plh-page-artifact .plh-btn{
    padding: 9px 10px;
    font-size: 12px;
  }

  /* Stack list action buttons */
  .plh-page-artifact .plh-add-row,
  .plh-page-artifact .plh-row-actions{
    flex-direction: column;
    align-items: stretch;
  }

  .plh-page-artifact .plh-add-row button,
  .plh-page-artifact .plh-row-actions button{
    width: 100%;
  }
}

/* =========================
   Artifact workspace frame
   Signals this as a central, durable object
========================= */

.plh-page-artifact #artifact-start{
  position: relative;
  margin-top: 22px;
  padding: 26px 24px 30px 24px;
  border-radius: 28px;
  background:
    linear-gradient(
      to bottom,
      rgba(163,185,163,0.20),
      rgba(235,240,235,0.55) 120px,
      rgba(235,240,235,0.35)
    );
}

/* Soft containment line */
.plh-page-artifact #artifact-start::before{
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 28px;
  border: 1px solid rgba(43,65,66,0.14);
  pointer-events: none;
}

/* Ensure section cards sit cleanly inside the frame */
.plh-page-artifact #artifact-start .plh-artifact-section{
  position: relative;
  z-index: 1;
}

@media (max-width: 980px){
  .plh-page-artifact #artifact-start{
    padding: 18px 14px 22px 14px;
    border-radius: 22px;
  }
}

/* =========================
   Accessibility pass: artifact instructional text
   ========================= */

.plh-page-artifact .plh-artifact-section .plh-small,
.plh-page-artifact .plh-artifact-section .plh-help-p,
.plh-page-artifact .plh-artifact-section .plh-help-subhead {
  color: #2f3e3a;
  font-size: 14.5px;
  line-height: 1.5;
  opacity: 1;
}

/* Section descriptive copy */
.plh-page-artifact .plh-artifact-section .plh-p {
  color: #2b3a37;
}

/* Optional: slightly darken card interior background */
.plh-page-artifact .plh-card,
.plh-page-artifact .plh-artifact-section {
  background: #f4f7f4;
}

/* =========================
   Rapid Access Surface polish
   ========================= */

.plh-page-artifact .plh-actions .plh-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1;
  font-weight: 800;
  text-decoration: none;
}

.plh-page-artifact .plh-actions .plh-btn-primary{
  background: #c97f6d;
  border: 1px solid rgba(43,65,66,0.16);
  color: #ffffff;
}

.plh-page-artifact .plh-actions .plh-btn-primary,
.plh-page-artifact .plh-actions .plh-btn-primary:visited{
  color: #ffffff;
}

.plh-page-artifact .plh-artifact-surface .plh-surface-head{
  display: block;
}

.plh-page-artifact .plh-artifact-surface .plh-surface-head .plh-kicker,
.plh-page-artifact .plh-artifact-surface .plh-surface-head .plh-h2,
.plh-page-artifact .plh-artifact-surface .plh-surface-head .plh-p{
  display: block;
}

.plh-page-artifact .plh-artifact-surface .plh-surface-head .plh-h2{
  font-weight: 900;
}

.plh-page-artifact .plh-artifact-surface [data-plh-surface-actions]{
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.plh-page-artifact .plh-artifact-surface [data-plh-surface-actions] .plh-btn{
  min-height: 38px;
  padding: 10px 14px;
  border-radius: 999px;
}

.plh-page-artifact .plh-artifact-surface [data-plh-surface-body]{
  margin-top: 14px;
}


/* =========================
   Width contract (artifacts)
   Keep width control inside PLH wrappers, not Astra containers.
   ========================= */


/* Ensure key artifact containers respect the same width */
#plh-artifact-shell.plh-page-artifact .plh-wrap,
#plh-artifact-shell.plh-page-artifact .plh-hero,
#plh-artifact-shell.plh-page-artifact .plh-artifact-surface,
#plh-artifact-shell.plh-page-artifact #artifact-builder{
  width: 100%;
  max-width: var(--plh-max);
  margin-left: auto;
  margin-right: auto;
}

/* =========================
   Seed communication layers
   ========================= */

/* Layer 1: Interactive seed note (beneath interactives that feed artifacts) */
.plh-seed-note{
  margin-top: 10px;
  font-size: 13px;
  color: var(--plh-faint);
  line-height: 1.5;
}

/* Layer 2: Artifact seed info block (top of builder area) */
.plh-seed-info{
  margin-bottom: 22px;
  padding: 18px 22px;
  background: rgba(163,185,163,0.10);
  border-left: 3px solid var(--plh-sage);
  border-radius: var(--plh-radius-sm);
}
.plh-seed-info .plh-h3{
  margin-bottom: 8px;
}

/* Layer 3: Builder orientation line (top of form, before sections) */
.plh-seed-orient{
  margin-bottom: 18px;
  font-size: 14px;
  color: var(--plh-muted);
}
