:root {
  color-scheme: light;
  --bg: #fff9ed;
  --panel: #fffefa;
  --surface: #f6eddf;
  --text: #231934;
  --muted: #594e61;
  --line: #b7a8b9;
  --accent: #4a328c;
  --selection: #4a328c;
  --lavender: #eee5ff;
  --sunflower: #ffd962;
  --ink-shadow: 4px 4px var(--text);
}
.home-page { --selection: var(--accent); }
body > header { background: var(--bg); }
.bar { min-height: 72px; }
.bar .brand { gap: 8px; }
.bar .wordmark {
  font: 850 1.22rem/.97 system-ui,sans-serif;
  letter-spacing: -.055em;
  text-transform: none;
}
.bar .wordmark span { color: var(--accent); }
.bar .mark { width: 41px; height: 41px; }
:where(a,button,input,summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.button {
  border: 1px solid var(--text);
  border-radius: 7px;
  color: #fff;
  box-shadow: 3px 3px var(--text);
}
.button.secondary { color: var(--accent); background: var(--panel); border-color: var(--accent); box-shadow: none; }
.button:disabled { box-shadow: none; }
.button:not(:disabled):active { box-shadow: none; transform: translate(2px,2px); }

.home-create {
  --hero-pad: clamp(24px,5vw,64px);
  display: grid;
  grid-template-columns: minmax(0,1.35fr) minmax(0,1fr);
  gap: 32px 0;
  align-items: center;
  isolation: isolate;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}
.home-create::before {
  content: "";
  grid-area: 1 / 1 / 2 / -1;
  align-self: stretch;
  background: var(--sunflower);
  border: 1px solid var(--text);
  border-radius: 10px;
  z-index: -1;
}
.home-create .hero-copy {
  grid-area: 1 / 1;
  padding: var(--hero-pad) 0 var(--hero-pad) var(--hero-pad);
  text-align: left;
}
.home-create .hero-copy h1 {
  color: var(--text);
  font: 850 clamp(2.65rem,4.9vw,4.6rem)/1.03 system-ui,sans-serif;
  letter-spacing: -.05em;
  text-wrap: balance;
}
.home-create .hero-copy h1 span { color: var(--accent); }
.home-create .desktop-title-break { display: none; }
.home-create .hero-copy > p {
  max-width: 49ch;
  text-align: left;
  text-wrap: pretty;
  margin: 20px 0 0;
  color: #453344;
}
.home-create .home-preview-cta { margin-top: 24px; }
.home-create .home-preview-cta-mobile { display: none; }
.hero-photo-stack {
  grid-area: 1 / 2;
  position: relative;
  width: min(100% - 40px, 420px);
  aspect-ratio: 1.18;
  margin: 32px auto;
}
.hero-photo-stack::before {
  content: "";
  position: absolute;
  inset: 12% 7% 10%;
  border: 1px solid var(--text);
  border-radius: 50%;
  transform: rotate(-16deg);
  background: repeating-linear-gradient(130deg, transparent 0 6px, #4a328c24 6px 7px);
}
.hero-photo-stack img {
  position: absolute;
  display: block;
  width: 40%;
  height: auto;
  padding: 4px 4px 10px;
  border: 1px solid var(--text);
  border-radius: 4px;
  background: var(--panel);
  box-shadow: 4px 5px var(--text);
}
.hero-photo-stack img:nth-child(1) {
  top: 12%;
  left: 3%;
  transform: rotate(-14deg);
}
.hero-photo-stack img:nth-child(2) {
  top: 2%;
  left: 33%;
  transform: rotate(7deg);
}
.hero-photo-stack img:nth-child(3) {
  width: 36%;
  bottom: 3%;
  right: 1%;
  transform: rotate(14deg);
}
.home-create .workbench .reference-panel {
  width: 100%;
  margin: 16px 0;
  padding: 14px 0;
}
.home-create .workbench .reference-panel .sample {
  width: min(100%, 200px);
}
.home-create > .workbench {
  grid-area: 2 / 1 / 3 / -1;
  width: min(100%, 850px);
  margin: 0 auto;
}
.workbench, .huss-studio .reference-panel, .sign-in-panel, .photo-required {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--text);
  border-radius: 10px;
  box-shadow: var(--ink-shadow);
}
.auth-panel:has(#account-title) { max-width: 760px; }
.sign-in-panel #google-login { border-color: var(--line); background: var(--panel); color: var(--text); }
.sign-in-panel input::placeholder { color: var(--muted); }
.auth-panel input { background: var(--bg); }
.account-history li { min-width: 0; overflow-wrap: anywhere; }

.page-intro h1 {
  font-family: system-ui,sans-serif;
  font-style: normal;
  text-transform: none;
  letter-spacing: -.045em;
  line-height: 1;
}
.hero:not(.home-create) .hero-copy h1 { color: var(--text); }
.hero:not(.home-create) .hero-copy h1 span { color: var(--accent); }
.card { border-color: var(--text); border-radius: 8px; box-shadow: 2px 2px var(--text); }
.card:hover { border-color: var(--accent); box-shadow: 3px 3px var(--accent); }
.card-media { border-bottom: 1px solid var(--text); }
.card-copy .category { color: var(--accent); }
.filters button { border-radius: 5px; }
.filters button[aria-pressed=true], .home-page .filters button[aria-pressed=true] {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.reference-hot, .pricing-badge {
  background: var(--sunflower);
  color: var(--text);
  border: 1px solid var(--text);
  border-radius: 5px;
}
.reference-picker button, .featured-picker button { background: var(--panel); }
.reference-picker button[aria-pressed=true],
.featured-picker button[aria-pressed=true],
#checkout-note.credit-shortfall {
  padding: .65rem .8rem;
  border: 1px solid #a86d12;
  border-radius: 8px;
  background: #fff1cc;
  color: #57370b;
}
#checkout-note.credit-shortfall strong {
  display: block;
  color: #342005;
}

.paid-video-details {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}
.paid-video-details a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.output-options label:has(input:checked) {
  background: var(--lavender);
  border-color: var(--accent);
}
.reference-picker button:focus-visible { outline-color: var(--accent); }
.photo-picker .upload { background: var(--surface); border-color: #76678a; }
.output-options input, .photo-consent input { accent-color: var(--accent); }

.home-use-cases { margin-top: 44px; }
.home-use-cases ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr));
  gap: 12px;
  padding: 0;
  list-style: none;
}
.home-use-cases li {
  padding: 16px;
  border: 1px solid var(--text);
  border-radius: 10px;
  background: var(--panel);
}
.home-use-cases li p { margin-top: 6px; }
.home-use-cases a, .home-page .huss-faq a {
  color: var(--accent);
  text-decoration: underline;
}

