*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 14px;
  --preview-max-height: calc(100vh - 3rem);
  --preview-max-height: calc(100dvh - 3rem);
  --brand-green: #43a047;
  --brand-green-border: #2e7d32;
  --brand-green-text: #1b5e20;
  --panel-idle-muted: #e8e8e8;
  --panel-idle-bg: #f5f5f5;
}

body {
  margin: 0;
  padding: 1rem 1rem 2.75rem;
  background: #fafafa;
  color: #111;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
}

.app-layout {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 1.25rem 2rem;
  width: 100%;
}

.preview-pane {
  flex: 1 1 0;
  order: 2;
  min-width: 10rem;
  max-width: none;
  max-height: var(--preview-max-height);
  align-self: flex-start;
  padding: 0;
  overflow: hidden;
}

.preview-pane[hidden] {
  display: none !important;
}

.preview-pane--stale .output-preview-host {
  opacity: 0.72;
}

.preview-pane-inner {
  width: 100%;
  max-height: var(--preview-max-height);
  overflow: hidden;
}

.output-preview-host {
  display: block;
  margin: 0;
  max-width: 100%;
  max-height: var(--preview-max-height);
  overflow: hidden;
  line-height: 0;
}

.output-preview-host svg,
.output-preview-host img.preview-raster {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: var(--preview-max-height);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.output-preview-host svg[data-preview-scaled="1"],
.output-preview-host img.preview-raster[data-preview-scaled="1"] {
  max-width: none;
  max-height: none;
}

.preview-raster-loading {
  margin: 0;
  padding: 0.75rem 0;
  font-size: 0.72rem;
  color: #666;
  line-height: 1.35;
}

.preview-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
  margin: 0 0 0.45rem;
}

.preview-actions .preview-action {
  flex: 1 1 0;
  min-width: 0;
  font-size: 0.75rem;
  padding: 0.25rem 0.35rem;
  border: 1px solid #bdbdbd;
  border-radius: 4px;
  background: #fff;
  color: #111;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  cursor: pointer;
}

.preview-actions .preview-action:not(:disabled):hover,
.preview-actions .preview-action:not(:disabled):focus-visible {
  border-color: #9e9e9e;
  color: #111;
  background: #fff;
}

.preview-actions .preview-action:disabled {
  border-color: var(--panel-idle-muted);
  background: var(--panel-idle-bg);
  color: #bbb;
  font-weight: 400;
  cursor: not-allowed;
}

.preview-stale-hint {
  margin: 0 0 0.45rem;
  font-size: 0.68rem;
  color: #b71c1c;
  line-height: 1.3;
}

.column {
  flex: 0 0 26rem;
  order: 1;
  width: 26rem;
  min-width: 26rem;
  max-width: 26rem;
  margin: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

/* Bardzo wąski ekran: podgląd pod panelem (DOM), nigdy nad nim. */
@media (max-width: 40rem) {
  .app-layout {
    flex-direction: column;
    flex-wrap: wrap;
    align-items: stretch;
    min-height: 0;
  }

  .column {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .preview-pane {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    order: 2;
  }
}

/* Trzy akcje INPUT: jeden rząd, ta sama szerokość pola co reszta fieldsetu (padding .opts-fieldset). */
.import-input-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.5rem;
  width: 100%;
  box-sizing: border-box;
  align-items: stretch;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.import-input-actions .import-input-action {
  flex: 1 1 0;
  min-width: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.import-input-actions .btn.btn--clear,
.import-input-actions .btn.btn--download,
.import-input-actions .btn.btn--accent {
  flex: 1 1 0;
  min-width: 0;
}

/* W rzędzie z pickerami: ten sam „obramowany” blok co Choose File (także gdy Clear jest nieaktywny). */
.import-input-actions .btn.btn--clear:disabled {
  border: 1px solid #e8e8e8;
  background: #fafafa;
  color: #999;
}

.import-col-heading {
  display: block;
  margin-bottom: 0.3rem;
}

.import-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 0.75rem;
  align-items: start;
}

.opts-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 0.55rem;
  align-items: stretch;
  margin: 0;
}

.opts-two-col .opts-fieldset {
  margin: 0;
  min-width: 0;
}

.opts-two-col--blocked {
  opacity: 0.48;
}

@media (max-width: 400px) {
  .import-two-col {
    grid-template-columns: 1fr;
  }
  .opts-two-col {
    grid-template-columns: 1fr;
  }
}

.single-file-opts {
  padding-bottom: 0;
}

.palette-list {
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
  max-height: 14rem;
  overflow: auto;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  background: #fff;
}

/* Palette inside fieldset: one frame with legend (same pattern as Dimensions / Lines). */
.opts-fieldset--palette .palette-list--embedded {
  margin: 0;
  border: none;
  border-radius: 3px;
  background: #fafafa;
}

.palette-all-colors-row {
  margin: 0 0 0.35rem;
  padding: 0 0.45rem;
}

.palette-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 0.55rem;
  align-items: center;
  padding: 0.35rem 0.45rem;
  border-bottom: 1px solid #efefef;
  font-size: 0.72rem;
}

