:root {
  color-scheme: light;
  font: 16px/1.48 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Malgun Gothic", sans-serif;
  --background: #f5f5f7;
  --surface: #fff;
  --fill: #f2f2f5;
  --line: #e2e2e7;
  --ink: #1d1d1f;
  --muted: #626269;
  --blue: #0066cc;
  --blue-fill: #e9f2fe;
  --radius: 18px;
  background: var(--background);
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.app-header { background: rgb(255 255 255 / .86); border-bottom: 1px solid var(--line); }
.app-bar { display: flex; align-items: center; gap: 11px; width: min(1240px, calc(100% - 48px)); min-height: 66px; margin: auto; }
.brand { display: grid; line-height: 1.23; }
.brand strong { letter-spacing: -.025em; }
.brand small { color: var(--muted); font-size: .74rem; margin-top: 2px; }
.header-actions { margin-inline-start: auto; }
.mark {
  display: grid; place-items: center; flex: 0 0 36px; height: 36px; border-radius: 10px;
  background: var(--blue); color: white; font-weight: 750; font-size: .95rem;
}
main { width: min(1240px, calc(100% - 48px)); margin: 30px auto 60px; }
#workspace { display: grid; grid-template-columns: 212px minmax(0, 1fr); gap: clamp(20px, 3.4vw, 42px); align-items: start; }
.app-sidebar { position: sticky; top: 18px; align-self: start; padding: 8px 0; }
#account { margin: 0 0 10px; padding-inline: 13px; font-size: .83rem; overflow-wrap: anywhere; }
.app-sidebar nav { gap: 3px; }
.app-sidebar nav button { justify-content: flex-start; background: transparent; border-color: transparent; min-height: 45px; }
.app-sidebar nav button[aria-current="true"] { color: var(--blue); background: var(--blue-fill); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px, 2vw, 25px); }
.narrow { width: min(410px, 100%); margin: clamp(28px, 10vh, 100px) auto; padding: clamp(20px, 5vw, 36px); }
.narrow form { gap: 15px; margin-top: 21px; }
.narrow .actions > button { flex: 1 1 auto; }
.dashboard { min-width: 0; }
.dashboard-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; margin-top: 12px; }
.dashboard-tools input { margin-top: 0; }
.dashboard-tools:has(details[open]) { grid-template-columns: minmax(0, 1fr); }
#new-project { margin: 0; }
#new-project summary {
  display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px;
  width: fit-content; padding: 7px 14px; border-radius: 12px; background: var(--blue); color: white; list-style: none;
}
#new-project summary::-webkit-details-marker { display: none; }
#new-project summary::before { content: "+"; font-size: 1.15rem; font-weight: 400; line-height: 1; }
#new-project[open] summary::before { content: "−"; }
#new-project form { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
#editor, .lower { display: grid; gap: 15px; }
.lower { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.project-head, .section-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.project-head p { margin: 0; }
h1, h2, h3 { line-height: 1.25; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.82rem, 4vw, 2.62rem); margin: 0 0 7px; letter-spacing: -.045em; font-weight: 740; }
h2 { font-size: 1.15rem; margin: 0 0 10px; letter-spacing: -.025em; }
h3 { font-size: .92rem; margin: 15px 0 7px; }
p { overflow-wrap: anywhere; }
.muted, .photo-card small { color: var(--muted); }
.project-list { display: grid; gap: 5px; }
.project-list p { margin: 0; font-size: .88rem; }
.project-list button { text-align: left; }
.management-lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 17px; }
.management-lists > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.management-lists h3 { margin: 0 0 9px; }
.project-list .management-card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; justify-content: stretch;
  gap: 3px 8px; padding: 11px 12px; font-weight: 670; background: var(--surface);
}
.management-card::after { content: "›"; grid-column: 2; grid-row: 1 / span 3; align-self: center; color: var(--muted); font-size: 1.24rem; font-weight: 400; }
.management-card small { grid-column: 1; font-weight: 400; color: var(--muted); }
.project-list .asset-identity-card { --scope: #0066cc; --scope-fill: #e9f2fe; padding: 12px; gap: 6px 9px; }
.asset-identity-card[data-project-scope="shared"] { --scope: #6743a7; --scope-fill: #f2ecfb; }
.asset-identity-card::after { grid-row: 1 / span 5; }
.project-identity { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.project-scope, .project-state { width: fit-content; border-radius: 6px; padding: 2px 6px; font-size: .73rem; font-weight: 700; }
.project-scope { color: var(--scope); background: var(--scope-fill); }
.project-code { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.project-card-title { grid-column: 1; font-size: 1.13rem; overflow-wrap: anywhere; }
.project-state { grid-column: 1; color: var(--muted); background: var(--fill); }
.project-state[data-state="completed"] { color: #1d663c; background: #e9f5ed; }
.project-state[data-state="review"] { color: #825100; background: #fff4df; }
.project-identity-details { grid-column: 1; color: var(--muted); font-size: .83rem; font-weight: 400; }
.project-identity-details > div { display: grid; grid-template-columns: minmax(38px, auto) minmax(0, 1fr); gap: 5px; overflow-wrap: anywhere; }
#completed-list { margin-top: 12px; }
.completed-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 225px); gap: 10px; }
.admin-panel { margin-top: 12px; }
.admin-panel .section-head h2 { margin: 0; }
.owner-filter { width: min(100%, 250px); margin-top: 10px; }
.storage-summary { margin: 10px 0 14px; }
.storage-summary h2 { margin: 0 0 3px; font-size: .95rem; }
#my-storage-total, #site-storage-total { font-size: 1.45rem; font-variant-numeric: tabular-nums; }
#my-storage-breakdown, #site-storage-breakdown { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; color: var(--muted); font-size: .84rem; }
#site-storage-progress { display: block; width: 100%; margin-top: 8px; accent-color: var(--blue); }
#site-storage-warning { margin: 6px 0 0; }
.management-card .user-storage { color: var(--ink); }
#user-storage-dialog { width: min(650px, calc(100% - 24px)); }
.storage-detail-total { margin: 13px 0; font-size: 1.35rem; }
.storage-detail-section { margin-bottom: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 0 11px; }
.storage-detail-section p { margin: 0 0 9px; font-size: .84rem; }
.storage-detail-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 8px; padding-block: 8px; overflow-wrap: anywhere; }
.storage-detail-row + .storage-detail-row { border-top: 1px solid var(--line); }
.storage-detail-row h3 { margin: 0; }
.storage-detail-row small { display: block; margin-top: 2px; }
.storage-item-size { white-space: nowrap; font-variant-numeric: tabular-nums; }
.admin-tabs { margin-block: 10px; }
.admin-tabs button[aria-current="true"] { color: var(--blue); }
#admin-user-stats, #admin-activity-list { margin-top: 12px; }
.admin-event { display: grid; gap: 3px; border-bottom: 1px solid var(--line); padding: 9px 0; overflow-wrap: anywhere; }
#admin-activity-more { margin-top: 10px; }
.project-section { display: grid; gap: 14px; }
.album-view-switch {
  display: flex; width: fit-content; max-width: 100%; gap: 3px; padding: 3px;
  border-radius: 13px; background: #e8e8ed;
}
.album-view-switch button { background: transparent; border-color: transparent; border-radius: 10px; }
.album-view-switch button[aria-pressed="true"] {
  background: var(--surface); color: var(--ink); border-color: transparent; box-shadow: 0 1px 3px rgb(0 0 0 / .10);
}
.inline-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; }
.member-list { display: grid; gap: 7px; margin-block: 10px; }
.member-list p { margin: 0; }
.member-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.member-row button { min-height: 34px; padding: 4px 8px; font-size: .82rem; }
.album-share-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 155px) auto;
  align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line);
}
.album-share-row > span, .member-row > span { overflow-wrap: anywhere; }
.team-picker { min-width: 0; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.team-picker legend { padding-inline: 5px; font-size: .9rem; font-weight: 700; }
.team-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(125px, 100%), 1fr)); gap: 4px 12px; max-height: 210px; overflow: auto; margin-top: 5px; }
.team-choice, .team-all { display: flex; align-items: center; gap: 7px; min-height: 34px; overflow-wrap: anywhere; cursor: pointer; }
.team-picker input[type=checkbox] { margin: 0; }
.team-picker p { margin: 6px 0 0; font-size: .84rem; }
#project-photos-tab { justify-self: start; }
#project-upload { margin: 0; }
.manual-link { display: inline-block; margin: 9px 0 0; padding: 8px 12px; color: var(--blue); font-size: .88rem; text-decoration: none; }
.manual-link:hover { text-decoration: underline; }
.board-panel { margin-top: 12px; }
.board-tabs button { flex: 0 1 auto; }
.board-tabs [aria-current="true"] { color: var(--blue); }
#board-posts { margin-top: 12px; }
#board-post-meta { margin-top: 4px; }
.board-content { line-height: 1.65; overflow-wrap: anywhere; }
.board-content p, .board-reply p { white-space: pre-wrap; }
.board-content blockquote { margin-inline: 0; padding-inline-start: 12px; border-inline-start: 3px solid var(--line); color: var(--muted); }
.board-divider { border-top: 1px solid var(--line); margin-top: 15px; padding-top: 4px; }
.board-attachment, .board-reply { padding: 10px 0; border-bottom: 1px solid var(--line); }
.board-attachment img { display: block; max-width: 100%; max-height: 440px; border-radius: 12px; margin-bottom: 7px; }
.board-attachment a { color: var(--blue); overflow-wrap: anywhere; }
.board-reply p { margin: 4px 0 0; }
.board-format button { min-height: 34px; padding: 4px 9px; font-size: .84rem; }
.manual-page { max-width: 850px; }
.manual-page nav { margin-block: 15px; }
.manual-page section { scroll-margin-top: 12px; }
.manual-page li + li { margin-top: 6px; }
.manual-page a { color: var(--blue); }
.manual-page .panel + .panel { margin-top: 12px; }
.help-guide > p { color: var(--muted); }
.help-nav { display: flex; flex-wrap: wrap; gap: 7px; }
.help-nav a { display: inline-block; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-decoration: none; }
.help-guide ol { padding-inline-start: 1.5rem; }
.help-shot { margin: 16px 0; }
.help-shot a { display: block; width: fit-content; max-width: 100%; }
.help-shot img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 12px; }
.help-shot figcaption { margin-top: 6px; color: var(--muted); font-size: .86rem; }
.help-guide details { margin-top: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.more-menu { position: relative; margin: 0; }
.more-menu > summary {
  display: flex; align-items: center; min-height: 44px; padding: 7px 13px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 11px;
  font-weight: 500; list-style: none;
}
.more-menu > summary::-webkit-details-marker { display: none; }
.download-menu > summary { color: white; background: var(--blue); border-color: var(--blue); font-weight: 680; }
.more-items {
  position: absolute; z-index: 4; inset-inline-end: 0; top: calc(100% + 5px);
  display: grid; gap: 3px; width: max-content; max-width: calc(100vw - 24px);
  padding: 5px; border: 1px solid var(--line); border-radius: 13px;
  background: var(--surface); box-shadow: 0 5px 17px rgb(0 0 0 / .12);
}
.more-items button { justify-content: flex-start; border-color: transparent; text-align: left; }
.photo-card-more { margin-top: 6px; }
.photo-card-more summary { color: var(--muted); font-size: .82rem; }
[aria-current="true"] { background: var(--blue-fill); }
details { margin-top: 20px; }
summary { cursor: pointer; font-weight: 700; }
form { display: grid; gap: 9px; margin-top: 10px; }
label { display: block; font-size: .88rem; font-weight: 620; }
input, select, textarea, button, .button { font: inherit; }
input[type=checkbox], input[type=range] { accent-color: var(--blue); }
input:not([type=file]):not([type=checkbox]):not([type=range]), select, textarea {
  width: 100%; min-width: 0; max-width: 100%; padding: 9px 12px; background: var(--fill); color: inherit;
  border: 1px solid var(--line); border-radius: 11px; min-height: 44px;
}
label input:not([type=file]):not([type=checkbox]), label select { margin-top: 4px; }
.dashboard-tools label input { margin-top: 0; }
button, .button {
  display: inline-flex; justify-content: center; align-items: center; cursor: pointer; min-height: 44px;
  padding: 7px 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; color: var(--ink);
  overflow-wrap: anywhere;
  max-width: 100%; min-width: 0;
}
.button { position: relative; text-align: center; }
button:focus-visible, summary:focus-visible, .button:focus-within, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
button:disabled, .button:has(input:disabled) { opacity: .5; cursor: default; }
.primary { background: var(--blue); color: white; border-color: var(--blue); font-weight: 680; }
.text-button { background: transparent; border-color: transparent; color: var(--blue); padding-inline: 0; min-height: 34px; font-size: .85rem; }
@media (hover: hover) {
  button:not(:disabled):hover, .button:not(:has(input:disabled)):hover { filter: brightness(.96); }
  .text-button:hover { text-decoration: underline; }
}
.actions { display: flex; gap: 8px; flex-wrap: wrap; min-width: 0; }
.fields { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(0, 3fr); gap: 12px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(215px, 100%), 1fr)); gap: 12px; }
.photo-card { border: 1px solid var(--line); border-radius: 14px; padding: 8px; min-width: 0; }
.picture { position: relative; overflow: hidden; container-type: size; background: var(--fill); }
.picture img {
  display: block; position: absolute; left: calc(50% + var(--pan-x, 0%)); top: calc(50% + var(--pan-y, 0%)); width: 100cqw; height: 100cqh;
  object-fit: var(--fit, contain); transform: translate(-50%, -50%) rotate(var(--angle, 0deg)) scale(var(--zoom, 1));
}
.picture.quarter-turn img { width: 100cqh; height: 100cqw; }
.watermark {
  position: absolute; left: 3%; bottom: 4%; max-width: 94%; padding: .22em .46em;
  background: rgb(16 32 54 / .84); color: white; border-radius: 4px;
  font-size: clamp(.55rem, 4cqw, .77rem); line-height: 1.25; font-weight: 650; overflow-wrap: anywhere;
  pointer-events: none; print-color-adjust: exact;
}
.photo-card .picture { aspect-ratio: 4 / 3; border-radius: 9px; }
.photo-card button { display: flex; margin-top: 8px; width: 100%; }
.photo-order { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.photo-order button { font-size: .77rem; padding-inline: 4px; min-height: 38px; }
.danger-text { color: #b4232d; }
.album-card { display: grid; gap: 5px; min-width: 0; border: 1px solid var(--line); border-radius: 14px; padding: 8px; overflow-wrap: anywhere; }
button.album-card { text-align: left; align-content: start; grid-template-columns: minmax(0, 1fr); }
.album-card:has(input) { cursor: pointer; }
.album-card:has(input:checked) { background: var(--blue-fill); border-color: var(--blue); }
.album-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 9px; background: var(--fill); }
.album-card input { justify-self: start; }
.album-view-switch { margin-block: 8px; }
.album-view-switch button { min-height: 36px; }
.album-explorer { grid-template-columns: minmax(0, 1fr); gap: 5px; }
.album-explorer .album-card { grid-template-columns: 56px minmax(0, 1fr); align-items: center; gap: 10px; }
.album-explorer .album-card:has(input) { grid-template-columns: auto 56px minmax(0, 1fr); }
#album-viewer-photo { display: block; width: 100%; max-height: 68vh; object-fit: contain; margin-block: 8px; background: var(--fill); border-radius: 12px; }
.album-viewer-nav { justify-content: space-between; align-items: center; }
#album-photos { margin-top: 12px; }
.album-folder-head { margin: 3px 0 12px; }
.album-folder-head h1 { margin-bottom: 4px; }
.album-folder-head p { margin: 0; }
.album-settings-section { margin-top: 13px; }
.album-settings-section + .album-settings-section { border-top: 1px solid var(--line); padding-top: 12px; }
.album-settings-section form, .album-settings-section h3 { margin-top: 0; }
#add-album-people, #remove-album-people { margin-top: 8px; }
#add-album-people[open] summary, #remove-album-people[open] summary { margin-bottom: 10px; }
#album-settings { width: min(560px, calc(100% - 24px)); }
dialog {
  width: min(760px, calc(100% - 24px)); max-height: calc(100% - 24px); color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  padding: clamp(14px, 3vw, 24px); box-shadow: 0 16px 60px rgb(0 0 0 / .2);
}
dialog::backdrop { background: rgb(24 24 30 / .46); backdrop-filter: blur(3px); }
dialog .section-head { position: sticky; top: -1px; z-index: 1; background: var(--surface); padding-bottom: 8px; border-bottom: 1px solid var(--line); }
dialog h2 { margin: 0; }
dialog input[type=range] { width: 100%; display: block; }
dialog a.button { margin-top: 10px; text-decoration: none; }
.drag-picture { cursor: grab; touch-action: none; border: 1px solid var(--line); border-radius: 13px; }
.drag-picture:active { cursor: grabbing; }
.drag-picture img { user-select: none; pointer-events: none; }
#submissions { display: grid; gap: 8px; }
#notice, #photo-notice, #album-import-notice, #album-settings-notice, #account-notice { background: #dff5ea; color: #164334; padding: 10px 14px; border-radius: 8px; white-space: pre-wrap; }
#notice.error, #photo-notice.error, #album-import-notice.error, #album-settings-notice.error, #account-notice.error { background: #fde8e8; color: #7c2525; }
#account-dialog { width: min(420px, calc(100% - 24px)); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.report-controls { width: min(100%, 210mm); margin: 0 auto 15px; }
#report-settings { max-width: 210mm; margin: 0 auto 18px; }
.report-setting-tabs { display: flex; flex-wrap: wrap; gap: 3px; padding: 3px; border-radius: 12px; background: var(--fill); }
.report-setting-tabs button { flex: 1 1 auto; min-height: 38px; padding-inline: 5px; background: transparent; border-color: transparent; font-size: .83rem; }
.report-setting-tabs button[aria-selected="true"] { color: var(--blue); background: var(--surface); box-shadow: 0 1px 3px rgb(0 0 0 / .10); }
#direct-typography { max-width: 210mm; margin: 0 auto 14px; }
#direct-typography-controls { margin-top: 12px; }
#report-typography { min-width: 0; border: 1px solid var(--line); border-radius: 12px; margin: 0; }
#report-typography legend { padding-inline: 5px; font-size: .9rem; font-weight: 700; }
.cover-logo-controls { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 6px; }
.report-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.report-fields .wide { grid-column: 1 / -1; }
#report {
  --paper-text: var(--ink);
  --paper-muted: #4a4a51;
  --paper-line: var(--line);
  --paper-blue: var(--blue);
  width: 100%; min-width: 0; max-width: 210mm; margin: 0 auto;
  color: var(--paper-text);
}
.report-page {
  padding: clamp(12px, 4vw, 13mm); margin-bottom: 18px; background: #fff;
  border-radius: 16px; box-shadow: 0 2px 16px rgb(0 0 0 / .08);
}
.cover-page {
  aspect-ratio: 210 / 297; display: grid; grid-template-rows: auto minmax(min-content, 1fr) auto;
  background: #fff;
}
.cover-brand {
  color: var(--paper-blue); border-bottom: 1px solid var(--paper-line);
  padding-bottom: 3mm; font-size: clamp(.9rem, 2.5vw, 1.13rem); letter-spacing: -.02em;
}
.cover-logo { display: block; max-width: min(65%, 65mm); max-height: 20mm; object-fit: contain; }
.cover-body { padding-top: clamp(30px, 11vw, 36mm); padding-bottom: 6mm; min-width: 0; }
.cover-hero { margin-bottom: clamp(22px, 5vw, 17mm); }
.cover-title { font-size: clamp(1.65rem, 6vw, 3.65rem); line-height: 1.1; letter-spacing: -.055em; margin: 0; overflow-wrap: anywhere; }
.cover-year { color: var(--paper-blue); font-weight: 700; font-size: clamp(.82rem, 2.4vw, 1.06rem); margin: 0 0 2.5mm; }
.cover-subtitle { color: var(--paper-muted); font-size: clamp(.8rem, 2.5vw, 1.15rem); margin: 3mm 0 0; }
.cover-info { border: 1px solid var(--paper-line); border-radius: 12px; background: #fff; padding: 0 4mm; }
.cover-info-row {
  display: grid; grid-template-columns: minmax(49px, 22%) minmax(0, 1fr);
  align-items: baseline; gap: 2.5mm; padding: 3mm 0;
  color: var(--paper-muted); font-size: clamp(.72rem, 2vw, .95rem);
}
.cover-info-row + .cover-info-row { border-top: 1px solid var(--paper-line); }
.cover-info-row p { margin: 0; color: var(--paper-text); }
.cover-project { font-weight: 700; }
.page-field { background: #f4f8ff !important; border: 1px dashed #7298c2 !important; margin-block: 3px; color: inherit; }
.page-field.cover-title { font-size: clamp(1.25rem, 4vw, 2rem); font-weight: 700; }
.report-photo-edit { position: absolute; top: 7px; right: 7px; min-height: 28px; font-size: .75rem; padding: 2px 7px; }
.photo-sheet {
  aspect-ratio: 210 / 297;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 2mm;
  padding: clamp(9px, 4vw, 13mm);
}
.sheet-heading {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: end; gap: 3mm;
  border-bottom: 1px solid var(--paper-line); padding-bottom: 1.8mm;
  color: var(--paper-muted); font-size: var(--header-size, 9pt); font-weight: 650;
  line-height: 1.25; overflow-wrap: anywhere;
}
.sheet-heading > :first-child { color: var(--paper-blue); text-align: var(--header-left-align, left); }
.sheet-heading > :last-child { text-align: var(--header-right-align, right); }
.sheet-footer {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 3mm;
  border-top: 1px solid var(--paper-line); padding-top: 1.6mm;
  color: var(--paper-muted); font-size: var(--footer-size, 8pt); line-height: 1.2; overflow-wrap: anywhere;
}
.sheet-footer > :first-child { text-align: var(--footer-align, left); }
.sheet-heading .page-field, .sheet-footer .page-field { font-size: inherit; }
.sheet-number { white-space: nowrap; font-variant-numeric: tabular-nums; }
.report-notes { white-space: pre-line; }
.report-grid {
  display: grid; gap: 2mm; min-height: 0;
  grid-template-rows: repeat(var(--rows, 1), minmax(0, 1fr));
  grid-template-columns: repeat(var(--columns, 1), minmax(0, 1fr));
}
.report-grid.wide-last > figure:last-child { grid-column: 1 / -1; }
.report-grid figure {
  position: relative; display: grid; grid-template-rows: minmax(0, 1fr) auto;
  margin: 0; min-width: 0; min-height: 0; border: 1px solid var(--paper-line); border-radius: 2.5mm; padding: 1.4mm;
}
.report-grid .picture { border-radius: 1.4mm; }
.report-grid figcaption { min-width: 0; padding: 1mm 0 0; overflow-wrap: anywhere; font-size: clamp(.65rem, 1.8vw, .82rem); line-height: 1.25; }
.report-grid figcaption strong { color: var(--paper-muted); }
.report-grid figcaption textarea { display: block; min-height: 0; max-height: 18mm; padding: 2px 4px; }
@media screen and (min-width: 1050px) {
  #report-view:has(#report-settings:not([hidden])) .report-controls { width: 100%; }
  .report-layout:has(#report-settings:not([hidden])) {
    display: grid; grid-template-columns: minmax(290px, 342px) minmax(0, 1fr); gap: 20px; align-items: start;
  }
  .report-layout:has(#report-settings:not([hidden])) #report-settings { width: 100%; }
  #report-settings .report-fields { grid-template-columns: minmax(0, 1fr); }
}
@media screen and (max-width: 740px) {
  main { width: calc(100% - 28px); margin-top: 14px; }
  .app-bar { width: calc(100% - 28px); min-height: 58px; }
  #workspace, .lower { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .panel { padding: 14px; }
  .app-sidebar { position: static; padding: 0; }
  #account { padding-inline: 3px; margin-bottom: 7px; }
  .app-sidebar nav.project-list {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px; border-radius: 13px; background: #e8e8ed; padding: 3px;
  }
  .app-sidebar nav:has(#admin-nav:not([hidden])) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-sidebar nav button { justify-content: center; text-align: center; min-height: 42px; padding-inline: 5px; }
  .app-sidebar nav button[aria-current="true"] { background: var(--surface); box-shadow: 0 1px 3px rgb(0 0 0 / .10); }
  .project-head > .actions { width: 100%; }
  .project-head > .actions button, .report-controls button { flex: 1 1 auto; }
  .album-share-row { grid-template-columns: minmax(0, 1fr) minmax(0, 155px); }
  .album-share-row .actions { grid-column: 1 / -1; }
  .album-share-row .actions button { flex: 1 1 auto; }
  dialog { max-height: calc(100dvh - 24px); overscroll-behavior: contain; }
  input:not([type=file]):not([type=checkbox]):not([type=range]), select, textarea { font-size: max(1rem, 16px); }
}
@media screen and (max-width: 480px) {
  .app-bar { gap: 8px; width: calc(100% - 24px); }
  .header-actions { gap: 4px; }
  .header-actions button { padding-inline: 7px; font-size: .83rem; }
  main { width: calc(100% - 24px); }
  .panel { padding: 12px; }
  .narrow { padding: 19px; }
  .management-lists, .fields, .inline-form, .report-fields { grid-template-columns: minmax(0, 1fr); }
  .completed-filters { grid-template-columns: minmax(0, 1fr); }
  .management-lists { gap: 9px; }
  .dashboard-tools { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .project-head > .actions button, .report-controls button { flex-basis: 42%; }
  .more-menu[open] { flex-basis: 100%; }
  .more-menu > summary { width: fit-content; }
  .more-items { position: static; width: 100%; max-width: none; margin-top: 5px; box-shadow: none; }
  .section-head, .project-head { gap: 8px; }
  .section-head > div { min-width: 0; }
  .album-folder-actions { width: 100%; }
  .album-folder-actions > * { flex: 1 1 auto; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(min(144px, 100%), 1fr)); gap: 8px; }
  .album-explorer { grid-template-columns: minmax(0, 1fr); }
  .photo-card { padding: 6px; }
  .photo-order { grid-template-columns: repeat(auto-fit, minmax(min(52px, 100%), 1fr)); }
  .cover-page { border-radius: 10px; }
  .photo-sheet { gap: 5px; padding: 8px; border-radius: 10px; }
  .sheet-heading { font-size: clamp(7px, calc(var(--header-size, 9pt) * .7), 16px); }
  .sheet-footer { font-size: clamp(7px, calc(var(--footer-size, 8pt) * .7), 16px); }
  .report-grid { gap: 4px; }
  .report-grid figure { padding: 3px; border-radius: 5px; }
  .report-grid figcaption { padding-top: 2px; font-size: .59rem; }
  .report-grid .photo-caption:not(textarea) { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  .report-photo-edit { min-height: 26px; top: 5px; right: 5px; padding: 2px 4px; }
  .board-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@page { size: A4; margin: 13mm; }
@media print {
  :root, body { background: white; color: black; }
  header, #notice, .report-controls, #report-settings, #direct-typography, .report-photo-edit, dialog { display: none !important; }
  main { width: 100%; margin: 0; }
  #report { max-width: none; }
  .report-layout { display: block; }
  .report-page { padding: 0; margin: 0; border-radius: 0; box-shadow: none; }
  .cover-page { height: 269mm; aspect-ratio: auto; background: white; break-inside: avoid; }
  .cover-body { padding-top: 36mm; }
  .cover-hero { margin-bottom: 13mm; }
  .cover-brand { font-size: 12pt; }
  .cover-title { font-size: 34pt; }
  .cover-year, .cover-subtitle { font-size: 12pt; }
  .cover-info-row { font-size: 10pt; }
  .report-page:not(:last-child) { break-after: page; }
  .photo-sheet { height: 269mm; aspect-ratio: auto; break-inside: avoid; }
  .report-grid figcaption { font-size: 9pt; line-height: 1.2; }
  .report-grid figure { break-inside: avoid; }
}
