.estimate-page {
  --estimate-ink: #17374a;
  --estimate-accent: #006785;
  --estimate-muted: #465e6d;
  --estimate-line: #cfe3eb;
  padding-block: clamp(22px, 4vw, 48px) 58px;
  color: var(--estimate-ink);
  overflow-wrap: anywhere;
}

.estimate-intro {
  background: linear-gradient(122deg, #f1fbff 12%, #dbf3fb 74%, #c3ecf8);
  border: 1px solid var(--estimate-line);
  border-radius: 22px;
  padding: clamp(20px, 4.2vw, 45px);
  margin-bottom: 22px;
}

.estimate-intro h1 {
  max-width: 21ch;
  font-size: clamp(34px, 5.1vw, 58px);
  letter-spacing: -.053em;
}

.estimate-intro p {
  max-width: 62ch;
  margin-top: 14px;
  font-size: clamp(15px, 1.55vw, 18px);
  color: var(--estimate-muted);
}

.estimate-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 21px;
}

.estimate-modes :is(a, button) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 18px;
  border-radius: 9px;
  border: 1px solid #97bdcc;
  background: white;
  color: var(--estimate-accent);
  font-weight: 800;
  cursor: pointer;
}

.estimate-modes :is([aria-current], [aria-pressed="true"]) {
  color: white;
  background: var(--estimate-accent);
  border-color: var(--estimate-accent);
}

.estimate-modes :is(a, button):not([aria-current], [aria-pressed="true"]):hover { background: #edfaff; }
.estimate-modes .dark-mode-link { background: transparent; margin-inline-start: auto; }
.nav a[aria-current="page"] { color: var(--accent); }

.estimate-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(15px, 2.1vw, 26px);
}

.estimate-form, .estimate-items { display: grid; gap: 15px; }
.estimate-aside { display: grid; gap: 13px; }

.estimate-card {
  padding: clamp(15px, 2.25vw, 24px);
  border: 1px solid var(--estimate-line);
  border-radius: 15px;
  background: white;
}

.estimate-card h2, .estimate-result h2, .estimate-card summary, .legal-section h2 {
  text-wrap: initial;
  font-size: clamp(18px, 2.05vw, 23px);
  letter-spacing: -.02em;
  font-weight: 800;
}

.estimate-card summary { cursor: pointer; padding-block: 5px; }
.estimate-card summary::marker { color: var(--estimate-accent); }
.estimate-card p + p { margin-top: 10px; }

.quick-method summary { font-size: 16px; }
.quick-method .detail-pairs { margin-top: 7px; }
.quick-action { margin-top: 16px; }
#quick-price:focus-visible { outline: 2px solid var(--calculate-background); outline-offset: 4px; }

.section-title {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  justify-content: space-between;
  align-items: center;
  min-height: 34px;
}

.field-help {
  color: var(--estimate-muted);
  margin-block: 8px 0;
  font-size: 13px;
  line-height: 1.5;
}

.estimate-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 11px 13px;
  margin-top: 14px;
}

.estimate-fields label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  font-weight: 750;
  font-size: 13px;
  line-height: 1.38;
}

.estimate-fields :is(input, select) {
  width: 100%;
  min-width: 0;
  min-height: 43px;
  border-radius: 7px;
  border: 1px solid #9ebdca;
  padding: 7px 10px;
  color: var(--estimate-ink);
  background-color: white;
  font-size: 16px;
  font-weight: 550;
}

.estimate-fields :is(input, select):user-invalid {
  border-color: #a53535;
}

.estimate-items:not(:empty) { margin-top: 14px; }

.estimate-item {
  min-width: 0;
  margin: 0;
  border: 1px solid #daeaf0;
  border-radius: 11px;
  background: #f5fbfd;
  padding: 13px 13px 9px;
}