.palette-active-dot {
  flex-shrink: 0;
  width: 0.85rem;
  height: 0.85rem;
  margin: 0;
  padding: 0;
  border: 1px solid #bdbdbd;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.palette-active-dot[hidden] {
  display: none;
}

.palette-active-dot--on {
  border-color: #2e7d32;
  background: #43a047;
  box-shadow: inset 0 0 0 1px #fff;
}

.palette-active-dot:hover,
.palette-active-dot:focus-visible {
  border-color: #666;
}

.palette-row:last-child {
  border-bottom: none;
}

.palette-color-cell {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  justify-content: flex-end;
}

.palette-color-cell .palette-target {
  width: 2rem;
  height: 1.6rem;
}

.palette-export {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.palette-export input[type="checkbox"] {
  margin: 0;
}

.palette-target {
  padding: 0;
  border: 1px solid #bdbdbd;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
}

.opts-fieldset {
  margin: 0 0 0.65rem;
  padding: 0.45rem 0.45rem 0.5rem;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  background: #fff;
}

/* Jedna ramka w sekcji (np. ACTIONS, OUTPUT): odstęp jak między blokami w .column — bez podwójnego marginesu. */
section.block > .opts-fieldset:only-child {
  margin-bottom: 0;
}

.single-file-opts .opts-two-col .opts-fieldset:last-child {
  margin-bottom: 0;
}

.opts-fieldset--dimensions {
  min-width: 0;
}

.opts-fieldset--hatch-fill {
  min-width: 0;
}

.opts-row--hatch-fill {
  gap: 0.45rem;
  flex-wrap: nowrap;
}

.opts-hatch-mode-pair {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  font-size: 0.72rem;
  color: inherit;
  cursor: pointer;
  flex-shrink: 0;
}

.opts-hatch-mode-pair--spacing {
  margin-left: 0.35rem;
}

.opts-hatch-mode-pair input[type="checkbox"] {
  margin: 0;
  flex-shrink: 0;
}

.opts-row--hatch-fill .hatch-line-count-input,
.opts-row--hatch-fill .hatch-spacing-mm-input {
  opacity: 0.45;
  transition: opacity 0.15s ease;
}

.opts-fieldset--hatch-fill.hatch-fill--active .hatch-line-count-input:not(:disabled),
.opts-fieldset--hatch-fill.hatch-fill--active .hatch-spacing-mm-input:not(:disabled) {
  opacity: 1;
}

.opts-row--hatch-fill .hatch-line-count-input {
  flex: 0 0 auto;
  width: 3.5rem;
  min-width: 3rem;
}

.opts-row--hatch-fill .hatch-spacing-mm-input {
  flex: 0 0 auto;
  width: 3.5rem;
  min-width: 3rem;
}

.opts-row--hatch-connect {
  margin-top: 0.35rem;
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.opts-fieldset--hatch-fill.hatch-fill--active .opts-row--hatch-connect {
  opacity: 1;
  pointer-events: auto;
}

.column.panel--idle .work-block .opts-fieldset--hatch-fill .opts-row--hatch-connect,
.column.panel--idle .work-block .opts-fieldset--hatch-fill .opts-row--hatch-connect span {
  color: #b8b8b8;
}

.opts-legend {
  padding: 0 0.25rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #666;
}

.opts-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  color: #333;
}

.opts-fieldset > .opts-row > input[type="checkbox"] {
  margin: 0;
  flex-shrink: 0;
}

.opts-fieldset > label.opts-row:first-of-type {
  margin-top: 0.25rem;
}

.opts-row--inline {
  justify-content: space-between;
}

.opts-row--edge-offset {
  gap: 0.45rem;
}

.opts-edge-offset-pair {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  font-size: 0.72rem;
  color: inherit;
  cursor: pointer;
  flex-shrink: 0;
}

.opts-edge-offset-pair input[type="checkbox"] {
  margin: 0;
  flex-shrink: 0;
}

.opts-row--edge-offset .opts-edge-offset-mm {
  flex: 1 1 auto;
  min-width: 3.5rem;
  max-width: 100%;
}

.opts-expand-swatch {
  width: 2rem;
  height: 1.6rem;
}

.opts-hex {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  color: #333;
  letter-spacing: 0.02em;
}

.opts-label {
  color: #666;
}

.opts-num {
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  font-size: 0.75rem;
  padding: 0.2rem 0.4rem;
  border: 1px solid #bdbdbd;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}

/* Hide number spinners (saves space; units shown beside field). */
.opts-num::-webkit-outer-spin-button,
.opts-num::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.opts-num[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.dim-grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.dim-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.dim-label {
  font-size: 0.72rem;
  color: #666;
  line-height: 1.2;
}

.dim-input-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  width: 100%;
}

.dim-input-row .opts-num {
  flex: 1 1 auto;
  min-width: 4.75rem;
}

.dim-suffix {
  flex-shrink: 0;
  font-size: 0.72rem;
  color: #555;
  font-variant-numeric: tabular-nums;
}

.dim-size-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  width: 100%;
}

.dim-size-row .dim-input-row {
  flex: 1 1 6.5rem;
  min-width: 6rem;
}

.dim-cross {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: #999;
  padding: 0 0.1rem;
}

.dim-hints {
  margin: 0.55rem 0 0;
  padding: 0;
}

.dim-hints .dim-hint-line {
  margin: 0.3rem 0 0;
  font-size: 0.7rem;
  color: #777;
  line-height: 1.35;
}

.dim-hints .dim-hint-line:first-child {
  margin-top: 0;
}

.dim-hints--stacked {
  margin-top: 0.45rem;
}

.dim-hints--stacked .dim-hint-line--summary {
  margin: 0;
  font-size: 0.7rem;
  color: #777;
  line-height: 1.4;
}

.dim-hints--stacked .dim-hint-line--px {
  margin: 0.28rem 0 0;
  font-size: 0.7rem;
  color: #777;
  line-height: 1.4;
}

.site-title {
  margin: 0;
  padding: 0;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #444;
}

.block {
  margin-bottom: 0;
}

.block-label {
  margin: 0 0 0.35rem;
  padding: 0;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #666;
}

.block-hint {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  color: #777;
}

.status {
  margin: 0.35rem 0 0;
  font-size: 0.7rem;
  color: #777;
}

.status code {
  font-size: 0.95em;
}

.preview-picker {
  margin: 0 0 0.5rem;
}

.preview-picker-label {
  display: block;
  margin: 0 0 0.25rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #666;
}

.preview-picker-select {
  width: 100%;
  max-width: 100%;
  font-size: 0.75rem;
  padding: 0.25rem 0.35rem;
  border: 1px solid #bdbdbd;
  border-radius: 4px;
  background: #fff;
  color: #111;
}

.file-line {
  margin: 0;
}

input[type="file"] {
  display: block;
  width: 100%;
  max-width: 100%;
  font-size: 0.75rem;
  padding: 0;
}

.picker-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.picker-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  /* must stay clickable for programmatic .click() after Clear */
}

