/* --- Global --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  background: #f5f5f7;
  color: #222;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
}

p {
  margin: 0 0 0.5rem;
}

/* --- Header --- */
.app-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: #ffffff;
}

.app-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.app-title {
  font-size: 1.4rem;
}

.app-subtitle {
  font-size: 0.9rem;
  color: #555;
}

/* --- Layout --- */
.app-main {
  max-width: 1100px;
  margin: 1.25rem auto;
  padding: 0 1.25rem 2rem;
  display: flex;
  gap: 1.5rem;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.panel-input {
  flex: 0 0 40%;
}

.panel-output {
  flex: 1;
}

.panel-title {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #777;
}

/* --- Cards --- */
.card {
  background: #ffffff;
  border-radius: 0.75rem;
  padding: 1rem 1rem 1.1rem;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

.card-title {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

/* --- Form elements --- */
.form-group {
  margin-bottom: 0.75rem;
}

.form-row {
  display: flex;
  gap: 0.75rem;
}

.form-row .form-group {
  flex: 1;
}

label {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
  color: #444;
}

.text-input,
.textarea-input {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.14);
  font: inherit;
  resize: vertical;
}

.text-input:focus,
.textarea-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
}

.helper-text {
  font-size: 0.75rem;
  color: #777;
}

/* --- Buttons --- */
.primary-button,
.secondary-button,
.ghost-button {
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font: inherit;
  cursor: pointer;
  border: none;
}

.primary-button {
  background: #2563eb;
  color: #ffffff;
}

.primary-button:hover {
  filter: brightness(0.95);
}

.secondary-button {
  background: #e5e7eb;
  color: #222;
}

.secondary-button:hover {
  background: #d4d4d8;
}

.ghost-button {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: #444;
}

.ghost-button:hover {
  background: rgba(0, 0, 0, 0.03);
}

.form-footer {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* --- Summary --- */
.card-summary {
  border-left: 3px solid #d4d4d8;
}

.summary-status {
  margin-bottom: 0.5rem;
}

.status-pill {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.status-neutral {
  background: #e5e7eb;
  color: #4b5563;
}

.status-ok {
  background: #dcfce7;
  color: #166534;
}

.status-warning {
  background: #fef9c3;
  color: #854d0e;
}

.status-danger {
  background: #fee2e2;
  color: #991b1b;
}

.summary-list {
  padding-left: 1.1rem;
  margin: 0;
  font-size: 0.85rem;
}

/* --- Tables --- */
.metrics-table-wrapper {
  overflow-x: auto;
}

.metrics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.metrics-table th,
.metrics-table td {
  padding: 0.35rem 0.45rem;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.metrics-table th {
  font-weight: 600;
  font-size: 0.8rem;
  color: #555;
}

/* --- Lists in result sections --- */
.result-list {
  list-style: disc;
  padding-left: 1.1rem;
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
}

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

/* --- Annealing temp section --- */
.anneal-main {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.anneal-value {
  font-weight: 600;
}

.anneal-range {
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}

/* --- Footer --- */
.app-footer {
  padding: 1rem 1.25rem 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: #6b7280;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .app-main {
    flex-direction: column;
  }

  .panel-input,
  .panel-output {
    flex: 1 1 auto;
  }
}

@media (max-width: 600px) {
  .app-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-row {
    flex-direction: column;
  }

  .form-footer {
    justify-content: flex-start;
  }
}



