/* ============================================================
   Chọn Ảnh — wedding photo culling & selection
   Design tokens + components. Warm, editorial, teal accent.
   Theme + accent + font + density are driven by JS (Tweaks).
   ============================================================ */

:root {
  /* accent is overwritten inline by Tweaks; default teal */
  --accent: oklch(0.55 0.085 205);
  --accent-soft: color-mix(in oklch, var(--accent) 14%, transparent);
  --accent-ink: color-mix(in oklch, var(--accent) 72%, black 12%);

  --font-display: "Lora", Georgia, serif;
  --font-ui: "Be Vietnam Pro", system-ui, sans-serif;

  --thumb: 220px;      /* grid cell min, driven by density */
  --radius: 14px;
  --radius-sm: 9px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---- Light (default) : warm champagne ---- */
:root,
[data-theme="light"] {
  --bg: oklch(0.972 0.008 78);
  --bg-2: oklch(0.955 0.011 76);
  --surface: oklch(0.995 0.004 85);
  --surface-2: oklch(0.978 0.008 80);
  --line: oklch(0.9 0.012 75);
  --line-strong: oklch(0.84 0.015 72);
  --ink: oklch(0.27 0.014 60);
  --ink-2: oklch(0.46 0.013 62);
  --ink-3: oklch(0.62 0.012 64);
  --shadow: 0 1px 2px oklch(0.4 0.02 60 / 0.06), 0 8px 24px oklch(0.4 0.02 60 / 0.07);
  --shadow-lg: 0 4px 12px oklch(0.35 0.02 60 / 0.1), 0 24px 60px oklch(0.35 0.02 60 / 0.16);
  --gold: oklch(0.78 0.09 78);
}

/* ---- Dark : deep warm charcoal ---- */
[data-theme="dark"] {
  --bg: oklch(0.205 0.008 62);
  --bg-2: oklch(0.185 0.008 62);
  --surface: oklch(0.245 0.009 64);
  --surface-2: oklch(0.285 0.01 66);
  --line: oklch(0.33 0.011 66);
  --line-strong: oklch(0.42 0.013 68);
  --ink: oklch(0.93 0.01 76);
  --ink-2: oklch(0.76 0.012 72);
  --ink-3: oklch(0.6 0.012 70);
  --shadow: 0 1px 2px oklch(0 0 0 / 0.3), 0 10px 28px oklch(0 0 0 / 0.4);
  --shadow-lg: 0 6px 16px oklch(0 0 0 / 0.4), 0 30px 70px oklch(0 0 0 / 0.55);
  --gold: oklch(0.8 0.1 80);
  --accent-soft: color-mix(in oklch, var(--accent) 22%, transparent);
  --accent-ink: color-mix(in oklch, var(--accent) 82%, white 14%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
}

#root { min-height: 100%; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }
::selection { background: var(--accent-soft); }

.serif { font-family: var(--font-display); font-weight: 500; letter-spacing: 0.01em; }

/* ===================== App shell ===================== */
.app { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px;
  padding: 0 26px; height: 66px;
  background: color-mix(in oklch, var(--surface) 86%, transparent);
  backdrop-filter: blur(18px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--accent), var(--accent-ink));
  color: #fff; box-shadow: var(--shadow);
}
.brand-name { font-family: var(--font-display); font-size: 24px; font-weight: 600; line-height: 1; letter-spacing: 0.005em; white-space: nowrap; }
.brand-sub { font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-3); margin-top: 2px; }

.topbar-spacer { flex: 1; }

.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-3); }
.breadcrumb button { color: var(--ink-2); border-radius: 6px; padding: 3px 7px; transition: 0.15s; }
.breadcrumb button:hover { color: var(--ink); background: var(--surface-2); }
.breadcrumb .crumb-current { color: var(--ink); font-weight: 600; }
.breadcrumb .sep { opacity: 0.5; }

/* role switch */
.role-switch {
  display: flex; align-items: center; gap: 2px; padding: 4px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
}
.role-switch button {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 15px; border-radius: 999px; font-size: 13px; font-weight: 600;
  color: var(--ink-3); transition: 0.18s var(--ease); white-space: nowrap;
}
.role-switch button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.role-switch button.on .ic { color: var(--accent); }

