* { box-sizing: border-box; }
:root { --bg: #ffffff; --surface: #ffffff; --text: #020817; --muted: #64708a; --line: #edf0f5; --navy: #020817; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body { overflow-x: hidden; }
body { margin: 0; font-family: var(--font-ui); background: var(--bg); color: var(--text); line-height: normal; }
button, input, select, textarea { font-family: inherit; }
:focus:not(:focus-visible) { outline: none; }
body.moodboard-shell { min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
.moodboard-page { flex: 1; display: flex; flex-direction: column; }
.btn { display: inline-block; padding: 14px 22px; border-radius: 10px; font-size: 15px; text-decoration: none; }
.feature { background: #fff; border: 1px solid var(--line); padding: 24px; border-radius: 12px; }
.feature h3 { margin: 0 0 10px; }
.feature p { margin: 0; color: var(--muted); }
:root { --gap: 10px; --outer: 10px; --mb-rail-w: 25px; }
body.moodboard-shell { min-height: 100dvh; display: flex; flex-direction: column; }
.moodboard-page { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.hidden { display: none !important; }
#board { display: none; box-sizing: border-box; padding: var(--outer); flex-direction: column; gap: var(--gap); overflow: hidden; }
.row { display: flex; gap: var(--gap); width: 100%; align-items: stretch; justify-content: center; }
.item { overflow: hidden; border-radius: 10px; background: transparent; flex: 0 0 auto; cursor: grab; transition: opacity .15s ease, transform .15s ease, box-shadow .15s ease; }
.item.dragging { opacity: .35; transform: scale(.97); cursor: grabbing; }
.item.drag-over { box-shadow: 0 0 0 3px #6c47ff, 0 4px 24px rgba(108,71,255,.25); transform: scale(1.03); }
.item img { display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
#lightbox { position: fixed; inset: 0; z-index: 9999; display: none; align-items: center; justify-content: center; padding: 24px; box-sizing: border-box; background: rgba(0,0,0,0.55); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
#lightbox.open { display: flex; }
#lightboxInner { position: relative; max-width: min(92vw, 1400px); max-height: 90vh; border-radius: 14px; overflow: visible; box-shadow: none; background: transparent; transform: scale(0.98); opacity: 0; transition: transform .16s ease, opacity .16s ease; }
#lightbox.open #lightboxInner { transform: scale(1); opacity: 1; }
#lightboxContent { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0; box-sizing: border-box; }
#lightboxImg { display: block; width: 100%; height: 100%; max-width: min(92vw, 1400px); max-height: calc(90vh - 18px); object-fit: contain; background: transparent; border-radius: 4px; }
#lightboxCaption { font-size: 11px; line-height: 1.2; color: rgb(255 255 255 / 44%); text-align: center; letter-spacing: 0.01em; user-select: none; }
@media (max-width: 1024px) {
  :root { --gap: 8px; --outer: 8px; }
}
@media (max-width: 768px) {
  :root { --gap: 6px; --outer: 12px; }
  .row { justify-content: stretch; }
  .item { background: rgba(255,255,255,0.72); box-shadow: 0 10px 24px rgba(17, 6, 35, 0.08); border-radius: 8px; }
  .item img { object-fit: cover; }
  body.moodboard-fullscreen #board { height: auto; min-height: 100dvh; overflow-x: hidden; overflow-y: auto; padding-top: max(var(--outer), env(safe-area-inset-top)); padding-bottom: calc(20px + env(safe-area-inset-bottom)); align-items: stretch; justify-content: flex-start; overscroll-behavior-y: contain; }
  #lightbox { padding: 16px; }
  #lightboxImg { max-height: calc(90vh - 14px); }
}
@media (max-width: 480px) {
  :root { --gap: 5px; --outer: 10px; }
  body.moodboard-fullscreen #board { padding-left: 12px; padding-right: 12px; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .item { border-radius: 12px; }
  #lightbox { padding: 12px; }
  #lightboxImg { max-height: calc(88vh - 14px); }
  #lightboxCaption { font-size: 10px; }
}
@media (max-width: 360px) {
  :root { --gap: 4px; --outer: 8px; }
}
body.moodboard-fullscreen { overflow: hidden; }
body.moodboard-fullscreen .nav, body.moodboard-fullscreen .foot { display: none; }
body.moodboard-fullscreen #board { display: flex; height: 100vh; min-height: 100vh; padding-top: var(--outer); padding-bottom: var(--outer); }
.btn[disabled] { opacity: 0.6; cursor: default; }
.mb-rail { position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; display: none; width: var(--mb-rail-w); box-sizing: border-box; border-left: 1px solid rgba(0,0,0,0.18); background: #ffffff; transition: width 420ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 420ms ease; }
body.moodboard-fullscreen .mb-rail { display: block; }
.mb-rail.is-open { width: min(340px, calc(100vw - 48px)); box-shadow: -24px 0 70px rgba(15, 23, 42, 0.14); }
.mb-rail__toggle { position: absolute; top: 14px; right: 0; z-index: 2; width: var(--mb-rail-w); height: 46px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 0; background: transparent; box-shadow: none; cursor: pointer; }
.mb-rail.is-open .hamburger svg { transform: rotate(-45deg); }
.mb-rail.is-open .hamburger .line-top-bottom { stroke-dasharray: 20 300; stroke-dashoffset: -32.42; }
.mb-rail__panel { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 22px; padding: 74px 22px 28px; box-sizing: border-box; overflow-y: auto; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 220ms ease, visibility 220ms; }
.mb-rail.is-open .mb-rail__panel { opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 160ms; }
.mb-rail__nav { display: grid; gap: 4px; width: 100%; padding-top: 8px; border-top: 1px solid #edf0f5; }
.mb-rail__nav a { display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 14px; border-radius: 12px; font-size: 15px; font-weight: 700; color: #1e293b; text-align: center; }
.mb-rail__nav a:hover { background: #f8fafc; }
body.moodboard-fullscreen #board { padding-right: calc(var(--outer) + var(--mb-rail-w)); }
@media (min-width: 769px) {
  body.moodboard-fullscreen #board { justify-content: center; }
}

body.moodboard-shell { background: var(--sw-bg); color: var(--sw-ink); font-family: var(--font-ui); font-feature-settings: 'ss01', 'cv11'; -webkit-font-smoothing: antialiased; }

.mbx-start { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; max-width: 760px; margin: 0 auto; padding: 96px 24px 72px; text-align: center; }
.mbx-start__title { margin: 0; font-size: clamp(34px, 5vw, 58px); font-weight: 650; line-height: 1.05; letter-spacing: -0.04em; color: var(--sw-ink); }
.mbx-start__title span { font-weight: 350; color: var(--sw-muted); }
.mbx-start__text { max-width: 560px; margin: 0; font-size: 17px; line-height: 1.5; color: var(--sw-ink-2); }
.mbx-start__btn { display: inline-flex; align-items: center; gap: 10px; height: 54px; margin-top: 10px; padding: 0 28px; border: 0; border-radius: 999px; background: var(--sw-ink); color: #fff; font-family: var(--font-ui); font-size: 16px; font-weight: 600; letter-spacing: -0.01em; cursor: pointer; box-shadow: 0 14px 28px -18px rgba(42, 35, 32, .8); transition: transform .15s ease, box-shadow .15s ease; }
.mbx-start__btn:hover { transform: translateY(-1px); box-shadow: 0 18px 32px -18px rgba(42, 35, 32, .85); }
.mbx-start__btn svg, .mbx-panel__pick svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mbx-start__hint, .mbx-start__note { max-width: 560px; margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--sw-muted); }
.mbx-start__hint { margin-top: 26px; }
.mbx-start__note { display: block; max-width: none; }
.mbx-start__note svg { display: inline-block; width: 16px; height: 16px; margin-right: 8px; vertical-align: -3px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mbx-start.hidden, body.moodboard-fullscreen .mbx-start { display: none; }
body.moodboard-shell .foot { margin-top: 0; }

.mbx-panel__title { margin: 0; text-align: center; font-size: 20px; font-weight: 650; letter-spacing: -0.02em; color: var(--sw-ink); }
.mbx-panel__title span { font-weight: 350; color: var(--sw-muted); }
.mbx-panel__pick { flex: none; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 50px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--sw-ink); color: #fff; font-family: var(--font-ui); font-size: 15px; font-weight: 600; letter-spacing: -0.01em; cursor: pointer; box-shadow: 0 14px 28px -18px rgba(42, 35, 32, .8); }
.mbx-panel__nav { display: grid; gap: 2px; width: 100%; padding-top: 14px; border-top: 1px solid #ECE7E3; }
.mbx-panel__nav a { min-height: 0; justify-content: flex-start; text-align: left; display: flex; align-items: baseline; gap: 14px; padding: 11px 12px; border-radius: 12px; color: var(--sw-ink); text-decoration: none; font-size: 16px; font-weight: 500; letter-spacing: -0.01em; transition: background .2s ease; }
.mbx-panel__nav a:hover { background: #F7F5F2; }
.mbx-panel__nav a[aria-current="page"] { background: #ECE7E3; font-weight: 650; }
.mbx-panel__num { width: 20px; flex: none; font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--sw-muted); }

@media (max-width: 640px) {
  .mbx-start { padding: 56px 16px 40px; }
}
