:root {
  --tocco-red: #b32a31;
  --tocco-red-dark: #8f2127;
  --ink: #1c1c1e;
  --muted: #6b6b70;
  --line: #e3e3e6;
  --bg: #f6f6f7;
  --card: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  line-height: 1.5;
}

a {
  color: var(--tocco-red);
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--card);
}

.site-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Collapsible setup block. */
.setup {
  margin-bottom: 24px;
}

/* Two islands side by side, stacking to one column on narrow screens. */
.islands {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 24px;
  align-items: start;
}

/* Sub-points inside the "Technische Infos" island */
.subsection + .subsection {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.subsection__heading {
  font-size: 15px;
  margin: 16px 0 8px;
}

@media (max-width: 860px) {
  .islands {
    /* minmax(0, 1fr), not 1fr, so the column may shrink below the width of
       wide <pre> blocks instead of forcing the page wider than the viewport. */
    grid-template-columns: minmax(0, 1fr);
  }
}

.site-header__logo {
  width: 34px;
  height: 34px;
}

.site-header__title {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.site-header__title .light {
  font-weight: 300;
  color: var(--muted);
}

/* Intro */
.intro {
  margin: 32px 0 24px;
}

.intro h2 {
  margin: 0 0 8px;
  font-size: 26px;
}

.intro p {
  margin: 0;
  color: var(--muted);
  max-width: 60ch;
}

/* Card */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.card h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

/* Collapsible block */
.collapsible__summary {
  cursor: pointer;
  font-size: 17px;
  font-weight: 600;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
}

/* hide the default disclosure marker */
.collapsible__summary::-webkit-details-marker {
  display: none;
}

/* custom chevron: points right when closed, down when open */
.collapsible__summary::before {
  content: '';
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: -3px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.collapsible[open] .collapsible__summary::before {
  transform: rotate(45deg);
  margin-top: -1px;
}

.collapsible[open] .collapsible__summary {
  margin-bottom: 20px;
}

.collapsible__summary:hover {
  color: var(--tocco-red);
}

.card__hint {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
}

/* Form */
.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
}

.field input:focus {
  outline: none;
  border-color: var(--tocco-red);
  box-shadow: 0 0 0 3px rgba(179, 42, 49, 0.12);
}

.field__hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.field__error {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--tocco-red);
}

/* Status of the theme textarea relative to what is actually applied. */
.theme-notice {
  margin: 8px 0 0;
  font-size: 12px;
  border: 1px solid;
  border-radius: 6px;
  padding: 8px 10px;
}

/* draft differs from applied → not active yet */
.theme-notice--pending {
  color: #7a5c00;
  background: #fff8e1;
  border-color: #f0e2b0;
}

.theme-notice--pending strong {
  color: #6b4f00;
}

/* draft matches applied → active */
.theme-notice--active {
  color: #1b5e20;
  background: #e9f5ea;
  border-color: #c3e6c8;
}

.theme-notice--active strong {
  color: #14471a;
}

.field__label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.field__label-row label {
  margin-bottom: 0;
}

.theme-input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1.5;
  /* height is set to fit the content from JS; no manual resize / scrollbar */
  resize: none;
  overflow: hidden;
  min-height: 5em;
  tab-size: 2;
}

.theme-input:focus {
  outline: none;
  border-color: var(--tocco-red);
  box-shadow: 0 0 0 3px rgba(179, 42, 49, 0.12);
}

.theme-input--error,
.theme-input--error:focus {
  border-color: var(--tocco-red);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin: 0 0 16px;
}

fieldset legend {
  font-size: 13px;
  font-weight: 600;
  padding: 0 6px;
}

/* Buttons */
.btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 11px 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.btn--primary {
  background: var(--tocco-red);
  color: #fff;
}

.btn--primary:hover {
  background: var(--tocco-red-dark);
}

.btn--ghost {
  background: transparent;
  color: var(--tocco-red);
  border: 1px solid var(--line);
}

.btn--ghost:hover {
  border-color: var(--tocco-red);
}

.btn--small {
  padding: 7px 14px;
  font-size: 14px;
}

.btn--icon {
  padding: 0;
  width: 40px;
  height: 40px;
  font-size: 20px;
  line-height: 1;
  flex: 0 0 auto;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* Widget mount area */
.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.widget-header h3 {
  margin: 0;
}

.widget-block {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.widget-block > .collapsible__summary {
  font-weight: 400;
}

.widget-mount {
  padding: 8px 0;
  min-height: 40px;
}

/* Widget key list in the form */
.key-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.key-row input {
  flex: 1 1 auto;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
}

.key-row input:focus {
  outline: none;
  border-color: var(--tocco-red);
  box-shadow: 0 0 0 3px rgba(179, 42, 49, 0.12);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #f0f0f2;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 13px;
  /* break long tokens (URLs, keys) instead of overflowing on mobile */
  overflow-wrap: anywhere;
}

pre {
  background: #1c1c1e;
  color: #f6f6f7;
  padding: 16px;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 11px;
  line-height: 1.5;
}

pre code {
  background: none;
  color: inherit;
  padding: 0;
  /* inherit <pre> font-size (overrides the global code rule) and don't wrap */
  font-size: inherit;
  overflow-wrap: normal;
}

/* Mobile refinements. Scoped to small screens so the laptop view is unchanged. */
@media (max-width: 600px) {
  .card {
    padding: 16px;
  }

  .intro {
    margin: 24px 0 20px;
  }

  .widget-mount {
    padding: 14px;
  }

  fieldset {
    padding: 12px;
  }

  pre {
    padding: 12px;
  }

  .field__label-row {
    flex-wrap: wrap;
  }
}