.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  color: var(--ink-2); border: 1px solid transparent; transition: 0.15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

/* ===================== Buttons ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 10px; font-size: 14px; font-weight: 600;
  transition: 0.16s var(--ease); white-space: nowrap; border: 1px solid transparent;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--accent-ink); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--line-strong); background: var(--surface-2); }
.btn-quiet { color: var(--ink-2); }
.btn-quiet:hover { background: var(--surface-2); color: var(--ink); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 46px; padding: 0 24px; font-size: 15px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===================== Main / page ===================== */
.main { flex: 1; }
.page { max-width: 1340px; margin: 0 auto; padding: 34px 26px 90px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.page-title { font-family: var(--font-display); font-size: 40px; font-weight: 600; line-height: 1.05; }
.page-sub { color: var(--ink-2); font-size: 15px; margin-top: 6px; }
.eyebrow { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: 10px; }

/* ===================== Project cards ===================== */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.project-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: 0.2s var(--ease); cursor: pointer;
  display: flex; flex-direction: column;
}
.project-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.project-cover { aspect-ratio: 16/10; position: relative; overflow: hidden; }
.project-cover .pc-mosaic { position: absolute; inset: 0; display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; }
.project-cover .pc-mosaic > div { background-size: cover; background-position: center; }
.project-cover .pc-mosaic > div:first-child { grid-row: 1 / 3; }
.project-cover .pc-veil { position: absolute; inset: 0; background: linear-gradient(to top, oklch(0.2 0.02 60 / 0.55), transparent 55%); }
.project-cover .pc-date {
  position: absolute; top: 12px; left: 12px; font-size: 11px; font-weight: 600;
  padding: 5px 10px; border-radius: 999px; color: #fff;
  background: oklch(0.2 0.02 60 / 0.4); backdrop-filter: blur(6px); letter-spacing: 0.04em;
}
.project-body { padding: 16px 18px 18px; }
.project-name { font-family: var(--font-display); font-size: 25px; font-weight: 600; line-height: 1.1; }
.project-meta { display: flex; align-items: center; gap: 14px; margin-top: 12px; font-size: 12.5px; color: var(--ink-3); }
.project-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); }
.project-progress { height: 5px; border-radius: 999px; background: var(--surface-2); margin-top: 14px; overflow: hidden; }
.project-progress > div { height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.4s var(--ease); }

.new-project-card {
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius);
  display: grid; place-items: center; min-height: 240px; color: var(--ink-3);
  background: var(--surface-2); transition: 0.18s; cursor: pointer; gap: 0;
}
.new-project-card:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.new-project-card .npc-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; font-weight: 600; font-size: 14px; }

/* ===================== Toolbar / filters ===================== */
.toolbar {
  position: sticky; top: 66px; z-index: 30;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 0; margin-bottom: 18px;
  background: color-mix(in oklch, var(--bg) 90%, transparent); backdrop-filter: blur(8px);
}
.seg {
  display: flex; align-items: center; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 3px; gap: 2px;
}
.seg button {
  display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 7px;
  font-size: 13px; font-weight: 600; color: var(--ink-3); transition: 0.15s;
}
.seg button.on { background: var(--surface-2); color: var(--ink); }
.seg button .count { font-size: 11px; color: var(--ink-3); font-weight: 700; }
.seg button.on .count { color: var(--accent); }

.field {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 13px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--ink-2);
}
.field input { border: none; outline: none; background: none; color: var(--ink); font-size: 14px; width: 170px; }
.field select { border: none; outline: none; background: none; color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; }
.spacer { flex: 1; }

