/* Virtual try-on. Uses the site's own theme tokens (--primary, --border, …) so it
   follows any palette change made in the main stylesheet. */

/* ── Homepage section ─────────────────────────────────────────────────────── */

.gf-tryon {
  position: relative;
  overflow: hidden;
  border-block: 1px solid hsl(var(--border) / 0.5);
  background:
    radial-gradient(60% 55% at 50% 0%, hsl(var(--primary) / 0.1), transparent 70%),
    hsl(var(--background));
}

.gf-tryon__lede {
  margin-top: 1.5rem;
}

.gf-steps {
  display: grid;
  gap: 1rem;
  max-width: 64rem;
  margin-inline: auto;
}

@media (min-width: 768px) {
  .gf-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

.gf-step__icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
  border-radius: 0.75rem;
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.1);
}

.gf-step__icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.gf-tryon__cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
  text-align: center;
}

/* ── Studio dialog ────────────────────────────────────────────────────────── */

.gf-studio {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  color: hsl(var(--foreground));
  background: hsl(var(--background));
  font-family: var(--font-body);
}

.gf-studio::backdrop {
  background: rgb(0 0 0 / 0.8);
  backdrop-filter: blur(4px);
}

.gf-studio [hidden] {
  display: none !important;
}

/* Scrollbars that belong to the dark theme (some systems draw them white otherwise) */
.gf-studio,
.gf-studio * {
  scrollbar-width: thin;
  scrollbar-color: hsl(var(--muted)) transparent;
}

.gf-studio__shell {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.gf-studio__bar {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid hsl(var(--border) / 0.6);
}

.gf-studio__eyebrow {
  display: block;
  color: hsl(var(--primary));
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.gf-studio__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
}

/* Phones: one scrolling column, the photo on top and the controls under it */
.gf-studio__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Controls for the live camera overlay, which is switched off */
.gf-studio:not([data-live-preview]) [data-live-only] {
  display: none;
}

.gf-studio:not([data-live-preview]) .gf-stage__canvas {
  cursor: default;
  touch-action: auto;
}

/* Stage: camera feed, snapshot, or the upload prompt */

.gf-stage {
  position: relative;
  height: 56dvh;
  min-height: 18rem;
  overflow: hidden;
  background: #000;
}

/* Choosing a cut: nothing else is on screen yet, so it takes the whole space */
.gf-studio[data-view='intro'] .gf-stage {
  height: 100%;
}

.gf-stage__canvas,
.gf-stage__shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gf-stage__shot--mirrored {
  transform: scaleX(-1);
}

.gf-stage__canvas {
  cursor: grab;
  touch-action: none;
}

.gf-stage__canvas:active {
  cursor: grabbing;
}

.gf-stage__video {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.gf-studio:not([data-view='live']) .gf-stage__canvas,
.gf-studio:not([data-view='live']) .gf-compare,
.gf-studio:not([data-view='result']) .gf-stage__shot,
.gf-studio:not([data-view='intro']) .gf-intro,
.gf-studio[data-view='intro'] .gf-panel,
.gf-studio:not([data-view='live']) .gf-panel__live,
.gf-studio:not([data-view='result']) .gf-panel__result,
.gf-studio:not([data-source='none']) .gf-nosource,
.gf-studio:not([data-view='live']) .gf-nosource,
.gf-studio[data-view='live'][data-source='none'] .gf-compare {
  display: none;
}

.gf-intro {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  /* Centred when there's room; when there isn't, it starts at the top and scrolls,
     where plain centring would push its top edge out of reach. */
  place-items: start center;
  padding: 1rem;
  overflow-y: auto;
  background: radial-gradient(70% 50% at 50% 30%, hsl(var(--primary) / 0.08), transparent 70%), hsl(var(--background));
}

.gf-intro__card {
  margin-block: auto;
}

.gf-intro__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
  max-width: 26rem;
  padding: 2rem 1.25rem;
  border: 1.5px dashed hsl(var(--primary) / 0.45);
  border-radius: 1rem;
  text-align: center;
  background: var(--gradient-card);
}

.gf-intro__card h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
}

.gf-intro__card .gf-btn {
  white-space: normal;
  text-align: center;
}

.gf-intro__card p {
  color: hsl(var(--muted-foreground));
  font-size: 0.9375rem;
  line-height: 1.5;
}

