:root {
  --forest: #142f28;
  --forest-2: #1d473a;
  --sage: #657b70;
  --mint: #e6eee9;
  --gold: #c79a45;
  --gold-soft: #f5e7c8;
  --cream: #f8f5ed;
  --paper: #fffdf9;
  --ink: #26332d;
  --muted: #6b7670;
  --line: #e1ddd4;
  --red: #a54944;
  --shadow: 0 18px 42px rgba(20, 47, 40, .1);
  --soft-shadow: 0 7px 22px rgba(20, 47, 40, .07);
}

* { box-sizing: border-box; }
html { background: var(--cream); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--cream); font-family: Inter, "Segoe UI", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
.loading-screen { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); }
.brand-round { width: 62px; height: 62px; display: grid; place-items: center; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold); font-family: Georgia, serif; font-size: 15px; letter-spacing: 1px; }

.auth-layout { min-height: 100dvh; display: grid; grid-template-columns: minmax(320px, 520px) 1fr; }
.auth-panel { position: relative; z-index: 2; display: flex; flex-direction: column; justify-content: center; padding: 56px clamp(24px, 6vw, 78px); background: var(--paper); box-shadow: 18px 0 42px rgba(20,47,40,.08); }
.auth-art { position: relative; min-height: 360px; overflow: hidden; background: linear-gradient(135deg, rgba(20,47,40,.17), rgba(20,47,40,.82)), url('/assets/photos/games-room.jpg') center/cover; }
.auth-art::before { content: ""; position: absolute; inset: 28px; border: 1px solid rgba(245,231,200,.62); }
.auth-art-copy { position: absolute; left: clamp(34px, 6vw, 88px); right: clamp(34px, 6vw, 88px); bottom: clamp(42px, 8vw, 100px); color: white; }
.auth-art-copy p { max-width: 560px; color: rgba(255,255,255,.77); font-size: 17px; line-height: 1.6; }
.auth-art-copy h2 { max-width: 650px; margin: 0; font-family: Georgia, serif; font-size: clamp(38px, 5vw, 70px); font-weight: 400; line-height: 1.02; }
.brand-lockup { display: flex; align-items: center; gap: 12px; margin-bottom: 42px; color: var(--forest); }
.brand-lockup .brand-round { width: 50px; height: 50px; }
.brand-lockup strong { display: block; font-family: Georgia, serif; font-size: 22px; font-weight: 500; }
.brand-lockup small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: 1.6px; text-transform: uppercase; }
.eyebrow { margin: 0 0 10px; color: var(--gold); font-size: 11px; font-weight: 800; letter-spacing: 1.8px; text-transform: uppercase; }
.auth-panel h1 { margin: 0; color: var(--forest); font-family: Georgia, serif; font-size: 42px; font-weight: 400; line-height: 1.05; }
.auth-intro { margin: 13px 0 28px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field > span { color: #4f5d56; font-size: 12px; font-weight: 750; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid var(--line); border-radius: 13px; outline: 0; color: var(--ink); background: white; box-shadow: 0 1px 0 rgba(20,47,40,.02); }
.field input, .field select { min-height: 48px; padding: 0 14px; }
.field textarea { min-height: 104px; padding: 12px 14px; line-height: 1.55; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(199,154,69,.13); }
.field-note { margin: -8px 0 16px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.error-message { min-height: 20px; margin: 8px 0; color: var(--red); font-size: 12px; }

.primary-button, .secondary-button, .quiet-button, .danger-button, .icon-button, .upload-button {
  min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 17px; border: 0; border-radius: 12px; font-weight: 800; text-decoration: none;
}
.primary-button { color: white; background: var(--forest); }
.primary-button:hover { background: var(--forest-2); }
.secondary-button { color: var(--forest); border: 1px solid var(--line); background: var(--paper); }
.quiet-button { color: var(--sage); background: transparent; }
.danger-button { min-height: 38px; padding-inline: 11px; color: var(--red); background: #f9e9e7; font-size: 11px; }
.icon-button { width: 38px; min-height: 38px; padding: 0; color: var(--forest); border: 1px solid var(--line); background: white; }
.upload-button { color: var(--forest); border: 1px dashed var(--gold); background: #fffaf0; }
.wide { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }

.app-header { position: sticky; z-index: 30; top: 0; min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 max(20px, calc((100vw - 1320px) / 2)); border-bottom: 1px solid rgba(225,221,212,.85); background: rgba(255,253,249,.94); backdrop-filter: blur(16px); }
.app-header .brand-lockup { margin: 0; }
.app-header .brand-round { width: 42px; height: 42px; font-size: 11px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-email { margin-right: 6px; color: var(--muted); font-size: 11px; }
.dashboard { max-width: 1320px; margin: 0 auto; padding: 46px 24px 80px; }
.dashboard-intro { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 28px; }
.dashboard-intro h1 { margin: 0; color: var(--forest); font-family: Georgia, serif; font-size: clamp(38px, 5vw, 58px); font-weight: 400; }
.dashboard-intro p:last-child { max-width: 620px; margin: 12px 0 0; color: var(--muted); line-height: 1.6; }
.summary-pill { flex: 0 0 auto; padding: 11px 15px; border-radius: 999px; color: var(--forest); background: var(--mint); font-size: 12px; font-weight: 800; }
.property-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.property-card { overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--paper); box-shadow: var(--soft-shadow); }
.property-cover { position: relative; height: 188px; display: flex; align-items: end; padding: 18px; color: white; background: linear-gradient(145deg, var(--forest), #406255); background-position: center; background-size: cover; }
.property-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 25%, rgba(12,35,28,.78)); }
.property-cover > * { position: relative; z-index: 1; }
.status-badge { position: absolute; z-index: 2; top: 14px; right: 14px; padding: 7px 10px; border-radius: 999px; color: var(--forest); background: rgba(255,253,249,.92); font-size: 9px; font-weight: 900; letter-spacing: .9px; text-transform: uppercase; }
.status-badge.draft { color: #76531d; background: #fff3d9; }
.property-cover h2 { margin: 0; font-family: Georgia, serif; font-size: 29px; font-weight: 400; }
.property-cover p { margin: 5px 0 0; color: rgba(255,255,255,.78); font-size: 12px; }
.property-meta { padding: 18px; }
.property-meta-row { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 18px; color: var(--muted); font-size: 11px; }
.property-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.property-actions .primary-button, .property-actions .secondary-button { min-height: 44px; padding-inline: 10px; font-size: 12px; }
.property-actions .single { grid-column: 1 / -1; }

.editor-shell { max-width: 1500px; margin: 0 auto; padding: 26px 24px 88px; }
.editor-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.editor-title { display: flex; align-items: center; gap: 14px; }
.editor-title h1 { margin: 0; color: var(--forest); font-family: Georgia, serif; font-size: 34px; font-weight: 400; }
.editor-title p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.editor-status { display: inline-flex; align-items: center; gap: 7px; margin-left: 8px; color: var(--sage); font-size: 11px; }
.editor-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.editor-status.saved::before { background: #4f8d65; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 24px; align-items: start; }
.editor-form { display: grid; gap: 16px; }
.editor-panel { padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); box-shadow: var(--soft-shadow); }
.panel-head { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.panel-head h2 { margin: 0; color: var(--forest); font-family: Georgia, serif; font-size: 24px; font-weight: 500; }
.panel-head p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.three-fields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.colour-field input { padding: 5px; }

.photo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.photo-card { position: relative; min-height: 142px; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--cream); }
.photo-card img { width: 100%; height: 142px; object-fit: cover; }
.photo-card::after { content: ""; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, rgba(12,35,28,.82)); pointer-events: none; }
.photo-label { position: absolute; z-index: 2; left: 9px; right: 9px; bottom: 8px; display: flex; justify-content: space-between; align-items: end; gap: 6px; color: white; }
.photo-label span { min-width: 0; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.photo-tools { display: flex; gap: 4px; }
.photo-tools button { width: 29px; height: 29px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; color: var(--forest); background: rgba(255,253,249,.94); font-size: 13px; }
.hero-chip { position: absolute; z-index: 2; top: 9px; left: 9px; padding: 6px 8px; border-radius: 999px; color: var(--forest); background: var(--gold-soft); font-size: 8px; font-weight: 900; text-transform: uppercase; }
.empty-state { padding: 28px 18px; border: 1px dashed var(--line); border-radius: 15px; color: var(--muted); background: var(--cream); text-align: center; font-size: 12px; line-height: 1.55; }

.section-editor-list { display: grid; gap: 11px; }
.section-editor { border: 1px solid var(--line); border-radius: 16px; background: white; }
.section-editor summary { min-height: 58px; display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; color: var(--forest); cursor: pointer; list-style: none; }
.section-editor summary::-webkit-details-marker { display: none; }
.section-number { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: var(--forest); background: var(--mint); font-size: 11px; font-weight: 900; }
.section-number.section-emoji { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-size: 18px; font-weight: 400; line-height: 1; }
.section-summary strong { display: block; font-family: Georgia, serif; font-size: 17px; font-weight: 500; }
.section-summary small { display: block; max-width: 520px; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.section-controls { display: flex; gap: 5px; }
.section-body { padding: 4px 14px 15px 56px; border-top: 1px solid var(--line); }
.section-body .button-row { justify-content: flex-end; }

.preview-column { position: sticky; top: 90px; }
.preview-label { display: flex; justify-content: space-between; align-items: center; margin: 0 2px 10px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.phone-frame { width: 100%; overflow: hidden; border: 9px solid #1d2723; border-radius: 34px; background: var(--cream); box-shadow: 0 24px 55px rgba(20,47,40,.2); }
.phone-notch { width: 112px; height: 20px; margin: 0 auto -20px; border-radius: 0 0 16px 16px; background: #1d2723; }
.phone-screen { position: relative; height: min(720px, calc(100dvh - 160px)); min-height: 580px; overflow: auto; background: var(--cream); scrollbar-width: none; }
.phone-screen::-webkit-scrollbar { display: none; }
.preview-top { min-height: 54px; display: flex; align-items: center; padding: 0 16px; color: var(--preview-theme, var(--forest)); background: rgba(255,253,249,.96); font-family: Georgia, serif; font-size: 16px; }
.preview-hero { min-height: 280px; display: flex; align-items: end; padding: 58px 18px 66px; color: white; background: linear-gradient(180deg, rgba(12,35,28,.04), rgba(12,35,28,.9)), var(--preview-image, linear-gradient(140deg, #48695c, #173d31)); background-position: center; background-size: cover; }
.preview-hero .eyebrow { color: var(--gold-soft); }
.preview-hero h2 { margin: 0; font-family: Georgia, serif; font-size: 39px; font-weight: 400; line-height: .98; }
.preview-hero p:last-child { margin: 11px 0 0; color: rgba(255,255,255,.84); font-size: 12px; line-height: 1.5; }
.preview-info { position: relative; z-index: 2; margin: -44px 13px 0; padding: 14px; border-radius: 17px; background: white; box-shadow: var(--shadow); }
.preview-times { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.preview-times span { padding: 10px; border-radius: 11px; color: var(--preview-theme, var(--forest)); background: var(--cream); font-size: 10px; }
.preview-times strong { display: block; margin-top: 3px; font-family: Georgia, serif; font-size: 15px; }
.preview-address { margin-top: 11px; padding-top: 11px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.45; }
.preview-guide { padding: 25px 14px 90px; }
.preview-guide h3 { margin: 0 0 13px; color: var(--preview-theme, var(--forest)); font-family: Georgia, serif; font-size: 25px; font-weight: 500; }
.preview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.preview-tile { min-height: 116px; display: flex; flex-direction: column; align-items: start; justify-content: space-between; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.preview-emoji { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: color-mix(in srgb, var(--preview-theme, var(--forest)) 10%, white); font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-size: 19px; line-height: 1; }
.preview-tile strong { color: var(--preview-theme, var(--forest)); font-family: Georgia, serif; font-size: 14px; font-weight: 500; line-height: 1.15; }
.preview-nav { position: absolute; left: 0; right: 0; bottom: 0; min-height: 62px; display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; color: var(--preview-theme, var(--forest)); border-top: 1px solid var(--line); background: rgba(255,253,249,.96); font-size: 9px; font-weight: 800; text-align: center; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 22px; max-width: calc(100% - 32px); padding: 12px 17px; border-radius: 999px; color: white; background: var(--forest); box-shadow: var(--shadow); font-size: 12px; opacity: 0; pointer-events: none; transform: translate(-50%, 14px); transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
:focus-visible { outline: 3px solid rgba(199,154,69,.42); outline-offset: 3px; }

@media (max-width: 1050px) {
  .property-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor-layout { grid-template-columns: minmax(0, 1fr) 350px; }
  .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-panel { min-height: 100dvh; }
  .header-email { display: none; }
  .dashboard { padding: 32px 16px 72px; }
  .property-grid { grid-template-columns: 1fr; }
  .editor-shell { padding: 18px 14px 76px; }
  .editor-toolbar { align-items: start; }
  .editor-layout { display: flex; flex-direction: column; }
  .preview-column { position: static; width: min(100%, 390px); order: -1; align-self: center; }
  .phone-screen { height: 640px; }
}

@media (max-width: 560px) {
  .app-header { min-height: 62px; padding: 0 12px; }
  .app-header .brand-lockup small { display: none; }
  .app-header .brand-lockup strong { font-size: 18px; }
  .header-actions .quiet-button { padding-inline: 9px; font-size: 11px; }
  .dashboard-intro { align-items: start; flex-direction: column; gap: 14px; }
  .dashboard-intro h1 { font-size: 40px; }
  .editor-toolbar { flex-direction: column; }
  .editor-toolbar > .button-row { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .editor-toolbar > .button-row > * { width: 100%; }
  .two-fields, .three-fields { grid-template-columns: 1fr; gap: 0; }
  .editor-panel { padding: 17px; }
  .panel-head { flex-direction: column; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-editor summary { grid-template-columns: 32px minmax(0, 1fr); }
  .section-controls { grid-column: 1 / -1; justify-content: flex-end; }
  .section-body { padding: 13px; }
  .phone-frame { border-width: 7px; border-radius: 29px; }
  .phone-screen { height: 500px; min-height: 500px; }
}
