/* Ashe Photo Studio — page styles.
   Colors match the Ashe Design store (dark header, magenta buttons). */

:root {
  --ink: #222;
  --muted: #666;
  --line: #e2e2e2;
  --bg: #f7f7f7;
  --card: #fff;
  --brand: #a3195b;
  --brand-dark: #82124a;
  --top: #1f1f1f;
  --error-bg: #fdecef;
  --error-ink: #8a1230;
  --radius: 10px;
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
h1 { font-size: 1.6rem; margin: 0 0 .4rem; }
h2 { font-size: 1.2rem; margin: 0 0 .4rem; }
p { line-height: 1.5; }
.muted { color: var(--muted); }
.center { text-align: center; }
[hidden] { display: none !important; }

/* Header */
.top { background: var(--top); color: #fff; }
.top__inner {
  max-width: 1000px; margin: 0 auto; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.brand { color: #fff; text-decoration: none; display: flex; flex-direction: column; }
.brand__name { font-size: 1.25rem; font-weight: 700; letter-spacing: .02em; }
.brand__by { font-size: .8rem; opacity: .7; }
.top__account { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.credits-pill { background: #fff; color: var(--ink); border-radius: 999px; padding: 6px 14px; font-size: .95rem; }
.link-button {
  background: none; border: 0; color: #fff; font: inherit; font-size: .95rem;
  text-decoration: underline; cursor: pointer; padding: 0;
}

/* Page */
.page { flex: 1; width: 100%; max-width: 1000px; margin: 0 auto; padding: 28px 16px 40px; }
.page__title { margin-bottom: 18px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }

.notice { background: #eef6ff; border: 1px solid #c9def5; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; }

/* Tool cards (the grid is set up in the Phase 7a section below) */
.tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.tool-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; display: flex; flex-direction: column; gap: 6px;
}
.tool-card .button, .tool-card .badge { margin-top: auto; align-self: flex-start; }
.tool-card__price { font-weight: 600; margin: 4px 0 12px; }
.tool-card--soon { opacity: .75; }
.badge { background: #eee; border-radius: 999px; padding: 6px 12px; font-size: .85rem; }

/* Buttons */
.button {
  display: inline-block; background: var(--brand); color: #fff; border: 2px solid var(--brand);
  border-radius: 6px; padding: 10px 20px; font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.button:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.button--outline { background: #fff; color: var(--brand); }
.button--outline:hover { background: #fdf2f7; color: var(--brand-dark); }
.back-link { background: none; border: 0; color: var(--brand); font: inherit; cursor: pointer; padding: 0; margin-bottom: 12px; }

/* Upload area */
.drop {
  margin-top: 18px; border: 2px dashed #c9c9c9; border-radius: var(--radius);
  padding: 40px 16px; text-align: center; background: #fcfcfc;
}
.drop.is-dragging { border-color: var(--brand); background: #fdf2f7; }
.drop__text { margin: 0 0 12px; color: var(--muted); }
.drop__buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Progress */
.progress { margin-top: 18px; display: flex; align-items: center; gap: 12px; padding: 24px; }
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid #ddd; border-top-color: var(--brand);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Result */
.result { margin-top: 18px; }
.result__image { border-radius: var(--radius); overflow: hidden; text-align: center; padding: 12px; }
.result__image img { max-width: 100%; max-height: 60vh; display: inline-block; }
.result__actions { display: flex; gap: 12px; flex-wrap: wrap; }
/* Checkerboard behind see-through images */
.checker {
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #e9e9e9 25%, transparent 25%),
    linear-gradient(-45deg, #e9e9e9 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e9e9e9 75%),
    linear-gradient(-45deg, transparent 75%, #e9e9e9 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

.error {
  margin-top: 18px; background: var(--error-bg); color: var(--error-ink);
  border-radius: var(--radius); padding: 12px 16px;
}
.error a { color: var(--error-ink); font-weight: 600; }

/* Backdrop picker */
.bd-controls { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.bd-tabs, .bd-subs { display: flex; flex-wrap: wrap; gap: 8px; }
.bd-tab, .bd-sub {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 8px 16px; font: inherit; cursor: pointer;
}
.bd-tab { font-weight: 600; }
.bd-sub { font-size: .9rem; padding: 6px 14px; }
.bd-tab:hover, .bd-sub:hover { border-color: var(--brand); }
.bd-tab[aria-pressed="true"], .bd-sub[aria-pressed="true"] {
  background: var(--brand); border-color: var(--brand); color: #fff;
}
.bd-search {
  width: 100%; max-width: 360px; padding: 10px 12px; font: inherit;
  border: 1px solid #c9c9c9; border-radius: 6px;
}
.bd-search:focus, .bd-tab:focus-visible, .bd-sub:focus-visible, .bd-tile:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px;
}
.bd-status { margin: 14px 0 10px; min-height: 1.5em; }

.bd-layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.bd-layout--no-selection { grid-template-columns: 1fr; }
.bd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.bd-tile {
  display: flex; flex-direction: column; gap: 6px; padding: 6px; text-align: left;
  background: #fff; border: 2px solid transparent; border-radius: var(--radius);
  font: inherit; color: var(--ink); cursor: pointer;
}
.bd-tile:hover { border-color: var(--line); }
.bd-tile[aria-pressed="true"] { border-color: var(--brand); background: #fdf2f7; }
/* Thumbnails: contain, so horizontal backdrops and blends show whole instead of chopped to 4:5. */
.bd-tile__img {
  width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: contain; display: block;
  border-radius: 6px; background: #eee;
}
.bd-tile__name { font-size: .85rem; line-height: 1.3; overflow-wrap: anywhere; }

.bd-selected {
  position: sticky; top: 16px; display: flex; flex-direction: column; gap: 10px;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: #fcfcfc;
}
.bd-selected__img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: contain; border-radius: 6px; background: #eee; }
.bd-selected h2 { margin: 0; overflow-wrap: anywhere; }
.bd-selected .button[disabled] { opacity: .5; cursor: not-allowed; }
.bd-selected__note { margin: 0; font-size: .9rem; }

.bd-retry { margin-left: 10px; padding: 6px 14px; }

/* Backdrop Blend (Phase 3b-2) */
.tool-card__buttons { margin-top: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.tool-card .tool-card__buttons .button { margin-top: 0; }
.button--danger { background: #fff; color: var(--error-ink); border-color: #e3b3bf; }
.button--danger:hover { background: var(--error-bg); color: var(--error-ink); border-color: var(--error-ink); }
.button[disabled] { opacity: .6; cursor: not-allowed; }
.link-like {
  background: none; border: 0; color: var(--brand); font: inherit; cursor: pointer;
  padding: 0; text-decoration: underline;
}
.link-like[disabled] { opacity: .5; cursor: not-allowed; }
.bl-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.bl-topbar .back-link { margin-bottom: 0; }
.bl-note { font-size: .9rem; margin: 10px 0 0; }

.bl-upload { display: grid; grid-template-columns: 220px 1fr; gap: 24px; margin-top: 18px; align-items: start; }
.bl-chosen { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.bl-chosen__img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: contain; border-radius: 6px; background: #eee; }
.bl-photo-side .drop { margin-top: 0; }
.bl-ready { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.bl-ready__img {
  max-width: 100%; max-height: 360px; width: auto; height: auto; border-radius: 6px;
  background-color: #fff; border: 1px solid var(--line);
}
.bl-start { font-size: 1.05rem; }

.bl-progress { padding: 18px 0; }
.bl-progress-actions { margin-top: 18px; }

.bl-view__image { margin: 18px 0 8px; text-align: center; background: #f1f1f1; border-radius: var(--radius); padding: 12px; }
.bl-view__image img { max-width: 100%; max-height: 72vh; height: auto; display: inline-block; border-radius: 4px; }

.bl-status { margin: 14px 0 10px; min-height: 1.5em; }
.bl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.bl-card {
  display: flex; flex-direction: column; gap: 4px; padding: 10px;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
}
.bl-card__picture {
  aspect-ratio: 4 / 5; border-radius: 6px; background: #f1f1f1; overflow: hidden;
  display: flex; align-items: center; justify-content: center; margin-bottom: 6px;
}
.bl-card__picture img { width: 100%; height: 100%; object-fit: contain; display: block; }
.bl-card__mark {
  width: 44px; height: 44px; border-radius: 50%; background: var(--error-bg); color: var(--error-ink);
  font-weight: 700; font-size: 1.4rem; display: flex; align-items: center; justify-content: center;
}
.bl-badge { align-self: flex-start; border-radius: 999px; padding: 3px 10px; font-size: .8rem; font-weight: 600; }
.bl-badge--done { background: #e6f4ea; color: #1e6b35; }
.bl-badge--working { background: #fdf2f7; color: var(--brand-dark); }
.bl-badge--failed { background: var(--error-bg); color: var(--error-ink); }
.bl-card__name { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; line-height: 1.3; }
.bl-card__when, .bl-card__step { margin: 0; font-size: .85rem; line-height: 1.35; }
.bl-card__error { margin: 0; font-size: .85rem; line-height: 1.35; color: var(--error-ink); }
.bl-card__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: auto; padding-top: 8px; }
.bl-small { padding: 6px 12px; font-size: .9rem; }
.bl-delete { font-size: .9rem; margin-left: auto; }

/* Adjust & Download (Phase 4) */
.adj-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; margin-top: 18px; }
.adj-stage {
  background: #f1f1f1; border-radius: var(--radius); padding: 12px; text-align: center;
  min-height: 240px; display: flex; align-items: center; justify-content: center;
  position: sticky; top: 12px; z-index: 2; /* the picture stays in view while the controls scroll */
}
.adj-canvas {
  display: block; max-width: 100%; max-height: 75vh; width: auto; height: auto;
  border-radius: 4px; box-shadow: 0 2px 12px rgba(0, 0, 0, .15); background: #000;
  touch-action: pan-y;
}
.adj-loading { margin: 0; }
.adj-panel { display: flex; flex-direction: column; gap: 10px; }
.adj-meta { margin: 0; }

/* Fold-open sections (Phase 4b) */
.adj-section { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.adj-section__head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; cursor: pointer; font-weight: 700; font-size: 1.05rem;
  list-style: none; user-select: none; -webkit-user-select: none;
}
.adj-section__head::-webkit-details-marker { display: none; }
.adj-section__head::after { content: "▾"; color: var(--muted); transition: transform .15s; }
.adj-section:not([open]) .adj-section__head::after { transform: rotate(-90deg); }
.adj-section__head:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.adj-section__note { margin-left: auto; font-weight: 400; font-size: .85rem; color: var(--muted); }
.adj-section__body { display: flex; flex-direction: column; gap: 10px; padding: 0 14px 14px; }
.adj-actions { display: flex; flex-direction: column; gap: 8px; }
.adj-share { width: 100%; text-align: center; }

/* My Blends: the 30-day reminder */
.keep-note {
  display: flex; align-items: flex-start; gap: 10px; margin: 12px 0 4px;
  background: #fff6e0; border: 1px solid #f0cf7a; border-left: 5px solid #e0a800;
  border-radius: var(--radius); padding: 12px 14px; color: #5c4300; line-height: 1.45;
}
.keep-note strong { color: #3d2c00; }
.keep-note__icon {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; background: #e0a800; color: #fff;
  font-weight: 700; font-size: .85rem; display: flex; align-items: center; justify-content: center; margin-top: 1px;
}

/* Blend names (Phase 4b) */
.bl-name { margin: 0 0 4px; }
.bl-name__line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.bl-name__line h1, .bl-name__line p { margin: 0; overflow-wrap: anywhere; }
.bl-name__edit { font-size: .85rem; }
.bl-name__sub { margin: 2px 0 0; font-size: .85rem; overflow-wrap: anywhere; }
.bl-name__form { display: flex; flex-direction: column; gap: 6px; margin: 4px 0; }
.bl-name__input {
  width: 100%; max-width: 420px; padding: 8px 10px; font: inherit;
  border: 1px solid #c9c9c9; border-radius: 6px;
}
.bl-name__input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.bl-name__buttons { display: flex; align-items: center; gap: 12px; }
.bl-name__help { margin: 0; font-size: .8rem; line-height: 1.35; }
.bl-name__error { margin: 0; font-size: .85rem; color: var(--error-ink); }
.adj-name { font-size: 1.1rem; font-weight: 600; }
.bl-card .bl-name__line { gap: 6px; }
.bl-search { margin-top: 14px; }
.adj-tabs { display: flex; gap: 6px; }
.adj-tab {
  flex: 1; border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 8px 6px; font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
}
.adj-tab:hover { border-color: var(--brand); }
.adj-tab[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.adj-tab[disabled] { opacity: .45; cursor: not-allowed; }
.adj-tab:focus-visible, .adj-select:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.adj-check { display: flex; gap: 8px; align-items: center; font-size: .9rem; }
.adj-slider { margin: 4px 0; }
.adj-slider__head { display: flex; justify-content: space-between; gap: 8px; font-size: .95rem; }
.adj-slider__head output { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.adj-slider input[type="range"] { width: 100%; accent-color: var(--brand); margin: 6px 0 2px; }
.adj-slider input[type="range"][disabled] { opacity: .45; }
.adj-auto { font-size: .85rem; }
.adj-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.adj-compare { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; }
.adj-heading { font-size: 1.05rem; margin: 10px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.adj-select {
  width: 100%; padding: 10px 12px; font: inherit; background: #fff;
  border: 1px solid #c9c9c9; border-radius: 6px;
}
.adj-download { width: 100%; text-align: center; font-size: 1.05rem; margin-top: 4px; }
.adj-hint { margin: 0; font-size: .85rem; line-height: 1.4; }
.adj-panel .error { margin-top: 0; }

/* Order a print and My Prints (Phase 5) */
.bl-topbar__right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.adj-order { width: 100%; text-align: center; }
.pr-name { margin: 0; overflow-wrap: anywhere; }
.pr-stage { min-height: 280px; padding: 24px; }

/* The preview, dressed as the product. --frame is the frame colour. */
.pr-frame {
  display: inline-block; max-width: 100%; line-height: 0; background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
}
.pr-frame[data-style="black"] { --frame: #1d1d1d; }
.pr-frame[data-style="white"] { --frame: #f5f5f5; }
.pr-frame[data-style="oak"] { --frame: #b88a56; }
.pr-canvas { display: block; max-width: 100%; max-height: 70vh; width: auto; height: auto; }
.pr-frame--canvas { box-shadow: 5px 5px 0 #c4c4c4, 0 8px 20px rgba(0, 0, 0, .25); }
.pr-frame--framed_canvas { border: 10px solid var(--frame, #1d1d1d); padding: 5px; background: #2b2b2b; }
.pr-frame--framed_print { border: 14px solid var(--frame, #1d1d1d); }
.pr-frame--framed_canvas[data-style="white"],
.pr-frame--framed_print[data-style="white"] { box-shadow: 0 0 0 1px #cfcfcf, 0 4px 16px rgba(0, 0, 0, .18); }
/* The real frame or canvas photo is drawn in the picture itself (prints.js): no CSS frame. */
.pr-frame--mockup { background: none; box-shadow: none; }
.pr-frame--mockup .pr-canvas { border-radius: 4px; }

.pr-group { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pr-label { font-weight: 700; font-size: 1rem; padding: 0; margin-bottom: 2px; }
.pr-products { display: grid; gap: 8px; }
.pr-product {
  display: flex; flex-direction: column; gap: 2px; text-align: left; width: 100%;
  border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: var(--radius);
  padding: 10px 12px; font: inherit; cursor: pointer;
}
.pr-product:hover { border-color: var(--brand); }
.pr-product[aria-pressed="true"] { border-color: var(--brand); background: #fdf2f7; box-shadow: inset 0 0 0 1px var(--brand); }
.pr-product[disabled], .pr-style[disabled] { opacity: .55; cursor: not-allowed; }
.pr-product__top { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.pr-product__from { color: var(--muted); font-weight: 400; font-size: .9rem; white-space: nowrap; }
.pr-product__desc { color: var(--muted); font-size: .82rem; line-height: 1.35; }
.pr-styles { display: flex; flex-wrap: wrap; gap: 8px; }
.pr-style {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff;
  color: var(--ink); border-radius: 999px; padding: 6px 14px 6px 8px; font: inherit; font-size: .9rem; cursor: pointer;
}
.pr-style:hover { border-color: var(--brand); }
.pr-style[aria-pressed="true"] { border-color: var(--brand); background: #fdf2f7; box-shadow: inset 0 0 0 1px var(--brand); }
.pr-swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .25); background: var(--frame, #1d1d1d); }
.pr-swatch[data-style="black"] { --frame: #1d1d1d; }
.pr-swatch[data-style="white"] { --frame: #f5f5f5; }
.pr-swatch[data-style="oak"] { --frame: #b88a56; }
.pr-product:focus-visible, .pr-style:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pr-qty { max-width: 120px; }
.pr-price { margin: 4px 0 0; font-size: 1.2rem; font-weight: 700; }
.pr-price small { display: block; margin-top: 2px; font-size: .85rem; font-weight: 400; color: var(--muted); }
.pr-notes { margin: 0; padding-left: 18px; font-size: .85rem; line-height: 1.4; color: #5c4300; }
.pr-deadlines {
  background: #fff6e0; border: 1px solid #f0cf7a; border-radius: var(--radius);
  padding: 10px 12px; font-size: .85rem; line-height: 1.4; color: #5c4300;
}
.pr-deadlines h3 { margin: 0 0 4px; font-size: .95rem; color: #3d2c00; }
.pr-deadlines p { margin: 6px 0 0; }
.pr-deadline { margin-top: 6px; }
.pr-deadline strong { color: #3d2c00; }
.pr-deadline ul { margin: 2px 0 0; padding-left: 18px; }

/* My Prints */
.pr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.pr-card__picture {
  aspect-ratio: 4 / 5; border-radius: 6px; background: #f1f1f1; overflow: hidden; margin-bottom: 6px;
  display: flex; align-items: center; justify-content: center;
}
.pr-card__picture img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.pr-card__title { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; line-height: 1.3; }
.pr-card__label { margin: 0; font-size: .9rem; line-height: 1.35; }
.pr-card__gone { margin: 0; font-size: .85rem; line-height: 1.35; }
.pr-orders { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: .85rem; }
.pr-order { border-top: 1px solid var(--line); padding-top: 6px; }
.pr-order__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pr-order__tracking { margin: 4px 0 0; overflow-wrap: anywhere; }
.pr-order__tracking a { color: var(--brand); }

/* Photo Enhance / Upscale (Phase 6) */
.ph-ready { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 18px; }
.ph-dims { margin: 0; font-size: .9rem; }
.ph-sizes { border: 0; padding: 0; margin: 6px 0 4px; min-width: 0; width: 100%; }
.ph-sizes legend { padding: 0; margin-bottom: 8px; font-weight: 600; }
.ph-size-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; max-width: 560px; }
.ph-size {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 52px; padding: 8px 6px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink); font: inherit; cursor: pointer;
}
.ph-size:hover:not([disabled]) { border-color: var(--brand); }
.ph-size[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.ph-size[disabled] { cursor: not-allowed; background: #f4f4f4; color: #999; }
.ph-size:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ph-size__label { font-weight: 600; }
.ph-size__why { font-size: .75rem; line-height: 1.2; text-align: center; }
.ph-hint { margin: 8px 0 0; font-size: .9rem; }
.ph-size-limit { display: inline-block; margin-bottom: 4px; color: var(--ink); font-weight: 600; }
.ph-center { text-align: center; }

.ph-stage { margin: 18px 0 8px; background: #f1f1f1; border-radius: var(--radius); padding: 12px; }
.ph-compare {
  --pos: 50%;
  position: relative; margin: 0 auto; width: 100%; max-width: 100%;
  overflow: hidden; border-radius: 4px; background: #e4e4e4; touch-action: pan-y;
}
.ph-compare img { display: block; width: 100%; height: 100%; object-fit: fill; user-select: none; -webkit-user-drag: none; }
.ph-compare__after { position: absolute; inset: 0; }
.ph-compare__before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.ph-compare__line {
  position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; margin-left: -1.5px;
  background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); pointer-events: none;
}
.ph-compare__line::after {
  content: "\2194"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 34px; height: 34px; border-radius: 50%; background: #fff; color: var(--ink);
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}
.ph-compare__tag {
  position: absolute; top: 8px; padding: 3px 9px; border-radius: 999px; font-size: .8rem; font-weight: 600;
  background: rgba(0, 0, 0, .55); color: #fff; pointer-events: none;
}
.ph-compare__tag--before { left: 8px; }
.ph-compare__tag--after { right: 8px; }
.ph-compare__range {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none;
}
.ph-compare:has(.ph-compare__range:focus-visible) { outline: 2px solid var(--brand); outline-offset: 3px; }
[data-view="photo-view"] .result__actions { margin-top: 16px; }
.ph-tip {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin: 10px 0 0; padding: 10px 14px;
  border-radius: 8px; font-size: .95rem; line-height: 1.45;
  background: #fff8e1; border: 1px solid #f1d58a; color: #3d2c00; max-width: 640px;
}
.ph-tip--info { background: #f4f6fb; border-color: #cfd8ea; color: #22314d; }
.ph-tip .link-like { font-weight: 600; }
.ph-redraw {
  margin: 12px 0 0; padding: 10px 14px; border-radius: 8px; font-size: .95rem; line-height: 1.45;
  background: #fff8e1; border: 1px solid #f1d58a; color: #3d2c00;
}

/* ------------------------------------------------------------------
   Studio home with tool pictures (Phase 7a)
   Desktop: picture cards, 3 across; Backdrop Blend first and 2 wide.
   Tablet (≤960px): 2 across. Phones (≤760px): Backdrop Blend as one
   big card, then one compact row per tool (small picture on the left).
   Each tool's title is its Open button. Before/after pictures can be
   dragged (studio.js, "Home sliders"); on phone rows they are a still
   preview instead, because the small pictures are too small to drag.
   ------------------------------------------------------------------ */
.home__title { margin-bottom: 4px; }
.home__intro { margin: 0 0 20px; }

/* A tool picture. Slider pictures show "before" under "after", cut at --split. */
.tool-pic {
  --split: 50%;
  position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #eee;
}
.tool-pic img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.tool-pic__base { position: absolute; inset: 0; }
.tool-pic--split-34 { --split: 34%; }
.tool-pic__after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--split)); }
.tool-pic__line {
  position: absolute; top: 0; bottom: 0; left: var(--split); width: 3px; margin-left: -1.5px;
  background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .2); pointer-events: none;
}
.tool-pic__line::after {
  content: "\2194"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 34px; height: 34px; border-radius: 50%; background: #fff; color: var(--ink);
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}
/* Dragging: vertical swipes still scroll the page; sideways moves the slider */
.tool-pic--slider { cursor: ew-resize; touch-action: pan-y; }
.tool-pic__range {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none;
}
.tool-pic--slider:has(.tool-pic__range:focus-visible) { outline: 3px solid var(--brand); outline-offset: -3px; }

/* Backdrop Blend: the feature card */
.tool-feature {
  grid-column: span 2; display: grid; grid-template-columns: 3fr 2fr;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.tool-feature .tool-pic { aspect-ratio: auto; height: 100%; min-height: 240px; } /* fills the card's height */
.tool-feature__body { padding: 22px; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.tool-feature__body .tool-row__heading { margin: 0; }
/* Buttons on top: Backdrop Blender (the Open button), then My Blends and My Prints */
.tool-feature__open { width: 100%; text-align: center; font-size: 1.1rem; }
.tool-feature__buttons { display: flex; flex-direction: column; gap: 8px; }
.tool-feature__buttons .button { width: 100%; text-align: center; }
.tool-feature__desc { margin: 6px 0 0; }
.tool-feature .badge { align-self: flex-start; }

/* The other tools: picture, then the title button and a few words */
.tool-row {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.tool-row__text { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px 18px 18px; min-width: 0; }
.tool-row__heading { margin: 0 0 2px; font-size: inherit; }
.tool-title { font-size: 1.05rem; padding: 9px 16px; min-height: 44px; }
.tool-title::after { content: " \203A"; font-weight: 700; } /* › */
.tool-card--soon .tool-title,
.tool-card--soon .tool-title:hover { background: #e8e8e8; border-color: #e8e8e8; color: #555; cursor: default; }
.tool-card--soon .tool-title::after { content: ""; }
.tool-row__desc { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.4; }
.tool-row__short { display: none; margin: 0; color: var(--muted); font-size: .875rem; line-height: 1.35; } /* phones only */
.tool-row__price { margin: 0; color: var(--brand); font-weight: 700; font-size: .95rem; }
.tool-row .badge { font-size: .8rem; padding: 4px 10px; }

/* Saved work: hidden when none of its buttons are turned on */
.saved { margin-top: 28px; }
.saved:not(:has(.saved__buttons > :not([hidden]))) { display: none; }
.saved__title { font-size: 1.1rem; margin: 0 0 10px; }
.saved__buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.saved__buttons .button { flex: 0 1 200px; text-align: center; }
.saved__note { margin: 10px 0 0; font-size: .9rem; }

@media (max-width: 960px) {
  .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .home__intro { margin-bottom: 16px; }
  .tools { grid-template-columns: minmax(0, 1fr); gap: 10px; }

  /* Backdrop Blend: picture on top (draggable), words and buttons below */
  .tool-feature { grid-column: auto; grid-template-columns: minmax(0, 1fr); margin-bottom: 8px; }
  .tool-feature .tool-pic { aspect-ratio: 16 / 10; height: auto; min-height: 0; }
  .tool-feature__body { padding: 16px; }
  /* Phones: My Blends and My Prints side by side under Backdrop Blender */
  .tool-feature__buttons { flex-direction: row; }
  .tool-feature__buttons .button { flex: 1 1 0; padding-left: 10px; padding-right: 10px; }

  /* Other tools: small still picture on the left, title button and one line on the right */
  .tool-row { flex-direction: row; align-items: center; gap: 12px; padding: 10px; }
  .tool-row .tool-pic { flex: 0 0 120px; width: 120px; border-radius: 8px; }
  .tool-row .tool-pic--slider { cursor: default; }
  .tool-row .tool-pic__range { display: none; } /* too small to drag: a still preview */
  .tool-row .tool-pic__line::after { display: none; }
  .tool-row__text { padding: 0; gap: 4px; }
  .tool-title { font-size: 1rem; padding: 8px 12px; }
  .tool-row__desc { display: none; }
  .tool-row__short { display: block; }
  .tool-row__price { font-size: .875rem; }
  .tool-row .badge { font-size: .75rem; padding: 3px 8px; }

  .saved__buttons .button { flex: 1 1 140px; }
}

.footer { text-align: center; padding: 20px 16px; color: var(--muted); font-size: .9rem; }
.footer a { color: var(--muted); }

@media (max-width: 600px) {
  .panel { padding: 20px 16px; }
  h1 { font-size: 1.35rem; }
}

@media (max-width: 760px) {
  /* Phones: the chosen backdrop shows above the grid */
  .bd-layout { grid-template-columns: 1fr; }
  .bd-selected { position: static; order: -1; }
  .bd-selected__img { max-width: 260px; }
  .bd-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
  /* Blend: the chosen backdrop sits above the photo area */
  .bl-upload { grid-template-columns: 1fr; }
  .bl-chosen { flex-direction: row; align-items: center; }
  .bl-chosen__img { width: 90px; }
  .bl-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  /* Adjust: the picture on top (and it stays there), the controls below it */
  .adj-layout { grid-template-columns: 1fr; gap: 12px; }
  .adj-stage {
    top: 0; padding: 6px; min-height: 120px; border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 6px 10px -8px rgba(0, 0, 0, .35);
  }
  .adj-canvas { max-height: 38vh; max-height: 38svh; }
  /* Order a print: same sticky picture; a little smaller to leave room for the frame */
  .pr-stage { min-height: 120px; padding: 10px; }
  .pr-canvas { max-height: 32vh; max-height: 32svh; }
  .pr-frame--framed_canvas { border-width: 7px; padding: 3px; }
  .pr-frame--framed_print { border-width: 9px; }
  .pr-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
}

/* ------------------------------------------------------------------
   "Place your photo" (Backdrop Blend v3, Oct 26; place.js)
   The backdrop sits in .pl-stage; the photo is drawn twice: clipped inside
   the backdrop (.pl-person) and faded outside it (.pl-ghost), so customers
   see what will be cut off. .pl-box is the drag box with 4 corner handles.
   ------------------------------------------------------------------ */
.pl-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; margin-top: 18px; }
.pl-wrap {
  background: #2a2930; border-radius: var(--radius); padding: 28px;
  display: flex; justify-content: center; align-items: center; min-height: 260px; overflow: hidden;
}
.pl-stage {
  position: relative; width: 240px; height: 300px;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.pl-frame { position: absolute; inset: 0; overflow: hidden; background: #3a3940; }
.pl-frame img, .pl-ghost { position: absolute; display: block; max-width: none; pointer-events: none; -webkit-user-drag: none; }
.pl-backdrop { left: 0; top: 0; width: 100%; height: 100%; }
.pl-ghost { opacity: .28; }
.pl-box {
  position: absolute; border: 2px solid #fff; outline: 1px solid rgba(0, 0, 0, .45);
  cursor: move; touch-action: none;
}
.pl-box:focus-visible { outline: 3px solid #f2c230; outline-offset: 3px; }
.pl-handle {
  position: absolute; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: 2px solid var(--brand); box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}
/* A bigger invisible touch area around each handle for fingers */
.pl-handle::after { content: ""; position: absolute; inset: -12px; }
.pl-handle[data-corner="nw"] { left: -12px; top: -12px; cursor: nwse-resize; }
.pl-handle[data-corner="ne"] { right: -12px; top: -12px; cursor: nesw-resize; }
.pl-handle[data-corner="sw"] { left: -12px; bottom: -12px; cursor: nesw-resize; }
.pl-handle[data-corner="se"] { right: -12px; bottom: -12px; cursor: nwse-resize; }
.pl-guide { position: absolute; background: #f2c230; pointer-events: none; display: none; }
.pl-guide--center { top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; }
.pl-guide--bottom { left: 0; right: 0; bottom: 0; height: 3px; }
.pl-guide.is-on { display: block; }
.pl-loading {
  position: absolute; inset: 0; margin: 0; display: flex; align-items: center; justify-content: center;
  color: #e6e4ea; background: rgba(42, 41, 48, .6); pointer-events: none;
}
.pl-panel { display: flex; flex-direction: column; gap: 10px; }
.pl-panel .adj-slider input[type="range"] { accent-color: var(--brand); }
.pl-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.pl-buttons .button { min-height: 40px; }
.pl-start { width: 100%; text-align: center; min-height: 48px; margin-top: 6px; }
.pl-panel .error { margin-top: 0; }

@media (max-width: 760px) {
  /* Phones: the backdrop on top, the controls below it */
  .pl-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 12px; }
  .pl-wrap { padding: 18px; min-height: 0; }
}

/* ---------------------------------------------------------------
   Remove Background: Photoshop plugin box + FAQ (Nov 5)
   The plugin box is the dark box from the old store page: info on the
   left, the customer's key on the right (stacked on phones).
   --------------------------------------------------------------- */
.rb-plugin { margin-top: 36px; padding: 32px; border-radius: var(--radius); background: var(--top); color: #fff;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; align-items: start; scroll-margin-top: 16px; }
.rb-plugin h2 { margin: 0 0 10px; font-size: 1.5rem; color: #fff; }
.rb-plugin__eyebrow { margin: 0 0 6px; font-size: .85em; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #f29cc4; }
.rb-plugin__text { color: #e6e6e6; }
.rb-plugin__note { font-size: .92em; color: #bdbdbd; }
.rb-plugin__install { margin: 14px 0 0; }
.rb-plugin__install summary { cursor: pointer; font-weight: 700; color: #fff; }
.rb-plugin__steps { margin: 12px 0 0; padding-left: 1.3em; color: #e6e6e6; }
.rb-plugin__steps li { margin: 6px 0; line-height: 1.45; }
.rb-plugin__steps strong { color: #fff; }
.rb-button--white { background: #fff; border-color: #fff; color: var(--top); }
.rb-button--white:hover { background: #f1f1f1; border-color: #f1f1f1; color: var(--top); }
.rb-button--ghost { background: transparent; border-color: rgba(255,255,255,.7); color: #fff; }
.rb-button--ghost:hover { background: rgba(255,255,255,.1); border-color: #fff; color: #fff; }
.rb-key { padding: 20px; border-radius: var(--radius); background: #2c2c2c; border: 1px solid #3a3a3a; }
.rb-key__label { margin: 0 0 6px; font-weight: 700; font-size: 1.1rem; }
.rb-key__text { margin: 0 0 12px; color: #d4d4d4; }
.rb-key__row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rb-key__input { flex: 1 1 100%; min-width: 0; padding: 10px 12px; font: 14px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  border: 1px solid #555; border-radius: 8px; background: #fff; color: var(--ink); }
.rb-key__note { margin: 10px 0 0; font-size: .92em; color: #bdf0c8; }
.rb-key__note.error { color: #ffb3c4; }
.rb-key__note:empty { display: none; }
@media (max-width: 760px) {
  .rb-plugin { grid-template-columns: 1fr; padding: 22px; }
}

.rb-faq { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--line); }
.rb-faq h2 { margin: 0 0 10px; font-size: 1.35rem; }
.rb-faq__item { border-bottom: 1px solid var(--line); }
.rb-faq__item summary { cursor: pointer; padding: 14px 0; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.rb-faq__item summary::-webkit-details-marker { display: none; }
.rb-faq__item summary::after { content: "+"; font-weight: 400; color: var(--muted); }
.rb-faq__item[open] summary::after { content: "\2212"; }
.rb-faq__item p { margin: 0 0 14px; }

/* Folder drop (Nov 5, batch.js) */
.batch { margin-top: 18px; }
.batch__title { margin: 0 0 4px; font-size: 1.3rem; overflow-wrap: anywhere; }
.batch__summary { margin: 0 0 12px; }
.batch__bar { height: 8px; background: #eee; border-radius: 999px; overflow: hidden; margin-bottom: 14px; }
.batch__bar-fill { height: 100%; width: 0; background: var(--brand); transition: width .3s; }
.batch__notice { background: #eef6ff; border: 1px solid #c9def5; border-radius: var(--radius); padding: 10px 14px; margin: 0 0 14px; }
.batch__notice--problem { background: var(--error-bg); border-color: #f0c4cf; color: var(--error-ink); }
.batch__actions, .batch__downloads { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.batch__downloads-note { flex-basis: 100%; margin: 0; }
.batch__zip-status { margin: 0 0 14px; }
.batch__zip-status:empty { display: none; }
.batch__skipped { margin-bottom: 14px; }
.batch__skipped summary { cursor: pointer; color: var(--muted); }
.batch__skipped ul { margin: 8px 0 0; padding-left: 20px; font-size: .9rem; color: var(--muted); max-height: 200px; overflow: auto; }
.batch__skipped strong { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.batch__grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.batch__card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 8px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.batch__card[data-status="done"] { border-color: #b9dcc4; }
.batch__card[data-status="failed"] { border-color: #f0c4cf; }
.batch__thumb { position: relative; aspect-ratio: 1; border-radius: 6px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.batch__thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.batch__spinner { position: absolute; }
.batch__name { margin: 0; font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.batch__status { margin: 0; font-size: .8rem; color: var(--muted); line-height: 1.3; }
.batch__card[data-status="failed"] .batch__status { color: var(--error-ink); }
.batch__card[data-status="done"] .batch__status { color: #1e6b35; }
.batch__link { font-size: .85rem; color: var(--brand); font-weight: 600; }
@media (max-width: 600px) {
  .batch__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