.picker-btn {
  display: inline-block;
  font-size: 0.75rem;
  color: #111;
  text-decoration: none;
  border: 1px solid #bdbdbd;
  background: #fff;
  padding: 0.25rem 0.45rem;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
}

/* Przyciski pickera (wcześniej <label>): spójne tło/ramka we wszystkich silnikach. */
button.picker-btn {
  margin: 0;
  font: inherit;
  font-size: 0.75rem;
  line-height: inherit;
  -webkit-appearance: none;
  appearance: none;
  text-align: center;
}

.picker-btn:hover,
.picker-btn:focus-visible {
  color: #555;
  border-color: #999;
}

.picker-btn.is-disabled,
.picker-btn:disabled {
  opacity: 1;
  cursor: not-allowed;
  background: var(--panel-idle-bg) !important;
  border-color: var(--panel-idle-muted) !important;
  color: #bbb !important;
  font-weight: 400 !important;
}

.picker-btn.is-disabled:hover,
.picker-btn.is-disabled:focus-visible,
.picker-btn:disabled:hover,
.picker-btn:disabled:focus-visible {
  background: var(--panel-idle-bg) !important;
  border-color: var(--panel-idle-muted) !important;
  color: #bbb !important;
}

/* Start: jedyne aktywne — wypełnione na zielono. */
.picker-btn.picker-btn--cta:not(:disabled):not(.is-disabled) {
  background: var(--brand-green) !important;
  border-color: var(--brand-green-border) !important;
  color: #fff !important;
  font-weight: 600;
}

