:root {
  --accent-color: #246bfe;
  --on-accent-color: #ffffff;
  --host-safe-top: 0px;
  --host-safe-right: 0px;
  --host-safe-bottom: 0px;
  --host-safe-left: 0px;
  --color-main: #172033;
  --color-back: #f6f7f9;
  --color-panel: #ffffff;
  --color-border: #d7dce5;
  --color-muted: #5d697d;
  --font-ui: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--color-main);
  background: var(--color-back);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent-color) 72%, white);
  outline-offset: 3px;
}

button,
input {
  font: inherit;
}

button {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-main);
  background: var(--color-panel);
  min-height: 2.5rem;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  transition:
    background-color 3333ms ease,
    border-color 3333ms ease,
    color 3333ms ease,
    fill 3333ms ease,
    stroke 3333ms ease;
}

button:hover {
  border-color: var(--accent-color);
}

#app-direct-header {
  position: fixed;
  z-index: 20;
  top: 0;
  right: 0;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.5rem;
  padding: 1rem;
  border-bottom: 1px solid var(--color-border);
  background: color-mix(in srgb, var(--color-panel) 94%, transparent);
  transition:
    background-color 3333ms ease,
    border-color 3333ms ease,
    color 3333ms ease,
    fill 3333ms ease,
    stroke 3333ms ease;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  color: var(--color-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breadcrumb a {
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb a[aria-current="page"] {
  color: inherit;
}

.logo-trigger,
.icon-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.5rem;
  padding: 0;
}

.logo-trigger {
  align-self: center;
  width: 2.5rem;
  height: 2.5rem;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.logo-trigger img {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  object-fit: contain;
}

#app-preferences-panel {
  position: fixed;
  z-index: 30;
  inset: 0 0 0 auto;
  width: min(23rem, 100vw);
  border-left: 1px solid var(--color-border);
  background: var(--color-panel);
  box-shadow: -18px 0 36px rgba(23, 32, 51, 0.14);
  transform: translateX(100%);
  transition:
    background-color 3333ms ease,
    border-color 3333ms ease,
    color 3333ms ease,
    fill 3333ms ease,
    stroke 3333ms ease;
}

#app-preferences-panel[aria-hidden="false"] {
  transform: translateX(0);
}

.preferences-panel-inner {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.preferences-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preferences-head h2,
.preference-section h3,
.proof-copy h1,
.proof-copy p {
  margin: 0;
}

.preference-section {
  display: grid;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.preference-section p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.92rem;
}

.preferences-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 0.92rem;
}

#app {
  min-height: 100vh;
  padding: 6rem 1rem 4.5rem;
}

.proof-surface {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem);
  gap: 1rem;
  align-items: stretch;
  max-width: 58rem;
  min-height: 24rem;
  margin: 0 auto;
}

.proof-copy,
.counter-panel {
  background: transparent;
}

.proof-copy {
  display: grid;
  align-content: center;
  gap: 0.8rem;
  padding: clamp(1.25rem, 4vw, 2.4rem);
}

.kicker {
  color: var(--accent-color);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  transition: color 3333ms ease;
}

.proof-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 4.2rem);
  line-height: 1.02;
}

.proof-copy p:not(.kicker) {
  max-width: 34rem;
  color: var(--color-muted);
}

.counter-panel {
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: center;
  gap: 0.65rem;
  min-height: 0;
  padding: 0;
}

.counter-label {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

#counter-value {
  display: grid;
  place-items: center;
  min-height: 4rem;
  color: var(--accent-color);
  font-family: var(--font-mono);
  font-size: clamp(3rem, 13vw, 6rem);
  line-height: 1;
  transition: color 3333ms ease;
}

.counter-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0.5rem;
}

.counter-actions button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.75rem;
  min-width: 2.75rem;
  height: 2.5rem;
  padding: 0.45rem;
  border-color: transparent;
  color: var(--accent-color);
  background: transparent;
  white-space: nowrap;
}

.counter-icon {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

.counter-operator {
  color: var(--color-main);
  font-weight: 800;
  line-height: 1;
}

.counter-status {
  min-height: 1.5rem;
  margin: 0;
  color: var(--color-muted);
  font-size: 0.86rem;
  text-align: center;
}

#reset-button {
  border-color: var(--accent-color);
  color: var(--on-accent-color);
  background: var(--accent-color);
}

#app-direct-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  min-height: 3rem;
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  background: color-mix(in srgb, var(--color-panel) 94%, transparent);
  font-size: 0.88rem;
  transition:
    background-color 3333ms ease,
    border-color 3333ms ease,
    color 3333ms ease,
    fill 3333ms ease,
    stroke 3333ms ease;
}

html[data-embed-context="full"] #app-direct-header,
html[data-embed-context="full"] #app-preferences-panel,
html[data-embed-context="full"] #app-direct-footer,
html[data-embed-context="inline"] #app-direct-header,
html[data-embed-context="inline"] #app-preferences-panel,
html[data-embed-context="inline"] #app-direct-footer {
  display: none;
}

html[data-embed-context="full"] #app {
  min-height: 100vh;
  padding:
    calc(1rem + var(--host-safe-top))
    calc(1rem + var(--host-safe-right))
    calc(1rem + var(--host-safe-bottom))
    calc(1rem + var(--host-safe-left));
}

html[data-embed-context="full"] .proof-surface {
  grid-template-columns: minmax(0, 1fr);
  min-height: calc(100vh - 2rem - var(--host-safe-top) - var(--host-safe-bottom));
}

html[data-embed-context="full"] .proof-copy,
html[data-embed-context="inline"] .proof-copy {
  display: none;
}

html[data-embed-context="inline"] body {
  background: transparent;
}

html[data-embed-context="inline"] #app {
  min-height: 0;
  padding:
    var(--host-safe-top)
    var(--host-safe-right)
    var(--host-safe-bottom)
    var(--host-safe-left);
}

html[data-embed-context="inline"] .proof-surface {
  grid-template-columns: 1fr;
  min-height: 0;
  max-width: none;
}

html[data-hosted="homepage"][data-embed-context="full"] body,
html[data-hosted="homepage"][data-embed-context="inline"] body {
  background: transparent;
}

html[data-hosted="homepage"] button,
html[data-hosted="homepage"] #app-direct-header,
html[data-hosted="homepage"] #app-preferences-panel,
html[data-hosted="homepage"] #app-direct-footer,
html[data-hosted="homepage"] .kicker,
html[data-hosted="homepage"] #counter-value {
  transition: none;
}

@media (max-width: 700px) {
  .proof-surface {
    grid-template-columns: 1fr;
  }

  .breadcrumb {
    font-size: 0.9rem;
  }

}

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