/* Photoalbumz — album designer */
:root {
  --bg: #efebe5;
  --panel: #ffffff;
  --panel-2: #f8f6f2;
  --ink: #1f1b16;
  --muted: #7a7066;
  --line: #e6e0d8;
  --accent: #c2573a;
  --accent-ink: #ffffff;
  --gold: #b08d57;
  --primary: #1f1b16;
  --sel: #2f7df6;
  --danger: #c0392b;
  --radius: 10px;
  --left-w: 272px;
  --right-w: 320px;
  --top-h: 58px;
  --pagebar-h: 150px;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); overflow: hidden; font-size: 14px; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
[hidden] { display: none !important; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid transparent;
  background: var(--panel-2); cursor: pointer; font-weight: 600; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: #3a332b; }
.btn.accent { background: var(--accent); color: var(--accent-ink); }
.btn.accent:hover { background: #a9472d; }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.ghost:hover { background: var(--panel-2); }
.btn.danger { color: var(--danger); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.sm svg { width: 16px; height: 16px; }
.btn.block { width: 100%; white-space: normal; height: auto; min-height: 30px; padding-top: 5px; padding-bottom: 5px; line-height: 1.3; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.mt { margin-top: 12px; }
.ib {
  width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 8px;
  border: 0; background: transparent; cursor: pointer; color: var(--ink);
}
.ib:hover { background: var(--panel-2); }
.ib[disabled] { opacity: .35; pointer-events: none; }
.ib.toggle.on { color: var(--sel); background: #e9f1ff; }

/* ---------- top bar ---------- */
.topbar {
  height: var(--top-h); display: flex; align-items: center; gap: 14px; padding: 0 14px;
  background: var(--panel); border-bottom: 1px solid var(--line); position: relative; z-index: 95;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-family: 'Playfair Display', serif; font-size: 19px; }
.brand b { color: var(--accent); font-weight: 700; }
.tb { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.tb .sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.zoom-label { min-width: 52px; height: 30px; border: 0; background: transparent; border-radius: 6px; cursor: pointer; font-size: 12.5px; font-weight: 600; }
.zoom-label:hover { background: var(--panel-2); }
.seg { display: inline-flex; background: var(--panel-2); border-radius: 8px; padding: 3px; margin-right: 4px; }
.seg button { border: 0; background: transparent; padding: 5px 10px; border-radius: 6px; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.tb-right { display: flex; align-items: center; gap: 8px; margin-left: 10px; flex: none; }
.save-state { font-size: 12px; color: var(--muted); text-align: right; }
.save-state.warn { color: var(--danger); }

/* ---------- workspace ---------- */
.workspace { display: grid; grid-template-columns: var(--left-w) 1fr var(--right-w); height: calc(100% - var(--top-h)); }
.panel { background: var(--panel); overflow: hidden; display: flex; flex-direction: column; }
.left { border-right: 1px solid var(--line); }
.right { border-left: 1px solid var(--line); min-width: 0; }
.right .tab-body { overflow-x: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 8px; }
.panel-head h3 { margin: 0; font-size: 15px; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.count { background: var(--panel-2); border-radius: 20px; padding: 1px 8px; font-size: 12px; color: var(--muted); }
.count.full { background: #fde8e4; color: #b3261e; }
.pool-album { margin: 0 14px 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); font-size: 12.5px; display: flex; flex-direction: column; gap: 2px; }
.pool-album b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pool-album small { color: var(--muted); line-height: 1.35; }
.photo-tools { display: flex; gap: 6px; padding: 0 14px 8px; }
.photo-tools select { flex: 1; min-width: 0; }
select, input[type=number], input[type=text], textarea {
  height: 32px; border: 1px solid var(--line); border-radius: 7px; padding: 0 8px; background: #fff; font-size: 13px;
}
textarea { height: auto; padding: 8px; resize: vertical; width: 100%; }
select:focus, input:focus, textarea:focus { outline: 2px solid #bcd4fb; outline-offset: -1px; }
input[type=color] { width: 40px; height: 30px; padding: 2px; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; }
input[type=range] { accent-color: var(--accent); width: 100%; }

.dropzone {
  margin: 0 14px 10px; border: 2px dashed #d9cfc2; border-radius: var(--radius); padding: 16px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; cursor: pointer;
  color: var(--muted); background: var(--panel-2); transition: border-color .15s, background .15s;
}
.dropzone svg { width: 30px; height: 30px; color: var(--accent); margin-bottom: 4px; }
.dropzone strong { color: var(--ink); font-size: 13.5px; }
.dropzone span { font-size: 12px; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: #fbefe9; }
.left.compact .dropzone { padding: 8px; flex-direction: row; justify-content: center; gap: 8px; }
.left.compact .dropzone svg { width: 20px; height: 20px; margin: 0; }
.left.compact .dropzone span { display: none; }
.folder-pick { display: block; margin: -4px 14px 10px; padding: 7px 10px; border-radius: 10px; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--accent); cursor: pointer; transition: background .15s; }
.folder-pick small { font-weight: 400; color: var(--muted); }
.light-pick { display: flex; gap: 6px; align-items: flex-start; margin: -6px 18px 10px; font-size: 11.5px; line-height: 1.35; color: var(--muted); cursor: pointer; }
.folder-pick:hover, .folder-pick:focus-within { background: #fbefe9; }
.upload-status { margin: 0 14px 10px; font-size: 12px; color: var(--muted); }
.bar { height: 6px; background: var(--panel-2); border-radius: 4px; overflow: hidden; margin-bottom: 4px; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

.photo-grid { flex: 1; overflow-y: auto; padding: 2px 14px 10px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; align-content: start; }
.ph { position: relative; height: 0; padding-top: 100%; border-radius: 8px; overflow: hidden; background: var(--panel-2); cursor: grab; outline: 2px solid transparent; transition: outline-color .15s; }
.ph:hover { outline-color: var(--accent); }
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.ph .badge { position: absolute; left: 5px; bottom: 5px; background: rgba(31,27,22,.78); color: #fff; font-size: 11px; font-weight: 600; border-radius: 10px; padding: 1px 7px; }
.ph .badge.used { background: #2f9e62; }
.ph .ph-actions { position: absolute; top: 4px; right: 4px; display: flex; gap: 3px; opacity: 0; transition: opacity .15s; }
.ph:hover .ph-actions { opacity: 1; }
.ph .ph-actions button { width: 24px; height: 24px; border: 0; border-radius: 6px; background: rgba(255,255,255,.92); cursor: pointer; display: grid; place-items: center; padding: 0; }
.ph .ph-actions svg { width: 15px; height: 15px; }
.ph .ph-actions button.del:hover { color: var(--danger); }
.ph .dims { position: absolute; right: 5px; bottom: 5px; font-size: 10px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.7); }
.ph .warn { position: absolute; left: 5px; top: 5px; background: #f5a524; color: #1f1b16; font-size: 10px; font-weight: 700; border-radius: 4px; padding: 0 4px; }
.panel-tip { margin: 0; padding: 8px 14px 12px; font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--line); }
.empty-photos { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 12.5px; padding: 18px 4px; }

/* ---------- stage ---------- */
.center { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.stage-wrap { flex: 1; position: relative; min-height: 0; display: flex; }
.stage { flex: 1; overflow: auto; position: relative; min-height: 0; isolation: isolate; }
.stage-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 56px; height: 56px; border-radius: 50%; border: 0; background: rgba(34,28,22,.55); color: #fff; cursor: pointer; display: grid; place-items: center; z-index: 5; box-shadow: 0 6px 18px rgba(0,0,0,.18); transition: background .15s, transform .15s, opacity .15s; }
.stage-nav svg { width: 34px; height: 34px; fill: currentColor; }
.stage-nav:hover { background: rgba(194,87,58,.92); transform: translateY(-50%) scale(1.06); }
.stage-nav.prev { left: 12px; }
.stage-nav.next { right: 12px; }
.stage-nav[disabled] { opacity: 0; pointer-events: none; }
.stage-inner { min-width: 100%; min-height: 100%; width: max-content; display: flex; align-items: center; justify-content: center; padding: 40px 80px 34px; }
.spread { display: flex; position: relative; box-shadow: 0 18px 40px -14px rgba(40,30,20,.45), 0 2px 6px rgba(40,30,20,.12); }
.page-wrap { position: relative; }
.page-wrap.active::after { content: ''; position: absolute; inset: -4px; border: 2px solid rgba(47,125,246,.35); border-radius: 3px; pointer-events: none; }
.spread.single .page-wrap.active::after { display: none; }
.page-tag { position: absolute; top: -24px; left: 0; font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.page-wrap + .page-wrap .page-tag { left: auto; right: 0; }
.spine { position: absolute; top: 0; bottom: 0; width: 26px; margin-left: -13px; pointer-events: none; z-index: 3;
  background: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.10) 45%, rgba(0,0,0,.18) 50%, rgba(0,0,0,.10) 55%, rgba(0,0,0,0) 100%); }

.page-canvas { position: relative; overflow: hidden; background: #fff; user-select: none; -webkit-user-select: none; }
.stage.dragging .page-canvas { overflow: visible; }
.stage.dragging .page-wrap.drop-page .page-canvas { outline: 3px solid rgba(47,125,246,.55); }
.bg-img { position: absolute; max-width: none; pointer-events: none; }
.el { position: absolute; transform-origin: 50% 50%; }
.el-clip { position: absolute; inset: 0; overflow: hidden; }
.el-img, .el-ghost { position: absolute; max-width: none; pointer-events: none; transform-origin: 50% 50%; }
.el-ghost { opacity: .35; }
.el.cropping { z-index: 50; }
.el-border { position: absolute; inset: 0; pointer-events: none; }
.el-vig { position: absolute; inset: 0; pointer-events: none; }
.el-clip.empty { background: repeating-linear-gradient(45deg, #ebe7e1, #ebe7e1 8px, #e4dfd8 8px, #e4dfd8 16px); }
.el-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #9a8f82; font-size: 12px; font-weight: 600; text-align: center; overflow: hidden; }
.el-empty svg { width: 28px; height: 28px; }
.el.drop-target .el-clip { outline: 4px solid var(--sel); outline-offset: -4px; }
.el.drop-target .el-clip::after { content: ''; position: absolute; inset: 0; background: rgba(47,125,246,.18); }
.el-txt { white-space: pre-wrap; overflow-wrap: normal; word-break: normal; cursor: default; }
.el-txt[contenteditable=true] { outline: none; cursor: text; user-select: text; -webkit-user-select: text; }
.el-shp { pointer-events: none; }

.guide-safe { position: absolute; border: 1px dashed rgba(194,87,58,.55); pointer-events: none; z-index: 60; }
.page-hint { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; pointer-events: none; color: #a1968a; font-size: 13px; text-align: center; padding: 20px; }
.page-hint svg { width: 40px; height: 40px; opacity: .6; }
.page-hint b { font-size: 15px; color: #7d7266; }

/* selection overlay */
.sel-layer { position: absolute; inset: 0; pointer-events: none; z-index: 70; }
.sel-box { position: absolute; border: 1.5px solid var(--sel); pointer-events: none; transform-origin: 50% 50%; }
.sel-box.crop { border-color: #f5a524; border-style: dashed; }
.h { position: absolute; width: 12px; height: 12px; background: #fff; border: 1.5px solid var(--sel); border-radius: 3px; pointer-events: auto; margin: -6px 0 0 -6px; }
.h[data-h="nw"], .h[data-h="se"] { cursor: nwse-resize; }
.h[data-h="ne"], .h[data-h="sw"] { cursor: nesw-resize; }
.h[data-h="n"], .h[data-h="s"] { cursor: ns-resize; width: 20px; height: 8px; margin: -4px 0 0 -10px; }
.h[data-h="e"], .h[data-h="w"] { cursor: ew-resize; width: 8px; height: 20px; margin: -10px 0 0 -4px; }
.h[data-h="rot"] { border-radius: 50%; cursor: grab; width: 16px; height: 16px; margin: -8px 0 0 -8px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%232f7df6' d='M17.65 6.35A7.96 7.96 0 0 0 12 4a8 8 0 1 0 7.73 10h-2.08A6 6 0 1 1 12 6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z'/%3E%3C/svg%3E") center/12px no-repeat; }
.rot-stem { position: absolute; left: 50%; width: 1.5px; height: 22px; top: -22px; background: var(--sel); margin-left: -.75px; }
.sel-bar {
  position: absolute; display: flex; gap: 2px; padding: 3px; background: #fff; border-radius: 9px; pointer-events: auto;
  box-shadow: 0 4px 16px rgba(0,0,0,.18); white-space: nowrap; z-index: 80; transform: translateX(-50%); flex-wrap: wrap; justify-content: center;
}
.sel-bar button { height: 28px; min-width: 28px; border: 0; background: transparent; border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; font-size: 12px; font-weight: 600; }
.sel-bar button:hover { background: var(--panel-2); }
.sel-bar button.warn { color: var(--danger); }
.sel-bar button.done { background: #f5a524; color: #1f1b16; }
.sel-bar svg { width: 16px; height: 16px; }
.snap-line { position: absolute; background: #ff3d7f; pointer-events: none; z-index: 75; }
.snap-line.v { width: 1px; top: 0; bottom: 0; }
.snap-line.h { height: 1px; left: 0; right: 0; }

/* ---------- page strip ---------- */
.pagebar { height: var(--pagebar-h); background: var(--panel); border-top: 1px solid var(--line); display: flex; flex-direction: column; }
.pagebar-head { display: flex; align-items: center; gap: 10px; padding: 6px 12px 0; }
.nav { display: flex; align-items: center; gap: 2px; }
.page-label { min-width: 90px; text-align: center; font-weight: 600; font-size: 13px; }
.page-actions { display: flex; gap: 6px; flex-wrap: nowrap; overflow: hidden; }
.page-total { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.thumbs { flex: 1; display: flex; gap: 14px; overflow-x: auto; overflow-y: hidden; padding: 8px 12px 10px; align-items: flex-start; }
.thumb-spread { display: flex; flex: none; }
.thumb { flex: none; display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; position: relative; }
.thumb-page { position: relative; box-shadow: 0 1px 3px rgba(0,0,0,.2); overflow: hidden; outline: 2px solid transparent; outline-offset: 1px; background: #fff; }
.thumb-page .page-canvas { pointer-events: none; }
.thumb-page .el-empty span { display: none; }
.thumb-page .el-empty svg { width: 12px; height: 12px; }
.thumb.visible .thumb-page { outline-color: rgba(47,125,246,.35); }
.thumb.cur .thumb-page { outline-color: var(--sel); }
.thumb span { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.thumb.drop-before::before { content: ''; position: absolute; left: -8px; top: 0; height: 72px; width: 3px; background: var(--sel); border-radius: 2px; }
.thumb.drop-into .thumb-page { outline: 3px solid var(--accent); }
.thumb.add .thumb-page { display: grid; place-items: center; background: var(--panel-2); color: var(--muted); border: 2px dashed var(--line); box-shadow: none; }

/* ---------- right panel ---------- */
.tabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 4px; overflow-x: auto; scrollbar-width: none; flex: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 1 1 auto; border: 0; background: transparent; padding: 14px 4px 11px; font-size: 12px; white-space: nowrap; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.tabs button:hover { color: var(--ink); }
.tab-body { flex: 1; overflow-y: auto; padding: 14px; }
.tab-body h4 { margin: 16px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tab-body h4:first-child { margin-top: 0; }
.row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.row.between { justify-content: space-between; }
.row > .lbl { flex: none; width: 92px; font-size: 12.5px; color: var(--muted); }
.row > input[type=range] { flex: 1; }
.row .val { width: 44px; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hint { font-size: 12px; color: var(--muted); margin: 8px 0 10px; line-height: 1.45; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.chips button { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 4px 10px; font-size: 12px; cursor: pointer; font-weight: 600; color: var(--muted); }
.chips button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.tpl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tpl { border: 1px solid var(--line); border-radius: 8px; padding: 6px; cursor: grab; background: #fff; display: flex; flex-direction: column; align-items: center; gap: 4px; transition: border-color .15s, box-shadow .15s; }
.tpl:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(194,87,58,.18); }
.tpl svg { width: 100%; height: auto; display: block; }
.tpl span { font-size: 10px; color: var(--muted); text-align: center; line-height: 1.2; }
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.swatches button { aspect-ratio: 1; border-radius: 8px; border: 1px solid rgba(0,0,0,.12); cursor: pointer; padding: 0; }
.swatches button:hover { transform: scale(1.08); }
.swatches button.on { outline: 2px solid var(--sel); outline-offset: 2px; }
.swatches.grads { grid-template-columns: repeat(4, 1fr); }
.bg-drop { border: 2px dashed var(--line); border-radius: 8px; padding: 18px 10px; text-align: center; font-size: 12.5px; color: var(--muted); margin-bottom: 10px; background-size: cover; background-position: center; }
.bg-drop.over { border-color: var(--accent); background-color: #fbefe9; }
.bg-drop.has { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.8); min-height: 90px; }
.text-presets { display: flex; flex-direction: column; gap: 6px; }
.text-presets button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 10px 12px; text-align: left; cursor: pointer; }
.text-presets button:hover { border-color: var(--accent); }
.font-list { display: flex; flex-direction: column; gap: 4px; }
.font-list button { border: 0; background: var(--panel-2); border-radius: 8px; padding: 9px 12px; text-align: left; cursor: pointer; font-size: 18px; }
.font-list button:hover { background: #f1e7df; }
.shape-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.shape-grid button { aspect-ratio: 1; border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.shape-grid button:hover { border-color: var(--accent); }
.shape-grid i { display: block; }
.sticker-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.sticker-grid button { aspect-ratio: 1; border: 0; background: var(--panel-2); border-radius: 8px; font-size: 22px; cursor: pointer; }
.sticker-grid button:hover { background: #f1e7df; }

/* properties */
.props-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.props-title h3 { margin: 0; font-size: 15px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.btn-row .btn { flex: 1 1 auto; }
.icon-row { display: flex; gap: 4px; margin-bottom: 10px; }
.icon-row .ib { border: 1px solid var(--line); width: auto; flex: 1; height: 32px; }
.icon-row .ib.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.num-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin-bottom: 10px; }
.num-grid label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.num-grid input { width: 100%; min-width: 0; }
.presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.presets button { border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 6px 2px; font-size: 11.5px; cursor: pointer; font-weight: 600; }
.presets button:hover { border-color: var(--accent); }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 8px 0; cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.muted { color: var(--muted); }

/* ---------- modals ---------- */
.modal { position: fixed; inset: 0; background: rgba(20,16,12,.45); display: grid; place-items: center; z-index: 100; padding: 20px; animation: fade .15s; }
.modal-card { background: #fff; border-radius: 14px; width: min(560px, 100%); padding: 20px 22px; box-shadow: 0 30px 80px rgba(0,0,0,.3); max-height: 90vh; overflow: auto; }
.modal-card header { display: flex; align-items: center; justify-content: space-between; }
.modal-card h2 { margin: 0; font-family: 'Playfair Display', serif; font-size: 22px; }
.modal-card footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.modal-card footer .muted { margin-right: auto; font-size: 12.5px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; margin: 14px 0 6px; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.form-grid select { width: 100%; height: 36px; }
.range-inputs { display: flex; align-items: center; gap: 6px; font-weight: 400; }
.range-inputs select { flex: 1; }
.progress { margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.progress .bar { height: 8px; }
@keyframes fade { from { opacity: 0; } }

.preview { position: fixed; inset: 0; background: #1b1814; z-index: 110; display: flex; align-items: center; justify-content: center; }
.pv-stage { display: flex; box-shadow: 0 30px 80px rgba(0,0,0,.6); position: relative; }
.pv-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%; border: 0; background: rgba(255,255,255,.1); color: #fff; cursor: pointer; display: grid; place-items: center; }
.pv-nav:hover { background: rgba(255,255,255,.22); }
.pv-nav svg { width: 28px; height: 28px; }
.pv-nav.prev { left: 24px; }
.pv-nav.next { right: 24px; }
.pv-label { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,.75); font-size: 13px; }
.preview .close { position: absolute; top: 16px; right: 16px; }
.ib.light { color: #fff; }
.ib.light:hover { background: rgba(255,255,255,.12); }

.toasts { position: fixed; bottom: calc(var(--pagebar-h) + 16px); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: fade .2s; max-width: 480px; }
.toast.err { background: var(--danger); }

.small-screen { display: none; }
@media (max-width: 1440px) {
  .page-actions .btn { font-size: 0; gap: 0; padding: 0 8px; }
  .page-actions .btn svg { width: 17px; height: 17px; }
}
@media (max-width: 1280px) {
  :root { --left-w: 236px; --right-w: 300px; }
  .tb-right .btn { padding: 0 11px; }
  .save-state { min-width: 0; }
}
@media (max-width: 1100px) {
  #btnPreview { display: none; }
  .page-actions .btn { font-size: 0; gap: 0; padding: 0 8px; }
}
@media (max-width: 860px) {
  .workspace { grid-template-columns: 0 1fr 0; }
  .left, .right { visibility: hidden; }
  .tb { display: none; }
  .small-screen { display: block; position: fixed; left: 12px; right: 12px; bottom: 12px; background: #fff3cd; color: #5c4400; padding: 10px 14px; border-radius: 10px; font-size: 13px; z-index: 90; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
}

/* ---------- photo edit (V1.1) ---------- */
.adj { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 4px 0 14px; scroll-margin-top: 10px; }
.adj-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.adj-head h4 { margin: 0 !important; color: var(--ink) !important; font-size: 12.5px !important; }
.adj-head .btn { user-select: none; -webkit-user-select: none; touch-action: none; }
.looks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
.looks button { border: 0; background: transparent; padding: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.looks canvas { width: 100%; aspect-ratio: 1; border-radius: 8px; background: #e7e1d8; outline: 2px solid transparent; outline-offset: 1px; display: block; }
.looks button:hover canvas { outline-color: #e5b8a8; }
.looks button.on canvas { outline-color: var(--accent); }
.looks span { font-size: 10.5px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.looks button.on span { color: var(--accent); }
.adj-group h5 { margin: 12px 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.adj .row { margin-bottom: 6px; }
.adj .row > .lbl { width: 86px; }
.adj input[type=range].bi { background: linear-gradient(90deg, transparent calc(50% - 1px), #c9bfb2 calc(50% - 1px), #c9bfb2 calc(50% + 1px), transparent calc(50% + 1px)) center / 100% 10px no-repeat; }
.adj .btn-row { margin: 10px 0 0; }

/* ---------- designer templates & ornaments (V1.1) ---------- */
.el-art { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.el.el-art.locked { pointer-events: none; }
.el.locked.el-photo { cursor: grab; }
.stage.dragging .el.spill { visibility: hidden; }
.sel-box.locked { border-color: #c9a227; border-style: dashed; }
.lock-note { font-size: 12px; padding: 0 6px; align-self: center; color: #7a7066; }
.tabs .tab-premium { color: #a07818; }
.tabs .tab-premium.on { color: var(--ink); border-bottom-color: #c9a227; }
.premium-note { display: flex; flex-direction: column; gap: 3px; background: linear-gradient(135deg, #fff8e6, #fbefd9); border: 1px solid #efd9a7; border-radius: 10px; padding: 10px 12px; font-size: 12px; color: #6b5a3a; margin-bottom: 10px; }
.premium-note b { color: #5a4516; font-size: 13px; }
.design-grid { display: flex; flex-direction: column; gap: 14px; }
.design { cursor: grab; border: 1px solid var(--line); border-radius: 10px; padding: 7px; background: #fff; display: flex; flex-direction: column; gap: 6px; transition: border-color .15s, box-shadow .15s; }
.design:hover { border-color: #c9a227; box-shadow: 0 4px 14px rgba(201,162,39,.25); }
.design-prev { display: flex; justify-content: center; pointer-events: none; box-shadow: 0 1px 4px rgba(0,0,0,.15); align-self: center; }
.design-prev .page-canvas + .page-canvas { box-shadow: inset 8px 0 10px -8px rgba(0,0,0,.25); }
.design span { font-size: 12px; font-weight: 600; color: #5a4516; }
.orn-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.orn-grid button { border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; padding: 6px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.orn-grid button:hover { border-color: var(--accent); }
.orn-grid img { width: 100%; height: 36px; object-fit: contain; }
.orn-grid span { font-size: 10.5px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ---------- account, sign-in & plans (V1.1) ---------- */
.acct { position: relative; display: flex; align-items: center; }
.acct-btn { height: 36px; }
.acct-avatar { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--gold); color: #fff; font-weight: 700; cursor: pointer; overflow: hidden; padding: 0; }
.acct-avatar img { width: 100%; height: 100%; object-fit: cover; }
.acct-menu { position: absolute; top: 44px; right: 0; width: 250px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.18); display: flex; flex-direction: column; gap: 4px; z-index: 60; font-size: 13px; }
.acct-menu .muted { font-size: 12px; word-break: break-all; }
.acct-plan { margin: 8px 0; padding: 8px 10px; background: var(--panel-2); border-radius: 8px; font-size: 12.5px; font-weight: 600; }
.pa-acct { z-index: 250; }
.pa-acct .modal-card { width: min(460px, 100%); }
.pa-acct.plans .modal-card { width: min(760px, 100%); }
.pa-acct .muted { margin: 8px 0 12px; line-height: 1.5; }
.pa-acct .lock-rules { padding-left: 20px; margin: 8px 0 12px; line-height: 1.5; font-size: 13.5px; }
.pa-acct .lock-rules li { margin-bottom: 4px; }
.pa-acct .fine { font-size: 11.5px; color: var(--muted); line-height: 1.5; margin: 14px 0 0; }
.pa-acct .fine a { color: var(--ink); }
.pa-acct .err { color: var(--danger); font-size: 13px; margin: 10px 0 0; }
.pa-acct .code { background: var(--panel-2); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.signin-opts { display: flex; flex-direction: column; gap: 10px; align-items: stretch; margin: 16px 0 4px; }
.gsi-slot { display: flex; justify-content: center; min-height: 44px; }
.signin-opts .btn[disabled] { opacity: .55; justify-content: space-between; height: 44px; pointer-events: auto; cursor: not-allowed; }
.signin-opts .soon { font-size: 11px; background: var(--panel-2); border-radius: 20px; padding: 2px 8px; font-weight: 700; }
.test-login { display: flex; flex-direction: column; gap: 8px; }
.test-login input { height: 40px; }
.test-badge { background: #fff3cd; color: #6b4e00; border: 1px solid #f3d98b; border-radius: 8px; padding: 6px 10px; font-size: 11.5px; font-weight: 700; margin: 6px 0; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 6px; }
.plan { border: 1.5px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.plan.rec { border-color: #c9a227; box-shadow: 0 8px 24px -12px rgba(201,162,39,.6); background: linear-gradient(180deg, #fffaf0, #fff); }
.plan.blocked { opacity: .6; }
.plan-head { display: flex; align-items: center; justify-content: space-between; }
.plan-head h3 { margin: 0; font-family: 'Playfair Display', serif; font-size: 20px; }
.plan .tag { font-size: 10.5px; font-weight: 700; background: #c9a227; color: #fff; border-radius: 20px; padding: 3px 8px; }
.plan-desc { margin: 0; font-size: 12.5px; color: var(--muted); }
.blocked-note { margin: 0; font-size: 12px; color: #8a6d1b; font-weight: 600; }
.buy { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; transition: border-color .15s, background .15s; }
.buy:hover:not([disabled]) { border-color: var(--accent); background: #fdf3ee; }
.buy[disabled] { cursor: not-allowed; }
.buy b { font-size: 17px; }
.buy span { font-size: 11.5px; color: var(--muted); }
.buy.main { background: var(--ink); border-color: var(--ink); color: #fff; }
.buy.main span { color: #d8d0c6; }
.buy.main:hover:not([disabled]) { background: #3a332b; border-color: #3a332b; }
.plan.premium .buy.main { background: #a07818; border-color: #a07818; }
.buy-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.free-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.free-row .muted { margin: 0; font-size: 12px; }
@media (max-width: 640px) { .plans { grid-template-columns: 1fr; } }
.page-total.over { color: #a07818; font-weight: 600; }
.btn.gold { background: linear-gradient(135deg, #c9a227, #a07818); color: #fff; }
.btn.gold:hover { filter: brightness(1.06); }
.special-note { margin-top: 12px; background: linear-gradient(135deg, #fff8e6, #fbefd9); border: 1px solid #efd9a7; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; color: #5a4516; line-height: 1.5; }
.modal-card footer { flex-wrap: wrap; }

/* ---------- preview, studio logo & flipbook sharing ---------- */
.pv-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; gap: 12px; z-index: 5; }
.pv-title { color: #f4efe7; font-family: 'Playfair Display', serif; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-actions { display: flex; align-items: center; gap: 8px; }
.preview .pv-actions .close { position: static; }
.pv-btn { background: rgba(255,255,255,.1); color: #fff; }
.pv-btn:hover { background: rgba(255,255,255,.2); }
.pv-canvas { display: block; }
.pv-stage { transition: margin .2s; }
.pv-logo { position: absolute; pointer-events: none; max-width: none; }
.pv-logo.editing { pointer-events: auto; cursor: move; outline: 1.5px dashed rgba(255,255,255,.8); outline-offset: 3px; }
.brand-panel { position: absolute; top: 60px; right: 12px; bottom: 12px; width: 280px; background: #fff; border-radius: 14px; padding: 14px; overflow-y: auto; z-index: 6; box-shadow: 0 20px 50px rgba(0,0,0,.4); }
.bp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.bp-head h3 { margin: 0; font-size: 16px; }
.bp-head .ib.light { color: var(--ink); }
.bp-note { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin: 0 0 12px; }
.bp-upload { margin-bottom: 12px; }
.bp-logo { background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 16px 16px; border-radius: 8px; display: grid; place-items: center; padding: 10px; margin-bottom: 8px; }
.bp-logo img { max-width: 100%; max-height: 70px; }
.bp-sub { font-size: 12px; color: var(--muted); margin: 10px 0 6px; }
.bp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; width: 120px; margin-bottom: 12px; }
.bp-grid button { aspect-ratio: 1.4; border: 1px solid var(--line); background: #faf8f5; border-radius: 5px; cursor: pointer; }
.bp-grid button.on, .bp-grid button:hover { background: var(--accent); border-color: var(--accent); }
.bp-mode { margin: 0; }
.brand-panel .row > .lbl { width: 64px; }
.brand-panel .btn.block { margin-top: 10px; }
.share-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.share-row .muted { font-size: 12.5px; }
.share-link { display: flex; gap: 8px; margin: 8px 0; }
.share-link input { flex: 1; height: 38px; font-size: 14px; }
.share-done p { margin: 6px 0; font-weight: 600; }
.share-h { margin: 18px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.share-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.share-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.share-list li a { font-weight: 600; color: var(--ink); word-break: break-all; }
.share-list li .muted { font-size: 12px; margin-right: auto; }
#shareModal .err { color: var(--danger); }
#shareModal { z-index: 130; }
.acct-menu a.btn { text-decoration: none; justify-content: center; margin: 4px 0; }
.save-state { cursor: pointer; }
.pw-login { font-size: 13px; color: var(--muted); }
.pw-login summary { cursor: pointer; text-align: center; padding: 4px 0; }
.pw-login form { margin-top: 8px; }
.pw-login input { border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font: inherit; height: 40px; }
.or-sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 2px 0; }
.or-sep::before, .or-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.pw-login summary { list-style: none; border: 1.5px solid var(--line); border-radius: 999px; padding: 10px 14px; font-weight: 600; color: var(--ink); font-size: 14px; }
.pw-login summary::-webkit-details-marker { display: none; }
.pw-login summary small { font-weight: 400; color: var(--muted); }
.pw-login[open] summary { border-color: var(--ink); }
.fair-use { background: #fff6e0; border: 1px solid #f0d58c; color: #5c4400; border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.5; margin: 6px 0 10px; }
.plans.album-only .buy-row { display: none; }
.missing-bar { margin: 8px 12px; padding: 10px 12px; border-radius: 10px; background: #fff3cd; border: 1px solid #f0d58c; color: #5c4400; font-size: 12.5px; line-height: 1.45; display: flex; flex-direction: column; gap: 6px; }
.missing-bar[hidden] { display: none; }
.pool-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; padding: 0 14px; margin-top: -2px; }
.add-cover { margin-bottom: 10px; }
.sort-pick { width: auto; max-width: 100%; padding-right: 8px; }
.pool-actions .btn[hidden] { display: none; }
.ph .warn.miss { background: #c0392b; color: #fff; }
.missing-bar small { color: #7a6420; word-break: break-all; }
.missing-bar .btn { align-self: flex-start; }
.missing-bar .relink-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.btn.primary.warn { background: #b23b2c; }
.btn.primary.warn:hover { background: #962f23; }
.check input:disabled + * , .check:has(input:disabled) { opacity: .55; }
.member-row { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, #fff8e6, #fff); border: 1.5px solid #e8c766; border-radius: 12px; padding: 10px 14px; margin: 8px 0 12px; font-size: 13px; }
.member-row > div { flex: 1; }
.member-row b { display: block; font-size: 14px; }
.member-row span { color: #6b5a2a; }
.member-row.on { display: block; font-weight: 600; color: #6b5a2a; }
.buy.main span s { opacity: .7; }
.style-chips { margin-top: 6px; }
.style-chips button { font-size: 11.5px; }
.style-tag { display: block; font-weight: 500; color: #8a7a55; font-size: 11px; margin-top: 2px; }
.member-row s.was { color: #9a8f86; text-decoration-color: #e0473a; text-decoration-thickness: 2px; font-weight: 500; }
.member-row .offer-tag { font-style: normal; font-size: 11px; font-weight: 700; color: #fff; background: linear-gradient(90deg, #e0473a, #e8a33a); padding: 2px 8px; border-radius: 999px; margin-left: 4px; white-space: nowrap; }

/* Plans window: clear regular price + member line, and a roomy membership offer card */
.with-member { margin: -2px 0 0; font-size: 12.5px; color: #6b5a2a; }
.with-member em { font-style: normal; color: #9a7b2a; }
.member-panel { position: relative; margin: 18px 0 14px; padding: 26px 22px 20px; border: 2px solid #e8c766; border-radius: 16px; background: linear-gradient(160deg, #fff8e6, #fff 60%); box-shadow: 0 10px 30px rgba(232, 163, 58, .18); }
.mp-ribbon { position: absolute; top: -14px; left: 22px; background: linear-gradient(90deg, #e0473a, #e8a33a); color: #fff; font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px; box-shadow: 0 4px 12px rgba(224, 71, 58, .3); }
.mp-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.mp-top h3 { margin: 0 0 4px; font-family: 'Playfair Display', serif; font-size: 22px; }
.mp-top p { margin: 0; font-size: 13px; color: var(--muted); }
.mp-price { display: flex; align-items: baseline; gap: 8px; }
.mp-price s { color: #9a8f86; text-decoration-color: #e0473a; text-decoration-thickness: 2px; font-size: 16px; }
.mp-price b { font-size: 30px; }
.mp-price span { color: var(--muted); font-size: 13px; }
.mp-table { width: 100%; border-collapse: collapse; margin: 16px 0 12px; font-size: 13.5px; }
.mp-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid #efe3c4; }
.mp-table td { padding: 9px 8px; border-bottom: 1px solid #f4ecd6; }
.mp-table td:nth-child(2) { color: #6f675f; }
.mp-table td em { font-style: normal; font-size: 12px; color: #1f8a4c; font-weight: 600; margin-left: 4px; }
.mp-perks { margin: 0 0 16px; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; font-size: 13px; color: #4a4038; }
.mp-perks li::before { content: '✓'; color: #1f8a4c; font-weight: 700; margin-right: 6px; }
.mp-join { width: 100%; justify-content: center; padding: 12px; font-size: 15px; }
@media (max-width: 640px) { .mp-perks { grid-template-columns: 1fr; } .mp-table { font-size: 12.5px; } }

/* Labelled Undo / Redo / Back to default */
.tb .lb { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 1px solid var(--line); background: #fff; border-radius: 9px; font: 600 13.5px/1 'Inter', sans-serif; color: var(--ink); cursor: pointer; white-space: nowrap; }
.tb .lb svg { width: 22px; height: 22px; fill: currentColor; }
.tb .lb:hover:not([disabled]) { border-color: var(--accent); background: #fdf3ee; }
.tb .lb[disabled] { opacity: .4; cursor: default; }
#btnDefault { color: #8a4b1f; }
@media (max-width: 1100px) { .tb .lb { padding: 0 8px; font-size: 12.5px; } }
.lb-short { display: none; }
@media (max-width: 1500px) { .tb .lb { padding: 0 9px; gap: 4px; } .lb-long { display: none; } .lb-short { display: inline; } }

/* BASIC / DESIGN A / B / C: grey until made, gold when ready, deep gold with a black ring when on the pages */
#designAB { gap: 5px; padding: 0; background: transparent; margin: 0 0 0 6px; }
#designAB button { min-width: 88px; height: 38px; padding: 0 12px; border-radius: 8px; font-size: 13.5px; font-weight: 800; letter-spacing: .03em; white-space: nowrap;
  color: #9a948b; background: #ece9e4; border: 1px solid #d9d4cc; box-shadow: none; }
#designAB button:hover { color: #6d675f; }
#designAB button.ready { color: #000; background: linear-gradient(180deg, #f6e6b0, #e2c77e); border-color: #b8964a; }
#designAB button.ready:hover { background: linear-gradient(180deg, #f8e19a, #dbb75c); }
#designAB button.on { color: #000; background: linear-gradient(180deg, #ffd96a, #c99a2e); border-color: #b8964a; box-shadow: 0 0 0 2px #000, 0 2px 6px rgba(0,0,0,.25); }
#autoModal footer .btn.pulse { animation: pa-pulse 0.8s ease-in-out 3; }
@keyframes pa-pulse { 50% { box-shadow: 0 0 0 4px #ffd96a; transform: scale(1.04); } }
.pool-album.editable { cursor: pointer; }
.pool-album.editable:hover { border-color: #b8964a; }
.pool-album .ren { font-style: normal; color: var(--muted); font-size: 11px; }


/* Narrower screens: keep Export fully visible. The album name is shown above My Photos, and these buttons keep their tooltips. */
@media (max-width: 1700px) {
  .tb .lb { font-size: 0; gap: 0; padding: 0 9px; }
  #btnDefault { font-size: 17px; }
  #btnDefault span { display: none; }
  #btnPreview { font-size: 0; gap: 0; padding: 0 10px; }
}

/* Designs tab: flip button on cards, colour palettes */
.design { position: relative; }
.flip-btn { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 8px; border: 1px solid #b8964a; background: linear-gradient(180deg, #f6e6b0, #e2c77e); color: #000; font-size: 17px; font-weight: 800; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.flip-btn:hover { background: linear-gradient(180deg, #ffd96a, #c99a2e); }
.palette-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin: 8px 0 10px; display: flex; flex-direction: column; gap: 6px; background: #fff; }
.palette-row { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.palette-row button { height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; display: flex; cursor: pointer; background: #fff; }
.palette-row button.on { outline: 2px solid #000; outline-offset: 1px; }
.palette-row i { flex: 1; display: block; }
.palette-row i.orig { display: grid; place-items: center; font-style: normal; font-weight: 700; color: var(--muted); }

/* Bigger, always-visible scroll bars in the panels and the page strip (macOS hides thin ones while idle). */
.panel *::-webkit-scrollbar, .thumbs::-webkit-scrollbar, #thumbs::-webkit-scrollbar, .tab-body::-webkit-scrollbar { width: 14px; height: 14px; }
.panel *::-webkit-scrollbar-thumb, .thumbs::-webkit-scrollbar-thumb, #thumbs::-webkit-scrollbar-thumb, .tab-body::-webkit-scrollbar-thumb {
  background: #c6b9a6; border-radius: 10px; border: 3px solid transparent; background-clip: content-box; min-height: 48px; }
.panel *::-webkit-scrollbar-thumb:hover, .thumbs::-webkit-scrollbar-thumb:hover, #thumbs::-webkit-scrollbar-thumb:hover, .tab-body::-webkit-scrollbar-thumb:hover { background-color: #a8977f; }
.panel *::-webkit-scrollbar-track, .thumbs::-webkit-scrollbar-track, #thumbs::-webkit-scrollbar-track, .tab-body::-webkit-scrollbar-track { background: #f1ede6; border-radius: 10px; }
.panel *, .thumbs, #thumbs { scrollbar-width: auto; scrollbar-color: #c6b9a6 #f1ede6; }
@media (max-width: 1440px) { #designAB button { min-width: 0; padding: 0 9px; font-size: 12px; letter-spacing: .01em; } }
@media (max-width: 1440px) { #btnZoomOut, #btnZoomIn, .tb .sep { display: none; } }

/* Layouts tab: Anusha designs button on the left, Spacing on the right */
.lay-top { display: flex; align-items: stretch; gap: 10px; margin-bottom: 10px; }
.spacing-box { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.spacing-box .lbl { width: auto; font-size: 11.5px; color: var(--muted); }
.spacing-box select { height: 26px; font-size: 12px; padding: 0 6px; width: 92px; }
.anusha-btn { flex: 1; min-height: 52px; border: 0; border-radius: 12px; cursor: pointer; color: #fff; font: 800 14.5px 'Inter', sans-serif; letter-spacing: .02em;
  background: linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,0) 50%), linear-gradient(135deg, #b48cff 0%, #7b3fe4 55%, #5a22c4 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 6px 18px -6px rgba(110,50,220,.7); position: relative; overflow: hidden; }
.anusha-btn::after { content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.6), transparent); transform: skewX(-20deg); animation: an-sweep 4s ease-in-out infinite; }
@keyframes an-sweep { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.anusha-btn[aria-expanded="true"] { box-shadow: inset 0 2px 6px rgba(40,10,90,.5), 0 0 0 2px #e2d3ff; }
.anusha-panel { margin-bottom: 14px; padding: 10px; border-radius: 12px; background: #f6f1ff; border: 1px solid #e2d3ff; }
.anusha-styles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.anusha-styles button { text-align: left; border: 1px solid #d7c4ff; background: #fff; border-radius: 10px; padding: 8px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.anusha-styles button b { font-size: 12.5px; color: #4b1fa6; }
.anusha-styles button small { font-size: 10.5px; color: var(--muted); line-height: 1.3; }
.anusha-styles button:hover { border-color: #7b3fe4; }
.anusha-styles button.ready { background: #efe6ff; }
.anusha-styles button.on { background: linear-gradient(135deg, #9a6cf5, #6a2fd8); border-color: transparent; }
.anusha-styles button.on b, .anusha-styles button.on small { color: #fff; }
#hanuStyles { margin-top: 8px; }
.cd-sets { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; }
.cd-sets button { border: 1px solid #d7c4ff; background: #fff; color: #4b1fa6; border-radius: 999px; padding: 4px 12px; font: 600 12px 'Inter', sans-serif; cursor: pointer; }
.cd-sets button.on { background: #6a2fd8; border-color: #6a2fd8; color: #fff; }
@media (prefers-reduced-motion: reduce) { .anusha-btn::after { animation: none; } }

/* ---------- checkout (shared by the website, the designer and Organise) ---------- */
.pa-acct.checkout .modal-card { width: min(440px, 100%); padding: 26px 26px 22px; }
.pa-acct.checkout h2 { font-size: 26px; }
.co-card { margin-top: 18px; padding: 6px 18px 16px; border-radius: 16px; background: var(--panel-2, #f6f2ec); border: 1px solid var(--line, #e6ddd1); }
.co-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line, #e6ddd1); }
.co-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.co-item b { font-size: 15.5px; font-weight: 700; }
.co-item small { font-size: 12.5px; color: var(--muted, #7a7066); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-price { font-size: 17px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.co-price s { margin-right: 8px; font-weight: 500; font-size: 14px; color: var(--muted, #7a7066); }
.co-code { display: flex; gap: 8px; margin-top: 14px; }
.co-code input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line, #d9d0c2); background: var(--panel, #fff); font: inherit; font-size: 14.5px; text-transform: uppercase; letter-spacing: .04em; }
.co-code input::placeholder { text-transform: none; letter-spacing: 0; }
.co-code input:focus { outline: none; border-color: var(--accent, #c2573a); box-shadow: 0 0 0 4px rgba(194,87,58,.14); }
.co-apply { height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--ink, #1f1b16); background: var(--ink, #1f1b16); color: #fff; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.co-apply:hover { opacity: .88; }
.co-msg { min-height: 18px; margin: 8px 2px 0; font-size: 13px; }
.co-msg.ok { color: #2f7d4f; font-weight: 600; }
.co-msg.bad { color: #b3261e; }
.co-total { display: flex; align-items: baseline; justify-content: space-between; padding-top: 12px; margin-top: 4px; border-top: 1px dashed var(--line, #e6ddd1); }
.co-total span { font-size: 14px; color: var(--muted, #7a7066); font-weight: 600; }
.co-total b { font-size: 24px; font-variant-numeric: tabular-nums; }
.co-secure { margin: 14px 2px 0; font-size: 12.5px; color: var(--muted, #7a7066); text-align: center; }
.pa-acct.checkout footer { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; margin-top: 16px; }
.co-btn { height: 48px; border-radius: 14px; font-size: 15.5px; justify-content: center; }

/* Sample designs / uploaded designs in Custom designs */
.x-set .x-title { grid-column: 1 / -1; margin: 4px 0 0; font-weight: 700; font-size: 14px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.x-set .x-title small { font-weight: 500; opacity: .65; font-size: 11.5px; }
/* "Upload your photos first": a big card in the middle of the designer */
.need-photos { position: fixed; inset: 0; z-index: 450; display: grid; place-items: center; padding: 20px; background: rgba(20,16,12,.45);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: np-in .3s ease-out; }
.np-card { width: min(460px, 100%); padding: 34px 30px 24px; border-radius: 28px; text-align: center; background: var(--panel, #fff); color: var(--ink, #1f1b16);
  box-shadow: 0 40px 100px -30px rgba(0,0,0,.6); animation: np-pop .45s cubic-bezier(.34,1.56,.64,1); }
.np-ic { font-size: 54px; line-height: 1; margin-bottom: 10px; }
.np-card h2 { margin: 0 0 8px; font-size: 24px; }
.np-card p { margin: 0 0 20px; line-height: 1.55; opacity: .85; }
.np-go { width: 100%; height: 52px; font-size: 17px; }
.np-later { margin-top: 10px; border: 0; background: none; color: inherit; opacity: .6; cursor: pointer; font: inherit; padding: 8px; }
.np-later:hover { opacity: 1; }
@keyframes np-in { from { opacity: 0; } }
@keyframes np-pop { from { opacity: 0; transform: scale(.92); } }
@media (prefers-reduced-motion: reduce) { .need-photos, .np-card { animation: none; } }
#xStyles { display: grid; gap: 12px; margin-top: 10px; } #xStyles:empty { display: none; }
/* Back to Sample designs (albums started from one) */
.back-samples { flex: none; display: inline-flex; align-items: center; height: 32px; padding: 0 14px; margin-left: 4px; border-radius: 999px; border: 1.5px solid var(--accent);
  color: var(--accent); background: transparent; font-weight: 600; font-size: 13px; text-decoration: none; white-space: nowrap; transition: background .15s, color .15s, transform .15s; }
.back-samples:hover { background: var(--accent); color: #fff; transform: translateY(-1px); }
.back-samples:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* "How many sheets?" before every new design */
.sheets-ask { z-index: 320; }
.sheets-ask .modal-card { max-width: 460px; }
.sheets-ask .sa-row { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; font-weight: 600; }
.sheets-ask .sa-row input { width: 96px; height: 44px; font-size: 20px; font-weight: 700; text-align: center; border-radius: 12px; border: 1.5px solid var(--line, #ddd); }
.sheets-ask .sa-row input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sheets-ask footer { flex-wrap: wrap; }
/* Pages picked in the strip (⌘/Shift-click) */
.thumb.picked .thumb-page { outline: 3px solid var(--accent); }
.thumb.picked span { color: var(--accent); }
.picked-note { margin: 0; padding: 4px 12px 0; font-size: 11.5px; color: var(--muted); }
.picked-note b { color: var(--accent); }