.picker-btn.picker-btn--cta:not(:disabled):not(.is-disabled):hover,
.picker-btn.picker-btn--cta:not(:disabled):not(.is-disabled):focus-visible {
  background: #388e3c !important;
  border-color: var(--brand-green-text) !important;
  color: #fff !important;
}

/* Po wyborze pliku/folderu: tylko zielony kontur. */
.picker-btn.picker-btn--loaded:not(:disabled):not(.is-disabled) {
  background: #fff !important;
  border-color: var(--brand-green-border) !important;
  color: var(--brand-green-text) !important;
  font-weight: 700;
}

.picker-btn.picker-btn--loaded:not(:disabled):not(.is-disabled):hover,
.picker-btn.picker-btn--loaded:not(:disabled):not(.is-disabled):focus-visible {
  background: #f1f8e9 !important;
  border-color: var(--brand-green-text) !important;
  color: var(--brand-green-text) !important;
}

.picker-status {
  font-size: 0.75rem;
  color: #777;
}

.picker-status.ok {
  color: #111;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: center;
}

.opts-fieldset--download,
.opts-fieldset--presets {
  position: relative;
  padding: 0.5rem 0.45rem;
}

.opts-fieldset--download .import-input-actions,
.opts-fieldset--presets .import-input-actions {
  gap: 2px;
}

.opts-fieldset--download .import-input-actions .import-input-action,
.opts-fieldset--presets .import-input-actions .import-input-action {
  white-space: nowrap;
  font-size: 0.75rem;
  line-height: 1.35;
  padding: 0.25rem 0.35rem;
}

.opts-fieldset--download .import-input-actions .btn.btn--download,
.opts-fieldset--presets .import-input-actions .btn.btn--accent {
  padding: 0.25rem 0.35rem;
}

.opts-fieldset--presets .preset-status {
  margin-top: 0.35rem;
}

.preset-status {
  margin: 0;
  min-height: 1em;
  font-size: 0.7rem;
  color: #777;
  line-height: 1.4;
}