.huss-story section,
.huss-steps li,
.huss-faq {
  background: var(--panel);
  border: 1px solid var(--text);
  border-radius: 10px;
}
.huss-steps li::before {
  color: var(--accent);
  background: var(--lavender);
}
.huss-faq summary { color: var(--text); }
.huss-faq summary::after { border-color: var(--accent); }
.huss-faq details[open] summary { color: var(--accent); }

.huss-pricing .pricing-plan { background: var(--panel); border-radius: 10px; box-shadow: 3px 3px var(--text); }
.huss-pricing .pricing-plan[data-plan="creator"] { background: var(--lavender); border-color: var(--accent); }
.huss-pricing .pricing-plan[data-selected] { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 2px; }
.pricing-plan .pricing-price { color: var(--text); }
.pricing-plan .pricing-credits {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  font-size: .8rem;
}
.pricing-credits strong {
  color: var(--accent);
  font-size: 1.05rem;
}
.pricing-plan[id] { scroll-margin-top: 24px; }

.pricing-plan .pricing-pack-fit {
  color: var(--accent);
  font-size: .86rem;
  font-weight: 700;
}
.pricing-plan ul {
  border-top: 0;
  padding-top: 0;
  list-style: none;
}
.pricing-plan .pricing-limited::before {
  top: .7em;
  width: .55em;
  height: 0;
  border: 0;
  border-top: 2px solid currentColor;
  transform: none;
}
@media (min-width: 1051px) {
  .pricing-plan .pricing-credits { min-height: 2.9em; }
}

