/* Shared stylesheet for all pages. Page-specific deviations are scoped via
   body[data-page="site|admin|landing"] so each page renders exactly as before. */

:root {
  --ink: #3d322c; --muted: #a08a7c; --soft: #6f5f56;
  --accent: #d99a82; --accent-deep: #b05c43;
  --card: #fff; --line: #f0e2d9; --line2: #efe0d7;
  --page: #faf5f0;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Jost', system-ui, sans-serif; color: var(--ink);
  background: #f0eee9; min-height: 100dvh;
}
#app {
  max-width: 480px; margin: 0 auto; min-height: 100dvh;
  background: var(--page); display: flex; flex-direction: column; position: relative;
}
.serif { font-family: 'Cormorant Garamond', serif; }
.kicker { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #c08a74; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; }
.btn-primary {
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  height: 54px; border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 16px; font-weight: 500; box-shadow: 0 6px 18px rgba(217,154,130,.4); user-select: none;
}
.btn-primary:active { transform: scale(.98); }
.btn-primary.disabled { background: #eee1d7; color: #b8a596; box-shadow: none; pointer-events: none; }
.field {
  height: 52px; border-radius: 16px; border: 1px solid var(--line2); background: #fff;
  padding: 0 18px; font-size: 15px; color: var(--ink); outline: none; width: 100%;
  font-family: 'Jost', sans-serif;
}
.field:focus { border-color: var(--accent); }
textarea.field { height: auto; padding: 12px 16px; resize: none; line-height: 1.5; font-size: 13.5px; }
select.field { appearance: auto; }
.err { color: #a04e3a; font-size: 13px; min-height: 18px; }
.sheet-wrap { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet-dim { position: absolute; inset: 0; background: rgba(61,42,32,.28); }
.sheet {
  position: relative; width: 100%; max-width: 480px; background: #fffdfb;
  border-radius: 26px 26px 0 0; box-shadow: 0 -12px 40px rgba(90,58,42,.25);
  padding: 14px 20px 26px; display: flex; flex-direction: column; gap: 12px;
}
.sheet-handle { width: 40px; height: 4px; border-radius: 2px; background: #e4d5c9; margin: 0 auto; flex: none; }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 6px; text-align: center; }
input[type=range] { accent-color: #d99a82; }

/* photo viewer (lightbox), shared by site + admin */
.viewer {
  position: fixed; inset: 0; z-index: 30; background: rgba(30,20,15,.93);
  display: flex; align-items: center; justify-content: center;
}
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-close {
  position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.14); color: #fff; display: flex; align-items: center;
  justify-content: center; font-size: 16px; cursor: pointer; user-select: none;
}
.viewer-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px;
  display: flex; align-items: center; justify-content: center; color: #fff;
  font-size: 36px; cursor: pointer; user-select: none;
}
.viewer-count {
  position: absolute; bottom: 18px; left: 0; right: 0; text-align: center;
  color: rgba(255,255,255,.8); font-size: 13px; user-select: none;
}

/* ============ client mini-site ============ */
body[data-page="site"] #app { background-attachment: fixed; }
body[data-page="site"] .btn-primary { font-size: 15.5px; letter-spacing: .04em; gap: 8px; }
body[data-page="site"] .err { padding: 6px 4px 0; min-height: 20px; }
body[data-page="site"] .cal-day {
  aspect-ratio: 1; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 14px; user-select: none;
}
.btn-ghost {
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  height: 46px; border-radius: 999px; background: #fff; border: 1px solid var(--line2);
  font-size: 13.5px; color: #8a7367; user-select: none;
}
.back-btn {
  cursor: pointer; width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: #fff; border: 1px solid var(--line2);
  display: flex; align-items: center; justify-content: center; color: var(--accent-deep);
}
.screen-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 6px; }
.sticky-cta {
  margin-top: auto; position: sticky; bottom: 0; padding: 12px 20px 26px;
  background: linear-gradient(transparent, var(--page) 40%);
}
.slot-chip {
  cursor: pointer; padding: 10px 16px; border-radius: 999px; background: #fff;
  border: 1px solid var(--line2); font-size: 14px; color: var(--ink); user-select: none;
}
.slot-chip.sel { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 500; }
.row { display: flex; justify-content: space-between; font-size: 14px; gap: 12px; }
.row .k { color: var(--muted); flex: none; }
.row .v { font-weight: 500; text-align: right; }
.hr { height: 1px; background: #f5eae2; }
.chip-link {
  font-size: 12.5px; color: #8a7367; background: #fff; border: 1px solid var(--line2);
  border-radius: 999px; padding: 7px 14px; text-decoration: none;
}
.gallery { padding: 0 20px 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gallery img { width: 100%; height: 100%; object-fit: cover; border-radius: 18px; display: block; }
.gallery .ph { aspect-ratio: 1; overflow: hidden; border-radius: 18px; }
.gallery .ph.wide { grid-column: 1 / -1; aspect-ratio: 2 / 1; }
.dark { --ink: #fff; --muted: rgba(255,255,255,.75); --soft: rgba(255,255,255,.85); }
.dark .kicker { color: #f5ddc9; }

/* ============ master admin ============ */
body[data-page="admin"] .card { border-radius: 16px; }
body[data-page="admin"] .field { height: 48px; border-radius: 14px; padding: 0 16px; font-size: 14.5px; }
body[data-page="admin"] .cal-grid { gap: 5px; }
body[data-page="admin"] .cal-day {
  aspect-ratio: 1; border-radius: 12px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px; font-size: 13.5px; user-select: none;
}
body[data-page="admin"] .cal-day .sub { font-size: 8.5px; line-height: 1; }
body[data-page="admin"] .sheet { max-height: 85dvh; overflow-y: auto; }
.btn-small {
  cursor: pointer; font-size: 12.5px; color: #b05c43; border: 1px solid #efe0d7;
  background: #fff; border-radius: 999px; padding: 5px 14px; user-select: none;
}
.stepper { display: flex; align-items: center; gap: 2px; background: #fdf8f3; border: 1px solid #efe0d7; border-radius: 999px; padding: 3px; }
.stepper .b {
  cursor: pointer; width: 28px; height: 28px; border-radius: 50%; background: #fff;
  border: 1px solid #efe0d7; display: flex; align-items: center; justify-content: center;
  color: #b05c43; font-size: 15px; user-select: none;
}
.stepper .val { width: 56px; text-align: center; font-size: 13px; font-weight: 500; }
.tabbar {
  margin-top: auto; position: sticky; bottom: 0; z-index: 5;
  background: linear-gradient(transparent, #faf5f0 30%); padding: 10px 20px 24px;
}
.tabbar .inner { display: flex; background: #fff; border: 1px solid #f0e2d9; border-radius: 999px; padding: 5px; box-shadow: 0 6px 20px rgba(178,116,94,.14); }
.tabbar .tab {
  cursor: pointer; flex: 1; display: flex; align-items: center; justify-content: center;
  height: 42px; border-radius: 999px; font-size: 13.5px; color: #8a7367; user-select: none;
}
.tabbar .tab.on { background: #d99a82; color: #fff; font-weight: 500; }
.switch { cursor: pointer; flex: none; width: 42px; height: 25px; border-radius: 999px; background: #e8ddd3; position: relative; transition: background .18s; }
.switch.on { background: #d99a82; }
.switch .knob { position: absolute; top: 2.5px; left: 2.5px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); transition: left .18s; }
.switch.on .knob { left: 19.5px; }
.bg-swatch { cursor: pointer; width: 44px; height: 44px; border-radius: 14px; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.08); display: flex; align-items: center; justify-content: center; font: 8px ui-monospace,monospace; color: transparent; }
.bg-swatch.sel { border-color: #b05c43; box-shadow: 0 3px 10px rgba(176,92,67,.3); }
.pgrid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.pgrid .ph { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; }
.pgrid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pgrid .del {
  position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(255,253,251,.92); color: #a04e3a; display: flex; align-items: center;
  justify-content: center; font-size: 13px; cursor: pointer;
}
.section { display: flex; flex-direction: column; gap: 9px; }
.row-line { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f8f0e9; }

/* ============ landing ============ */
body[data-page="landing"] #app { padding-bottom: 40px; }
body[data-page="landing"] .kicker { letter-spacing: .16em; }
.step { display: flex; gap: 12px; align-items: flex-start; }
.step .n {
  flex: none; width: 26px; height: 26px; border-radius: 50%; background: #f7e8e0;
  color: #b05c43; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 500;
}
.step p { margin: 2px 0 0; font-size: 13.5px; color: #6f5f56; line-height: 1.5; }
