/* The Graffs workspace pencil edits the presentation of the active result page. */
#episode-editor {
  flex: none;
  min-width: 0;
  color: var(--ink);
}
.hp-edit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  min-height: 60px;
  padding: 8px clamp(8px, 1.8vw, 30px);
}
.hp-edit-bar p {
  flex: 1 1 18em;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.hp-edit-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 100%;
  padding: 5px;
  border: 1px solid #ffffffb3;
  border-radius: 28px;
  background: #ffffffc9;
}
.hp-edit-actions button, .hp-text-panel button, .hp-layout-panel button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  line-height: 1.3;
  cursor: pointer;
}
.hp-edit-actions button:is(:hover, [aria-expanded="true"]):not(:disabled),
.hp-text-panel button:hover:not(:disabled),
.hp-layout-panel button:hover:not(:disabled) {
  border-color: #d2d0cb;
}
.hp-edit-actions .hp-done {
  padding-inline: 18px;
  background: #262624;
  color: white;
}
.hp-edit-actions button[data-action="sections"] { --hp-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Cpath d='M3 9h18M9 9v12'/%3E%3C/svg%3E"); }
.hp-edit-actions button[data-action="undo"] { --hp-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m8 4-5 5 5 5M3 9h11a6 6 0 0 1 0 12h-4'/%3E%3C/svg%3E"); }
.hp-edit-actions button[data-action="redo"] { --hp-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m16 4 5 5-5 5M21 9H10a6 6 0 0 0 0 12h4'/%3E%3C/svg%3E"); }
.hp-edit-actions button[data-action="reset"] { --hp-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4v5h5M3.4 9a8.5 8.5 0 1 1-.3 6'/%3E%3C/svg%3E"); }
.hp-edit-actions .hp-done { --hp-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 12 5 5L20 6'/%3E%3C/svg%3E"); }
.hp-edit-actions button:is([data-action="sections"], [data-action="undo"], [data-action="redo"], [data-action="reset"])::before,
.hp-edit-actions .hp-done::after, .hp-hide::before, .hp-resize::before {
  content: "";
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  background: currentColor;
  mask: var(--hp-icon) center / contain no-repeat;
}
.hp-edit-actions button:disabled { opacity: .45; cursor: default; }
#episode-editor :is(button, select, input):focus-visible,
[data-hp-editing] :is(.hp-hide, .hp-resize, [data-hp-text]):focus-visible {
  outline: 2px solid #2455a4;
  outline-offset: 2px;
}

.hp-layout-panel, .hp-text-panel {
  min-width: 0;
  margin: 2px clamp(8px, 1.8vw, 30px) 14px;
  border: 1px solid #ffffffd9;
  border-radius: 20px;
  background: #ffffffeb;
  box-shadow: 0 8px 30px #2424210a;
  overflow-wrap: anywhere;
}
.hp-layout-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  padding: 20px 24px;
}
.hp-layout-panel fieldset, .hp-text-panel fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.hp-layout-panel legend, .hp-text-panel legend {
  margin: 0 0 12px;
  padding: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
}
.hp-layout-panel label {
  display: block;
  margin: 0 0 10px;
  font-size: 14px;
}
.hp-layout-panel .hp-visibility, .hp-layout-panel label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 24px;
}
.hp-layout-panel input, .hp-text-panel input { accent-color: #262624; }
.hp-layout-panel input[type="checkbox"] { width: 17px; height: 17px; margin: 0; }
.hp-layout-panel input[type="range"], .hp-layout-panel select {
  display: block;
  width: 100%;
  margin-top: 6px;
}
.hp-layout-panel select, .hp-text-panel :is(input, select) {
  max-width: 100%;
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid #d2d0cb;
  border-radius: 8px;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
}
.hp-layout-panel output { float: right; color: var(--muted); }
.hp-layout-panel button { padding-inline: 0; text-decoration: underline; text-underline-offset: 3px; }
.hp-layout-panel p, .hp-message { margin: 6px 0; color: var(--muted); font-size: 13px; }
.hp-message { padding-inline: clamp(8px, 1.8vw, 30px); }
.hp-message:empty { display: none; }
.hp-text-panel {
  position: fixed;
  z-index: 60;
  width: min(580px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  margin: 0;
  overflow-y: auto;
  padding: 13px 16px 16px;
  background: white;
  border-color: #dbe4ee;
  border-radius: 16px;
  box-shadow: 0 10px 35px #14273c26;
}
.hp-text-panel label {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  max-width: 100%;
  margin: 0 8px 6px 0;
  font-size: 12px;
  color: var(--muted);
}
.hp-text-panel > strong { display: block; margin-bottom: 10px; font-size: 14px; font-weight: 500; }
.hp-text-panel :is(input, select) { background: #f6f7f9; }
.hp-text-panel input[type="number"] { width: 5.6em; }
.hp-text-panel input[type="text"] { width: 7em; }
.hp-text-panel input[type="color"] { width: 38px; height: 34px; padding: 2px; cursor: pointer; }
.hp-align { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.hp-align button { padding: 5px 10px; border-radius: 8px; background: #f3f3f1; }
.hp-align [aria-pressed="true"] { border-color: #a98524; background: #fbf3db; }

.hp-sized {
  width: min(100%, var(--hp-width, 100%));
  min-height: var(--hp-height, auto);
  max-width: 100%;
}
[data-hp-hidden]:not([data-hp-hidden="false"]) { display: none !important; }
[data-hp-editing][data-hp-section], [data-hp-editing] [data-hp-section] {
  position: relative;
  outline: 1px dashed #98bde6;
  outline-offset: -1px;
}
[data-hp-editing] [data-hp-text] {
  cursor: pointer;
  outline: 1px dashed #a8c9ed;
  outline-offset: 2px;
  border-radius: 5px;
}
[data-hp-editing] [data-hp-text]:is(:hover, [data-hp-selected]) {
  outline: 2px solid #5d95d5;
  background-color: #e3efff29;
}
.hp-hide, .hp-resize {
  position: absolute;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 2px;
  border: 1px solid #bdcfe4;
  border-radius: 7px;
  background: #e6effb;
  color: #2455a4;
  cursor: pointer;
}
.hp-hide { right: 4px; top: 3px; }
.hp-resize { right: 4px; bottom: 3px; cursor: nwse-resize; touch-action: none; }
.hp-hide { --hp-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 3 18 18M9.5 5.6a11 11 0 0 1 2.5-.3c5.5 0 9.5 6.7 9.5 6.7a18 18 0 0 1-2.3 2.9M6.3 6.8A18 18 0 0 0 2.5 12s4 6.7 9.5 6.7c1.9 0 3.7-.8 5.2-1.8M10 10a2.8 2.8 0 0 0 4 4'/%3E%3C/svg%3E"); }
.hp-resize { --hp-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 10V4h6m10 10v6h-6M4 4l16 16'/%3E%3C/svg%3E"); }
[data-hp-editing] [data-hp-section]:has(> .hp-hide) { padding-right: 34px; }
[data-hp-editing] [data-hp-section]:has(> .hp-resize) { padding-bottom: 30px; }

@media (max-width: 740px) {
  .hp-edit-bar { justify-content: flex-start; padding: 8px; }
  .hp-edit-bar p { flex-basis: 100%; }
  .hp-edit-actions { border-radius: 16px; gap: 2px; }
  .hp-edit-actions button { padding: 6px 9px; }
  .hp-layout-panel { padding: 15px; grid-template-columns: 1fr; gap: 16px; }
  .hp-layout-panel { margin-inline: 6px; }
  .hp-sized { width: 100%; min-height: auto; }
}
@media (max-height: 620px) and (min-width: 761px) {
  .hp-layout-panel {
    max-height: 45dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}
