/* Shared canvas for input, reading, contents, checkout and the paid report.
   Only content is constrained: the document scroll rail stays at the edge. */
:root { --palm-page-width: 440px; }
[data-screen-label="input"] {
  --palm-input-inline-space:24px;
  --palm-input-bottom-space:calc(26px + env(safe-area-inset-bottom,0px));
  --palm-input-content-bottom:20px;
}
[data-palm-input-shell] { padding:0 var(--palm-input-inline-space) var(--palm-input-bottom-space); }
[data-palm-input-content] { padding-bottom:var(--palm-input-content-bottom)!important; }
.palm-input-primary {
  display:flex;align-items:center;justify-content:center;gap:8px;flex:none;width:100%;min-height:47px;
  padding:16px 0;border:0;border-radius:11px;font:700 15px/1 'Noto Sans KR',sans-serif;
}
.palm-input-primary > svg { width:15px;height:15px;flex:none; }
html body [data-screen-label="intro"],
html body [data-screen-label="input"],
html body [data-screen-label="loading"],
html body [data-screen-label="verify"],
html body .reading-flow:not(:has(.payment-detail-page)),
html body .reading-flow-header>div,
html body .rp,
html body .report-nav,
html body .td,
html body .ps,
html body .halmae-dock,
html body .manshin-880055,
html body>div.max-w-md {
  box-sizing:border-box;
  width:100%!important;
  max-width:var(--palm-page-width)!important;
  margin-left:auto;
  margin-right:auto;
}
html body .payment-detail-page.is-preparing { max-width:none; }
html body .palm-detail-back { left:max(12px,calc(50% - 208px)); }
.reading-flow img,.rp img { max-width:100%; }
.reading-flow button,.rp button { touch-action:manipulation; }
.reading-flow input,.rp input { min-width:0; }
/* The photo step shares one viewport between heading, a fitted 3:4 frame and
   its two bottom actions. Other input steps keep their normal document flow. */
[data-palm-capture-page="true"] {
  --palm-capture-height:100vh;
  height:var(--palm-capture-height)!important;
  min-height:0!important;
}
@supports(height:100dvh) { [data-palm-capture-page="true"] { --palm-capture-height:100dvh; } }
[data-palm-capture-page="true"] [data-palm-input-shell] {
  height:100%;min-height:0!important;
  padding-top:calc(50px + env(safe-area-inset-top,0px));
}
[data-palm-capture-page="true"] [data-palm-input-content] {
  display:flex;flex-direction:column;flex:1;min-height:0;margin:0!important;padding-top:0!important;
}
[data-palm-capture-page="true"] [data-palm-input-heading] {
  flex:none;font-size:clamp(18px,3.3dvh,25px)!important;line-height:1.35!important;margin:0 0 12px!important;
}
[data-palm-capture-page="true"] [data-palm-capture-slot] {
  display:flex;flex-direction:column;flex:1;min-height:0;margin:0!important;
}
[data-palm-capture-page="true"] [data-palm-capture-slot] > .sc-host { display:flex;flex-direction:column;flex:1;min-height:0; }
[data-palm-capture-page="true"] [data-palm-capture-stack] { flex:1;min-height:0;gap:12px; }
[data-palm-capture-page="true"] [data-palm-photo-area="true"] {
  order:0!important;flex:1;min-height:0;display:flex;align-items:center;justify-content:center;
}
[data-palm-capture-page="true"] [data-palm-photo-frame] {
  flex:none;width:var(--palm-photo-width,100%)!important;max-width:100%;height:auto;aspect-ratio:3/4;
}
[data-palm-photo-controls] { flex:none;display:flex;flex-direction:column;gap:6px;width:100%; }
[data-palm-photo-controls] button { touch-action:manipulation; }
[data-palm-photo-controls] button:focus-visible { outline:3px solid #e6c463;outline-offset:3px; }
[data-palm-photo-messages] { max-height:min(100px,18dvh);overflow:auto;overscroll-behavior:contain; }
[data-palm-photo-messages]:empty { display:none; }
[data-palm-photo-messages] p { margin:0 0 8px;color:#ffd2d5;font:13px/1.5 system-ui,sans-serif;word-break:keep-all; }
[data-palm-photo-messages] button { min-height:44px;margin-right:10px;text-decoration:underline;text-underline-offset:4px;font-size:13px; }
.palm-photo-secondary {
  display:flex;align-items:center;justify-content:center;gap:8px;flex:none;min-height:44px;
  width:100%;padding:8px 0;background:transparent;color:#d5cfc9;font-size:15px;font-weight:600;
  text-decoration:underline;text-underline-offset:4px;
}
.palm-photo-primary:disabled,.palm-photo-secondary:disabled { cursor:default; }
.palm-photo-secondary:disabled { opacity:.55; }
@media(max-height:500px) {
  [data-palm-capture-page="true"] [data-palm-input-shell] { padding-top:40px; }
  [data-palm-capture-page="true"] [data-palm-input-heading] { font-size:17px!important;gap:0!important;margin-bottom:6px!important; }
  [data-palm-capture-page="true"] [data-palm-capture-stack] { gap:6px; }
}
/* Let long names and contents labels wrap instead of pushing controls out. */
html body .td-item .t { white-space:normal; overflow-wrap:anywhere; }
html body .report-nav-toc { min-width:0; }
/* The contents drawer must use the viewport, not the end of the long page. */
.reading-flow>.ov:not(.ps-overlay),.rp>.ov { position:fixed; inset:0; z-index:60; display:flex; align-items:flex-end; justify-content:center; }
.reading-flow>.ov:not(.ps-overlay)>.td,.rp>.ov>.td { position:relative; bottom:auto; overscroll-behavior:contain; }
.reading-flow>.ov:not(.ps-overlay)>.ov-scrim { position:absolute; inset:0; background:rgba(5,5,5,.72); backdrop-filter:blur(3px); }
@media(max-width:360px) {
  html body .report-nav { gap:6px; padding-inline:12px; }
  html body .td { padding-inline:12px; }
  html body .rp-open .body { padding-inline:20px; }
}
