:root {
  --to-ink: #181914;
  --to-muted: #696a62;
  --to-paper: #f5f2e9;
  --to-card: #fffdf8;
  --to-line: #ddd8ca;
  --to-gold: #d4a84f;
  --to-gold-dark: #9b701e;
  --to-sage: #dfe9dc;
  --to-danger: #a63e35;
  --to-radius: 22px;
  --to-shadow: 0 22px 70px rgba(38, 35, 24, .10);
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; color: var(--to-ink); background: var(--to-paper); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.5; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }
.to-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.to-skip { position: fixed; top: 8px; left: 8px; z-index: 100; padding: .7rem 1rem; background: #fff; border-radius: 8px; transform: translateY(-140%); }
.to-skip:focus { transform: none; }

.to-header { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 12px clamp(18px, 4vw, 64px); background: rgba(255, 253, 248, .92); border-bottom: 1px solid rgba(24, 25, 20, .08); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 30; }
.to-brand { display: inline-flex; align-items: center; gap: .75rem; text-decoration: none; }
.to-brand img { width: 48px; height: 48px; object-fit: contain; border-radius: 50%; }
.to-brand span { display: grid; line-height: 1.1; }
.to-brand b { font-family: Georgia, "Times New Roman", serif; font-size: 1.18rem; letter-spacing: .02em; }
.to-brand small { color: var(--to-muted); margin-top: .28rem; font-size: .72rem; }
.to-header nav { display: flex; align-items: center; gap: .45rem; }
.to-header nav a { color: var(--to-muted); text-decoration: none; padding: .6rem .8rem; border-radius: 999px; font-size: .9rem; }
.to-header nav a:hover, .to-header nav a:focus-visible { color: var(--to-ink); background: #eee9dc; }
.to-header__cart { border: 1px solid var(--to-line); color: var(--to-ink) !important; }
.to-header__cart span { display: inline-grid; place-items: center; min-width: 1.35rem; height: 1.35rem; padding: 0 .28rem; border-radius: 999px; background: var(--to-ink); color: #fff; font-size: .72rem; }

.to-shell { width: min(1560px, calc(100% - 36px)); margin: 0 auto; padding: clamp(36px, 6vw, 88px) 0 70px; }
.to-intro { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: clamp(28px, 4vw, 52px); }
.to-intro > div:first-child { max-width: 780px; }
.to-kicker { display: block; margin-bottom: .7rem; color: var(--to-gold-dark); text-transform: uppercase; letter-spacing: .18em; font-weight: 800; font-size: .73rem; }
.to-intro h1 { margin: 0; max-width: 750px; font: 500 clamp(2.25rem, 5vw, 4.9rem)/.98 Georgia, "Times New Roman", serif; letter-spacing: -.045em; }
.to-intro p { max-width: 690px; margin: 1.2rem 0 0; color: var(--to-muted); font-size: clamp(1rem, 1.3vw, 1.17rem); }
.to-privacy { flex: 0 0 295px; display: flex; align-items: center; gap: .8rem; padding: .9rem 1rem; border: 1px solid #cad9c6; background: var(--to-sage); border-radius: 16px; }
.to-privacy__icon { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border-radius: 50%; color: #fff; background: #466242; font-weight: 900; }
.to-privacy div { display: grid; }
.to-privacy b { font-size: .88rem; }
.to-privacy small { color: #50604d; font-size: .74rem; line-height: 1.35; }

.to-workspace { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(350px, .72fr); gap: clamp(18px, 2.5vw, 34px); align-items: start; }
.to-stage-card, .to-choice, .to-manage-panel { background: var(--to-card); border: 1px solid rgba(58, 53, 36, .10); border-radius: var(--to-radius); box-shadow: var(--to-shadow); }
.to-stage-card { overflow: hidden; padding: clamp(16px, 2vw, 26px); }
.to-stage-head, .to-choice__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 18px; }
.to-stage-head > div:first-child, .to-choice__head { align-items: center; }
.to-stage-head > div:first-child, .to-choice__head > div { display: flex; align-items: center; gap: .7rem; }
.to-stage-head h2, .to-choice h2, .to-manage-panel h2 { margin: 0; font: 600 1.35rem/1.1 Georgia, "Times New Roman", serif; }
.to-choice__head > div { align-items: flex-start; flex-direction: column; gap: .15rem; }
.to-choice__head p { margin: 0; color: var(--to-muted); font-size: .76rem; }
.to-step { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; color: var(--to-gold-dark); background: #f3e7c8; border-radius: 50%; font: 800 .73rem/1 Inter, sans-serif; }
.to-mode-tabs { display: flex; padding: 3px; background: #eee9dd; border-radius: 999px; }
.to-mode-tabs button { border: 0; background: transparent; color: var(--to-muted); padding: .48rem .8rem; border-radius: 999px; cursor: pointer; font-size: .82rem; font-weight: 700; }
.to-mode-tabs button[aria-selected="true"] { color: var(--to-ink); background: #fff; box-shadow: 0 2px 10px rgba(30, 28, 20, .09); }

.to-stage { position: relative; overflow: hidden; aspect-ratio: 4/3; min-height: 360px; background: radial-gradient(circle at 50% 34%, #fbfaf6 0 27%, #e9e5da 78%); border-radius: 17px; isolation: isolate; user-select: none; touch-action: none; }
.to-stage canvas, .to-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.to-stage video { z-index: 1; transform: scaleX(-1); }
.to-stage canvas { z-index: 2; }
.to-start { position: absolute; inset: 0; z-index: 4; display: grid; place-content: center; justify-items: center; padding: 2rem; text-align: center; background: linear-gradient(145deg, rgba(255,255,255,.78), rgba(235,230,218,.88)); }
.to-start__mark { position: relative; width: 92px; height: 92px; margin-bottom: 1rem; border: 1px solid rgba(24,25,20,.12); border-radius: 46% 46% 50% 50%; background: #e2c5a8; box-shadow: inset 0 -14px 0 rgba(107,71,45,.08); }
.to-start__mark::before { content: ""; position: absolute; width: 105px; height: 45px; left: -7px; top: 20px; border: 8px solid #30312c; border-top-width: 5px; border-radius: 28px 28px 18px 18px; clip-path: polygon(0 0, 43% 0, 47% 35%, 53% 35%, 57% 0, 100% 0, 100% 100%, 57% 100%, 53% 58%, 47% 58%, 43% 100%, 0 100%); }
.to-start__mark span { position: absolute; top: 47px; width: 7px; height: 7px; background: #342419; border-radius: 50%; }
.to-start__mark span:first-child { left: 27px; }
.to-start__mark span:last-child { right: 27px; }
.to-start h3 { margin: .2rem 0 .35rem; font: 600 1.5rem Georgia, serif; }
.to-start p { margin: 0 0 1.1rem; color: var(--to-muted); max-width: 350px; }
.to-start small { color: var(--to-muted); margin-top: .8rem; font-size: .72rem; }
.to-start__actions { display: flex; gap: .65rem; flex-wrap: wrap; justify-content: center; }
.to-stage-badge { position: absolute; z-index: 6; top: 12px; left: 12px; color: #30462d; background: rgba(225,238,221,.9); border: 1px solid rgba(67,95,62,.22); border-radius: 999px; padding: .38rem .65rem; font-size: .68rem; font-weight: 800; backdrop-filter: blur(8px); }
.to-eye-guide { position: absolute; inset: 0; z-index: 7; }
.to-eye-guide button { position: absolute; width: 22px; height: 22px; padding: 0; border: 3px solid #fff; border-radius: 50%; background: var(--to-gold); box-shadow: 0 0 0 2px #171713, 0 4px 12px rgba(0,0,0,.25); cursor: grab; transform: translate(-50%, -50%); }
.to-eye-guide button:first-child { left: 38%; top: 43%; }
.to-eye-guide button:nth-child(2) { left: 62%; top: 43%; }
.to-eye-guide span { position: absolute; left: 38%; top: 43%; width: 24%; border-top: 1px dashed #fff; filter: drop-shadow(0 1px #111); }

.to-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .65rem 1rem; color: var(--to-ink); background: #fffdf8; border: 1px solid var(--to-line); border-radius: 11px; text-decoration: none; cursor: pointer; font-weight: 800; font-size: .85rem; transition: transform .15s ease, border-color .15s ease, background .15s ease; }
.to-btn:hover:not(:disabled), .to-btn:focus-visible:not(:disabled) { transform: translateY(-1px); border-color: #aaa18c; }
.to-btn:focus-visible, .to-link:focus-visible, .to-frame:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(212,168,79,.42); outline-offset: 2px; }
.to-btn--primary { background: var(--to-ink); border-color: var(--to-ink); color: #fff; }
.to-btn--danger { color: var(--to-danger); border-color: #d8aaa5; background: #fff8f7; }
.to-btn:disabled { cursor: not-allowed; opacity: .45; }
.to-link { border: 0; padding: .25rem; background: transparent; color: var(--to-gold-dark); cursor: pointer; font-size: .78rem; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.to-camera-actions { justify-content: center; gap: .65rem; padding: 14px 0 0; }
.to-camera-actions:not([hidden]) { display: flex; }

.to-adjust { display: grid; grid-template-columns: minmax(150px, 1.2fr) minmax(105px, 1fr) repeat(4, auto); align-items: end; gap: .8rem; padding: 16px 3px 2px; }
.to-adjust__title { display: grid; }
.to-adjust__title span { color: var(--to-muted); font-size: .72rem; }
.to-adjust label { display: grid; gap: .2rem; color: var(--to-muted); font-size: .7rem; font-weight: 800; }
.to-adjust input[type="range"] { accent-color: var(--to-gold-dark); width: 100%; }

.to-builder { margin-top: 16px; padding: 18px; border: 1px solid var(--to-line); border-radius: 15px; background: #faf7ef; }
.to-builder__head { display: grid; margin-bottom: 14px; }
.to-builder__head span { color: var(--to-muted); font-size: .75rem; }
.to-builder__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.to-builder label { display: grid; gap: .3rem; color: var(--to-muted); font-size: .7rem; font-weight: 800; }
.to-builder select, .to-search input { width: 100%; min-height: 42px; padding: .55rem .7rem; color: var(--to-ink); background: #fff; border: 1px solid var(--to-line); border-radius: 9px; }
.to-save-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 16px; padding: 14px 16px; border: 1px solid #e4d4a9; background: #fcf6e7; border-radius: 14px; }
.to-save-row > div { display: grid; }
.to-save-row span { color: var(--to-muted); font-size: .73rem; }
.to-status { min-height: 1.5rem; margin: .7rem 0 0; color: #446341; font-size: .82rem; font-weight: 700; }
.to-status.is-error { color: var(--to-danger); }

.to-choice { position: sticky; top: 92px; max-height: calc(100vh - 112px); overflow: auto; padding: 22px; scrollbar-width: thin; }
.to-search { display: block; margin-bottom: .8rem; }
.to-frame-list { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; max-height: 310px; overflow: auto; padding: 2px; scrollbar-width: thin; }
.to-frame { position: relative; display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: center; gap: .6rem; padding: .55rem; text-align: left; color: inherit; background: #fff; border: 1px solid var(--to-line); border-radius: 12px; cursor: pointer; }
.to-frame[aria-selected="true"] { border-color: var(--to-gold-dark); box-shadow: 0 0 0 2px rgba(212,168,79,.24); }
.to-frame[aria-disabled="true"] { opacity: .62; }
.to-frame img { width: 58px; height: 47px; object-fit: contain; background: #f4f1e8; border-radius: 8px; }
.to-frame__copy { display: grid; min-width: 0; }
.to-frame__copy b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .78rem; }
.to-frame__copy small { color: var(--to-muted); font-size: .67rem; }
.to-frame__swatches { display: flex; gap: 3px; margin-top: 4px; }
.to-frame__swatches i { width: 12px; height: 12px; border: 1px solid rgba(0,0,0,.16); border-radius: 50%; }
.to-lens { padding-top: 21px; margin-top: 20px; border-top: 1px solid var(--to-line); }
.to-lens-list, [data-lens-list] { display: grid; gap: .55rem; }
.to-lens-option { display: grid; grid-template-columns: auto 1fr auto; gap: .6rem; align-items: center; padding: .65rem .75rem; border: 1px solid var(--to-line); border-radius: 11px; cursor: pointer; }
.to-lens-option:has(input:checked) { border-color: var(--to-gold-dark); background: #fcf6e7; }
.to-lens-option input { accent-color: var(--to-gold-dark); }
.to-lens-option span { display: grid; font-size: .8rem; font-weight: 800; }
.to-lens-option small { color: var(--to-muted); font-size: .65rem; font-weight: 400; }
.to-lens-option b { font-size: .72rem; }
.to-buy { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--to-line); }
.to-buy__meta { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; margin-bottom: .7rem; }
.to-buy__meta span { color: var(--to-muted); font-size: .78rem; }
.to-buy__meta strong { font: 700 1.32rem Georgia, serif; }
.to-buy__actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.to-buy > small { display: block; margin-top: .65rem; color: var(--to-muted); font-size: .65rem; line-height: 1.4; }

.to-empty { min-height: 440px; display: grid; place-content: center; justify-items: center; padding: 3rem; text-align: center; background: var(--to-card); border: 1px solid var(--to-line); border-radius: var(--to-radius); box-shadow: var(--to-shadow); }
.to-empty > span { font-size: 3rem; color: var(--to-gold-dark); }
.to-empty h2 { margin: .6rem 0 .2rem; font: 600 2rem Georgia, serif; }
.to-empty p { color: var(--to-muted); max-width: 520px; }
.to-empty div { display: flex; gap: .7rem; }

.to-shell--manage { max-width: 1260px; }
.to-manage-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(340px, .9fr); gap: 28px; align-items: start; }
.to-manage-panel { padding: clamp(20px, 3vw, 32px); }
.to-source-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; }
.to-source-card { display: grid; gap: .15rem; min-height: 94px; padding: 1rem; text-align: left; color: var(--to-ink); background: #fff; border: 1px solid var(--to-line); border-radius: 13px; cursor: pointer; }
.to-source-card:hover, .to-source-card:focus-visible { border-color: var(--to-gold-dark); }
.to-source-card span { color: var(--to-muted); font-size: .7rem; }
.to-manage-panel .to-builder__grid { grid-template-columns: repeat(2, 1fr); }
.to-manage-actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 18px; }
.to-data-note { margin-top: 20px; padding: 1rem; border-left: 3px solid #688464; background: var(--to-sage); border-radius: 0 10px 10px 0; }
.to-data-note p { margin: .25rem 0 0; color: #50604d; font-size: .75rem; }
.to-link-arrow { display: flex; justify-content: space-between; margin-top: 22px; padding: 1rem 0 0; color: var(--to-gold-dark); border-top: 1px solid var(--to-line); text-decoration: none; font-weight: 800; }
.to-saved-pill { padding: .35rem .62rem; color: #50604d; background: var(--to-sage); border-radius: 999px; font-size: .7rem; font-weight: 800; }

.to-footer { display: flex; justify-content: center; gap: 1rem; padding: 25px; color: var(--to-muted); border-top: 1px solid var(--to-line); font-size: .74rem; }

.tryon-auth-page main { min-height: calc(100vh - 150px); display: grid; place-items: center; padding: 34px 16px; }
.to-auth { width: min(100%, 470px); padding: clamp(24px, 5vw, 42px); background: var(--to-card); border: 1px solid var(--to-line); border-radius: var(--to-radius); box-shadow: var(--to-shadow); }
.to-auth h1 { margin: 0; font: 600 clamp(2rem, 7vw, 3.1rem)/1 Georgia, serif; letter-spacing: -.03em; }
.to-auth > p { color: var(--to-muted); font-size: .87rem; }
.to-auth form { display: grid; gap: .9rem; margin-top: 1.4rem; }
.to-auth label { display: grid; gap: .32rem; color: var(--to-muted); font-size: .73rem; font-weight: 800; }
.to-auth label small { font-weight: 400; }
.to-auth input { width: 100%; min-height: 46px; padding: .65rem .75rem; color: var(--to-ink); background: #fff; border: 1px solid var(--to-line); border-radius: 10px; }
.to-auth__error { margin: 1rem 0; padding: .75rem .9rem; color: var(--to-danger); background: #fff1ef; border: 1px solid #e4bbb6; border-radius: 10px; font-size: .8rem; }
.to-auth__switch { margin: 1rem 0 0; text-align: center; }
.to-auth__switch a { color: var(--to-gold-dark); font-weight: 800; }
.to-auth--complete { text-align: center; }
.to-auth__check { display: grid; place-items: center; width: 66px; height: 66px; margin: 0 auto 1.2rem; color: #fff; background: #4f704b; border-radius: 50%; font-size: 2rem; font-weight: 900; }

@media (max-width: 1060px) {
  .to-workspace, .to-manage-grid { grid-template-columns: 1fr; }
  .to-choice { position: static; max-height: none; }
  .to-frame-list { max-height: 390px; grid-template-columns: repeat(3, 1fr); }
  .to-builder__grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 720px) {
  .to-header { min-height: 64px; padding: 8px 14px; }
  .to-brand img { width: 42px; height: 42px; }
  .to-brand small, .to-header nav a:not(.to-header__cart) { display: none; }
  .to-shell { width: min(100% - 22px, 1560px); padding-top: 34px; }
  .to-intro { display: grid; }
  .to-intro h1 { font-size: clamp(2.2rem, 12vw, 3.4rem); }
  .to-privacy { width: 100%; flex-basis: auto; }
  .to-stage-card, .to-choice, .to-manage-panel { border-radius: 16px; }
  .to-stage { min-height: 300px; }
  .to-stage-head { align-items: flex-start; }
  .to-adjust { grid-template-columns: 1fr 1fr; }
  .to-adjust__title { grid-column: 1 / -1; }
  .to-builder__grid, .to-manage-panel .to-builder__grid { grid-template-columns: 1fr 1fr; }
  .to-save-row { align-items: stretch; flex-direction: column; }
  .to-frame-list { grid-template-columns: 1fr 1fr; max-height: 360px; }
  .to-source-buttons { grid-template-columns: 1fr; }
  .to-footer { text-align: center; flex-direction: column; }
}

@media (max-width: 430px) {
  .to-mode-tabs button { padding-inline: .6rem; }
  .to-stage { min-height: 265px; }
  .to-start { padding: 1rem; }
  .to-start__mark { width: 72px; height: 72px; }
  .to-start__mark::before { width: 85px; height: 38px; }
  .to-builder__grid, .to-manage-panel .to-builder__grid, .to-frame-list { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
