:root {
  --navy: #102f55;
  --navy-deep: #092540;
  --blue: #0877d1;
  --blue-bright: #0b84e5;
  --blue-soft: #eef7ff;
  --green: #84bd00;
  --green-dark: #6ca000;
  --ink: #172433;
  --muted: #69798c;
  --line: #dce5ee;
  --surface: #ffffff;
  --canvas: #f3f7fa;
  --shadow: 0 18px 45px rgba(16, 47, 85, 0.1);
}

* { box-sizing: border-box; }

[ng-cloak], .ng-cloak { display: none !important; }

html { min-width: 320px; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 4% 12%, rgba(132, 189, 0, 0.08), transparent 26rem),
    linear-gradient(180deg, #f8fafc 0, var(--canvas) 100%);
  color: var(--ink);
  font-family: "DM Sans", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.topbar {
  height: 76px;
  padding: 0 clamp(20px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  background: linear-gradient(106deg, var(--navy-deep), var(--navy) 70%, #174678);
  box-shadow: 0 4px 16px rgba(5, 31, 55, 0.18);
}

.brand { display: inline-flex; align-items: center; gap: 12px; color: white; text-decoration: none; }
.brand-mark { position: relative; width: 36px; height: 35px; display: flex; align-items: flex-end; gap: 3px; transform: skewX(-16deg); }
.brand-mark span { display: block; width: 9px; border-radius: 2px 2px 1px 1px; background: var(--green); }
.brand-mark span:nth-child(1) { height: 18px; }
.brand-mark span:nth-child(2) { height: 27px; }
.brand-mark span:nth-child(3) { height: 35px; background: #a4d52d; }
.brand-name { font-size: 23px; letter-spacing: -0.9px; line-height: 1; }
.brand-name strong { font-weight: 600; }
.brand-name b { margin-left: 2px; color: #a5d72f; font-weight: 700; }
.topbar-label { color: #cadae8; font-size: 13px; font-weight: 500; letter-spacing: .04em; }

.page-shell { width: min(1160px, calc(100% - 40px)); margin: 0 auto; padding: 54px 0 42px; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 25px; }
.eyebrow { margin: 0 0 8px; color: var(--green-dark); font-size: 12px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
h1 { margin: 0; color: var(--navy); font-size: clamp(30px, 4vw, 43px); line-height: 1.08; letter-spacing: -1.5px; }
.intro p:last-child { margin: 12px 0 0; color: var(--muted); font-size: 16px; }

.clear-button {
  min-height: 42px;
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #cbd7e2;
  border-radius: 9px;
  color: #3f5367;
  background: white;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .18s, color .18s, box-shadow .18s, transform .18s;
}
.clear-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.clear-button:hover:not(:disabled) { border-color: #97adc1; color: var(--navy); box-shadow: 0 5px 14px rgba(16,47,85,.08); transform: translateY(-1px); }
.clear-button:disabled { opacity: .48; cursor: not-allowed; }

.calculator-card { overflow: hidden; border: 1px solid rgba(202, 215, 227, .82); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.input-panel { padding: 29px 32px 27px; border-bottom: 1px solid var(--line); background: linear-gradient(105deg, #fff, #f9fbfd); }
.input-panel label { display: block; margin-bottom: 9px; color: var(--navy); font-size: 14px; font-weight: 700; }
.price-input { width: min(410px, 100%); height: 58px; display: flex; align-items: center; border: 1.5px solid #b9c8d6; border-radius: 10px; background: white; transition: border-color .18s, box-shadow .18s; }
.price-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(8, 119, 209, .12); }
.price-input > span { padding-left: 17px; color: #6f8193; font-size: 23px; font-weight: 500; }
.price-input input { width: 100%; height: 100%; padding: 0 18px 0 8px; border: 0; outline: 0; color: var(--navy-deep); background: transparent; font-size: 25px; font-weight: 700; letter-spacing: .01em; }
.price-input input::placeholder { color: #aebbc7; }
.input-panel > p { margin: 8px 0 0; color: #8190a0; font-size: 12px; }

.empty-state { min-height: 305px; padding: 48px 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-icon { width: 66px; height: 66px; margin-bottom: 16px; display: grid; place-items: center; border-radius: 50%; color: #6c91b3; background: #eef5fa; }
.empty-icon svg { width: 31px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.empty-state strong { color: var(--navy); font-size: 17px; }
.empty-state span { margin-top: 5px; color: var(--muted); font-size: 14px; }

.results { padding: 27px 32px 32px; }
.results-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 19px; }
.results h2 { margin: 0; color: var(--navy); font-size: 19px; }
.results-heading p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.live-dot { display: inline-flex; align-items: center; gap: 7px; color: #5f7182; font-size: 12px; font-weight: 600; }
.live-dot i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(132,189,0,.13); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 11px; }
table { width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 0; }
th, td { padding: 0; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
th:last-child, td:last-child { border-right: 0; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
thead th { height: 58px; padding: 0 15px; color: #506478; background: #f3f7fa; font-size: 12px; font-weight: 700; line-height: 1.18; text-align: left; text-transform: uppercase; letter-spacing: .035em; }
thead th:first-child { width: 110px; text-align: center; }
thead th small { display: block; margin-top: 3px; color: #8898a8; font-size: 10px; font-weight: 500; text-transform: none; letter-spacing: 0; }
tbody th { padding: 9px 13px; background: #fbfcfd; text-align: center; }
.margin-badge { min-width: 54px; padding: 6px 10px; display: inline-block; border: 1px solid #d6e1ea; border-radius: 999px; color: var(--navy); background: white; font-size: 13px; font-weight: 700; }
.copy-cell { width: 100%; min-height: 55px; padding: 0 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 0; color: white; background: var(--blue); cursor: pointer; transition: background .16s, box-shadow .16s; }
.copy-cell.primary { background: #075fa9; }
.copy-cell span { margin-left: auto; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.copy-cell svg { width: 17px; flex: 0 0 auto; fill: none; stroke: rgba(255,255,255,.68); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: translateX(-4px); transition: opacity .16s, transform .16s; }
.copy-cell:hover, .copy-cell:focus-visible { background: var(--blue-bright); box-shadow: inset 0 0 0 2px rgba(255,255,255,.3); outline: none; }
.copy-cell.primary:hover, .copy-cell.primary:focus-visible { background: #0874c9; }
.copy-cell:hover svg, .copy-cell:focus-visible svg { opacity: 1; transform: translateX(0); }
.copy-cell:active { filter: brightness(.92); }
.mobile-hint { display: none; }

.privacy-note { margin: 22px 0 0; display: flex; align-items: center; justify-content: center; gap: 8px; color: #7a8998; font-size: 12px; }
.privacy-note svg { width: 17px; fill: none; stroke: var(--green-dark); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 5; min-width: 265px; padding: 13px 16px; display: flex; align-items: center; gap: 11px; border-radius: 11px; color: white; background: #102f55; box-shadow: 0 14px 35px rgba(5,31,55,.3); opacity: 0; pointer-events: none; transform: translateY(15px); transition: opacity .2s, transform .2s; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast-check { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; color: var(--navy); background: #a3d62c; font-size: 14px; font-weight: 800; }
.toast > span:last-child { display: flex; flex-direction: column; }
.toast strong { font-size: 13px; }
.toast small { margin-top: 2px; color: #cbd9e5; font-size: 11px; }

@media (max-width: 720px) {
  .topbar { height: 68px; padding: 0 20px; }
  .topbar-label { display: none; }
  .page-shell { width: min(100% - 24px, 1160px); padding-top: 34px; }
  .intro { align-items: flex-start; }
  .intro p:last-child { max-width: 92%; font-size: 14px; }
  .clear-button { min-width: 42px; padding: 0 11px; font-size: 0; }
  .clear-button svg { width: 19px; }
  .calculator-card { border-radius: 13px; }
  .input-panel, .results { padding: 23px 19px; }
  .results-heading { align-items: flex-start; }
  .live-dot { margin-top: 5px; }
  .mobile-hint { margin: 11px 0 0; display: block; color: #7c8c9b; font-size: 11px; text-align: center; }
  .toast { right: 12px; bottom: 12px; left: 12px; min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