.albums-strip { display: flex; align-items: center; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.album-chip {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 600;
  color: var(--ink-2); white-space: nowrap; transition: 0.15s;
}
.album-chip:hover { border-color: var(--line-strong); }
.album-chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.album-chip.on .album-count { color: var(--bg); opacity: 0.7; }
.album-chip .album-count { font-size: 11px; color: var(--ink-3); font-weight: 700; }

/* ===================== Photo grid ===================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--thumb), 1fr));
  gap: 16px;
}
.photo {
  position: relative; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--surface-2); aspect-ratio: 1; cursor: pointer;
  border: 1px solid var(--line); transition: 0.16s var(--ease);
  box-shadow: var(--shadow);
}
.photo:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.photo.sel-pick { outline: 2.5px solid var(--accent); outline-offset: -2.5px; }
.photo.sel-reject { opacity: 0.5; }
.photo.sel-reject img { filter: grayscale(0.7); }
.photo.sel-edit { outline: 2.5px solid var(--gold); outline-offset: -2.5px; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: 0.3s; }
.photo:hover img { transform: scale(1.04); }

.photo-grad { position: absolute; inset: 0; }
.photo-overlay {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, oklch(0.18 0.02 60 / 0.62) 0%, transparent 38%, transparent 70%, oklch(0.18 0.02 60 / 0.28) 100%);
  opacity: 0; transition: 0.18s;
}
.photo:hover .photo-overlay, .photo.has-marks .photo-overlay { opacity: 1; }

.photo-top { position: absolute; top: 9px; left: 9px; right: 9px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.photo-bottom { position: absolute; bottom: 9px; left: 9px; right: 9px; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; pointer-events: none; }
.photo-filename { font-size: 10.5px; color: #fff; opacity: 0.82; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }

.heart-btn {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: oklch(0.2 0.02 60 / 0.35); backdrop-filter: blur(6px); color: #fff;
  pointer-events: auto; transition: 0.16s var(--ease); opacity: 0; transform: scale(0.85);
}
.photo:hover .heart-btn, .heart-btn.liked { opacity: 1; transform: scale(1); }
.heart-btn:hover { background: oklch(0.2 0.02 60 / 0.55); }
.heart-btn.liked { color: oklch(0.62 0.2 18); background: #fff; }
.heart-btn.liked:hover { background: #fff; }

.idx-badge {
  font-size: 10px; font-weight: 800; color: #fff; padding: 3px 7px; border-radius: 999px;
  background: oklch(0.2 0.02 60 / 0.4); backdrop-filter: blur(6px); pointer-events: none;
  font-variant-numeric: tabular-nums; letter-spacing: 0.03em;
}

/* stars */
.stars { display: inline-flex; gap: 2px; pointer-events: auto; }
.stars.lg { gap: 5px; }
.star { color: oklch(1 0 0 / 0.55); transition: 0.12s; line-height: 0; }
.star.lit { color: var(--gold); }
.stars.interactive .star:hover { transform: scale(1.18); }
.stars-onlight .star { color: var(--line-strong); }
.stars-onlight .star.lit { color: var(--gold); }

/* status pills row */
.status-row { display: flex; gap: 5px; pointer-events: auto; }
.spill {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: oklch(0.2 0.02 60 / 0.4); backdrop-filter: blur(6px); color: #fff;
  transition: 0.14s; opacity: 0; transform: translateY(4px);
}
.photo:hover .spill, .photo.has-marks .spill { opacity: 1; transform: none; }
.spill:hover { background: oklch(0.2 0.02 60 / 0.6); }
.spill.on-pick { background: var(--accent); opacity: 1; transform: none; }
.spill.on-edit { background: var(--gold); color: oklch(0.3 0.05 70); opacity: 1; transform: none; }
.spill.on-reject { background: oklch(0.55 0.18 18); opacity: 1; transform: none; }

.corner-flag {
  position: absolute; top: 0; left: 0; width: 0; height: 0; pointer-events: none;
}
.corner-flag.pick { border-top: 34px solid var(--accent); border-right: 34px solid transparent; }
.corner-flag.edit { border-top: 34px solid var(--gold); border-right: 34px solid transparent; }
.corner-flag .ck { position: absolute; top: -31px; left: 4px; color: #fff; }

.note-dot {
  position: absolute; bottom: 9px; left: 9px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px var(--surface);
}

/* ===================== Empty / dropzone ===================== */
.dropzone {
  border: 2px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-2);
  padding: 56px 30px; text-align: center; transition: 0.18s var(--ease); cursor: pointer;
}
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.005); }
.dropzone .dz-ic { color: var(--accent); margin-bottom: 16px; }
.dropzone h3 { font-family: var(--font-display); font-size: 27px; font-weight: 600; }
.dropzone p { color: var(--ink-2); font-size: 14px; margin-top: 6px; }
.dropzone .dz-hint { font-size: 12px; color: var(--ink-3); margin-top: 14px; }

