/*
 * Framkalla — application styles on top of scandi.css.
 * Uses the zinc tokens from scandi.css; adds layout and the photo-specific components.
 */

:root {
  --trim: rgba(128, 128, 128, .85);   /* 50% gray over everything that is trimmed off a print */
  --page-max: 1240px;
  --topbar-h: 60px;
  --accent: var(--zn-900);
  --ok: #15803d;
  --ok-bg: #f0fdf4;
}

html { -webkit-text-size-adjust: 100%; }
body { font-size: 14px; line-height: 1.55; background: var(--background); }
h1, h2, h3, h4 { font-family: var(--font-sans); color: var(--foreground); letter-spacing: -0.02em; margin: 0; }
h1 { font-size: 28px; font-weight: 650; }
h2 { font-size: 20px; font-weight: 600; }
h3 { font-size: 16px; font-weight: 600; }
p { margin: 0 0 12px; }
a { text-decoration: none; }
a:hover, a:focus { text-decoration: none; }
[hidden] { display: none !important; }
.muted { color: var(--muted-fg); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }
.icon { flex-shrink: 0; vertical-align: -3px; }
.btn .icon { vertical-align: 0; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.gap-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------------------------------------------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.86);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: var(--page-max); margin: 0 auto; height: var(--topbar-h);
  display: flex; align-items: center; gap: 32px; padding: 0 24px;
}
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px;
         letter-spacing: -0.02em; color: var(--foreground); }
.brand:hover { color: var(--foreground); }
.brand .icon { stroke-width: 1.6; }
/* The Framkalla logo (static/logo.svg) laid out side by side: the symbol, then the wordmark. */
.brand { gap: 10px; color: #16130f; }
.brand:hover { color: #16130f; }
.brand .logo-mark { width: 30px; height: 30px; display: block; }
.brand .logo-word { height: 13px; width: auto; display: block; }
.brand span { display: block; }
.topnav { display: flex; gap: 4px; }
.topnav a {
  color: var(--muted-fg); font-weight: 500; padding: 7px 12px; border-radius: var(--radius);
  transition: color .15s, background-color .15s;
}
.topnav a:hover { color: var(--foreground); background: var(--zn-100); }
.topnav a.active { color: var(--foreground); background: var(--zn-100); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.cart-button {
  display: inline-flex; align-items: center; gap: 7px; color: var(--foreground); font-weight: 500;
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border); transition: background-color .15s;
}
.cart-button:hover, .cart-button.active { background: var(--zn-100); color: var(--foreground); }
.cart-button .count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--zn-900); color: #fff;
  font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center;
}
.cart-button .count.bump { animation: bump .4s ease; }
@keyframes bump { 40% { transform: scale(1.35); } }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--zn-900); color: #fff;
  font-weight: 600; font-size: 13px; cursor: pointer;
}
.usermenu .dropdown-menu { margin-top: 8px; min-width: 220px; }
.usermenu .dropdown-menu .icon { margin-right: 6px; color: var(--muted-fg); }
.dropdown-button {
  display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 12px;
  border-radius: var(--radius-sm); color: var(--foreground); font-size: 14px;
}
.dropdown-button:hover { background: var(--zn-100); }

/* ---------------------------------------------------------- page scaffolding */
.page { max-width: var(--page-max); margin: 0 auto; padding: 36px 24px 120px; }
.page-narrow { max-width: 760px; margin: 0 auto; padding: 48px 24px 120px; }
.page-header { display: flex; align-items: flex-end; gap: 16px; margin: 0 0 28px; padding: 0; border: 0; flex-wrap: wrap; }
.page-header .subtitle { color: var(--muted-fg); margin: 6px 0 0; font-size: 15px; }
.page-header .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted-fg); font-weight: 500;
             margin-bottom: 14px; }
.back-link:hover { color: var(--foreground); }
.section { margin-top: 40px; }
.section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.section-title h2 { font-size: 17px; }
.section-title .hint { color: var(--muted-fg); font-size: 13px; }

.card {
  background: var(--background); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.card-body { padding: 22px 24px; }
.card-header { padding: 16px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.card-header h3 { font-size: 15px; }
.card-footer { padding: 14px 24px; border-top: 1px solid var(--border); background: var(--zn-50);
               border-radius: 0 0 12px 12px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.layout-aside { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; align-items: start; }
.sticky-aside { position: sticky; top: calc(var(--topbar-h) + 24px); }

.empty {
  text-align: center; padding: 72px 24px; border: 1px dashed var(--zn-300); border-radius: 16px;
  background: var(--zn-50);
}
.empty .empty-icon {
  width: 56px; height: 56px; border-radius: 16px; background: var(--background); border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.empty h3 { font-size: 17px; margin-bottom: 6px; }
.empty p { color: var(--muted-fg); max-width: 420px; margin: 0 auto 20px; }

/* ---------------------------------------------------------- forms */
.form-control { height: 40px; }
.form-group label { display: block; }
.form-group .optional { color: var(--muted-fg); font-weight: 400; }
.field-error { color: var(--destructive); font-size: 12.5px; margin-top: 4px; }
.has-error .form-control { border-color: var(--destructive); }
.check-row { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-weight: 400; margin: 0; }
.check-row input { margin-top: 3px; }
.check-row strong { display: block; font-weight: 500; color: var(--foreground); font-size: 14px; }
.check-row span { color: var(--muted-fg); font-size: 13px; }

/* Choice cards: big radio buttons for shipping / payment */
.choice-list { display: grid; gap: 10px; }
.choice {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer; font-weight: 400; margin: 0; transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.choice:hover { border-color: var(--zn-400); }
.choice.selected { border-color: var(--zn-900); box-shadow: 0 0 0 1px var(--zn-900); background: var(--zn-50); }
.choice input { margin: 0; }
.choice .choice-icon { width: 36px; height: 36px; border-radius: 8px; background: var(--zn-100);
                       display: flex; align-items: center; justify-content: center; }
.choice .choice-text { flex: 1; }
.choice .choice-text strong { display: block; font-weight: 550; }
.choice .choice-text span { color: var(--muted-fg); font-size: 13px; }
.choice .choice-price { font-weight: 600; white-space: nowrap; }

/* Chips: compact pickers for size and paper */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--border); background: var(--background); border-radius: 10px; padding: 8px 12px;
  cursor: pointer; font-size: 13.5px; font-weight: 500; color: var(--foreground); text-align: left;
  transition: border-color .15s, box-shadow .15s, background-color .15s; line-height: 1.3;
}
.chip small { display: block; color: var(--muted-fg); font-weight: 400; font-size: 12px; }
.chip:hover { border-color: var(--zn-400); }
.chip.selected { border-color: var(--zn-900); box-shadow: 0 0 0 1px var(--zn-900); }
.chip[disabled] { opacity: .35; cursor: not-allowed; }
.picker-label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
                color: var(--muted-fg); margin: 18px 0 8px; }
.picker-label:first-child { margin-top: 0; }

/* Quantity stepper */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--input-border); border-radius: 999px;
           height: 34px; background: var(--background); }
