:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #161616;
  background: #f4f4f2;
  line-height: 1.5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
}

button, input { font: inherit; }

.shell {
  width: min(100% - 32px, 680px);
  margin: 0 auto;
  padding: 48px 0;
}

.calculator-card {
  background: #fff;
  border: 1px solid #deded8;
  border-radius: 18px;
  padding: clamp(24px, 5vw, 40px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.06);
}

.intro h1 {
  margin: 4px 0 8px;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.1;
}

.intro p { margin: 0; color: #555; }
.eyebrow { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

form { margin-top: 32px; }
fieldset { border: 0; padding: 0; margin: 24px 0 0; }
legend { font-weight: 700; margin-bottom: 10px; }

.time-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field { display: grid; gap: 7px; }
.field label { font-weight: 650; }

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid #b9b9b2;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

input:focus-visible, button:focus-visible {
  outline: 3px solid #222;
  outline-offset: 2px;
}

.error {
  min-height: 1.5em;
  margin: 16px 0 0;
  color: #9b1c1c;
  font-weight: 650;
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

button {
  min-height: 48px;
  border: 1px solid #222;
  border-radius: 10px;
  padding: 10px 18px;
  background: #222;
  color: #fff;
  cursor: pointer;
}

button.secondary { background: #fff; color: #222; }

.result-panel {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid #deded8;
}

.result-panel h2 { margin: 0 0 12px; }
dl { margin: 0; }
dl > div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid #ecece7;
}
dt { color: #555; }
dd { margin: 0; font-weight: 750; text-align: right; }
.primary-result dd { font-size: 1.4rem; }

.boundary-notice {
  margin: 24px 0 0;
  padding: 14px 16px;
  border-radius: 10px;
  background: #f7f7f4;
  color: #555;
  font-size: 0.9rem;
}

@media (max-width: 520px) {
  .shell { width: min(100% - 20px, 680px); padding: 20px 0; }
  .calculator-card { border-radius: 14px; padding: 22px 18px; }
  .time-grid { grid-template-columns: 1fr; }
  .actions { flex-direction: column; }
  button { width: 100%; }
  dl > div { flex-direction: column; gap: 4px; }
  dd { text-align: left; }
}
