:root {
  --preview-bar-height: 60px;
  --preview-frame: min(1320px, 100%);
  --preview-gutter: clamp(16px, 3.2vw, 48px);
}
.global-bar {
  height: var(--preview-bar-height);
  padding-inline: var(--preview-gutter);
  gap: clamp(12px, 2vw, 28px);
  background: color-mix(in srgb, var(--theme-top, var(--bar)) 86%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--theme-rail) 32%, var(--line));
  backdrop-filter: saturate(1.35) blur(18px);
}
.global-bar > .global-brand {
  min-height: 36px;
  margin-inline-start: -6px;
  padding-inline: 6px;
  border-radius: 9px;
  font-weight: 650;
  letter-spacing: -.025em;
}
:root[data-palette] .global-bar > .global-brand:is(:hover,:focus-visible) {
  background: color-mix(in srgb, var(--theme-selected) 84%, var(--theme-ring));
  color: var(--theme-selected-text);
}
:root[data-palette] .global-bar > .global-brand:focus-visible { outline-offset: 1px; }
.global-brand img { display: block; width: 28px; height: 28px; object-fit: contain; }
.global-bar .settings-button { flex: none; width: 40px; height: 40px; padding: 0; }
.global-bar .merged-tool {
  display: grid;
  grid-template-columns: minmax(0, 136px) auto;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.global-bar .merged-tool > .component-name {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 36px;
  margin: 0;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 16px;
  line-height: 1;
  font-weight: 620;
  white-space: nowrap;
}
:root[data-palette] .global-bar .merged-tool > button.component-name:is(:hover,:focus-visible):not(:disabled) {
  background: color-mix(in srgb, var(--theme-selected) 84%, var(--theme-ring));
  color: var(--theme-selected-text);
  outline: none;
}
.global-bar .merged-tool > button.component-name:focus-visible {
  outline: 2px solid var(--theme-ring);
  outline-offset: 1px;
}
.global-bar .component-controls { height: 40px; align-items: center; }
.global-bar .component-controls > button {
  display: inline-grid;
  place-items: center;
  min-height: 36px;
  line-height: 1.15;
}
@media (min-width: 901px) {
  .global-bar .component-controls > button[data-action="menu"] { display: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .global-bar { background: var(--theme-top, var(--bar)); backdrop-filter: none; }
}
#workspace { height: calc(100dvh - var(--preview-bar-height)); }

:root[data-palette] .preview-home {
  background: var(--group, var(--bg));
  color: var(--label);
  padding: clamp(10px, 1.5vw, 22px) var(--preview-gutter) 10px;
}
:root[data-palette] .preview-home .hero-editorial {
  width: var(--preview-frame);
  padding: 0;
  isolation: isolate;
  border-radius: clamp(20px, 2.5vw, 32px);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--line) 70%, transparent);
}
:root[data-palette] .preview-home .hero-stage {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  max-width: none;
  border: 0;
  overflow: hidden;
}
.preview-home .hero-artwork {
  position: absolute;
  inset: 0;
}
.preview-home .hero-stage .hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: contain;
  object-position: center;
}
.preview-home .hero-image { animation: none; transform: none; }
.preview-home .hero-effects {
  position: absolute;
  pointer-events: none;
}
.preview-home .hero-motion-toggle:not([hidden]) {
  position: absolute;
  z-index: 2;
  inset: auto 12px 12px auto;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid #ffffff35;
  border-radius: 50%;
  background: #181921b8;
  color: #fff;
  cursor: pointer;
}
.preview-home .hero-motion-toggle:hover { background: #181921ed; }
.hero-motion-toggle::before {
  content: '';
  width: 9px;
  height: 12px;
  border-inline: 2px solid currentColor;
}
.hero-motion-toggle[data-paused]::before {
  width: 0;
  height: 0;
  border: 0;
  border-block: 6px solid transparent;
  border-inline-start: 9px solid currentColor;
  margin-inline-start: 2px;
}
.preview-home .hero-editorial .hero-copy {
  inset: clamp(24px, 5.7vh, 56px) 18px auto;
  width: auto;
  text-align: center;
}
.preview-home .hero-copy h1 {
  font-size: clamp(42px, 6.1vw, 88px);
  font-weight: 660;
  line-height: 1.01;
  letter-spacing: -.067em;
}
:root[data-palette="chiikawa"] .preview-home .hero-editorial .hero-copy {
  inset: 23% auto auto 6%;
  width: 39%;
  text-align: start;
}
.preview-home .editorial-tools {
  --poster-ratio: 4 / 3;
  width: var(--preview-frame);
  max-width: none;
  margin: clamp(12px, 2vw, 22px) auto 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 1.35vw, 18px);
}
:root[data-palette="chiikawa"] .preview-home .editorial-tools { --poster-ratio: 1; }
:root[data-palette] .preview-home .editorial-tools .poster-card {
  aspect-ratio: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  border: 1px solid var(--line);
  border-radius: 20px;
  min-width: 0;
  background: var(--surface);
  box-shadow: 0 2px 6px #15182108;
  transition: box-shadow .22s ease, border-color .22s ease;
}
:root[data-palette] .preview-home .editorial-tools .poster-art {
  position: relative;
  inset: auto;
  grid-area: 1 / 1;
  align-self: stretch;
  justify-self: stretch;
  width: 100%;
  aspect-ratio: var(--poster-ratio);
  z-index: auto;
  mask-image: none;
  min-width: 0;
  min-height: 0;
  isolation: isolate;
  background: color-mix(in srgb, var(--fill) 68%, var(--surface));
}
:root[data-palette] .preview-home .editorial-tools .poster-art::after { content: none; }
:root[data-palette] .preview-home .editorial-tools .poster-card .poster-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  object-fit: cover;
  object-position: var(--poster-position, center);
  transform: none;
}
.preview-home .poster-cpp { --poster-position: 64% center; }
.preview-home .poster-drill { --poster-position: 58% center; }
.preview-home :is(.poster-review,.poster-analysis) { --poster-position: center 74%; }
:root[data-palette="chiikawa"] .preview-home .poster-card { --poster-position: center; }
/* Keep the artwork independent from the label so every palette stays readable. */
.preview-home .editorial-tools .poster-card .poster-copy {
  position: relative;
  grid-area: 2 / 1;
  align-self: stretch;
  justify-self: stretch;
  inset: auto;
  transform: none;
  width: auto;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0,1fr);
  grid-template-rows: auto minmax(2.7em, auto);
  font-size: 13px;
  gap: 3px 6px;
  align-content: center;
  padding: 13px 15px 14px;
  text-align: start;
  background: var(--surface);
}
:root[data-palette] .preview-home .editorial-tools .poster-card h2 {
  font-size: clamp(16px, 1.55vw, 24px);
  line-height: 1.1;
  letter-spacing: -.036em;
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  color: var(--label);
  text-shadow: none;
}
:root[data-palette] .preview-home .editorial-tools .poster-card .poster-tagline {
  grid-column: 1;
  grid-row: 2;
  font-size: 13px;
  line-height: 1.35;
  margin: 0;
  color: var(--secondary);
  text-shadow: none;
  text-wrap: pretty;
}
.preview-home .poster-cells {
  position: absolute;
  inset: auto 10px 10px auto;
  z-index: 1;
  padding: 5px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface) 83%, transparent);
}
.preview-home .poster-cells i { width: 8px; height: 8px; border-radius: 2px; }
.preview-home .poster-card:hover { border-color: var(--theme-rail); box-shadow: 0 5px 20px #11182715; }
.preview-home .poster-card:is(:hover,:focus-visible) .poster-copy { background: color-mix(in srgb, var(--theme-selected) 43%, var(--surface)); }
.preview-home .poster-card:focus-visible { outline-color: var(--theme-ring); outline-offset: 3px; }

@media (max-width: 1130px) {
  .preview-home .editorial-tools { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  :root { --preview-bar-height: 56px; --preview-gutter: 12px; }
  .global-bar { gap: 8px; }
  .global-bar .merged-tool { grid-template-columns: minmax(0, 112px) auto; gap: 3px; }
  .global-bar .merged-tool > .component-name { font-size: 14px; padding-inline: 6px; }
  .global-bar .component-controls > button { padding-inline: 6px; }
  .preview-home .hero-editorial .hero-copy { inset: clamp(12px,3vw,22px) 12px auto; }
  .preview-home .hero-copy h1 { font-size: clamp(24px, 7.4vw, 51px); }
  :root[data-palette="chiikawa"] .preview-home .hero-editorial .hero-copy {
    inset: 18% auto auto 6%;
    text-align: start;
  }
  :root[data-palette="chiikawa"] .preview-home .hero-copy h1 { font-size: clamp(19px, 5.7vw, 42px); }
  .preview-home .editorial-tools { grid-template-columns: repeat(2, minmax(0,1fr)); }
  :root[data-palette] .preview-home .editorial-tools .poster-card {
    border-radius: 16px;
  }
  .preview-home .editorial-tools .poster-card .poster-copy { padding: 10px 11px; }
}
@media (max-width: 350px) {
  .global-bar .merged-tool > .component-name { font-size: 13px; padding-inline: 4px; }
  .global-bar .component-controls > button { padding-inline: 4px; }
  .preview-home .editorial-tools .poster-card .poster-copy { padding-inline: 8px; }
}

.settings-section .settings-group {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 0 14px;
}
.settings-group > summary {
  min-height: 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  margin-inline: -14px;
  padding-inline: 14px;
  border-radius: 13px;
}
.settings-group > summary::-webkit-details-marker { display: none; }
.settings-group > summary::after {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  flex: none;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  color: var(--secondary);
}
.settings-group > summary::after { transform: rotate(-45deg); margin-right: 2px; }
.settings-group[open] > summary::after { transform: translateY(-2px) rotate(45deg); }
.settings-group > summary:is(:hover,:focus-visible) { background: var(--fill); }

#home .site-filing {
  justify-content: center;
  padding: 12px 4px 0;
  text-align: center;
  font-size: 12px;
  color: var(--secondary);
}
.site-filing a {
  padding: 8px 12px;
  border-radius: 8px;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.site-filing a:is(:hover, :focus-visible) { color: var(--label); }
.settings-group > summary:focus-visible { outline-offset: -3px; }
.settings-group > :last-child { margin-bottom: 14px; }
.settings-group:not([open]) > summary { margin-bottom: 0; }
#settings:has(#connectionStatus:not(:empty)) #connectionStatus { margin-block: 8px 12px; }
