/* Bespawke: warm storybook look. */
:root {
  --paper: #faf6ef;
  --card: #ffffff;
  --ink: #2f2622;
  --ink-2: #6d5f55;
  --ink-3: #9c8f84;
  --line: #ebe2d6;
  --line-2: #d9ccbb;
  --accent: #b8612e;
  --accent-2: #9d4f22;
  --accent-soft: #f6e6da;
  --ok: #3f7a4a;
  --ok-soft: #e3efe2;
  --warn: #a86a12;
  --warn-soft: #fbf0d9;
  --err: #a83a2c;
  --err-soft: #f8e1dc;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 4px 16px rgba(60, 40, 20, .06);
  --shadow-lg: 0 10px 40px rgba(40, 25, 10, .18);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
main { max-width: 1160px; margin: 0 auto; padding: 28px 24px 80px; outline: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; margin: 0; }
h1 { font-size: 32px; line-height: 1.15; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0; }
a { color: var(--accent-2); }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.lede { color: var(--ink-2); font-size: 16px; margin-top: 6px; max-width: 640px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }

/* ---------- top bar & stepper */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 24px; background: rgba(250, 246, 239, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { font-family: var(--serif); font-size: 22px; font-weight: 600; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand-mark { font-size: 18px; }
.topbar-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.save-state { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.service { font-size: 12px; padding: 4px 10px; border-radius: 99px; background: var(--warn-soft); color: var(--warn); white-space: nowrap; }
.book-btn { background: var(--card); border: 1px solid var(--line-2); color: var(--ink); padding: 7px 12px; border-radius: 10px; font-weight: 500; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); min-width: 260px; padding: 6px; z-index: 40; }
.menu button { display: flex; width: 100%; text-align: left; background: none; border: none; color: var(--ink); padding: 9px 12px; border-radius: 8px; font-weight: 400; gap: 8px; align-items: center; }
.menu button:hover { background: var(--paper); }
.menu button.current { font-weight: 600; }
.menu hr { border: none; border-top: 1px solid var(--line); margin: 6px 0; }
.menu .menu-label { font-size: 12px; color: var(--ink-3); padding: 6px 12px 2px; }

.stepper { display: flex; justify-content: center; gap: 4px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--paper); overflow-x: auto; }
.step { display: flex; align-items: center; gap: 10px; background: none; border: none; padding: 8px 14px; border-radius: 99px; color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.step:hover:not(:disabled) { background: rgba(0, 0, 0, .035); }
.step .num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; border: 1.5px solid var(--line-2); background: var(--card); flex: none; }
.step.done .num { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.active { color: var(--ink); background: var(--card); box-shadow: var(--shadow); }
.step.active .num { border-color: var(--accent); color: var(--accent); }
.step.active.done .num { color: #fff; }
.step:disabled { opacity: .45; cursor: not-allowed; }
.step .sub { font-size: 12px; color: var(--ink-3); font-weight: 400; }
.step-sep { width: 18px; height: 1px; background: var(--line-2); align-self: center; flex: none; }

/* ---------- basics */
button { font: inherit; cursor: pointer; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: 15px; padding: 11px 20px; border-radius: 11px; border: 1px solid transparent; background: var(--accent); color: #fff; transition: background .15s, transform .05s; text-decoration: none; }
.btn:hover:not(:disabled) { background: var(--accent-2); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.lg { font-size: 16px; padding: 14px 26px; }
.btn.secondary { background: var(--card); color: var(--ink); border-color: var(--line-2); }
.btn.secondary:hover:not(:disabled) { background: #fffaf4; border-color: var(--ink-3); }
.btn.ghost { background: none; color: var(--ink-2); padding: 8px 12px; }
.btn.ghost:hover:not(:disabled) { background: rgba(0, 0, 0, .04); color: var(--ink); }
.btn.danger { background: var(--err); }
.btn.sm { font-size: 13px; padding: 7px 12px; border-radius: 9px; }
.link-btn { background: none; border: none; padding: 0; color: var(--accent-2); text-decoration: underline; text-underline-offset: 2px; font-weight: 500; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card + .card, .stack > * + * { margin-top: 18px; }
.field { display: block; margin-top: 16px; }
.field:first-child { margin-top: 0; }
.field > span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field > small { display: block; color: var(--ink-3); font-size: 13px; margin-top: 5px; }
input[type=text], input[type=email], .signin input, textarea, select { width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; transition: border-color .15s, box-shadow .15s; }
input[type=text]:focus, input[type=email]:focus, .signin input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
textarea.story { font-family: var(--serif); font-size: 17px; line-height: 1.6; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.footer-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 32px; gap: 12px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--paper); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.accent { background: var(--accent-soft); color: var(--accent-2); border-color: transparent; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; background: var(--warn-soft); color: #6b4a12; }
.notice.ok { background: var(--ok-soft); color: #2d5a35; }
.notice.info { background: var(--accent-soft); color: #6b3a1c; }
.notice b { display: block; }
.advanced { margin-top: 18px; border-top: 1px dashed var(--line-2); padding-top: 14px; }
.advanced > summary { cursor: pointer; color: var(--ink-3); font-size: 13px; font-weight: 600; }
.advanced[open] > summary { margin-bottom: 10px; }

/* ---------- step 1: dogs */
.dog-card { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; }
.dog-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; grid-column: 1 / -1; }
.avatar-dot { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--accent-soft); display: grid; place-items: center; font-family: var(--serif); font-weight: 600; color: var(--accent-2); flex: none; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--paper); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.photo .face-tag { position: absolute; left: 6px; bottom: 6px; background: rgba(255, 255, 255, .95); color: var(--ink); font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 99px; }
.photo .tools { position: absolute; inset: auto 6px 6px auto; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.photo:hover .tools, .photo:focus-within .tools { opacity: 1; }
.icon-btn { width: 28px; height: 28px; border-radius: 8px; border: none; background: rgba(255, 255, 255, .95); color: var(--ink); display: grid; place-items: center; font-size: 13px; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.icon-btn:hover { background: #fff; color: var(--accent-2); }
.photo.face { outline: 3px solid var(--accent); outline-offset: -3px; }
.dropzone { aspect-ratio: 1; border: 2px dashed var(--line-2); border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; color: var(--ink-2); font-size: 13px; cursor: pointer; padding: 8px; background: #fffdf9; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-2); }
.dropzone .plus { font-size: 24px; line-height: 1; }
.dropzone.wide { aspect-ratio: auto; min-height: 140px; grid-column: 1 / -1; }
.photo-tip { margin-top: 12px; font-size: 13px; color: var(--ink-3); }
.add-dog { width: 100%; padding: 20px; border: 2px dashed var(--line-2); background: none; border-radius: var(--radius); color: var(--ink-2); font-weight: 600; margin-top: 18px; }
.add-dog:hover { border-color: var(--accent); color: var(--accent-2); background: var(--accent-soft); }
.styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.style-opt { text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 14px; color: var(--ink); }
.style-opt:hover { border-color: var(--line-2); }
.style-opt.sel { border-color: var(--accent); background: #fffaf5; }
.style-opt b { display: block; font-size: 15px; margin: 8px 0 2px; }
.style-opt span { font-size: 13px; color: var(--ink-2); }
.swatches { display: flex; gap: 4px; }
.swatches i { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .08); }

/* ---------- step 2: characters */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 36px; align-items: center; }
.hero-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; transform: rotate(-1.5deg); }
.hero-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 5px solid #fff; box-shadow: var(--shadow); }
.hero-photos img:nth-child(even) { transform: rotate(3deg); }
.sheet-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.sheet-img { width: 100%; display: block; border-radius: 12px; cursor: zoom-in; background: var(--paper); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chip { background: var(--paper); border: 1px solid var(--line-2); color: var(--ink-2); padding: 5px 11px; border-radius: 99px; font-size: 13px; }
.chip:hover { border-color: var(--accent); color: var(--accent-2); }
.versions { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px; }
.versions button { border: 2px solid transparent; padding: 0; border-radius: 8px; overflow: hidden; background: none; flex: none; }
.versions button.sel { border-color: var(--accent); }
.versions img { height: 56px; display: block; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink-2); margin-top: 10px; }

/* ---------- working state */
.working { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; padding: 40px 20px; border-radius: 12px; background: linear-gradient(110deg, #f6efe4 30%, #fbf7f0 50%, #f6efe4 70%); background-size: 200% 100%; animation: shimmer 1.6s linear infinite; min-height: 240px; }
.working .msg { font-family: var(--serif); font-size: 19px; }
.working .time { color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.paw-spin { font-size: 28px; animation: bob 1.2s ease-in-out infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-8deg); } }
.spinner { width: 14px; height: 14px; border: 2px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- step 3: pages */
.progress { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--ok); border-radius: 99px; transition: width .4s; }
.studio { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; }
.page-list { position: sticky; top: 140px; max-height: calc(100vh - 160px); overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow); }
.page-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px; border: none; background: none; border-radius: 9px; text-align: left; color: var(--ink); }
.page-item:hover { background: var(--paper); }
.page-item.sel { background: var(--accent-soft); }
.page-item .thumb { width: 44px; height: 44px; border-radius: 7px; background: var(--paper); border: 1px solid var(--line); flex: none; object-fit: cover; display: grid; place-items: center; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.page-item .t { flex: 1; min-width: 0; }
.page-item .t b { display: block; font-size: 14px; font-weight: 600; }
.page-item .t span { font-size: 12px; color: var(--ink-3); }
.page-item .t span.ok { color: var(--ok); }
.page-item .t span.warn { color: var(--warn); }
.page-list .add { margin: 6px 0 2px; width: 100%; }
.options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.options.four { grid-template-columns: repeat(4, 1fr); }
.option { position: relative; border-radius: 12px; overflow: hidden; background: var(--paper); border: 3px solid transparent; cursor: pointer; padding: 0; transition: border-color .15s, transform .15s; }
.option:hover { transform: translateY(-2px); }
.option img { width: 100%; display: block; }
.option.square img { aspect-ratio: 1; object-fit: cover; }
.option.chosen { border-color: var(--ok); }
.option .pick { position: absolute; left: 8px; bottom: 8px; font-size: 13px; font-weight: 600; padding: 5px 11px; border-radius: 99px; background: rgba(255, 255, 255, .95); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.option.chosen .pick { background: var(--ok); color: #fff; }
.option .zoom { position: absolute; right: 8px; top: 8px; opacity: 0; transition: opacity .15s; }
.option:hover .zoom, .option:focus-within .zoom { opacity: 1; }
.option-skel { aspect-ratio: 1; border-radius: 12px; background: linear-gradient(110deg, #f1e9dc 30%, #faf5ed 50%, #f1e9dc 70%); background-size: 200% 100%; animation: shimmer 1.6s linear infinite; }
.change-box { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.change-box input { flex: 1; min-width: 220px; }
.empty-pic { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 20px; text-align: center; border: 2px dashed var(--line-2); border-radius: 12px; background: #fffdf9; }
.empty-pic .art { font-size: 34px; }
.section-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 26px 0 12px; }
.section-label h3 { font-size: 17px; }
.bulk { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.bulk .meter { flex: 1; min-width: 200px; }
.bulk .meter .row { justify-content: space-between; margin-bottom: 6px; font-size: 14px; }

/* ---------- step 4: review */
.viewer { display: flex; align-items: center; gap: 16px; }
.viewer .nav { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--card); font-size: 20px; flex: none; color: var(--ink); }
.viewer .nav:disabled { opacity: .3; }
.spread { flex: 1; display: grid; grid-template-columns: 1fr 1fr; box-shadow: var(--shadow-lg); border-radius: 4px; overflow: hidden; background: #fff; position: relative; }
.spread::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 30px; transform: translateX(-50%); background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .07) 48%, rgba(0, 0, 0, .12) 50%, rgba(0, 0, 0, .07) 52%, transparent); pointer-events: none; }
.spread.single { grid-template-columns: 1fr; max-width: 50%; margin: 0 auto; }
.spread.single::after { display: none; }
.spread > div { aspect-ratio: 1; position: relative; overflow: hidden; }
.spread img { width: 100%; height: 100%; object-fit: cover; display: block; }
.spread .text { background: #fbf6ec; display: flex; flex-direction: column; justify-content: center; padding: 12%; font-family: var(--serif); font-size: clamp(11px, 1.35vw, 17px); line-height: 1.5; text-align: center; }
.spread .text p { margin: 0 0 .7em; }
.spread .missing { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: #f1eadf; color: var(--ink-2); font-size: 14px; }
.spread .cover-title { position: absolute; top: 9%; left: 8%; right: 8%; text-align: center; font-family: var(--serif); }
.spread .cover-title b { display: block; font-size: clamp(16px, 2.6vw, 32px); line-height: 1.15; }
.spread .cover-title span { font-size: clamp(11px, 1.2vw, 15px); }
.filmstrip { display: flex; gap: 8px; overflow-x: auto; padding: 16px 2px 4px; }
.filmstrip button { flex: none; border: 2px solid transparent; border-radius: 6px; padding: 0; background: none; text-align: center; color: var(--ink-3); font-size: 11px; }
.filmstrip button.sel { border-color: var(--accent); }
.filmstrip .fs { width: 74px; height: 37px; display: flex; overflow: hidden; border-radius: 4px; background: #fbf6ec; }
.filmstrip .fs img, .filmstrip .fs i { width: 37px; height: 37px; object-fit: cover; display: block; }
.filmstrip .fs i { background: #e9e0d2; }
.review-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.spec { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; margin: 14px 0 18px; }
.spec dt { color: var(--ink-3); }
.spec dd { margin: 0; }
.todo-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ---------- step 5: extras */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.product { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.product .ico { font-size: 26px; }
.product p { font-size: 13px; color: var(--ink-2); flex: 1; }
.product .row { margin-top: 6px; }
.extra-card .head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.extra-card .head input { max-width: 340px; font-weight: 600; font-family: var(--serif); font-size: 18px; border-color: transparent; padding-left: 4px; }
.extra-card .head input:hover { border-color: var(--line-2); }
.dog-toggles { display: flex; gap: 6px; flex-wrap: wrap; }
.dog-toggle { border: 1px solid var(--line-2); background: #fff; border-radius: 99px; padding: 5px 12px; font-size: 13px; color: var(--ink-2); }
.dog-toggle.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.download-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 18px; padding: 14px; border-radius: 12px; background: var(--paper); }
.download-bar select { width: auto; }

/* ---------- overlays */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 60; width: min(560px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; display: flex; gap: 12px; align-items: flex-start; animation: up .2s ease-out; }
.toast.err { background: #fff; color: var(--ink); border-left: 4px solid var(--err); }
.toast .x { margin-left: auto; background: none; border: none; color: inherit; opacity: .6; font-size: 16px; padding: 0 2px; }
.toast details { margin-top: 6px; font-size: 12px; color: var(--ink-2); }
.toast details pre { white-space: pre-wrap; word-break: break-word; margin: 6px 0 0; font-size: 11px; max-height: 140px; overflow: auto; }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }
.modal-backdrop { position: fixed; inset: 0; background: rgba(30, 20, 12, .45); display: grid; place-items: center; z-index: 70; padding: 20px; }
.modal { background: var(--card); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 26px; width: min(460px, 100%); animation: up .2s ease-out; }
.modal h2 { margin-bottom: 8px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.lightbox { position: fixed; inset: 0; background: rgba(20, 14, 10, .9); z-index: 80; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 120px); border-radius: 6px; box-shadow: var(--shadow-lg); }
.lightbox .row { justify-content: center; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }

/* ---------- responsive */
@media (max-width: 900px) {
  .dog-card, .hero, .sheet-layout, .studio, .review-grid, .grid-2 { grid-template-columns: 1fr; }
  .page-list { position: static; max-height: none; display: flex; gap: 6px; overflow-x: auto; padding: 6px; }
  .page-item { flex-direction: column; width: auto; min-width: 72px; text-align: center; gap: 4px; }
  .page-item .t span { display: none; }
  .page-list .add { width: auto; flex: none; }
  .options, .options.four { grid-template-columns: repeat(2, 1fr); }
  .step:not(.active) .label-text, .step .sub, .step-sep { display: none; }
  .save-state { display: none; }
  .spread.single { max-width: 100%; }
}
@media (max-width: 560px) {
  main { padding: 20px 14px 60px; }
  h1 { font-size: 26px; }
  .topbar { padding: 10px 14px; }
  .book-btn { max-width: 150px; }
  .service { display: none !important; }
  .brand { font-size: 19px; }
  .viewer .nav { display: none; }
  .options, .options.four { grid-template-columns: 1fr; }
}
main:focus, main:focus-visible { outline: none; }

/* ================= profiles-first layout ================= */
a.brand { color: inherit; text-decoration: none; }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 14px; text-decoration: none; margin-bottom: 14px; font-weight: 500; }
.crumb:hover { color: var(--accent-2); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 44px 0 16px; }
.section-title h2 { font-size: 24px; }

/* pack home */
.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.dog-tile { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 26px 18px 20px; box-shadow: var(--shadow); text-align: center; color: var(--ink); text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 6px; transition: transform .15s, box-shadow .15s; }
.dog-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.dog-tile h3 { font-size: 22px; margin-top: 8px; }
.dog-tile .meta { font-size: 13px; color: var(--ink-3); }
.dog-tile .badge { margin-top: 8px; }
.dog-tile.add { border: 2px dashed var(--line-2); box-shadow: none; background: transparent; justify-content: center; color: var(--ink-2); font-weight: 600; min-height: 250px; cursor: pointer; font: inherit; font-weight: 600; }
.dog-tile.add:hover { border-color: var(--accent); color: var(--accent-2); background: var(--accent-soft); transform: none; box-shadow: none; }
.dog-tile.add .plus { font-size: 34px; line-height: 1; }
.av { border-radius: 50%; object-fit: cover; background: var(--accent-soft); color: var(--accent-2); display: grid; place-items: center; font-family: var(--serif); font-weight: 600; flex: none; border: 4px solid #fff; box-shadow: 0 2px 10px rgba(60, 40, 20, .15); }
.av.xl { width: 168px; height: 168px; font-size: 64px; }
.av.lg { width: 124px; height: 124px; font-size: 46px; }
.av.sm { width: 34px; height: 34px; font-size: 14px; border-width: 2px; box-shadow: none; }
.av.xs { width: 26px; height: 26px; font-size: 11px; border-width: 2px; box-shadow: none; }
.av-stack { display: inline-flex; }
.av-stack .av + .av { margin-left: -8px; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.book-tile { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); color: var(--ink); text-decoration: none; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.book-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.book-tile .cover { aspect-ratio: 1; background: linear-gradient(135deg, #efe4d2, #f8f1e6); display: grid; place-items: center; font-size: 40px; overflow: hidden; }
.book-tile .cover img { width: 100%; height: 100%; object-fit: cover; }
.book-tile .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.book-tile .body h3 { font-size: 17px; }
.book-tile.add { border: 2px dashed var(--line-2); box-shadow: none; background: transparent; align-items: center; justify-content: center; min-height: 260px; color: var(--ink-2); font-weight: 600; cursor: pointer; font: inherit; font-weight: 600; }
.book-tile.add:hover { border-color: var(--accent); color: var(--accent-2); background: var(--accent-soft); }
.style-current { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

/* dog profile */
.profile-hero { display: flex; gap: 32px; align-items: center; background: linear-gradient(135deg, #fff 0%, #fbf3e8 100%); border: 1px solid var(--line); border-radius: 22px; padding: 32px; box-shadow: var(--shadow); flex-wrap: wrap; }
.profile-hero .who { flex: 1; min-width: 240px; }
.profile-hero h1 { font-size: 40px; }
.profile-hero .meta { color: var(--ink-2); margin-top: 4px; }
.profile-hero .tagline { font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--ink); margin-top: 12px; }
.profile-hero .cta { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tabs { display: flex; gap: 4px; margin: 26px 0 22px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { background: none; border: none; border-bottom: 3px solid transparent; padding: 10px 16px; color: var(--ink-2); font-weight: 600; white-space: nowrap; text-decoration: none; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--accent); }
.tab .count { font-size: 12px; color: var(--ink-3); font-weight: 500; margin-left: 4px; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.cols > div > .card + .card { margin-top: 20px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.seg button { background: #fff; border: none; padding: 8px 14px; color: var(--ink-2); font-weight: 500; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--ink); color: #fff; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.facts .wide { grid-column: 1 / -1; }
.ideas { margin-top: 18px; background: var(--paper); border-radius: 12px; padding: 12px 16px; }
.ideas summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.ideas dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 14px; margin: 10px 0 4px; }
.ideas dt { color: var(--ink-3); }
.ideas dd { margin: 0; }
.ideas h4 { margin: 12px 0 0; font-family: var(--serif); font-size: 15px; }
.cast { display: flex; gap: 10px; flex-wrap: wrap; }
.cast-chip { display: flex; align-items: center; gap: 10px; border: 2px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 16px 5px 5px; color: var(--ink); font-weight: 600; }
.cast-chip.on { border-color: var(--accent); background: var(--accent-soft); }
.cast-chip small { display: block; font-weight: 400; font-size: 12px; color: var(--ink-3); }
.book-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; justify-content: space-between; margin-bottom: 6px; }
.book-steps { display: flex; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 4px; box-shadow: var(--shadow); overflow-x: auto; }
.book-steps .step { padding: 7px 14px 7px 8px; }
.modal .cast { margin-top: 6px; }
@media (max-width: 900px) {
  .cols, .facts { grid-template-columns: 1fr; }
  .profile-hero { padding: 22px; gap: 20px; }
  .profile-hero h1 { font-size: 32px; }
  .av.xl { width: 120px; height: 120px; font-size: 44px; }
}
::placeholder { color: #b9ada2; font-style: italic; opacity: 1; }

.story-read { margin: 12px 0 16px; padding-left: 22px; font-family: var(--serif, Georgia, serif); line-height: 1.55; }
.story-read li { margin-bottom: 8px; }

/* sign-in (hosted app) */
.signin { max-width: 440px; margin: 8vh auto 0; text-align: center; padding: 40px 32px; }
.signin h1 { font-size: 28px; margin: 8px 0 10px; }
.signin form { display: grid; gap: 14px; margin: 22px 0 10px; text-align: left; }
.signin form .btn { justify-self: stretch; }
.signin .notice { display: block; text-align: left; }
.signin-mark { font-size: 40px; }
.menu-account { padding: 8px 12px 6px; display: grid; gap: 2px; }
.menu-account b { overflow: hidden; text-overflow: ellipsis; }
.menu-account span { font-size: 12px; color: var(--ink-3); }
