:root {
  --paper: #fffaf4;
  --paper-deep: #f7eee5;
  --ink: #3d2d32;
  --muted: #796b6f;
  --rose: #a7616e;
  --rose-dark: #824653;
  --gold: #b28a55;
  --line: #eadbd0;
  --success: #39735b;
  --shadow: 0 14px 38px rgba(85, 54, 59, .09);
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top, #fff 0, var(--paper) 36rem); }
button, input { font: inherit; }
.hidden { display: none !important; }
.page-shell { width: min(100% - 28px, 720px); margin: 0 auto; padding: max(32px, env(safe-area-inset-top)) 0 32px; }
.hero { padding: 28px 8px 34px; text-align: center; }
.hero h1, .admin-header h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.5rem, 11vw, 4.6rem); font-style: italic; font-weight: 400; letter-spacing: -.045em; }
.hero h1 span { color: var(--rose); font-size: .76em; }
.ornament { color: var(--gold); font-size: 1.75rem; margin-bottom: 10px; }
.eyebrow { margin: 10px 0 0; color: var(--rose); font-size: .76rem; font-weight: 750; letter-spacing: .18em; text-transform: uppercase; }
.card { border: 1px solid rgba(178, 138, 85, .22); border-radius: 22px; background: rgba(255, 255, 255, .82); box-shadow: var(--shadow); }
.intro-card { padding: clamp(20px, 5vw, 38px); }
h2 { margin: 0 0 10px; font-family: Georgia, "Times New Roman", serif; font-size: 1.65rem; font-weight: 500; }
p { color: var(--muted); line-height: 1.62; }
.name-field { display: grid; gap: 8px; margin: 24px 0 20px; color: var(--ink); font-weight: 650; }
.name-field small { color: var(--muted); font-weight: 400; }
input { min-height: 48px; border: 1px solid var(--line); border-radius: 13px; padding: 0 14px; background: white; color: var(--ink); outline: none; }
input:focus { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(167, 97, 110, .12); }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.message { margin: 18px 0; border-radius: 12px; padding: 13px 15px; font-size: .94rem; }
.message.error { background: #fff0f0; color: #8e3232; }
.message.success { background: #edf8f2; color: #245c46; }
.message.notice { background: #fff8df; color: #725d18; }
#uploader.disabled { opacity: .45; pointer-events: none; }
.primary-button { width: 100%; min-height: 50px; border: 0; border-radius: 13px; padding: 0 18px; background: var(--rose-dark); color: #fff; font-weight: 800; cursor: pointer; }
.primary-button:hover { background: #713b47; color: #fff; }
.primary-button:focus-visible, .picker-button:focus-visible { outline: 3px solid rgba(167, 97, 110, .28); outline-offset: 2px; }
.primary-button:disabled { opacity: .55; cursor: default; }
.name-locked { margin-bottom: 18px; }
.name-locked .name-field { margin-bottom: 0; }
.name-locked input { background: var(--paper-deep); color: var(--ink); opacity: 1; }
.compact-uploader { margin-top: 20px; }
.picker-button { width: 100%; min-height: 92px; display: flex; align-items: center; justify-content: center; gap: 14px; border: 1.5px dashed var(--rose); border-radius: 16px; padding: 16px; background: rgba(167, 97, 110, .055); color: var(--rose-dark); cursor: pointer; text-align: left; }
.picker-button:hover { background: rgba(167, 97, 110, .10); }
.picker-button strong, .picker-button small { display: block; }
.picker-button strong { font-size: 1.02rem; }
.picker-button small { margin-top: 3px; color: var(--muted); font-weight: 500; }
.picker-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; background: var(--rose-dark); color: #fff; font-size: 1.7rem; line-height: 1; }
.upload-note { margin: 12px 0 0; text-align: center; color: var(--muted); font-size: .78rem; }
.upload-queue { display: grid; gap: 9px; margin: 12px 0; }
.upload-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 34px; gap: 10px; padding: 12px 12px 15px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.upload-row-info { min-width: 0; display: grid; gap: 3px; }
.upload-row-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.upload-row-info span { color: var(--muted); font-size: .76rem; }
.remove-file { width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--paper-deep); color: var(--ink); font-size: 1.25rem; cursor: pointer; }
.remove-file:disabled { opacity: .35; }
.progress-track { position: absolute; right: 0; bottom: 0; left: 0; height: 4px; background: var(--paper-deep); }
.progress-track span { display: block; height: 100%; background: var(--success); transition: width .2s ease; }
.history-section { margin-top: 42px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-heading .eyebrow { margin-bottom: 6px; }
.section-heading h2 { margin: 0; }
.text-button { border: 0; background: transparent; color: var(--rose-dark); font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap; }
.history-grid { display: grid; gap: 10px; }
.history-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) 26px; gap: 13px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.history-preview { width: 64px; height: 64px; display: grid; place-items: center; overflow: hidden; border-radius: 11px; background: var(--paper-deep); color: var(--rose); font-size: 1.4rem; }
.history-preview img { width: 100%; height: 100%; object-fit: cover; }
.history-info { min-width: 0; display: grid; gap: 5px; }
.history-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-info span { color: var(--muted); font-size: .82rem; }
.success-mark { color: var(--success); font-size: 1.1rem; font-weight: 800; }
.device-info { max-width: 650px; margin: 0 auto; padding: 6px 14px 10px; color: var(--muted); font-size: .7rem; line-height: 1.55; text-align: center; overflow-wrap: anywhere; }
footer { padding: 42px 0 0; text-align: center; color: var(--muted); font-family: Georgia, serif; font-style: italic; }

.admin-body { background: #f8f5f1; }
.admin-shell { width: min(100% - 32px, 1180px); margin: 0 auto; padding: 36px 0 60px; }
.admin-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 30px; }
.admin-header h1 { font-size: clamp(2rem, 6vw, 3.4rem); }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; border-radius: 12px; padding: 0 16px; background: var(--rose); color: white; font-weight: 700; text-decoration: none; }
.button.secondary { background: white; border: 1px solid var(--line); color: var(--rose-dark); }
.admin-summary { display: grid; grid-template-columns: repeat(3, 1fr); padding: 22px; margin-bottom: 20px; }
.admin-summary div { display: grid; gap: 5px; padding: 4px 22px; border-right: 1px solid var(--line); }
.admin-summary div:last-child { border: 0; }
.admin-summary strong { font-family: Georgia, serif; font-size: 1.7rem; font-weight: 500; }
.admin-summary span { color: var(--muted); font-size: .86rem; }
.qr-card { display: flex; align-items: center; gap: 26px; padding: 20px; margin-bottom: 38px; }
.qr-card img { width: 150px; height: 150px; }
.guest-url { display: block; max-width: 660px; overflow: hidden; color: var(--rose-dark); font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.settings-card { padding: clamp(20px, 4vw, 32px); margin-bottom: 38px; }
.settings-card form { max-width: 760px; }
.settings-card .name-field { margin-top: 20px; }
.settings-card .button { border: 0; cursor: pointer; }
.check-field { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 8px; font-weight: 650; }
.check-field input { width: 19px; min-height: 19px; margin: 2px 0 0; accent-color: var(--rose-dark); }
.settings-note { max-width: 760px; margin: 8px 0 18px; font-size: .84rem; }
.settings-status { margin-top: 16px; color: var(--muted); font-size: .85rem; }
.settings-card hr { margin: 24px 0; border: 0; border-top: 1px solid var(--line); }
.danger-setting { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.danger-setting p { margin: 4px 0 0; font-size: .86rem; }
.button.danger { flex: 0 0 auto; background: #963f47; }
.storage-setting { display: grid; gap: 7px; }
.storage-setting code { width: fit-content; max-width: 100%; overflow-wrap: anywhere; border-radius: 8px; padding: 7px 9px; background: var(--paper-deep); color: var(--ink); }
.storage-setting small { color: var(--muted); }
.exif-button { border: 0; padding: 0; background: transparent; color: var(--rose-dark); font: inherit; cursor: pointer; text-align: left; text-decoration: underline dotted; text-underline-offset: 3px; }
.exif-popover { position: fixed; z-index: 1000; max-height: min(440px, calc(100vh - 24px)); overflow: auto; border: 1px solid var(--line); border-radius: 14px; padding: 17px 40px 16px 17px; background: #fff; box-shadow: 0 18px 55px rgba(61, 45, 50, .24); }
.exif-popover > strong { display: block; margin-bottom: 12px; font-family: Georgia, serif; font-size: 1.1rem; }
.exif-popover dl { display: grid; grid-template-columns: minmax(92px, auto) minmax(0, 1fr); gap: 7px 12px; margin: 0; font-size: .82rem; }
.exif-popover dt { color: var(--muted); }
.exif-popover dd { margin: 0; overflow-wrap: anywhere; color: var(--ink); }
.popover-close { position: absolute; top: 7px; right: 8px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--paper-deep); color: var(--ink); font-size: 1.15rem; cursor: pointer; }
.ip-address { white-space: nowrap; font-size: .78rem; }
.device-cell { display: block; min-width: 130px; max-width: 210px; }
.admin-list-section { padding-top: 10px; }
.admin-list-section .section-heading input { width: min(320px, 45vw); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: white; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: .76rem; letter-spacing: .06em; text-transform: uppercase; }
td strong, td small { display: block; max-width: 260px; }
td small { margin-top: 4px; color: var(--muted); }
.status { display: inline-flex; border-radius: 99px; padding: 3px 8px; background: var(--paper-deep); font-size: .75rem; font-weight: 750; }
.status.complete { background: #e7f5ed; color: var(--success); }
.status.rejected, .status.expired { background: #fff0f0; color: #8e3232; }
.empty { padding: 34px; color: var(--muted); text-align: center; }

@media (max-width: 650px) {
  .page-shell { width: min(100% - 18px, 720px); }
  .hero { padding-top: 15px; }
  .intro-card { border-radius: 18px; }
  .hero h1 { font-size: clamp(2.45rem, 13vw, 3.7rem); }
  .picker-button { min-height: 82px; }
  .admin-header { align-items: flex-start; flex-direction: column; }
  .admin-summary { grid-template-columns: 1fr; }
  .admin-summary div { border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 4px; }
  .qr-card { align-items: flex-start; }
  .qr-card img { width: 112px; height: 112px; }
  .danger-setting { align-items: stretch; flex-direction: column; }
  .danger-setting .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