.gf-tips {
  display: grid;
  gap: 0.5rem;
  width: 100%;
  padding-top: 1.25rem;
  border-top: 1px solid hsl(var(--border) / 0.6);
  color: hsl(var(--muted-foreground));
  font-size: 0.8125rem;
  text-align: left;
}

.gf-tips li {
  display: flex;
  gap: 0.5rem;
}

.gf-tips li::before {
  flex: none;
  color: hsl(var(--primary));
  content: '✓';
}

.gf-styles {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.625rem;
  width: 100%;
}

.gf-intro__card .gf-styles {
  padding-top: 1.25rem;
  border-top: 1px solid hsl(var(--border) / 0.6);
}

.gf-styles__title {
  color: hsl(var(--muted-foreground));
  font-size: 0.8125rem;
  line-height: 1.45;
  text-align: left;
}

.gf-presets {
  display: grid;
  grid-auto-columns: 4.75rem;
  grid-auto-flow: column;
  gap: 0.625rem;
  padding-block: 0.5rem 0.25rem; /* room for the "For you" tag */
  overflow-x: auto;
}

.gf-preset {
  position: relative;
  display: grid;
  gap: 0.375rem;
  justify-items: center;
  color: hsl(var(--muted-foreground));
  font-size: 0.6875rem;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
}

.gf-preset img {
  width: 4.5rem;
  height: 4.5rem;
  border: 2px solid hsl(var(--border));
  border-radius: 0.75rem;
  object-fit: cover;
  transition: border-color 0.2s;
}

.gf-preset:hover img,
.gf-preset:focus-visible img {
  border-color: hsl(var(--primary) / 0.6);
}

.gf-preset:focus-visible {
  outline: none;
}

.gf-preset[aria-pressed='true'] {
  color: hsl(var(--foreground));
}

.gf-preset[aria-pressed='true'] img {
  border-color: hsl(var(--primary));
}

/* Suggested for the viewer's face shape */
.gf-preset[data-suggested]::after {
  position: absolute;
  top: -0.375rem;
  right: 0;
  padding: 0.0625rem 0.375rem;
  border-radius: 999px;
  color: hsl(var(--primary-foreground));
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: hsl(var(--primary));
  content: 'For you';
}

.gf-nosource {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: start center;
  padding: 1rem;
  overflow-y: auto;
  background: hsl(var(--background));
}

.gf-nosource .gf-intro__card {
  border-style: solid;
  border-color: hsl(var(--border));
}

.gf-nosource .gf-btn {
  width: 100%;
}

/* Comparison: the viewer wearing every preset */
.gf-grid {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  background: hsl(var(--background));
}

.gf-grid__bar {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  font-family: var(--font-display);
  font-size: 1.0625rem;
}

.gf-grid__tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 0.75rem;
  align-content: start;
  padding: 0 1rem 1rem;
  overflow-y: auto;
}

.gf-tile {
  position: relative;
  display: grid;
  gap: 0.375rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.8125rem;
  text-align: center;
  cursor: pointer;
}

.gf-tile img {
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid hsl(var(--border));
  border-radius: 0.75rem;
  object-fit: cover;
  transition: border-color 0.2s;
}

.gf-tile:hover img,
.gf-tile:focus-visible img {
  border-color: hsl(var(--primary));
}

.gf-tile:focus-visible {
  outline: none;
}

.gf-tile[data-suggested]::after {
  position: absolute;
  top: 0.375rem;
  right: 0.375rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  color: hsl(var(--primary-foreground));
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: hsl(var(--primary));
  content: 'For you';
}

.gf-status {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  left: 0.75rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: fit-content;
  max-width: calc(100% - 1.5rem);
  margin-inline: auto;
  padding: 0.625rem 1rem;
  border: 1px solid hsl(var(--border));
  border-radius: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.4;
  text-align: center;
  background: hsl(var(--background) / 0.92);
  backdrop-filter: blur(8px);
}

.gf-status:empty {
  display: none;
}

.gf-status[data-kind='error'] {
  border-color: hsl(var(--destructive) / 0.7);
}

/* Waiting on the AI: the picture dims and the progress sits in the middle of it */
.gf-studio[data-waiting] .gf-stage::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgb(0 0 0 / 0.6);
  content: '';
}

.gf-studio[data-waiting] .gf-status {
  top: 50%;
  bottom: auto;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  transform: translateY(-50%);
}

/* A bar along the bottom that fills while a picture is being drawn */
.gf-status[data-kind='busy'] {
  background-image: linear-gradient(hsl(var(--primary)), hsl(var(--primary)));
  background-repeat: no-repeat;
  background-position: left bottom;
  background-size: calc(var(--progress, 0) * 100%) 3px;
  transition: background-size 0.5s linear;
}

