:root {
  --ivory: #f5f0e8;
  --paper: #fffdf9;
  --ink: #302722;
  --muted: #85766d;
  --line: #ded3c7;
  --terracotta: #ae6b52;
  --terracotta-dark: #864f3b;
  --sage: #768b78;
  --danger: #a7544d;
  --shadow: 0 22px 60px rgba(62, 44, 32, .08);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--ivory);
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--ivory); }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 15% 10%, rgba(255,255,255,.8), transparent 30rem), var(--ivory); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
code { padding: .15rem .35rem; border-radius: 6px; background: #eee4da; }
.page { min-height: 100vh; }
.page-inner { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 56px 0 80px; }
.eyebrow { margin: 0 0 12px; color: var(--terracotta-dark); font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: -.03em; }
h1 { margin-bottom: 16px; font-size: clamp(2.4rem, 5vw, 4.8rem); line-height: .98; }
h2 { margin-bottom: 12px; font-size: clamp(1.6rem, 2.5vw, 2.5rem); line-height: 1.05; }
p { line-height: 1.65; }
.lede { max-width: 630px; color: var(--muted); font-size: 1.05rem; }
.page-header { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 40px; }
.page-header h1 { max-width: 780px; }
.sidebar { position: fixed; z-index: 3; inset: 0 auto 0 0; display: flex; width: 240px; flex-direction: column; padding: 34px 26px; border-right: 1px solid var(--line); background: rgba(251,247,241,.92); backdrop-filter: blur(14px); }
.admin-shell .page { margin-left: 240px; }
.wordmark { display: flex; align-items: center; gap: 9px; font-family: Georgia, serif; font-size: 1.15rem; }
.mark, .seal { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--terracotta); border-radius: 50%; color: var(--terracotta-dark); font-size: 1.3rem; line-height: 1; transform: rotate(-45deg); }
.sidebar .eyebrow { margin-top: 58px; font-size: .62rem; }
.sidebar nav { display: grid; gap: 8px; }
.sidebar nav a { padding: 10px 12px; border-radius: 10px; color: var(--muted); font-size: .93rem; transition: background .2s ease, color .2s ease; }
.sidebar nav a:hover { background: #efe4d9; color: var(--ink); }
.sidebar-foot { display: grid; gap: 10px; margin-top: auto; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
.sidebar-foot a { color: var(--terracotta-dark); }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 38px; }
.metric { display: grid; min-height: 130px; align-content: space-between; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,253,249,.6); }
.metric span, .metric small { color: var(--muted); font-size: .76rem; }
.metric strong { font-family: Georgia, serif; font-size: 2.8rem; font-weight: 500; }
.split-panel, .upload-panel, .editor-panel, .link-result, .callout { padding: 30px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.split-panel { display: flex; justify-content: space-between; gap: 30px; margin-top: 26px; }
.split-panel p { max-width: 570px; color: var(--muted); }
.panel-actions, .form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 18px; border: 1px solid transparent; border-radius: 999px; font-size: .88rem; font-weight: 750; transition: transform .2s ease, background .2s ease, border-color .2s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--terracotta); color: #fffaf5; }
.button-primary:hover { background: var(--terracotta-dark); }
.button-secondary { border-color: var(--line); background: transparent; color: var(--ink); }
.button-secondary:hover { border-color: var(--terracotta); }
.button-danger { color: var(--danger); }
.button-small { min-height: 34px; padding: 0 12px; font-size: .76rem; }
.button-large { min-height: 52px; padding: 0 28px; font-size: 1rem; }
.notice { margin-bottom: 16px; padding: 13px 16px; border-radius: 12px; font-size: .88rem; }
.notice-success { background: #e8f0e8; color: #45624c; }
.notice-error { background: #f6e4e0; color: #7b3f3a; }
.notice ul { margin: 0; padding-left: 20px; }
.upload-panel { margin-bottom: 36px; }
.upload-form { display: grid; grid-template-columns: 1fr 1.2fr auto; align-items: center; gap: 24px; }
.upload-form p { margin-bottom: 0; color: var(--muted); }
.file-drop { display: grid; min-height: 108px; place-items: center; align-content: center; gap: 5px; border: 1px dashed var(--terracotta); border-radius: 14px; background: #fdf8f1; text-align: center; cursor: pointer; }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-drop span { font-weight: 750; }
.file-drop small { color: var(--muted); }
.upload-progress { height: 5px; margin-top: 18px; overflow: hidden; border-radius: 9px; background: #ecdfd3; }
.upload-progress span { display: block; width: 0; height: 100%; background: var(--terracotta); transition: width .2s ease; }
.photo-list, .link-list { display: grid; gap: 10px; }
.photo-row, .link-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,253,249,.65); }
.thumb-placeholder, .album-art { display: grid; flex: 0 0 auto; place-items: center; width: 70px; height: 70px; border-radius: 12px; background: linear-gradient(145deg, #d6b3a2, #f0dbc9 45%, #b6c2b1); color: rgba(255,255,255,.9); font-family: Georgia, serif; font-size: 2rem; }
.photo-row { justify-content: flex-start; }
.photo-meta { display: grid; gap: 5px; min-width: 0; flex: 1; }
.photo-meta strong, .link-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-meta span, .photo-meta small, .link-row span, .link-row small { color: var(--muted); font-size: .78rem; }
.inline-form { margin-left: auto; }
.create-strip { margin-bottom: 24px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,253,249,.55); }
.inline-create { display: flex; gap: 10px; }
input, select { width: 100%; min-height: 44px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; outline: none; background: #fffdfa; color: var(--ink); }
input:focus, select:focus { border-color: var(--terracotta); box-shadow: 0 0 0 3px rgba(174,107,82,.13); }
.album-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.album-card { display: grid; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); transition: transform .2s ease, box-shadow .2s ease; }
.album-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.album-art { width: 100%; height: 180px; font-size: 3rem; }
.album-card strong, .album-card small { display: block; }
.album-card small { margin-top: 5px; color: var(--muted); font-size: .78rem; }
.stacked-form { display: grid; gap: 18px; max-width: 540px; }
.stacked-form label { display: grid; gap: 7px; font-size: .86rem; font-weight: 750; }
.stacked-form small { color: var(--muted); font-weight: 400; line-height: 1.5; }
.editor-panel { display: grid; gap: 28px; }
.check-list { display: grid; gap: 8px; max-height: 460px; overflow: auto; padding: 5px; }
.check-row { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fffdfa; }
.check-row input[type="checkbox"] { width: 18px; min-height: 18px; accent-color: var(--terracotta); }
.check-row span { display: grid; flex: 1; gap: 3px; }
.check-row small { color: var(--muted); font-size: .76rem; }
.order-input { width: 78px; min-height: 35px; }
.danger-zone { padding-top: 20px; border-top: 1px solid #eed8d3; }
.link-row > div:first-child { display: grid; min-width: 0; gap: 5px; }
.link-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: end; gap: 8px; }
.link-actions form { margin: 0; }
.status { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: .68rem; font-weight: 800; white-space: nowrap; }
.status-unused { background: #f7ead2; color: #8b652d; }
.status-redeemed { background: #e3eee5; color: #4d7257; }
.status-expired, .status-revoked { background: #eee4e1; color: #85534b; }
.auth-card, .landing-card, .state-card { width: min(100%, 590px); margin: 9vh auto 0; padding: clamp(28px, 6vw, 64px); border: 1px solid var(--line); border-radius: 26px; background: rgba(255,253,249,.83); box-shadow: var(--shadow); }
.auth-card h1, .landing-card h1, .state-card h1 { max-width: 510px; }
.auth-card .button { width: 100%; margin-top: 8px; }
.seal { width: 46px; height: 46px; margin-bottom: 34px; font-size: 1.8rem; }
.landing-card { text-align: center; }
.landing-card .seal, .state-card .seal { margin-right: auto; margin-left: auto; }
.landing-card .lede, .state-card .lede { margin-right: auto; margin-left: auto; }
.fine-print, .muted { color: var(--muted); font-size: .8rem; }
.landing-card .fine-print { margin: 24px 0 0; }
.link-result .copy-line { display: flex; gap: 10px; margin: 22px 0 14px; }
.copy-line input { font-family: ui-monospace, monospace; }
.callout { margin-top: 22px; color: var(--muted); font-size: .9rem; }
.empty-state { padding: 46px 25px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; }
.empty-state p { color: var(--muted); }
.viewer { width: min(1200px, 100%); margin: 0 auto; }
.viewer-header { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.viewer-header h1 { margin-bottom: 0; font-size: clamp(2.2rem, 5vw, 4rem); }
.session-note { color: var(--muted); font-size: .78rem; }
.viewer-stage { position: relative; display: grid; min-height: min(72vh, 780px); place-items: center; overflow: hidden; padding: 16px; border: 1px solid var(--line); border-radius: 24px; background: #e9dfd4; box-shadow: var(--shadow); }
.viewer-frame { display: none; width: 100%; margin: 0; text-align: center; }
.viewer-frame.is-active { display: block; animation: appear .35s ease both; }
.viewer-frame img { display: block; max-width: 100%; max-height: 68vh; margin: 0 auto; border-radius: 12px; box-shadow: 0 16px 50px rgba(53,39,28,.18); user-select: none; -webkit-user-select: none; -webkit-user-drag: none; pointer-events: none; }
.viewer-frame figcaption { margin-top: 13px; color: var(--muted); font-size: .8rem; }
.viewer-controls { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 20px 0; }
.viewer-controls span { min-width: 60px; color: var(--muted); text-align: center; font-size: .82rem; }
.viewer-footnote { max-width: 620px; margin: 22px auto 0; color: var(--muted); text-align: center; font-size: .8rem; }
@keyframes appear { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
@media (max-width: 980px) { .metric-grid { grid-template-columns: repeat(2, 1fr); } .upload-form { grid-template-columns: 1fr 1fr; } .upload-form .button { grid-column: 1 / -1; justify-self: start; } }
@media (max-width: 720px) { .sidebar { position: static; width: 100%; min-height: auto; padding: 18px 20px; } .sidebar .eyebrow { margin-top: 22px; } .sidebar nav { display: flex; overflow: auto; margin: 0 -4px; } .sidebar nav a { white-space: nowrap; } .sidebar-foot { display: flex; justify-content: space-between; margin-top: 20px; } .admin-shell .page { margin-left: 0; } .page-inner { width: min(100% - 30px, 620px); padding-top: 32px; } .page-header { display: block; margin-bottom: 28px; } h1 { font-size: 3rem; } .metric-grid { gap: 8px; } .metric { min-height: 105px; padding: 14px; } .metric strong { font-size: 2.1rem; } .split-panel, .photo-row, .link-row, .viewer-header { align-items: flex-start; flex-direction: column; } .panel-actions, .inline-form { margin-top: 4px; } .upload-form { grid-template-columns: 1fr; } .upload-form .button { grid-column: auto; justify-self: stretch; } .album-grid { grid-template-columns: 1fr 1fr; } .album-art { height: 125px; } .inline-create, .link-result .copy-line { flex-direction: column; } .link-actions { justify-content: flex-start; } .viewer-stage { min-height: 58vh; padding: 8px; } .session-note { margin-top: 4px; } }
@media (max-width: 440px) { .metric-grid, .album-grid { grid-template-columns: 1fr 1fr; } .metric span { font-size: .68rem; } .metric strong { font-size: 1.8rem; } .auth-card, .landing-card, .state-card { margin-top: 4vh; padding: 28px 22px; } }
