:root {
    --primary-blue: #0052cc;
    --hero-gradient: linear-gradient(135deg, #0061ff 0%, #0033aa 100%);
    --bg-light: #f8fafc;
    --white: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --transition: all 0.3s ease;
    --success-bg: #ecfdf5;
    --success-text: #047857;
    --warning-bg: #fff7ed;
    --warning-text: #c2410c;
    --danger-bg: #fef2f2;
    --danger-text: #b91c1c;
  }
  
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }
  
  html {
    scroll-behavior: smooth;
    overflow-x: hidden;
  }
  
  body {
    margin: 0;
    font-family: "Inter", sans-serif;
    color: var(--text-main);
    background: var(--white);
    line-height: 1.7;
    overflow-x: hidden;
  }
  
  a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: var(--transition);
  }
  
  a:hover {
    text-decoration: underline;
  }
  
  button,
  input,
  select {
    font: inherit;
  }
  
  button {
    cursor: pointer;
  }
  
  fieldset {
    border: 0;
    margin: 0;
    padding: 0;
  }
  
  table {
    width: 100%;
    border-collapse: collapse;
  }
  
  th,
  td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    vertical-align: top;
  }
  
  th {
    color: var(--text-main);
    background: var(--bg-light);
    font-weight: 800;
  }
  
  td {
    color: var(--text-muted);
  }
  
  .container {
    width: 100%;
    max-width: 1200px;
    padding: 0 16px;
    margin: 0 auto;
  }
  
  .hidden {
    display: none !important;
  }
  
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  
  /* Hero */
  
  .fuel-hero {
    background: var(--hero-gradient);
    color: var(--white);
    padding: 34px 0 38px;
  }
  
  .breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
    font-size: 0.92rem;
  }
  
  .breadcrumb a,
  .breadcrumb span {
    color: rgba(255, 255, 255, 0.92);
  }
  
  .fuel-hero h1 {
    margin: 0;
    color: var(--white);
    font-size: clamp(2.2rem, 5vw, 3.55rem);
    line-height: 1.08;
    letter-spacing: -0.04em;
  }
  
  /* Main layout */
  
  .main-area {
    padding: 42px 0 58px;
    background: var(--bg-light);
  }
  
  .calculator-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: 24px;
    align-items: start;
  }
  
  .calculator-card {
    min-width: 0;
    padding: 28px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow-sm);
  }
  
  .result-card {
    position: sticky;
    top: 18px;
  }
  
  .card-heading {
    display: flex;
    gap: 16px;
    margin-bottom: 22px;
  }
  
  .card-heading h2 {
    margin: 0 0 6px;
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
  }
  
  .card-heading p {
    margin: 0;
    color: var(--text-muted);
  }
  
  .card-icon {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: 16px;
    background: rgba(0, 82, 204, 0.08);
    color: var(--primary-blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.35rem;
  }
  
  /* Calculator controls */
  
  .mode-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 20px;
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-light);
  }
  
  .mode-tab {
    min-height: 44px;
    padding: 10px 8px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.25;
    transition: var(--transition);
  }
  
  .mode-tab:hover,
  .mode-tab.is-active {
    background: var(--white);
    color: var(--primary-blue);
    border-color: rgba(0, 82, 204, 0.18);
    box-shadow: var(--shadow-sm);
  }
  
  .form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  
  .form-group {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
  }
  
  .form-group label {
    font-weight: 800;
  }
  
  .form-group input,
  .form-group select {
    width: 100%;
    min-height: 50px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--white);
    color: var(--text-main);
    font-size: 16px;
  }
  
  .form-group input:focus,
  .form-group select:focus,
  .btn:focus,
  .mode-tab:focus,
  .faq-section summary:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.16);
  }
  
  .calculator-note {
    margin: 0 0 16px;
    padding: 13px 15px;
    border-radius: 10px;
    background: var(--warning-bg);
    color: var(--warning-text);
    font-size: 0.94rem;
    font-weight: 700;
  }
  
  .form-message {
    display: none;
    margin-top: 4px;
    padding: 14px 16px;
    border-radius: 10px;
    font-weight: 800;
  }
  
  .form-message.error {
    display: block;
    color: var(--danger-text);
    background: var(--danger-bg);
  }
  
  .form-message.success {
    display: block;
    color: var(--success-text);
    background: var(--success-bg);
  }
  
  .button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
  }
  
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-weight: 800;
    transition: var(--transition);
  }
  
  .btn-primary {
    color: var(--white);
    background: var(--primary-blue);
    box-shadow: var(--shadow-sm);
  }
  
  .btn-primary:hover {
    background: #003f9e;
    transform: translateY(-1px);
  }
  
  .btn-secondary {
    color: var(--text-main);
    background: var(--white);
    border-color: var(--border-color);
  }
  
  .btn-secondary:hover {
    background: var(--bg-light);
  }
  
  /* Mode visibility */
  
  .field-trip,
  .field-economy,
  .field-cost,
  .field-commute,
  .field-roundtrip {
    display: none;
  }
  
  .mode-trip .field-trip,
  .mode-economy .field-economy,
  .mode-cost .field-cost,
  .mode-commute .field-commute,
  .mode-roundtrip .field-roundtrip {
    display: flex;
  }
  
  .mode-trip .field-trip.field-economy,
  .mode-trip .field-trip.field-cost,
  .mode-trip .field-trip.field-commute,
  .mode-trip .field-trip.field-roundtrip,
  .mode-economy .field-economy.field-trip,
  .mode-economy .field-economy.field-cost,
  .mode-economy .field-economy.field-commute,
  .mode-economy .field-economy.field-roundtrip,
  .mode-cost .field-cost.field-trip,
  .mode-cost .field-cost.field-economy,
  .mode-cost .field-cost.field-commute,
  .mode-cost .field-cost.field-roundtrip,
  .mode-commute .field-commute.field-trip,
  .mode-commute .field-commute.field-economy,
  .mode-commute .field-commute.field-cost,
  .mode-commute .field-commute.field-roundtrip,
  .mode-roundtrip .field-roundtrip.field-trip,
  .mode-roundtrip .field-roundtrip.field-economy,
  .mode-roundtrip .field-roundtrip.field-cost,
  .mode-roundtrip .field-roundtrip.field-commute {
    display: flex;
  }
  
  /* Results */
  
  .results-placeholder {
    text-align: center;
    padding: 44px 18px;
  }
  
  .placeholder-icon {
    width: 84px;
    height: 84px;
    margin: 0 auto 18px;
    border-radius: 999px;
    background: rgba(0, 82, 204, 0.08);
    color: var(--primary-blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.92rem;
  }
  
  .results-placeholder h3 {
    margin: 0 0 10px;
    font-size: 1.35rem;
  }
  
  .results-placeholder p {
    margin: 0;
    color: var(--text-muted);
  }
  
  .mini-label {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--primary-blue);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  
  .results-content h2 {
    margin: 0 0 10px;
    color: var(--primary-blue);
    font-size: clamp(2rem, 4.5vw, 2.9rem);
    line-height: 1.08;
    overflow-wrap: anywhere;
  }
  
  #resultSentence {
    margin: 0 0 18px;
    color: var(--text-muted);
    overflow-wrap: anywhere;
  }
  
  .result-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0;
  }
  
  .result-grid div {
    min-width: 0;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-light);
  }
  
  .result-grid span {
    display: block;
    margin-bottom: 5px;
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 700;
  }
  
  .result-grid strong {
    display: block;
    font-size: 1.05rem;
    overflow-wrap: anywhere;
  }
  
  .breakdown-box {
    margin: 18px 0;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-light);
  }
  
  .breakdown-box strong {
    display: block;
    margin-bottom: 12px;
  }
  
  .table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .result-detail {
    margin-top: 14px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-light);
  }
  
  .result-detail strong {
    display: block;
    margin-bottom: 6px;
  }
  
  .result-detail p {
    margin: 0;
    color: var(--text-muted);
    overflow-wrap: anywhere;
  }
  
  .manual-note {
    background: var(--warning-bg);
    border-color: rgba(194, 65, 12, 0.18);
  }
  
  .manual-note strong {
    color: var(--warning-text);
  }
  
  #warningBox {
    background: var(--danger-bg);
    border-color: rgba(185, 28, 28, 0.18);
  }
  
  #warningBox strong,
  #warningText {
    color: var(--danger-text);
  }
  
  .copy-btn {
    width: 100%;
    margin-top: 16px;
  }
  
  /* Supporting content */
  
  .content-section {
    margin-top: 28px;
    padding: 30px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow-sm);
  }
  
  .content-section h2 {
    margin: 0 0 14px;
    font-size: clamp(1.55rem, 3vw, 2.15rem);
    line-height: 1.18;
    letter-spacing: -0.025em;
  }
  
  .content-section h3 {
    margin: 26px 0 10px;
    font-size: 1.2rem;
    line-height: 1.3;
  }
  
  .content-section p {
    margin: 0 0 16px;
    color: var(--text-muted);
  }
  
  .content-section p:last-child {
    margin-bottom: 0;
  }
  
  .content-list {
    margin: 14px 0 0;
    padding-left: 20px;
    color: var(--text-muted);
  }
  
  .content-list li {
    margin-bottom: 12px;
  }
  
  .content-list li:last-child {
    margin-bottom: 0;
  }
  
  .content-list strong {
    color: var(--text-main);
  }
  
  .formula-box {
    margin: 20px 0;
    padding: 18px;
    border-left: 4px solid var(--primary-blue);
    border-radius: 12px;
    background: rgba(0, 82, 204, 0.06);
  }
  
  .formula-box strong {
    display: block;
    margin-bottom: 6px;
    color: var(--primary-blue);
  }
  
  .formula-box p {
    margin: 0;
    color: var(--text-main);
    font-weight: 700;
  }
  
  .related-section {
    background:
      linear-gradient(180deg, rgba(0, 82, 204, 0.04), rgba(255, 255, 255, 1));
  }
  
  .related-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
  }
  
  .related-grid a {
    display: flex;
    align-items: center;
    min-height: 70px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--white);
    color: var(--text-main);
    font-weight: 800;
    line-height: 1.35;
    box-shadow: var(--shadow-sm);
  }
  
  .related-grid a:hover {
    color: var(--primary-blue);
    border-color: rgba(0, 82, 204, 0.24);
    text-decoration: none;
    transform: translateY(-1px);
  }
  
  /* FAQ */
  
  .faq-section details {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--white);
    overflow: hidden;
  }
  
  .faq-section details + details {
    margin-top: 12px;
  }
  
  .faq-section summary {
    padding: 18px;
    color: var(--text-main);
    font-weight: 800;
    cursor: pointer;
  }
  
  .faq-section details[open] summary {
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-light);
  }
  
  .faq-section details p {
    padding: 18px;
    margin: 0;
  }
  
  /* Better long content tables */
  
  .content-section .table-wrap {
    margin: 18px 0 4px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--white);
  }
  
  .content-section .table-wrap table {
    min-width: 720px;
  }
  
  .content-section .table-wrap th:first-child,
  .content-section .table-wrap td:first-child {
    font-weight: 800;
    color: var(--text-main);
  }
  
  /* Mobile and tablet */
  
  @media (max-width: 1024px) {
    .calculator-layout {
      grid-template-columns: 1fr;
    }
  
    .result-card {
      position: static;
    }
  
    .related-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }
  
  @media (max-width: 820px) {
    .mode-tabs {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  
    .mode-tab:last-child {
      grid-column: 1 / -1;
    }
  
    .form-grid {
      grid-template-columns: 1fr;
      gap: 0;
    }
  
    .card-heading {
      align-items: flex-start;
    }
  }
  
  @media (max-width: 640px) {
    .container {
      padding: 0 14px;
    }
  
    .fuel-hero {
      padding: 28px 0 32px;
    }
  
    .breadcrumb {
      gap: 6px;
      margin-bottom: 18px;
      font-size: 0.84rem;
    }
  
    .fuel-hero h1 {
      font-size: clamp(2rem, 12vw, 2.6rem);
    }
  
    .main-area {
      padding: 28px 0 44px;
    }
  
    .calculator-card,
    .content-section {
      padding: 20px;
    }
  
    .card-heading {
      gap: 12px;
    }
  
    .card-icon {
      width: 48px;
      height: 48px;
      min-width: 48px;
      border-radius: 14px;
    }
  
    .mode-tabs {
      grid-template-columns: 1fr;
    }
  
    .mode-tab:last-child {
      grid-column: auto;
    }
  
    .button-row {
      flex-direction: column;
    }
  
    .button-row .btn {
      width: 100%;
    }
  
    .result-grid {
      grid-template-columns: 1fr;
    }
  
    .results-placeholder {
      padding: 32px 8px;
    }
  
    .related-grid {
      grid-template-columns: 1fr;
    }
  
    th,
    td {
      padding: 10px 12px;
      font-size: 0.92rem;
    }
  }
  
  @media (max-width: 420px) {
    .calculator-card,
    .content-section {
      padding: 18px;
    }
  
    .content-section h2 {
      font-size: 1.45rem;
    }
  
    .results-content h2 {
      font-size: 2rem;
    }
  
    .placeholder-icon {
      width: 72px;
      height: 72px;
    }
  }