* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f7f3ec;
  color: #1a1a1a;
  display: flex;
  justify-content: center;
  padding: 24px 12px;
}

.card {
  width: 100%;
  max-width: 480px;
  text-align: center;
}

/* Toast alert — more prominent than the inline #status line, for things the visitor
   should actually notice (validation errors, service unavailable, a result arriving). */
.toast {
  position: fixed;
  top: 14px;
  left: 50%;
  z-index: 1000;
  max-width: min(92vw, 420px);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  opacity: 0;
  transform: translate(-50%, -16px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.toast.toast-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast-error {
  background: #fdeaea;
  color: #a12626;
  border: 1px solid #f3b8b8;
}

.toast-success {
  background: #e3f3ea;
  color: #1a7a4c;
  border: 1px solid #b7ddc7;
}

.app-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
}

.app-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

h1 {
  font-size: 1.4rem;
  margin: 0 0 4px;
  color: #1a1a1a;
  text-align: left;
}

.beta-badge {
  display: inline-block;
  vertical-align: middle;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1a7a4c;
  background: #e3f3ea;
  border-radius: 999px;
  padding: 2px 8px;
}

.subtitle {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.4;
  margin: 0 0 8px;
  text-align: left;
}

.disclaimer {
  color: #a15c00;
  background: #fff6e5;
  border-radius: 8px;
  font-size: 0.78rem;
  line-height: 1.4;
  padding: 8px 10px;
  margin: 0 0 20px;
  text-align: left;
}

/* Input groups */

.q-group {
  text-align: left;
  margin: 0 0 16px;
}

.q-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 6px;
}

.q-hint {
  font-weight: 500;
  color: #888;
}

.field-hint {
  color: #888;
  font-size: 0.74rem;
  line-height: 1.35;
  margin: 6px 0 0;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

input[type="number"],
select {
  padding: 10px 11px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  color: #1a1a1a;
  font-size: 0.88rem;
  min-width: 0;
  width: 100%;
}

.field + .field {
  margin-top: 8px;
}

/* Persistent labels rather than placeholder-only fields — a placeholder disappears the
   moment a value is typed, which on a form of bare numbers leaves no way to tell focal
   length from aperture at a glance. */
.field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #777;
  margin: 0 0 4px;
}

button#calculate-btn {
  margin-top: 4px;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: #1a7a4c;
  color: white;
  font-size: 1rem;
  cursor: pointer;
}

button#calculate-btn:disabled {
  background: #aaa;
  cursor: not-allowed;
}

#status {
  min-height: 1.2em;
  color: #444;
  font-size: 0.9rem;
}

#result {
  margin-top: 8px;
  text-align: left;
  outline: none; /* programmatically focused after a calculation, not keyboard-navigated */
}

/* Hero result — the one number the visitor came for. Night-sky panel rather than the
   family's usual white card, since it's the only element here that should read as a
   verdict rather than a row of data. */
.hero-result {
  background: #1b2340;
  border-radius: 12px;
  padding: 18px 16px;
  text-align: center;
  margin: 0 0 14px;
}

.hero-label {
  color: #9fb0d9;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 4px;
}

.hero-value {
  color: #fff;
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1.05;
  margin: 0;
}

.hero-sub {
  color: #9fb0d9;
  font-size: 0.76rem;
  line-height: 1.35;
  margin: 6px 0 0;
}

/* Comparison table */

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin: 0 0 12px;
}

.compare-table th {
  text-align: left;
  color: #666;
  font-weight: 600;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 6px;
  border-bottom: 2px solid #ddd;
}

.compare-table th:not(:first-child),
.compare-table td:not(:first-child) {
  text-align: right;
  white-space: nowrap;
}

.compare-table td {
  padding: 8px 6px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
  color: #333;
}

.compare-table tr.primary-row td {
  background: #f2edfa;
}

.rule-name {
  font-weight: 700;
  color: #1a1a1a;
  display: block;
}

.rule-sub {
  display: block;
  font-size: 0.7rem;
  color: #888;
  line-height: 1.3;
  margin-top: 2px;
}

.rule-speed {
  font-weight: 700;
  color: #5b3fa0;
}

.rule-raw {
  color: #888;
  font-size: 0.72rem;
}

/* Suggested starting exposure */

.settings-strip {
  background: #e3f3ea;
  border: 1px solid #b7ddc7;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  margin: 0 0 4px;
}

.settings-strip-label {
  color: #1a7a4c;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0 0 4px;
}

.settings-strip-value {
  color: #12603b;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
}

.settings-sub {
  color: #888;
  font-size: 0.74rem;
  line-height: 1.35;
  margin: 0 0 14px;
}

/* Explanatory prose + the derived details */

.explain {
  background: #f7f5fb;
  border: 1px solid #eee2fa;
  border-radius: 8px;
  color: #555;
  font-size: 0.76rem;
  line-height: 1.4;
  padding: 8px 10px;
  margin: 0 0 14px;
}

.explain strong {
  color: #5b3fa0;
}

.detail-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}

.detail-list li {
  font-size: 0.76rem;
  color: #666;
  padding: 5px 0;
  border-bottom: 1px solid #eee;
}

.detail-list li strong {
  color: #1a1a1a;
  font-weight: 600;
}

/* Shared with the sibling tools: anything the calculator wants the visitor to notice
   about their own inputs, rather than a number. Never buried in the gray prose. */
.alert-badge {
  color: #b5540a;
  background: #ffe9d6;
  border-left: 3px solid #e8873a;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.4;
  padding: 8px 10px;
  margin: 0 0 8px;
}