.preset-file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.btn {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.75rem;
  color: #111;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.btn:hover,
.btn:focus-visible {
  color: #555;
}

.btn:disabled {
  color: #bbb;
  cursor: not-allowed;
  text-decoration: none;
}

.btn--download {
  text-decoration: none;
  padding: 0.28rem 0.55rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  font-weight: 400;
}

.btn--download:not(:disabled) {
  border-color: var(--brand-green-border);
  background: var(--brand-green);
  color: #fff;
  font-weight: 600;
}

.btn--download:not(:disabled):hover,
.btn--download:not(:disabled):focus-visible {
  background: #388e3c;
  border-color: var(--brand-green-text);
  color: #fff;
}

.btn--download:disabled {
  border-color: var(--panel-idle-muted);
  background: var(--panel-idle-bg);
  color: #bbb;
  font-weight: 400;
}

.btn--clear {
  text-decoration: none;
  padding: 0.28rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 4px;
  background: #fff;
}

.btn--clear:not(:disabled) {
  border-color: #c62828;
  color: #b71c1c;
  font-weight: 600;
}

.btn--clear:not(:disabled):hover,
.btn--clear:not(:disabled):focus-visible {
  color: #8e0000;
  border-color: #8e0000;
}

.btn--clear:disabled {
  border-color: transparent;
  background: transparent;
  font-weight: 400;
  color: #bbb;
}

.btn--accent {
  text-decoration: none;
  padding: 0.28rem 0.55rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  font-weight: 600;
}

.btn--accent:not(:disabled) {
  border-color: #7e57c2;
  color: #5e35b1;
  font-weight: 600;
}

.btn--accent:not(:disabled):hover,
.btn--accent:not(:disabled):focus-visible {
  color: #4527a0;
  border-color: #5e35b1;
}

.btn--accent:disabled {
  border-color: var(--panel-idle-muted);
  background: var(--panel-idle-bg);
  font-weight: 400;
  color: #bbb;
}

/* Panel bez pliku: sekcje robocze — jasnoszare, nieaktywne. */
.column.panel--idle .work-block {
  opacity: 1;
  --work-idle-text: #bbb;
  --work-idle-control-bg: var(--panel-idle-bg);
  --work-idle-control-border: var(--panel-idle-muted);
}

.column.panel--idle .work-block .opts-fieldset {
  border-color: var(--panel-idle-muted);
  background: #fafafa;
}

.column.panel--idle .work-block .opts-legend {
  color: #aaa;
}

/* Tekst i etykiety w opcjach (nowe kontrolki w .opts-fieldset dziedziczą automatycznie). */
.column.panel--idle .work-block .opts-fieldset label,
.column.panel--idle .work-block .opts-fieldset label span,
.column.panel--idle .work-block .opts-fieldset .opts-row,
.column.panel--idle .work-block .opts-fieldset .opts-row span,
.column.panel--idle .work-block .opts-fieldset--hatch-fill label,
.column.panel--idle .work-block .opts-fieldset--hatch-fill label span,
.column.panel--idle .work-block .dim-label,
.column.panel--idle .work-block .opts-hex,
.column.panel--idle .work-block .dim-cross {
  color: var(--work-idle-text);
}

.column.panel--idle .work-block .opts-num,
.column.panel--idle .work-block .preview-picker-select,
.column.panel--idle .work-block .opts-fieldset input:disabled,
.column.panel--idle .work-block .opts-fieldset select:disabled,
.column.panel--idle .work-block .opts-fieldset button:disabled {
  background: var(--work-idle-control-bg);
  border-color: var(--work-idle-control-border);
  color: var(--work-idle-text);
}

.column.panel--idle .work-block .opts-num::placeholder {
  color: var(--work-idle-text);
  opacity: 1;
}

.column.panel--idle .work-block .opts-num::-webkit-input-placeholder {
  color: var(--work-idle-text);
}

.column.panel--idle .work-block .opts-num::-moz-placeholder {
  color: var(--work-idle-text);
  opacity: 1;
}

/* Nieaktywne: puste pola bez ptaszków (All colors, Horizontal, Edge offset…). */
.column.panel--idle .work-block .opts-fieldset input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 0.85rem;
  height: 0.85rem;
  margin: 0;
  flex-shrink: 0;
  border: 1px solid var(--work-idle-control-border);
  border-radius: 2px;
  background: var(--work-idle-control-bg);
  cursor: not-allowed;
}

.column.panel--idle .work-block .opts-fieldset input[type="checkbox"]:checked {
  background: var(--work-idle-control-bg);
  background-image: none;
  box-shadow: none;
}

.column.panel--idle .work-block .opts-fieldset input[type="color"],
.column.panel--idle .work-block .opts-fieldset .opts-expand-swatch {
  border: 1px solid var(--work-idle-control-border);
  background: var(--work-idle-control-bg);
  cursor: not-allowed;
}

.column.panel--idle .work-block .preview-actions .preview-action:disabled {
  border-color: var(--panel-idle-muted);
  background: var(--panel-idle-bg);
  color: #bbb;
}