.account-dropdown, .site-menu nav { border-color: var(--text); box-shadow: var(--ink-shadow); }
.header-credits { background: var(--lavender); border-color: var(--accent); color: var(--accent); }
.payment-success-check { background: var(--lavender); color: var(--accent); }
.generation-progress { background: var(--lavender); border-color: var(--accent); }
.generation-progress .generation-progress-title { color: var(--text); }
.generation-progress :is(.generation-progress-note,.generation-progress-detail,.generation-account-link) { color: var(--muted); }
.generation-progress-track span { background: #d3c4ee; }
.generation-progress[data-stage="2"] span:first-child,
.generation-progress[data-stage="3"] span:nth-child(-n+2) { background: #7963b6; }
.generation-progress[data-stage="1"] span:first-child,
.generation-progress[data-stage="2"] span:nth-child(2),
.generation-progress[data-stage="3"] span:nth-child(3) { background: var(--accent); }

.mobile-sign-in { display: none; }

.desktop-nav nav { align-items: center; }
.desktop-nav [data-sign-in]:not([hidden]) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 16px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--lavender);
  color: var(--accent);
  white-space: nowrap;
}
.desktop-nav [data-sign-in]:hover {
  background: var(--accent);
  color: var(--panel);
  text-decoration: none;
}

@media (max-width: 760px) {
  .bar, main, footer { width: calc(100% - 28px); }
  .bar { min-height: 64px; gap: 8px; }
  .bar .brand { gap: 6px; }
  .bar .wordmark { font-size: 1rem; }
  .bar .mark { width: 36px; height: 36px; }
  .mobile-sign-in {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-inline-start: auto;
    padding-inline: 10px;
    color: var(--accent);
    font-size: .9rem;
    font-weight: 750;
    white-space: nowrap;
  }
  .site-menu nav a, .account-dropdown a, .account-dropdown button {
    min-height: 44px;
    align-content: center;
  }

  .home-create { gap: 0; grid-template-columns: minmax(0,1fr); margin-top: 14px; }
  .home-create::before { grid-area: 1 / 1 / 4 / -1; }
  .home-create .hero-copy { grid-area: 1 / 1; padding: 22px 16px 2px; }
  .home-create .hero-copy h1 {
    font-size: clamp(1.95rem,8.3vw,3.8rem);
    text-align: center;
  }
  .home-create .hero-copy > p { margin-top: 10px; }
  .home-create .hero-copy .home-preview-cta { display: none; }
  .home-create .home-preview-cta-mobile {
    grid-area: 3 / 1;
    display: flex;
    width: fit-content;
    min-height: 44px;
    margin: 4px auto 16px;
  }
  .hero-photo-stack {
    grid-area: 2 / 1;
    width: min(80%, 300px, 33svh);
    margin: 10px auto;
  }
  .home-create > .workbench { grid-area: 3 / 1; margin-top: 16px; }

  .huss-create-link span { transform: rotate(90deg); }
  .huss-studio { grid-template-columns: minmax(0,1fr); gap: 16px; }
  .huss-studio .reference-panel { padding: 14px; }
  .huss-studio .reference-panel .sample { max-width: min(180px,100%); }
  .workbench { padding: 16px; }
  .home-create .workbench { padding: 13px; }
  .create-heading { flex-wrap: wrap; }
  .reference-picker {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: clamp(104px,33%,148px);
    gap: 8px;
    margin-inline: -3px;
    padding: 4px 3px 8px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }
  .reference-picker button {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 5px;
    scroll-snap-align: start;
  }
  .reference-picker img { height: auto; aspect-ratio: 4/5; }
  .reference-picker span { font-size: .84rem; }
  .reference-picker small { font-size: .73rem; }
  .home-create #maker .actions,
  #maker .actions { margin-top: 15px; }
  #maker .button[type="submit"] { width: 100%; min-height: 48px; }
  .photo-picker .upload { min-height: 110px; }
  .output-options label { min-height: 48px; }
  .photo-consent label { padding-bottom: 4px; }

  .grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .filters { flex-wrap: wrap; gap: 6px; }
  .filters button { min-height: 44px; }
  .card-copy { padding: 10px; }
  .card-copy h3, .section-head h2 { overflow-wrap: anywhere; }
  .card-copy h3 { font-size: 1rem; }
  .section-head a { flex-shrink: 0; }
  .huss-pricing .pricing-plan { padding: 18px; }
  .pricing-plan .button, .pricing-checkout .button { min-height: 44px; }
  #pricing-payment-actions .button { margin: 3px; }
  #account-details section { margin-top: 24px; }
  .account-history li { gap: 8px; }
  .account-history .button { min-height: 44px; align-items: center; }
  footer { flex-wrap: wrap; gap: 8px 18px; }
  .footer-legal a { padding-block: 5px; }
}

