/* Shared photo reader: the header and tabs stay in place while the notes scroll. */
#lb .stage {background:#191a1b}
#lb #lbpanel {
  --gutter:clamp(22px,2.35vw,48px);
  --inset:clamp(19px,1.6vw,28px);
  --panel-ink:#202936;
  --panel-muted:#515e6d;
  --panel-blue:#294b68;
  --panel-edge:1px solid rgba(255,255,255,.95);
  --panel-shadow:inset 0 1px 0 white,0 2px 5px #23334a08,0 8px 24px -14px #27364c33;
  display:flex;flex-direction:column;overflow:hidden;
  padding:clamp(24px,3vh,40px) 0 0;
  background:linear-gradient(145deg,#edf1f4,#f7f7f6 60%,#f0f1f1)!important;
  color:var(--panel-ink);font-family:-apple-system,BlinkMacSystemFont,"PingFang SC",system-ui,sans-serif;
}
#lbpanel>.v-title,#lbpanel>.post-info,#lbpanel>.v-src,#lbpanel>.reader-tabs {
  flex:none;margin-inline:var(--gutter)
}
#lbpanel>h3.v-title {
  padding-inline-end:38px;margin-block:0 7px;color:#172331;
  font:650 clamp(21px,1.7vw,28px)/1.42 -apple-system,BlinkMacSystemFont,"PingFang SC",sans-serif;
  letter-spacing:-.035em;text-wrap:pretty
}
#lbpanel>.post-info {display:grid;gap:4px;margin-top:4px;line-height:1.5;color:var(--panel-muted);font-size:13px}
.post-byline,.post-stats {display:flex;align-items:center;gap:10px}
#lbpanel .post-author {font-weight:650;color:#263c50;text-decoration:none}
#lbpanel .post-author:hover {text-decoration:underline}
.post-slot {padding:2px 7px;border-radius:6px;background:#ffffffa8;border:1px solid #d6dee5;color:#4a5967;font:600 12px/1.35 system-ui;font-variant-numeric:tabular-nums}
#lbpanel #view-post {margin-left:auto;padding:6px 10px;border:1px solid #ccd6df;border-radius:10px;background:#ffffffab;text-decoration:none;color:#284863;font-size:13px;font-weight:600;white-space:nowrap}
#lbpanel #view-post:hover {background:white}
.post-stats {flex-wrap:wrap;gap:4px 14px;color:#55616b;font-size:12px}
.post-stats b {font-variant-numeric:tabular-nums}
#lbpanel .reader-tabs {
  display:flex;gap:2px;margin-block:18px 0;padding:4px;
  border:1px solid #ffffffd9;border-radius:22px;background:linear-gradient(155deg,#ffffffa8,#cbd7e1b8);
  box-shadow:inset 0 1px 0 white,0 2px 8px #30425612;
  backdrop-filter:blur(18px) saturate(145%);-webkit-backdrop-filter:blur(18px) saturate(145%)
}
.reader-tabs button {flex:1;border:0;border-radius:18px;min-height:40px;padding:8px 4px;color:#475663;background:transparent;cursor:pointer;font:600 14px system-ui}
.reader-tabs button[aria-selected=true] {background:linear-gradient(175deg,white,#f6f9fce6);color:#182e44;box-shadow:0 1px 2px #31465e24,0 3px 8px #31465e16,inset 0 1px 0 white}
#lbpanel :is(button,a,summary,.reader-pane):focus-visible {outline:2px solid #24567e;outline-offset:1px}
#lbpanel .reader-pane[hidden] {display:none}
/* archive.css resets section padding and borders with !important. */
#lbpanel>.reader-pane:not([hidden]) {
  flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;scroll-padding-block:20px;
  padding:22px var(--gutter) max(36px,env(safe-area-inset-bottom))!important;
  scrollbar-width:thin;scrollbar-color:#bac2c8 transparent
}
#lbpanel .photo-reading,#lbpanel .reader-pane>section,#lbpanel #pane-1>.v-read {
  background:#ffffffb8;box-shadow:var(--panel-shadow);border-radius:16px;
  border:var(--panel-edge)!important;padding:var(--inset)!important;margin:0 0 16px
}
#lbpanel .photo-reading {
  margin-bottom:25px;background:linear-gradient(115deg,#f7fbfd,#e4ecf4 82%,#dfeaf3);
  box-shadow:inset 0 1px 0 white,0 4px 14px #354c6810
}
#lbpanel .reading-origin {display:block;margin:0 0 8px;font-size:12px;color:var(--panel-muted)}
#lbpanel .photo-reading strong {display:block;max-width:23em;color:#192f42;font-size:clamp(19px,1.48vw,24px);line-height:1.56;letter-spacing:-.02em;font-weight:650;text-wrap:pretty}
#lbpanel .photo-reading p {margin:12px 0 0;color:#495764;line-height:1.8;font-size:14px}
#lbpanel .reader-pane .v-sec {margin:20px 0 9px;padding:0;border:0;font:650 17px/1.45 system-ui;letter-spacing:-.02em;color:var(--panel-ink)}
#lbpanel .reader-pane section>h4.v-sec {margin:0 0 14px}
#lbpanel .v-leg {color:#52606a;letter-spacing:0;margin:0 0 14px;line-height:1.65}
#lbpanel #pane-0>.vx {background:#ffffffbd;border:1px solid #dce1e5;border-radius:16px;box-shadow:0 3px 12px #35445108;padding:0 var(--inset)}
#lbpanel #pane-0 .vx-g {padding:18px 0;margin:0}
#lbpanel #pane-0 .vx-g+.vx-g {border-top:1px solid #dce2e7}
#lbpanel .reader-pane .vx-g h5 {font:650 15px/1.5 system-ui;letter-spacing:0;color:var(--panel-blue);margin:0 0 9px}
#lbpanel .reader-pane .vx-g h5::after {display:none}
#lbpanel .reader-pane .vx-r {display:grid;grid-template-columns:minmax(3em,max-content) minmax(0,1fr);column-gap:12px;align-items:baseline;line-height:1.75;padding:8px 0;margin:0;border-color:#25384912;font-size:14px;color:#343f49}
#lbpanel .reader-pane .vx-r b {max-width:7em;color:var(--panel-blue);margin:0;white-space:normal;overflow-wrap:anywhere;font-size:13px}
#lbpanel .reader-pane .vx-r:last-child {border-bottom:0;padding-bottom:0}
#lbpanel .reader-pane .vx-r b:empty {display:none}
#lbpanel .reader-pane .vx-r:has(b:empty) {display:block}
#lbpanel .reader-shooting {background:linear-gradient(135deg,#fcfdff,#e4eff8)}
#lbpanel .reader-shooting .v-read,#lbpanel #pane-1>.v-read {font-size:15px;line-height:1.8;color:#344250}
#lbpanel .reader-shooting .v-read {margin:0 0 8px;background:none;border:0;padding:0}
#lbpanel .reader-borrow .vx-g,#lbpanel .reader-shooting .v-read:last-child {margin:0}
#lbpanel .reader-borrow .vx-r {padding:13px 0}
#lbpanel .reader-frames {margin:16px 0}
#lbpanel .reader-frames summary {cursor:pointer;color:var(--panel-blue);font-size:14px}
#lbpanel .reader-pane>section:last-child {margin-bottom:0}
#lbpanel .reader-tags {display:flex;flex-wrap:wrap;gap:5px}
#lbpanel .reader-tags span {border:1px solid #d6e0e7;border-radius:12px;background:#f4f8fb;color:#3d5368;padding:2px 9px;font-size:12px}
#lbpanel .attribute-row {display:flex;gap:14px;padding:8px 0;align-items:baseline}
#lbpanel .attribute-row>b {flex:none;min-width:4em;font:600 12px system-ui;color:#536273}
#lbpanel .attribute-row+.attribute-row {border-top:1px solid #2839480d}
#lbpanel .reader-palette p,#lbpanel .reader-palette small {margin:0 0 12px;font-size:12px;color:#536273;line-height:1.7}
#lbpanel .reader-palette small {display:block;margin:6px 0 0}
#lbpanel .reader-palette small:empty {display:none}
.reader-palette input {width:8em;font:inherit;user-select:text}
.color-ratio-bar {display:flex;height:28px;border-radius:14px;border:1px solid #d3dce4;overflow:hidden;margin-bottom:10px}
.color-ratio-bar button {min-width:12%;padding:0;border:0;cursor:pointer}
.color-chip-grid {display:grid;grid-template-columns:repeat(auto-fit,minmax(74px,1fr));gap:8px}
.color-chip {display:flex;flex-direction:column;gap:3px;min-height:76px;text-align:left;border:1px solid #d3dce4;background:white;color:#273445;border-radius:12px;padding:6px;cursor:pointer;box-shadow:0 2px 4px #2e405208}
.color-chip:hover {border-color:#627181}
.color-chip-swatch {display:block;height:36px;border-radius:6px;border:1px solid #0002}
.color-chip-hex {font:600 11px ui-monospace,monospace}
.color-chip-pct {font-size:11px;color:#536273}

/* Photo controls share one floating surface. */
#lb #lbtools.tools2 {
  gap:2px;padding:5px 7px;bottom:14px;border-radius:999px;background:linear-gradient(160deg,#484b50e8,#25272cf5 65%);
  border:1px solid #ffffff32;box-shadow:inset 0 1px 0 #ffffff24,0 5px 18px #0004;
  backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)
}
#lb #lbtools .tool-divider {flex:0 0 1px;height:17px;margin:0 4px;background:#ffffff29}
#lb #lbtools button {display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:36px;height:38px;border-radius:999px!important;padding-inline:8px;font:500 13px/1 system-ui;letter-spacing:0}
#lb #lbtools button svg {width:17px;height:17px;flex:none}
#lb #lbtools button[data-m=marks] {padding-inline:13px}
#lb #lbtools button[data-m=marks].on {background:linear-gradient(#f6fbff,#cbdce7)!important;color:#1e3447!important;box-shadow:inset 0 1px 0 #fff,0 1px 3px #1114}
#lb #lbtools button[hidden],#lb #lbtools button[hidden]+.tool-divider {display:none}
#lb #lbtools #photo-fit {font-variant-numeric:tabular-nums;min-width:48px}
#lb #lbtools :is(#photo-in,#photo-out) {font-size:20px;font-weight:400}
#lb #lbtools button:focus-visible {outline:2px solid #a1d9ff;outline-offset:0}
#lb #lbtools #photo-copy {padding-inline:10px}
@media(max-width:960px) {
  #lb #lbpanel {--gutter:clamp(18px,4.8vw,32px);--inset:18px;padding-top:18px}
  #lbpanel>h3.v-title {padding-inline-end:0}
  #lb .stage {height:44dvh}
  #photo-viewport {inset:48px 12px 68px}
  #lb #lbtools {bottom:9px;max-width:calc(100% - 16px)}
  #lbpanel>.reader-tabs {margin-top:12px}
  #lbpanel>.reader-pane:not([hidden]) {padding-top:16px!important}
}
@media(max-width:600px) {
  #lbpanel .reader-tabs button {min-height:44px}
  #lb #lbtools.tools2 {gap:0;padding:3px 5px}
  #lb #lbtools button {height:42px;min-width:34px;padding-inline:5px}
  #lb #lbtools .tool-divider {margin:0 2px}
  #lb #lbtools #photo-copy span {display:none}
  #lb #lbtools #photo-copy {padding-inline:6px}
  #lb #lbtools button[data-m=marks] {padding-inline:9px}
  #lb #lbtools #photo-fit {min-width:40px}
  #lbpanel h3.v-title {font-size:clamp(19px,5vw,22px)}
}
@media(max-width:960px) and (max-height:650px) {
  #lb .stage {height:37dvh}
  #lb #lbpanel {padding-top:12px}
  #lbpanel>.reader-tabs {margin-top:8px}
}
@media(max-height:550px) and (min-aspect-ratio:3/2) {
  #lb #lbpanel {display:block;overflow-y:auto}
  #lbpanel>.reader-tabs {position:sticky;top:8px;z-index:2}
  #lbpanel>.reader-pane:not([hidden]) {overflow:visible}
}
@media(prefers-reduced-transparency:reduce) {
  #lbpanel .reader-tabs {background:#f9fbfd;backdrop-filter:none}
  #lb #lbtools.tools2 {background:#33363a;backdrop-filter:none}
}

.prompt-preview #lb #lbclose,
.prompt-preview #lb .step,
.prompt-preview #lbpanel .reader-frames {display:none!important}
.prompt-preview [data-prompt-region] {cursor:pointer}
.prompt-preview [data-prompt-region]:is(:hover,:focus-visible) {
  outline:2px dashed #447399;
  outline-offset:-2px;
  border-radius:4px;
}
.prompt-preview #lbpanel .reader-palette [data-copy-hex] {cursor:pointer}
@media(max-width:600px) {
  .prompt-preview #lb .stage {height:clamp(265px,52dvh,420px)}
  .prompt-preview #photo-viewport {inset:4px 8px 60px}
}

.prompt-preview [data-prompt-region][aria-pressed="true"] {
  outline:2px solid #447399;
  outline-offset:-2px;
  border-radius:4px;
}

/* Medium-width embedded readers have room for a full-height photo beside the notes. */
@media (min-width:580px) and (max-width:960px) {
  .prompt-preview #lb.on {
    display:grid;
    grid-template-columns:minmax(0,.94fr) minmax(0,1fr);
    grid-template-rows:minmax(0,1fr);
  }
  .prompt-preview #lb .stage {height:100%;max-height:none;padding:0!important}
  .prompt-preview #photo-viewport {inset:8px 6px 60px}
  .prompt-preview #lb #lbpanel {min-width:0;display:flex;overflow:hidden;--gutter:14px;--inset:12px;padding:14px 0 0}
  .prompt-preview #lbpanel>.reader-pane:not([hidden]) {overflow:auto}
  .prompt-preview #lbpanel>.reader-tabs {position:static}
  .prompt-preview #lbpanel .reader-tabs button {padding:7px 2px;font-size:13px}
  .prompt-preview #lb #lbtools {gap:0;padding:3px}
  .prompt-preview #lb #lbtools button {min-width:27px;height:34px;padding-inline:4px}
  .prompt-preview #lb #lbtools .tool-divider {margin-inline:1px}
  .prompt-preview #lb #lbtools #photo-fit {min-width:38px}
  .prompt-preview #lb #lbtools #photo-copy span {display:none}
}
