:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #16181d;
  --muted: #6b7280;
  --line: #e3e5e8;
  --accent: #1a56db;
  --box: #f7f8fa;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --fg: #e6e8eb;
    --muted: #9aa1aa;
    --line: #2a2d33;
    --accent: #7aa7f5;
    --box: #1b1e23;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0 auto;
  max-width: 42rem;
  padding: 1.5rem 1.15rem 4rem;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.75;
}

h1 {
  font-size: 1.7rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 1.25rem;
}

h2 {
  font-size: 1.2rem;
  line-height: 1.35;
  margin: 2.5rem 0 0.75rem;
}

h3 {
  font-size: 1.02rem;
  line-height: 1.4;
  margin: 1.75rem 0 0.4rem;
}

p, ol, ul { margin: 0 0 1.1rem; }
ol, ul { padding-left: 1.35rem; }
li { margin-bottom: 0.5rem; }

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.5rem 0 1.5rem;
}

a { color: var(--accent); }

/* ---- Tool (first screen) ---- */

#tool { margin: 0 0 2rem; }

#drop {
  border: 2px dashed var(--line);
  border-radius: 10px;
  background: var(--box);
  padding: 1.5rem 1rem;
  text-align: center;
  transition: border-color .15s ease, background .15s ease;
}

#drop.over {
  border-color: var(--accent);
  background: var(--bg);
}

#drop input[type=file] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

#droplabel {
  display: block;
  cursor: pointer;
  font-weight: 600;
}

#filename {
  display: block;
  margin-top: .4rem;
  font-weight: 400;
  font-size: .92rem;
  color: var(--muted);
  word-break: break-all;
}

button {
  font: inherit;
  font-weight: 600;
  border: 0;
  border-radius: 8px;
  padding: .7rem 1.1rem;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  min-height: 44px; /* comfortable tap target on mobile */
}

button:disabled {
  background: var(--line);
  color: var(--muted);
  cursor: not-allowed;
}

#convert {
  display: block;
  width: 100%;
  margin-top: 1rem;
}

#status {
  margin: .9rem 0 0;
  font-size: .95rem;
  color: var(--muted);
  min-height: 1.5em;
}

/* ---- Result ---- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin: .9rem 0 1rem;
}

#notes {
  margin: 0;
  padding: .9rem 1rem;
  background: var(--box);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .86rem;
  line-height: 1.6;
  max-height: 22rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---- Mobile ---- */

@media (max-width: 400px) {
  body { font-size: 1rem; }
  h1 { font-size: 1.5rem; }
  #drop { padding: 1.25rem .75rem; }
}