.empty {
  text-align: center; padding: 80px 20px; color: var(--ink-3);
}
.empty .em-ic { color: var(--line-strong); margin-bottom: 18px; }
.empty h3 { font-family: var(--font-display); font-size: 28px; color: var(--ink-2); font-weight: 600; }
.empty p { font-size: 14px; margin-top: 6px; }

/* upload progress tray */
.upload-tray {
  position: fixed; bottom: 22px; right: 22px; z-index: 60; width: 320px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.upload-tray-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 13.5px; }
.upload-row { display: flex; align-items: center; gap: 11px; padding: 10px 16px; }
.upload-thumb { width: 38px; height: 38px; border-radius: 7px; object-fit: cover; flex-shrink: 0; background: var(--surface-2); }
.upload-row .ur-name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-row .ur-bar { height: 4px; border-radius: 999px; background: var(--surface-2); margin-top: 5px; overflow: hidden; }
.upload-row .ur-bar > div { height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.2s linear; }
.upload-row .ur-ok { color: var(--accent); }

/* ===================== Modal ===================== */
.modal-scrim {
  position: fixed; inset: 0; z-index: 80; background: oklch(0.15 0.02 60 / 0.5);
  backdrop-filter: blur(5px); display: grid; place-items: center; padding: 24px;
  animation: fade 0.18s ease;
}
.modal {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-lg); width: 100%; max-width: 440px; overflow: hidden;
  animation: pop 0.22s var(--ease);
}
.modal-head { padding: 24px 26px 4px; }
.modal-head h2 { font-family: var(--font-display); font-size: 28px; font-weight: 600; }
.modal-head p { color: var(--ink-2); font-size: 14px; margin-top: 4px; }
.modal-body { padding: 18px 26px 4px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { padding: 20px 26px 24px; display: flex; gap: 10px; justify-content: flex-end; }

.input-group label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 7px; letter-spacing: 0.01em; }
.input-group input, .input-group textarea {
  width: 100%; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink); font-size: 14px; outline: none; transition: 0.15s;
}
.input-group input:focus, .input-group textarea:focus { border-color: var(--accent); background: var(--surface); }
.cover-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.cover-swatch { width: 40px; height: 40px; border-radius: 9px; cursor: pointer; border: 2px solid transparent; transition: 0.14s; }
.cover-swatch.on { border-color: var(--ink); transform: scale(1.06); }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(0.96) translateY(8px); } }

