/* D521, the hard review of 12 November 2026: the sheets area's fixes, loaded after heritage.css and simple.css.
   Every sheet, the review stack, the palette and Help share one frame, one close button, one
   section header and one light surface. Numbers in the comments are the review's findings. */

/* 2: one close button, 44 px, the same on every sheet (.swx on the page's own sheets, .sh-x where sheet.js adds it) */
.swx, .sh-x, .lightbox > .x {
  flex: none; width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%;
  display: inline-grid; place-items: center; font-size: 16px; line-height: 1;
  background: var(--raised); border: 1px solid var(--line-strong); color: var(--ink);
}
.swx:hover, .sh-x:hover { background: var(--panel-2); border-color: var(--line-strong); }
/* 1: a close button that was focused by a script, not by the keyboard, shows no ring */
.swx:focus:not(:focus-visible), .sh-x:focus:not(:focus-visible) { outline: none; box-shadow: none; }
/* a card sheet.js focuses itself on a phone (no ring: nothing was chosen) */
.sp-in:focus, .sheetcard:focus, .nsheet-card:focus, .desk-card:focus, .sw:focus { outline: none; }

/* 3, 4: one frame for the page's sheets. On a desk a centred card 24 px from the top; on a
   phone the whole screen, its header clear of the notch and the status bar. */
.sp-top { align-items: flex-start; gap: 12px; }
.sp-top > div:first-child { flex: 1 1 auto; min-width: 0; }
.sp-top small { display: block; line-height: 1.4; }
@media (max-width: 899px) {
  /* sheet.js lifts .sp-top into the sticky .sh-head; it keeps clear of the notch */
  .shotpage .sp-in > .sh-head { padding-top: calc(10px + env(safe-area-inset-top)); border-bottom: 1px solid var(--line); }
  /* 47: the eyebrow stays on one line once the title has the width */
  .sp-top small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .swtop { padding-top: calc(16px + env(safe-area-inset-top)); }
}
@media (min-width: 900px) {
  .shotpage .sp-in > .sh-head { border-bottom: 1px solid var(--line); }
}
.sh-head .sp-top h2 { margin-bottom: 0; }

/* 3, 35: Help is the same centred card as the other sheets on a desk, no drag handle there,
   and nothing hides the last question */
#helpSheet .helpcard { width: min(860px, 100%); }
@media (min-width: 900px) {
  #helpSheet.sheet { align-items: flex-start; padding: 24px 16px; }
  #helpSheet .helpcard { border-radius: var(--r-l); max-height: calc(100dvh - 48px); border: 1px solid var(--line-strong); }
  #helpSheet .sh-head { border-radius: var(--r-l) var(--r-l) 0 0; }
  #helpSheet .sh-head .grab, #helpSheet .helpcard > .grab { display: none; }
}
@media (max-width: 899px) {
  #helpSheet .sh-head { padding-top: calc(10px + env(safe-area-inset-top)); }
}
/* 36: the intro is one muted line */
#helpSheet .helpintro { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
/* 32: the role tabs are 44 px and the one chosen is plainly chosen */
.faqtabs { gap: 8px; margin-top: 14px; }
.faqtabs button { min-height: 44px; padding: 0 16px; border-radius: 999px; font-size: 14px; }
.faqtabs button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink, #fff); }
.helpcard #helpQ { margin: 14px 0 4px; }
/* 34: the chevrons sit on the section heading's edge; the section labels read as labels */
.faqgroup { margin-top: 22px; }
.faqgroup h4 { font-size: 12px; color: var(--muted); margin: 0 0 4px; }
details.faq > summary { padding: 13px 0; min-height: 48px; }
details.faq > p { margin-left: 15px; }

/* 5: one light surface. A sheet, the review stack and the palette are the app's own
   panel on the app's own ground, never a stray white or grey of their own. */
:root[data-theme="light"] .sp-in, :root[data-theme="light"] .sheetcard, :root[data-theme="light"] .pal-in,
:root[data-theme="light"] .swcard, :root[data-theme="light"] .sh-head { background: var(--panel); }
:root[data-theme="light"] .sw { background: var(--bg); }
:root[data-theme="light"] .shotpage { background: rgba(40, 32, 18, .42); }
@media (max-width: 899px) { :root[data-theme="light"] .shotpage { background: var(--panel); } }

