:root {
  color-scheme: light;
  --canvas: #f5f7f6; --surface: #fff; --ink: #202c26; --muted: #647169;
  --line: #e0e7e2; --soft: #eef3ef; --green: #176447; --green-dark: #104e36;
  --green-soft: #e8f3ec; --red: #a63333; --red-soft: #fff2f0;
  --radius: 16px; --shadow: 0 3px 14px #23382b05;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px; line-height: 1.55; color: var(--ink); background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
a { color: var(--green); text-underline-offset: .22em; }
a:hover { color: var(--green-dark); }
button, input, select, textarea { font: inherit; }
button, input[type="submit"], a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #318d65; outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.85rem, 3.5vw, 2.5rem); letter-spacing: -.045em; line-height: 1.18; font-weight: 650; margin-bottom: .7rem; overflow-wrap: anywhere; }
h2 { font-size: 1.2rem; line-height: 1.35; letter-spacing: -.025em; font-weight: 650; margin-bottom: .75rem; }
h3 { font-size: 1.05rem; font-weight: 650; margin-bottom: .4rem; }
p { margin-bottom: 1rem; }
small, .small { font-size: .82rem; }
.ui-icon { width: 20px; height: 20px; flex: 0 0 auto; vertical-align: middle; }
.muted, .page-description, .hint { color: var(--muted); }
.page-description { max-width: 45rem; margin-bottom: 0; }
.eyebrow { color: var(--green); font-size: .72rem; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; margin-bottom: .7rem; }
.skip-link { position: fixed; left: 1rem; top: -100px; z-index: 100; padding: .8rem 1rem; background: white; }
.skip-link:focus { top: 1rem; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header__inner { max-width: 1280px; min-height: 80px; margin: auto; padding: 0 40px; display: flex; align-items: center; gap: 36px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 750; font-size: 1.2rem; letter-spacing: -.05em; white-space: nowrap; }
.brand-mark { width: 34px; height: 34px; background: var(--green); color: white; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; letter-spacing: -.18em; padding-right: 4px; line-height: 1; font-weight: 650; }
.brand-mark span { transform: translateY(-3px); opacity: .7; }
.main-nav { display: flex; gap: 6px; align-self: stretch; align-items: center; }
.nav-link { text-decoration: none; color: var(--muted); padding: 10px 14px; border-radius: 8px; font-size: .9rem; font-weight: 600; }
.nav-link:hover, .nav-link[aria-current="page"] { background: var(--green-soft); color: var(--green); }
.account-menu { margin-left: auto; display: flex; align-items: center; gap: 20px; min-width: 0; }
.account-name { font-size: .8rem; color: var(--muted); max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-note { margin-left: auto; font-size: .8rem; color: var(--muted); }
.page-shell { width: min(1280px, 100%); padding: 44px 40px 64px; margin: 0 auto; min-height: calc(100svh - 150px); }
.page-shell:focus { outline: none; }
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 32px; }
.page-header__actions { flex-shrink: 0; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); margin-bottom: 24px; }
.breadcrumbs a { text-decoration: none; color: var(--muted); }
.breadcrumbs a:hover { color: var(--green); }
.button, button, input[type="submit"] { display: inline-flex; gap: 9px; justify-content: center; align-items: center; min-height: 44px; padding: 11px 17px; border: 1px solid transparent; border-radius: 9px; background: var(--green); color: #fff; font-size: .87rem; font-weight: 650; line-height: 1.35; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s; }
.button:hover, button:hover, input[type="submit"]:hover { background: var(--green-dark); color: #fff; }
.button-secondary { border-color: var(--line); background: white; color: var(--ink); }
.button-secondary:hover { background: var(--soft); border-color: #c6d5cb; color: var(--ink); }
.button-quiet { background: transparent; color: var(--muted); padding: 10px; }
.button-quiet:hover { background: var(--soft); color: var(--ink); }
.button-danger { background: white; color: var(--red); border-color: #ebcdca; }
.button-danger:hover { background: var(--red-soft); color: var(--red); }
button:disabled, input[type="submit"]:disabled { opacity: .5; cursor: not-allowed; }
.button_to { display: inline-flex; margin: 0; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.text-link { display: inline-flex; align-items: center; gap: 7px; font-size: .86rem; font-weight: 600; text-decoration: none; min-height: 44px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 20px; }
.section-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 30px 0 18px; }
.section-heading h2 { margin: 0; }
.section-heading .muted { font-size: .82rem; }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 6px; background: var(--soft); color: #526058; padding: 5px 9px; font-size: .73rem; font-weight: 650; line-height: 1.4; }
.badge--success { background: var(--green-soft); color: var(--green); }
.badge--attention { background: #fff4df; color: #80510e; }
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 14px 18px; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 24px; font-size: .9rem; overflow-wrap: anywhere; }
.flash--success { color: var(--green-dark); background: var(--green-soft); border-color: #cee4d5; }
.flash--error, .form-errors { background: var(--red-soft); border-color: #f0d5d0; color: var(--red); }
.form-errors { padding: 15px 20px; border-radius: 10px; margin-bottom: 20px; font-size: .9rem; }
.collection-grid, .album-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; padding: 0; list-style: none; }
.collection-card, .album-card { background: white; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; position: relative; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; min-width: 0; }
.collection-card:hover, .album-card:hover { border-color: #a4bfae; box-shadow: 0 8px 24px #173d2510; }
.collection-card__cover { aspect-ratio: 1.6; background: var(--soft); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.collection-card__cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-placeholder { display: flex; align-items: center; flex-direction: column; gap: 12px; font-size: .8rem; color: #72867a; }
.cover-placeholder .ui-icon { width: 38px; height: 38px; stroke-width: 1; }
.collection-card__body, .album-card__body { padding: 21px; }
.collection-card h2, .album-card h2 { font-size: 1.05rem; margin: 12px 0 6px; }
.card-title-link { color: var(--ink); text-decoration: none; }
.card-title-link::after { content: ""; position: absolute; inset: 0; }
.card-meta { display: flex; justify-content: space-between; gap: 12px; align-items: center; color: var(--muted); font-size: .78rem; margin: 0; }
.card-meta .ui-icon { width: 16px; height: 16px; }
.card-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 20px; color: var(--muted); font-size: .75rem; }
.card-footer .ui-icon { color: var(--green); width: 17px; height: 17px; }
.empty-state { padding: 48px 24px; text-align: center; background: white; border: 1px dashed #cbd9ce; border-radius: var(--radius); }
.empty-state__icon { width: 64px; height: 64px; margin: 0 auto 20px; display: grid; place-items: center; color: var(--green); background: var(--green-soft); border-radius: 18px; }
.empty-state__icon .ui-icon { width: 30px; height: 30px; }
.empty-state p { color: var(--muted); max-width: 440px; margin: 0 auto 22px; }
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.tabs a { padding: 12px 2px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .9rem; border-bottom: 2px solid transparent; }
.tabs a[aria-current="page"] { border-color: var(--green); color: var(--green); }
.upload-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 1.1fr); gap: 32px; align-items: center; border-style: dashed; padding: 28px; }
.upload-panel__intro { display: flex; gap: 16px; align-items: flex-start; }
.upload-panel__icon { background: var(--green-soft); color: var(--green); padding: 12px; border-radius: 12px; }
.upload-panel__intro h2 { margin-bottom: 5px; }
.upload-panel__intro p { color: var(--muted); font-size: .85rem; margin: 0; }
.upload-form { display: grid; gap: 10px; }
.upload-form label { font-size: .78rem; color: var(--muted); font-weight: 500; }
.upload-form input[type="file"] { min-width: 0; width: 100%; background: var(--canvas); border: 1px solid var(--line); border-radius: 9px; padding: 8px; font-size: .8rem; }
input[type="file"]::file-selector-button { border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; margin-right: 10px; background: white; font: inherit; color: var(--ink); cursor: pointer; }
.upload-message:not(:empty) { margin: 16px 0; padding: 12px 16px; background: var(--soft); border-radius: 8px; font-size: .85rem; }
.photo-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; padding: 0; list-style: none; margin: 0; }
.photo-gallery > li, .album-photo-choice { background: white; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; min-width: 0; }
.photo-card__preview { aspect-ratio: 4/3; background: #edf1ee; display: grid; place-items: center; overflow: hidden; }
.photo-gallery img { width: 100%; height: 100%; object-fit: contain; display: block; }
.photo-card__placeholder { color: var(--muted); font-size: .8rem; }
.photo-card__body { padding: 14px; overflow-wrap: anywhere; }
.photo-card__name { display: block; font-size: .8rem; font-weight: 600; margin-bottom: 4px; }
.photo-card__status { display: block; font-size: .75rem; color: var(--muted); }
.photo-card[data-state="validated"] .photo-card__status { color: var(--green); }
.photo-card[data-state="rejected"] .photo-card__status, .photo-card[data-state="expired"] .photo-card__status { color: var(--red); }
.photo-card__details { display: block; color: var(--muted); font-size: .72rem; margin-top: 8px; }
.photo-card__download { font-size: .76rem; display: inline-flex; align-items: center; min-height: 44px; }
.photo-card button { min-height: 44px; margin-top: 10px; padding: 8px 12px; }
progress { appearance: none; display: block; width: 100%; height: 4px; border: none; border-radius: 3px; overflow: hidden; background: var(--line); margin: 12px 0 2px; accent-color: var(--green); }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--green); }
progress::-moz-progress-bar { background: var(--green); }
.gallery-empty { padding: 36px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; }
.photo-gallery:not(:empty) + .gallery-empty { display: none; }
.disclosure { margin-top: 28px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.disclosure summary { padding: 16px 20px; cursor: pointer; font-size: .85rem; font-weight: 600; min-height: 44px; }
.disclosure__body { padding: 0 20px 20px; color: var(--muted); font-size: .85rem; }
.disclosure__body p:last-child { margin-bottom: 0; }
.limits-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 24px; margin: 0 0 24px; }
.limits-grid div { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
dt { font-size: .78rem; color: var(--muted); }
dd { margin: 3px 0 0; font-weight: 600; }
.danger-zone { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center; }
.danger-zone h2 { font-size: .95rem; margin-bottom: 4px; }
.danger-zone p { font-size: .8rem; color: var(--muted); margin-bottom: 0; max-width: 620px; }
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="file"]), select, textarea { width: 100%; max-width: 100%; min-height: 48px; border: 1px solid #cbd7ce; background: white; border-radius: 8px; padding: 11px 13px; color: var(--ink); font-size: 1rem; }
input::placeholder { color: #7d8981; }
input[readonly] { background: var(--soft) !important; font-size: .85rem !important; }
label { font-size: .85rem; font-weight: 600; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; flex: 0 0 18px; accent-color: var(--green); vertical-align: middle; }
.form-stack { display: grid; gap: 20px; }
.form-stack label { display: block; margin-bottom: 7px; }
.form-stack .button, .form-stack input[type="submit"] { width: 100%; }
.field_with_errors { display: contents; }
.field_with_errors input { border-color: var(--red) !important; }
.narrow-page { max-width: 620px; margin: 0 auto; }
.form-note { color: var(--muted); font-size: .8rem; margin-top: 16px; }
.page-shell--auth { max-width: 1000px; padding-top: 64px; }
.auth-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.auth-intro h2 { font-size: 2.4rem; line-height: 1.2; letter-spacing: -.05em; margin: 18px 0; }
.auth-intro > p { color: var(--muted); font-size: .95rem; max-width: 320px; }
.auth-illustration { width: 160px; height: 160px; position: relative; margin: 12px 0 32px; }
.auth-illustration span { position: absolute; width: 108px; height: 136px; border: 1px solid #c4d6c9; border-radius: 12px; background: #e7eee9; transform: rotate(-13deg); left: 10px; top: 12px; }
.auth-illustration span:nth-child(2) { transform: rotate(8deg); left: 40px; top: 4px; background: white; }
.auth-illustration span:nth-child(3) { display: grid; place-items: center; transform: rotate(1deg); left: 30px; top: 22px; background: var(--green); color: white; border: 7px solid white; }
.auth-illustration .ui-icon { width: 42px; height: 42px; stroke-width: 1; }
.auth-card { padding: 32px; }
.auth-card h1 { font-size: 1.65rem; margin-bottom: 12px; }
.auth-card > p { font-size: .85rem; color: var(--muted); }
.auth-footer { text-align: center; margin: 20px 0 0; font-size: .85rem; }
.album-settings-form { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 28px; align-items: start; }
.album-settings-panel { position: static; }
.album-settings-panel label { display: block; margin-bottom: 8px; }
.album-settings-panel .field { margin-bottom: 22px; }
.checkbox-setting { border-top: 1px solid var(--line); padding-top: 20px; }
.checkbox-setting label { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.checkbox-setting p { font-size: .8rem; color: var(--muted); margin: 5px 0 0; }
.photo-choices { min-width: 0; border: 0; margin: 0; padding: 0; }
.photo-choices legend { font-size: 1.05rem; font-weight: 650; padding: 0; margin-bottom: 6px; }
.photo-choices > p { color: var(--muted); font-size: .82rem; }
.choice-count { font-size: .78rem; color: var(--green); background: var(--green-soft); border-radius: 7px; padding: 9px 12px; }
.photo-choices .photo-gallery { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.album-photo-choice__preview { height: 150px; display: grid; place-items: center; background: #edf1ee; }
.album-photo-choice__preview img { width: 100%; height: 150px; object-fit: contain; }
.album-photo-choice__body { padding: 12px; }
.album-photo-choice__name { font-size: .75rem; font-weight: 600; margin-bottom: 8px; overflow-wrap: anywhere; }
.photo-choice-toggle { display: flex; gap: 8px; align-items: center; min-height: 44px; font-size: .75rem; font-weight: 500; cursor: pointer; }
.album-photo-choice:has(input[data-album-configuration-target="choice"]:checked) { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.album-photo-choice:has(input[data-album-configuration-target="exclusion"]:checked) .album-photo-choice__preview { opacity: .4; }
.choice-note { display: block; margin-top: 6px; color: var(--muted); font-size: .7rem; }
.form-actions { grid-column: 1/-1; display: flex; justify-content: space-between; gap: 12px; align-items: center; position: static; background: #fffffffa; border: 1px solid var(--line); padding: 16px 20px; border-radius: 12px; }
.form-actions p { margin: 0; font-size: .8rem; color: var(--muted); }
.album-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.album-sidebar { position: static; }
.album-sidebar .button_to, .album-sidebar .button { width: 100%; }
.album-sidebar .button_to + .button_to { margin-top: 10px; }
.album-sidebar .button_to button { width: 100%; }
.album-sidebar p { font-size: .8rem; color: var(--muted); }
.album-sidebar h2 { font-size: 1rem; }
.album-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0; }
.album-summary dd { font-size: 1.2rem; }
.album-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.album-gallery > li { padding: 10px; background: white; }
.album-gallery > li:first-child { grid-column: 1/-1; }
.album-gallery img { max-height: 520px; min-height: 120px; height: auto; width: 100%; object-fit: contain; }
.album-result-header { margin-bottom: 20px; }
.album-result-header h2 { font-size: 1.05rem; }
.public-page { background: #edf1ee; }
.public-page .page-shell { max-width: 1100px; }
.public-album-header { text-align: center; max-width: 700px; margin: 12px auto 36px; }
.public-album-header h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
.public-album-header p { color: var(--muted); font-size: .85rem; }
.site-footer { max-width: 1280px; margin: 0 auto; padding: 20px 40px 28px; display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: .72rem; }
.site-footer span:first-child { font-weight: 700; }
.home-hero { padding: 30px 0 42px; max-width: 720px; }
.home-hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.home-hero > p { max-width: 540px; color: var(--muted); font-size: 1.05rem; margin: 20px 0 28px; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step-number { width: 36px; height: 36px; background: var(--green-soft); border-radius: 10px; color: var(--green); display: grid; place-items: center; font-weight: 650; margin-bottom: 22px; font-size: .85rem; }
.steps-grid p { color: var(--muted); font-size: .85rem; margin-bottom: 0; }
.table-scroll { overflow-x: auto; max-width: 100%; background: white; border: 1px solid var(--line); border-radius: 12px; margin: 22px 0; }
table { border-collapse: collapse; width: 100%; font-size: .8rem; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
th { background: var(--soft); color: var(--muted); font-weight: 650; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
@media (max-width: 1000px) {
  .site-header__inner { gap: 20px; padding: 0 24px; }
  .account-name { display: none; }
  .page-shell { padding: 32px 24px 48px; }
  .collection-grid, .album-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .album-settings-form { grid-template-columns: 240px minmax(0, 1fr); gap: 20px; }
  .album-workspace { grid-template-columns: minmax(0, 1fr) 270px; gap: 20px; }
  .upload-panel { gap: 20px; }
}
@media (max-width: 700px) {
  .site-header__inner { min-height: 68px; padding: 12px 18px; gap: 16px; flex-wrap: wrap; }
  .brand { font-size: 1.1rem; }
  .brand-mark { width: 30px; height: 30px; border-radius: 8px; font-size: 20px; }
  .main-nav { order: 3; width: 100%; gap: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
  .main-nav a { padding: 8px 12px; }
  .account-menu { margin-left: auto; }
  .logout-button { min-width: 44px; padding: 10px; }
  .logout-button span { display: none; }
  .page-shell { padding: 28px 18px 40px; }
  .page-header { align-items: flex-start; flex-direction: column; gap: 18px; margin-bottom: 24px; }
  .page-header__actions, .page-header__actions .button { width: 100%; }
  .collection-grid, .album-card-grid { grid-template-columns: 1fr; gap: 18px; }
  .collection-card__cover { aspect-ratio: 1.8; }
  .panel { padding: 20px; border-radius: 12px; }
  .upload-panel { grid-template-columns: 1fr; padding: 22px 18px; gap: 20px; }
  .photo-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .photo-card__body { padding: 10px; }
  .photo-card__name { font-size: .73rem; }
  .photo-card__status { font-size: .7rem; }
  .photo-card__details { font-size: .68rem; }
  .photo-card__download { font-size: .72rem; }
  .limits-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .danger-zone { align-items: flex-start; }
  .danger-zone .button_to, .danger-zone button { width: 100%; }
  .album-settings-form, .album-workspace { display: flex; flex-direction: column; gap: 22px; }
  .album-settings-panel, .album-sidebar { position: static; width: 100%; }
  .photo-choices, .album-preview { width: 100%; }
  .photo-choices .photo-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .album-photo-choice__preview, .album-photo-choice__preview img { height: 125px; }
  .album-photo-choice__body { padding: 10px; }
  .form-actions { width: 100%; flex-direction: column; align-items: stretch; padding: 12px; }
  .form-actions p { display: none; }
  .form-actions input[type="submit"] { width: 100%; }
  .album-sidebar { order: -1; }
  .album-sidebar .panel { padding: 18px; }
  .album-sidebar .panel + .panel { margin-top: 14px; }
  .album-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .album-summary dt { font-size: .7rem; }
  .album-summary dd { font-size: 1.05rem; }
  .album-gallery img { min-height: 0; }
  .auth-layout { grid-template-columns: 1fr; gap: 24px; }
  .auth-intro { display: none; }
  .page-shell--auth { padding-top: 32px; max-width: 480px; }
  .auth-card { padding: 24px; }
  .site-footer { padding: 20px 18px; flex-wrap: wrap; }
  .steps-grid { grid-template-columns: 1fr; gap: 14px; }
  .home-hero { padding: 12px 0 30px; }
  .tabs { gap: 20px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
@media (max-width: 700px) {
  .album-sidebar { display: contents; }
  .album-sidebar .panel { width: 100%; margin-top: 0; }
  .generation-panel { order: -1; }
  .sharing-panel { order: 1; }
}
.nav-link { display: inline-flex; align-items: center; min-height: 44px; }
.photo-card[data-state="rejected"] progress::-webkit-progress-value { background: var(--red); }
.photo-card[data-state="rejected"] progress::-moz-progress-bar { background: var(--red); }
.retention-note { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; color: var(--muted); font-size: .76rem; margin: 12px 0 0; }
.retention-note .ui-icon { width: 15px; height: 15px; }
.upload-disclosure { border: 1px dashed #cbd9ce; border-radius: var(--radius); background: white; }
.upload-disclosure > summary { list-style: none; display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 16px 22px; cursor: pointer; color: var(--green); }
.upload-disclosure > summary::-webkit-details-marker { display: none; }
.upload-disclosure > summary strong { display: block; font-size: .95rem; }
.upload-disclosure > summary small { display: block; color: var(--muted); font-size: .75rem; margin-top: 2px; }
.upload-disclosure > summary > .ui-icon:last-child { margin-left: auto; transform: rotate(90deg); }
.upload-disclosure[open] > summary > .ui-icon:last-child { transform: rotate(-90deg); }
.upload-disclosure .upload-panel { border: 0; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); box-shadow: none; }
@media (max-width: 700px) {
  .photo-card__name { font-size: .8rem; }
  .photo-card__status { font-size: .75rem; }
  .photo-card__details { font-size: .72rem; }
}
.generation-options { margin: 12px 0 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.generation-options summary { min-height: 44px; padding: 12px 0; cursor: pointer; color: var(--muted); font-size: .8rem; }
.generation-options .album-summary dd { overflow-wrap: anywhere; }
.generation-options .album-summary dd.small { font-size: .82rem; }
.mobile-only { display: none; }
#album-actions { scroll-margin-top: 20px; }
@media (max-width: 700px) {
  .mobile-only { display: inline-flex; }
  .album-page-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .album-page-actions > a { font-size: .8rem; padding-left: 10px; padding-right: 10px; }
  .album-workspace--ready .album-preview { order: -2; }
}
.admin-nav { overflow-x: auto; }
.admin-nav a { flex-shrink: 0; }

/* Both album presentations use the same protected images and their existing order. */
.album-viewer__toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.view-switch { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: white; gap: 2px; }
.view-switch button { min-height: 44px; padding: 9px 16px; border-radius: 8px; color: var(--muted); }
.view-switch button[aria-pressed="true"] { background: var(--green-soft); color: var(--green-dark); }
.album-viewer__stage { border-radius: 12px; }
.album-viewer__navigation { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; }
.album-viewer__navigation [role="status"] { color: var(--muted); font-size: .8rem; text-align: center; }
.album-viewer[data-view="slider"] .album-gallery { display: block; margin: 0; }
.album-viewer[data-view="slider"] .album-gallery li { padding: 8px; }
.album-viewer[data-view="slider"] .album-gallery img { display: block; width: 100%; height: clamp(240px, 55vh, 610px); max-height: none; object-fit: contain; }
.album-viewer[data-view="slider"] .album-viewer__stage { touch-action: pan-y; }
@media (max-width: 700px) {
  .album-viewer__toolbar { align-items: stretch; }
  .album-viewer__toolbar > .button { font-size: .8rem; }
  .album-viewer__navigation .button { padding: 10px 12px; }
}
@media (max-width: 700px) {
  .album-viewer[data-view="slider"] .album-gallery img { height: clamp(240px, 42vh, 380px); }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Slideshow controls remain in the DOM for keyboard access while fading visually. */
.album-player { position: relative; }
.slider-arrow, .slider-close { display: none; }
.album-viewer[data-view="slider"] .slider-arrow, .album-player--expanded .slider-close { display: grid; place-items: center; position: absolute; z-index: 2; width: 48px; height: 48px; min-height: 48px; padding: 0; border: 1px solid #ffffff50; border-radius: 50%; background: #15241dcc; color: white; box-shadow: 0 2px 12px #0002; }
.album-viewer[data-view="slider"] .slider-arrow { top: calc((100% - 68px) / 2); transform: translateY(-50%); font-size: 2rem; line-height: 1; }
.slider-arrow--previous { left: 18px; }
.slider-arrow--next { right: 18px; }
.slider-arrow:disabled { opacity: .3; }
.slider-arrow:hover:not(:disabled), .slider-close:hover { background: #153e2e; }
.slider-close { top: max(18px, env(safe-area-inset-top)); right: max(18px, env(safe-area-inset-right)); font-size: 1.8rem; }
.slider-bottom-actions { display: flex; align-items: center; gap: 10px; }
.slider-autoplay[aria-pressed="true"] { color: white; background: var(--green); border-color: var(--green); }
.album-viewer[data-view="slider"] .album-gallery img { cursor: zoom-in; }
.slider-chrome { transition: opacity .2s ease; }
.album-player[data-idle="true"] { cursor: none; }
.album-player[data-idle="true"] .slider-chrome { opacity: 0; pointer-events: none; }
.album-player[data-idle="true"] .album-gallery img { cursor: none; }
.album-player .slider-chrome:has(:focus-visible), .album-player .slider-chrome:focus-visible { opacity: 1; pointer-events: auto; }
.album-viewer__dialog { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #101713; color: white; overflow: hidden; }
.album-viewer__dialog::backdrop { background: #101713; }
.album-player--expanded, .album-player:fullscreen { width: 100%; height: 100dvh; background: #101713; color: white; }
.album-player--expanded .album-viewer__stage, .album-player--expanded .album-gallery, .album-player--expanded .album-gallery li { width: 100%; height: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
.album-viewer[data-view="slider"] .album-player--expanded .album-gallery img { width: 100%; height: 100dvh; max-height: none; object-fit: contain; cursor: default; }
.album-player--expanded .slider-arrow { top: 50%; }
.album-player--expanded .album-viewer__navigation { position: absolute; z-index: 2; bottom: 0; left: 0; right: 0; margin: 0; padding: 24px max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, #000b); }
.album-player--expanded .album-viewer__navigation [role="status"] { color: white; }
.album-player--expanded .button { border-color: #ffffff50; color: white; background: #15241dcc; }
.album-player--expanded .slider-autoplay[aria-pressed="true"] { background: var(--green); }
.album-player--expanded .slider-expand { display: none; }
@media (max-width: 700px) {
  .album-viewer__navigation { align-items: center; gap: 8px; }
  .slider-bottom-actions { gap: 8px; }
  .slider-bottom-actions .button { font-size: .72rem; padding: 10px; }
  .slider-expand span:not([aria-hidden]) { display: none; }
  .album-viewer[data-view="slider"] .slider-arrow { width: 44px; height: 44px; min-height: 44px; }
  .slider-arrow--previous { left: 12px; }
  .slider-arrow--next { right: 12px; }
}

.slider-expand { min-width: 44px; }
html:has(.album-viewer__dialog[open]) { overflow: hidden; }
.album-viewer__dialog { overscroll-behavior: contain; }
.album-viewer[data-view="slider"] .album-player--expanded .album-gallery li { padding: 0; }

.ai-settings-panel { margin-bottom: 24px; }
.ai-settings-panel h2 { margin-top: 0; }
.ai-settings-panel .checkbox-setting { border-top: 0; padding-top: 0; }
.ai-settings-panel details { margin: 16px 0; }
.ai-budget-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ai-budget-summary dd { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

.ai-photo-description { margin-top: 14px; font-size: .85rem; overflow-wrap: anywhere; }
.ai-photo-description summary { cursor: pointer; color: var(--green); font-weight: 600; }
.ai-photo-tags { color: var(--muted); font-size: .8rem; }
.album-gallery > .album-chapter-heading { grid-column: 1 / -1; background: transparent; padding: 16px 0 0; border: 0; }
.album-chapter-heading h3 { margin: 0; font-size: 1.15rem; }
.album-gallery > .album-gallery__hero { grid-column: 1 / -1; }
.album-viewer[data-view="slider"] .album-chapter-heading,
.album-viewer[data-view="slider"] .ai-photo-description { display: none; }

.correction-toolbar { margin-bottom: 24px; }
.correction-dialog { border: 1px solid var(--line); border-radius: 18px; padding: 28px; max-width: min(520px, calc(100vw - 32px)); color: var(--ink); }
.correction-dialog::backdrop { background: rgb(16 35 25 / 55%); }
.correction-dialog h2 { margin-top: 0; }
.correction-gallery > [hidden] { display: none; }

/* Inline album corrections share the gallery/slider instead of a separate editor. */
.correction-toolbar { position: static; border-color: var(--green); box-shadow: 0 6px 20px #10231915; }
.correction-toolbar p { margin-top: 0; }
.album-gallery > li[data-image-id] { position: relative; }
.photo-edit-menu { position: absolute; z-index: 3; top: 18px; left: 18px; }
.photo-edit-menu summary { display: grid; place-items: center; cursor: pointer; list-style: none; width: 44px; height: 44px; border-radius: 50%; background: #15241de8; color: white; font-size: 1.5rem; }
.photo-edit-menu summary::-webkit-details-marker { display: none; }
.photo-edit-menu > div { display: grid; gap: 8px; margin-top: 6px; padding: 10px; background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 6px 20px #0002; }
.photo-edit-menu .button { white-space: normal; text-align: left; }
.photo-edit-menu[open] { opacity: 1 !important; pointer-events: auto !important; }
.correction-mandatory { position: absolute; right: 14px; top: 14px; max-width: calc(100% - 90px); }
.replacement-dialog > img { display: block; width: 100%; height: min(40vh, 320px); object-fit: contain; background: #f2f5f2; border-radius: 10px; margin: 12px 0 20px; }
.correction-dialog { width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; background: white; }
.album-player--expanded .correction-dialog .button { background: var(--green); color: white; }
.album-player--expanded .photo-edit-menu { top: max(18px, env(safe-area-inset-top)); }
.album-gallery > [hidden], .correction-toolbar[hidden], .replacement-dialog > img[hidden] { display: none; }
.album-player--expanded .correction-mandatory { right: 78px; top: max(18px, env(safe-area-inset-top)); }
.album-player--expanded .correction-dialog .button-secondary { background: white; color: var(--ink); border-color: var(--line); }

.correction-toolbar__label { font-weight: 650; margin-bottom: 6px; }
.correction-toolbar__note { font-size: .85rem; }
[data-controller~="album-corrections"][data-submitting="true"] .photo-edit-menu { pointer-events: none; opacity: .45; }
.album-player--expanded .correction-toolbar { position: absolute; top: auto; bottom: max(88px, calc(env(safe-area-inset-bottom) + 72px)); left: max(16px, env(safe-area-inset-left)); right: max(16px, env(safe-area-inset-right)); margin: 0 auto; width: auto; max-width: 680px; max-height: calc(100dvh - 180px); overflow-y: auto; padding: 16px; background: white; color: var(--ink); }
.album-player--expanded .correction-toolbar .button { background: var(--green); color: white; border-color: var(--green); }
.album-player--expanded .correction-toolbar .button-secondary { background: white; color: var(--ink); border-color: var(--line); }
.album-player--expanded .correction-toolbar__note { margin-bottom: 12px; }
.album-player--expanded:has(.correction-toolbar:not([hidden])) .slider-chrome { opacity: 1; pointer-events: auto; }
@media (max-width: 700px) {
  .album-player--expanded .correction-toolbar { padding: 12px; }
  .album-player--expanded .correction-toolbar .actions { gap: 6px; }
  .album-player--expanded .correction-toolbar .button { padding: 10px; font-size: .75rem; }
}

.generation-progress { margin: 16px 0; }
.generation-progress label { display: block; font-size: .85rem; margin-bottom: 8px; }
.generation-progress progress { display: block; width: 100%; height: 10px; accent-color: var(--green); }
.generation-progress[hidden] { display: none; }

.replacement-dialog { width: min(960px, calc(100vw - 32px)); max-width: min(960px, calc(100vw - 32px)); }
.replacement-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 16px 0; }
.replacement-comparison figure { min-width: 0; margin: 0; }
.replacement-comparison figcaption { margin-bottom: 8px; font-size: .85rem; font-weight: 600; }
.replacement-comparison img { display: block; width: 100%; height: min(40vh, 340px); object-fit: contain; background: #f2f5f2; border-radius: 10px; }
.replacement-reason { font-size: .85rem; line-height: 1.6; }
.replacement-reason strong { display: block; margin-bottom: 4px; }
.replacement-comparison[hidden], .replacement-reason[hidden] { display: none; }
@media (max-width: 700px) {
  .replacement-comparison { grid-template-columns: 1fr; gap: 12px; }
  .replacement-comparison img { height: min(22vh, 190px); }
  .replacement-dialog { padding: 20px; }
  .replacement-dialog .actions { gap: 8px; }
  .replacement-dialog .button { padding: 10px 12px; font-size: .8rem; }
}

.pdf-settings-workspace { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 28px; align-items: start; }
.pdf-settings-workspace .field { margin-bottom: 20px; }
.pdf-settings-workspace select { width: 100%; min-height: 44px; }
.pdf-cover-picker { margin: 20px 0; }
.pdf-cover-picker summary { cursor: pointer; font-weight: 600; }
.pdf-cover-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.pdf-cover-choice { padding: 8px; border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 6px; font-size: .8rem; }
.pdf-cover-choice:has(input:checked) { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.pdf-cover-choice img { display: block; width: 100%; height: 90px; object-fit: contain; }
.pdf-preview-pages { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.pdf-preview-page { position: relative; aspect-ratio: 595.28 / 841.89; border: 1px solid var(--line); box-shadow: 0 4px 16px #10231910; overflow: hidden; }
.pdf-preview-brand { position: absolute; left: 6.05%; top: 4.28%; font-size: clamp(5px, .7vw, 8px); letter-spacing: .05em; }
.pdf-preview-title { position: absolute; left: 6.05%; right: 6.05%; top: 7%; height: 4.5%; font-size: clamp(7px, 1vw, 12px); line-height: 1.25; overflow: hidden; }
.pdf-preview-title--cover { top: 11.7%; height: 10%; text-align: center; font-size: clamp(12px, 1.6vw, 20px); }
.pdf-preview-image { position: absolute; }
.pdf-preview-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.pdf-preview-footer { position: absolute; left: 6.05%; right: 6.05%; bottom: 4.1%; display: flex; justify-content: space-between; font-size: clamp(5px, .7vw, 8px); }
@media (max-width: 850px) {
  .pdf-settings-workspace { grid-template-columns: 1fr; }
  .pdf-preview-pages { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .pdf-preview-brand, .pdf-preview-footer { font-size: 7px; }
  .pdf-preview-title { font-size: 11px; }
  .pdf-preview-title--cover { font-size: 18px; }
}

#pdf-preview, #pdf-appearance { scroll-margin-top: 20px; }

/* The cover uses the same private album copies as the gallery and public viewer. */
.album-cover { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: white; margin: 12px 0 28px; }
.album-cover__image { min-width: 0; background: #e9efea; display: flex; align-items: center; justify-content: center; padding: 20px; }
.album-cover__image img { display: block; width: 100%; height: clamp(220px, 38vh, 420px); object-fit: contain; }
.album-cover__intro { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: clamp(24px, 4vw, 48px); min-width: 0; }
.album-cover__intro h1, .album-cover__intro h2 { font-size: clamp(1.6rem, 3vw, 2.6rem); line-height: 1.15; margin: 0; overflow-wrap: anywhere; }
.album-cover__intro .button { margin: 12px 0; }
.album-cover__intro .text-link { padding: 10px 0; }
.album-cover-settings .pdf-cover-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 440px; overflow-y: auto; padding: 4px; }
.album-cover-settings summary { cursor: pointer; padding: 12px 0; }
.album-cover-settings input[type="submit"] { margin-top: 12px; }
.album-cover[hidden], .album-player[hidden], .album-cover button[hidden] { display: none; }
.public-album-unavailable { max-width: 640px; margin: 40px auto; }
@media (max-width: 700px) {
  .album-cover { grid-template-columns: minmax(0, 1fr); }
  .album-cover__image { padding: 16px; }
  .album-cover__image img { height: clamp(180px, 32vh, 300px); }
  .album-cover__intro { padding: 24px; }
  .album-cover__intro .button { width: 100%; }
}

.album-card .collection-card__cover img { object-fit: contain; background: #e9efea; }

.pdf-preview-chapter { position: absolute; left: 6.05%; right: 6.05%; font-size: clamp(7px, 1.2cqw, 14px); line-height: 1.3; overflow-wrap: anywhere; max-height: 3.5%; overflow: hidden; }
/* Chapter buckets: desktop drag-and-drop, explicit controls on every device. */
.chapter-workspace { margin-top: 24px; }
.chapter-workspace[data-enhanced=true] .chapter-position-field { display: none; }
.chapter-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px 0; }
.chapter-toolbar > p { max-width: 640px; margin: 0; }
.chapter-toolbar .actions { flex-shrink: 0; }
.chapter-bulk { background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin: 12px 0; }
.chapter-bulk > strong { font-size: .85rem; min-width: 130px; }
.chapter-bulk label { display: flex; align-items: center; gap: 10px; font-size: .85rem; margin: 0; }
.chapter-bulk select { min-height: 44px; max-width: 240px; }
.chapter-status { min-height: 24px; font-size: .85rem; color: var(--muted); }
.chapter-board { display: grid; gap: 24px; }
.chapter-bucket { min-width: 0; border: 1px solid var(--line); border-radius: 18px; background: white; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.chapter-bucket-header { padding: 20px 24px; display: flex; gap: 16px; align-items: center; background: #f5f8f5; border-bottom: 1px solid var(--line); }
.chapter-bucket-header h2 { margin: 0; }
.chapter-name-field { flex: 1; min-width: 0; }
.chapter-name-field label { font-size: .75rem; color: var(--muted); }
.chapter-name-field input { display: block; width: 100%; margin-top: 5px; padding: 8px 10px; font-size: 1.15rem; font-weight: 650; color: var(--ink); border-color: transparent; background: transparent; }
.chapter-name-field input:hover, .chapter-name-field input:focus { background: white; border-color: var(--line); }
.chapter-count { display: inline-block; font-size: .75rem; font-weight: 500; color: var(--muted); margin-top: 5px; }
.chapter-position-field { width: 78px; flex-shrink: 0; font-size: .75rem; color: var(--muted); }
.chapter-position-field input { display: block; width: 100%; min-height: 44px; margin-top: 5px; }
.chapter-row-actions { flex-shrink: 0; gap: 6px; }
.chapter-drag-handle { cursor: grab; font-size: 1.8rem; color: var(--muted); padding: 10px 2px; user-select: none; }
.chapter-bucket-tools { padding: 10px 24px 0; }
.chapter-bucket-tools button, .chapter-bulk .text-link { min-height: 44px; border: 0; background: transparent; cursor: pointer; color: var(--green); font-size: .8rem; }
.chapter-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; padding: 20px 24px; }
.chapter-photo { min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: white; overflow: hidden; }
.chapter-photo[draggable=true] { cursor: grab; }
.chapter-photo.is-selected { border-color: var(--green); box-shadow: 0 0 0 2px var(--green); }
.chapter-photo-image { position: relative; background: var(--soft); }
.chapter-photo-image img { display: block; width: 100%; height: 150px; object-fit: contain; user-select: none; }
.chapter-photo-check { position: absolute; top: 8px; left: 8px; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 8px; background: #ffffffed; cursor: pointer; }
.chapter-photo-check input { width: 22px; height: 22px; margin: 0; accent-color: var(--green); }
.chapter-photo-check span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.chapter-photo-caption { padding: 10px; font-size: .75rem; cursor: auto; }
.chapter-photo-caption strong { display: block; margin-bottom: 6px; }
.chapter-photo-caption summary { cursor: pointer; color: var(--green); min-height: 30px; padding-top: 4px; }
.chapter-photo-caption label { display: block; margin: 6px 0; }
.chapter-photo-caption select { width: 100%; min-width: 0; min-height: 44px; }
.chapter-empty { padding: 24px; margin: 0; color: var(--muted); text-align: center; font-size: .85rem; }
.chapter-bucket:has(.chapter-photo-grid:empty) .chapter-photo-grid { padding: 0; }
.chapter-unassigned { margin: 20px 0 24px; border-style: dashed; }
.chapter-unassigned .chapter-bucket-header { background: #fff9ea; }
.chapter-unassigned .form-note { margin-bottom: 0; }
.chapter-bucket.is-drop-target { border-color: var(--green); box-shadow: 0 0 0 3px #23634530; }
.chapter-bucket.is-drop-target .chapter-photo-grid { background: #edf6ef; min-height: 80px; }
.chapter-bucket.is-drop-before { box-shadow: 0 -4px 0 var(--green); }
.chapter-bucket.is-drop-after { box-shadow: 0 4px 0 var(--green); }
.chapter-bucket.is-drag-source { opacity: .45; }
.chapter-save { margin-top: 24px; }
.chapter-remove-dialog select { width: 100%; min-height: 44px; margin: 10px 0 24px; }
.chapter-workspace [hidden] { display: none !important; }
@media (max-width: 850px) {
  .chapter-toolbar { flex-wrap: wrap; gap: 12px; }
  .chapter-bucket-header { flex-wrap: wrap; gap: 12px; padding: 16px; }
  .chapter-name-field { flex-basis: calc(100% - 100px); }
  .chapter-row-actions { width: 100%; justify-content: flex-end; }
  .chapter-photo-grid { grid-template-columns: repeat(auto-fill, minmax(125px, 1fr)); padding: 16px; gap: 12px; }
  .chapter-photo-image img { height: 130px; }
  .chapter-bucket-tools { padding: 8px 16px 0; }
  .chapter-bulk { padding: 14px; }
  .chapter-bulk label { width: 100%; flex-wrap: nowrap; }
  .chapter-bulk select { width: 0; flex: 1; min-width: 0; max-width: none; }
}
@media (pointer: coarse) { .chapter-drag-handle { display: none; } .chapter-photo[draggable=true] { cursor: auto; } }

/* Standalone settings labels must occupy separate rows. */
label.checkbox-setting { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; margin: 0 0 12px; }
label.checkbox-setting input[type="checkbox"], label.checkbox-setting input[type="radio"] { flex: 0 0 auto; width: 20px; height: 20px; margin: 2px 0 0; }
label.checkbox-setting span { min-width: 0; }
/* Scale typography with the paper, keeping chapter headings inside their page geometry. */
.pdf-preview-page { container-type: inline-size; }
.pdf-preview-brand { font-size: 1.52cqw; line-height: 1.1; letter-spacing: .25cqw; }
.pdf-preview-title { font-size: 3.03cqw; }
.pdf-preview-title--cover { display: flex; align-items: center; justify-content: center; font-size: 5.04cqw; }
.pdf-preview-chapter { font-size: 2.35cqw; line-height: 1.2; }
.pdf-preview-footer { font-size: 1.35cqw; }

/* Quick chapter navigation remains in document flow on desktop and phone. */
.chapter-navigation { margin: 16px 0 24px; padding: 18px; background: white; border: 1px solid var(--line); border-radius: 14px; }
.chapter-navigation h2 { margin: 0 0 12px; font-size: .85rem; }
.chapter-navigation-items { display: flex; flex-wrap: wrap; gap: 8px; }
.chapter-navigation-items button { min-width: 0; max-width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; min-height: 44px; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); font: inherit; font-size: .8rem; cursor: pointer; text-align: left; }
.chapter-navigation-items button > span:first-child { overflow-wrap: anywhere; }
.chapter-navigation-items button:hover { border-color: var(--green); background: #edf6ef; }
.chapter-navigation-count { color: var(--muted); font-size: .75rem; white-space: nowrap; }
.chapter-draft-state { margin: 0 0 12px; color: var(--muted); font-size: .8rem; }
.chapter-workspace[data-dirty=true] .chapter-draft-state { color: #855611; font-weight: 650; }
.chapter-bucket { scroll-margin-top: 20px; }
.chapter-bucket:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
.chapter-workspace[aria-busy=true] { opacity: .75; }

/* Private activity center: a document-level controller, with a focused drawer. */
.activity-bell { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: white; flex-shrink: 0; }
.activity-bell:hover { background: var(--soft); border-color: var(--green); }
.activity-badge { position: absolute; top: -5px; right: -7px; min-width: 20px; height: 20px; padding: 1px 5px; background: var(--green); color: white; border-radius: 20px; font-size: .65rem; text-align: center; }
.activity-running-dot { position: absolute; left: 4px; bottom: 4px; width: 8px; height: 8px; border-radius: 50%; background: #5d8f71; box-shadow: 0 0 0 2px white; }
.activity-panel { margin: 0 0 0 auto; padding: 28px; width: min(540px, 100vw); height: 100dvh; max-height: 100dvh; max-width: 100vw; border: 0; border-left: 1px solid var(--line); background: #f7f9f7; color: var(--ink); overflow-y: auto; }
.activity-panel::backdrop { background: #152c2240; }
.activity-panel-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.activity-panel-header h2 { margin: 0; font-size: 1.6rem; }
.activity-panel-header .eyebrow { margin: 0 0 4px; }
.activity-panel-header button { min-width: 44px; font-size: 1.4rem; }
.activity-panel-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 12px 0 24px; font-size: .8rem; }
.activity-panel-actions button { background: transparent; border: 0; color: var(--green); cursor: pointer; padding: 8px 0; min-height: 44px; text-align: left; font: inherit; }
.activity-panel-actions button:disabled { opacity: .5; cursor: default; }
.activity-connection, .activity-limit-note { color: var(--muted); font-size: .75rem; line-height: 1.6; }
.activity-group { margin: 24px 0; }
.activity-group > h2 { font-size: .9rem; margin: 0 0 12px; }
.activity-items { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.activity-item { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: white; overflow-wrap: anywhere; }
.activity-item--unread { border-left: 4px solid var(--green); }
.activity-item h3 { font-size: 1.05rem; margin: 10px 0 4px; }
.activity-item-type { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; font-size: .75rem; font-weight: 650; margin: 0; }
.activity-state { color: var(--green); font-weight: 500; }
.activity-state--failed, .activity-state--partial, .activity-state--paused, .activity-state--stale { color: #86551b; }
.activity-collection, .activity-progress-label, .activity-time { color: var(--muted); font-size: .75rem; margin: 4px 0 12px; }
.activity-time { display: block; margin-top: 12px; }
.activity-item progress { display: block; width: 100%; height: 8px; accent-color: var(--green); }
.activity-item .form-note { font-size: .75rem; margin-bottom: 0; }
.activity-item .actions { margin: 8px 0 0; gap: 12px; font-size: .8rem; }
.activity-read-button { border: 0; border-radius: 6px; padding: 10px 0; min-height: 44px; color: var(--muted); background: transparent; cursor: pointer; font: inherit; font-size: .75rem; }
.activity-read-button:hover { color: var(--green); text-decoration: underline; }
.activity-full-view { max-width: 860px; }
.activity-toast { position: fixed; right: 24px; bottom: 24px; z-index: 12; width: min(360px, calc(100vw - 32px)); padding: 20px 44px 20px 20px; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 12px; background: white; box-shadow: 0 8px 32px #152c2220; font-size: .85rem; overflow-wrap: anywhere; max-height: min(280px, 50dvh); overflow-y: auto; }
.activity-toast p { margin: 8px 0; }
.activity-toast-close { position: absolute; right: 6px; top: 6px; border: 0; background: transparent; min-width: 36px; min-height: 36px; cursor: pointer; font-size: 1.2rem; }
.activity-badge[hidden], .activity-running-dot[hidden], .activity-toast[hidden] { display: none; }
@media (max-width: 700px) {
  .activity-panel { width: 100vw; padding: 22px 16px; }
  .activity-item { padding: 16px; }
  .activity-toast { right: 16px; bottom: 16px; }
  .account-menu:has(.activity-bell) { gap: 8px; }
}

/* A proposal compares saved and proposed chapters with equal visual weight. */
.chapter-proposal-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 24px 0; }
.chapter-proposal-comparison > section { min-width: 0; }
.chapter-proposal-comparison .chapter-bucket { margin-bottom: 16px; }
.chapter-proposal-comparison .chapter-bucket-header > div { min-width: 0; }
.chapter-proposal-comparison h3 { overflow-wrap: anywhere; }
@media (max-width: 850px) { .chapter-proposal-comparison { grid-template-columns: 1fr; } }

.upload-overview { padding: 16px; margin: 0 0 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); overflow-wrap: anywhere; }
.upload-overview p { margin: 0 0 10px; }
.upload-overview progress { height: 8px; margin-bottom: 12px; }
.upload-overview .form-note { margin: 12px 0 0; }
.upload-overview button { max-width: 100%; white-space: normal; }

.upload-overview p:empty { display: none; }
.upload-help { margin-top: 12px; font-size: .8rem; color: var(--muted); }
.upload-help summary { cursor: pointer; }

.feedback-details { margin-top: 14px; }
.feedback-details summary { cursor: pointer; min-height: 44px; padding: 8px 0; color: var(--green); }
.feedback-details fieldset { border: 0; padding: 0; margin: 8px 0 16px; }
.feedback-choice { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; }
.result-feedback input[type="submit"] { max-width: 100%; white-space: normal; }

.collection-journey { margin-bottom: 24px; }
.journey-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding: 0; list-style: none; }
.journey-steps li { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.journey-steps span { color: var(--muted); font-size: .85rem; }
.collection-journey button { max-width: 100%; white-space: normal; }
.expiry-notice { padding: 16px 20px; margin: 0 0 24px; border: 1px solid #c7d9cd; background: var(--green-soft); border-radius: 12px; }
.expiry-notice p { margin: 8px 0; font-size: .85rem; }
.expiry-notice--urgent { border-color: #e7b5aa; background: var(--red-soft); }
@media (max-width: 600px) { .journey-steps { grid-template-columns: 1fr; gap: 18px; } }

.limit-action { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; max-width: 24rem; }
.limit-action .form-note { margin: 0; }

.limit-action button.text-link { background: transparent; border: 0; padding: 0; min-height: 24px; color: var(--muted); }

.text-link[aria-disabled="true"] { color: var(--muted); cursor: not-allowed; text-decoration: none; }

.selection-explanation { margin: 16px 0 24px; padding: 12px 20px; }
.selection-explanation > summary { min-height: 44px; padding: 11px 0; cursor: pointer; color: var(--green); font-weight: 650; }
.selection-explanation .album-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.selection-explanation dt { overflow-wrap: anywhere; }

.variant-counts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.variant-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 24px 0; }
.variant-photos { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.variant-photo { min-width: 0; border: 2px solid var(--line); border-radius: 10px; padding: 6px; background: var(--surface); }
.variant-photo figure { margin: 0; }
.variant-photo img { display: block; width: 100%; height: 150px; object-fit: contain; }
.variant-photo figcaption { font-size: .78rem; padding: 8px 2px 2px; overflow-wrap: anywhere; }
.variant-photo--added { border-color: var(--green); }
.variant-photo--removed { border-style: dashed; }
#variant-decision, #variant-current, #variant-proposed { scroll-margin-top: 20px; }
#variant-decision { margin-bottom: 16px; }
@media (max-width: 700px) { .variant-comparison { grid-template-columns: minmax(0, 1fr); } .variant-counts dt { overflow-wrap: anywhere; } }
