/* Font-review controls are independent of the selected Arcade typeface. */
.font-studio,
.font-gallery,
.font-preview-error {
  font-family: Manrope, Arial, sans-serif;
  font-synthesis: none;
  letter-spacing: normal;
}
.font-studies-active .studio-bar { display: none; }
.font-studio {
  position: fixed;
  z-index: 60;
  inset: auto 0 0;
  height: var(--rail, 90px);
  display: grid;
  grid-template-columns: minmax(130px, 180px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 12px 24px;
  border-top: 1px solid #ffffff1b;
  background: #0a0b0ef7;
  color: #efeff2;
  backdrop-filter: blur(18px);
}
.font-studio-context { display: grid; gap: 4px; min-width: 0; }
.font-studio-kicker,
.font-gallery-kicker {
  margin: 0;
  color: #858792;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .14em;
}
.font-studio-current { font-size: 12px; line-height: 1.3; }
.font-studio-status { min-height: 12px; color: #9295a3; font-size: 9px; line-height: 1.3; }
.font-studio-status.is-error { color: #ffc19e; }
.font-studio-tabs {
  position: relative;
  display: flex;
  gap: 5px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  padding: 5px;
  margin: -5px;
}
.font-studio-tabs::-webkit-scrollbar { display: none; }
.font-studio button,
.font-gallery-back {
  font-family: Manrope, Arial, sans-serif;
  font-weight: 400;
  letter-spacing: normal;
  cursor: pointer;
  transition: background .16s, border-color .16s, color .16s;
}
.font-studio-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 1 0 auto;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #999ca8;
  white-space: nowrap;
  font-size: 11px;
}
.font-tab-number { color: #686c79; font-size: 9px; font-variant-numeric: tabular-nums; }
.font-studio-tabs button[aria-selected="true"] {
  border-color: #ffffff28;
  background: #1c1e26;
  color: #fff;
}
.font-studio-tabs button[aria-selected="true"] .font-tab-number { color: #edaa80; }
.font-studio-tabs button.is-loading { border-color: #e9a87a7a; }
.font-studio-tabs button:hover { color: #fff; background: #ffffff09; }
.font-studio-actions { display: flex; align-items: center; gap: 7px; }
.font-studio-actions button,
.font-gallery-back {
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid #ffffff25;
  border-radius: 6px;
  background: #ffffff03;
  color: #c8cad3;
  white-space: nowrap;
  font-size: 10px;
  line-height: 1.3;
}
.font-studio-actions button:hover,
.font-gallery-back:hover { background: #ffffff0e; color: #fff; }
.font-studio-actions .font-studio-pause { width: 34px; padding-inline: 0; font-size: 13px; }
.font-studio button:focus-visible,
.font-gallery a:focus-visible,
.font-gallery button:focus-visible { outline: 2px solid #edaa80; outline-offset: 3px; }
.font-gallery {
  min-height: 100svh;
  padding: 42px 4.5% calc(var(--rail, 90px) + 40px);
  background: #101115;
  color: #f3f3f5;
}
.font-gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
}
.font-gallery-header h1 {
  margin: 13px 0 0;
  font-family: Manrope, Arial, sans-serif;
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: -.04em;
}
.font-gallery-intro { margin: 12px 0 0; color: #999da9; font-size: 13px; line-height: 1.6; }
.font-gallery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 22px; }
.font-gallery-card { min-width: 0; }
.font-gallery-preview {
  position: relative;
  display: block;
  overflow: hidden;
  isolation: isolate;
  aspect-ratio: 1.6;
  border: 1px solid #ffffff1f;
  border-radius: 6px;
  background: #0c101b;
}
.font-gallery-preview:hover,
.font-gallery-card.is-selected .font-gallery-preview { border-color: #e9a87a8c; }
.font-gallery-frame {
  position: absolute;
  inset: 0 auto auto 0;
  width: 1600px;
  height: 1000px;
  border: 0;
  pointer-events: none;
  transform: scale(var(--font-preview-scale, .4));
  transform-origin: top left;
}
.font-gallery-open {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 9px 12px;
  border: 1px solid #ffffff2b;
  border-radius: 999px;
  background: #0a0e18db;
  color: #efeff3;
  font-size: 10px;
  opacity: 0;
  transition: opacity .16s;
}
.font-gallery-preview:hover .font-gallery-open,
.font-gallery-preview:focus-visible .font-gallery-open { opacity: 1; }
.font-gallery-caption { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 2px 0; }
.font-gallery-caption h2 { margin: 0; font-size: 16px; font-weight: 500; line-height: 1.4; letter-spacing: -.025em; }
.font-gallery-caption h2 span { margin-right: 10px; color: #777c8b; font-size: 10px; font-weight: 400; }
.font-gallery-caption > span { color: #bba28f; font-size: 10px; }
.font-preview-error { position: absolute; z-index: 30; inset: auto 20px 20px; margin: 0; padding: 12px; background: #18131ded; color: #ffd2b5; font-size: 13px; line-height: 1.5; }
/* Hidden review panels must never override the page's concept switches. */
.font-studio[hidden],
.font-gallery[hidden] { display: none !important; }
.clean .font-studio,
.clean .font-gallery { display: none !important; }
.clean.font-studies-active { --rail: 0px !important; }
@media (max-width: 1180px) and (min-width: 768px) {
  .font-studio { grid-template-columns: 125px minmax(0, 1fr) auto; gap: 10px; padding-inline: 16px; }
  .font-studio-tabs button { padding-inline: 8px; gap: 5px; font-size: 10px; }
  .font-tab-number { display: none; }
  .font-studio-actions { gap: 5px; }
  .font-studio-actions button { padding-inline: 8px; font-size: 9px; }
}
@media (max-width: 767px) {
  body.font-studies-active { --rail: 144px; }
  body.clean.font-studies-active { --rail: 0px !important; }
  .font-studio {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto 48px;
    gap: 10px 8px;
    padding: 12px 16px 14px;
  }
  .font-studio-context { gap: 4px; }
  .font-studio-kicker { font-size: 7px; }
  .font-studio-current { font-size: 10px; }
  .font-studio-status { max-width: 150px; font-size: 8px; }
  .font-studio-actions { gap: 5px; }
  .font-studio-actions button { min-height: 34px; padding-inline: 8px; font-size: 9px; }
  .font-studio-actions .font-studio-pause { width: 28px; }
  .font-studio-tabs { grid-column: 1 / -1; grid-row: 2; align-self: stretch; gap: 6px; margin: 0 -4px; padding: 3px 4px; }
  .font-studio-tabs button { flex: 0 0 auto; min-height: 42px; padding-inline: 12px; font-size: 11px; }
  .font-tab-number { display: inline; }
  .font-gallery { padding: 28px 20px calc(var(--rail, 144px) + 28px); }
  .font-gallery-header { align-items: flex-start; flex-direction: column; gap: 20px; margin-bottom: 26px; }
  .font-gallery-header h1 { font-size: 30px; }
  .font-gallery-intro { font-size: 12px; }
  .font-gallery-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .font-gallery-caption { gap: 8px; padding-top: 12px; }
  .font-gallery-caption h2 { font-size: 15px; }
  .font-gallery-caption > span { font-size: 9px; }
  .font-gallery-open { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .font-studio *, .font-gallery * { transition: none !important; }
}
