:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f7f9;
  color: #19202a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: hidden;
}

.app-header {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(243, 247, 251, 0.98)),
    linear-gradient(90deg, rgba(6, 55, 109, 0.09), transparent 52%);
  border-bottom: 1px solid #d9dee7;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(520px, 1fr) minmax(190px, 240px) auto;
  min-height: 112px;
  padding: 18px clamp(18px, 4vw, 48px);
}

.brand-lockup {
  align-items: center;
  display: flex;
  gap: 20px;
  min-width: 0;
}

.quickcalcs-logo {
  background:
    linear-gradient(135deg, #05294d, #0f6b7a 72%, #7fbf90);
  border-radius: 16px;
  box-shadow: 0 18px 34px rgba(5, 41, 77, 0.22);
  color: #ffffff;
  flex: 0 0 auto;
  height: 76px;
  position: relative;
  width: 76px;
}

.quickcalcs-logo::after {
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 13px;
  content: "";
  inset: 6px;
  position: absolute;
}

.logo-q,
.logo-c {
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
  position: absolute;
  z-index: 1;
}

.logo-q {
  font-size: 2rem;
  left: 13px;
  top: 13px;
}

.logo-c {
  font-size: 1.55rem;
  right: 13px;
  top: 26px;
}

.logo-grid {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.48) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.48) 1px, transparent 1px);
  background-size: 8px 8px;
  bottom: 13px;
  height: 20px;
  left: 14px;
  opacity: 0.72;
  position: absolute;
  width: 27px;
  z-index: 1;
}

.header-actions {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: flex-end;
}

.suite-home-link {
  background: #ffffff;
  border: 1px solid #bdc8d9;
  border-radius: 6px;
  color: #05294d;
  font-weight: 850;
  padding: 9px 11px;
  text-decoration: none;
  white-space: nowrap;
}

.publisher-mark {
  color: #66758a;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  margin-top: 6px;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-subtitle {
  color: #344258;
  font-size: clamp(1.05rem, 1.6vw, 1.28rem);
  font-weight: 800;
  letter-spacing: 0;
  margin: 4px 0 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  color: #05294d;
  font-size: clamp(2.45rem, 4.4vw, 3.9rem);
  letter-spacing: 0;
  line-height: 0.95;
  margin-bottom: 0;
  white-space: nowrap;
}

.header-visual {
  align-items: center;
  align-self: stretch;
  display: grid;
  gap: 10px;
  grid-template-columns: 76px minmax(96px, 1fr);
  min-height: 64px;
}

.visual-card,
.visual-chart {
  border: 1px solid #d3deeb;
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(24, 47, 79, 0.1);
  height: 64px;
}

.visual-card {
  background: #ffffff;
  display: grid;
  gap: 7px;
  padding: 12px;
}

.visual-card-primary {
  border-left: 5px solid #0f6b7a;
}

.visual-line {
  background: #c8d6e6;
  border-radius: 999px;
  display: block;
  height: 7px;
  width: 82%;
}

.visual-line.short {
  width: 56%;
}

.visual-total {
  align-self: end;
  color: #05294d;
  font-size: 1.25rem;
  font-weight: 900;
}

.visual-chart {
  align-items: end;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(237, 246, 248, 0.96)),
    linear-gradient(90deg, transparent 0 24%, rgba(15, 107, 122, 0.08) 24% 25%, transparent 25% 49%, rgba(15, 107, 122, 0.08) 49% 50%, transparent 50% 74%, rgba(15, 107, 122, 0.08) 74% 75%, transparent 75%);
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 10px 12px;
}

.visual-chart span {
  background: linear-gradient(180deg, #0f6b7a, #7fbf90);
  border-radius: 5px 5px 2px 2px;
  display: block;
  width: 11px;
}

@media (max-width: 1180px) {
  .app-header {
    grid-template-columns: minmax(440px, 1fr) minmax(150px, 190px) auto;
  }

  .header-visual {
    grid-template-columns: 1fr;
  }

  .visual-card {
    display: none;
  }
}

.language-control {
  align-items: center;
  display: flex;
  gap: 8px;
}

.language-control span {
  color: #344258;
  font-size: 0.9rem;
  font-weight: 700;
}

.layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: calc(100vh - 93px);
}

.calc-nav {
  background: #202938;
  padding: 16px;
}

.nav-item {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #d8e0ed;
  cursor: pointer;
  display: block;
  font: inherit;
  margin-bottom: 6px;
  padding: 12px;
  text-align: left;
  width: 100%;
}

.nav-item.active,
.nav-item:hover {
  background: #ffffff;
  color: #202938;
}

.category-nav {
  color: #f0ddb6;
}

.nav-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin: 12px 0;
}

.workspace {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(300px, 520px) minmax(360px, 1fr);
  padding: clamp(18px, 4vw, 36px);
}

.calc-form,
.results,
.landing-panel {
  background: #ffffff;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  min-width: 0;
  padding: 20px;
}

.landing-panel {
  grid-column: 1 / -1;
  padding: 0;
}

.hidden {
  display: none;
}

.quickcalcs-landing {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 34%);
  min-height: 430px;
}

.landing-copy {
  padding: clamp(22px, 4vw, 36px);
}

.landing-copy h2 {
  color: #06376d;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1.1;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.landing-copy p {
  color: #111827;
  font-size: 1rem;
  line-height: 1.45;
  margin-bottom: 24px;
  max-width: 760px;
}

.landing-visual {
  background: #003366;
  overflow: hidden;
}

.landing-visual img {
  display: block;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  width: 100%;
}