/* ===================== Lightbox ===================== */
.lightbox {
  position: fixed; inset: 0; z-index: 90; background: oklch(0.12 0.012 60 / 0.97);
  display: flex; flex-direction: column; animation: fade 0.2s ease; color: oklch(0.95 0.01 80);
}
.lb-bar { display: flex; align-items: center; gap: 16px; padding: 16px 22px; flex-shrink: 0; }
.lb-bar .lb-name { font-size: 13.5px; font-variant-numeric: tabular-nums; color: oklch(0.8 0.01 80); letter-spacing: 0.03em; }
.lb-bar .lb-meta { font-size: 12px; color: oklch(0.62 0.01 80); }
.lb-stage { flex: 1; display: flex; align-items: center; justify-content: center; position: relative; padding: 0 16px 8px; min-height: 0; }
.lb-img-wrap { position: relative; max-width: 100%; max-height: 100%; display: flex; }
.lb-img { max-width: 100%; max-height: calc(100vh - 200px); object-fit: contain; border-radius: 8px; box-shadow: 0 30px 90px rgba(0,0,0,0.6); }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%;
  background: oklch(0.3 0.01 60 / 0.5); backdrop-filter: blur(8px); display: grid; place-items: center;
  color: #fff; transition: 0.15s;
}
.lb-nav:hover { background: oklch(0.4 0.01 60 / 0.7); }
.lb-nav.prev { left: 22px; } .lb-nav.next { right: 22px; }
.lb-foot {
  flex-shrink: 0; display: flex; align-items: center; justify-content: center; gap: 22px;
  padding: 14px 22px 20px;
}
.lb-actions { display: flex; align-items: center; gap: 8px; }
.lb-act {
  display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 999px;
  background: oklch(0.26 0.01 60 / 0.7); color: oklch(0.92 0.01 80); font-size: 13.5px; font-weight: 600;
  transition: 0.15s; border: 1px solid oklch(0.4 0.01 60 / 0.5);
}
.lb-act:hover { background: oklch(0.34 0.01 60 / 0.8); }
.lb-act.on-pick { background: var(--accent); color: #fff; border-color: transparent; }
.lb-act.on-edit { background: var(--gold); color: oklch(0.3 0.05 70); border-color: transparent; }
.lb-act.on-reject { background: oklch(0.55 0.18 18); color: #fff; border-color: transparent; }
.lb-side {
  width: 320px; flex-shrink: 0; border-left: 1px solid oklch(0.3 0.01 60 / 0.5);
  padding: 20px; display: flex; flex-direction: column; gap: 18px; overflow-y: auto;
}
.lb-thumbs { display: flex; gap: 7px; padding: 10px 22px 16px; overflow-x: auto; justify-content: center; flex-shrink: 0; }
.lb-thumb { width: 54px; height: 54px; border-radius: 7px; object-fit: cover; opacity: 0.4; cursor: pointer; transition: 0.15s; flex-shrink: 0; border: 2px solid transparent; }
.lb-thumb:hover { opacity: 0.75; }
.lb-thumb.on { opacity: 1; border-color: var(--accent); }

/* notes / comments */
.note-block label { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: oklch(0.62 0.01 80); font-weight: 700; }
.note-input {
  width: 100%; margin-top: 8px; padding: 11px 13px; border-radius: 10px; resize: vertical; min-height: 70px;
  background: oklch(0.2 0.01 60 / 0.6); border: 1px solid oklch(0.36 0.01 60 / 0.6); color: oklch(0.92 0.01 80);
  font-size: 13.5px; outline: none;
}
.note-input:focus { border-color: var(--accent); }
.comment { padding: 11px 13px; border-radius: 10px; background: oklch(0.22 0.01 60 / 0.6); }
.comment .c-who { font-size: 12px; font-weight: 700; color: oklch(0.85 0.01 80); display: flex; align-items: center; gap: 7px; }
.comment .c-who .who-badge { font-size: 9.5px; padding: 2px 6px; border-radius: 5px; background: var(--accent); color: #fff; font-weight: 700; letter-spacing: 0.04em; }
.comment .c-text { font-size: 13px; color: oklch(0.8 0.01 80); margin-top: 5px; line-height: 1.45; }
.comment .c-time { font-size: 10.5px; color: oklch(0.55 0.01 80); margin-top: 4px; }

/* compare */
.compare { position: fixed; inset: 0; z-index: 90; background: oklch(0.12 0.012 60 / 0.98); display: flex; flex-direction: column; animation: fade 0.2s; }
.compare-stage { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 16px; min-height: 0; }
.compare-pane { position: relative; display: flex; align-items: center; justify-content: center; background: oklch(0.08 0.01 60); border-radius: 10px; overflow: hidden; }
.compare-pane img { max-width: 100%; max-height: 100%; object-fit: contain; }
.compare-pane .cp-tag { position: absolute; top: 14px; left: 14px; font-size: 12px; color: #fff; background: oklch(0.2 0.01 60 / 0.6); padding: 5px 11px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.compare-pane .cp-acts { position: absolute; bottom: 14px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; }

/* selection summary (client) */
.summary-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: color-mix(in oklch, var(--surface) 92%, transparent); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line); box-shadow: 0 -8px 30px oklch(0.3 0.02 60 / 0.08);
  padding: 14px 26px; display: flex; align-items: center; gap: 22px;
}
.summary-stat { display: flex; align-items: baseline; gap: 8px; }
.summary-stat .ss-num { font-family: var(--font-display); font-size: 30px; font-weight: 600; line-height: 1; }
.summary-stat .ss-lbl { font-size: 12.5px; color: var(--ink-2); }
.summary-stat .ss-num.pick { color: var(--accent); }
.summary-stat .ss-num.edit { color: var(--gold); }

/* toast */
.toast-wrap { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-lg);
  animation: toastin 0.25s var(--ease);
}
.toast .t-ic { color: var(--accent); }
@keyframes toastin { from { opacity: 0; transform: translateY(12px); } }

/* misc */
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.r2-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 600; color: var(--ink-3); padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.r2-pill .dot-live { width: 7px; height: 7px; border-radius: 50%; background: oklch(0.7 0.16 145); box-shadow: 0 0 0 3px oklch(0.7 0.16 145 / 0.2); }

.divider { height: 1px; background: var(--line); margin: 6px 0; }

/* keyboard hint */
kbd {
  font-family: var(--font-ui); font-size: 11px; font-weight: 700; line-height: 1;
  padding: 3px 6px; border-radius: 5px; background: var(--surface-2);
  border: 1px solid var(--line-strong); color: var(--ink-2); box-shadow: 0 1px 0 var(--line-strong);
}
.kbd-hint {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--ink-3); margin: -6px 0 18px; padding: 0 2px;
}
.lb-kbd {
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
  font-size: 11.5px; color: oklch(0.6 0.01 80); line-height: 1.9;
}
.lb-kbd kbd { background: oklch(0.26 0.01 60 / 0.7); border-color: oklch(0.42 0.01 60 / 0.6); color: oklch(0.84 0.01 80); box-shadow: none; }

