/* <style> */
  :root {
    --crimson: #c0392b;
    --crimson-dark: #96281b;
    --crimson-light: #e74c3c;
    --gold: #f0a500;
    --gold-light: #ffc531;
    --bg: #0d0d0f;
    --bg-card: #141416;
    --bg-raised: #1a1a1e;
    --bg-input: #111114;
    --border: rgba(255,255,255,0.07);
    --border-active: rgba(192,57,43,0.5);
    --text: #f0ede8;
    --text-muted: #888;
    --text-dim: #555;
    --success: #2ecc71;
    --radius: 14px;
    --radius-sm: 8px;
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    font-family: 'Sora', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
  }

  /* Background texture */
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
      radial-gradient(ellipse 60% 40% at 20% 10%, rgba(192,57,43,0.08) 0%, transparent 70%),
      radial-gradient(ellipse 50% 50% at 80% 90%, rgba(240,165,0,0.05) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
  }

  .page-wrap {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 48px 20px 80px;
  }

  /* HEADER */
  .page-header {
    text-align: center;
    margin-bottom: 40px;
  }

  .page-header .eyebrow {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--crimson-light);
    margin-bottom: 12px;
    display: block;
  }

  .page-header h1 {
    font-size: clamp(26px, 5vw, 42px);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 14px;
    background: linear-gradient(135deg, #f0ede8 30%, #c0392b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .page-header p {
    color: var(--text-muted);
    font-size: 15px;
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.6;
  }

  /* TAB SWITCHER */
  .mode-tabs {
    display: flex;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 4px;
    width: fit-content;
    margin: 0 auto 36px;
    gap: 4px;
  }

  .mode-tab {
    padding: 9px 22px;
    border-radius: 50px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: 'Sora', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
  }

  .mode-tab.active {
    background: var(--crimson);
    color: #fff;
    box-shadow: 0 4px 16px rgba(192,57,43,0.35);
  }

  /* CARD */
  .calc-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 24px;
  }

  .calc-card h2 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .calc-card h2 .badge {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    background: rgba(192,57,43,0.15);
    border: 1px solid rgba(192,57,43,0.3);
    color: var(--crimson-light);
    padding: 3px 8px;
    border-radius: 4px;
  }

  /* SYSTEM SELECTOR */
  .system-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
  }

  .sys-pill {
    padding: 7px 16px;
    border-radius: 50px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-family: 'Sora', sans-serif;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
  }

  .sys-pill:hover { border-color: rgba(192,57,43,0.4); color: var(--text); }
  .sys-pill.active {
    background: rgba(192,57,43,0.12);
    border-color: rgba(192,57,43,0.5);
    color: var(--crimson-light);
  }

  /* INPUTS */
  .field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
  }

  @media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

  .field-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
  }

  .field-group label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    text-transform: uppercase;
  }

  .field-group input,
  .field-group select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: 'DM Mono', monospace;
    font-size: 16px;
    padding: 12px 16px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
  }

  .field-group input:focus,
  .field-group select:focus {
    border-color: var(--crimson);
    box-shadow: 0 0 0 3px rgba(192,57,43,0.12);
  }

  .field-group select option { background: #1a1a1e; }

  /* CONVERT BTN */
  .convert-btn {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-sm);
    border: none;
    background: linear-gradient(135deg, var(--crimson), var(--crimson-dark));
    color: #fff;
    font-family: 'Sora', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.2s;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 20px rgba(192,57,43,0.3);
  }

  .convert-btn:hover {
    background: linear-gradient(135deg, var(--crimson-light), var(--crimson));
    box-shadow: 0 6px 28px rgba(192,57,43,0.45);
    transform: translateY(-1px);
  }

  /* RESULT */
  .result-strip {
    display: none;
    margin-top: 20px;
    background: linear-gradient(135deg, rgba(192,57,43,0.1), rgba(240,165,0,0.06));
    border: 1px solid rgba(192,57,43,0.25);
    border-radius: var(--radius-sm);
    padding: 20px 24px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }

  .result-strip.show { display: flex; animation: fadeSlide 0.3s ease; }

  @keyframes fadeSlide {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .result-label { font-size: 12px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 1px; }
  .result-big { font-family: 'DM Mono', monospace; font-size: 36px; font-weight: 500; color: var(--gold-light); line-height: 1; }
  .result-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
  .result-grade-badge {
    background: rgba(240,165,0,0.1);
    border: 1px solid rgba(240,165,0,0.3);
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    text-align: center;
    min-width: 120px;
  }
  .result-grade-badge .grade-letter { font-size: 28px; font-weight: 700; color: var(--gold); }
  .result-grade-badge .grade-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

  /* BREAKDOWN TABLE */
  .breakdown-wrap {
    display: none;
    margin-top: 20px;
  }
  .breakdown-wrap.show { display: block; }
  .breakdown-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
  }

  .breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
  }

  .breakdown-item {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
  }

  .breakdown-item .bi-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
  .breakdown-item .bi-val { font-family: 'DM Mono', monospace; font-size: 18px; color: var(--text); font-weight: 500; }
  .breakdown-item .bi-sub { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

  /* REFERENCE TABLE */
  .ref-section { margin-top: 8px; }
  .ref-section h3 { font-size: 15px; font-weight: 600; margin-bottom: 14px; color: var(--text); }

  .ref-table-wrap { overflow-x: auto; }

  .ref-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
  }

  .ref-table th {
    background: rgba(192,57,43,0.08);
    padding: 10px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
  }

  .ref-table td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--text);
    font-family: 'DM Mono', monospace;
    font-size: 12.5px;
  }

  .ref-table tr:last-child td { border-bottom: none; }
  .ref-table tr:hover td { background: rgba(255,255,255,0.02); }

  .ref-table .section-head td {
    background: rgba(255,255,255,0.03);
    color: var(--text-muted);
    font-family: 'Sora', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
  }

  .grade-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 13px;
    font-family: 'DM Mono', monospace;
  }

  .chip-aplus { background: rgba(46,204,113,0.12); color: #2ecc71; }
  .chip-a { background: rgba(52,152,219,0.12); color: #3498db; }
  .chip-bplus { background: rgba(155,89,182,0.12); color: #9b59b6; }
  .chip-b { background: rgba(52,152,219,0.1); color: #5dade2; }
  .chip-cplus { background: rgba(240,165,0,0.12); color: var(--gold); }
  .chip-c { background: rgba(230,126,34,0.12); color: #e67e22; }
  .chip-d { background: rgba(192,57,43,0.12); color: var(--crimson-light); }
  .chip-e { background: rgba(192,57,43,0.18); color: #e74c3c; }
  .chip-f { background: rgba(192,57,43,0.2); color: #c0392b; }

  /* SEO CONTENT */
  .seo-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    margin-top: 24px;
  }

  .seo-section h2 {
    font-size: 19px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text);
  }

  .seo-section h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 20px 0 8px;
    color: var(--text);
  }

  .seo-section p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 12px;
  }

  .seo-section ul {
    list-style: none;
    padding: 0;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.8;
  }

  .seo-section ul li::before {
    content: '→ ';
    color: var(--crimson-light);
    font-weight: 600;
  }

  .formula-box {
    background: var(--bg-raised);
    border-left: 3px solid var(--crimson);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 14px 18px;
    font-family: 'DM Mono', monospace;
    font-size: 14px;
    color: var(--gold-light);
    margin: 14px 0;
  }

  .error-msg {
    color: var(--crimson-light);
    font-size: 12px;
    margin-top: 4px;
    min-height: 16px;
  }

  /* Divider */
  .divider {
    height: 1px;
    background: var(--border);
    margin: 24px 0;
  }

  /* ===== HIDDEN PANEL SYSTEM ===== */
  .converter-panel { display: none; }
  .converter-panel.active { display: block; }

  /* Mobile tweaks */
  @media (max-width: 480px) {
    .calc-card { padding: 20px 16px; }
    .page-wrap { padding: 32px 14px 60px; }
  }
/* </style> */