.html2md {
  max-width: 1280px;
}

.html2md [hidden] {
  display: none !important;
}

.html2md-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: 156px;
  padding: 30px clamp(22px, 4vw, 46px);
  margin-bottom: 22px;
  border: 1px solid #2f63b5;
  border-radius: 16px;
  overflow: hidden;
  background: #103e90;
  color: #fff;
}

.html2md-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.2;
  color: inherit;
}

.html2md-hero p {
  max-width: 34em;
  margin: 0;
  color: #e0ebff;
  line-height: 1.65;
}

.html2md-art {
  position: absolute;
  z-index: -1;
  inset: 0 0 0 auto;
  width: 39%;
  pointer-events: none;
  background: linear-gradient(90deg, #103e90, transparent 24%), var(--html2md-art) 24% center / auto 104% no-repeat;
}

.html2md-workbench {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}

.html2md-tabs {
  display: flex;
  gap: 8px;
  padding: 0 clamp(16px, 3vw, 26px);
  border-bottom: 1px solid var(--line);
}

.html2md-tabs button {
  min-height: 48px;
  padding: 0 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
}

.html2md-tabs button[aria-selected="true"] {
  border-bottom-color: var(--accent);
  color: var(--text);
  font-weight: 650;
}

.html2md-panel {
  padding: clamp(16px, 3vw, 26px);
}

.html2md-form, .html2md-title {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.html2md-form > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.html2md input, .html2md textarea {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

.html2md input, .html2md button {
  min-height: 44px;
}

.html2md label {
  font-weight: 600;
}

.html2md-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.html2md-editor {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.html2md-editor-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}

.html2md-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.html2md textarea {
  display: block;
  min-height: 370px;
  padding: 14px;
  resize: vertical;
  border: 0;
  border-radius: 0;
  font: 14px/1.65 ui-monospace, Consolas, monospace;
}

.html2md :is(input, textarea, button):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.html2md-status {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  grid-column: 1 / -1;
}

.html2md-status:empty {
  margin: 0;
}

.html2md-fetch-status:not(:empty) {
  margin: -8px 0 16px;
}

.html2md-fallback {
  margin: -6px 0 18px;
}

.html2md button:disabled {
  opacity: .55;
  cursor: default;
}

@media (max-width: 850px) {
  .html2md-art { display: none; }
}

@media (max-width: 640px) {
  .html2md-grid { grid-template-columns: minmax(0, 1fr); }
  .html2md textarea { min-height: 235px; font-size: 16px; }
}
