:root {
  --canvas: #f3f6fa;
  --surface: #ffffff;
  --ink: #162033;
  --muted: #516178;
  --line: #b5c1d2;
  --accent: #0659b8;
  --accent-dark: #034488;
  --notice: #fff5cf;
  --notice-line: #bb8000;
  --focus: #d34f00;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--canvas);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.6;
}

.shell {
  width: min(100% - 2rem, 760px);
  margin: 3rem auto;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgb(22 32 51 / 10%);
}

header { margin-bottom: 1.5rem; }

header p:last-child, .formats, #selected-file, #status {
  color: var(--muted);
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: .04em;
}

h1 {
  margin: .25rem 0;
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  line-height: 1.2;
}

.notice {
  display: grid;
  gap: .25rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--notice);
  border-left: 5px solid var(--notice-line);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 150px;
  padding: 1.5rem;
  color: var(--accent-dark);
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  background: #eff7ff;
}

.drop-zone:hover, .drop-zone.is-dragging { background: #dceeff; }

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

button {
  min-height: 44px;
  padding: .6rem 1rem;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 8px;
}

button:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); }
button:disabled { cursor: wait; opacity: .65; }

button:focus-visible, .drop-zone:focus-within, textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

#status { min-height: 1.6em; font-weight: 600; }

#result {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; }
.preview-label { display: block; margin-bottom: .5rem; font-weight: 700; }

#markdown-preview {
  width: 100%;
  min-height: 280px;
  padding: 1rem;
  color: var(--ink);
  font: .92rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 8px;
  resize: vertical;
}

@media (max-width: 640px) {
  .shell { width: min(100% - 1rem, 760px); margin: .5rem auto; border-radius: 8px; }
  .actions, .actions button, #convert-button { width: 100%; }
  .drop-zone { min-height: 130px; }
}
