:root {
  font-family: system-ui, sans-serif;
  color: #172c3d;
  background: #f1f4f7;
  line-height: 1.5;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
body:has(#home:not([hidden])) {
  min-height: 100vh;
  background-image:
    linear-gradient(rgb(241 244 247 / 92%), rgb(241 244 247 / 92%)),
    url("../assets/homeBG.jpg");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
main {
  max-width: 1080px;
  margin: auto;
  padding: 32px 20px;
}
h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0;
}
h2 {
  margin-top: 32px;
}
.eyebrow {
  color: #356078;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.8rem;
}
.unit-note {
  border-left: 4px solid #35788f;
  padding: 12px 16px;
  background: #e3eef3;
}
.input-grid,
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
fieldset,
.result-card {
  min-width: 0;
  border: 1px solid #bbcbd5;
  border-radius: 10px;
  padding: 20px;
  background: white;
}
legend {
  font-weight: 700;
  padding: 0 6px;
}
label {
  display: block;
  margin: 12px 0 5px;
  font-weight: 600;
}
input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 1px solid #8397a6;
  border-radius: 5px;
  padding: 9px 12px;
  font: inherit;
}
button {
  min-height: 46px;
  padding: 10px 16px;
  border: 1px solid #16566c;
  border-radius: 5px;
  background: #16566c;
  color: white;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
button:hover {
  background: #0e4052;
}
button.secondary {
  background: white;
  color: #16566c;
}
button.secondary:hover {
  background: #e3eef3;
}
:focus-visible {
  outline: 3px solid #b35b00;
  outline-offset: 3px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.calculation-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin: 24px 0;
}
.custom {
  max-width: 600px;
}
.custom .actions input {
  flex: 1;
  width: 180px;
}
#storage-status,
#angle-help,
footer {
  font-size: 0.9rem;
  color: #425b6c;
}
#error {
  color: #9a2525;
  font-weight: 600;
}
#error:empty {
  display: none;
}
.result-card {
  border-top: 4px solid #35788f;
}
.result-card h3 {
  margin: 0;
  font-size: 1.4rem;
}
dl {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  gap: 10px;
}
dt {
  font-weight: 700;
}
dd {
  margin: 0;
  font:
    1.2rem ui-monospace,
    monospace;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
footer {
  margin-top: 28px;
}
@media (max-width: 600px) {
  main {
    padding: 20px 14px;
  }
  .input-grid,
  .cards {
    grid-template-columns: 1fr;
  }
  .actions button {
    flex-grow: 1;
  }
}

[hidden] {
  display: none !important;
}
#tool-home {
  margin-bottom: 24px;
}
.tool-choice {
  text-align: left;
  padding: 24px;
}
.tool-choice strong,
.tool-choice span {
  display: block;
}
.tool-choice strong {
  font-size: 1.3rem;
}
.tool-choice span {
  margin-top: 8px;
  font-weight: 400;
}
.card-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}
.coordinate-name {
  font-size: 1.4rem;
  overflow-wrap: anywhere;
  min-width: 0;
}
.name-toggle {
  margin-left: auto;
  min-width: 46px;
  flex-shrink: 0;
}
.name-editor {
  max-width: 100%;
}
.name-editor input {
  max-width: calc(100% - 26px);
  box-sizing: content-box;
  font-weight: 700;
}
#drill-search {
  max-width: 320px;
}
.true-position-form {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 360px);
  align-items: start;
  gap: 24px;
}
.true-position-inputs,
#tp-results {
  min-width: 0;
}
@media (max-width: 600px) {
  .true-position-form {
    grid-template-columns: minmax(0, 360px);
    gap: 12px;
  }
}
#tp-results output {
  display: block;
  font-size: 1.4rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
#tp-error {
  color: #9a2525;
}
.drill-chart {
  max-height: 60vh;
  overflow: auto;
  position: relative;
  border: 1px solid #bbcbd5;
  border-radius: 8px;
  background: white;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid #d8e1e7;
}
th {
  position: sticky;
  top: 0;
  background: #e3eef3;
}
tr.highlight {
  background: #fff0c2;
}
tr.highlight td:first-child {
  border-left: 4px solid #b35b00;
  font-weight: 700;
}
@media (max-width: 600px) {
  th,
  td {
    padding: 10px 6px;
  }
}