.stepper button { width: 32px; height: 32px; border: 0; background: none; border-radius: 50%; color: var(--foreground);
                  display: inline-flex; align-items: center; justify-content: center; }
.stepper button:hover { background: var(--zn-100); }
.stepper input { width: 38px; border: 0; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums;
                 background: none; -moz-appearance: textfield; padding: 0; }
.stepper input:focus { outline: none; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ---------------------------------------------------------- toasts */
#toasts { position: fixed; top: calc(var(--topbar-h) + 14px); left: 50%; transform: translateX(-50%); z-index: 2000;
          display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast-item {
  pointer-events: auto; background: var(--zn-900); color: #fff; padding: 11px 18px; border-radius: 999px;
  box-shadow: var(--shadow-lg); font-weight: 500; max-width: min(560px, 92vw); text-align: center;
  animation: toast-in .25s ease;
}
.toast-item.toast-danger { background: #b91c1c; }
.toast-item.toast-warning { background: #92400e; }
.toast-item.leaving { opacity: 0; transform: translateY(-6px); transition: opacity .3s, transform .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

/* ---------------------------------------------------------- justified photo grid */
.photo-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-grid::after { content: ""; flex-grow: 999999; }
.tile {
  position: relative; flex-grow: calc(var(--ar) * 100); flex-basis: calc(var(--ar) * var(--row-h, 220px));
  border-radius: 6px; overflow: hidden; background: var(--zn-100); cursor: pointer;
  user-select: none; -webkit-user-select: none;
}
.tile::before { content: ""; display: block; padding-bottom: calc(100% / var(--ar)); }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease, opacity .3s;
            opacity: 0; }
.tile img.loaded { opacity: 1; }
.tile:hover img { transform: scale(1.02); }
.tile .tile-check {
  position: absolute; top: 10px; left: 10px; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.95); background: rgba(0,0,0,.18); color: transparent;
  display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s, background-color .15s;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.tile .tile-check .icon { stroke-width: 3; }
.tile:hover .tile-check, .selecting .tile .tile-check { opacity: 1; }
.tile .tile-shade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,.28), transparent 35%);
                    opacity: 0; transition: opacity .15s; pointer-events: none; }
.tile:hover .tile-shade, .selecting .tile .tile-shade { opacity: 1; }
/* Selected: the photo stays as it is; only the tick turns gold so it stands out on any picture. */
.tile { --sel: #e0a91b; --sel-fg: #3a2a00; }
.tile .tile-check { z-index: 2; }
.tile.selected .tile-check { opacity: 1; background: var(--sel); border-color: #fff; color: var(--sel-fg);
                             box-shadow: 0 0 0 1px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.35); }
.tile .tile-badge { position: absolute; right: 8px; bottom: 8px; background: rgba(255,255,255,.95); color: var(--foreground);
                    border-radius: 999px; font-size: 12px; font-weight: 600; padding: 3px 9px; box-shadow: var(--shadow); }
.tile.uploading img { opacity: .45; }
.tile .tile-progress { position: absolute; left: 12px; right: 12px; bottom: 12px; height: 4px; border-radius: 4px;
                       background: rgba(255,255,255,.5); overflow: hidden; }