/* ===================== Login ===================== */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-art { position: relative; background-size: cover; background-position: center; overflow: hidden; }
.login-art-veil { position: absolute; inset: 0; background: linear-gradient(140deg, oklch(0.2 0.03 60 / 0.55), oklch(0.2 0.03 60 / 0.25) 45%, oklch(0.45 0.06 205 / 0.35)); }
.login-art-inner { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: space-between; padding: 40px; }
.login-quote .serif { color: #fff; font-size: 52px; line-height: 1.08; font-weight: 600; text-shadow: 0 2px 20px rgba(0,0,0,0.3); }
.login-quote p { color: oklch(0.92 0.01 80 / 0.9); font-size: 16px; margin-top: 18px; max-width: 380px; }
.login-form { display: grid; place-items: center; padding: 40px 28px; background: var(--bg); }
.login-box { width: 100%; max-width: 400px; }
.login-box h1 { font-size: 38px; font-weight: 600; }
.login-sub { color: var(--ink-2); font-size: 15px; margin-top: 4px; margin-bottom: 26px; }
.login-tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 24px; }
.login-tabs button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--ink-3); transition: 0.16s; }
.login-tabs button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.login-tabs button.on svg { color: var(--accent); }
.login-fields { display: flex; flex-direction: column; gap: 16px; }
.login-err { display: flex; align-items: center; gap: 8px; font-size: 13px; color: oklch(0.55 0.18 18); font-weight: 600; }
.login-demo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); }
.code-chip { font-family: var(--font-ui); font-size: 12px; font-weight: 700; letter-spacing: 0.1em; padding: 6px 11px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); transition: 0.14s; }
.code-chip:hover { border-color: var(--accent); color: var(--accent); }
.login-note { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; margin-top: 4px; }

