:root {
  --accent: #b8895a;
  --bg: #ffffff;
  --ink: #1c1a17;
  --muted: #8a8378;
  --line: #e7e2d8;
  --card: #faf8f4;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius: 14px;
  --shadow: 0 10px 40px rgba(40, 30, 20, 0.08);
  --nav-font-size: 13px;
  --header-height: 62px;
  --header-bg: rgba(255,255,255,0.9);
  --header-logo-size: 30px;
  --nav-font-family: var(--sans);
}

* { box-sizing: border-box; }
/* Ensure the hidden attribute always wins over author display rules
   (e.g. .modal-host { display:flex } would otherwise override [hidden]). */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Login ---------- */
.login-screen {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: var(--login-bg, #f4f1ec);
  background-size: cover; background-position: center;
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 380px; background: rgba(255,255,255,0.92);
  backdrop-filter: blur(6px); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 40px 34px; box-shadow: var(--shadow);
  text-align: center;
}
.login-logo { height: 54px; margin: 0 auto 14px; object-fit: contain; }
.login-brand { font-family: var(--serif); font-size: 44px; letter-spacing: 0.12em; margin: 0; font-weight: 600; }
.login-slogan { font-family: var(--serif); font-size: 21px; margin: 10px 0 4px; color: var(--ink); }
.login-intro { color: var(--muted); font-size: 14px; margin: 0 0 24px; }
.login-intro p { margin: 0; }
.login-intro p + p { margin-top: var(--intro-para-spacing, 14px); }
.login-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.login-form label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.login-form input {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 15px;
  background: #fff; color: var(--ink);
}
.login-form input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.login-foot { margin-top: 22px; font-size: 11px; color: var(--muted); letter-spacing: 0.04em; }

.btn-primary {
  background: var(--accent); color: #fff; border: none; padding: 13px 18px;
  border-radius: 10px; font-size: 15px; font-weight: 500; letter-spacing: 0.02em;
  transition: opacity 0.2s, transform 0.1s;
}
.btn-primary:hover { opacity: 0.92; }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost { background: transparent; border: 1px solid var(--line); padding: 11px 16px; border-radius: 10px; color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.form-error { color: #c0392b; font-size: 13px; margin: 4px 0 0; }

/* ---------- App shell ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: 8px 30px; background: var(--header-bg, rgba(255,255,255,0.9)); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); min-height: var(--header-height, 62px);
}
.topbar[data-nav-align="between"] { justify-content: space-between; }
.topbar[data-nav-align="center"] { justify-content: center; gap: 30px; }
.topbar[data-nav-align="center"] .tb-side { flex: 0 0 auto; }
.topbar[data-nav-align="left"] { justify-content: flex-start; }
.topbar[data-nav-align="right"] { justify-content: flex-end; }
.tb-side { display: flex; align-items: center; gap: 18px; flex: 1 1 0; min-width: 0; }
.tb-center { flex: 0 0 auto; justify-content: center; }
.tb-right { justify-content: flex-end; }
.topbar-logo { height: var(--header-logo-size, 30px); width: auto; object-fit: contain; flex: 0 0 auto; }
.nav { display: flex; align-items: center; gap: 22px; margin-top: var(--nav-margin-top, 0); }
.nav-link { font-size: var(--nav-font-size, 13px); font-family: var(--nav-font-family, var(--sans)); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); position: relative; padding: 4px 0; }
.nav-link:hover { color: var(--ink); }
.nav-link.active { color: var(--ink); }
.nav-link.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--accent); }
.badge { background: var(--accent); color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 7px; margin-left: 4px; }
.nav-logout { background: none; border: none; color: var(--muted); font-size: var(--nav-font-size, 13px); font-family: var(--nav-font-family, var(--sans)); letter-spacing: 0.06em; text-transform: uppercase; }
.nav-logout:hover { color: var(--ink); }
/* Clickable affordance: links, buttons, menus, cards → pointer (hand) cursor. */
a, button, .nav-link, .nav-logout, .card, .picked-card, .thumb, .swatch, .remove-btn, .note-add, .ilink, .tag, .enq-item, .badge, [data-go], [data-nav] { cursor: pointer; }
[data-full] { cursor: zoom-in; }

.view { flex: 1; padding: 34px 30px 60px; max-width: 1280px; width: 100%; margin: 0 auto; }
.appfoot { text-align: center; padding: 22px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); }

/* ---------- Timeline / catalog ---------- */
.section-title { font-family: var(--serif); font-size: 30px; margin: 0 0 4px; font-weight: 600; }
.section-sub { color: var(--muted); font-size: 14px; margin: 0 0 28px; }

.weekly {
  margin-bottom: 56px; padding-top: 20px; border-top: 1px solid var(--line);
}
.weekly:first-child { border-top: none; padding-top: 0; }
.weekly-head { position: sticky; top: var(--header-height, 64px); z-index: 15; background: var(--bg); display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.weekly-title { font-family: var(--serif); font-size: 26px; margin: 0; font-weight: 600; }
.weekly-cats { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-end; margin-left: auto; gap: 10px; }
.weekly-cat { font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); position: relative; padding: 1px 0; }
.weekly-cat:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.cat-block { margin-bottom: 26px; scroll-margin-top: calc(var(--header-height, 64px) + 66px); }
.cat-label { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin: 0 0 12px; font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: transform 0.18s, box-shadow 0.18s; cursor: pointer;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-img { aspect-ratio: 3/4; background: linear-gradient(135deg, #efe9df, #e3dccd); display: flex; align-items: center; justify-content: center; color: var(--muted); font-family: var(--serif); font-size: 22px; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-cap { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 8px 12px 4px; }
.card-cover { position: relative; aspect-ratio: 3/4; background: linear-gradient(135deg, #efe9df, #e3dccd); overflow: hidden; }
.card-detail { aspect-ratio: 4/3; background: linear-gradient(135deg, #efe9df, #e3dccd); overflow: hidden; }
.card-cover img, .card-detail img { width: 100%; height: 100%; object-fit: cover; }
.card-empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-family: var(--serif); font-size: 16px; }
.card-pick {
  position: absolute; right: 10px; bottom: 10px; background: var(--accent); color: #fff; border: none;
  border-radius: 22px; padding: 7px 14px; font-size: 12px; letter-spacing: 0.03em; font-family: var(--sans);
  opacity: 0; transform: translateY(8px); transition: opacity 0.2s, transform 0.2s; pointer-events: none;
  box-shadow: 0 4px 14px rgba(40,30,20,0.25);
}
.card:hover .card-pick { opacity: 1; transform: translateY(0); pointer-events: auto; }
/* picked state — kept visible so the user sees the confirmation without re-hovering */
.card-pick.picked, .card-pick:disabled { opacity: 1; transform: translateY(0); pointer-events: auto; background: #2e7d32; cursor: default; }
.card-cap { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 8px 12px 4px; }
.card-cap.center { text-align: center; }
.card-body { padding: 12px 14px 14px; }
.card-no { font-size: 11px; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
.card-name { font-size: 15px; font-weight: 500; margin: 2px 0 0; }

/* ---------- Style detail modal ---------- */
.modal-host { position: fixed; inset: 0; background: rgba(28,26,23,0.55); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; z-index: 50; }
.modal {
  background: #fff; border-radius: var(--radius); width: 100%; max-width: 920px; box-shadow: var(--shadow);
  display: grid; grid-template-columns: 1.1fr 1fr; overflow: hidden;
}
/* Stacked detail layout: large side-by-side images on top, info below. */
.modal-stack { grid-template-columns: 1fr; width: fit-content; max-width: 96vw; }
.modal-media { background: #fff; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.modal-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal-big { display: flex; flex-direction: column; max-width: 500px; }
.modal-big img { width: 100%; height: auto; max-height: 74vh; object-fit: contain; border-radius: 10px; background: #fff; cursor: zoom-in; }
.modal-big .card-img { aspect-ratio: 3/4; border-radius: 10px; font-size: 18px; background: #fff; }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.thumb { aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #e7e0d3; cursor: pointer; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.modal-info { padding: 30px 30px 26px; display: flex; flex-direction: column; }
.modal-info h2 { font-family: var(--serif); font-size: 28px; margin: 0 0 2px; }
.modal-no { color: var(--muted); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 16px; }
.label { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 16px 0 6px; }
.note-area { width: 100%; min-height: 130px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-family: inherit; font-size: 14px; resize: vertical; }
.color-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.modal-actions { margin-top: auto; padding-top: 18px; display: flex; gap: 10px; justify-content: space-between; align-items: center; }
.picked-flag { color: var(--accent); font-size: 13px; letter-spacing: 0.04em; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 120; background: rgba(20,18,15,0.92);
  display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out;
}
.lightbox img { max-width: 96vw; max-height: 96vh; object-fit: contain; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }

/* ---------- Picked list ---------- */
.picked-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; margin-bottom: 36px; }
.picked-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.picked-card .card-img { aspect-ratio: 3/4; }
.picked-card .card-body { padding: 10px 12px; }
.note-mini { font-size: 12px; color: var(--muted); margin-top: 4px; min-height: 16px; }
.remove-btn { margin-top: 8px; font-size:12px; color: #c0392b; background: none; border: none; padding: 0; }
/* "Add note" inside picked cards: same muted text look as note-mini, but clickable. */
.note-add { color: var(--accent); }
.note-add:hover { text-decoration: underline; text-underline-offset: 2px; }

.contact-form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; max-width: 640px; }
.contact-form h3 { font-family: var(--serif); font-size: 22px; margin: 0 0 16px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.field input, .field textarea { padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; font-family: inherit; font-size: 14px; }
.field textarea { min-height: 90px; resize: vertical; }
.field .req { color: #c0392b; margin-left: 2px; }
.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sync-note { font-size: 12px; color: var(--muted); margin-top: 10px; }
#c-message, #enq-message { min-height: 150px; }
.empty { color: var(--muted); text-align: center; padding: 60px 0; font-family: var(--serif); font-size: 22px; }

/* Enquiry page */
.enq-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.enq-item { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.enq-item .preview, .enq-thumb { width: 46px; height: 58px; object-fit: cover; border-radius: 6px; flex: none; }
.enq-thumb { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#efe9df,#e3dccd); color: var(--muted); font-size: 11px; text-align: center; }
.enq-item b { font-size: 14px; }
.ilink { color: var(--accent); text-decoration: underline; }
.modal-desc { color: var(--ink); font-size: 14px; line-height: 1.6; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.modal-desc p { margin: 0 0 8px; }
.modal-desc ul, .modal-desc ol { padding-left: 20px; margin: 0 0 8px; }
.modal-desc a { color: var(--accent); }
.preview { max-height: 70px; border-radius: 6px; }

/* ---------- Account ---------- */
.account-wrap { max-width: 560px; }
.account-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; margin-bottom: 22px; }
.account-card h3 { font-family: var(--serif); font-size: 22px; margin: 0 0 16px; }
.danger { border-color: #e6c9c2; }
.danger h3 { color: #c0392b; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 5px 15px; border-radius: 30px; font-size: 14px;
  z-index: 100; box-shadow: var(--shadow); animation: pop 0.25s ease;
  width: -webkit-fit-content; width: fit-content; max-width: 90vw;
}
@keyframes pop { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .modal { grid-template-columns: 1fr; }
  .modal-media { padding: 16px; }
  .modal-pair { grid-template-columns: 1fr; }
  .modal-big img { height: auto; max-height: 72vh; }
  .view { padding: 24px 18px 40px; }
  .topbar { padding: 8px 16px; flex-wrap: wrap; gap: 8px 16px; justify-content: center; }
  .tb-side { flex: 0 0 auto !important; justify-content: center; }
  .tb-center { order: -1; width: 100%; }
  .nav { gap: 14px; flex-wrap: wrap; }
  .nav-logout { font-size: 12px; }
}
@media (max-width: 560px) {
  .nav-link { font-size: 11px; letter-spacing: 0.03em; }
  .form-2col { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .login-card { padding: 32px 22px; }
}