/* 14: the review stack's picture area is a quiet surface while the picture loads, never a black slab */
.swmedia { background: var(--raised); }
.swmedia img, .swmedia video { background: transparent; }
.swnone { font-size: 14px; padding: 16px; text-align: center; }
/* 15: the buttons under the picture keep the body's inset */
.swcard > .swprev { padding: 0 18px; margin-top: 12px; }
.swbody { padding: 12px 18px 16px; }
.swlabel { line-height: 1.25; }
.swchips { display: flex; flex-wrap: wrap; gap: 8px; }
/* 17: no dashed drop zone where Accept would be; the rule reads as a caption */
.swacts .swrule { border: 0; background: transparent; min-height: 58px; font-size: 12.5px; color: var(--muted); }
/* 48: the progress track reads */
.swprog { height: 4px; background: var(--line-strong); }
/* 49: Retake is a soft red, never a disabled-looking beige */
.swacts .swbad { background: var(--bad-soft); }
/* 2, 50: on a desk the count, the progress and the close line up with the card */
@media (min-width: 900px) {
  .swtop { width: min(780px, calc(100% - 32px)); margin: 0 auto; padding-left: 0; padding-right: 0; }
}

/* 20: the three money tiles stay in one row on a phone */
@media (max-width: 600px) {
  .money-top { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .money-top > div { padding: 10px; }
  .money-top small { font-size: 10.5px; letter-spacing: .06em; }
  .money-top b { font-size: 17px; }
  .money-top span { font-size: 12px; line-height: 1.3; display: block; }
}
/* 19: the budget curve fills its column, as the tiles above it do */
.budgetcurve { max-width: none; }
.budgetcurve .bg-capt { font-size: 12px; }
/* 22: the cap meter's fill is a bar from its first rupee, and the marks are readable */
.capbar > i { min-width: 8px; border-radius: 999px; }
.capmarks { font-size: 12px; }

/* 42, 43: section headers. The rule is solid to the count; on a phone the count drops
   under the heading instead of breaking it in two. */
.sect::after { background: var(--line); }
.sp-in .sect { margin: 28px 0 12px; }
.sp-in .sect h3 { font-size: 22px; }
@media (max-width: 899px) {
  .sp-in .sect { flex-wrap: wrap; row-gap: 2px; }
  .sp-in .sect h3 { font-size: 20px; white-space: normal; }
  .sp-in .sect > span { white-space: nowrap; flex: 1 0 100%; order: 4; }
  .sp-in .sect::after { display: none; }
}

/* 10: an asset row's name is what you scan for; its status pill sits on one column at the right */
.sa-row { align-items: center; min-height: 48px; }
.sa-row .k { color: var(--ink); font-weight: 500; flex: 1 1 auto; max-width: none; }
.sa-row > span:last-child { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px;
  color: var(--muted); font-size: 13px; flex: 0 1 auto; }
.sa-row > span:last-child > .chip { order: 2; min-width: 84px; justify-content: center; }
.sa-row > span:last-child > div { order: 3; flex-basis: 100%; }
/* 8: the readiness bar is one status colour and tall enough to read */
.sa-ready { padding: 12px 14px; }
.sa-ready .bar { height: 6px; margin-top: 10px; }
.sa-ready .bar > i { background: var(--warn); }
.sa-ready.ok .bar > i { background: var(--ok); }
/* 7, 51: the facts are one row of the same chip; only the people are tinted, as taps */
.sp-facts { gap: 6px; margin-bottom: 8px; }
/* 9: on a phone every fact row is a label over its value, not three alignments in three rows */
@media (max-width: 899px) {
  .sp-in .row:has(> .k) { flex-wrap: wrap; row-gap: 2px; }
  .sp-in .row.sa-row { flex-wrap: nowrap; }
}

/* 44, 45, 13: the person sheet */
.person .row label.btn, .person label.btn.mini { min-height: 44px; padding: 0 16px; display: inline-flex; align-items: center; }
.cont-ph { color: var(--faint); font-size: 12px; border: 1px dashed var(--line-strong); }
.cont-ph[style*="background-image"] { border-style: solid; }
.cont-it b { font-size: 14px; margin-top: 4px; }
@media (min-width: 900px) { .person .cont { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); } }