.estimate-item > .estimate-fields { margin-top: 0; }
.shift-duration { font-weight: 750; }
.region-pay { margin-top: 14px; padding: 12px 14px; background: #f1f9fc; border-radius: 10px; }
.region-pay > summary { font-size: 15px; }
.region-pay .source-link { color: var(--estimate-accent); text-decoration: underline; }
.market-button { margin: 4px 14px 0 0; }
.estimate-item .role-settings { margin-top: 10px; }
.estimate-item .role-settings summary { font-size: 13px; letter-spacing: 0; color: var(--estimate-accent); }
.estimate-item .role-settings .estimate-fields { margin-block: 8px; }

.plain-button {
  border: 0;
  padding: 6px 1px;
  background: transparent;
  color: var(--estimate-accent);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  min-height: 38px;
}

.plain-button:hover, .estimate-contact:hover, .legal-back:hover { text-decoration: underline; text-underline-offset: 3px; }
.plain-button:disabled { cursor: default; color: var(--estimate-muted); opacity: .6; text-decoration: none; }
.remove-item { margin-top: 4px; }
.add-item { margin-top: 7px; }

.estimate-result {
  background: #103c52;
  border-radius: 17px;
  padding: clamp(18px, 2.4vw, 28px);
  color: white;
}

.estimate-result h2 { color: #e3f4fa; font-size: 16px; }
.estimate-total {
  margin-top: 9px;
  font-size: clamp(26px, 3.3vw, 45px);
  font-weight: 800;
  letter-spacing: -.05em;
  line-height: 1.15;
}

.estimate-caption { margin-top: 4px; font-size: 13px; color: #d8edf5; }
.result-pairs { margin-block: 18px 14px; }
.result-pairs div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  align-items: baseline;
  gap: 6px 12px;
  padding-block: 7px;
  border-top: 1px solid #507488;
}
.result-pairs dt { color: #e3f4fa; }
.result-pairs dd { margin: 0; font-weight: 800; text-align: right; }

.pdf-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  padding: 8px 16px;
  background: #b7ebf7;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #103c52;
  font-weight: 800;
  cursor: pointer;
}

.pdf-button:hover { background: #d4f4fa; }
.pdf-button:disabled { opacity: .61; cursor: default; }
.pdf-button:focus-visible { outline-color: #42c2dc; }
.estimate-contact { display: inline-flex; align-items: center; min-height: 40px; font-weight: 750; }
.estimate-status { font-size: 13px; color: #ecf7fa; }
.estimate-status:not(:empty) { margin-top: 8px; }
.result-note { margin: 0 0 12px; }
.estimate-alert { padding: 11px 14px; border-radius: 8px; background: #fff4da; color: #684505; }

.estimate-breakdown { padding-block: 17px; }
.estimate-breakdown h2 { font-size: 19px; }
#breakdown-rows { margin-top: 11px; }
.breakdown-line { border-top: 1px solid var(--estimate-line); }
.breakdown-line > summary { font-size: 14px; letter-spacing: 0; }
.breakdown-label {
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  align-items: baseline;
  width: calc(100% - 19px);
  gap: 5px 9px;
  vertical-align: middle;
  padding-block: 5px;
}
.breakdown-value { text-align: right; font-variant-numeric: tabular-nums; color: var(--estimate-accent); }
.line-detail { padding-block: 8px 12px; }
.line-detail + .line-detail { border-top: 1px dashed var(--estimate-line); }
.line-detail h3 { font-size: 14px; letter-spacing: 0; }
.line-detail p { margin: 3px 0; }
.detail-pairs { margin: 4px 0 0; font-size: 13px; }
.detail-pairs div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  gap: 4px 9px;
  padding-block: 3px;
}
.detail-pairs dt { color: var(--estimate-muted); }
.detail-pairs dd { margin: 0; text-align: right; font-weight: 750; font-variant-numeric: tabular-nums; }

.calendar-card, .method-card { margin-top: 17px; }
.estimate-table-scroll { overflow-x: auto; margin-top: 10px; }
.estimate-table { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
.estimate-table :is(td, th) { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--estimate-line); }
.estimate-table th { background: #eef9fd; }
.estimate-table tbody td { white-space: nowrap; }
.method-card p { margin-top: 10px; max-width: 89ch; }
.source-links { font-size: 13px; }
.source-links a, .legal-back { color: var(--estimate-accent); text-decoration: underline; text-underline-offset: 2px; }
.source-links li + li { margin-top: 5px; }

.legal-intro h1 { max-width: none; }
.legal-return { width: fit-content; margin-top: 20px; }
.legal-section { display: grid; gap: 13px; width: min(100%, 860px); margin: 27px auto 0; }
.legal-card h3 { margin-bottom: 8px; font-size: 19px; letter-spacing: -.02em; }
.legal-back { margin-top: 3px; font-weight: 800; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

@media (max-width: 920px) {
  .estimate-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 440px) {
  .estimate-intro h1 { font-size: 32px; }
  .estimate-fields { grid-template-columns: minmax(0, 1fr); }
  .estimate-modes :is(a, button) { padding-inline: 11px; font-size: 13px; }
  .estimate-modes .dark-mode-link { margin-inline-start: 0; }
  .estimate-item { padding-inline: 11px; }
}

@media (min-width: 360px) and (max-width: 440px) {
  #quick-form .estimate-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
