.r33-page-editor-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2147483000;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #181818;
  border-radius: 6px;
  background: #ffd03f;
  color: #111;
  font: 800 14px/1 system-ui, sans-serif;
  letter-spacing: 0;
  box-shadow: 0 8px 24px rgb(0 0 0 / 18%);
  cursor: pointer;
}

.r33-page-editor-launcher:hover,
.r33-page-editor-launcher:focus-visible {
  background: #ffe176;
}

.r33-page-editor-panel {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 2147483100;
  display: none;
  width: min(390px, 100vw);
  overflow: auto;
  border-left: 1px solid #3a3a3a;
  background: #181818;
  color: #f7f7f3;
  font: 15px/1.45 system-ui, sans-serif;
  letter-spacing: 0;
  box-shadow: -12px 0 30px rgb(0 0 0 / 24%);
}

body.r33-page-editor-active .r33-page-editor-panel {
  display: block;
}

body.r33-page-editor-active {
  padding-right: min(390px, 100vw) !important;
}

body.r33-page-editor-active .portal-layout.ris-layout {
  width: min(1760px, calc(100vw - min(390px, 100vw) - 24px));
}

.r33-editor-panel-head,
.r33-editor-panel-foot {
  position: sticky;
  z-index: 2;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 16px;
  background: #181818;
}

.r33-editor-panel-head {
  top: 0;
  border-bottom: 1px solid #3a3a3a;
}

.r33-editor-panel-foot {
  bottom: 0;
  border-top: 1px solid #3a3a3a;
}

.r33-editor-panel-head > div {
  min-width: 0;
  flex: 1;
}

.r33-editor-panel-head strong,
.r33-editor-panel-head small {
  display: block;
}

.r33-editor-panel-head strong {
  font-size: 17px;
}

.r33-editor-panel-head small,
.r33-editor-help,
.r33-editor-status {
  color: #bdbdb7;
  font-size: 12px;
}

.r33-editor-panel-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.r33-editor-card {
  padding: 14px;
  border: 1px solid #3b3b38;
  border-radius: 6px;
  background: #222220;
}

.r33-editor-card[hidden] {
  display: none !important;
}

.r33-editor-card h2 {
  margin: 0 0 10px;
  color: #fff;
  font: 800 14px/1.2 system-ui, sans-serif;
  letter-spacing: 0;
}

.r33-editor-field {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  color: #e8e8e3;
  font-size: 12px;
  font-weight: 700;
}

.r33-editor-field input,
.r33-editor-field textarea,
.r33-editor-field select {
  width: 100%;
  min-height: 40px;
  box-sizing: border-box;
  padding: 9px 10px;
  border: 1px solid #55554f;
  border-radius: 4px;
  background: #101010;
  color: #fff;
  font: 500 14px/1.35 system-ui, sans-serif;
  letter-spacing: 0;
}

.r33-editor-field textarea {
  min-height: 84px;
  resize: vertical;
}

.r33-editor-field > span {
  display: flex;
  gap: 9px;
  align-items: center;
}

.r33-editor-field input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
}

.r33-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.r33-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.r33-page-editor-panel button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #595952;
  border-radius: 5px;
  background: #30302d;
  color: #fff;
  font: 750 13px/1 system-ui, sans-serif;
  letter-spacing: 0;
  cursor: pointer;
}

.r33-page-editor-panel button:hover,
.r33-page-editor-panel button:focus-visible {
  border-color: #ffd03f;
}

.r33-page-editor-panel button.r33-editor-primary {
  border-color: #ffd03f;
  background: #ffd03f;
  color: #111;
}

.r33-page-editor-panel button.r33-editor-danger {
  border-color: #a84a4a;
  color: #ffb4b4;
}

.r33-page-editor-panel button:disabled,
.r33-page-editor-panel :is(input, textarea, select):disabled {
  opacity: .48;
  cursor: not-allowed;
}

.r33-editor-close {
  width: 38px;
  padding: 0 !important;
  font-size: 20px !important;
}

.r33-editor-save {
  flex: 1;
}

.r33-editor-notice {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid #ffd03f;
  background: #292820;
  color: #e9e7dd;
  font-size: 12px;
}

body.r33-page-editor-active [data-r33-editor-selectable="true"] {
  outline: 1px dashed rgb(255 208 63 / 48%);
  outline-offset: 2px;
  cursor: text !important;
}

body.r33-page-editor-active [data-r33-editor-selectable="true"]:hover {
  outline: 2px solid #ffd03f;
  background-color: rgb(255 208 63 / 10%) !important;
}

body.r33-page-editor-active .r33-editor-selected {
  outline: 3px solid #ffd03f !important;
  outline-offset: 3px !important;
}

