/* Playground chrome only. Every component is styled by the app's own stylesheets; this file lays out the page and
   puts floating components (menus, popovers, the skip link) into the flow so they can be seen side by side. */
body.notefriends-brand { overflow-x: hidden; }
.pg-bar { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px max(3vw, 16px); border-bottom: 1px solid var(--nf-line); background: var(--nf-paper); }
.pg-title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.pg-bar-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; min-width: 0; }
.pg-bar-controls button { min-height: 40px; }
.pg-note { color: var(--nf-pencil-muted); font-size: 12px; }
.pg-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--nf-pencil-muted); }

.pg-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 24px; max-width: 1380px; margin: 0 auto; padding: 0 max(3vw, 16px); }
.pg-nav { position: sticky; top: 76px; align-self: start; padding: 18px 0; }
.pg-nav ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.pg-nav a { display: block; padding: 8px 10px; border-radius: 6px; text-decoration: none; font-size: 14px; }
.pg-nav a:hover { background: var(--nf-sheet); }
.notefriends-brand main.pg-main { max-width: none; margin: 0; padding: 0 0 80px; min-width: 0; }
.notefriends-brand.pg-phone main.pg-main { max-width: 390px; margin: 0 auto; border-inline: 1px dashed var(--nf-pencil-muted); padding-inline: 12px; }
.pg-section { padding: 28px 0 8px; border-bottom: 1px solid var(--nf-line); scroll-margin-top: 80px; }
.pg-section h2 { margin: 0 0 6px; font: 400 34px/1.1 'Instrument Serif', Georgia, serif; }
.pg-section h3 { margin: 26px 0 4px; font-size: 15px; }
.pg-caption { margin: 0 0 12px; color: var(--nf-pencil-muted); font-size: 13px; line-height: 1.55; max-width: 80ch; }
.pg-caption code, .pg-label code, .pg-spec code, .pg-panel code { font: 12px ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.pg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pg-demo { margin: 6px 0 14px; padding: 16px; min-width: 0; border: 1px dashed var(--nf-line); border-radius: 8px; background: var(--nf-sheet); display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.pg-demo.pg-row { display: flex; }
.pg-demo .notice, .pg-demo .topbar { margin-top: 0; }
.pg-room { min-height: 300px; align-content: start; }
.pg-demo .export-menu { justify-self: start; }
.pg-demo .export-options { right: auto; left: 0; }
.pg-demo .skip, .pg-skip-demo .skip { position: static; display: inline-block; justify-self: start; }
.pg-demo dialog[open] { position: static; margin: 0; width: auto; }
.pg-demo .nf-menu { position: static; display: block; }
.pg-menus { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 280px)); align-items: start; }
.pg-demo .appearance-panel { border: 1px solid var(--nf-line); }

/* Tokens */
.pg-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pg-swatch { display: grid; gap: 6px; padding: 8px; border: 1px solid var(--nf-line); border-radius: 8px; background: var(--nf-sheet); font-size: 12px; min-width: 0; }
.pg-chip { height: 54px; border: 1.5px solid var(--nf-pencil); border-radius: var(--nf-radius); }
.pg-swatch code, .pg-swatch span { overflow-wrap: anywhere; }
.pg-specimens { display: grid; gap: 4px; }
.pg-spec { margin: 0; font-size: 17px; }
.pg-spec code { margin-right: 10px; color: var(--nf-pencil-muted); }
.pg-font-ui { font-family: var(--nf-font-ui); }
.pg-font-label { font-family: var(--nf-font-label); letter-spacing: .08em; font-size: 14px; }
.pg-font-reading { font-family: var(--nf-font-reading); }
.pg-font-display { font: 400 34px/1.2 'Instrument Serif', Georgia, serif; }
.pg-samples { display: flex; flex-wrap: wrap; gap: 16px; }
.pg-sample { display: grid; place-items: center; width: 150px; height: 70px; background: var(--nf-sheet); font-size: 12px; }
.pg-stroke { border: var(--nf-stroke) solid var(--nf-pencil); }
.pg-radius { border: 1.5px solid var(--nf-pencil); border-radius: var(--nf-radius); }
.pg-focus { outline: var(--nf-focus); outline-offset: 3px; }

