:root {
  color-scheme: light;
  --bg: #f3f5f9;
  --card: #ffffff;
  --ink: #1f2430;
  --muted: #5a6475;
  --line: #d6dce7;
  --accent: #1d6bd1;
  --danger: #c12a2a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Yu Gothic UI", sans-serif;
  background: radial-gradient(circle at top, #ffffff, var(--bg) 42%);
  color: var(--ink);
}

.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

h1 {
  margin: 0 0 8px;
  font-size: 1.9rem;
}

h2 {
  margin: 0 0 12px;
  font-size: 1.15rem;
}

.lead {
  margin: 0 0 16px;
  color: var(--muted);
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.screen-drop-hint {
  color: var(--muted);
  font-size: 0.92rem;
}

body.is-file-dragging {
  background: radial-gradient(circle at top, #ffffff, #deebff 40%);
}

button {
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  padding: 8px 14px;
  font-size: 0.95rem;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.05);
}

.message {
  min-height: 1.4em;
  margin: 12px 2px;
  font-size: 0.95rem;
  color: var(--muted);
}

.message.error {
  color: var(--danger);
  font-weight: 600;
}

.message.notice {
  color: #6b4a00;
}

.panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

#preview {
  max-width: 100%;
  max-height: 420px;
  width: auto;
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8f9fc;
  object-fit: contain;
}

.preview-wrap {
  min-height: 180px;
}

#preview.is-hidden {
  display: none;
}

#preview.is-visible {
  display: block;
}

.preview-placeholder {
  margin: 0;
  min-height: 180px;
  display: grid;
  place-items: center;
  border: 1px dashed #a7b7d1;
  border-radius: 10px;
  background: #f8f9fc;
  color: var(--muted);
  text-align: center;
  padding: 14px;
}

.preview-placeholder.is-hidden {
  display: none;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  width: 34%;
  color: var(--muted);
  font-weight: 600;
}

pre {
  margin: 0;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f7f9fe;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 640px) {
  h1 {
    font-size: 1.6rem;
  }

  .app {
    padding: 16px 12px 28px;
  }

  .toolbar {
    align-items: flex-start;
  }

  th,
  td {
    display: block;
    width: 100%;
    border-bottom: none;
    padding: 4px 0;
  }

  tr {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
  }
}
