/* Ideal Weight Calculator — style.css v1.0 */

.iwc-wrap {
    max-width: 600px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1a1a1a;
}

/* Header */
.iwc-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.iwc-icon   { font-size: 34px; line-height: 1; }
.iwc-title  {
    font-size: 22px !important; font-weight: 600 !important;
    margin: 0 0 3px !important; padding: 0 !important;
    border: none !important; color: #1a1a1a !important;
}
.iwc-sub { font-size: 13px; color: #666; margin: 0; }

/* Unit toggle */
.iwc-unit-toggle {
    display: flex; border: 1px solid #d0d0d0;
    border-radius: 9px; overflow: hidden; margin-bottom: 18px;
}
.iwc-utbtn {
    flex: 1; padding: 9px 10px; font-size: 13px;
    border: none; border-right: 1px solid #d0d0d0;
    background: #fff; color: #555; cursor: pointer;
    transition: background .13s, color .13s;
}
.iwc-utbtn:last-child { border-right: none; }
.iwc-utbtn.act { background: #e8f5e9; color: #1B5E20; font-weight: 600; }
.iwc-utbtn:hover:not(.act) { background: #fafafa; }

/* Section label */
.iwc-section-lbl {
    font-size: 11px; font-weight: 700; color: #999;
    text-transform: uppercase; letter-spacing: .6px; margin-bottom: 10px;
}

/* Gender toggle */
.iwc-gender-row {
    display: flex; border: 1px solid #d0d0d0;
    border-radius: 8px; overflow: hidden; height: 40px; margin-bottom: 4px;
}
.iwc-gbtn {
    flex: 1; border: none; border-right: 1px solid #d0d0d0;
    background: #fff; color: #555; font-size: 13px;
    cursor: pointer; transition: background .13s, color .13s;
}
.iwc-gbtn:last-child { border-right: none; }
.iwc-gbtn.act { background: #e8f5e9; color: #1B5E20; font-weight: 600; }

/* Grid */
.iwc-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 14px; margin-bottom: 4px;
}
@media (max-width: 440px) { .iwc-grid { grid-template-columns: 1fr; } }

/* Labels */
.iwc-lbl {
    display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
    font-size: 13px; font-weight: 500; color: #555; margin-bottom: 6px;
}
.iwc-optional { font-size: 11px; color: #aaa; font-weight: 400; }

/* Inputs */
.iwc-iw { position: relative; }
.iwc-iw input[type="number"] {
    width: 100%; box-sizing: border-box;
    padding: 9px 36px 9px 12px;
    border: 1px solid #d0d0d0; border-radius: 8px;
    font-size: 14px; color: #1a1a1a; background: #fff;
    outline: none; transition: border-color .15s;
    -moz-appearance: textfield;
}
.iwc-iw input::-webkit-inner-spin-button,
.iwc-iw input::-webkit-outer-spin-button { -webkit-appearance: none; }
.iwc-iw input:focus { border-color: #2E7D32; box-shadow: 0 0 0 3px rgba(46,125,50,.1); }
.iwc-suf {
    position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
    font-size: 12px; color: #999; pointer-events: none;
}
.iwc-ft-in-row { display: flex; gap: 8px; }
.iwc-ft-in-row .iwc-iw { flex: 1; }

/* Primary card */
.iwc-primary-card {
    background: linear-gradient(135deg, #2E7D32, #1B5E20);
    border-radius: 14px; padding: 20px 24px;
    color: #fff; text-align: center;
    margin-top: 20px; margin-bottom: 10px;
    animation: iwc-in .22s ease;
}
@keyframes iwc-in { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }
.iwc-primary-val   { font-size: 42px; font-weight: 700; line-height: 1; }
.iwc-primary-range { font-size: 16px; opacity: .85; margin: 6px 0 4px; }
.iwc-primary-sub   { font-size: 12px; opacity: .7; }

/* BMI range card */
.iwc-bmi-range-card {
    background: #f0fdf4; border: 1px solid #86efac;
    border-radius: 11px; padding: 14px 18px; margin-bottom: 4px;
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.iwc-bmi-icon { font-size: 24px; }
.iwc-bmi-info { flex: 1; }
.iwc-bmi-title { font-size: 13px; font-weight: 600; color: #166534; margin-bottom: 3px; }
.iwc-bmi-vals  { font-size: 14px; font-weight: 700; color: #166534; }
.iwc-bmi-note  { font-size: 12px; color: #888; margin-top: 3px; }

/* 4 formula cards */
.iwc-formula-grid {
    display: grid; grid-template-columns: repeat(4,1fr);
    gap: 8px; margin-bottom: 14px;
}
@media (max-width: 520px) { .iwc-formula-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 340px) { .iwc-formula-grid { grid-template-columns: 1fr; } }

.iwc-formula-card {
    border-radius: 10px; padding: 12px 10px;
    text-align: center; border: 1px solid;
}
.iwc-fc-robinson { background: #eff6ff; border-color: #93c5fd; }
.iwc-fc-devine   { background: #fdf4ff; border-color: #e9d5ff; }
.iwc-fc-miller   { background: #fff7ed; border-color: #fdba74; }
.iwc-fc-hamwi    { background: #f0fdf4; border-color: #86efac; }

.iwc-fc-val   { font-size: 20px; font-weight: 700; margin-bottom: 3px; }
.iwc-fc-name  { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.iwc-fc-year  { font-size: 11px; color: #888; }
.iwc-fc-robinson .iwc-fc-val { color: #1d4ed8; }
.iwc-fc-devine   .iwc-fc-val { color: #7e22ce; }
.iwc-fc-miller   .iwc-fc-val { color: #c2410c; }
.iwc-fc-hamwi    .iwc-fc-val { color: #166534; }

/* Current weight comparison */
.iwc-compare-card {
    border-radius: 11px; padding: 14px 18px; margin-bottom: 14px;
    border: 1px solid; font-size: 13px;
}
.iwc-compare-card.on-track   { background: #f0fdf4; border-color: #86efac; }
.iwc-compare-card.above      { background: #fff3e0; border-color: #ffcc80; }
.iwc-compare-card.below      { background: #eff6ff; border-color: #93c5fd; }
.iwc-compare-title { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.iwc-compare-card.on-track .iwc-compare-title { color: #166534; }
.iwc-compare-card.above      .iwc-compare-title { color: #c2410c; }
.iwc-compare-card.below      .iwc-compare-title { color: #1d4ed8; }
.iwc-compare-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; border-bottom: 1px solid rgba(0,0,0,.06); }
.iwc-compare-row:last-child { border-bottom: none; font-weight: 600; padding-top: 8px; margin-top: 2px; }
.iwc-compare-lbl { color: #555; }
.iwc-compare-val { font-weight: 600; }

/* Bars inside compare card */
.iwc-weight-bar-wrap { margin-top: 10px; }
.iwc-weight-bar-track {
    height: 14px; background: #e0e0e0; border-radius: 7px;
    overflow: hidden; position: relative; margin-bottom: 5px;
}
.iwc-weight-bar-ideal { height: 100%; position: absolute; top: 0; border-radius: 7px; background: #22C55E; }
.iwc-weight-bar-curr  { height: 14px; width: 4px; position: absolute; top: 0; border-radius: 2px; background: #1a1a1a; }
.iwc-weight-bar-labels { display: flex; justify-content: space-between; font-size: 11px; color: #888; }

/* Formula reference table */
table.iwc-ref-table {
    width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 14px;
}
table.iwc-ref-table th {
    padding: 7px 10px; text-align: left; color: #888;
    font-size: 11px; text-transform: uppercase; letter-spacing: .4px;
    border-bottom: 1px solid #e8e8e8; background: #fafafa; font-weight: 600;
}
table.iwc-ref-table td {
    padding: 8px 10px; border-bottom: 1px solid #f0f0f0; font-size: 12px; vertical-align: top;
}
table.iwc-ref-table tr:last-child td { border-bottom: none; }
table.iwc-ref-table code { font-family: monospace; font-size: 11px; background: #f5f5f5; padding: 2px 5px; border-radius: 3px; }

/* Disclaimer */
.iwc-disclaimer { font-size: 11px; color: #bbb; text-align: center; margin-top: 10px; }
.iwc-reset-btn {
    display: block; width: 100%; margin-top: 10px; padding: 9px;
    font-size: 13px; color: #999; background: none;
    border: 1px solid #e8e8e8; border-radius: 8px;
    cursor: pointer; transition: background .13s;
}
.iwc-reset-btn:hover { background: #f5f5f5; color: #333; }
