@import url('./design-system.css');
.app-header, .workspace-nav, main { max-width: var(--page-width); margin-inline: auto; }
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: calc(1rem + env(safe-area-inset-top)) 1.25rem .625rem; }
.brand { color: var(--ink); font-size: 1.25rem; letter-spacing: -.045em; font-weight: 750; text-decoration: none; min-height: var(--hit); display: inline-flex; align-items: center; }
.app-header .quiet { padding-right: 0; }
.workspace-nav { display: flex; gap: .25rem; padding: .25rem; width: calc(100% - 2.5rem); background: var(--selection); border-radius: 1rem; }
.workspace-nav button { flex: 1; min-height: var(--hit); border: 0; background: transparent; border-radius: .75rem; font-weight: 600; }
.workspace-nav button[aria-current] { background: white; box-shadow: 0 1px 4px #2028220d; }
main { padding: 1.5rem 1.25rem calc(2rem + env(safe-area-inset-bottom)); }
main:focus { outline: none; }
body[data-action="true"] main { padding-bottom: calc(var(--dock-height,9.5rem) + 1.5rem); }
.page-heading { display: grid; gap: .625rem; margin-bottom: 1.25rem; }
.example { overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; position: relative; border-radius: var(--radius-card); gap: 3px; background: white; }
.example figure { margin: 0; position: relative; overflow: hidden; }
.example img { display: block; width: 100%; height: clamp(12rem, 32vh, 20rem); object-fit: cover; object-position: center 56%; }
.image-label { position: absolute; bottom: .75rem; left: .75rem; padding: .375rem .625rem; background: #ffffffed; color: var(--ink); border-radius: .625rem; font-size: var(--font-support); font-weight: 600; }
.example-mark { position: absolute; left: 50%; top: 50%; translate: -50% -50%; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; background: white; border-radius: 50%; box-shadow: 0 2px 14px #20282215; }
.photo-entry { padding-top: 1.25rem; display: grid; gap: .75rem; }
.photo-entry .sample { margin: 0 auto; }
.selected-photo { padding: .75rem; }
.photo { display: block; width: 100%; max-height: 26rem; object-fit: contain; border-radius: .875rem; }
.selected-photo .row { margin-top: .75rem; }
.photo-disclosure { text-align: center; margin-top: .75rem; }
.context-card { display: flex; align-items: center; gap: .875rem; width: 100%; border: 0; text-align: left; padding: .75rem; background: white; border-radius: 1rem; margin-bottom: 1.25rem; }
.context-card img { width: 3rem; height: 3.5rem; object-fit: cover; border-radius: .625rem; }
.context-card .context-copy { display: grid; gap: .125rem; flex: 1; }
.context-card .context-action { font-size: var(--font-support); color: var(--action); padding-inline: .5rem; }
.context-card .context-copy span { font-size: var(--font-support); color: var(--muted); }
.style-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,9rem),1fr)); gap: 1rem .75rem; }
.style-card { position: relative; border: 2px solid transparent; border-radius: 1rem; padding: .25rem; background: transparent; text-align: left; min-width: 0; }
.style-card img { display: block; width: 100%; aspect-ratio: 1.4; object-fit: cover; border-radius: .75rem; }
.style-card strong { display: block; padding: .625rem .25rem .375rem; overflow-wrap: anywhere; font-size: var(--font-body); line-height: 1.3; font-weight: 600; }
.style-card[aria-pressed="true"] { border-color: var(--action); background: var(--selection); }
.selection-check { position: absolute; top: .75rem; right: .75rem; display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border: 2px solid white; border-radius: 50%; background: var(--action); color: white; }
.selection-check svg { width: 1rem; height: 1rem; stroke-width: 2.5; }
.action-dock { position: fixed; z-index: 3; bottom: 0; left: 0; right: 0; padding: 1rem 1.25rem calc(.875rem + env(safe-area-inset-bottom)); background: var(--canvas); border-top: 1px solid var(--line); }
.action-dock > div { max-width: calc(var(--page-width) - 2.5rem); margin: auto; display: grid; gap: .625rem; }
.action-dock p { text-align: center; }
.action-dock .primary { box-shadow: 0 4px 14px #243c3110; }
.status-card { padding: 1.5rem; display: grid; justify-items: center; text-align: center; gap: 1rem; }
.status-photo { width: min(100%, 15rem); max-height: 15rem; object-fit: contain; border-radius: 1rem; }
.spinner { width: 2.25rem; height: 2.25rem; border: 3px solid var(--line); border-top-color: var(--action); border-radius: 50%; animation: spin .9s linear infinite; }
.spinner.small { display: inline-block; width: 1.125rem; height: 1.125rem; vertical-align: middle; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.compare { position: relative; overflow: hidden; border-radius: var(--radius-card); background: var(--selection); max-width: 28rem; margin: auto; }
.compare img { width: 100%; height: auto; display: block; }
.compare .before { position: absolute; inset: 0; height: 100%; object-fit: fill; clip-path: inset(0 calc(100% - var(--split,50%)) 0 0); }
.compare .divider { position: absolute; top: 0; bottom: 0; left: var(--split,50%); width: 2px; background: white; pointer-events: none; }
.compare .divider::after { content: '↔'; position: absolute; top: 50%; left: -1.375rem; background: white; width: 2.75rem; height: 2.75rem; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 2px 12px #0003; }
.compare input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; touch-action: pan-y; }
.compare:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.compare .image-label { bottom: auto; top: .75rem; pointer-events: none; }
.compare .image-label.right { left: auto; right: .75rem; }
.compare-note { margin-top: .75rem; text-align: center; }
.result-actions { display: grid; gap: .75rem; margin-top: 1.25rem; }
.history-heading { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: 1.5rem; }
.history-heading h1 { font-size: 1.875rem; }
.history-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,9rem),1fr)); gap: 1.25rem .75rem; }
.history-item { min-width: 0; border: 0; background: white; border-radius: 1rem; text-align: left; overflow: hidden; padding: 0 0 .875rem; }
.history-item img, .history-placeholder { width: 100%; aspect-ratio: 1.15; object-fit: cover; display: block; }
.history-placeholder { background: var(--selection); display: grid; place-items: center; }
.history-item strong, .history-item time, .history-item .support { display: block; margin: .625rem .875rem 0; }
.history-item strong { font-size: var(--font-body); }
.history-item time { font-size: var(--font-support); color: var(--muted); }
.empty-state { padding: 2.5rem 1.25rem; display: grid; justify-items: center; text-align: center; gap: 1rem; }
.empty-state > svg { width: 2.5rem; height: 2.5rem; color: var(--muted); }
.empty-state .primary { margin-top: .5rem; }
.notice { margin-top: 1rem; }
.screen-enter { animation: enter .24s var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
body:has(dialog[open]) { overflow: hidden; }
dialog { border: 0; border-radius: 1.5rem; padding: 0 1.5rem 1.5rem; width: min(32rem,calc(100% - 2rem)); max-height: 90dvh; color: var(--ink); background: var(--canvas); overscroll-behavior: contain; }
dialog::backdrop { background: #14251d99; backdrop-filter: blur(4px); }
.modal-bar { display: flex; justify-content: flex-end; position: sticky; top: 0; padding: .75rem 0 .5rem; z-index: 5; background: var(--canvas); }
.close { border: 0; background: var(--selection); color: var(--action); border-radius: 50%; font-size: 1.5rem; width: var(--hit); height: var(--hit); line-height: 1; }
#modal-content { display: grid; gap: 1.25rem; }
dialog h2 { font-size: 1.75rem; }
dialog label { display: block; font-weight: 600; }
dialog input:not([type="radio"]) { width: 100%; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-control); background: white; margin-top: .5rem; font-size: 1.0625rem; }
dialog form { display: grid; gap: 1rem; }
dialog form .error { margin: 0; }
dialog input[name="code"] { font-size: 1.5rem; letter-spacing: .15em; font-variant-numeric: tabular-nums; }
.dialog-heading { display: grid; gap: .75rem; }
#social-options:empty { display: none; }
#social-options { display: grid; gap: 1.25rem; }
.social-signin { display: grid; gap: .75rem; }
.provider-button { width: 100%; min-height: var(--control); display: grid; grid-template-columns: 1.5rem 1fr 1.5rem; gap: .625rem; align-items: center; padding: .875rem 1rem; border: 1px solid #747775; border-radius: var(--radius-control); background: white; color: #1f1f1f; font-weight: 500; line-height: 1.35; }
.provider-button.apple { background: #000; color: #fff; border-color: #000; }
.provider-button .provider-mark { width: 1.25rem; height: 1.25rem; fill: none; stroke: none; }
.auth-divider { display: flex; align-items: center; gap: 1rem; color: var(--muted); font-size: var(--font-support); }
.auth-divider::before, .auth-divider::after { content: ''; height: 1px; background: var(--line); flex: 1; }
.auth-legal { display: flex; gap: .625rem; justify-content: flex-start; }
.auth-callback { padding: 3rem 1.5rem; display: grid; gap: 1.5rem; }
.account-identity { display: flex; align-items: center; gap: .875rem; background: white; padding: 1rem; border-radius: var(--radius-card); }
.account-identity .avatar { display: grid; place-items: center; background: var(--selection); color: var(--action); border-radius: 50%; width: 2.75rem; height: 2.75rem; flex: 0 0 auto; }
.account-identity p { overflow-wrap: anywhere; color: var(--ink); }
.settings-group { background: white; border-radius: var(--radius-card); overflow: hidden; }
.settings-row { display: flex; align-items: center; gap: .875rem; min-height: 3.75rem; width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 1rem; text-align: left; font-size: var(--font-body); text-decoration: none; color: var(--ink); }
.settings-row:last-child { border: 0; }
.settings-row > span { flex: 1; }
.settings-row > svg:last-child { width: 1rem; color: var(--muted); }
.settings-row .support { display: block; margin-top: .25rem; }
.danger { color: var(--error); }
.account-footer { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.account-footer a { min-height: var(--hit); display: inline-flex; align-items: center; font-size: var(--font-support); }
.support-id { overflow-wrap: anywhere; font-family: monospace; font-size: var(--font-support); }
.subscription-state { display: grid; gap: 1rem; }
.subscription-state > p { margin: 0; }
.paywall-example .example img { height: 9rem; }
.paywall-title { text-align: center; }
.checkout-plans { display: grid; gap: .75rem; }
.checkout-plan { display: flex; align-items: center; gap: .75rem; padding: .875rem; border: 2px solid var(--line); border-radius: 1rem; background: white; cursor: pointer; }
.checkout-plan:has(input:checked) { border-color: var(--action); background: var(--selection); }
.checkout-plan input { margin: 0; width: 1.25rem; height: 1.25rem; accent-color: var(--action); flex: 0 0 auto; }
.checkout-plan .plan-copy { flex: 1; min-width: 0; }
.checkout-plan strong { display: block; font-size: var(--font-body); }
.checkout-plan .support { display: block; margin-top: .25rem; font-weight: 400; }
.plan-price { text-align: right; white-space: nowrap; }
.plan-price span { display: block; font-size: var(--font-support); font-weight: 400; color: var(--muted); }
.purchase-terms { text-align: center; font-size: var(--font-support); line-height: 1.45; }
.purchase-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }
.purchase-links a { min-height: var(--hit); display: inline-flex; align-items: center; font-size: var(--font-support); }
.test-badge { background: var(--selection); color: var(--action); padding: .5rem .75rem; border-radius: .75rem; font-size: var(--font-support); }
.analytics-choice { display: grid; gap: 1rem; }
.analytics-choice p { margin: 0; }
#notice { position: fixed; z-index: 20; top: calc(1rem + env(safe-area-inset-top)); left: 50%; translate: -50% 0; background: var(--ink); color: white; border-radius: 1rem; padding: 1rem 1.25rem; width: max-content; max-width: min(90%,32rem); box-shadow: 0 6px 30px #0002; display: none; }
@media (min-width: 600px) {
  :root { --font-title: 2.25rem; }
  .app-header { padding-top: 1.25rem; }
  main { padding-top: 2rem; }
  .style-grid { grid-template-columns: repeat(auto-fit,minmax(min(100%,11rem),1fr)); gap: 1.25rem; }
  .style-card img { aspect-ratio: 1.2; }
  .history-grid { grid-template-columns: repeat(auto-fit,minmax(min(100%,11rem),1fr)); }
  .photo-entry .row { max-width: 28rem; width: 100%; margin: auto; }
}
@media (max-width: 599px) {
  dialog { width: 100%; max-width: none; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; padding: 0 1.25rem calc(1.5rem + env(safe-area-inset-bottom)); }
  .modal-bar { padding-top: calc(.75rem + env(safe-area-inset-top)); }
}
@media (max-width: 359px) {
  .app-header, main { padding-inline: 1rem; }
  .workspace-nav { width: calc(100% - 2rem); }
  .plan-price { white-space: normal; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .action-dock { position: static; border: 0; margin-top: 1.5rem; padding-inline: 0; }
  body[data-action="true"] main { padding-bottom: 2rem; }
}
/* The offer scrolls independently; purchase and its essential terms stay together. */
dialog.paywall[open] { display: flex; flex-direction: column; height: min(56rem,90dvh); padding-bottom: 0; overflow: hidden; }
dialog.paywall #modal-content { flex: 1; min-height: 0; display: block; }
dialog.paywall form.paywall-layout { height: 100%; display: flex; flex-direction: column; gap: 0; }
.paywall-scroll { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; display: grid; align-content: start; gap: 1rem; padding: .25rem .25rem 1rem; }
.paywall-scroll .paywall-example .example img { height: clamp(6rem,16vh,9rem); }
.paywall-scroll .dialog-heading { gap: .5rem; }
.paywall-scroll .paywall-title h2 { font-size: 1.5rem; }
.purchase-dock { display: grid; gap: .625rem; flex-shrink: 0; border-top: 1px solid var(--line); background: var(--canvas); padding: .875rem 0 calc(1rem + env(safe-area-inset-bottom)); }
#checkout-status:empty { display: none; }
#checkout-status { font-size: var(--font-support); }
@media(max-width:599px) { dialog.paywall[open] { height: 100dvh; max-height: 100dvh; } }
@media(max-height:560px) { dialog.paywall[open] { overflow: auto; } dialog.paywall #modal-content { flex: none; } dialog.paywall .paywall-scroll { overflow: visible; } }
/* Native paywall's compact variant: reduce decoration before reducing type. */
@media (max-height: 740px) and (min-height: 561px) {
  .paywall-scroll .paywall-example .example img { height: 4rem; }
  .paywall-scroll { gap: .75rem; }
  .paywall-scroll .paywall-title h2 { font-size: 1.375rem; }
  .paywall-scroll .paywall-title p { display: none; }
  .checkout-plan { padding: .625rem .75rem; }
}
/* The completed result is the task. Keep the whole image visible, never stretch it. */
.result-screen .context-card { padding: .5rem .75rem; margin-bottom: 1rem; }
.result-screen .context-card img { width: 2.5rem; height: 2.75rem; }
.result-screen .context-copy span { display: none; }
.result-screen .page-heading { margin-bottom: 1rem; }
.result-screen h1 { font-size: 1.75rem; }
.result-screen .compare { height: clamp(16rem,calc(100svh - 24rem),36rem); }
.result-screen .compare img { width: 100%; height: 100%; object-fit: contain; }
.result-screen .result-actions { margin-top: 1rem; }
/* One integrated vertical journey. Each marker belongs to the content beside it. */
.creation-flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; }
.flow-step { position: relative; display: grid; grid-template-columns: 1.5rem minmax(0,1fr); gap: .625rem; }
.flow-step.completed::before { content: ''; position: absolute; top: 1.5rem; bottom: -1.25rem; left: .71875rem; width: 1px; background: var(--line); }
.flow-marker { position: relative; z-index: 1; display: grid; place-items: center; width: 1.5rem; height: 1.5rem; margin-top: .25rem; background: var(--action); color: white; border-radius: 50%; font-size: var(--font-support); font-weight: 650; }
.flow-marker svg { width: 1rem; height: 1rem; stroke-width: 2.2; }
.completed .flow-marker { margin-top: 1.25rem; color: var(--action); background: var(--selection); }
.flow-content { min-width: 0; }
.flow-content .context-card { margin-bottom: 0; }
.flow-content .page-heading { margin-bottom: 1rem; }
.flow-content .photo-entry .row { width: 100%; }
.flow-content .photo-entry .sample { margin: 0; }
.flow-content .photo-entry .quiet { padding-inline: .25rem; }
.result-screen .creation-flow { gap: .75rem; }
.result-screen .flow-step.completed::before { bottom: -.75rem; }
.result-screen .completed .flow-marker { margin-top: .875rem; }
.result-screen .context-card { padding: .5rem; }
.result-screen .context-card img { width: 2rem; height: 2.25rem; }
.result-screen .compare { height: clamp(16rem,calc(100svh - 26rem),36rem); }
@media(max-width:599px) { .app-header, main { padding-inline: 1rem; } .workspace-nav { width: calc(100% - 2rem); } }
@media(min-width:600px) { .flow-step { grid-template-columns: 1.75rem minmax(0,1fr); gap: 1rem; } .flow-marker { width: 1.75rem; height: 1.75rem; } .flow-step.completed::before { left: .84375rem; top: 1.75rem; } }

.header-actions { display: flex; align-items: center; gap: .5rem; }
.header-actions .quiet { padding-right: .5rem; }
.menu-button { background: transparent; }
.auth-switch { min-height: var(--hit); padding: .625rem 0; border: 0; color: var(--action); background: none; font: inherit; text-align: left; justify-self: start; text-decoration: underline; text-underline-offset: .2em; }
