:root {
  font: 16px "Segoe UI", system-ui, sans-serif;
  color: #222823;
  background: #eeeae2;
  --green: #245849;
  --line: #d6d4ca;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.folder-controls {
  position: absolute; top: 15px; right: 16px; z-index: 1;
  display: grid; justify-items: end; gap: 4px; max-width: 45%;
  padding: 4px 6px; border-radius: 8px; background: #eeeae2f5;
}
.folder-controls span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; }
.folder-controls button { min-height: 30px; padding: 3px 8px; font-size: .8rem; }
button, textarea { font: inherit; }
button {
  min-height: 42px; padding: 8px 15px; border-radius: 8px; border: 1px solid #c5cbc3;
  background: #fffefa; color: inherit; cursor: pointer;
}
button:hover:enabled { background: #f0f3ed; }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 3px solid #327c64; outline-offset: 3px; }
.primary { background: var(--green); color: white; border-color: var(--green); font-weight: 650; }
.primary:hover:enabled { background: #184538; }
#welcome {
  width: min(660px, calc(100% - 32px)); margin: clamp(20px, 5vh, 60px) auto;
  background: #fbf8ef; box-shadow: 0 16px 42px #26272128; border-radius: 14px; overflow: hidden;
}
figure { margin: 0; text-align: center; }
figure img { display: block; width: 100%; }
figcaption { background: white; color: #202520; padding: 10px; font-weight: 650; }
.intro { padding: 22px 24px 25px; text-align: center; }
h1 { margin: 0; font-size: clamp(1.75rem, 5vw, 2.65rem); letter-spacing: -.045em; }
h2 { margin: 7px 0; font-size: 1.2rem; }
.intro p { margin: 8px 0 19px; }
#recent { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 360px; margin: 12px auto 0; padding: 6px 7px 6px 14px; background: #eeeae0; border-radius: 8px; }
#recentName { overflow-wrap: anywhere; text-align: left; }
#setupStatus:empty { display: none; }
#support { display: inline-block; margin-top: 15px; color: var(--green); }
#welcome { background: radial-gradient(ellipse at top, #6c4567, #3d263c 80%); color: #fff9f1; }
#welcome .intro { padding: 30px 24px 26px; }
#welcome .brand { font-weight: 700; display: grid; justify-items: center; gap: 5px; font-family: Georgia, serif; letter-spacing: -.035em; }
.brand-subtitle { font-size: .51em; font-weight: 500; font-style: italic; letter-spacing: .01em; }
.brand-mark { position: relative; width: 46px; height: 38px; margin: 0 0 6px; color: inherit; }
.brand-mark::before, .brand-mark > span {
  content: ""; position: absolute; inset: 3px 4px; border: 2px solid currentColor; border-radius: 3px;
}
.brand-mark::before { transform: translate(5px, -3px) rotate(11deg); }
.brand-mark > span { border-bottom-width: 8px; transform: rotate(-8deg); background: #f7efda; }
.brand-mark > span::before {
  content: ""; position: absolute; left: 5px; top: 4px; width: 5px; height: 5px; border-radius: 50%; background: currentColor;
}
.brand-mark > span::after {
  content: ""; position: absolute; right: 3px; bottom: 0; width: 22px; height: 12px; background: currentColor;
  clip-path: polygon(0 100%, 32% 42%, 51% 67%, 75% 0, 100% 100%);
}
.photo-stack { position: relative; isolation: isolate; width: min(53%, 305px); margin: 0 auto 24px; padding-top: clamp(46px, 10vw, 99px); }
.photo-stack figure { position: relative; box-shadow: 0 5px 15px #1d0f20a6; }
.photo-stack figure img, .stack-back { aspect-ratio: 1.85; object-fit: cover; }
.stack-back { position: absolute; width: 77%; aspect-ratio: 1.46; border: 3px solid #e8d7bb; border-radius: 3px; box-shadow: 0 4px 12px #1d0f2090; }
.stack-center { left: -13%; top: 1%; transform: rotate(-4deg); }
.stack-left { left: -42%; top: 24%; transform: rotate(-8deg); }
.stack-right { right: -32%; top: 10%; transform: rotate(7deg); }
.stack-far-left { left: -48%; top: 49%; transform: rotate(-10deg); }
.stack-far-right { right: -48%; top: 48%; transform: rotate(9deg); }
.photo-stack figcaption { font: italic 650 1rem Georgia, serif; }
#welcome .primary { background: #f5e8ef; color: #482941; border-color: #f5e8ef; }
#welcome .primary:hover:enabled { background: #fff6fa; }
#welcome #recent { background: #efe3ec; color: #322330; }
#welcome #support { color: #fff0fa; }
#welcome :focus-visible { outline-color: #245849; }
@media (max-height: 850px) {
  #welcome { margin-block: 12px; }
  #welcome .intro { padding-block: 16px; }
  #welcome .brand { gap: 3px; font-size: clamp(1.65rem, 4.4vw, 2.3rem); }
  .brand-mark { margin-bottom: 0; }
  #welcome .intro > p { margin-block: 6px 12px; }
  .photo-stack {
    width: min(53%, clamp(160px, calc(47dvh - 35px), 305px));
    padding-top: clamp(42px, calc(16dvh - 30px), 92px);
    margin-bottom: 17px;
  }
  #recent { margin-top: 9px; }
  #welcome #support { margin-top: 9px; }
}
@media (max-height: 680px) {
  #welcome { margin-block: 8px; }
  #welcome .intro { padding-block: 11px; }
  #welcome .brand { font-size: clamp(1.55rem, 4.2vw, 2rem); }
  .brand-mark { height: 32px; }
  .photo-stack {
    width: min(53%, clamp(150px, calc(55dvh - 102px), 265px));
    padding-top: clamp(38px, calc(14dvh - 23px), 70px);
    margin-bottom: 13px;
  }
}
#review {
  position: relative; display: grid; grid-template-rows: minmax(64px, 1fr) repeat(4, auto);
  height: 100dvh; max-width: 1450px; margin: auto; padding: 15px 16px 6px;
}
#welcome {
  width: min(590px, calc(100% - 24px));
  margin: max(12px, calc((100dvh - 480px) / 2)) auto 12px;
  background: radial-gradient(ellipse at top, #fff9eb, #f1e6ca 85%);
  color: #183c2b;
  border: 1px solid #315642;
}
#welcome .intro { min-height: min(480px, calc(100dvh - 24px)); display: grid; grid-template-rows: auto 1fr auto; padding: 20px clamp(14px, 4vw, 25px) 12px; }
.splash-help { display: grid; grid-template-rows: 42px auto; justify-items: center; align-items: center; gap: 4px; }
.information-page {
  width: min(680px, calc(100% - 24px)); margin: 20px auto; padding: clamp(16px, 4vw, 28px);
  color: #183c2b; background: #fff9eb; border: 1px solid #315642; border-radius: 14px;
}
.information-page h1 { font-family: Georgia, serif; }
.information-page p { line-height: 1.55; }
.information-page .app-version { font-size: .875rem; }
.information-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.information-actions a { color: inherit; }
.splash-layout { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); align-items: center; gap: 12px; padding-block: 8px 18px; }
.splash-brand { grid-column: 2; grid-row: 1; }
#welcome .splash-tagline {
  place-self: center; margin: 0; padding-block: 12px; max-width: 27ch; color: inherit; text-wrap: balance;
  font: 700 clamp(1.55rem, 5.6vw, 2.5rem)/1.02 Georgia, serif;
  letter-spacing: -.035em;
}
#welcome .brand { font-size: clamp(1.5rem, 5.2vw, 2.1rem); line-height: 1.08; text-wrap: balance; }
.brand-subtitle {
  margin-top: 4px; padding-top: 7px; border-top: 1px solid #3156428c;
  width: 100%; max-width: 9em; font-size: .61em;
}
.splash-layout .photo-stack { grid-column: 1; grid-row: 1; width: min(53%, 176px); padding-top: 57px; margin-bottom: 4px; }
.photo-stack figcaption { padding: 5px 2px; font-size: .8rem; }
.splash-actions {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.75fr) minmax(0, 1fr);
  align-items: start; gap: 8px; padding-top: 13px; border-top: 1px solid #31564240;
}
.folder-actions { display: grid; justify-items: center; min-width: 0; }
.footer-link { padding: 4px; border: 0; background: transparent; color: inherit; text-decoration: underline; font-size: .8rem; }
.footer-link:hover:enabled { background: #31564214; }
.photo-stack figure img { border: 3px solid #fffaf1; border-bottom: 0; }
.stack-back { border-color: #fffaf1; }
#welcome #choose {
  display: inline-flex; justify-content: center; align-items: center; gap: 12px;
  width: min(100%, 286px); color: #fff9eb; background: #1b4934;
  border-color: #153b2a;
}
#welcome #choose:hover { background: #123826; }
.folder-icon { position: relative; width: 20px; height: 14px; border: 2px solid currentColor; border-radius: 3px; }
.folder-icon::before { content: ""; position: absolute; left: -2px; top: -5px; width: 8px; height: 5px; border: 2px solid currentColor; border-right: 0; border-bottom: 0; border-radius: 3px 0 0 0; }
#welcome #recent {
  justify-content: center; gap: 6px; min-width: 0; max-width: 100%; margin: 4px 0 0;
  padding: 0; background: transparent; color: inherit; font-size: .8rem;
}
#resume { color: inherit; background: transparent; border: 0; border-left: 1px solid #31564255; border-radius: 0; min-height: 32px; padding: 3px 7px; white-space: nowrap; }
#resume:hover:enabled { background: #31564214; }
#welcome #support { margin: 0; padding: 7px 5px; border-radius: 7px; color: inherit; font-size: .8rem; text-decoration: none; }
#welcome #support:hover { background: #31564214; }
#supportWidget { max-width: 100%; text-align: center; }
#feedbackThanks .feedback-thanks-actions { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; margin-top: 20px; }
#feedbackThanks .about-support-widget { justify-content: flex-start; }
#feedbackThanks .feedback-thanks-actions form { margin-left: auto; }
#supportWidget .kofi-button,
.about-support-widget .kofi-button {
  max-width: 100%; white-space: nowrap !important;
  font-size: 11px !important; padding-inline: 7px !important;
}
#supportWidget .kofitext,
.about-support-widget .kofitext { font-size: 11px !important; white-space: nowrap !important; }
#supportWidget .kofiimg,
.about-support-widget .kofiimg { width: 17px !important; height: auto !important; margin-right: 4px !important; }
#welcome #support,
.support-fallback { font-size: 11px; white-space: nowrap; }
@media (max-width: 440px) {
  .splash-actions { grid-template-columns: 1fr 1fr; align-items: center; }
  .folder-actions { grid-column: 1 / -1; grid-row: 1; }
  #welcome #support { margin-top: 0; justify-self: center; }
  .splash-layout { grid-template-columns: 1fr; gap: 12px; }
  .splash-brand { grid-column: 1; grid-row: 1; }
  .splash-layout .photo-stack { grid-row: 2; }
}
#stage { display: grid; place-items: center; min-width: 0; min-height: 0; }
#sheet { max-width: 100%; box-shadow: 0 4px 18px #25251d25; }
#photo { display: block; width: 100%; touch-action: pan-y; user-select: none; }
#editNoteOnPhoto { display: block; width: 100%; min-height: 0; padding: 0; border: 0; border-radius: 0; }
#strip { width: 100%; height: auto; display: block; }
.edit { display: flex; align-items: center; gap: 10px; width: min(820px, 100%); margin: 8px auto 6px; }
#caption { resize: none; }
.edit label { font-family: "Segoe Print", "Segoe UI", sans-serif; font-size: clamp(1.15rem, 2vw, 1.4rem); font-weight: 700; color: #1b4934; white-space: nowrap; border-bottom: 2px solid #1b493440; padding-bottom: 3px; }
textarea { width: 100%; min-width: 0; padding: 8px 11px; resize: vertical; border: 1px solid #b9c0b5; border-radius: 8px; }
.edit button { white-space: nowrap; }
#film { display: flex; min-width: 0; gap: 9px; overflow-x: auto; padding: 6px 5px 10px; }
#film button { padding: 0; border: 2px solid transparent; flex: 0 0 106px; height: 71px; position: relative; background: #dedbd1; }
#film img { width: 100%; height: 100%; object-fit: contain; border-radius: 5px; display: block; }
#film button[aria-current="true"] { border-color: var(--green); outline: 2px solid var(--green); outline-offset: 1px; }
#film button[data-captioned]::after { content: "✓"; position: absolute; right: 3px; bottom: 3px; background: var(--green); color: white; border-radius: 50%; width: 21px; }
nav { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
#position { min-width: 79px; text-align: center; font-variant-numeric: tabular-nums; }
#status { text-align: center; margin: 7px 0 0; min-height: 24px; color: #425647; }
dialog { max-width: min(460px, 92vw); border: 1px solid var(--line); border-radius: 12px; padding: 24px; background: #fffefa; }
dialog::backdrop { background: #171b1766; }
body:has(#optionsPage:not([hidden])) main { display: none; }
#optionsPage {
  width: min(880px, calc(100% - 24px)); margin: 12px auto; padding: clamp(14px, 3vw, 24px);
  border: 1px solid var(--line); border-radius: 12px; background: #fffefa;
}
.options-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; gap: 20px; }
.options-columns > fieldset { min-width: 0; }
.options-actions { display: flex; justify-content: end; gap: 9px; margin-top: 14px; }
#scanFolderSetup { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin: 10px 0; }
#optionsStatus:empty { display: none; }
@media (max-width: 680px) { .options-columns { grid-template-columns: minmax(0, 1fr); gap: 0; } }
#selectedScanFolder { overflow-wrap: anywhere; }
#optionsForm fieldset { margin-block: 10px; border: 1px solid var(--line); }
#optionsForm fieldset p { margin-block: 6px; }
.strip-settings { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.strip-settings label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.strip-color-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#editStripColor { display: inline-flex; align-items: center; gap: 6px; }
#stripColorSwatch { width: 16px; height: 16px; border: 1px solid #777; border-radius: 3px; }
#stripColorEditor {
  position: fixed; inset: 0; margin: auto; z-index: 2; width: min(820px, calc(100% - 24px));
  height: fit-content; padding: 16px; border: 1px solid var(--line); border-radius: 10px;
  background: #fffefa; box-shadow: 0 8px 30px #25251d45;
}
#stripColorEditor label { margin-bottom: 8px; }
#stripColorEditor h3 { margin: 0 0 12px; font-size: 1rem; }
#stripColorEditor h4 { margin: 14px 0 8px; }
.strip-editor-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: start; gap: 20px; }
@media (max-width: 500px) { .strip-editor-layout { grid-template-columns: 1fr; gap: 8px; } }
#stripColorEditor { max-height: calc(100dvh - 24px); overflow: auto; }
.color-sample { width: 100%; margin: 4px 0 12px; }
.strip-wheel-wrap { position: relative; width: 180px; height: 180px; margin: 8px auto; }
#stripColorWheel { display: block; width: 100%; height: 100%; border-radius: 50%; touch-action: none; cursor: crosshair; }
#stripColorWheel:focus-visible { outline: 3px solid #2f8066; outline-offset: 4px; }
.strip-wheel-cursor { position: absolute; width: 14px; height: 14px; border: 2px solid white; border-radius: 50%; box-shadow: 0 0 0 1px #111; transform: translate(-50%, -50%); pointer-events: none; }
#optionsPage .strip-wheel-help { font-size: 12px; line-height: 1.3; margin: 6px 0; }
#stripBrightness { accent-color: #285c4b; }
.strip-palette { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.strip-palette button { width: 28px; min-height: 28px; padding: 0; background: var(--swatch); }
.strip-palette button:hover:enabled { background: var(--swatch); outline: 1px solid currentColor; }
#draftStripColor { max-width: 8ch; font: inherit; }
.strip-color-actions { display: flex; justify-content: flex-end; gap: 4px; margin-top: 8px; }
.strip-color-actions button { min-height: 32px; padding: 4px 6px; }
.strip-sample { min-width: 0; margin: 4px 0; box-shadow: 0 2px 8px #25251d25; }
.strip-sample canvas { display: block; width: 100%; height: auto; }
dialog div { display: flex; justify-content: end; gap: 9px; }
.feedback-actions { flex-wrap: wrap; }
#feedbackStatus:empty { display: none; }
@media (max-width: 540px) {
  .edit { display: grid; grid-template-columns: 1fr auto; }
  .edit label { grid-column: 1 / -1; }
  nav button { padding-inline: 8px; }
}

/* Keep the source photo intact while displaying the chosen monochrome treatment. */
.memory-photo { filter: grayscale(1) brightness(1.18) contrast(.92); }
.photo-stack figure img.memory-photo { aspect-ratio: 1746 / 1169; object-fit: contain; }

/* Keep both faces visible in the wedding photo's landscape stack frame. */
.stack-far-right { object-position: center 16%; }

/* Frame the man on the truck around his face and upper body. */
.stack-left { object-position: center 18%; }

.stack-far-left { object-position: center bottom; }

/* Home page typography. */
#welcome, #welcome .brand, #welcome .splash-tagline, #welcome .photo-stack figcaption { font-family: 'Segoe UI', system-ui, sans-serif; }

/* Compact the options preview to balance the two columns. */
.strip-settings > .strip-sample { width: min(100%, 250px); justify-self: center; }
@media (min-width: 681px) {
  .options-columns { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .options-columns > fieldset { align-self: stretch; }
}

#sheet { position: relative; }
.photo-rotate { position: absolute; top: 6px; z-index: 1; width: 38px; height: 38px; min-height: 38px; padding: 0; font-size: 1.6rem; line-height: 1; background: #fffefae8; box-shadow: 0 1px 5px #0003; }
.rotate-left { left: 6px; }
.rotate-right { right: 6px; }

#backToHome { position: absolute; top: 15px; left: 16px; z-index: 2; min-height: 36px; padding: 5px 10px; color: #1b4934; background: #fffefaf2; font-weight: 600; }

#photoInfo { position: absolute; right: 16px; top: 116px; bottom: 215px; z-index: 3; width: 270px; padding: 14px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #fffefa; box-shadow: 0 4px 15px #0002; }
.photo-info-heading { display: flex; justify-content: space-between; align-items: center; }
.photo-info-heading button { min-height: 30px; padding: 0 8px; font-size: 1.3rem; }
#photoInfoDetails { margin: 12px 0; font-size: .85rem; }
#photoInfoDetails dt { font-weight: 650; color: #1b4934; margin-top: 10px; }
#photoInfoDetails dd { margin: 2px 0 0; overflow-wrap: anywhere; }
#photoInfoStatus, .photo-info-hint { font-size: .8rem; color: #536057; }
#captionDate { display: block; width: 100%; margin: 6px 0 9px; padding: 8px; font: inherit; border: 1px solid #b9c0b5; border-radius: 5px; }
#photoInfo label { font-size: .9rem; font-weight: 600; }

@media (max-width: 600px), (max-height: 650px) { #photoInfo { top: 115px; bottom: 12px; max-width: calc(100% - 32px); } }

.edit { width: min(960px, 100%); }
#dateFormat { max-width: 100%; margin: 6px; padding: 6px; font: inherit; }
@media (max-width: 540px) { #caption { grid-column: 1 / -1; } }

.photo-map-link { display: inline-block; margin-left: 6px; white-space: nowrap; color: #1b4934; text-underline-offset: 3px; }

#saveModeHelp, #photoInfoHelp { font-size: .8rem; line-height: 1.4; color: #536057; }

.options-right { min-width: 0; }


/* Keep the picture centered; fit its information frame into the spare right space. */
.review-options { position: absolute; top: 59px; left: 16px; z-index: 2; min-height: 34px; padding: 5px 10px; }
#photoInfo { position: absolute; bottom: auto; margin: 0; max-width: none; min-height: 0; padding: 14px; border: 1px solid #aab9ae; border-radius: 3px; background: #eeeae2; box-shadow: none; }
#photoInfoDetails { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
.photo-info-item { min-width: 0; }
#photoInfoDetails dt { margin-top: 0; }
#photoInfo.compact-info #photoInfoDetails { grid-template-columns: 1fr; }

#geoapifyKey { display: block; width: 100%; padding: 8px; margin-top: 6px; font: inherit; }
.location-help, .location-credit { font-size: .75rem; color: #536057; }
.location-credit { display: block; margin-top: 5px; }
.location-credit a { color: #1b4934; }
.photo-info-item dd > [role="status"] { display: block; font-size: .8rem; margin-top: 4px; }

#captionLocation { display: block; width: 100%; padding: 8px; margin: 8px 0; font: inherit; }
#datePlacement, #locationPlacement { font: inherit; padding: 6px; margin: 6px; }
.edit { width: min(1100px, 100%); }
@media (max-width: 760px) { .edit { flex-wrap: wrap; } .edit textarea { flex-basis: 100%; } }

.detail-available::before { content: "✓"; color: #20803d; font-weight: 800; margin-right: 6px; }

#locationFormat { max-width: 100%; font: inherit; padding: 6px; margin: 6px; }

.saved-notice { position:fixed; left:50%; top:50%; transform:translate(-50%,-50%); z-index:1000; padding:12px 24px; border-radius:12px; background:#194b38; color:#fff9e9; box-shadow:0 4px 18px #0003; font:600 18px/1.4 "Segoe UI",sans-serif; pointer-events:none; }
.saved-notice[hidden] { display:none; }

#formatNotice { margin: 4px auto 0; max-width: 1000px; padding: 6px 12px; border-left: 3px solid #8a6527; background: #fff6df; color: #493b22; font-size: .85rem; line-height: 1.35; }

#optionsForm fieldset small { display: block; margin: 4px 0 12px 24px; font-size: .8rem; line-height: 1.4; color: #536057; }

/* Review layout: reserve space instead of covering the photo with controls. */
#review { grid-template-rows: auto minmax(220px, 1fr) repeat(4, auto); height: 100dvh; min-height: 620px; gap: 6px; }
.review-header { display: flex; justify-content: space-between; align-items: start; gap: 16px; min-width: 0; }
.review-left-actions { display: grid; justify-items: start; gap: 5px; flex-shrink: 0; }
#backToHome, .review-options, .folder-controls { position: static; }
.folder-controls { max-width: min(50%, 420px); padding: 0; min-width: 0; }
.folder-controls span { white-space: normal; overflow-wrap: anywhere; text-align: right; }
#review button { min-height: 44px; }
.review-visual { position: relative; min-width: 0; min-height: 0; --info-width: clamp(240px, 25%, 340px); }
#stage { width: 100%; height: 100%; margin-inline: auto; }
#review.with-photo-info #stage { width: calc(100% - 2 * (var(--info-width) + 12px)); }
#sheet { min-width: 0; }
#photo { height: auto; object-fit: contain; }
#review #photoInfo { position: absolute; inset: 0 0 0 auto; width: var(--info-width); height: auto; max-width: 100%; overflow: auto; overscroll-behavior: contain; }
#photoInfoDetails { grid-template-columns: minmax(0, 1fr); }
.photo-info-heading { gap: 10px; }
.photo-info-heading button { flex-shrink: 0; }
.edit { display: grid; grid-template-columns: auto minmax(140px, 1fr) repeat(3, auto); width: 100%; margin: 0; }
.edit label { grid-column: auto; }
#caption { grid-column: auto; min-height: 62px; }
#review nav { margin: 0; }
#status { overflow-wrap: anywhere; }
.review-messages { min-width: 0; }
#film { scroll-padding-inline: 6px; }
#review .photo-rotate { width: 44px; height: 44px; }
@media (min-width: 1400px) { #photoInfoDetails { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1099px) {
  #review { height: auto; min-height: 100dvh; grid-template-rows: auto auto repeat(4, auto); }
  .review-visual { display: grid; gap: 12px; }
  #stage, #review.with-photo-info #stage { width: 100%; height: clamp(240px, 52dvh, 620px); }
  #review #photoInfo { position: static; width: 100%; max-height: 320px; }
  #photoInfoDetails { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .edit { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .edit label, #caption { grid-column: 1 / -1; }
  .edit label { justify-self: start; }
  .edit button { white-space: normal; padding-inline: 8px; }
}
@media (max-width: 480px) {
  #review { padding: 10px 10px 16px; }
  #photoInfoDetails { grid-template-columns: minmax(0, 1fr); }
  #review nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #position { grid-column: 1 / -1; grid-row: 1; }
  #prev { grid-column: 1; grid-row: 2; }
  #next { grid-column: 2; grid-row: 2; }
  #review nav button { white-space: normal; font-size: .875rem; }
}

#review #editNoteOnPhoto { min-height: 0; }

.release-notes { margin-block: 24px; }
.release-notes details { padding: 10px 0; border-bottom: 1px solid #31564240; }
.release-notes summary { cursor: pointer; font-weight: 600; padding-block: 5px; }
.release-notes details p { margin: 8px 0; }

.app-news { margin-block: 24px; padding: 16px; background: #3156420a; border: 1px solid #31564230; border-radius: 10px; }
.app-news h3 { margin: 12px 0 6px; font-size: 1.1rem; }
.app-news time { font-size: .85rem; color: #536057; }

/* Small printed sticker beside the name, kept within the brand column. */
.brand-title { position: relative; }
#welcome .brand-name { margin: 0; font: inherit; letter-spacing: inherit; }
.brand-title .brand-name-line { padding-right: 1.45em; }
.brand-title > .beta-sticker { position: absolute; right: .3em; top: 1em; }
.brand-title > .brand-trademark { position: absolute; left: 100%; top: 3.7em; }
.brand-name-line { display: inline-flex; align-items: center; justify-content: center; gap: .16em; max-width: 100%; }
.beta-sticker { display: inline-block; flex: 0 0 auto; padding: .3em .4em; border: 1px solid #183c2b; border-radius: 4px; background: #1b4934; color: #fff9eb; box-shadow: 1px 2px 0 #183c2b30; transform: rotate(9deg); font: 800 .29em/1 "Segoe UI", sans-serif; letter-spacing: .07em; vertical-align: middle; }

.folder-controls .review-folder-heading { display: flex; align-items: center; justify-content: flex-end; gap: 8px; overflow: visible; padding: 3px; }
.review-folder-heading #folderName { min-width: 0; overflow-wrap: anywhere; }
.folder-controls .review-beta { font-size: .65rem; white-space: nowrap; overflow: visible; }

/* Fit desktop review to the usable viewport, including short/scaled displays. */
@media (min-width: 800px) and (min-height: 400px) {
  #review { height: 100dvh; min-height: 0; grid-template-rows: auto minmax(0, 1fr) auto auto auto auto; gap: 4px; padding: 8px 12px 4px; }
  .review-left-actions { gap: 3px; }
  #review button { min-height: 36px; padding: 5px 10px; }
  .review-header { gap: 10px; }
  .folder-controls { max-width: 45%; }
  .review-folder-heading #folderName { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .review-visual { display: block; --info-width: clamp(210px, 25%, 340px); }
  #stage { width: 100%; height: 100%; }
  #review.with-photo-info #stage { width: calc(100% - 2 * (var(--info-width) + 10px)); height: 100%; }
  #review #photoInfo { position: absolute; inset: 0 0 0 auto; width: var(--info-width); height: auto; max-height: none; padding: 10px; }
  #photoInfoDetails { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 8px 0; font-size: .8rem; }
  .photo-info-heading h2 { font-size: 1.05rem; }
  .edit { grid-template-columns: auto minmax(100px, 1fr) repeat(3, auto); gap: 8px; }
  .edit label { grid-column: auto; font-size: 1.1rem; }
  #caption { grid-column: auto; min-height: 48px; height: 48px; padding: 6px 9px; }
  .edit button { white-space: nowrap; font-size: .9rem; }
  #film { padding-block: 4px 7px; }
  #film button { flex-basis: clamp(72px, 13dvh, 106px); height: clamp(44px, 10dvh, 71px); min-height: 0; padding: 0; }
  #review nav { gap: 6px; }
  #review nav button { font-size: .875rem; }
  .review-messages { max-height: 64px; overflow: auto; }
  #status { margin: 0; min-height: 18px; font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #formatNotice { margin-top: 2px; padding: 3px 8px; font-size: .75rem; }
  #review .photo-rotate { width: 36px; height: 36px; padding: 0; }
  #review #editNoteOnPhoto { min-height: 0; padding: 0; }
}

/* Corner controls share the visual row instead of consuming a header band. */
@media (min-width: 800px) and (min-height: 400px) {
  #review { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) repeat(4, auto); }
  .review-header, .review-visual { grid-column: 1; grid-row: 1; }
  .review-header { align-self: start; z-index: 2; pointer-events: none; }
  .review-header > * { pointer-events: auto; }
  .review-left-actions { max-width: calc((100% - 20px) / 4); }
  #backToHome { max-width: 100%; }
  .folder-controls { max-width: 25%; }
  #review #photoInfo { top: 44px; }
  #stage { align-items: start; }
  .edit { grid-column: 1; grid-row: 2; }
  #film { grid-column: 1; grid-row: 3; }
  #review nav { grid-column: 1; grid-row: 4; }
  .review-messages { grid-column: 1; grid-row: 5; }
}

/* Small windows also use a bounded review workspace, never a tall document. */
@media (max-width: 799px), (max-height: 399px) {
  #review { height: 100dvh; min-height: 0; padding: 6px 8px 4px; gap: 4px; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto auto auto; }
  .review-header { grid-column: 1; grid-row: 1; gap: 8px; }
  .review-left-actions { display: flex; flex-wrap: wrap; gap: 4px; max-width: 60%; }
  #review button { min-height: 32px; padding: 4px 8px; font-size: .8rem; }
  .folder-controls { max-width: 40%; }
  .folder-controls span { font-size: .7rem; }
  .review-folder-heading #folderName { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
  .review-visual { grid-column: 1; grid-row: 2; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 4px; min-height: 0; }
  #review.with-photo-info .review-visual { grid-template-rows: minmax(0, 3fr) minmax(0, 2fr); }
  #stage, #review.with-photo-info #stage { width: 100%; height: 100%; min-height: 0; align-items: center; }
  #review #photoInfo { position: static; width: 100%; height: 100%; min-height: 0; max-height: none; padding: 6px 8px; overflow: auto; }
  #photoInfoDetails { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 12px; font-size: .75rem; margin: 6px 0; }
  .photo-info-heading h2 { margin: 0; font-size: .9rem; }
  #photoInfoStatus { font-size: .7rem; margin: 5px 0; }
  .edit { grid-column: 1; grid-row: 3; grid-template-columns: auto repeat(3, minmax(0, 1fr)); gap: 4px 6px; margin: 0; }
  .edit label { grid-column: 1; grid-row: 1; align-self: center; font-size: .85rem; padding: 0; }
  #caption { grid-column: 2 / -1; grid-row: 1; height: 42px; min-height: 42px; padding: 5px 7px; font-size: .875rem; }
  .edit button { grid-row: 2; white-space: normal; }
  #save { grid-column: 2; }
  #openCaptionDate { grid-column: 3; }
  #openCaptionLocation { grid-column: 4; }
  #film { grid-column: 1; grid-row: 4; padding: 3px 4px 5px; gap: 6px; }
  #film button { flex-basis: 70px; height: clamp(32px, 9dvh, 52px); min-height: 0; padding: 0; }
  #review nav { grid-column: 1; grid-row: 5; display: flex; flex-wrap: nowrap; gap: 4px; margin: 0; }
  #review nav button { min-width: 0; min-height: 30px; padding: 3px 5px; font-size: .7rem; white-space: normal; }
  #position { min-width: 48px; font-size: .7rem; }
  .review-messages { grid-column: 1; grid-row: 6; max-height: 38px; overflow: auto; }
  #status { min-height: 14px; margin: 0; font-size: .65rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #formatNotice { font-size: .7rem; margin-top: 2px; padding: 3px 6px; }
  #review .photo-rotate { width: 30px; height: 30px; min-height: 30px; padding: 0; font-size: 1.3rem; }
  #review #editNoteOnPhoto { min-height: 0; padding: 0; }
}

/* One desktop arrangement at every size; JS scales the entire workspace. */
#review.fixed-layout { position: fixed; inset: 0 auto auto 0; transform-origin: top left; max-width: none; min-height: 0; margin: 0; padding: 8px 12px 4px; gap: 4px; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) repeat(4, auto); }
#review.fixed-layout .review-header { grid-column: 1; grid-row: 1; align-self: start; z-index: 2; pointer-events: none; gap: 10px; }
#review.fixed-layout .review-header > * { pointer-events: auto; }
#review.fixed-layout .review-left-actions { display: grid; justify-items: start; gap: 3px; max-width: 25%; }
#review.fixed-layout .folder-controls { max-width: 25%; }
#review.fixed-layout .folder-controls span { font-size: .8rem; }
#review.fixed-layout .folder-controls .review-beta { font-size: .65rem; }
#review.fixed-layout .review-visual { display: block; grid-column: 1; grid-row: 1; --info-width: clamp(210px, 25%, 340px); }
#review.fixed-layout #stage { width: 100%; height: 100%; align-items: start; }
#review.fixed-layout.with-photo-info #stage { width: calc(100% - 2 * (var(--info-width) + 10px)); height: 100%; }
#review.fixed-layout #photoInfo { position: absolute; inset: 44px 0 0 auto; width: var(--info-width); height: auto; max-height: none; min-height: 0; padding: 10px; overflow: auto; }
#review.fixed-layout #photoInfoDetails { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 8px 0; font-size: .8rem; }
#review.fixed-layout .photo-info-heading h2 { font-size: 1.05rem; margin: 7px 0; }
#review.fixed-layout #photoInfoStatus { font-size: .8rem; }
#review.fixed-layout button { min-height: 36px; padding: 5px 10px; font-size: 1rem; }
#review.fixed-layout .edit { grid-column: 1; grid-row: 2; grid-template-columns: auto minmax(140px, 1fr) repeat(3, auto); gap: 8px; margin: 0; }
#review.fixed-layout .edit label { grid-column: 1; grid-row: 1; font-size: 1.35rem; height: 64px; display: flex; align-items: center; padding-bottom: 3px; }
#review.fixed-layout #caption { grid-column: 2; grid-row: 1; height: 64px; min-height: 64px; padding: 10px 9px; font-size: 1rem; }
#review.fixed-layout .edit button { grid-row: 1; white-space: nowrap; font-size: 1rem; height: 64px; min-height: 64px; }
#review.fixed-layout #save { grid-column: 3; }
#review.fixed-layout #openCaptionDate { grid-column: 4; }
#review.fixed-layout #openCaptionLocation { grid-column: 5; }
#review.fixed-layout #film { grid-column: 1; grid-row: 3; padding: 4px 5px 7px; gap: 9px; }
#review.fixed-layout #film button { flex-basis: 96px; height: 64px; min-height: 0; padding: 0; }
#review.fixed-layout nav { grid-column: 1; grid-row: 4; display: flex; flex-wrap: nowrap; gap: 6px; margin: 0; }
#review.fixed-layout nav button { font-size: .875rem; white-space: nowrap; }
#review.fixed-layout #position { min-width: 79px; font-size: 1rem; }
#review.fixed-layout .review-messages { grid-column: 1; grid-row: 5; max-height: 64px; overflow: auto; }
#review.fixed-layout #status { margin: 0; min-height: 18px; font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#review.fixed-layout #formatNotice { font-size: .75rem; margin-top: 2px; padding: 3px 8px; }
#review.fixed-layout .photo-rotate { width: 36px; height: 36px; min-height: 36px; padding: 0; font-size: 1.6rem; }
#review.fixed-layout #editNoteOnPhoto { min-height: 0; padding: 0; }

.sample-download { margin-block: 20px; padding: 18px; border: 1px solid #31564240; border-radius: 10px; }
.sample-download-button { display: inline-block; padding: 12px 16px; border-radius: 8px; text-decoration: none; line-height: 1.5; }
.sample-download-button:hover { background: #184538; }
.sample-download-button span { white-space: nowrap; font-size: .85em; }
.sample-download li { margin-block: 10px; line-height: 1.5; }

#firstVisitWelcome { width: min(460px, 92vw); max-height: calc(100dvh - 24px); overflow: auto; color: #183c2b; background: #fff9eb; }
#firstVisitWelcome p { line-height: 1.5; }
.welcome-preference { display: flex; align-items: center; gap: 8px; margin-block: 16px; }
.welcome-storage-note { font-size: .8rem; color: #536057; }

.ai-values { margin-block: 22px; }
.sample-ai-note { padding: 12px; border-left: 3px solid #315642; background: #31564208; font-size: .9rem; }
.sample-ai-note a { color: #1b4934; text-underline-offset: 3px; }

.brand-trademark { font-size: .32em; vertical-align: super; margin-left: .12em; letter-spacing: 0; }
.brand-notice { margin-block: 22px; }

.tutorial-choices { display: flex; flex-wrap: wrap; gap: 10px; margin-block: 16px; }
#detailedGuide { margin-block: 24px; }
#detailedGuide details { border-bottom: 1px solid #31564240; padding: 12px 0; }
#detailedGuide summary { font-weight: 600; cursor: pointer; }
#quickTour { position: fixed; inset: 0; z-index: 2000; pointer-events: none; }
.tour-shade { position: fixed; background: #101d18b8; pointer-events: auto; }
.tour-ring { position: fixed; border: 3px solid #e8c97e; border-radius: 8px; pointer-events: none; box-shadow: 0 0 0 2px #183c2b; }
.tour-card { position: fixed; padding: 14px; border: 1px solid #315642; border-radius: 12px; background: #fff9eb; color: #183c2b; box-shadow: 0 6px 24px #0005; pointer-events: auto; max-height: calc(100dvh - 16px); overflow: auto; font: 14px/1.4 'Segoe UI',sans-serif; }
.tour-card p { margin: 6px 0; }
.tour-card h2 { font-size: 1.1rem; }
#tourCount { font-size: .8em; }
.tour-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-top: 10px; }
.tour-actions button { font-size: 13px; padding: 6px 9px; min-height: 34px; }

/* Options retain their two columns and scale together to fit the window. */
body:has(#optionsPage:not([hidden])) { overflow: hidden; }
#optionsPage { position: fixed; top: 12px; margin: 0; padding: 16px 20px; transform-origin: top left; font-size: 16px; line-height: 1.3; }
#optionsTitle { margin: 0 0 10px; font-size: 24px; outline: none; }
#optionsPage .options-columns { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 20px; }
#optionsPage fieldset { padding: 8px 12px; margin-block: 8px; }
#optionsPage legend { font-size: 17px; }
#optionsPage button { min-height: 34px; padding: 6px 10px; font-size: 15px; }
#optionsPage select, #optionsPage input { font-size: 15px; }
#optionsPage fieldset p { margin-block: 5px; }
#optionsPage fieldset small { margin: 2px 0 6px 24px; font-size: 12px; line-height: 1.3; }
#optionsPage #saveModeHelp, #optionsPage #photoInfoHelp, #optionsPage .location-help { font-size: 12px; line-height: 1.3; }
#optionsPage #scanFolderSetup { margin: 0 0 8px; }
#optionsPage #optionsStatus { margin: 6px 0; }
#optionsPage #cityResetStatus:empty { display: none; }
#optionsPage .strip-settings > .strip-sample { width: 210px; }
#optionsPage .options-actions { margin-top: 8px; }
#optionsPage #stripColorEditor { position: absolute; inset: 16px auto auto 50%; margin: 0; transform: translateX(-50%); width: 820px; max-height: none; overflow: visible; }
#optionsPage .strip-editor-layout { grid-template-columns: minmax(0,2fr) minmax(0,3fr); }
#optionsPage .strip-palette button { padding: 0; min-height: 28px; }

#scanFolderSetup .folder-storage-note { flex-basis: 100%; font-size: 12px; color: #536057; line-height: 1.3; }

.brand-notes-line { position: relative; display: inline-block; }
.brand-notes-line > .brand-trademark { position: absolute; left: 100%; top: .1em; margin-left: .12em; }

#tourThanks { max-width: min(560px, 92vw); }
#tourThanks .tour-thanks-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tour-coffee-link { display: inline-block; padding: 10px 14px; border-radius: 8px; background: #1b4934; color: #fffefa; text-decoration: none; font-weight: 600; }

#tourSavedFolder { position: relative; margin: 20px 0 10px; padding: 12px; border: 1px solid #c79d44; border-radius: 0 8px 8px 8px; background: #efd18c; color: #183c2b; }
#tourSavedFolder::before { content: ''; position: absolute; top: -10px; left: -1px; width: 45%; height: 10px; background: #efd18c; border: 1px solid #c79d44; border-bottom: none; border-radius: 6px 6px 0 0; }
#tourSavedFolder figcaption { font-weight: 700; margin-bottom: 7px; }
.tour-folder-picture { position: relative; width: 150px; max-width: 100%; margin: auto; box-shadow: 0 2px 6px #0003; background: white; }
.tour-folder-picture img { display: block; width: 100%; height: auto; }
.tour-saved-check { position: absolute; right: -10px; top: -10px; background: #245849; color: white; border-radius: 50%; width: 28px; height: 28px; text-align: center; font-size: 22px; }
#tourSavedFolder small { display: block; text-align: center; margin-top: 8px; }

#tourTitle { outline: none; }

#optionsPage label:has(> #showPhotoInfoAlways) { display: block; margin-bottom: 8px; }

.local-testing { margin: 18px 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; }
.local-testing summary { cursor: pointer; font-weight: 600; }
.local-testing label { display: block; }
.local-testing #geoapifyKey { max-width: 540px; }

/* About actions stay in their own left column instead of covering content. */
:is(#aboutPage, #tutorialPage) { width: min(1000px, calc(100% - 24px)); display: grid; grid-template-columns: 190px minmax(0,1fr); gap: 24px; align-items: start; }
:is(#aboutPage, #tutorialPage) > .information-actions { position: sticky; top: 16px; display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 12px; background: #f1e6ca; border: 1px solid #c5cbbd; border-radius: 10px; }
:is(#aboutPage, #tutorialPage) > .information-actions button { width: 100%; font-size: 15px; }
:is(#aboutPage, #tutorialPage) .information-content { min-width: 0; }
:is(#aboutPage, #tutorialPage) .information-content > h1 { margin-top: 0; }
:is(#aboutPage, #tutorialPage) .about-support-widget { text-align: center; }
:is(#aboutPage, #tutorialPage) .support-fallback { display: inline-block; padding: 10px 8px; background: #1b4934; color: white; border-radius: 8px; text-decoration: none; font-size: 13px; }
@media (max-width: 640px) {
  :is(#aboutPage, #tutorialPage) { grid-template-columns: minmax(0,1fr); gap: 16px; }
  :is(#aboutPage, #tutorialPage) > .information-actions { top: 0; z-index: 5; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
  :is(#aboutPage, #tutorialPage) > .information-actions > * { flex: 1 1 120px; }
  :is(#aboutPage, #tutorialPage) > .information-actions button { font-size: 13px; padding: 7px; }
}

#review.fixed-layout .review-folder-heading { padding: 0; gap: 6px; }
#review.fixed-layout .folder-controls .review-product-name { font-weight: 700; font-size: .85rem; white-space: nowrap; }
#review.fixed-layout .folder-controls .review-working-folder { display: block; width: 100%; font-size: .75rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }

/* Compact the floating Ko-fi overlay while keeping its corner anchor. */
.floatingchat-container-wrap, .floatingchat-container-wrap-mobi { transform: scale(.8); transform-origin: bottom left; }

/* Overlay stays within the photo stack and never blocks home actions. */
#homePhotoLoading { position: absolute; z-index: 5; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 8px; white-space: nowrap; padding: 10px 14px; border-radius: 10px; color: #173f30; background: #fff9eb; box-shadow: 0 2px 12px #0002; font: 500 14px "Segoe UI", sans-serif; pointer-events: none; }
#homePhotoLoading[hidden] { display: none; }
.home-photo-spinner { width: 16px; height: 16px; border: 2px solid #cad5cf; border-top-color: #245849; border-radius: 50%; animation: home-photo-spin 0.8s linear infinite; }
@keyframes home-photo-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .home-photo-spinner { animation: none; } }

/* Desktop home preserves its arrangement as the entire card scales to fit. */
#welcome.fit-home { position: fixed; left: 50%; top: 50%; width: 590px; margin: 0; transform: translate(-50%, -50%) scale(var(--home-scale, 1)); transform-origin: center; }
#welcome.fit-home .intro { min-height: 480px; }

#aboutPage .information-actions button[aria-pressed="true"] { background: var(--green); color: white; border-color: var(--green); font-weight: 650; }
#aboutNews { margin-top: 0; }
#aboutOverview > h1, #aboutNews > h1, #aboutHistory > h1 { margin-top: 0; }

/* Matching secondary home actions; photo review keeps the primary green. */
#welcome .splash-help { grid-template-rows: repeat(2, minmax(42px, auto)); justify-items: stretch; gap: 8px; }
#welcome .footer-link, #welcome #support, #welcome #supportWidget .kofi-button {
  display: flex !important; align-items: center; justify-content: center;
  width: 100%; min-height: 42px; margin: 0 !important; padding: 7px 8px !important;
  border: 1px solid #a8bca2 !important; border-radius: 8px !important;
  background: #dce6d7 !important; color: #183c2b !important;
  font: 600 15px/1.3 'Segoe UI', system-ui, sans-serif !important;
  text-decoration: none !important; box-shadow: none !important;
}
#welcome #supportWidget { width: 100%; }
#welcome #supportWidget .kofitext { color: #183c2b !important; font: 600 15px/1.3 'Segoe UI', system-ui, sans-serif !important; white-space: normal !important; }
#welcome #supportWidget .kofi-button span { color: #183c2b !important; }
#welcome .footer-link:hover, #welcome #support:hover, #welcome #supportWidget .kofi-button:hover { background: #cadbc4 !important; color: #183c2b !important; opacity: 1 !important; }

/* Individual news cards and easy-to-scan publication dates. */
#aboutNews { padding: 0; background: transparent; border: 0; }
#aboutNews article { margin-top: 20px; padding: 22px; border: 1px solid #a8bca2; border-radius: 12px; background: #fffaf0; box-shadow: 0 3px 10px #183c2b0a; }
#aboutNews article h3 { margin-top: 0; font-size: 1.3rem; }
#aboutNews article time { display: inline-block; padding: 7px 12px; border-radius: 6px; background: #dce6d7; color: #183c2b; font-size: 1rem; font-weight: 700; }

/* Larger saved-folder navigation; the name can wrap beside Resume. */
#welcome #recent { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; width: 100%; font-size: 15px; font-weight: 600; }
#welcome #recentName { min-width: 0; line-height: 1.3; text-align: center; overflow-wrap: anywhere; }
#welcome #resume { font: inherit; min-height: 42px; }

/* Let the home support icon use the available label height. */
#welcome #supportWidget .kofitext { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; }
#welcome #supportWidget .kofiimg { flex: 0 0 auto; width: 44px !important; height: auto !important; margin: 0 !important; }

/* Static support links share the navigation buttons' alignment and dimensions. */
.about-support-widget .btn-container { display: block !important; min-width: 0; width: 100%; }
.about-support-widget a.kofi-button { display: flex !important; align-items: center; justify-content: center; width: 100%; min-width: 0; min-height: 42px; padding: 10px 12px !important; border: 1px solid #a8bca2 !important; border-radius: 8px; background: #dce6d7; color: #183c2b !important; box-shadow: none; text-decoration: none; }
.about-support-widget .kofitext { display: flex; align-items: center; justify-content: center; gap: 8px; color: #183c2b !important; font: 600 15px/1.3 'Segoe UI', system-ui, sans-serif !important; white-space: normal !important; }
.about-support-widget .kofitext img.kofiimg { width: 30px !important; height: auto !important; margin: 0 !important; flex: 0 0 auto; }
.about-support-widget a.kofi-button:hover { background: #cadbc4; opacity: 1; }
#welcome #supportWidget .btn-container { display: block !important; min-width: 0; width: 100%; }

/* Share the home navigation rows so the center fills and aligns with both sides. */
#welcome.fit-home .splash-actions { grid-template-rows: auto auto; align-items: stretch; row-gap: 8px; }
#welcome.fit-home .splash-actions > :is(.splash-help, .folder-actions) { display: grid; grid-row: 1 / span 2; grid-template-rows: subgrid; align-items: stretch; }
#welcome.fit-home .splash-actions > .splash-help:first-child { grid-column: 1; }
#welcome.fit-home .splash-actions > .folder-actions { grid-column: 2; }
#welcome.fit-home .splash-actions > .splash-help:last-child { grid-column: 3; }
#welcome.fit-home #recent { height: 100%; margin: 0; padding: 7px 0; align-items: center; justify-content: center; }
#welcome.fit-home #resume { align-self: stretch; display: flex; align-items: center; justify-content: center; gap: 4px; }

#welcome.fit-home #supportWidget, #welcome.fit-home #supportWidget .btn-container, #welcome.fit-home #support { height: 100%; }

/* Date and location share one row below the Story Strip preview. */
#optionsPage .caption-format-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
#optionsPage .caption-format-pair fieldset { min-width: 0; margin-top: 8px; }
#optionsPage .caption-format-pair label { display: block; margin: 0 0 4px; }
#optionsPage .caption-format-pair select { box-sizing: border-box; width: 100%; min-width: 0; margin: 0; }
#optionsPage .caption-format-pair p { margin: 8px 0 0; }
#optionsPage .caption-format-pair fieldset:nth-child(2) > p { margin: 0 0 8px; }

#optionsPage .working-folder-panel { padding: 12px 14px; margin-bottom: 12px; }
#optionsPage #selectedScanFolder { font-size: 19px; font-weight: 600; overflow-wrap: anywhere; }
#optionsPage .working-folder-panel #pickScanFolder { font-size: 17px; min-height: 40px; }
#optionsPage .working-folder-panel .folder-storage-note { font-size: 14px; margin-top: 6px; }
#optionsPage .working-folder-panel #optionsStatus { font-size: 15px; margin-top: 10px; }
#optionsPage .options-right > fieldset:first-child { margin-top: 0; }

#optionsPage .strip-color-row { justify-content: flex-start; gap: 8px; }
#optionsPage .strip-color-row > button { flex: 1 1 0; min-width: 0; align-self: stretch; }

/* Balance the settings columns, with matching lower panel edges. */
#optionsPage .options-right { align-self: stretch; display: flex; flex-direction: column; }
#optionsPage .options-right > fieldset:first-child { flex: 1; display: flex; flex-direction: column; }
#optionsPage .options-right .strip-settings { flex: 1; grid-template-rows: auto 1fr; }
#optionsPage .strip-settings > .strip-sample { width: 260px; max-width: 100%; align-self: center; margin-block: 10px; }
#optionsPage .caption-format-pair { flex: 0 0 auto; }

/* Access renewal needs a separate row outside the two-row navigation subgrid. */
#welcome .splash-actions > #setupStatus { grid-column: 1 / -1; grid-row: 3; margin: 0; min-width: 0; padding: 8px 10px; overflow-wrap: anywhere; text-align: center; font-size: .85rem; }

/* Legal drafts share the About content area. */
#aboutLegal .legal-document{border-top:1px solid #bcc9bc;margin-top:24px;padding-top:12px;overflow-wrap:anywhere}
#aboutLegal .draft{padding:12px;border:1px solid #a87925;background:#fff0c8}
#aboutLegal h3{margin-top:24px}

/* Reviewable feedback diagnostics stay within the dialog. */
.feedback-technical { margin: 1rem 0; }
.feedback-technical summary { cursor: pointer; font-weight: 600; }
.feedback-technical pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: .85em; }

.save-recovery-actions{display:flex;flex-wrap:wrap;gap:10px;justify-content:flex-end}
#recoveryNote{width:100%;box-sizing:border-box;min-height:100px}

/* Equal-width recovery actions; compact screens use a balanced two-column row. */
#failure .save-recovery-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;width:100%}
#failure .save-recovery-actions button{width:100%;min-width:0;margin:0;padding:12px 8px;white-space:normal}
@media(max-width:640px){#failure .save-recovery-actions{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Keep static and dynamic action labels consistently Title Case. */
button,input[type=button],input[type=submit],[role=button]{text-transform:capitalize}

/* Keep the front-photo place and date together beneath the names. */
.photo-stack .front-photo-details{display:block;font-size:.82em;white-space:nowrap}

/* Shared News review label and grouped mobile history. */
.publication-preview{padding:12px 16px;border:1px solid #a87925;border-radius:10px;background:#fff0c8;color:#483608;font-size:16px;line-height:1.5}.earlier-news,.mobile-release{margin:18px 0}.mobile-release summary{cursor:pointer;font-weight:700;line-height:1.5}.mobile-release li{margin:8px 0}

/* A compact public follow link beneath the Home actions. */
.home-social-footer { text-align: center; padding: 0 18px 12px; }
.home-social-footer a { display: inline-flex; align-items: center; min-height: 44px; color: #173e30; font-size: 14px; text-underline-offset: 3px; }
.home-social-footer a:focus-visible { outline: 3px solid #367e63; outline-offset: 4px; border-radius: 3px; }

/* Shared Story Strip logo keeps the existing Home layout. */
.brand-mark[data-story-strip-logo]{display:block;overflow:visible}
.brand-mark[data-story-strip-logo]::before{content:none}
