.converter-workspace {
  --workspace-inset: clamp(18px, 2.5vw, 32px);
  gap: 0;
  padding: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: none;
}

.converter-workspace .panel {
  padding: var(--workspace-inset);
  background: transparent;
  border: 0;
  border-radius: 0;
}

.converter-workspace .panel-heading {
  min-height: 32px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.converter-workspace .panel-heading h2 {
  font-size: clamp(21px, 2.1vw, 27px);
  line-height: 1.16;
}

.converter-workspace .drop-zone {
  height: clamp(208px, 22vw, 258px);
  background-color: #f1f3e9;
  background-image: radial-gradient(#cbd0be 0.9px, transparent 1px);
  background-size: 16px 16px;
  border-color: #929a80;
  border-radius: 10px;
}

.converter-workspace .drop-zone:is(:hover, :focus-visible, .dragover):enabled {
  background-color: #eaf0df;
  border-color: #4c6138;
}

.converter-workspace .upload-prompt {
  gap: 10px;
  padding: 16px;
  color: #51574c;
}

.converter-workspace .upload-sheet {
  display: grid;
  width: 59px;
  height: 65px;
  margin: 0 0 4px;
  place-items: center;
  color: #323d27;
  background: repeating-linear-gradient(to bottom, transparent 0 11px, #e4e6d9 11px 12px), var(--paper);
  border: 1px solid #8e977e;
  border-radius: 3px;
  box-shadow: 4px 4px 0 #d2dbc3;
  font-size: 22px;
  font-weight: 600;
  transform: rotate(-7deg);
}

.converter-workspace .upload-prompt strong {
  padding: 9px 18px;
  color: var(--text);
  background: var(--accent);
  border: 1px solid #97b845;
  border-radius: 7px;
}

.converter-workspace .preview-wrap { display: block; background: var(--soft); }
.converter-workspace .change-badge { border-radius: 6px; font-size: 12px; }

.upload-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 10px;
  padding: 5px 0;
}

.upload-options small { color: var(--muted); font-size: 12px; }
.upload-options .converter-sample-button { padding-inline: 0; }
.upload-options:has(#try-sample[hidden]) { padding-block: 11px; }

.converter-workspace .ai-data-notice {
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.converter-workspace :is(.primary-button, .secondary-button, .file-meta, .crop-tool-button, textarea, .explanation-panel) {
  border-radius: 8px;
}

.converter-workspace .crop-toolbar { flex-wrap: wrap; }
.converter-workspace .crop-tool-button { min-height: 38px; font-size: 12px; }
.converter-workspace .crop-status { font-size: 12px; }

.converter-workspace .output-panel {
  display: flex;
  flex-direction: column;
  border-inline-start: 1px solid var(--line);
}

.converter-workspace .output-status {
  padding: 5px 9px;
  color: #505148;
  background: var(--soft);
  border-radius: 20px;
}

.output-panel:has(#latex-output:enabled) .output-status {
  color: #355124;
  background: #e7f1d8;
}

.converter-workspace .equation-preview {
  min-height: 120px;
  border-radius: 9px;
}

.output-panel:has(#latex-output:disabled) :is(.converter-source, #copy-button, #result-actions),
.output-panel:has(#reset-button:disabled) #explain-button,
.converter-workspace #reset-button:disabled {
  display: none;
}

.output-panel:has(#latex-output:disabled) .equation-preview {
  flex: 1;
  min-height: 202px;
  margin: 0;
  background: #f6f5ef;
  border-color: #e1e0d5;
}

.converter-workspace .preview-placeholder > span {
  display: grid;
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  place-items: center;
  color: #737366;
  background: var(--paper);
  border: 1px solid #d8d7ca;
  border-radius: 12px;
  font-size: 26px;
}

.preview-placeholder strong { color: var(--text); font-size: 15px; }
.converter-workspace .preview-placeholder p { margin: 5px 0 0; line-height: 1.5; }
.converter-workspace #copy-button { margin-top: 0; }
.converter-workspace .quiet-reset { min-height: 44px; font-size: 13px; }

.converter-help {
  grid-column: 1 / -1;
  padding: 4px var(--workspace-inset);
  border-top: 1px solid var(--line);
}

.converter-help:has(.converter-help-panel:not([hidden])) { padding-bottom: var(--workspace-inset); }

.converter-workspace .converter-help-button {
  position: static;
  display: inline-flex;
  width: auto;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding: 0 3px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 3px;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.converter-workspace .converter-help-panel {
  position: static;
  width: min(100%, 68ch);
  max-height: none;
  margin-top: 4px;
  padding: clamp(16px, 2.5vw, 28px);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: none;
}

.converter-help .converter-help-heading { align-items: center; margin-bottom: 10px; }
.converter-help .converter-help-heading h2 { margin: 0; }
.converter-help .converter-help-heading button { min-width: 44px; min-height: 44px; }
.converter-help .converter-help-panel li strong { font-size: 14px; }
.converter-help .converter-help-panel li span { font-size: 13px; }

@media (max-width: 980px) {
  .converter-workspace .output-panel {
    border-inline-start: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 620px) {
  .converter-workspace .panel-heading { margin-bottom: 14px; }
  .converter-workspace .result-actions { grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); }
  .converter-workspace .drop-zone { height: 210px; }
  .output-panel:has(#latex-output:disabled) .equation-preview { min-height: 175px; }
}
