:root {
  --bg: #fffaf7;
  --card: rgba(255,255,255,.9);
  --text: #3d3231;
  --muted: #766967;
  --accent: #a86b70;
  --accent-dark: #885158;
  --border: #eadfd9;
  --success: #406b54;
  --error: #9b3f46;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(circle at top, #fff 0, var(--bg) 50%, #f8eee9 100%);
  color: var(--text);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}
a { color: inherit; }
.page-shell { width: min(100% - 28px, 680px); margin: 0 auto; padding: 42px 0 64px; }
.page-shell.wide { width: min(100% - 28px, 1120px); }
.hero { text-align: center; padding: 12px 8px 28px; }
.hero.compact { padding-bottom: 18px; }
.rings { font-size: 42px; margin-bottom: 6px; }
.eyebrow { margin: 0 0 10px; text-transform: uppercase; letter-spacing: .2em; font-size: 12px; color: var(--accent); font-weight: 800; }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 500; font-size: clamp(34px, 8vw, 58px); line-height: 1.05; }
.subtitle { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: clamp(19px, 4vw, 25px); margin: 16px 0 0; color: var(--accent-dark); }
.intro { max-width: 560px; margin: 18px auto 0; color: var(--muted); line-height: 1.6; }
.upload-card { background: var(--card); border: 1px solid var(--border); border-radius: 26px; padding: 22px; box-shadow: 0 18px 55px rgba(80,58,54,.09); }
.field-label { display: block; margin: 0 0 8px; font-weight: 700; }
.text-input { width: 100%; min-height: 50px; border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; font-size: 16px; background: #fff; color: var(--text); margin-bottom: 18px; outline: none; }
.text-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(168,107,112,.13); }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.drop-zone { border: 2px dashed #d9c5bd; background: #fffaf8; border-radius: 22px; min-height: 190px; padding: 28px 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-align: center; }
.drop-zone .camera { font-size: 42px; }
.drop-zone strong { font-size: 20px; }
.drop-zone span:last-child { color: var(--muted); font-size: 14px; }
.selection { text-align: center; color: var(--muted); margin: 14px 0; font-size: 14px; }
.preview-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.preview-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.primary-btn, .secondary-btn, .danger-btn { border: 0; border-radius: 14px; min-height: 50px; padding: 12px 18px; font-size: 16px; font-weight: 800; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.primary-btn { width: 100%; background: var(--accent); color: #fff; }
.primary-btn:hover { background: var(--accent-dark); }
.primary-btn:disabled { opacity: .65; cursor: wait; }
.secondary-btn { background: #fff; border: 1px solid var(--border); color: var(--text); }
.danger-btn { min-height: 38px; padding: 8px 12px; color: #fff; background: var(--error); font-size: 14px; }
.hint { margin: 12px 0 0; color: var(--muted); text-align: center; font-size: 12px; }
.gallery-link { margin: 18px auto 0; min-height: 50px; padding: 12px 20px; border: 1px solid var(--border); border-radius: 14px; text-decoration: none; font-weight: 800; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.7); }
.footer-note { text-align: center; color: var(--muted); font-size: 13px; margin-top: 28px; }
.message { padding: 14px 16px; border-radius: 14px; margin: 0 0 16px; font-weight: 700; }
.message.error { color: var(--error); background: #fff0f1; border: 1px solid #f3cdd0; }
.message.success { color: var(--success); background: #edf8f1; border: 1px solid #cae6d4; }
.gallery-actions, .admin-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 0 0 24px; }
.gallery-grid { columns: 4 220px; column-gap: 14px; }
.photo-card { break-inside: avoid; margin: 0 0 14px; background: #fff; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); }
.photo-card img { width: 100%; display: block; }
.photo-card figcaption { padding: 9px 11px; color: var(--muted); font-size: 13px; }
.empty-state { text-align: center; background: #fff; border: 1px dashed var(--border); border-radius: 18px; padding: 32px 20px; color: var(--muted); }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.admin-photo { overflow: hidden; border-radius: 18px; background: #fff; border: 1px solid var(--border); }
.admin-photo img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.admin-meta { display: grid; gap: 8px; padding: 12px; }
.admin-meta small { color: var(--muted); }
.admin-shell { max-width: 520px; }
@media (max-width: 520px) {
  .page-shell { width: min(100% - 20px, 680px); padding-top: 24px; }
  .upload-card { padding: 16px; border-radius: 20px; }
  .preview-grid { grid-template-columns: repeat(3, 1fr); }
}
