body {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f5f7fb;
  color: #1f2430;
}

header,
footer {
  background-color: #222d3a;
  color: #ffffff;
  padding: 1.5rem;
  text-align: center;
}

main {
  padding: 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

section {
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

h1,
h2,
h3 {
  margin-top: 0;
}

p {
  line-height: 1.6;
}

form {
  margin-top: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

label {
  font-weight: 600;
}

textarea,
input[type="file"] {
  width: 100%;
  box-sizing: border-box;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid #cbd2d9;
  font-family: inherit;
  font-size: 1rem;
  background-color: #fdfdfd;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

textarea[readonly] {
  background-color: #f0f4fa;
}

button {
  padding: 0.85rem 1.5rem;
  background-color: #3066be;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
}

button:hover {
  background-color: #234a88;
}

.full-width {
  width: 100%;
}

.results {
  margin-top: 1.5rem;
  background-color: #f0f4fa;
  border-radius: 10px;
  padding: 1.25rem;
  border: 1px solid #d0dae7;
}

.mono {
  font-family: "Fira Code", "Source Code Pro", monospace;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

.stat-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stat-card {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #d0dae7;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 110px;
}

.stat-label {
  font-size: 0.9rem;
  color: #546174;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 1.1rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.chip-panel,
.text-panel {
  margin-top: 1.5rem;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #d0dae7;
  padding: 1.25rem;
}

.panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-header h4 {
  margin: 0;
}

.panel-hint {
  font-size: 0.85rem;
  color: #6b7280;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background-color: #e2e8f8;
  color: #1f2430;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid #c4d0f1;
}

.text-box {
  background: #f8fbff;
  border-radius: 8px;
  border: 1px solid #d0dae7;
  padding: 1rem;
  white-space: pre-wrap;
  min-height: 120px;
  line-height: 1.6;
}

.log-wrapper {
  margin-top: 1.5rem;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.log-card {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #d0dae7;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.log-card h4 {
  margin: 0;
}

.log-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.4rem;
}

.log-section {
  border-radius: 8px;
  border: 1px solid #dfe6f6;
  padding: 0.5rem 0.75rem;
  background: #f6f8fe;
}

.log-section + .log-section {
  margin-top: 0.75rem;
}

.log-section summary {
  cursor: pointer;
  font-weight: 600;
  color: #1f2430;
  list-style: none;
}

.log-section[open] summary {
  margin-bottom: 0.5rem;
}

.log-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.log-line {
  position: relative;
  padding-left: 1.25rem;
  line-height: 1.5;
}

.log-line::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #c4d0f1;
}

.log-line-round::before {
  background-color: #3066be;
}

.action-row {
  margin-top: 1.75rem;
  display: flex;
  justify-content: flex-end;
}

.messages {
  max-width: 960px;
  margin: 1rem auto;
  padding: 0 2rem;
}

.message {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.message.success {
  background-color: #e4f6e8;
  color: #276738;
  border: 1px solid #7cd992;
}

.message.error {
  background-color: #fdecea;
  color: #a0271f;
  border: 1px solid #f5a8a1;
}

.hidden-field {
  display: none;
}

footer p {
  margin: 0;
  font-size: 0.95rem;
}

@media (max-width: 768px) {
  main {
    padding: 1rem;
  }

  section {
    padding: 1rem;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .action-row {
    justify-content: stretch;
  }

  .action-row button {
    width: 100%;
  }
}

