:root {
  --bg: #0f2f4a;
  --surface: #0e151d;
  --surface-alt: #111a24;
  --text: #e6edf5;
  --accent: #d9781f;
  --accent-dark: #b35f14;
  --border: #2e3f51;
  --mint: #ffcf9f;
  --warm: #f3a561;
  --danger: #ca0200;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif; background: radial-gradient(130% 95% at 50% 100%, rgba(22, 49, 90, 0.78) 0%, rgba(10, 19, 34, 0.58) 36%, rgba(0, 0, 0, 0) 70%), #000000; background-attachment: fixed; color: var(--text); padding-bottom: 0; }
.app-shell { max-width: 1050px; margin: 0 auto; padding: 1.1rem 1rem 6.2rem; min-height: 100dvh; display: flex; flex-direction: column; }
.hero { background: #000000; color: #ffffff; padding: 1.4rem; border-radius: 16px; margin-bottom: 2rem; }
.hero-brand { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; min-height: 120px; }
.hero-logo {
  width: clamp(160px, 22vw, 260px);
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}
.brand-name { margin: 0; font-size: clamp(1.2rem, 2.6vw, 1.8rem); font-weight: 800; text-align: center; color: #ffffff; }
.tagline { margin: 0; color: var(--mint); font-size: 1.4rem; font-style: italic; text-align: center; }

.calculator-title {
  margin: .2rem 0 0;
  color: #ffffff;
  font-size: clamp(1.45rem, 3.2vw, 2.15rem);
  font-weight: 800;
  text-align: center;
}

.calculator-tagline {
  margin: .2rem 0 0;
  color: var(--mint);
  font-size: clamp(1rem, 2.2vw, 1.3rem);
  font-style: italic;
  text-align: center;
}

.home-button {
  margin-top: .35rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .15rem;
  line-height: 1.1;
  padding: .48rem .8rem .52rem;
}

.home-icon {
  font-size: 1rem;
}

.home-label {
  font-size: .73rem;
  font-weight: 700;
}
.card-grid { display: grid; gap: 1rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1rem; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25); }
.card h2, .card h3 { margin-top: 0; color: #d9e8ff; }
.card h2 { border-bottom: 2px solid var(--warm); padding-bottom: .25rem; }
.field-row { display: grid; grid-template-columns: 1.3fr 1fr; gap: .7rem; align-items: center; margin-bottom: .65rem; }
label { font-weight: 600; color: #d6e2f0; }

.label-with-action { display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.label-with-action .secondary { padding: .35rem .65rem; font-size: .82rem; }
input[type="number"], input[type="text"], select { width: 100%; max-width: 16rem; padding: .62rem .7rem; border: 1px solid #51667c; border-radius: 10px; background: #0a1018; color: #e8eef6; }
input[type="number"] { text-align: right; }
.numeric-formatted { text-align: right; }
.radio-set { display: flex; gap: .9rem; flex-wrap: wrap; }
.radio-set label { font-weight: 500; }
.stack { border-left: 3px solid var(--mint); padding-left: .9rem; }
.fixed-costs-header { display: flex; align-items: center; gap: .55rem; margin-bottom: .55rem; }
.fixed-costs-header label { font-weight: 700; }
.fixed-cost-row { display: grid; grid-template-columns: 1.2fr 1fr auto; gap: .6rem; align-items: center; margin-bottom: .5rem; }
.fixed-cost-row input { max-width: 100%; }
.remove-fixed-cost { background: #ffe7e3; color: var(--danger); padding: .48rem .7rem; }
.remove-compliance-cost { background: #ffe7e3; color: var(--danger); padding: .48rem .7rem; }
.fixed-costs-actions { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; margin-bottom: .7rem; }
.fixed-costs-total { font-weight: 600; }
.fixed-costs-total strong { color: var(--accent); }
.hidden { display: none !important; }
.actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .65rem;
  margin-top: .2rem;
}

#downloadPdfReport {
  min-width: 220px;
}

.actions.calculated #downloadPdfReport {
  background: var(--accent);
  border-color: var(--accent-dark);
  color: #ffffff;
}

.actions.calculated #downloadPdfReport:hover {
  background: var(--accent-dark);
}

.csv-actions {
  display: flex;
  justify-content: center;
  gap: .8rem;
  flex-wrap: wrap;
}
button { border: 0; border-radius: 10px; padding: .68rem 1rem; font-weight: 700; cursor: pointer; }
.primary { background: var(--accent); color: white; }
.primary:hover { background: var(--accent-dark); }
.primary:disabled { background: #94a3b8; cursor: not-allowed; }
.primary:disabled:hover { background: #94a3b8; }
.secondary { background: #1a2735; color: #dce7f4; border: 1px solid #31465b; }
.results { background: var(--surface-alt); }
.metric { display: flex; justify-content: space-between; padding: .35rem 0; border-bottom: 1px dashed #7a8692; }
.metric strong { color: var(--accent); }
.input-with-help { display: flex; gap: .45rem; align-items: center; }
.help-btn { width: 34px; padding: 0; border-radius: 50%; background: var(--mint); color: var(--bg); font-weight: 800; }
.help-note { margin-top: 0; color: #9db1c6; }
.benchmark-action-row { margin: .35rem 0 .6rem; }

summary { cursor: pointer; font-weight: 700; margin-bottom: .8rem; }
.nested-advanced { margin: .8rem 0; padding: .7rem; border: 1px solid var(--border); border-radius: 10px; background: #101923; }
.nested-advanced > summary { margin-bottom: .7rem; }
#warningsCard ul { margin: 0; padding-left: 1.1rem; color: var(--danger); }
dialog { border: 1px solid var(--border); border-radius: 12px; max-width: 450px; background: #0f1721; color: #e6edf5; }


.landing-card {
  background: rgba(10, 17, 25, 0.86);
  border: 1px solid #2d3f52;
  border-radius: 16px;
  padding: 1.05rem .95rem;
  text-align: center;
  width: fit-content;
  max-width: calc(100vw - 2rem);
  display: flex;
  flex-direction: column;
  gap: .6rem;
  justify-content: center;
  align-items: center;
  margin: .3rem auto auto;
  z-index: 70;
}

.landing-intro {
  margin: 0 0 1rem;
  font-size: 1.08rem;
  color: #d4e0ec;
}

.landing-cta {
  font-size: 1.04rem;
  padding: .9rem 1.25rem;
  width: 100%;
  max-width: 360px;
  min-height: 56px;
  text-align: center;
}


.contact-footer {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: max(env(safe-area-inset-bottom), .45rem);
  z-index: 90;
}

.contact-icons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .85rem;
}

.bar-contact {
  display: flex;
  align-items: center;
  gap: .55rem;
}

.contact-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: #1a2735;
  border: 1px solid #31465b;
  color: #dce7f4;
  cursor: pointer;
  text-decoration: none;
}

.contact-icon svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.contact-icon:hover {
  background: #26384b;
}

.phone-popup {
  margin: 0;
  color: #ffd9b7;
  font-weight: 700;
  font-size: .84rem;
}

#calculatorNoticeDialog p {
  line-height: 1.45;
}

.dialog-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
  gap: .55rem;
}

.bottom-action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  background: rgba(31, 59, 81, 0.96);
  border-top: 1px solid #7a8692;
  backdrop-filter: blur(8px);
  padding: .85rem 1rem;
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  align-items: center;
}

.bottom-action-summary {
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  min-width: 320px;
}

.summary-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #ffd9b7;
}

#stickyRateValue {
  font-size: 1.05rem;
  color: #ffffff;
}



.calculator-open .hero {
  margin-bottom: .35rem;
  padding-bottom: .6rem;
}

.calculator-open .hero-brand {
  gap: .12rem;
  min-height: 0;
}

.calculator-open .hero-logo {
  width: clamp(260px, 38vw, 420px);
  margin-bottom: -.85rem;
}

.calculator-open .calculator-title {
  margin-top: 0;
}

.calculator-open .calculator-tagline {
  margin-top: .05rem;
}

.calculator-open .brand-name {
  display: none;
}

.contact-footer {
  width: 100%;
  max-width: 1050px;
  padding: 0 1rem;
}

body:not(.calculator-open) {
  overflow: hidden;
}

body:not(.calculator-open) .app-shell {
  justify-content: flex-start;
}

body:not(.calculator-open) .hero {
  margin-bottom: .9rem;
}

body:not(.calculator-open) .landing-card {
  margin-top: .1rem;
  margin-bottom: auto;
}

@media (max-width: 800px) {
  .field-row, .fixed-cost-row { grid-template-columns: 1fr; }
  .bottom-action-bar {
    justify-content: space-between;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: .75rem;
  }
  .bar-contact { gap: .35rem; }
  .bottom-action-summary {
    min-width: 0;
    flex: 1 1 100%;
  }
  .gst-reminder {
    margin: 0;
    overflow-wrap: anywhere;
  }
  #calculateRateBtn {
    width: 100%;
  }
  .csv-actions {
    width: 100%;
    flex-direction: column;
  }
  .contact-footer { bottom: max(env(safe-area-inset-bottom), .35rem); }
}

.inline-link {
  background: transparent;
  color: var(--accent);
  padding: 0;
  border-radius: 0;
  text-decoration: underline;
  font-weight: 700;
}

#costBreakdownDialog {
  max-width: 560px;
}

#costBreakdownBody {
  margin-bottom: .8rem;
}



@media (max-width: 560px) {
  .hero-brand { min-height: 96px; gap: .45rem; }
  .hero-logo { width: clamp(92px, 26vw, 120px); }
  .calculator-open .hero-logo {
    width: clamp(150px, 42vw, 220px);
    margin-bottom: -.55rem;
  }
  .brand-name { font-size: 1.15rem; }
  .tagline { font-size: 1.1rem; }
  .calculator-title { font-size: 1.2rem; }
  .calculator-tagline { font-size: 1rem; }
  .landing-card { max-width: calc(100vw - 1.25rem); }
}

.gst-reminder {
  margin: .25rem 0 0;
  color: #ff4d4d;
  font-size: 1.06rem;
  font-weight: 800;
  line-height: 1.2;
}
