/* Plotter panel — optional side drawer. Matches the app's plain look. */

#plotter-toggle[aria-expanded="true"] {
  background: #333;
  color: #fff;
  border-color: #333;
}

body.plotter-open main {
  margin-right: 404px;
}

#plotter-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 400px;
  background: #fff;
  border-left: 1px solid #ccc;
  overflow-y: auto;
  padding: 12px 14px 40px;
  font-size: 14px;
  z-index: 20;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.06);
}

#plotter-panel[hidden] { display: none; }

#plotter-panel h2 {
  font-size: 1.1rem;
  margin: 0;
}

.pl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.pl-sub {
  color: #666;
  font-size: 12px;
  margin-bottom: 10px;
}

#plotter-panel button,
#plotter-panel select,
#plotter-panel input[type="number"],
#plotter-panel input[type="text"],
#plotter-panel textarea {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #fff;
  font-size: 13px;
  font-family: inherit;
}

#plotter-panel button { cursor: pointer; }
#plotter-panel button:hover:not(:disabled) { background: #f0f0f0; }
#plotter-panel button:disabled { opacity: 0.45; cursor: not-allowed; }
#plotter-panel button.pl-primary { background: #333; color: #fff; border-color: #333; }
#plotter-panel button.pl-primary:hover:not(:disabled) { background: #111; }
#plotter-panel button.pl-danger { border-color: #b3261e; color: #b3261e; }
#plotter-panel button.pl-danger:hover:not(:disabled) { background: #fbeceb; }
#plotter-panel button.pl-close { border: none; font-size: 20px; line-height: 1; padding: 2px 8px; }

#plotter-panel details {
  border-top: 1px solid #e5e5e5;
  padding: 8px 0;
}

#plotter-panel details > summary {
  cursor: pointer;
  font-weight: 600;
  padding: 2px 0;
  list-style-position: inside;
}

#plotter-panel details details {
  border-top: 1px dashed #e5e5e5;
  margin-left: 4px;
}

#plotter-panel details details > summary { font-weight: 500; }

.pl-est {
  position: sticky;   /* stays in view while tuning Settings → Timing */
  top: -12px;
  z-index: 1;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: #fafafa;
}

.pl-est-total {
  font-size: 1.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pl-tag {
  display: inline-block;
  font-size: 11px;
  border-radius: 10px;
  padding: 1px 8px;
  margin-left: 6px;
  vertical-align: middle;
  background: #e8e8e8;
  color: #333;
  font-weight: 500;
}

.pl-tag.pl-live { background: #fdf0d5; color: #7a4b00; }
.pl-tag.pl-opt { background: #dff3e4; color: #1d5e33; }
.pl-tag.pl-error { background: #fbe1dc; color: #9b2a14; }

.pl-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  margin-top: 6px;
  font-size: 13px;
}

.pl-table td, .pl-table th {
  padding: 2px 4px;
  text-align: right;
  border-bottom: 1px solid #eee;
}

.pl-table td:first-child, .pl-table th:first-child { text-align: left; }
.pl-table th { font-weight: 600; color: #555; }

.pl-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 6px 0;
}

.pl-note {
  font-size: 12px;
  color: #555;
  margin: 4px 0;
}

.pl-warn {
  font-size: 12px;
  color: #8a1c14;
  background: #fbeceb;
  border-radius: 6px;
  padding: 6px 8px;
  margin: 6px 0;
}

.pl-warn:empty { display: none; }

.pl-info {
  font-size: 12px;
  color: #1f4f6e;
  background: #e8f2f8;
  border-radius: 6px;
  padding: 6px 8px;
  margin: 6px 0;
}

.pl-info:empty { display: none; }

.pl-field {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 6px;
  align-items: center;
  margin: 4px 0;
  font-size: 13px;
}

.pl-field input[type="number"],
.pl-field select,
.pl-field input[type="text"] { width: 100%; }

.pl-field .pl-unit { color: #777; font-size: 11px; margin-left: 2px; }
.pl-field.pl-check { grid-template-columns: 1fr auto; }
.pl-field textarea { grid-column: 1 / -1; width: 100%; min-height: 40px; }

/* circled "i" next to a setting; opens its bullet-point notes in a popover */
#plotter-panel .pl-info-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; padding: 0; margin-left: 3px;
  border: 0; border-radius: 50%; background: none;
  color: #5b7488; cursor: pointer; vertical-align: -4px;
}
#plotter-panel .pl-info-btn:hover, #plotter-panel .pl-info-btn[aria-expanded="true"] { color: #1f4e79; background: #e6eef5; }
#plotter-panel .pl-info-btn:focus-visible { outline: 2px solid #1f4e79; outline-offset: 1px; }
.pl-hint {
  margin: 0; padding: 7px 10px 7px 24px;
  background: #fff; border: 1px solid #c9d3dc; border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  font-size: 12px; line-height: 1.4; color: #333;
}
.pl-hint[popover] { position: fixed; inset: auto; max-width: 280px; }
.pl-hint.pl-hint-inline { margin: 0 0 6px; box-shadow: none; }
.pl-hint li { margin: 2px 0; }

.pl-slider {
  display: grid;
  grid-template-columns: 90px 1fr 42px;
  gap: 6px;
  align-items: center;
  margin: 4px 0;
}

.pl-progress {
  height: 12px;
  background: #eee;
  border-radius: 6px;
  overflow: hidden;
  margin: 6px 0 4px;
}

.pl-progress > div {
  height: 100%;
  width: 0;
  background: #2f7d4f;
  transition: width 0.2s linear;
}

.pl-progress-text {
  font-size: 12px;
  color: #444;
  font-variant-numeric: tabular-nums;
}

.pl-status {
  font-size: 12px;
  color: #444;
}

.pl-status b { color: #111; }

.pl-badge {
  font-size: 11px;
  background: #e8f2f8;
  color: #1f4f6e;
  border-radius: 10px;
  padding: 1px 8px;
}

#pl-mock-view {
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-top: 6px;
  background: #fff;
  aspect-ratio: 300 / 218;
  overflow: hidden;
}

#pl-mock-view svg { width: 100%; height: 100%; display: block; }

.pl-log-wrap { max-height: 220px; overflow: auto; }

/* travel overlay inside the output preview */
#preview svg .pl-travel line {
  stroke: #e07a2f;
  stroke-width: 0.8;
  stroke-dasharray: 3 2;
  vector-effect: non-scaling-stroke;
}

/* paper border overlay inside the output preview */
#preview svg .pl-paper rect { fill: none; vector-effect: non-scaling-stroke; }
#preview svg .pl-paper .pl-paper-sheet { stroke: #8a8a8a; stroke-width: 1.2; }
#preview svg .pl-paper .pl-paper-margin { stroke: #b8c4d0; stroke-width: 0.8; stroke-dasharray: 4 3; }

@media (max-width: 768px) {
  body.plotter-open main { margin-right: 0; }
  #plotter-panel { width: 100%; }
}
