/* The editor uses its own fixed styles so adjusting the practice pages never hides its controls. */
.visual-tuner-toggle {
  position: fixed;
  z-index: 50;
  right: 18px;
  bottom: 18px;
  min-height: 44px;
  border: 1px solid #343332;
  border-radius: 999px;
  background: #343332;
  color: #fff;
  padding: 0 18px;
  box-shadow: 0 8px 24px rgba(36, 36, 35, 0.2);
  font: 700 0.9rem system-ui, sans-serif;
}
.visual-tuner-toggle:hover { background: #242423; transform: translateY(-1px); }
.visual-tuner-toggle:focus-visible,
.visual-tuner button:focus-visible,
.visual-tuner input:focus-visible,
.visual-tuner select:focus-visible {
  outline: 3px solid #9e9588;
  outline-offset: 2px;
}
.visual-tuner {
  position: fixed;
  z-index: 51;
  right: 18px;
  bottom: 72px;
  width: min(410px, calc(100vw - 24px));
  min-width: min(350px, calc(100vw - 16px));
  min-height: min(260px, calc(100dvh - 16px));
  max-width: calc(100vw - 16px);
  max-height: min(780px, calc(100dvh - 94px));
  display: flex;
  flex-direction: column;
  container-type: inline-size;
  overflow: hidden;
  overscroll-behavior: contain;
  border: 1px solid #c7c1b7;
  border-radius: 18px;
  background: #fff;
  color: #292927;
  box-shadow: 0 20px 60px rgba(36, 36, 35, 0.2);
  padding: 18px;
  font: 400 0.9rem/1.4 system-ui, sans-serif;
}
.visual-tuner[data-resized] { max-height: calc(100dvh - 16px); }
.visual-tuner-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  padding-left: 18px;
}
.visual-tuner-header.dragging { cursor: grabbing; }
.visual-tuner-header:focus-visible { outline: 3px solid #9e9588; outline-offset: 3px; }
.visual-tuner-kicker { color: #645d52; font-size: 0.75rem; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.visual-tuner h2 { margin: 3px 0 0; color: #242423; font: 750 1.25rem/1.2 system-ui, sans-serif; }
.visual-tuner-move { display: block; margin-top: 3px; color: #6a645b; font-size: 0.75rem; }
.visual-tuner-close { width: 38px; height: 38px; border: 0; border-radius: 9px; background: #f3f0ea; color: #292927; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.visual-tuner-help { margin: 12px 0 14px; color: #5d5c58; font-size: 0.85rem; }
.visual-tuner-controls { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.visual-tuner-category { border-top: 1px solid #e3ded6; padding: 10px 0; }
.visual-tuner summary { cursor: pointer; color: #292927; font-weight: 750; }
.visual-tuner-category > summary { font-size: 1rem; }
.visual-tuner-category-help { margin: 8px 0 10px; color: #645d52; font-size: 0.81rem; }
.visual-tuner-groups { display: grid; gap: 7px; }
.visual-tuner-group { border: 1px solid #e3ded6; border-radius: 10px; background: #fdfcfb; padding: 9px 11px; }
.visual-tuner-group[open] { border-color: #c7c1b7; background: #fff; }
.visual-tuner-group > summary { font-size: 0.9rem; }
.visual-tuner-fields { display: grid; gap: 11px; padding: 13px 0 4px; }
.visual-tuner-field { display: grid; grid-template-columns: minmax(78px, 1fr) minmax(88px, 1.1fr) 58px 27px; align-items: center; gap: 6px; min-height: 32px; }
.visual-tuner-field label { min-width: 0; color: #343332; font-size: 0.83rem; font-weight: 600; }
.visual-tuner-field output { min-width: 0; color: #5d5c58; font-size: 0.76rem; text-align: right; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.visual-tuner-field input[type="color"] { width: 100%; height: 32px; padding: 2px; border: 1px solid #c7c1b7; border-radius: 7px; background: #fff; cursor: pointer; }
.visual-tuner-field input[type="range"] { width: 100%; accent-color: #343332; cursor: pointer; }
.visual-tuner-field select { width: 100%; min-height: 32px; border: 1px solid #c7c1b7; border-radius: 7px; background: #fff; color: #292927; padding: 2px 5px; font: inherit; }
.visual-tuner-revert { width: 27px; height: 27px; border: 1px solid #c7c1b7; border-radius: 6px; background: #fff; color: #343332; padding: 0; font: 700 1rem system-ui, sans-serif; cursor: pointer; }
.visual-tuner-revert:hover { background: #f3f0ea; }
.visual-tuner-words { margin-top: 12px; border-top: 1px solid #e3ded6; padding-top: 10px; }
.visual-tuner-words h3 { margin: 0 0 7px; color: #343332; font-size: 0.85rem; }
.visual-tuner-word { display: block; margin-bottom: 9px; color: #343332; font-size: 0.8rem; font-weight: 600; }
.visual-tuner-word input,
.visual-tuner-word textarea { display: block; width: 100%; min-height: 34px; margin-top: 4px; border: 1px solid #c7c1b7; border-radius: 7px; background: #fff; color: #292927; padding: 6px 8px; font: 0.85rem/1.35 system-ui, sans-serif; }
.visual-tuner-word textarea { min-height: 65px; resize: vertical; }
.visual-tuner-word input[readonly] { background: #f3f0ea; color: #5d5c58; }
.visual-tuner-word-line { display: grid; grid-template-columns: minmax(0, 1fr) 27px; align-items: end; gap: 6px; }
.visual-tuner-word-line .visual-tuner-word { margin-bottom: 0; }
.visual-tuner-word-line + .visual-tuner-word-line { margin-top: 9px; }
.visual-tuner-section-reset { width: 100%; min-height: 33px; margin-top: 13px; border: 1px solid #c7c1b7; border-radius: 7px; background: #f7f4ef; color: #343332; font: 650 0.8rem system-ui, sans-serif; cursor: pointer; }
.visual-tuner-section-reset:hover { background: #eee9e1; }
.visual-tuner-actions { display: grid; grid-template-columns: 1fr; gap: 8px; border-top: 1px solid #e3ded6; background: #fff; padding: 12px 0 0; }
.visual-tuner-actions button { min-height: 40px; border: 1px solid #343332; border-radius: 9px; background: #343332; color: #fff; font: 700 0.82rem system-ui, sans-serif; cursor: pointer; }
.visual-tuner-actions button:hover { opacity: 0.88; }
.visual-tuner-actions p { grid-column: 1 / -1; min-height: 1em; margin: 0; color: #5d5c58; font-size: 0.8rem; }
.visual-tuner-actions textarea { grid-column: 1 / -1; width: 100%; min-height: 90px; border: 1px solid #c7c1b7; border-radius: 7px; padding: 8px; font: 0.75rem ui-monospace, monospace; }
.visual-tuner-resize { position: absolute; left: 3px; top: 3px; width: 28px; height: 28px; border: 0; border-radius: 10px 0 5px 0; background: transparent; cursor: nwse-resize; touch-action: none; }
.visual-tuner-resize::after { content: ""; position: absolute; left: 5px; top: 5px; width: 13px; height: 13px; background: repeating-linear-gradient(135deg, transparent 0 4px, #786f63 4px 6px, transparent 6px 9px); clip-path: polygon(0 0, 100% 0, 0 100%); }
.visual-tuner-resize:hover, .visual-tuner-resize:focus-visible { background: #f3f0ea; }
@container (max-width: 350px) {
  .visual-tuner-field { grid-template-columns: minmax(0, 1fr) minmax(70px, 1fr) 42px 27px; gap: 4px; }
}
@media (max-width: 520px) {
  .visual-tuner-toggle { right: 12px; bottom: 12px; }
  .visual-tuner { right: 12px; bottom: 66px; max-height: calc(100dvh - 82px); padding: 14px; }
  .visual-tuner[data-resized] { max-height: calc(100dvh - 16px); }
}