/* ===================== User chip ===================== */
.user-chip-wrap { position: relative; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 5px 8px 5px 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); transition: 0.15s; }
.user-chip:hover { border-color: var(--line-strong); }
.uc-text { text-align: left; line-height: 1.15; }
.uc-name { font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.uc-role { font-size: 11px; color: var(--ink-3); }
.uc-backdrop { position: fixed; inset: 0; z-index: 60; }
.uc-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 61; width: 240px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 14px; animation: pop 0.16s var(--ease); }
.uc-menu-head { display: flex; align-items: center; gap: 11px; }
.uc-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 10px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--ink); transition: 0.14s; }
.uc-item:hover { background: var(--surface-2); }

/* ===================== Share / access modal ===================== */
.share-code { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; border-radius: 12px; background: var(--accent-soft); border: 1px solid color-mix(in oklch, var(--accent) 30%, transparent); }
.sc-label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-ink); font-weight: 700; }
.sc-code { font-family: var(--font-ui); font-size: 26px; font-weight: 800; letter-spacing: 0.16em; color: var(--ink); margin-top: 4px; }
.guest-list { display: flex; flex-direction: column; gap: 6px; max-height: 200px; overflow-y: auto; }
.guest-row { display: flex; align-items: center; gap: 11px; padding: 8px 6px; border-radius: 10px; }
.guest-row:hover { background: var(--surface-2); }
.gr-name { font-size: 13.5px; font-weight: 600; }
.gr-email { font-size: 12px; color: var(--ink-3); }
.invite-row { display: flex; gap: 8px; margin-top: 12px; }
.invite-row input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font-size: 13.5px; outline: none; }
.invite-row input:focus { border-color: var(--accent); background: var(--surface); }
.invite-row .btn { flex-shrink: 0; padding: 0 14px; }

/* ===================== Responsive ===================== */
.lb-main { flex: 1; display: flex; min-height: 0; }

@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
}

@media (max-width: 860px) {
  .lb-main { flex-direction: column; }
  .lb-side { display: flex; width: auto; border-left: none; border-top: 1px solid oklch(0.3 0.01 60 / 0.5); max-height: 44vh; }
  .lb-img { max-height: 42vh; }
  .lb-thumbs { display: none; }
  .lb-nav { width: 42px; height: 42px; }
  .lb-bar .lb-act { padding: 0 12px; }
  .compare-stage { gap: 2px; padding: 10px; }
  .compare-pane .cp-acts { flex-wrap: wrap; bottom: 8px; }
}

@media (max-width: 720px) {
  .topbar { padding: 0 14px; gap: 8px; height: 60px; }
  .brand-sub { display: none; }
  .brand-name { font-size: 22px; }
  .page { padding: 20px 14px 90px; }
  .page-head { gap: 14px; }
  .page-title { font-size: 28px; }
  .uc-text { display: none; }
  .user-chip { padding: 4px; }
  .project-grid { grid-template-columns: 1fr; gap: 16px; }
  .toolbar { top: 60px; gap: 8px; padding: 12px 0; }
  .toolbar .seg { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
  .toolbar .seg::-webkit-scrollbar { display: none; }
  .toolbar .seg { scrollbar-width: none; }
  .spacer { display: none; }
  .field input { width: 120px; }
  .albums-strip { -webkit-overflow-scrolling: touch; }
  .summary-bar { padding: 10px 14px; gap: 14px; }
  .summary-bar .summary-stat .ss-num { font-size: 24px; }
  .summary-bar > span { display: none; }
  .summary-bar .btn span, .summary-bar .btn { font-size: 13px; }
  .login-box h1 { font-size: 32px; }
  .login-quote .serif { font-size: 38px; }
  .modal { max-width: 100% !important; }
  .lb-bar { padding: 12px 14px; gap: 10px; }
  .page-head .btn-lg { height: 42px; padding: 0 16px; font-size: 14px; }
}

@media (max-width: 420px) {
  .page-title { font-size: 24px; }
  .grid { gap: 10px; }
  .summary-stat .ss-lbl { display: none; }
  .invite-row { flex-wrap: wrap; }
  .invite-row input { flex: 1 1 100%; }
}

@media (max-width: 720px) {
  .brand-mark { width: 30px; height: 30px; }
}