/* 37 to 41: the palette */
.pal-in { position: relative; }
.pal-in input { padding-left: 50px; font-size: 16px;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") 18px center / 20px no-repeat; }
.pal-in input::placeholder { color: var(--muted); opacity: 1; }
.pal-list { max-height: 60vh; }
.pal-item { min-height: 44px; align-items: center; }
.pal-item.on { box-shadow: inset 3px 0 var(--accent); }
@media (min-width: 900px) {
  .pal-item { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 12px; }
}
@media (max-width: 899px) {
  .pal-item { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 10px 14px; }
  .pal-item span { white-space: normal; }
  .pal-list { max-height: calc(var(--vvh, 100dvh) - 240px); }
}
@media (hover: none) { .pal-hint { display: none; } }

/* 56: the phone tab bar's highlight sits inside its own tab with equal room either side */
@media (max-width: 899px) {
  nav.tabs .navbtn[aria-current="page"] { margin: 4px 6px; border-radius: 12px; }
}

/* KS, typing in a sheet (the founder, 18 November 2026: "when keyboard opens text box is invisible"):
   the studio page's own overlays follow the rule heritage.css writes for .sheet and .nsheet. While a
   field in one of them is typed in on a touch device (sheet.js sets .sh-top and .sh-ty), it is in the
   top half of the screen, above any keyboard, whatever the phone reports. */
/* the reel's block form and its other small forms (chats.js makes .ch-modal; it only gets the classes) */
.ch-modal.on.sh-top { align-items: flex-start; padding-top: var(--sh-top, 0px); padding-bottom: 0; }
.ch-modal.sh-top > .ch-card { max-height: var(--sh-max, 50%); }
@media (orientation: landscape) { .ch-modal.sh-top > .ch-card { max-height: var(--sh-max, 42%); } }
.ch-modal.sh-top > .ch-card > header { padding-top: calc(4px + env(safe-area-inset-top, 0px)); padding-bottom: 4px; }
.ch-modal.sh-top > .ch-card > .ch-mbody { padding-top: 8px; padding-bottom: 12px; }
.ch-modal.sh-top > .ch-card > .ch-mbody > .ch-foot { bottom: -12px; margin-bottom: -12px; padding: 8px 20px; }
.ch-modal.sh-top > .ch-card > .ch-mbody > .ch-foot .primary { height: 44px; }
@media (max-width: 899px) { .ch-modal.sh-top > .ch-card { border-radius: 0 0 20px 20px; } }
@media (min-width: 900px) {
  .ch-modal.on.sh-top { padding-top: calc(var(--sh-top, 0px) + 12px + env(safe-area-inset-top, 0px)); }
  .ch-modal.sh-top > .ch-card { max-height: calc(var(--sh-max, 50%) - 12px - env(safe-area-inset-top, 0px)); }
  .ch-modal.sh-top > .ch-card > header { padding-top: 4px; }
}
/* the quick actions form: its own sticky foot ends where the shorter card ends */
.sheet.sh-top > .qa-sheet .qa-foot { bottom: -12px; margin-bottom: -12px; padding: 8px 20px; }
/* the one-by-one review's retake note: the note comes up into the top half, the picture stays small above it,
   and what was under the picture comes back when the note is left */
.sw.on.sh-top { padding-top: var(--sh-top, 0px); padding-bottom: var(--sh-rest, 50vh); }
.sw.sh-top > .swtop { padding-top: calc(4px + env(safe-area-inset-top, 0px)); padding-bottom: 4px; }
.sw.sh-top > .swcard > :not(.swmedia) { display: none; }
.sw.sh-top > .swcard > .swmedia { min-height: 0; }
.sw.sh-top > .swhint, .sw.sh-top > .swrule { display: none; }
.sw.sh-top > .swslot { min-height: 0; padding-bottom: 0; }
.sw.sh-top > .swnote { padding-top: 6px; }
.sw.sh-top > .swnote .chipsrow { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 6px; padding: 0 16px; scrollbar-width: none; }
.sw.sh-top > .swnote .chipsrow::-webkit-scrollbar { display: none; }
.sw.sh-top > .swnote .chipsrow > * { flex: none; }
.sw.sh-top > .swnote textarea { min-height: 72px; resize: none; margin-top: 4px; }
.sw.sh-top > .swnote .swacts { padding: 8px 0 4px; }
.sw.sh-top > .swnote .swacts button { min-height: 44px; }
.sw.sh-tight > .swnote .chipsrow { display: none; }

/* KS (breaker, 24 November 2026): a phone on its side. The one answer's card is no taller than half of a
   window that is only 375 to 430 px high, so its sticky actions covered the box before he typed and a tap on
   the box landed on Cancel. Here the card is only the title, the box and the actions, in a row of rows that
   no bar overlaps; the note and the chips give way (they come back when he turns the phone upright). */
@media (orientation: landscape) and (max-height: 520px) {
  .sheet.sh-top > .sheetcard.sh-answer > .sheetacts { position: static; margin: 6px -20px -12px; padding: 4px 20px 8px; }
  .sh-top > .sheetcard.sh-answer > .note:not(.warn),
  .sh-top > .sheetcard.sh-answer > .chipsrow { display: none; }
  .sh-top > .sheetcard.sh-answer > textarea { min-height: 48px; margin-top: 4px; }
}
