:root {
  color-scheme: light;
  --border: #d0d5dd;
  --accent: #2563eb;
  --warn-bg: #fff4e5;
  --disclaimer-bg: #fef3c7;
}

* { box-sizing: border-box; }

body {
  font-family: "Segoe UI", "Hiragino Kaku Gothic ProN", sans-serif;
  margin: 0;
  padding: 0 1.5rem 3rem;
  color: #1f2937;
  background: #f9fafb;
}

header h1 {
  font-size: 1.4rem;
  margin: 1.5rem 0 0.5rem;
}

.disclaimer {
  background: var(--disclaimer-bg);
  border: 1px solid #f6c453;
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  margin: 0.5rem 0 1rem;
}

.mode-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.mode-tabs button {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
}

.mode-tabs button[aria-selected="true"] {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.input-section textarea {
  width: 100%;
  max-width: 720px;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
}

.input-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.4rem;
}

#submit-btn, #export-btn {
  padding: 0.5rem 1.2rem;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

#submit-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.error {
  color: #b91c1c;
  min-height: 1.2em;
  font-size: 0.9rem;
}

.result-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0 0.5rem;
}

table {
  border-collapse: collapse;
  width: 100%;
  background: #fff;
}

th, td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  text-align: left;
  vertical-align: top;
}

td[contenteditable="true"] {
  cursor: text;
}

tr.needs-confirmation {
  background: var(--warn-bg);
}

tr.grounding-warning {
  outline: 2px solid #ef4444;
  outline-offset: -1px;
}

.delete-cell button {
  border: none;
  background: transparent;
  color: #b91c1c;
  cursor: pointer;
  font-size: 0.9rem;
}