@media (max-width: 380px) {
  .bar { gap: 6px; }
  .bar .brand { gap: 4px; }
  .bar .wordmark { font-size: .87rem; }
  .bar .mark { width: 32px; height: 32px; }
  .header-account { gap: 5px; }
}

.template-reference-guide {
  max-width: 960px;
  padding: clamp(16px, 3vw, 26px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--lavender);
}
.template-reference-guide h2 { margin: 0; }
.template-reference-guide ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.template-reference-guide li {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 12px;
  border-radius: 6px;
  background: var(--panel);
}
.template-reference-guide span { color: var(--muted); }
.template-continue { text-align: center; }
.huss-origin.template-continue .button { min-height: 44px; color: #fff; }

.template-mobile-return { display: none; }
@media (max-width: 760px) {
  .huss-intro { margin-block: 8px 12px; }
  .huss-intro h1 { font-size: clamp(1.75rem, 7vw, 2.4rem); }
  .huss-intro p { margin-block: 8px 0; }
  .huss-studio .reference-panel { padding-block: 12px; }
  .huss-studio .reference-panel h2 { font-size: 1.15rem; }
  .huss-studio .reference-panel .sample { max-width: min(136px, 100%); max-height: 46svh; }
  .huss-studio .huss-reference-spec { margin-top: 6px; }
  .template-mobile-return {
    position: fixed;
    z-index: 3;
    inset: auto 0 0;
    display: grid;
    justify-items: center;
    padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--bg);
  }
  .template-mobile-return a { width: min(100%, 420px); min-height: 44px; }
  body:has(dialog[open]) .template-mobile-return { display: none; }
  body:has(.template-mobile-return) footer { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
}

.template-credit-packs > p { margin-bottom: 28px; }
.template-credit-packs .pricing-plan h3 { margin: 0; }
@media (min-width: 1051px) {
  .template-credit-packs .huss-pricing { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.tpl-page {
  --fs-h1: 32px;
  --fs-h2: 24px;
  --fs-h2-panel: 22px;
  --fs-h3: 18px;
  --fs-body: 16px;
  --fs-small: 14px;
  --tpl-section-gap: 48px;
}
.tpl-page .huss-intro { border: 0; padding: 0; margin: 16px 0; }
.tpl-page h1 { font-size: var(--fs-h1); line-height: 1.1; font-weight: 850; }
.tpl-page h2 { font-size: var(--fs-h2); line-height: 1.2; font-weight: 700; margin: 0 0 12px; }
.tpl-page .huss-studio h2 { font-size: var(--fs-h2-panel); }
.tpl-page h3, .tpl-page .huss-steps strong { font-size: var(--fs-h3); line-height: 1.3; }
.tpl-page p { max-width: 68ch; font-size: var(--fs-body); line-height: 1.55; }
.tpl-page .huss-origin, .tpl-page .template-credit-packs { max-width: none; margin: var(--tpl-section-gap) 0 0; }
.tpl-page .huss-studio { gap: 24px; }
.tpl-page .huss-studio .reference-panel { padding: 16px; }
.tpl-page .reference-panel .sample {
  width: auto;
  height: min(46vh, 400px);
  height: min(46svh, 400px);
  max-width: 100%;
  max-height: none;
  aspect-ratio: 9 / 16;
  border-radius: 12px;
}
.tpl-page .reference-panel > p { font-size: 15px; }
.tpl-page .huss-reference-spec { margin-inline: auto; font-size: var(--fs-small); }
.tpl-page .huss-create-link svg { flex: none; }
@media (min-width: 900px) {
  .tpl-page .studio .huss-create-link svg { transform: rotate(-90deg); }
}
.tpl-page .huss-studio .workbench { padding: 16px; }
.tpl-page .huss-studio .workbench > p { margin-block: 0 10px; }
.tpl-composer #maker > .actions > .button { width: 100%; min-height: 52px; }
.tpl-composer { --fs-small: 14px; }
.tpl-composer .photo-consent p, .tpl-composer .upload-hint { font-size: var(--fs-small); color: var(--muted); }
.tpl-composer .photo-consent label { display: flex; align-items: center; min-height: 44px; }
.tpl-composer .photo-consent input { width: 24px; height: 24px; margin-top: 10px; }
.tpl-composer .photo-consent p { grid-column: 1 / -1; }
.tpl-composer .photo-consent [data-consent-note]:not([hidden]) { background: var(--lavender); padding: 4px 8px; border-radius: 6px; }
.tpl-composer .photo-picker .upload { min-height: 112px; padding: 16px; }
.tpl-composer .photo-picker.is-dragover :is(.upload, .tpl-photo-selected) { outline: 2px solid var(--accent); background: var(--lavender); }
.tpl-composer .photo-picker.is-error .upload { border: 2px solid #b3261e; }
.tpl-composer .tpl-error { color: #b3261e; font-size: var(--fs-small); margin: 6px 0 0; }
.tpl-photo-selected {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 2px solid var(--accent);
  border-radius: 10px;
  background: var(--lavender);
}
.tpl-composer .tpl-photo-selected #photo-preview { width: 72px; height: 96px; margin: 0; object-fit: cover; border-radius: 8px; }
.tpl-photo-selected [data-photo-name] { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.tpl-photo-selected button { min-height: 44px; padding: 0 8px; font: inherit; font-size: 14px; cursor: pointer; }
.tpl-photo-selected [data-remove-photo] { border: 0; background: transparent; color: var(--accent); text-decoration: underline; }
.tpl-composer .photo-picker:focus-within :is(.upload, .tpl-photo-selected),
.tpl-composer label:has(input:focus-visible), .tpl-page :focus-visible {
  outline: 2px solid var(--selection);
  outline-offset: 3px;
}
.tpl-page :is(.huss-story section, .huss-steps li, .huss-faq, .pricing-plan) {
  padding: 20px;
  border-radius: 12px;
  box-shadow: none;
}
.tpl-page .template-reference-guide { max-width: 960px; margin-inline: auto; }
.tpl-page .template-reference-guide h2 { margin: 0; font-size: clamp(1.4rem, 3vw, 2rem); }
.tpl-page .template-reference-guide > p { max-width: none; }
.tpl-page .huss-steps li::before { width: 28px; height: 28px; font-size: 14px; }
.tpl-page .huss-faq summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; font-size: 17px; font-weight: 600; }
.tpl-page .huss-faq summary::after { content: none; }
.tpl-page .huss-faq summary svg { flex: none; transition: transform 120ms; }
.tpl-page .huss-faq details[open] summary svg { transform: rotate(180deg); }
.tpl-page .huss-faq details p { max-width: none; padding-bottom: 16px; text-wrap: pretty; }
.tpl-page .template-continue { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.tpl-page .template-continue .button { min-height: 44px; gap: 6px; }
.tpl-page .template-continue .button.secondary { color: var(--accent); }
.tpl-composer .generation-progress-track span { height: 6px; border-radius: 3px; }
.tpl-composer #output { max-height: 70svh; aspect-ratio: 9 / 16; border-radius: 12px; }
.tpl-page .crumb a, .tpl-page .section-head a { display: inline-flex; min-height: 44px; align-items: center; }
.tpl-page .pricing-credits span { font-size: 14px; }

@media (min-width: 900px) {
  .tpl-page { --fs-h1: 56px; --fs-h2: 32px; --fs-h2-panel: 28px; --fs-h3: 20px; --fs-body: 17px; --tpl-section-gap: 72px; }
  .tpl-page h1 { line-height: 1.05; }
  .tpl-page .huss-studio { grid-template-columns: minmax(340px, .85fr) minmax(0, 1.15fr); align-items: stretch; }
  .tpl-page .reference-panel .sample { height: min(52vh, 350px); }
  .tpl-page .huss-story { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .tpl-page :is(.huss-story section, .huss-steps li, .huss-faq, .pricing-plan) { padding: 24px; }
}
@media (max-width: 899px) {
  .tpl-page .huss-studio { grid-template-columns: minmax(0, 1fr); gap: 14px; }
}
@media (max-width: 760px) {
  .tpl-page .template-mobile-return {
    background: var(--panel);
    box-shadow: 0 -4px 12px rgb(35 25 52 / .08);
    transform: translateY(100%);
    transition: transform 160ms ease-out;
  }
  .tpl-page .template-mobile-return[data-visible] { transform: translateY(0); }
  .tpl-page .template-mobile-return a { min-height: 48px; }
  body:has(.tpl-page) footer a { display: inline-flex; align-items: center; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .tpl-page .template-mobile-return, .tpl-page .huss-faq summary svg { transition: none; }
}

.tpl-page .crumb { margin-top: 8px; align-items: center; }
.tpl-page .huss-studio { margin-top: 8px; }
.tpl-composer .photo-picker .upload { margin-top: 8px; }
.tpl-composer #maker > .actions { margin-top: 14px; }
.tpl-composer .photo-consent { margin-top: 8px; }
.tpl-photo-selected [data-photo-name] { font-size: 14px; }
@media (max-width: 760px) {
  .tpl-page .huss-studio .workbench { padding-top: 12px; }
}
.tpl-composer .tpl-error { display: flex; align-items: center; gap: 6px; }
.tpl-composer .tpl-error svg { flex: 0 0 16px; width: 16px; height: 16px; }
.tpl-composer .photo-picker[aria-busy="true"] .upload { opacity: .6; cursor: wait; }
.tpl-composer .photo-picker .upload .upload-hint { font-size: var(--fs-small); }
.tpl-composer .generation-progress .generation-progress-title { font-size: 16px; font-weight: 700; }
.tpl-composer .generation-progress .generation-progress-detail { font-size: 14px; }
@media (min-width: 900px) {
  .tpl-page .huss-studio .workbench > p { margin-bottom: 4px; }
  .tpl-composer .photo-picker { margin-top: 4px; }
  .tpl-composer .photo-picker .upload { min-height: 102px; padding: 10px 12px; }
  .tpl-composer .output-options { margin-top: 12px; }
  .tpl-composer #maker > .actions { margin-top: 12px; }
}
.tpl-share { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tpl-share :is(a, button) { display: inline-flex; align-items: center; min-height: 44px; }
.tpl-share p { flex-basis: 100%; }
.tpl-share p:empty { display: none; }

.output-groups { display: grid; gap: 10px; }
.output-group-heading { padding: 10px 12px; background: var(--surface); }
.output-full-group { border: 1px solid var(--line); border-radius: 8px; }
.output-options .output-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 12px;
}
.output-options .output-row input { margin: 0; accent-color: var(--accent); }
.output-full-group .output-row { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.output-full-group .output-row:last-child { border-radius: 0 0 7px 7px; }
.output-group-heading { border-radius: 7px 7px 0 0; }
.output-options .output-row:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.output-quality { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; }
.output-credits { white-space: nowrap; font-size: .875rem; text-align: right; }
.output-quality .output-model-benefit { padding: 1px 5px; border-radius: 4px; background: var(--lavender); color: var(--accent); }

@media (max-width: 899px) {
  .tpl-page .crumb { margin-top: 0; flex-wrap: nowrap; gap: 6px; }
  .tpl-page .crumb [aria-current="page"] { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tpl-page .huss-intro { margin-block: 4px 10px; }
  .tpl-page .huss-intro h1 { font-size: clamp(25px, 7.2vw, 32px); }
  .tpl-page .huss-intro p { margin-top: 6px; font-size: 15px; line-height: 1.4; }
  .tpl-page .huss-studio .reference-panel { padding: 10px 12px 4px; }
  .tpl-page .reference-panel h2 { margin-bottom: 4px; font-size: 20px; }
  .tpl-page .reference-panel > p { margin-top: 4px; font-size: 14px; line-height: 1.4; }
  .tpl-page .huss-studio .reference-panel .sample { height: min(39svh, 320px); margin-top: 6px; }
}
@media (max-width: 600px) and (max-height: 700px) {
  .tpl-page .huss-studio .reference-panel .sample { height: min(34svh, 230px); }
}

.tpl-editorial {
  display: grid;
  gap: clamp(32px, 5vw, 64px);
  margin-top: var(--tpl-section-gap);
}
.tpl-page .tpl-editorial > :is(.template-reference-guide, .huss-story, .huss-faq) {
  max-width: none;
  margin: 0;
  padding: clamp(20px, 3.5vw, 44px);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.tpl-page .tpl-editorial :is(.template-reference-guide, .huss-faq) { background: var(--surface); }
.tpl-page .tpl-editorial .template-reference-guide > p { max-width: 64ch; margin-top: 12px; }
.tpl-page .tpl-editorial .template-reference-guide ul { margin-top: 22px; gap: 14px; }
.tpl-page .tpl-editorial .template-reference-guide li {
  gap: 8px;
  padding: clamp(14px, 1.8vw, 22px);
  border: 1px solid var(--line);
  border-radius: 10px;
  line-height: 1.55;
}
.tpl-page .tpl-editorial .huss-story {
  gap: clamp(22px, 4vw, 48px);
  background: var(--panel);
}
.tpl-page .tpl-editorial .huss-story section { border: 0; background: transparent; padding: 0; }
.tpl-page .tpl-editorial .huss-story h2 { font-size: clamp(1.35rem, 2.15vw, 1.75rem); }
.tpl-page .tpl-editorial .huss-story p { margin-top: 14px; line-height: 1.65; }
.tpl-page .tpl-editorial .huss-story section + section {
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding-top: 22px;
}
@media (min-width: 761px) {
  .tpl-page .tpl-editorial .huss-story { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tpl-page .tpl-editorial .huss-story section + section {
    border-top: 0;
    border-left: 1px solid var(--line);
    padding: 0 0 0 clamp(20px, 3vw, 36px);
  }
}

@media (min-width: 900px) {
  body:has(.tpl-page) :is(.bar, main, footer) {
    width: min(1144px, calc(100% - 104px));
  }
}

@media (max-width: 760px) and (max-height: 700px) {
  .home-create { margin-top: 10px; }
  .home-create .hero-copy { padding: 16px 14px 0; }
  .home-create .hero-copy h1 { font-size: clamp(1.65rem, 7.5vw, 2.4rem); }
  .home-create .hero-copy > p { margin-top: 8px; font-size: .9375rem; line-height: 1.4; }
  .hero-photo-stack { width: min(75%, 28svh); margin: 8px auto; }
}

.pricing-faq { padding: clamp(18px, 3vw, 32px); }
.pricing-faq h2 { margin: 0 0 12px; }
.pricing-faq details:last-child { border-bottom: 0; }
.pricing-faq details p { margin: 4px 0 12px; text-wrap: pretty; }
.pricing-faq details a { text-decoration: underline; text-underline-offset: 2px; }

.bar [data-auth-loading] { animation: reveal-header-sign-in 2s step-end both; }
@keyframes reveal-header-sign-in {
  from { visibility: hidden; }
  to { visibility: visible; }
}

.home-create > .workbench { width: 100%; }
@media (min-width: 761px) {
  .home-create .reference-picker { max-width: 800px; }
}
.home-creation-columns {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}
.home-create .home-creation-columns .reference-panel {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}
.home-create .home-creation-columns .reference-panel .sample {
  width: auto;
  height: min(40svh, 290px);
  max-width: 100%;
}
.home-creation-columns .tpl-composer { min-width: 0; }
.home-page .home-use-cases, .home-page .huss-faq {
  padding: clamp(18px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.home-page .home-use-cases li { border-color: var(--line); }
.home-page .huss-faq { margin-inline: 0; max-width: none; }
.home-page .huss-faq h2 { margin-top: 0; }
@media (min-width: 900px) {
  .home-creation-columns {
    grid-template-columns: minmax(220px, .75fr) minmax(0, 1.65fr);
    gap: 24px;
    align-items: start;
  }
  .home-create .home-creation-columns .reference-panel .sample { height: min(46vh, 350px); }
}

.sign-in-panel .sign-in-legal {
  margin-top: 18px;
  color: var(--muted);
  font-size: .875rem;
  line-height: 1.5;
}
.sign-in-panel .sign-in-legal a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.sign-in-panel:has(#auth-account:not([hidden])) .sign-in-legal { display: none; }

.reference-card .card-media { position: relative; aspect-ratio: 9 / 16; }
.reference-card .card-media img { object-fit: contain; object-position: center; }
.reference-panel .tpl-parody-note { font-size: .875rem; line-height: 1.45; color: var(--muted); }

#explore-templates { scroll-margin-top: 20px; }
.reference-card .reference-card-action {
  min-height: 44px;
  align-items: center;
  margin-top: 10px;
  padding-inline: 12px;
  text-align: center;
}
.reference-card a:hover .reference-card-action { filter: brightness(.93); }
.reference-card > a:is(:hover, :focus-visible) { text-decoration: none; }
.reference-card > a:is(:hover, :focus-visible) h3 { text-decoration: underline; }
@media (min-width: 900px) {
  .home-creation-columns:has(.reference-panel[hidden]) { grid-template-columns: minmax(0, 1fr); }
}

.reference-card .reference-card-action {
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 7px;
  box-shadow: none;
  background: var(--panel);
  color: var(--accent);
  border-color: var(--line);
  font-size: .875rem;
  font-weight: 700;
}

.reference-card .reference-card-alias { margin-top: 6px; color: var(--muted); font-size: .9rem; }
.tpl-page .huss-studio .reference-panel { text-align: center; }
.tpl-page .huss-studio .reference-panel > p { margin-inline: auto; }
.tpl-page .huss-studio .tpl-sound { margin-top: 8px; min-height: 44px; align-items: center; }
.tpl-page .tpl-editorial > .template-credit-packs { margin-top: 0; }
.template-reference-guide ul:has(li:nth-child(4)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1051px) {
  .template-reference-guide ul:has(li:nth-child(4)) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 600px) and (max-height: 700px) {
  .tpl-page .huss-studio .reference-panel .sample { height: min(31svh, 206px); }
}

#home-choose-template .home-template-picker { margin-bottom: 16px; }
.home-template-tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  scroll-snap-align: start;
}
.home-template-tile:has(input:checked) { border-color: var(--accent); background: var(--lavender); }
.home-template-tile label { position: relative; display: block; cursor: pointer; }
.home-template-tile input { position: absolute; top: 8px; left: 8px; margin: 0; accent-color: var(--accent); }
.home-template-tile .home-template-state { color: var(--accent); font-weight: 750; }
.home-template-state::before { content: "Select template"; }
.home-template-tile input:checked ~ .home-template-state::before { content: "Selected"; }
.home-template-details {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  margin-top: auto;
  color: var(--accent);
  font-size: .8rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.home-template-details span { margin: 0; }
#home-choose-template .tpl-photo-selected img { object-fit: cover; border-radius: 8px; }
#home-choose-template .actions { display: flex; justify-content: center; margin-top: 15px; }

.reference-card .card-media > video[data-card-preview] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  opacity: 0;
}
.reference-card .card-media > video.is-playing { opacity: 1; }
.reference-card .reference-hot { z-index: 1; }

.tpl-page .huss-studio .reference-panel-landscape .sample {
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: none;
  aspect-ratio: 16 / 9;
}
.reference-card[data-landscape] .card-media {
  aspect-ratio: 16 / 9;
}

@media (min-width: 900px) {
  .tpl-page .huss-studio .reference-panel-landscape { align-content: center; }
}

.elevator-studio .elevator-reference { display: block; width: 100%; height: auto; margin: 0 auto; border-radius: 12px; }
.elevator-slot {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.elevator-slot p { margin-block: 4px 8px; }
.elevator-slot input { max-width: 100%; }
.elevator-slot img { width: 100px; height: 100px; object-fit: contain; margin: 8px 0; }
.elevator-consent { display: flex; align-items: start; gap: 8px; margin-top: 16px; }
@media (max-width: 760px) {
  .elevator-studio .elevator-reference { width: min(100%, 36svh); }
}
.elevator-slot .elevator-native-file {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
.elevator-native-file:focus-visible + .elevator-file-button {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.elevator-file-button { cursor: pointer; }
.elevator-file-name { display: inline-block; margin: 6px 8px; overflow-wrap: anywhere; }

:is(#explore-templates, .template-related) .grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
  align-items: start;
}
:is(#explore-templates, .template-related) .reference-card .card-media {
  aspect-ratio: 4 / 3;
  height: auto;
  background: var(--text);
}
:is(#explore-templates, .template-related) .card-media > :is(img, video[data-card-preview]) {
  object-fit: contain;
  object-position: center;
}
@media (max-width: 600px) {
  :is(#explore-templates, .template-related) .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