.category-list {
  display: grid;
  gap: 14px;
}

.category-card {
  align-items: flex-start;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: inherit;
  cursor: pointer;
  display: grid;
  font: inherit;
  gap: 10px;
  grid-template-columns: 24px minmax(0, 1fr);
  padding: 6px;
  text-align: left;
}

.category-card:hover,
.category-card:focus {
  background: #f0f5ff;
  outline: 3px solid #d9e7ff;
}

.category-card strong {
  color: #06376d;
  display: block;
  font-size: 1.25rem;
  line-height: 1.05;
  text-transform: uppercase;
}

.category-card small {
  color: #111827;
  display: block;
  font-size: 0.95rem;
  line-height: 1.35;
  margin-top: 3px;
}

.sales-grid {
  border-top: 1px solid #d9dee7;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 26px;
  padding-top: 18px;
}

.sales-grid article {
  background: #f6f7f9;
  border-radius: 6px;
  padding: 14px;
}

.sales-grid strong {
  color: #06376d;
  display: block;
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.sales-grid p {
  color: #5c6a7c;
  font-size: 0.9rem;
  line-height: 1.35;
  margin: 0;
}

.secondary-action {
  background: transparent;
  border: 1px solid #bbc5d3;
  border-radius: 6px;
  color: #344258;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 14px;
  padding: 8px 10px;
}

.category-kicker {
  align-items: center;
  color: #4b627f;
  display: flex;
  font-size: 0.8rem;
  font-weight: 800;
  gap: 8px;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.category-symbol {
  background: #e9f2f8;
  border: 1px solid #c7d6e6;
  border-radius: 7px;
  display: inline-block;
  height: 25px;
  position: relative;
  width: 25px;
}

.category-symbol::before,
.category-symbol::after {
  content: "";
  position: absolute;
}

.category-symbol::before {
  border-bottom: 2px solid #06376d;
  border-left: 2px solid #06376d;
  height: 10px;
  left: 6px;
  top: 6px;
  transform: skew(-14deg);
  width: 11px;
}

.category-symbol::after {
  background: #0f6b7a;
  border-radius: 999px;
  bottom: 5px;
  height: 4px;
  right: 5px;
  width: 4px;
}

.category-symbol.personal {
  background: #eef1fb;
}

.category-symbol.personal::after {
  background: #4b6fae;
}

.category-symbol.business {
  background: #f7f0dc;
}

.category-symbol.business::after {
  background: #b98b1c;
}

.section-heading p {
  color: #5c6a7c;
  margin-bottom: 18px;
}

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

label {
  color: #344258;
  display: grid;
  font-size: 0.9rem;
  font-weight: 700;
  gap: 6px;
}

input,
select,
textarea {
  border: 1px solid #bbc5d3;
  border-radius: 6px;
  font: inherit;
  padding: 9px 10px;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #2668d9;
  outline: 3px solid #d9e7ff;
}

select {
  background: #ffffff;
  cursor: pointer;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.wide-field {
  grid-column: 1 / -1;
}

.check-field {
  align-items: center;
  display: flex;
  flex-direction: row;
}

.check-field input {
  width: auto;
}

.method-select {
  border: 1px solid #d9dee7;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding: 14px;
}

.method-select label {
  align-items: center;
  display: flex;
  font-weight: 600;
}

.method-select input {
  margin-right: 8px;
  width: auto;
}

.primary-action {
  background: #2668d9;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  margin-top: 18px;
  padding: 11px 16px;
}

.result-summary {
  background: #f0f5ff;
  border: 1px solid #bdd1ff;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 16px;
}

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

.result-grid div {
  min-width: 0;
}

.empty-results {
  color: #5c6a7c;
  margin-bottom: 0;
}

.result-summary span,
.metric-grid span {
  color: #5c6a7c;
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
}

.result-summary strong {
  font-size: 1.5rem;
}

table {
  border-collapse: collapse;
  font-size: 0.92rem;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid #e4e8ef;
  padding: 10px 8px;
  text-align: right;
}

th:first-child,
td:first-child {
  text-align: left;
}

.year-result {
  border-bottom: 1px solid #d9dee7;
  margin-bottom: 22px;
  padding-bottom: 22px;
}

.year-result:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.year-heading {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
}

.metric-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.metric-grid div {
  background: #f6f7f9;
  border-radius: 6px;
  padding: 10px;
}

@media (max-width: 1050px) {
  .layout,
  .workspace {
    grid-template-columns: 1fr;
  }

  .quickcalcs-landing {
    grid-template-columns: 1fr;
  }

  .landing-visual {
    display: none;
  }

  .calc-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .nav-item {
    margin: 0;
    text-align: center;
  }
}

@media (max-width: 720px) {
  .app-header {
    align-items: flex-start;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .quickcalcs-logo {
    border-radius: 12px;
    height: 56px;
    width: 56px;
  }

  .logo-q {
    font-size: 1.45rem;
    left: 10px;
    top: 10px;
  }

  .logo-c {
    font-size: 1.15rem;
    right: 10px;
    top: 19px;
  }

  .logo-grid {
    bottom: 10px;
    height: 15px;
    left: 11px;
    width: 21px;
  }

  .header-visual {
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .header-actions {
    align-items: flex-start;
  }

  .publisher-mark {
    margin-top: 5px;
  }

  .header-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .language-control {
    align-items: flex-start;
    flex-direction: column;
  }

  .field-grid,
  .metric-grid,
  .sales-grid {
    grid-template-columns: 1fr;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