.gf-status[data-kind='busy']::before {
  flex: none;
  width: 1rem;
  height: 1rem;
  border: 2px solid hsl(var(--primary) / 0.3);
  border-top-color: hsl(var(--primary));
  border-radius: 50%;
  content: '';
  animation: gf-spin 0.8s linear infinite;
}

@keyframes gf-spin {
  to {
    transform: rotate(360deg);
  }
}

.gf-compare {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* Panel: fit controls and snapshot actions */

.gf-panel {
  padding: 1rem;
  border-top: 1px solid hsl(var(--border) / 0.6);
  background: hsl(var(--card));
}

/* A titled block of related controls */
.gf-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
}

.gf-group + .gf-group {
  padding-top: 1rem;
  border-top: 1px solid hsl(var(--border) / 0.6);
}

.gf-group__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: hsl(var(--foreground));
  font-size: 0.9375rem;
  font-weight: 600;
}

/* The number of a step */
.gf-step {
  display: grid;
  flex: none;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  color: hsl(var(--primary-foreground));
  font-size: 0.75rem;
  font-weight: 700;
  background: hsl(var(--primary));
}

/* Nested groups (a tab's contents) don't get the divider of top-level ones */
.gf-group .gf-group {
  padding-top: 0;
  border-top: 0;
}

/* The ways of choosing a cut, one shown at a time */
.gf-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 0.75rem;
  background: hsl(var(--secondary));
}

.gf-tab {
  min-height: 2.5rem;
  padding: 0.25rem 0.375rem;
  border-radius: 0.5rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color 0.2s,
    color 0.2s;
}

.gf-tab:hover {
  color: hsl(var(--foreground));
}

.gf-tab:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

.gf-tab[aria-selected='true'] {
  color: hsl(var(--primary-foreground));
  font-weight: 600;
  background: var(--gradient-gold);
}

.gf-studio[data-busy] .gf-tab {
  opacity: 0.6;
  pointer-events: none;
}

/* Optional extras, folded away until asked for */
.gf-more {
  border: 1px solid hsl(var(--border));
  border-radius: 0.625rem;
}

.gf-more summary {
  padding: 0.625rem 0.75rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.8125rem;
  cursor: pointer;
}

.gf-more summary:hover {
  color: hsl(var(--foreground));
}

.gf-more summary:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

.gf-more__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0 0.75rem 0.75rem;
}

/* The opening choices */
.gf-ways {
  display: grid;
  gap: 0.75rem;
  width: 100%;
}

.gf-way {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  border: 1px solid hsl(var(--border));
  border-radius: 0.875rem;
  text-align: left;
  cursor: pointer;
  background: hsl(var(--secondary) / 0.6);
  transition:
    border-color 0.2s,
    background-color 0.2s;
}

.gf-way:focus-visible {
  border-color: hsl(var(--primary));
  outline: none;
  background: hsl(var(--primary) / 0.08);
}

/* Only where there's a real pointer: on a phone, the tap that opened this screen
   would otherwise leave whichever choice is under the finger looking selected. */
@media (hover: hover) {
  .gf-way:hover {
    border-color: hsl(var(--primary));
    background: hsl(var(--primary) / 0.08);
  }
}

.gf-way__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.12);
}

.gf-way__icon svg {
  width: 1.375rem;
  height: 1.375rem;
}

.gf-way__text {
  display: grid;
  gap: 0.125rem;
  color: hsl(var(--foreground));
  font-size: 0.9375rem;
}

.gf-way__text small {
  color: hsl(var(--muted-foreground));
  font-size: 0.8125rem;
  font-weight: 400;
}

.gf-studio[data-busy] .gf-way {
  opacity: 0.5;
  pointer-events: none;
}

/* The main action stays in reach at the bottom of the screen while the rest scrolls */
.gf-cta {
  position: sticky;
  bottom: 0;
  z-index: 1;
  display: grid;
  gap: 0.5rem;
  margin: 0 -1rem -1rem;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  border-top: 1px solid hsl(var(--border) / 0.6);
  text-align: center;
  background: hsl(var(--card));
}

