:root {
  color-scheme: light;
  --bg: #f5f4ef;
  --surface: #ffffff;
  --text: #202524;
  --muted: #606b67;
  --line: #d8ddd8;
  --accent: #1f5f56;
  --accent-strong: #16473f;
  --accent-soft: #e5f1ed;
  --warning: #8c3f27;
  --focus: #b36b18;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Yu Gothic", "Meiryo", system-ui, sans-serif;
  letter-spacing: 0;
}

.app-shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 44px;
}

.tool-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0 20px;
  border-bottom: 1px solid var(--line);
}

.case-label {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.16;
  font-weight: 800;
}

h2 {
  margin-bottom: 8px;
  font-size: 15px;
  line-height: 1.4;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.status-strip span {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  padding: 0 12px;
  font-size: 13px;
  white-space: nowrap;
}

.alert {
  margin-top: 18px;
  border: 1px solid #c57b62;
  border-radius: 8px;
  background: #fff7f3;
  color: var(--warning);
  padding: 14px 16px;
  line-height: 1.6;
  font-weight: 700;
}

.upload-form {
  margin-top: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.file-field {
  display: grid;
  gap: 10px;
  min-height: 168px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfcfa;
}

.file-title {
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.4;
}

.file-subtitle {
  min-height: 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

input[type="file"] {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 8px;
  font-size: 14px;
}

input[type="file"]:focus-visible,
.primary-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 42%, transparent);
  outline-offset: 2px;
}

.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}

.primary-button {
  min-width: 180px;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  padding: 0 22px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.privacy-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: right;
}

.result-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.result-preview > div {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent-soft);
  padding: 18px;
}

.result-preview p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 22px, 680px);
    padding-top: 20px;
  }

  .tool-header,
  .action-row {
    align-items: stretch;
    flex-direction: column;
  }

  .status-strip {
    justify-content: flex-start;
  }

  .file-grid,
  .result-preview {
    grid-template-columns: 1fr;
  }

  .upload-form {
    padding: 16px;
  }

  .privacy-note {
    text-align: left;
  }
}