.r33-editor-hidden {
  display: none !important;
}

body.r33-page-editor-active .r33-editor-hidden {
  display: revert !important;
  opacity: .35 !important;
  text-decoration: line-through;
}

.r33-custom-text-block {
  box-sizing: border-box;
  width: min(100%, 920px);
  margin: 20px auto;
  padding: 18px 20px;
  border-left: 4px solid #ffd03f;
  border-radius: 4px;
  background: #fff;
  color: #171717;
  text-align: left;
}

.r33-custom-text-block[data-width="narrow"] { width: min(100%, 560px); }
.r33-custom-text-block[data-width="wide"] { width: min(100%, 1180px); }
.r33-custom-text-block[data-width="full"] { width: 100%; }
.r33-custom-text-block[data-align="center"] { text-align: center; }
.r33-custom-text-block[data-align="right"] { text-align: right; }
.r33-custom-text-block[data-tone="highlight"] { background: #ffd03f; }
.r33-custom-text-block[data-tone="muted"] { background: #ecece8; color: #3f3f3a; }
.r33-custom-text-block[data-tone="dark"] { background: #1b1b1b; color: #fff; }
.r33-custom-text-block[data-size="small"] { font-size: 14px; }
.r33-custom-text-block[data-size="large"] { font-size: 20px; }

.r33-custom-text-block h2 {
  margin: 0 0 7px;
  color: inherit;
  font: 850 1.35em/1.15 system-ui, sans-serif;
  letter-spacing: 0;
}

.r33-custom-text-block p {
  margin: 0;
  color: inherit;
  white-space: pre-wrap;
}

body.dark-mode .r33-custom-text-block[data-tone="plain"] {
  background: #252525;
  color: #f5f5f1;
}

.ris-layout.r33-ris-grid-custom {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  grid-template-areas: none !important;
  grid-auto-flow: dense;
  grid-auto-rows: var(--r33-ris-grid-row-height, 72px);
  align-items: stretch;
}

.ris-layout.r33-ris-grid-custom > .ris-panel {
  position: relative;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-content: stretch;
  justify-items: stretch;
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.ris-layout.r33-ris-grid-custom > .ris-weather-panel {
  grid-template-rows: minmax(0, 1fr);
  align-content: center;
  overflow: hidden;
}

.ris-layout.r33-ris-grid-custom > .ris-panel > :not(.r33-ris-grid-tools):not(.r33-ris-grid-resize) {
  width: 100%;
  min-width: 0;
  max-width: none;
  justify-self: stretch;
}

.ris-layout.r33-ris-grid-custom > .ris-panel .section-head,
.ris-layout.r33-ris-grid-custom > .ris-panel .section-head > div,
.ris-layout.r33-ris-grid-custom > .ris-panel .section-head p {
  width: 100%;
  min-width: 0;
  max-width: none;
  text-align: left;
}

.ris-layout.r33-ris-grid-custom > .ris-panel :is(.ris-list, .ris-track-list, .ris-today-grid) {
  width: 100%;
  min-width: 0;
  max-width: none;
  max-height: none;
  align-content: start;
  justify-self: stretch;
}

.ris-layout.r33-ris-grid-custom > :is(.ris-news-panel, .ris-traffic-panel, .ris-suggestions-panel) > :is(.ris-list, .ris-track-list),
.ris-layout.r33-ris-grid-custom > .ris-news-music-panel > .ris-track-list {
  grid-template-columns: minmax(0, 1fr);
}

.ris-layout.r33-ris-grid-custom > .ris-news-music-panel[data-r33-grid-width="2"] > .ris-track-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ris-layout.r33-ris-grid-custom > .ris-news-music-panel[data-r33-grid-width="3"] > .ris-track-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ris-layout.r33-ris-grid-custom > .ris-today-panel[data-r33-grid-width="1"] > .ris-today-grid {
  grid-template-columns: minmax(0, 1fr);
}

.ris-layout.r33-ris-grid-custom > .ris-today-panel[data-r33-grid-width="2"] > .ris-today-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ris-layout.r33-ris-grid-custom > .ris-today-panel[data-r33-grid-width="3"] > .ris-today-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ris-layout.r33-ris-grid-custom > .ris-today-panel .ris-today-column {
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.ris-layout.r33-ris-grid-custom > .ris-panel :is(.ris-news-item, .ris-traffic-item, .ris-track-item, .ris-empty, .ris-today-item) {
  width: 100%;
  min-width: 0;
  max-width: none;
  justify-self: stretch;
  text-align: left;
}

.ris-layout.r33-ris-grid-custom > .ris-traffic-panel .ris-traffic-top,
.ris-layout.r33-ris-grid-custom > .ris-weather-panel .ris-script-card {
  width: 100%;
  min-width: 0;
}

/* De inhoud volgt de gekozen rasterbreedte, niet alleen de buitenkant. */
.ris-layout.r33-ris-grid-custom > .ris-weather-panel:is([data-r33-grid-width="1"], [data-r33-grid-width="2"]) {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: auto auto !important;
  align-content: start;
  align-items: start;
  row-gap: 10px;
  overflow: auto;
}

.ris-layout.r33-ris-grid-custom > .ris-weather-panel:is([data-r33-grid-width="1"], [data-r33-grid-width="2"]) > .section-head {
  display: grid !important;
  grid-column: 1 !important;
  grid-row: auto !important;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 8px;
}

.ris-layout.r33-ris-grid-custom > .ris-weather-panel:is([data-r33-grid-width="1"], [data-r33-grid-width="2"]) > .section-head > div:first-child,
.ris-layout.r33-ris-grid-custom > .ris-weather-panel:is([data-r33-grid-width="1"], [data-r33-grid-width="2"]) .ris-actions,
.ris-layout.r33-ris-grid-custom > .ris-weather-panel:is([data-r33-grid-width="1"], [data-r33-grid-width="2"]) .ris-script-card {
  grid-column: 1 !important;
  grid-row: auto !important;
  width: 100%;
  min-width: 0;
  max-width: none;
}

.ris-layout.r33-ris-grid-custom > .ris-weather-panel:is([data-r33-grid-width="1"], [data-r33-grid-width="2"]) > .section-head h1 {
  max-width: none;
}

.ris-layout.r33-ris-grid-custom > .ris-weather-panel:is([data-r33-grid-width="1"], [data-r33-grid-width="2"]) .ris-actions {
  justify-content: flex-start;
}

.ris-layout.r33-ris-grid-custom > .ris-weather-panel[data-r33-grid-width="1"] .ris-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.ris-layout.r33-ris-grid-custom > .ris-weather-panel[data-r33-grid-width="1"] .ris-font-control {
  justify-content: space-between;
}

.ris-layout.r33-ris-grid-custom > .ris-weather-panel[data-r33-grid-width="1"] .ris-font-control input[type="range"] {
  width: min(130px, 48%);
}

.ris-layout.r33-ris-grid-custom > .ris-weather-panel[data-r33-grid-width="1"] .ris-script-card {
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  padding-inline: 8px;
}

.ris-layout.r33-ris-grid-custom > .ris-weather-panel[data-r33-grid-width="1"] .ris-weather-icon {
  width: 40px;
  height: 40px;
  font-size: 27px;
}

.ris-layout.r33-ris-grid-custom > .ris-news-panel[data-r33-grid-width="1"] .ris-news-item summary {
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
}

.ris-layout.r33-ris-grid-custom > .ris-news-panel[data-r33-grid-width="1"] .ris-news-item summary > :is(span, small) {
  justify-self: start;
}

.ris-layout.r33-ris-grid-custom > .ris-news-panel[data-r33-grid-width="1"] :is(.ris-news-actions, .ris-news-editor-actions) {
  align-items: stretch;
  flex-direction: column;
}

.ris-layout.r33-ris-grid-custom > .ris-news-panel[data-r33-grid-width="1"] :is(.ris-news-edit-button, .ris-news-link, .ris-news-editor-actions button) {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.ris-layout.r33-ris-grid-custom > .ris-traffic-panel[data-r33-grid-width="1"] .ris-traffic-top {
  align-items: flex-start;
  flex-wrap: wrap;
}

.ris-layout.r33-ris-grid-custom > .ris-traffic-panel[data-r33-grid-width="1"] .ris-traffic-delay {
  white-space: nowrap;
}

.ris-layout.r33-ris-grid-custom > :is(.ris-suggestions-panel, .ris-news-music-panel)[data-r33-grid-width="1"] .ris-track-item {
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 7px;
}

.ris-layout.r33-ris-grid-custom > :is(.ris-suggestions-panel, .ris-news-music-panel)[data-r33-grid-width="1"] .ris-track-rank {
  width: 26px;
  height: 26px;
}

.ris-layout.r33-ris-grid-custom > .ris-news-music-panel[data-r33-grid-width="1"] .ris-news-music-item {
  grid-template-columns: 48px minmax(0, 1fr);
  min-height: 0;
  padding: 9px;
}

.ris-layout.r33-ris-grid-custom > .ris-news-music-panel[data-r33-grid-width="1"] .ris-news-music-cover {
  width: 48px;
  height: 48px;
}

.ris-layout.r33-ris-grid-custom > .ris-today-panel[data-r33-grid-width="1"] .ris-today-grid {
  gap: 16px;
}

.ris-layout.r33-ris-grid-custom > .ris-panel[data-r33-grid-width="1"] :is(strong, p, small, span, h1, h2, h3) {
  max-width: 100%;
  overflow-wrap: anywhere;
}

body.r33-page-editor-active .ris-layout.r33-ris-grid-custom {
  padding-top: 30px;
  outline: 1px dashed rgb(255 208 63 / 42%);
  outline-offset: 5px;
}

body.r33-page-editor-active .ris-layout.r33-ris-grid-custom > .ris-panel {
  border-color: rgb(255 208 63 / 72%);
  outline: 1px dashed rgb(255 208 63 / 38%);
  outline-offset: -4px;
}

.r33-ris-grid-tools {
  position: absolute;
  inset: 7px 7px auto auto;
  z-index: 50;
  display: flex;
  gap: 6px;
  align-items: center;
  max-width: calc(100% - 14px);
  padding: 4px;
  border: 1px solid #3d3216;
  border-radius: 5px;
  background: #171510;
  color: #fff;
  box-shadow: 0 5px 14px rgb(0 0 0 / 22%);
  font: 750 11px/1 system-ui, sans-serif;
  letter-spacing: 0;
}

.r33-ris-grid-tools [data-ris-grid-size] {
  overflow: hidden;
  color: #eee9dc;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.r33-ris-grid-tools .r33-ris-grid-drag {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid #ffd03f;
  border-radius: 4px;
  background: #ffd03f;
  color: #111;
  font: 850 11px/1 system-ui, sans-serif;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.r33-ris-grid-tools .r33-ris-grid-drag:active {
  cursor: grabbing;
}

.r33-ris-grid-resize {
  position: absolute;
  right: 7px;
  bottom: 7px;
  z-index: 51;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid #ffd03f;
  border-radius: 4px;
  background: #242018;
  color: #ffd03f;
  cursor: nwse-resize;
  touch-action: none;
}

.r33-ris-grid-resize::before,
.r33-ris-grid-resize::after {
  content: "";
  position: absolute;
  right: 5px;
  bottom: 6px;
  width: 13px;
  height: 2px;
  background: currentColor;
  transform: rotate(-45deg);
  transform-origin: right center;
}

.r33-ris-grid-resize::after {
  right: 5px;
  bottom: 11px;
  width: 7px;
}

.ris-layout.r33-ris-grid-custom > .r33-ris-grid-dragging {
  opacity: .48;
}

.ris-layout.r33-ris-grid-custom > [class*="r33-ris-grid-drop-"] {
  border-color: #ffd03f !important;
}

.ris-layout.r33-ris-grid-custom > .r33-ris-grid-drop-top {
  box-shadow: 0 -7px 0 -3px #ffd03f, 0 0 0 3px rgb(255 208 63 / 24%) !important;
}

.ris-layout.r33-ris-grid-custom > .r33-ris-grid-drop-right {
  box-shadow: 7px 0 0 -3px #ffd03f, 0 0 0 3px rgb(255 208 63 / 24%) !important;
}

.ris-layout.r33-ris-grid-custom > .r33-ris-grid-drop-bottom {
  box-shadow: 0 7px 0 -3px #ffd03f, 0 0 0 3px rgb(255 208 63 / 24%) !important;
}

.ris-layout.r33-ris-grid-custom > .r33-ris-grid-drop-left {
  box-shadow: -7px 0 0 -3px #ffd03f, 0 0 0 3px rgb(255 208 63 / 24%) !important;
}

.ris-layout.r33-ris-grid-custom > .r33-ris-grid-resizing {
  outline: 3px solid #ffd03f !important;
  outline-offset: -4px !important;
  user-select: none;
}

@media (max-width: 760px) {
  body.r33-page-editor-active {
    padding-right: 0 !important;
  }

  body.r33-page-editor-active .portal-layout.ris-layout {
    width: min(100%, calc(100vw - 24px));
  }

  .r33-page-editor-panel {
    width: 100vw;
  }

  .r33-page-editor-launcher {
    right: 12px;
    bottom: 12px;
  }

  .ris-layout.r33-ris-grid-custom {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-auto-rows: auto;
  }

  .ris-layout.r33-ris-grid-custom > .ris-panel {
    grid-column: 1 !important;
    grid-row: auto !important;
    min-height: 0;
  }

  .ris-layout.r33-ris-grid-custom > :is(.ris-news-panel, .ris-traffic-panel, .ris-suggestions-panel, .ris-news-music-panel) > :is(.ris-list, .ris-track-list),
  .ris-layout.r33-ris-grid-custom > .ris-today-panel > .ris-today-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