.gf-panel__live,
.gf-panel__result {
  display: grid;
  /* minmax(0, …) lets the scrolling preset strip shrink instead of widening the panel */
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.gf-ref {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.gf-ref img {
  flex: none;
  width: 3.5rem;
  height: 3.5rem;
  border: 1px solid hsl(var(--primary) / 0.6);
  border-radius: 0.625rem;
  object-fit: cover;
}

.gf-ref__label {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.gf-ref__label small {
  display: block;
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
  font-weight: 400;
}

.gf-fit {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}

.gf-fit label {
  display: grid;
  gap: 0.25rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gf-fit input[type='range'] {
  width: 100%;
  accent-color: hsl(var(--primary));
}

.gf-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.gf-row > * {
  flex: 1 1 auto;
}

/* A labelled either-or setting */
.gf-choice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gf-choice__label {
  flex: 1;
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gf-choice .gf-btn {
  min-height: 2.25rem;
  padding-inline: 0.875rem;
  font-size: 0.8125rem;
}

/* An optional extra photo of the cut: an "add" button, or its thumbnail once added */
.gf-extra {
  display: grid;
}

.gf-extra .gf-btn img {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.375rem;
  object-fit: cover;
}

.gf-select {
  min-height: 2.25rem;
  padding: 0.25rem 0.625rem;
  border: 1px solid hsl(var(--border));
  border-radius: 0.5rem;
  color: hsl(var(--foreground));
  font: inherit;
  font-size: 0.8125rem;
  background: hsl(var(--secondary));
}

/* The honest verdict on whether the viewer's own hair can do the cut */
.gf-reality {
  --tone: hsl(var(--primary));
  display: grid;
  gap: 0.375rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--tone);
  border-radius: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.45;
  background: color-mix(in srgb, var(--tone) 8%, transparent);
}

.gf-reality[data-verdict='yes'] {
  --tone: hsl(142 60% 45%);
}

.gf-reality[data-verdict='no'] {
  --tone: hsl(var(--destructive));
}

.gf-reality__tag {
  color: var(--tone);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gf-reality p,
.gf-reality li,
.gf-reality small {
  color: hsl(var(--muted-foreground));
  font-size: 0.8125rem;
}

.gf-reality ul {
  display: grid;
  gap: 0.125rem;
  padding-left: 1.125rem;
  list-style: disc;
}

.gf-reality small {
  font-size: 0.6875rem;
}

.gf-reality__facts {
  display: grid;
  gap: 0.125rem;
  padding-top: 0.5rem;
  border-top: 1px solid color-mix(in srgb, var(--tone) 35%, transparent);
}

.gf-reality__facts:empty {
  display: none;
}

.gf-reality__facts dt {
  margin-top: 0.375rem;
  color: var(--tone);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gf-reality__facts dd {
  color: hsl(var(--foreground));
  font-size: 0.8125rem;
}

.gf-row--tight {
  flex-wrap: nowrap;
}

.gf-row--tight > * {
  flex: 1 1 0;
  min-width: 0;
  padding-inline: 0.375rem;
  font-size: 0.8125rem;
}

/* Features that need the server: hidden when the page is served without it */
.gf-studio:not([data-server]) [data-needs-server] {
  display: none;
}

.gf-ai,
.gf-picks {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.625rem;
}

.gf-pick {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.125rem 0.75rem;
  align-items: center;
  padding: 0.625rem 0.75rem;
  border: 1px solid hsl(var(--border));
  border-radius: 0.625rem;
  font-size: 0.875rem;
}

/* Style choices for the suggestions */
.gf-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.gf-chip {
  min-height: 2.25rem;
  padding: 0.25rem 0.875rem;
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  color: hsl(var(--muted-foreground));
  font-size: 0.8125rem;
  cursor: pointer;
  transition:
    border-color 0.2s,
    color 0.2s;
}

.gf-chip:hover {
  color: hsl(var(--foreground));
}

.gf-chip:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

.gf-chip[aria-pressed='true'] {
  border-color: hsl(var(--primary));
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.1);
}

.gf-studio[data-busy] .gf-chip {
  opacity: 0.5;
  pointer-events: none;
}

/* While more suggestions are still arriving */
.gf-picks__more {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gf-picks__more::before {
  flex: none;
  width: 0.875rem;
  height: 0.875rem;
  border: 2px solid hsl(var(--primary) / 0.3);
  border-top-color: hsl(var(--primary));
  border-radius: 50%;
  content: '';
  animation: gf-spin 0.8s linear infinite;
}

.gf-pick small {
  margin-left: 0.375rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.6875rem;
  font-weight: 400;
}

.gf-pick p {
  grid-column: 1;
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
  line-height: 1.45;
}

.gf-pick .gf-btn {
  grid-row: 1 / span 2;
  grid-column: 2;
  min-height: 2.25rem;
  padding-inline: 0.75rem;
}

.gf-hint {
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
  line-height: 1.5;
}

.gf-panel__result h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

/* Buttons */

.gf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.625rem;
  color: hsl(var(--secondary-foreground));
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  background: hsl(var(--secondary));
  transition:
    background-color 0.2s,
    border-color 0.2s,
    transform 0.2s;
}

.gf-btn:hover {
  background: hsl(var(--muted));
}

.gf-btn:active {
  transform: scale(0.98);
}

.gf-btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.gf-btn:focus-visible,
.gf-icon-btn:focus-visible,
.gf-fit input:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

.gf-btn svg {
  flex: none;
  width: 1rem;
  height: 1rem;
}

.gf-btn--gold {
  color: hsl(var(--primary-foreground));
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--gradient-gold);
  box-shadow: 0 0 30px hsl(var(--primary) / 0.25);
}

.gf-btn--gold:hover {
  background: var(--gradient-gold);
  box-shadow: 0 0 40px hsl(var(--primary) / 0.4);
}

.gf-btn--outline {
  border-color: hsl(var(--primary) / 0.7);
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.08);
}

.gf-btn--outline:hover {
  background: hsl(var(--primary) / 0.16);
}

.gf-btn--icon {
  flex: none;
  min-width: 2.75rem;
  padding-inline: 0;
  color: hsl(var(--muted-foreground));
}

.gf-btn--lg {
  min-height: 3.25rem;
  padding-inline: 1.5rem;
  font-size: 0.9375rem;
}

.gf-btn--glass {
  border-color: hsl(var(--border));
  background: hsl(var(--background) / 0.8);
  backdrop-filter: blur(8px);
}

.gf-btn[aria-pressed='true'] {
  border-color: hsl(var(--primary));
  color: hsl(var(--primary));
}

.gf-icon-btn {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.625rem;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
}

.gf-icon-btn:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--secondary));
}