.tile .tile-progress i { display: block; height: 100%; width: 0; background: #fff; transition: width .2s; }

/* Floating action bar for selections */
.action-bar {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); z-index: 500;
  background: var(--zn-900); color: #fff; border-radius: 999px; padding: 8px 8px 8px 20px;
  display: flex; align-items: center; gap: 6px; box-shadow: 0 20px 40px -12px rgba(0,0,0,.45);
  transition: transform .3s cubic-bezier(.2,.9,.3,1.2); white-space: nowrap;
}
.action-bar.is-open { transform: translate(-50%, 0); }
.action-bar .count { font-weight: 600; margin-right: 10px; }
.action-bar .btn { height: 38px; border-radius: 999px; box-shadow: none; }
.action-bar .btn-ab { background: transparent; border-color: transparent; color: #fff; }
.action-bar .btn-ab:hover { background: rgba(255,255,255,.12); color: #fff; }
.action-bar .btn-ab-primary { background: #fff; border-color: #fff; color: var(--zn-900); }
.action-bar .btn-ab-primary:hover { background: var(--zn-200); color: var(--zn-900); }
.action-bar .divider { width: 1px; height: 22px; background: rgba(255,255,255,.2); margin: 0 4px; }

/* Upload drop zone */
.drop-overlay {
  position: fixed; inset: 0; z-index: 3000; background: rgba(250,250,250,.92); display: none;
  align-items: center; justify-content: center; pointer-events: none;
}
.drop-overlay.is-open { display: flex; }
.drop-overlay .drop-box { border: 2px dashed var(--zn-900); border-radius: 24px; padding: 64px 96px; text-align: center; }
.drop-overlay h2 { font-size: 22px; margin-top: 12px; }

/* ---------------------------------------------------------- cart */
.cart-list { display: flex; flex-direction: column; gap: 12px; }
.cart-item {
  display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 22px; padding: 18px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--background); transition: opacity .2s;
}
.cart-item.busy { opacity: .6; pointer-events: none; }
.print-preview {
  width: 148px; height: 148px; display: flex; align-items: center; justify-content: center;
  background: var(--zn-100); border-radius: 10px; position: relative; cursor: pointer;
}
.print-preview .paper {
  position: relative; overflow: hidden; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.1), 0 6px 14px -4px rgba(0,0,0,.2);
}
.print-preview .paper img { position: absolute; max-width: none; }
.print-preview .crop-hint {
  position: absolute; right: 6px; bottom: 6px; width: 28px; height: 28px; border-radius: 50%; background: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); opacity: 0; transition: opacity .15s;
}
.print-preview:hover .crop-hint { opacity: 1; }
.cart-item-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cart-item-head { display: flex; align-items: flex-start; gap: 12px; }
.cart-item-head .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-item-head .meta { color: var(--muted-fg); font-size: 13px; }
.cart-item-head .line-price { margin-left: auto; font-weight: 600; font-size: 15px; white-space: nowrap; }
.cart-item-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cart-item-controls select.form-control { width: auto; height: 34px; padding-top: 4px; padding-bottom: 4px; border-radius: 999px; }
.cart-item-controls .btn { height: 34px; border-radius: 999px; }
.cart-item-controls .item-actions { margin-left: auto; display: flex; gap: 4px; align-items: center; white-space: nowrap; }
.warn-note { color: #b45309; font-size: 13px; display: flex; gap: 6px; align-items: center; }

.summary .row-line { display: flex; justify-content: space-between; padding: 6px 0; color: var(--muted-fg); }
.summary .row-line span:last-child { color: var(--foreground); font-variant-numeric: tabular-nums; }
.summary .row-total { display: flex; justify-content: space-between; padding: 14px 0 4px; margin-top: 8px;
                      border-top: 1px solid var(--border); font-weight: 650; font-size: 18px; }
.summary .lab-line { display: flex; gap: 12px; align-items: center; padding-bottom: 16px; margin-bottom: 10px;
                     border-bottom: 1px solid var(--border); }
.lab-mark { width: 40px; height: 40px; border-radius: 10px; background: var(--zn-900); color: #fff;
            display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.mini-items { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; max-height: 320px; overflow: auto; }
.mini-item { display: flex; gap: 12px; align-items: center; font-size: 13px; }
.mini-item img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }
.mini-item .mi-text { flex: 1; min-width: 0; }
.mini-item .mi-text div:first-child { font-weight: 500; }

/* Crop modal */
.crop-modal .modal-dialog { width: min(1100px, 94vw); margin-top: 3vh; }
.crop-modal .modal-body { padding: 0; background: #111; }
.crop-stage { height: min(68vh, 720px); }
.crop-stage img { display: block; max-width: 100%; }
.crop-toolbar { display: flex; gap: 10px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--border);
                flex-wrap: wrap; }
.crop-toolbar .size-info { font-weight: 600; }
.crop-toolbar .quality { font-size: 13px; }
.quality.good { color: var(--ok); }
.quality.fair { color: #b45309; }
.quality.poor { color: #b91c1c; }
.crop-inner { position: absolute; inset: 28px 36px; }
/* Everything outside the frame is trimmed: dark and striped so even thin strips are obvious. */
.crop-modal .cropper-modal { opacity: 1; background-color: transparent; }
.crop-modal .cropper-canvas::after {        /* gray only over the photo; the crop box above shows it clean */
  content: ""; position: absolute; inset: 0; background: var(--trim);
}
.cropper-view-box { outline: 2px solid #fff; outline-color: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.35), 0 0 0 4px rgba(255,255,255,.18); }
.cropper-dashed { border-color: rgba(255,255,255,.55); opacity: 1; }
.cropper-line, .cropper-point { background-color: #fff; }
.cropper-point { width: 9px; height: 9px; opacity: 1; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.35); }
.crop-meta { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 240px; }   /* its text wraps before the buttons do */
.crop-meta .as-printed { width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
                         background: var(--zn-100); border-radius: 8px; }
.crop-meta .lines { display: flex; flex-direction: column; gap: 1px; font-size: 13px; line-height: 1.35; }
.crop-meta .trim { color: var(--muted-fg); }
.crop-meta .trim strong { color: var(--foreground); font-weight: 600; }

/* ---------------------------------------------------------- tables & lists */
.list-card { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--background); }
.list-row {
  display: flex; align-items: center; gap: 16px; padding: 14px 20px; border-top: 1px solid var(--border);
  color: var(--foreground); transition: background-color .12s;
}
.list-row:first-child { border-top: 0; }
a.list-row:hover { background: var(--zn-50); color: var(--foreground); }
.list-row .thumb { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; background: var(--zn-100); flex-shrink: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .title { font-weight: 600; }
.list-row .sub { color: var(--muted-fg); font-size: 13px; }
.list-row .amount { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 90px; text-align: right; }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px;
          border-radius: 999px; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-warning { background: #fef3c7; color: #b45309; }
.status-info { background: #dbeafe; color: #1d4ed8; }
.status-primary { background: var(--zn-900); color: #fff; }
.status-success { background: #dcfce7; color: #15803d; }
.status-default { background: var(--zn-100); color: var(--zn-600); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tabs a { padding: 10px 14px; color: var(--muted-fg); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px;
          display: inline-flex; gap: 8px; align-items: center; }
.tabs a:hover { color: var(--foreground); }
.tabs a.active { color: var(--foreground); border-bottom-color: var(--foreground); }
.tabs .n { background: var(--zn-100); color: var(--zn-600); font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; }
.tabs a.active .n { background: var(--zn-900); color: #fff; }

/* Order detail */
.order-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.order-item { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--background); }
.order-item .oi-preview { height: 200px; background: var(--zn-100); display: flex; align-items: center; justify-content: center; }
.order-item .oi-body { padding: 12px 14px; }
.order-item .oi-body .t { font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.order-item .oi-body .s { color: var(--muted-fg); font-size: 13px; }
.order-item .oi-actions { padding: 0 14px 14px; }
.copies-badge { background: var(--zn-900); color: #fff; border-radius: 999px; padding: 0 8px; font-size: 12px; line-height: 20px; }
.address { font-style: normal; line-height: 1.6; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted-fg); font-weight: 400; }
.kv dd { margin: 0; }
.timeline { display: flex; gap: 0; margin: 4px 0 28px; }
.timeline .step { flex: 1; position: relative; padding-top: 22px; font-size: 13px; color: var(--muted-fg); font-weight: 500; }
.timeline .step::before { content: ""; position: absolute; top: 5px; left: 0; right: 0; height: 2px; background: var(--zn-200); }
.timeline .step::after { content: ""; position: absolute; top: 0; left: 0; width: 12px; height: 12px; border-radius: 50%;
                         background: var(--background); border: 2px solid var(--zn-300); }
.timeline .step.done { color: var(--foreground); }
.timeline .step.done::before, .timeline .step.done::after { background: var(--zn-900); border-color: var(--zn-900); }
.timeline .step:last-child::before { right: auto; width: 0; }

.success-hero { text-align: center; padding: 20px 0 36px; }
.success-hero .check { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-bg); color: var(--ok);
                       display: inline-flex; align-items: center; justify-content: center; margin-bottom: 18px;
                       animation: pop .5s cubic-bezier(.2,.9,.3,1.4); }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }

/* ---------------------------------------------------------- galleries (photographer) */
.gallery-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.gallery-card { color: var(--foreground); display: block; }
.gallery-card:hover { color: var(--foreground); }
.gallery-card .cover { aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--zn-100); position: relative;
                       display: flex; align-items: center; justify-content: center; }
.gallery-card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.gallery-card:hover .cover img { transform: scale(1.03); }
.gallery-card .gc-title { font-weight: 600; margin-top: 12px; font-size: 15px; }
.gallery-card .gc-sub { color: var(--muted-fg); font-size: 13px; }
.gallery-card .new-flag { position: absolute; top: 12px; left: 12px; background: #fff; border-radius: 999px; padding: 4px 10px;
                          font-size: 12px; font-weight: 600; box-shadow: var(--shadow); }
.share-box { display: flex; gap: 8px; }
.share-box input { font-family: var(--font-mono); font-size: 12.5px; background: var(--zn-50); }
.selection { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; background: var(--background); }
.selection-head { display: flex; gap: 12px; align-items: center; padding: 14px 18px; }
.selection-body { border-top: 1px solid var(--border); padding: 12px 18px; }
.selection .quote { background: var(--zn-50); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; font-style: italic; }
.sel-line { display: flex; gap: 12px; align-items: center; padding: 6px 0; font-size: 13px; }
.sel-line img { width: 36px; height: 36px; object-fit: cover; border-radius: 5px; }

/* ---------------------------------------------------------- public gallery (client view) */
.client-page { background: #fff; }
.client-header { max-width: 1400px; margin: 0 auto; padding: 72px 32px 40px; text-align: center; }
.client-header .by { text-transform: uppercase; letter-spacing: .16em; font-size: 12px; font-weight: 600; color: var(--muted-fg); }
.client-header h1 { font-size: clamp(32px, 5vw, 52px); font-weight: 600; letter-spacing: -0.035em; margin: 12px 0 16px; }
.client-header .message { max-width: 620px; margin: 0 auto; color: var(--zn-600); font-size: 16px; line-height: 1.7; white-space: pre-line; }
.client-grid { max-width: 1400px; margin: 0 auto; padding: 0 32px 140px; --row-h: 300px; }
.client-grid .tile { border-radius: 2px; }
.client-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: 56px; display: flex; align-items: center; padding: 0 20px;
  background: rgba(255,255,255,.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transform: translateY(-100%); transition: transform .25s; border-bottom: 1px solid var(--border);
}
.client-bar.is-open { transform: none; }
.client-bar .t { font-weight: 600; }
.selection-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 500; border-radius: 999px; height: 50px; padding: 0 22px;
  background: var(--zn-900); color: #fff; border: 0; font-weight: 600; font-size: 15px; display: inline-flex; gap: 10px;
  align-items: center; box-shadow: 0 16px 32px -10px rgba(0,0,0,.5); transform: translateY(150%); transition: transform .3s cubic-bezier(.2,.9,.3,1.2);
}
.selection-fab.is-open { transform: none; }
.selection-fab .n { background: #fff; color: var(--zn-900); border-radius: 999px; min-width: 24px; height: 24px; font-size: 12px;
                    display: inline-flex; align-items: center; justify-content: center; padding: 0 7px; }
.tile .fav-badge { position: absolute; top: 10px; right: 10px; background: #fff; color: var(--zn-900); border-radius: 999px;
                   font-size: 12px; font-weight: 600; padding: 3px 9px; box-shadow: var(--shadow); display: inline-flex; gap: 4px; align-items: center; }
.powered { text-align: center; color: var(--zn-400); font-size: 12px; padding: 24px; }
.powered a { color: var(--zn-500); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 1500; background: rgba(12,12,14,.97); display: none; }
.lightbox.is-open { display: flex; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.lb-stage { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; padding: 56px 72px; min-width: 0; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 30px 60px -20px rgba(0,0,0,.6);
                transition: opacity .2s; }
.lb-btn { position: absolute; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.08); color: #fff;
          display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background-color .15s; }
.lb-btn:hover { background: rgba(255,255,255,.18); }
.lb-prev { left: 16px; top: 50%; margin-top: -22px; }
.lb-next { right: 16px; top: 50%; margin-top: -22px; }
.lb-close { right: 16px; top: 16px; }
.lb-counter { position: absolute; left: 20px; top: 24px; color: rgba(255,255,255,.6); font-size: 13px; font-variant-numeric: tabular-nums; }
.lb-panel { width: 360px; background: #fff; overflow-y: auto; padding: 28px 24px; display: flex; flex-direction: column; }
.lb-panel h3 { font-size: 18px; margin-bottom: 4px; }
.lb-panel .panel-sub { color: var(--muted-fg); font-size: 13px; margin-bottom: 22px; }
.lb-lines { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 16px; }
.lb-line { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 13.5px; }
.lb-line .grow { flex: 1; }
.lb-line .x { border: 0; background: none; color: var(--muted-fg); padding: 4px; border-radius: 6px; }
.lb-line .x:hover { background: var(--zn-100); color: var(--foreground); }
.add-row { display: flex; gap: 10px; align-items: center; margin-top: 22px; }
.add-row .btn { flex: 1; height: 40px; border-radius: 999px; }

/* Client selection drawer */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1600; display: none; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); background: #fff; z-index: 1601;
          transform: translateX(100%); transition: transform .3s cubic-bezier(.2,.9,.3,1); display: flex; flex-direction: column;
          box-shadow: -20px 0 40px -20px rgba(0,0,0,.3); }
.drawer.is-open { transform: none; }
.drawer-head { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.drawer-head h3 { font-size: 18px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 24px; }
.drawer-foot { padding: 18px 24px; border-top: 1px solid var(--border); background: var(--zn-50); }

/* ---------------------------------------------------------- lab catalogue */
.price-matrix { width: 100%; border-collapse: separate; border-spacing: 0; }
.price-matrix th, .price-matrix td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.price-matrix thead th { font-size: 12px; font-weight: 600; color: var(--muted-fg); text-transform: uppercase; letter-spacing: .05em;
                         background: var(--zn-50); }
.price-matrix tbody tr:last-child td, .price-matrix tbody tr:last-child th { border-bottom: 0; }
.price-matrix tbody th { font-weight: 600; white-space: nowrap; }
.price-cell { position: relative; }
.price-cell input { width: 100%; min-width: 90px; height: 36px; border: 1px solid transparent; border-radius: 6px; padding: 0 34px 0 10px;
                    background: var(--zn-50); font-variant-numeric: tabular-nums; transition: border-color .15s, background-color .15s; }
.price-cell input:hover { border-color: var(--zn-300); }
.price-cell input:focus { outline: none; border-color: var(--zn-900); background: #fff; box-shadow: 0 0 0 3px rgba(24,24,27,.1); }
.price-cell input:placeholder-shown { background: repeating-linear-gradient(135deg, var(--zn-50), var(--zn-50) 6px, #fff 6px, #fff 12px); }
.price-cell .cur { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); color: var(--muted-fg); font-size: 12px; pointer-events: none; }
.price-cell.saved input { border-color: #86efac; background: var(--ok-bg); }
.price-cell.error input { border-color: var(--destructive); }
.catalog-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); }
.catalog-row:first-child { border-top: 0; }
.catalog-row .grow { flex: 1; min-width: 0; }
.catalog-row .title { font-weight: 600; }
.catalog-row .sub { color: var(--muted-fg); font-size: 13px; }
.catalog-row.inactive .title, .catalog-row.inactive .sub { opacity: .5; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 0; background: none; color: var(--muted-fg);
            display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--zn-100); color: var(--foreground); }
.size-shape { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.size-shape i { display: block; border: 1.5px solid var(--zn-400); border-radius: 2px; background: var(--zn-50); }
.setup-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 28px; }
.setup-step { padding: 18px 20px; border: 1px solid var(--border); border-radius: 12px; display: flex; gap: 12px; }
.setup-step .n { width: 26px; height: 26px; border-radius: 50%; background: var(--zn-100); display: flex; align-items: center;
                 justify-content: center; font-weight: 600; font-size: 13px; flex-shrink: 0; }
.setup-step.done .n { background: var(--zn-900); color: #fff; }

/* ---------------------------------------------------------- landing & auth */
.landing-hero { max-width: var(--page-max); margin: 0 auto; padding: 88px 24px 56px; display: grid;
                grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 500; color: var(--zn-600);
           border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; margin-bottom: 22px; }
.landing-hero h1 { font-size: clamp(38px, 5.2vw, 60px); line-height: 1.04; letter-spacing: -0.045em; font-weight: 650; }
.landing-hero .lead { font-size: 18px; color: var(--zn-600); line-height: 1.6; margin: 22px 0 30px; max-width: 520px; }
.landing-hero .cta { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-art { display: flex; align-items: center; justify-content: center; }
.hero-art img { width: 100%; max-width: 420px; height: auto; display: block; }
.features { max-width: var(--page-max); margin: 0 auto; padding: 24px 24px 96px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature { padding: 28px; border: 1px solid var(--border); border-radius: 16px; }
.feature .fi { width: 44px; height: 44px; border-radius: 12px; background: var(--zn-100); display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.feature h3 { margin-bottom: 8px; }
.feature p { color: var(--muted-fg); margin: 0; }
.landing-footer { border-top: 1px solid var(--border); padding: 28px 24px; text-align: center; color: var(--muted-fg); font-size: 13px; }

.auth-wrap { min-height: calc(100vh - var(--topbar-h)); display: flex; align-items: center; justify-content: center; padding: 40px 20px; background: var(--zn-50); }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 36px 34px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 24px; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted-fg); margin-bottom: 26px; }
.auth-card .btn-block { height: 42px; margin-top: 8px; }
.auth-foot { text-align: center; margin-top: 20px; color: var(--muted-fg); }
.auth-foot a { font-weight: 500; }
.role-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 22px; }
.role-toggle a { border: 1px solid var(--border); border-radius: 10px; padding: 12px; color: var(--foreground); text-align: center; font-weight: 500;
                 display: flex; flex-direction: column; align-items: center; gap: 6px; }
.role-toggle a span { font-size: 12px; color: var(--muted-fg); font-weight: 400; }
.role-toggle a.selected { border-color: var(--zn-900); box-shadow: 0 0 0 1px var(--zn-900); }
.demo-hint { margin-top: 18px; padding: 12px 14px; background: var(--zn-50); border-radius: 10px; font-size: 13px; color: var(--muted-fg); }
.demo-hint code { background: none; color: var(--foreground); padding: 0; font-size: 12px; }

/* Lab picker */
.lab-options { display: grid; gap: 10px; }
.lab-option { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px;
              cursor: pointer; background: #fff; text-align: left; width: 100%; transition: border-color .15s; }
.lab-option:hover { border-color: var(--zn-400); }
.lab-option.selected { border-color: var(--zn-900); box-shadow: 0 0 0 1px var(--zn-900); }
.lab-option[disabled] { opacity: .45; cursor: not-allowed; }
.lab-chip { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted-fg); border: 1px solid var(--border);
            border-radius: 999px; padding: 4px 12px 4px 4px; background: #fff; cursor: pointer; }
.lab-chip .lab-mark { width: 24px; height: 24px; border-radius: 50%; font-size: 11px; }
.lab-chip strong { color: var(--foreground); font-weight: 600; }
.lab-chip:hover { border-color: var(--zn-400); }

.modal-body { color: var(--foreground); }
.modal-content { border-radius: 16px; }
.modal-header { border-bottom: 0; padding-bottom: 4px; }
.modal-header .modal-sub { color: var(--muted-fg); margin: 4px 0 0; }
.modal-footer { border-top: 0; }
.modal-footer .total { margin-right: auto; font-weight: 600; font-size: 15px; }

/* ---------------------------------------------------------- responsive */
@media (max-width: 960px) {
  .layout-aside { grid-template-columns: 1fr; }
  .sticky-aside { position: static; }
  .landing-hero { grid-template-columns: 1fr; padding-top: 48px; }
  .hero-art img { max-width: 240px; }
  .features, .setup-steps, .grid-3 { grid-template-columns: 1fr; }
  .lb-panel { position: absolute; left: 0; right: 0; bottom: 0; width: auto; max-height: 55vh; border-radius: 16px 16px 0 0; }
  .lightbox.is-open { flex-direction: column; }
  .lb-stage { padding: 56px 12px 56vh; }
}
@media (max-width: 640px) {
  .topbar-inner { gap: 12px; padding: 0 14px; }
  .brand span, .cart-button span:not(.count) { display: none; }
  .topnav a { padding: 7px 8px; }
  .page { padding: 24px 16px 120px; }
  .grid-2 { grid-template-columns: 1fr; }
  .cart-item { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 14px; }
  .print-preview { width: 96px; height: 96px; }
  .photo-grid { --row-h: 140px !important; gap: 4px; }
  .client-grid { padding: 0 8px 120px; }
  .action-bar { left: 12px; right: 12px; transform: translateY(140%); padding-left: 16px; overflow-x: auto; }
  .action-bar.is-open { transform: none; }
  .kv { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------- order prints dialog (one row per print) */
.set-all { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; background: var(--zn-50);
           border: 1px solid var(--border); border-radius: 12px; margin-bottom: 14px; }
.set-all-label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-fg); margin-right: auto; }
.set-all select.form-control, .order-row select.form-control { width: auto; height: 34px; padding-top: 4px; padding-bottom: 4px; border-radius: 999px; }
.order-rows { max-height: min(52vh, 520px); overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.order-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.order-row:first-child { border-top: 0; }
.order-row.extra { padding-top: 6px; border-top-style: dashed; }
.order-row .or-thumb { width: 52px; height: 52px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
                       background: var(--zn-100); border-radius: 8px; overflow: hidden; }
.order-row .or-thumb img { max-width: 100%; max-height: 100%; }
.order-row.extra .or-thumb { background: none; color: var(--zn-300); }
.order-row .or-name { flex: 1; min-width: 0; font-size: 13px; }
.order-row .or-name div:first-child { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-row .or-name div + div { color: var(--muted-fg); font-size: 12px; }
.order-row .or-price { width: 72px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.order-row .or-actions { display: flex; gap: 2px; }
@media (max-width: 760px) {
  .order-row { flex-wrap: wrap; }
  .order-row .or-name { flex-basis: calc(100% - 62px); }
  .order-row .or-price { margin-left: auto; }
}
.order-row select[data-f="size"], #all-size { width: 136px !important; }
.order-row select[data-f="paper"], #all-paper { width: 176px !important; text-overflow: ellipsis; }
@media (max-width: 760px) {
  .order-row select[data-f="size"], .order-row select[data-f="paper"] { flex: 1 1 40%; width: auto !important; }
  .set-all-label { flex-basis: 100%; }
  #all-size, #all-paper { flex: 1 1 40%; width: auto !important; }
}

/* Print previews anywhere (cart, client selection) */
.paper { position: relative; overflow: hidden; background: #fff; flex-shrink: 0;
         box-shadow: 0 1px 2px rgba(0,0,0,.1), 0 6px 14px -4px rgba(0,0,0,.2); }
.paper img { position: absolute; max-width: none; }
.crop-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: #1d4ed8;
            background: #dbeafe; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }

/* ---------------------------------------------------------- client crop frame (public gallery lightbox) */
.lb-stage img { position: relative; z-index: 1; }
.lb-paper { position: absolute; z-index: 0; background: #fff; box-shadow: 0 30px 60px -20px rgba(0,0,0,.6); }
.crop-overlay { position: absolute; z-index: 2; overflow: hidden; touch-action: none; cursor: grab; }
.crop-overlay.locked { cursor: default; }
.crop-overlay.dragging { cursor: grabbing; }
/* Trimmed area: striped layer with a hole cut out where the frame is (clip-path set in gallery.js). */
.crop-shade { position: absolute; inset: 0; pointer-events: none; background: var(--trim); }
.crop-frame { position: absolute; outline: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.35), 0 0 0 4px rgba(255,255,255,.18);
              }
.crop-overlay.dragging .crop-frame { transition: none; }
.crop-frame::before, .crop-frame::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to right, transparent calc(33.33% - .5px), rgba(255,255,255,.35) calc(33.33% - .5px), rgba(255,255,255,.35) calc(33.33% + .5px), transparent calc(33.33% + .5px), transparent calc(66.66% - .5px), rgba(255,255,255,.35) calc(66.66% - .5px), rgba(255,255,255,.35) calc(66.66% + .5px), transparent calc(66.66% + .5px)); }
.crop-frame::after { background: linear-gradient(to bottom, transparent calc(33.33% - .5px), rgba(255,255,255,.35) calc(33.33% - .5px), rgba(255,255,255,.35) calc(33.33% + .5px), transparent calc(33.33% + .5px), transparent calc(66.66% - .5px), rgba(255,255,255,.35) calc(66.66% - .5px), rgba(255,255,255,.35) calc(66.66% + .5px), transparent calc(66.66% + .5px)); }
.crop-pill { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: rgba(12,12,14,.8); color: #fff;
             font-size: 12.5px; font-weight: 500; padding: 6px 12px; border-radius: 999px; white-space: nowrap; pointer-events: none;
             display: inline-flex; gap: 6px; align-items: center; transition: opacity .3s; }
.crop-pill:empty { display: none; }
.crop-note { margin-top: 18px; padding: 12px 14px; background: var(--zn-50); border: 1px solid var(--border); border-radius: 12px; }
.crop-note-text { font-size: 13px; color: var(--zn-700); margin: 0; }
.crop-note-text .icon { vertical-align: -2px; margin-right: 2px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px; }
.seg button { border: 1px solid var(--border); background: #fff; border-radius: 10px; padding: 8px 10px; text-align: left; line-height: 1.3; }
.seg button strong { display: block; font-size: 13px; font-weight: 600; }
.seg button small { color: var(--muted-fg); font-size: 12px; }
.seg button.selected { border-color: var(--zn-900); box-shadow: 0 0 0 1px var(--zn-900); }
.lb-line .adjust { border: 0; background: none; color: var(--muted-fg); padding: 4px; border-radius: 6px; }
.lb-line .adjust:hover { background: var(--zn-100); color: var(--foreground); }
.lb-line.editing { background: var(--zn-50); border-radius: 8px; padding-left: 6px; padding-right: 6px; }
.sel-preview { width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.crop-stage { position: relative; }
.crop-fit-view { display: none; position: absolute; inset: 0; z-index: 5; align-items: center; justify-content: center; background: #111; }
.crop-stage.fit-mode .crop-fit-view { display: flex; }
.seg-inline { margin-top: 0; grid-template-columns: auto auto; }
.seg-inline button { padding: 7px 12px; }
.seg-inline button strong { font-size: 13px; }
.crop-note-text.trim { color: var(--muted-fg); }
.crop-note-text.trim strong { color: var(--foreground); font-weight: 600; }

/* Cart thumbnail: the whole photo, with the trimmed parts under a 50% gray border. */
.crop-thumb { position: relative; overflow: hidden; flex-shrink: 0; box-shadow: 0 1px 2px rgba(0,0,0,.1), 0 6px 14px -4px rgba(0,0,0,.2); }
.crop-thumb img { display: block; width: 100%; height: 100%; }
.crop-thumb .frame { position: absolute; box-shadow: 0 0 0 999px var(--trim); outline: 1px solid #fff; }

/* Lab order: print file preparation */
.files-status { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; font-size: 13px; color: var(--muted-fg); }
.files-status[data-status="ready"] { color: var(--ok); }
.files-status[data-status="failed"] { color: #b91c1c; }
.files-status a { color: inherit; text-decoration: underline; }
.spinner { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--zn-300); border-top-color: var(--zn-700);
           animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------- photo viewer (library, gallery editor) */
.viewer { background: #0c0c0e; }                  /* opaque: nothing of the page shows through */
.viewer .lb-stage { padding: 56px 72px 96px; }
.viewer-img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 30px 60px -20px rgba(0,0,0,.6); transition: opacity .2s; }
.viewer-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 24px; display: flex; align-items: center; gap: 16px;
                  justify-content: center; color: #fff; }
.viewer-text { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.viewer-text strong { font-weight: 600; font-size: 15px; max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-text span { font-size: 12.5px; color: rgba(255,255,255,.6); font-variant-numeric: tabular-nums; }
.viewer-select { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 999px;
                 border: 1px solid rgba(255,255,255,.35); background: transparent; color: #fff; font-weight: 500; }
.viewer-select:hover { background: rgba(255,255,255,.12); }
.viewer-select.on { background: #fff; color: var(--zn-900); border-color: #fff; }
.viewer-select .ring { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; display: inline-block; }
@media (max-width: 640px) { .viewer .lb-stage { padding: 56px 8px 110px; } .viewer-caption { flex-direction: column; gap: 10px; } }

/* Tiles that open the viewer: the tick selects, the photo opens. */
.photo-grid.viewable .tile { cursor: zoom-in; }
.photo-grid.viewable .tile .tile-check { cursor: pointer; width: 28px; height: 28px; top: 8px; left: 8px; }
.photo-grid.viewable .tile .tile-check::after { content: ""; position: absolute; inset: -10px; }   /* easier to hit */
.photo-grid.viewable .tile .tile-check:hover { background: rgba(0,0,0,.45); }
.photo-grid.viewable .tile.selected .tile-check:hover { background: var(--sel); }
@media (hover: none) {        /* touch screens: no hover, so always show the tick */
  .photo-grid.viewable .tile .tile-check, .photo-grid.viewable .tile .tile-shade { opacity: 1; }
}

/* Client gallery: make saving photos awkward (no drag, no long-press menu, no selection) */
.client-page img { -webkit-user-drag: none; user-drag: none; -webkit-touch-callout: none; user-select: none;
                   -webkit-user-select: none; }

/* ---------------------------------------------------------- a lab's own site */
.brand-lab { gap: 10px; }
.brand-lab img { max-height: 36px; max-width: 220px; display: block; }
.brand-lab .lab-mark { width: 32px; height: 32px; border-radius: 8px; font-size: 14px; }
.site-lab .brand-lab .lab-mark, .site-lab .avatar, .site-lab .cart-button .count { background: var(--brand, var(--zn-900)); color: var(--brand-fg, #fff); }
.site-lab .btn-primary { background: var(--brand, var(--zn-900)); border-color: var(--brand, var(--zn-900)); color: var(--brand-fg, #fff); }
.site-lab .btn-primary:hover, .site-lab .btn-primary:focus { background: var(--brand, var(--zn-700)); border-color: var(--brand, var(--zn-700));
                                                              color: var(--brand-fg, #fff); filter: brightness(1.1); }
.lab-hero { max-width: 760px; margin: 0 auto; padding: 96px 24px 48px; text-align: center; }
.lab-hero .lab-logo { max-height: 72px; max-width: 320px; margin: 0 auto 28px; display: block; }
.lab-hero h1 { font-size: clamp(34px, 5vw, 52px); letter-spacing: -0.04em; line-height: 1.08; }
.lab-hero .lead { font-size: 18px; color: var(--zn-600); line-height: 1.6; margin: 20px auto 30px; white-space: pre-line; max-width: 600px; }
.lab-hero .cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.lab-prices { max-width: 760px; margin: 0 auto; padding: 0 24px 96px; }
.lab-prices .list-card { margin-top: 12px; }
.powered-by { text-align: center; color: var(--zn-400); font-size: 12px; padding: 24px; }
.powered-by a { color: var(--zn-500); }
.form-group .check-row { display: flex; }      /* not the block layout of other form labels */

/* ---------------------------------------------------------- galleries first */
.first-gallery { max-width: 620px; margin: 40px auto 0; text-align: center; padding: 48px 24px 56px; }
.first-gallery h1 { font-size: 32px; margin-bottom: 10px; }
.first-gallery > p { color: var(--muted-fg); font-size: 16px; line-height: 1.6; margin: 0 auto 26px; }
.first-gallery-art { position: relative; width: 180px; height: 120px; margin: 0 auto 30px; }
.first-gallery-art span { position: absolute; width: 96px; height: 72px; border-radius: 6px; border: 6px solid #fff;
  box-shadow: 0 12px 24px -8px rgba(0,0,0,.3), 0 0 0 1px rgba(0,0,0,.05); }
.first-gallery-art span:nth-child(1) { left: 6px; top: 26px; transform: rotate(-8deg); background: linear-gradient(180deg,#8cbad6,#e6eef0 55%,#5f7882 56%,#304248); }
.first-gallery-art span:nth-child(2) { right: 6px; top: 20px; transform: rotate(7deg); background: linear-gradient(180deg,#222a4f,#f3a26e 60%,#3c3255 61%,#1e1a30); }
.first-gallery-art span:nth-child(3) { left: 42px; top: 4px; background: linear-gradient(180deg,#fad6a5,#f6ae8c 58%,#966060 59%,#5c3a42); }
.first-steps { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 0; margin: 40px 0 0; text-align: left; }
.first-steps li { counter-increment: step; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px 16px; font-size: 13px; color: var(--muted-fg); }
.first-steps li::before { content: counter(step); display: inline-flex; width: 24px; height: 24px; border-radius: 50%; background: var(--zn-100);
  color: var(--foreground); font-weight: 600; font-size: 12px; align-items: center; justify-content: center; margin-bottom: 8px; }
.first-steps li strong { display: block; color: var(--foreground); font-weight: 600; font-size: 14px; }
.purpose-tag { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; background: var(--zn-100); color: var(--zn-700);
  border-radius: 999px; padding: 2px 10px; margin-right: 8px; vertical-align: 1px; }
.purpose-choices .choice-text span { display: block; }
@media (max-width: 640px) { .first-steps { grid-template-columns: 1fr; } }
.form-group .choice { display: flex; }        /* choice cards inside forms keep their row layout */

/* A switch: <label class="switch"><input type="checkbox"><span class="switch-track"></span> Text</label> */
.switch { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; font-weight: 500;
          color: var(--foreground); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; width: 34px; height: 20px; border-radius: 999px; background: var(--zn-300, #d4d4d8);
                transition: background-color .15s; flex: none; }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
                       background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + .switch-track { background: var(--zn-900); }
.switch input:checked + .switch-track::after { transform: translateX(14px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px rgba(24,24,27,.2); }
.photo-grid.only-selected .tile:not(.selected):not(.uploading) { display: none; }
.none-selected { text-align: center; padding: 48px 0; }
.watermark-text { margin: 0 0 14px 26px; max-width: 360px; }   /* lined up under the checkbox's text */