/* Token editor */
.pg-editor { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.pg-panel { padding: 14px; border: 1.5px solid var(--nf-pencil); border-radius: var(--nf-radius); background: var(--nf-sheet); min-width: 0; }
.pg-panel h3 { margin-top: 0; }
.pg-fields { display: grid; gap: 8px; margin-top: 10px; }
.pg-field { display: grid; grid-template-columns: minmax(0, 1fr) auto 108px; align-items: center; gap: 8px; font-size: 12px; }
.pg-field.pg-text { grid-template-columns: minmax(0, 1fr); }
.pg-field label { overflow-wrap: anywhere; }
.pg-field input[type=color] { width: 44px; height: 38px; padding: 2px; border: 1.5px solid var(--nf-pencil-muted); border-radius: 6px; background: var(--nf-sheet); }
.pg-field input[type=text] { box-sizing: border-box; width: 100%; min-width: 0; min-height: 38px; padding: 6px 8px; border: 1.5px solid var(--nf-pencil-muted); border-radius: 6px; background: var(--nf-sheet); color: var(--nf-pencil); font: 13px ui-monospace, SFMono-Regular, Consolas, monospace; }
.pg-field input[aria-invalid=true] { border-color: #963b25; }
.pg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.pg-changed { margin-left: 6px; font-size: 13px; color: var(--nf-pencil-muted); }
.pg-status { min-height: 1.5em; margin: 8px 0 0; font-size: 13px; }
.pg-output-label { display: grid; gap: 6px; margin-top: 8px; font-size: 13px; }
#pg-output { box-sizing: border-box; width: 100%; min-height: 0; padding: 10px; border: 1.5px solid var(--nf-pencil-muted); border-radius: 6px; background: var(--nf-sheet); color: var(--nf-pencil); font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }

/* Reading-surface samples (sections 4 and 5) */
#preview.reading-surface, #pg-render.reading-surface { border: 1.5px solid var(--nf-pencil); border-radius: 9px 7px 10px 8px; min-width: 0; }
#preview.prose { max-width: none; min-height: 0; margin: 0; }
.pg-label { margin: 28px 0 8px; padding-top: 10px; border-top: 1px dashed var(--note-line); color: var(--note-muted); font: 12px/1.4 var(--nf-font-label); letter-spacing: .02em; }
.pg-label:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.pg-label code { color: var(--note-ink); }
.pg-gutters { display: flex; flex-wrap: wrap; gap: 24px; }
.pg-gutters .nf-gutter { position: static; }
.pg-table-open .nf-table-tools { position: relative; opacity: 1; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.pg-table-open .nf-table-menu { position: static; }
.pg-pop { position: static; max-width: 360px; }
#pg-render .pg-label { margin-top: 36px; }
#pg-render .pg-label:first-child { margin-top: 0; }

/* Brand assets */
.pg-assets-group { margin: 0 0 18px; }
.pg-assets-group h3 { margin: 22px 0 8px; }
.pg-asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pg-asset-grid.pg-wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.pg-asset { display: grid; align-content: space-between; gap: 8px; margin: 0; padding: 10px; border: 1px solid var(--nf-line); border-radius: 8px; background: var(--nf-sheet); min-width: 0; }
.pg-asset-img { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; min-height: 60px; }
.pg-asset img { display: block; max-width: 100%; height: auto; }
.pg-wide .pg-asset img { width: auto; max-height: 140px; }
.pg-asset-grid.pg-icons { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.pg-asset figcaption { font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--nf-pencil-muted); overflow-wrap: anywhere; }

@media (max-width: 750px) {
  .pg-layout { display: block; }
  .pg-nav { position: static; padding: 8px 0 0; }
  .pg-nav ol { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 6px; }
  .pg-nav a { white-space: nowrap; min-height: 40px; display: flex; align-items: center; border: 1px solid var(--nf-line); }
  .pg-bar { position: static; }
  .pg-note { display: none; }
  .pg-field { grid-template-columns: minmax(0, 1fr) auto; }
  .pg-field input[type=text] { grid-column: 1 / -1; }
  .pg-section h2 { font-size: 30px; }
  .pg-demo { padding: 12px; }
  .pg-demo .export-options { max-width: 100%; }
  .pg-room { min-height: 310px; }
  #preview.prose, #pg-render .prose { padding-inline: 14px; }
}
.pg-jump ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 16px; padding: 0; list-style: none; }
.pg-jump a { display: inline-block; padding: 3px 9px; border: 1px solid var(--nf-line); border-radius: 999px; color: var(--nf-pencil); font: 12px/1.4 var(--nf-font-label); text-decoration: none; }
.pg-jump a:hover, .pg-jump a:focus-visible { border-color: var(--nf-pencil); }
#pg-render .pg-group { margin: 48px 0 0; border-top: 0; color: var(--note-ink); font-size: 14px; text-transform: uppercase; letter-spacing: .06em; }
#pg-render .pg-group:first-child { margin-top: 0; }
#pg-render .pg-label { scroll-margin-top: 80px; }