.gf-studio[data-busy] .gf-tile,
.gf-studio[data-busy] .gf-preset,
.gf-studio[data-busy] .gf-btn,
.gf-studio[data-busy] label.gf-btn {
  opacity: 0.5;
  pointer-events: none;
}

/* Desktop: a centered window with the controls beside the stage */

@media (min-width: 900px) {
  .gf-studio {
    width: min(1120px, 94vw);
    height: min(760px, 92dvh);
    margin: auto;
    border: 1px solid hsl(var(--border));
    border-radius: 1rem;
    box-shadow: 0 30px 80px rgb(0 0 0 / 0.6);
  }

  .gf-studio__bar {
    padding: 1rem 1.25rem;
  }

  .gf-studio__body {
    display: flex;
    overflow: hidden;
  }

  .gf-stage {
    flex: 1;
    height: auto;
  }

  .gf-studio[data-view] .gf-stage {
    height: auto;
  }

  .gf-panel {
    flex: none;
    width: 22rem;
    padding: 1.25rem;
    overflow-y: auto;
    border-top: 0;
    border-left: 1px solid hsl(var(--border) / 0.6);
  }

  .gf-cta {
    margin: 0 -1.25rem -1.25rem;
    padding: 1rem 1.25rem;
  }

}

@media (prefers-reduced-motion: reduce) {
  .gf-btn {
    transition: none;
  }

  .gf-status[data-kind='busy']::before {
    animation-duration: 2.4s;
  }
}

/* The box for asking for a small change to a drawn picture. */
.gf-tweak {
  display: grid;
  gap: 0.4rem;
}

.gf-tweak label {
  font-weight: 600;
}

.gf-tweak__row {
  display: flex;
  gap: 0.5rem;
}

.gf-tweak__row input {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0.75rem;
  border-width: 1px;
  border-radius: 0.5rem;
  background: hsl(var(--secondary));
}

.gf-tweak__row input:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 1px;
}

/* Over the camera view: the button that takes the photo, and a way out. */
.gf-shutter {
  position: absolute;
  right: 0;
  bottom: 1rem;
  left: 0;
  z-index: 3;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.gf-studio[data-view='live'][data-source='camera'] .gf-shutter {
  display: flex;
}

/* (Messages sit above the button while the camera is on.) */
.gf-studio[data-view='live'][data-source='camera'] .gf-status {
  bottom: 5rem;
}