.column.panel--idle .work-block input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.column.panel--idle .work-block input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 2px;
  background: var(--panel-idle-muted);
}

.column.panel--idle .work-block input[type="color"]::-moz-color-swatch {
  border: none;
  background: var(--panel-idle-muted);
}

.palette-idle-swatch {
  display: block;
  width: 2rem;
  height: 1.6rem;
  flex-shrink: 0;
  border: 1px solid var(--panel-idle-muted);
  border-radius: 3px;
  background: var(--panel-idle-muted);
}

.column.panel--idle .palette-list--idle .palette-row--idle .palette-export,
.column.panel--idle .palette-list--idle .palette-row--idle .palette-hex {
  color: #bbb;
}

.column.panel--idle .palette-list--idle .palette-row--idle .palette-export input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 0.85rem;
  height: 0.85rem;
  border: 1px solid var(--panel-idle-muted);
  border-radius: 2px;
  background: var(--panel-idle-bg);
}

.column.panel--idle .work-block .palette-list--embedded {
  background: var(--panel-idle-bg);
}

.column.panel--idle .work-block .opts-two-col--blocked {
  opacity: 1;
}

.task-progress-wrap {
  margin: 0.65rem 0 0.15rem;
}

.task-progress-wrap--active {
  margin: 0.7rem 0 0.2rem;
}

.task-progress-label {
  margin: 0 0 0.45rem;
  font-size: 0.74rem;
  color: #444;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

.task-progress-track {
  position: relative;
  height: 9px;
  border-radius: 999px;
  background: #e5e5e5;
  overflow: hidden;
}

.task-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1565c0, #42a5f5);
  transition: width 0.12s linear;
}

.task-progress-track--indeterminate .task-progress-fill {
  width: 32%;
  transition: none;
  animation: task-progress-slide 1.05s ease-in-out infinite;
}

@keyframes task-progress-slide {
  0% {
    transform: translateX(-130%);
  }
  100% {
    transform: translateX(400%);
  }
}

.output-stack {
  margin: 0;
  padding: 0;
}

.output {
  margin: 0 0 1rem;
  padding: 0 0 1rem;
  border-bottom: 1px solid #e0e0e0;
  width: 100%;
  max-width: 100%;
}

.output:last-child {
  border-bottom: none;
}

.output-preview {
  display: block;
  margin: 0 0 0.5rem;
  max-width: 100%;
}

.output-preview .output-dl {
  display: block;
  text-decoration: none;
  color: inherit;
}

.output-preview svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

.output-meta {
  margin: 0.2rem 0 0.5rem;
  font-size: 0.7rem;
  color: #777;
  font-style: normal;
}

.opts-fieldset--output .output-meta {
  margin-top: 0.15rem;
  margin-bottom: 0;
}

.output-actions {
  margin: 0 0 0.5rem;
}

.output-actions a {
  font-size: 0.75rem;
  color: #111;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.output-actions a:hover,
.output-actions a:focus-visible {
  color: #555;
}

.output__raw {
  display: block;
  margin: 0;
  padding: 0.4rem 0;
  width: 100%;
  max-width: 100%;
  max-height: 10rem;
  overflow: auto;
  background: transparent;
  border: none;
  border-top: 1px solid #eee;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.62rem;
  line-height: 1.3;
  color: #444;
  white-space: pre-wrap;
  word-break: break-all;
  text-align: left;
}

.site-footnote {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  margin: 0;
  padding: 0.45rem 1rem;
  text-align: left;
  font-size: 0.65rem;
  color: #999;
  line-height: 1.4;
  background: #fafafa;
  border-top: 1px solid #eee;
}

.footnote-link {
  color: #666;
  text-decoration: none;
}

.footnote-link:hover,
.footnote-link:focus-visible {
  color: #111;
}

#filedrag {
  display: none;
}

.filedrag-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  margin: 0;
  padding: 1rem;
  align-items: center;
  justify-content: flex-start;
  background: rgba(250, 250, 250, 0.92);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #333;
}

#filedrag.dragenter {
  display: flex;
}
