/* Matches the OEMS Noise Exposure Calculator (noise_twa_dose_time). */
:root {
  --bg: #eef0f3;
  --ink: #111315;
  --muted: #6b7076;
  --soft: #8a8f95;
  --line: #e6e8eb;
  --field: #f1f2f4;
  --focus: #4f5bd5;
  --dark: #16181b;
  --dark-line: #2b2e33;
  --dark-muted: #9a9fa6;
  --green: #34d399;
  --green-ink: #4ade80;
  --red: #f87171;
}

* { box-sizing: border-box; }
html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 34px; }

/* Header banner */
.banner {
  position: relative; overflow: hidden; color: #fff;
  background:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px) right top / 48px 48px,
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px) right top / 48px 48px,
    linear-gradient(100deg, #071433 0%, #0b2554 45%, #13497f 80%, #175b92 100%);
  box-shadow: 0 6px 18px rgba(7, 20, 51, .18);
}
.banner::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: linear-gradient(90deg, #22c3e6 0%, #4f7be8 45%, #7b5cf0 60%, #22c3e6 100%);
}
.banner-in { display: flex; justify-content: space-between; align-items: center; gap: 28px; padding: 30px 34px 34px; max-width: 1180px; margin: 0 auto; }
.banner-name { font-size: 44px; line-height: 1; font-weight: 700; letter-spacing: -0.04em; }
.banner-sub { font-size: 12.5px; font-weight: 500; letter-spacing: .24em; color: #c6d2e8; margin-top: 10px; }
.banner-tag { font-size: 15.5px; font-weight: 500; color: #b9cdea; border-left: 1px solid rgba(255, 255, 255, .22); padding: 6px 0 6px 28px; }

h1 {
  font-size: 54px; line-height: 1.04; letter-spacing: -0.035em; font-weight: 600;
  margin: 56px 0 40px; max-width: 760px;
}

/* Layout */
.grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.col { display: grid; gap: 24px; min-width: 0; }

.card {
  background: #fff; border-radius: 16px; padding: 30px 32px 34px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .04);
}
.card p { margin: 0; }

/* Fields */
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding: 22px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; padding-top: 4px; }
.row:last-child { padding-bottom: 0; }
.row.full { grid-template-columns: 1fr; }
label { display: block; min-width: 0; }
.label { display: block; font-weight: 600; font-size: 13px; margin: 0 0 10px; }

.input {
  position: relative; display: flex; align-items: center;
  background: var(--field); border: 1.5px solid transparent; border-radius: 10px;
  height: 46px; padding: 0 16px; transition: border-color .15s, background .15s;
}
.input:focus-within { background: #fff; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(79, 91, 213, .08); }
.input input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 16px; color: var(--ink); padding: 0;
}
.input input::placeholder { color: #a3a8ae; }
.input .unit { font-size: 12.5px; color: var(--muted); margin-left: 8px; }
.hint { display: block; font-size: 12.5px; color: var(--muted); margin: -4px 0 12px; }
.note { display: block; font-size: 12.5px; color: var(--soft); margin: 10px 0 0; }
.input.select { padding: 0; }
.input select {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 16px; color: var(--ink); padding: 0 40px 0 16px; cursor: pointer;
  appearance: none; -webkit-appearance: none;
}
.input.select::after {
  content: ""; position: absolute; right: 18px; top: 50%; width: 7px; height: 7px; pointer-events: none;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: translateY(-70%) rotate(45deg);
}
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }


/* Results (black card) */
.result {
  background: var(--dark); color: #fff; border-radius: 18px; padding: 30px 32px 30px;
  box-shadow: 0 24px 48px rgba(16, 24, 40, .22), 0 4px 12px rgba(16, 24, 40, .12);
}
.result p { margin: 0; }
.lead { font-size: 14px; line-height: 1.6; color: #c9ccd0; }

.split { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--dark-line); }
.split.three { grid-template-columns: repeat(3, 1fr); margin-top: 8px; }
.split > div { padding: 22px 0 18px; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; }
.split > div + div { border-left: 1px solid var(--dark-line); padding-left: 20px; }
.stat-k { font-size: 12.5px; color: #c9ccd0; margin: 0 0 6px !important; }
.stat-v { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; min-height: 1.2em; }

.al-note { font-size: 12.5px; line-height: 1.6; color: var(--dark-muted); padding: 14px 0; border-bottom: 1px solid var(--dark-line); }
.al-note[hidden] { display: none; }

.pill {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; letter-spacing: .04em;
  padding: 6px 12px 6px 11px; border-radius: 999px;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.pill.under { background: rgba(52, 211, 153, .13); color: var(--green-ink); }
.pill.over { background: rgba(248, 113, 113, .15); color: var(--red); }

.statements { display: grid; gap: 10px; padding-top: 22px; font-size: 15px; font-weight: 500; line-height: 1.5; color: #e3e5e8; }

/* Chart */
.chart-card { padding: 16px; }
#chart { display: block; width: 100%; height: auto; }
.c-title { font-size: 18px; font-weight: 600; fill: var(--ink); }
.c-tick { font-size: 12px; fill: #4d5257; }
.c-axis { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; fill: #4d5257; }
.c-grid { stroke: var(--line); stroke-width: 1; }
.c-line { stroke-width: 3; stroke-dasharray: 10 6; }
.c-label { font-size: 14px; font-weight: 700; fill: #fff; stroke: #191919; stroke-width: 4px; stroke-linejoin: round; paint-order: stroke; }
.c-label.dark { fill: var(--ink); stroke: #fff; }

/* Footer */
footer { padding: 56px 0 40px; }
.disclaimer { border-top: 1px solid #dcdfe3; padding-top: 28px; max-width: 820px; }
footer p { font-size: 12.5px; line-height: 1.6; color: #5a5f65; margin: 0 0 10px; }
footer .copy { margin-top: 18px; color: var(--soft); }

@media (max-width: 800px) {
  .wrap { padding: 0 16px; }
  .banner-in { flex-direction: column; align-items: flex-start; gap: 14px; padding: 22px 16px 26px; }
  .banner-name { font-size: 34px; }
  .banner-sub { font-size: 10px; letter-spacing: .1em; }
  .banner-tag { font-size: 14px; border-left: 0; padding: 0; }
  h1 { font-size: 38px; margin: 40px 0 28px; }
  .grid { grid-template-columns: 1fr; }
  /* One column: fields, results, then the chart. */
  .col { display: contents; }
  .result { order: 1; }
  .chart-card { order: 2; }
  .card, .result { padding: 24px 20px; }
  .chart-card { padding: 12px; }
  .row { grid-template-columns: 1fr; gap: 22px; }
}

@media (max-width: 480px) {
  .split.three > div + div { padding-left: 12px; }
  .stat-v { font-size: 26px; }
}
