:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #1a2233;
  --muted: #6b7388;
  --border: #e3e7ee;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --redact: #dc2626;
  --redact-bg: #fee2e2;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06),
    0 4px 12px rgba(15, 23, 42, 0.04);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
}

.privacy-banner {
  background: #ecfdf5;
  color: #065f46;
  border-bottom: 1px solid #a7f3d0;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.privacy-icon {
  font-size: 14px;
}

.site-header {
  padding: 32px 24px 16px;
  text-align: center;
  max-width: 880px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.logo-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

h1 {
  font-size: 22px;
  margin: 0;
  letter-spacing: -0.01em;
}

.tagline {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.container {
  max-width: 880px;
  margin: 16px auto 32px;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.card-header h2 {
  margin: 0 0 14px;
}

.clear-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  max-width: 260px;
}

.clear-btn {
  appearance: none;
  background: #fff;
  color: var(--redact);
  border: 1px solid #fecaca;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.clear-btn:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}

.clear-note {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  line-height: 1.3;
}

.upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.upload-button {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}

.upload-button:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.file-name {
  color: var(--muted);
  font-size: 14px;
}

.file-name.has-file {
  color: var(--text);
  font-weight: 500;
}

.primary-btn {
  appearance: none;
  border: none;
  background: var(--accent);
  color: white;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.primary-btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.primary-btn:disabled {
  background: #a4b3cc;
  cursor: not-allowed;
}

.status {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  min-height: 18px;
}

.status.error {
  color: var(--redact);
}

.summary-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.summary-box h3 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.summary-intro {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
}

.summary-box ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 4px 16px;
}

.summary-box li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  padding: 2px 0;
}

.summary-label {
  color: var(--muted);
}

.summary-count {
  color: var(--redact);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.redacted-box,
.answer-box {
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 480px;
  overflow-y: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.55;
}

.redacted-box.empty,
.answer-box.empty {
  color: var(--muted);
  font-style: italic;
  font-family: inherit;
}

.insights-block {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fafafa;
}

.insights-block h3 {
  margin: 0 0 8px;
  font-size: 14px;
  color: #111827;
}

.notices-block {
  background: #fff7ed;
  border-color: #fed7aa;
}

.notices-block h3 { color: #9a3412; }

.bullet-list {
  margin: 0;
  padding-left: 20px;
}

.bullet-list li {
  margin: 4px 0;
  font-size: 14px;
  line-height: 1.5;
  color: #1f2937;
}

.keyinfo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px 16px;
}

.keyinfo-list li {
  font-size: 14px;
  line-height: 1.4;
  color: #1f2937;
  background: #fff;
  border: 1px solid #eef2f7;
  border-radius: 6px;
  padding: 8px 10px;
}

.keyinfo-list .ki-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  margin-bottom: 2px;
}

.keyinfo-list .ki-value {
  font-weight: 600;
  word-wrap: break-word;
}

.answer-evidence {
  background: #fef9c3;
  color: inherit;
  padding: 1px 2px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(202, 138, 4, 0.35);
}

.redacted {
  background: var(--redact-bg);
  color: var(--redact);
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: inherit;
  box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.25);
  cursor: help;
}

.sample-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.sample-btn {
  background: #eff4ff;
  color: var(--accent);
  border: 1px solid #dbeafe;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s;
}

.sample-btn:hover:not(:disabled) {
  background: #dbeafe;
}

.sample-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ask-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.ask-row input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}

.ask-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.ask-row input:disabled {
  background: #f3f4f8;
  cursor: not-allowed;
}

.site-footer {
  text-align: center;
  padding: 16px;
  color: var(--muted);
  font-size: 12px;
}

.answer-mode {
  display: inline-block;
  margin: 12px 0 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}
.answer-mode.reasoning {
  color: #6d28d9;
  background: #f5f3ff;
  border-color: #ddd6fe;
}
.answer-mode.strict {
  color: #0e7490;
  background: #ecfeff;
  border-color: #a5f3fc;
}
