/* ============================================
   OVERWEIGHT CALCULATOR - CSS
   Version 1.0
============================================ */

@import url('https://fonts.googleapis.com/css2?family=Jost:wght@400;500;600;700;800;900&display=swap');

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

.owc-wrap {
    --coral:       #0D9488;
    --coral-dark:  #0B7A70;
    --sage:        #52B788;
    --sage-dark:   #3A8A63;
    --peach:       #E6F2F0;
    --amber:       #E8A33D;
    --red:         #E0554F;
    --grad:        linear-gradient(135deg, #0D9488 0%, #14B8A6 100%);
    --grad-soft:   rgba(13,148,136,0.08);
    --white:       #FFFFFF;
    --bg:          #F2F7F6;
    --card-bg:     #FFFFFF;
    --border:      rgba(13,148,136,0.14);
    --text:        #0F2A3D;
    --text-muted:  #5C7A80;
    --shadow-card: 0 32px 80px rgba(15,42,61,0.16), 0 8px 24px rgba(13,148,136,0.10);
    --shadow-btn:  0 12px 32px rgba(13,148,136,0.40);
    --radius-xl:   28px;
    --radius-lg:   20px;
    --radius-md:   14px;
    --radius-sm:   10px;
    font-family: 'Jost', sans-serif;
    position: relative;
    padding: 32px 20px 60px;
    background: var(--bg);
    min-height: 100%;
    color: var(--text);
}

.owc-blob { position: absolute; border-radius: 50%; filter: blur(80px); pointer-events: none; z-index: 0; }
.owc-blob-1 { width: 420px; height: 420px; background: rgba(13,148,136,0.14); top: -120px; left: -120px; }
.owc-blob-2 { width: 360px; height: 360px; background: rgba(15,42,61,0.10); bottom: 0; right: -120px; }

.owc-card { position: relative; z-index: 1; max-width: 860px; margin: 0 auto; }

/* ---- Header ---- */
.owc-header { background: var(--grad); border-radius: var(--radius-xl); padding: 28px 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; position: relative; overflow: hidden; box-shadow: var(--shadow-card); margin-bottom: 20px; }
.owc-header::after { content: ''; position: absolute; width: 280px; height: 280px; background: rgba(255,255,255,0.10); border-radius: 50%; top: -110px; right: -70px; }
.owc-header-left { display: flex; align-items: center; gap: 16px; position: relative; z-index: 1; }
.owc-header-icon { width: 52px; height: 52px; background: rgba(255,255,255,0.20); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.3); }
.owc-header-text h1 { color: #fff; font-family: 'Jost', sans-serif; font-size: 21px; font-weight: 700; letter-spacing: -0.3px; }
.owc-header-text p { color: rgba(255,255,255,0.85); font-size: 12px; margin-top: 4px; }
.owc-icon-btn { width: 40px; height: 40px; background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.3); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; position: relative; z-index: 1; transition: background 0.2s; }
.owc-icon-btn:hover { background: rgba(255,255,255,0.28); }

/* ---- History panel ---- */
.owc-history-panel { max-height: 0; overflow: hidden; transition: max-height 0.35s ease; background: var(--card-bg); border-radius: var(--radius-xl); box-shadow: var(--shadow-card); }
.owc-history-panel.owc-history-open { max-height: 420px; overflow-y: auto; margin-bottom: 20px; }
.owc-history-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; font-size: 13px; font-weight: 800; color: var(--text); border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--card-bg); }
.owc-history-close { background: none; border: none; font-size: 20px; color: var(--text-muted); cursor: pointer; line-height: 1; }
.owc-history-list { padding: 14px 24px 20px; display: flex; flex-direction: column; gap: 10px; }
.owc-history-empty { font-size: 13px; color: var(--text-muted); padding: 20px 0; text-align: center; }
.owc-history-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--radius-md); padding: 12px 16px; cursor: pointer; }
.owc-history-item:hover { border-color: var(--coral); }
.owc-history-item-name { font-size: 13.5px; font-weight: 700; color: var(--text); }
.owc-history-item-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }
.owc-history-item-btn { border: 1.5px solid var(--border); background: var(--white); color: var(--red); font-family: 'Jost', sans-serif; font-size: 11.5px; font-weight: 700; border-radius: 7px; padding: 6px 11px; cursor: pointer; flex-shrink: 0; }

/* ---- Explainer ---- */
.owc-explainer { background: var(--card-bg); border-radius: var(--radius-xl); box-shadow: var(--shadow-card); border: 1px solid var(--border); margin-bottom: 20px; overflow: hidden; }
.owc-explainer-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; background: var(--grad-soft); border: none; cursor: pointer; font-size: 13.5px; font-weight: 700; color: var(--text); font-family: 'Jost', sans-serif; }
.owc-explainer-toggle svg { color: var(--coral); transition: transform 0.25s ease; flex-shrink: 0; }
#owc_explainer_arrow.owc-explainer-arrow-open { transform: rotate(180deg); }
.owc-explainer-body { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; padding: 0 24px; }
.owc-explainer-body.owc-explainer-open { max-height: 420px; padding: 16px 24px; }
.owc-explainer-body p { font-size: 12.5px; color: var(--text-muted); line-height: 1.65; margin-bottom: 10px; }
.owc-explainer-body p:last-child { margin-bottom: 0; }
.owc-explainer-body strong { color: var(--text); }

/* ---- Fields ---- */
.owc-panel { background: var(--card-bg); border-radius: var(--radius-xl); box-shadow: var(--shadow-card); border: 1px solid var(--border); padding: 26px 28px; margin-bottom: 20px; }
.owc-field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.owc-field { margin-bottom: 16px; }
.owc-field:last-child { margin-bottom: 0; }
.owc-field label { display: block; font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 7px; text-transform: uppercase; letter-spacing: 0.4px; }
.owc-hint-inline { text-transform: none; font-weight: 500; opacity: 0.75; font-size: 11px; }
.owc-input, .owc-plain-input {
    width: 100%; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    padding: 11px 12px; font-family: 'Jost', sans-serif; font-size: 13.5px; font-weight: 600; color: var(--text);
    background: var(--white); outline: none; transition: border-color 0.2s;
}
.owc-input:focus, .owc-plain-input:focus { border-color: var(--coral); }

.owc-unit-input-wrap { display: flex; gap: 6px; }
.owc-unit-input-wrap .owc-plain-input { flex: 1; min-width: 0; }
.owc-unit-static { display: flex; align-items: center; padding: 0 12px; font-size: 12.5px; font-weight: 700; color: var(--text-muted); background: var(--bg); border-radius: var(--radius-sm); border: 1.5px solid var(--border); flex-shrink: 0; white-space: nowrap; }

/* ---- Segmented toggle ---- */
.owc-toggle-row { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; cursor: default; margin-bottom: 0; }
.owc-toggle-row span:first-child { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.owc-seg-toggle { display: flex; gap: 6px; background: var(--peach); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 5px; width: 100%; }
.owc-seg-btn { flex: 1; background: none; border: none; color: var(--coral-dark); font-family: 'Jost', sans-serif; font-size: 12px; font-weight: 700; border-radius: var(--radius-sm); padding: 9px 6px; cursor: pointer; }
.owc-seg-btn:hover { color: var(--coral); }
.owc-seg-btn.owc-seg-active { background: var(--grad); color: #fff; }
.owc-seg-toggle-full { margin: 0; }

/* ---- Result ---- */
.owc-result { background: var(--card-bg); border-radius: var(--radius-xl); box-shadow: var(--shadow-card); border: 1px solid var(--border); padding: 26px 28px; }
.owc-result-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.owc-result-badge { font-size: 13px; font-weight: 800; color: var(--text); }
.owc-input-recap { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; line-height: 1.5; }
.owc-input-recap:empty { display: none; margin: 0; }

.owc-due-card { background: var(--grad); border-radius: var(--radius-lg); padding: 24px; text-align: center; margin-bottom: 18px; position: relative; overflow: hidden; }
.owc-due-card::after { content: ''; position: absolute; width: 180px; height: 180px; background: rgba(255,255,255,0.10); border-radius: 50%; top: -80px; right: -50px; }
.owc-due-label { color: rgba(255,255,255,0.85); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; position: relative; }
.owc-due-value { color: #fff; font-family: 'Jost', sans-serif; font-size: 34px; font-weight: 700; letter-spacing: -0.5px; margin: 8px 0; position: relative; word-break: break-word; }
.owc-due-sub { color: rgba(255,255,255,0.9); font-size: 12px; font-weight: 500; position: relative; }

/* ---- Range bar (BMI zones) ---- */
.owc-range-card { background: var(--bg); border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 20px; margin-bottom: 18px; }
.owc-range-title { font-size: 12.5px; font-weight: 800; color: var(--text); margin-bottom: 16px; }
.owc-range-bar-wrap { padding-top: 30px; }
.owc-range-bar {
    position: relative; height: 20px; border-radius: 100px; overflow: visible;
    background: linear-gradient(to right,
        #B23A34 0%, #D9714A 12%, #E8C86A 24%,
        var(--sage) 38%, var(--sage) 62%,
        var(--amber) 74%, #D9714A 87%, #B23A34 100%);
}
.owc-range-marker { position: absolute; top: -28px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; transition: left 0.4s ease; }
.owc-range-marker-pin { width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 9px solid var(--text); margin-top: 2px; }
.owc-range-marker-label { background: var(--text); color: #fff; font-size: 10.5px; font-weight: 800; padding: 3px 8px; border-radius: 100px; white-space: nowrap; margin-bottom: 2px; }

.owc-range-ticks { position: relative; height: 44px; margin-top: 6px; }
.owc-range-tick { position: absolute; top: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; text-align: center; }
.owc-range-tick-mark { width: 1px; height: 6px; background: var(--border); margin-bottom: 3px; }
.owc-range-tick-val { font-size: 9.5px; font-weight: 800; color: var(--text); white-space: nowrap; }
.owc-range-tick-label { font-size: 8.5px; font-weight: 600; color: var(--text-muted); white-space: nowrap; margin-top: 1px; max-width: 62px; line-height: 1.2; }

.owc-range-legend { display: flex; flex-wrap: wrap; gap: 12px 14px; margin-top: 12px; }
.owc-legend-item { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--text); }
.owc-legend-swatch { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.owc-legend-swatch.owc-zone-severe-under { background: #B23A34; }
.owc-legend-swatch.owc-zone-under { background: #E8C86A; }
.owc-legend-swatch.owc-zone-healthy { background: var(--sage); }
.owc-legend-swatch.owc-zone-over { background: var(--amber); }
.owc-legend-swatch.owc-zone-obese1 { background: #D9714A; }
.owc-legend-swatch.owc-zone-obese2 { background: #C24A3E; }
.owc-legend-swatch.owc-zone-obese3 { background: #B23A34; }

.owc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.owc-stats:empty { display: none; margin-bottom: 0; }
.owc-stat-card { background: var(--bg); border-radius: var(--radius-md); padding: 14px; text-align: center; border: 1px solid var(--border); }
.owc-stat-icon { font-size: 16px; margin-bottom: 4px; }
.owc-stat-value { font-size: 15.5px; font-weight: 800; color: var(--text); word-break: break-word; }
.owc-stat-label { font-size: 10.5px; font-weight: 600; color: var(--text-muted); margin-top: 2px; }

.owc-excess-card { display: flex; align-items: center; gap: 14px; background: rgba(232,163,61,0.12); border: 1.5px solid rgba(232,163,61,0.35); border-radius: var(--radius-md); padding: 16px 18px; margin-bottom: 18px; }
.owc-excess-card.owc-excess-good { background: rgba(82,183,136,0.12); border-color: rgba(82,183,136,0.35); }
.owc-excess-card.owc-excess-bad { background: rgba(224,85,79,0.12); border-color: rgba(224,85,79,0.35); }
.owc-excess-icon { font-size: 22px; flex-shrink: 0; }
.owc-excess-title { font-size: 13.5px; font-weight: 800; color: var(--text); }
.owc-excess-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; line-height: 1.5; }

.owc-breakdown-card { background: var(--bg); border-radius: var(--radius-md); border: 1px solid var(--border); padding: 16px; margin-bottom: 14px; }
.owc-breakdown-title { font-size: 12.5px; font-weight: 800; color: var(--text); margin-bottom: 10px; }
.owc-table-wrap { overflow-x: auto; }
.owc-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.owc-table th { text-align: left; font-weight: 700; color: var(--text-muted); padding: 6px 8px; border-bottom: 1.5px solid var(--border); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.3px; white-space: nowrap; }
.owc-table td { padding: 8px; border-bottom: 1px solid var(--border); color: var(--text); font-weight: 600; white-space: nowrap; }
.owc-table tr:last-child td { border-bottom: none; }
.owc-table tr.owc-table-current td { background: rgba(122,155,118,0.14); font-weight: 800; color: var(--sage-dark); }

.owc-actions-row { margin-bottom: 10px; }
.owc-save-btn { width: 100%; background: var(--grad); color: #fff; border: none; font-family: 'Jost', sans-serif; font-size: 14px; font-weight: 800; border-radius: var(--radius-md); padding: 14px; cursor: pointer; box-shadow: var(--shadow-btn); }
.owc-export-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.owc-export-btn { background: var(--white); border: 1.5px solid var(--border); color: var(--text); font-family: 'Jost', sans-serif; font-size: 12px; font-weight: 700; border-radius: var(--radius-sm); padding: 11px 6px; cursor: pointer; }
.owc-export-btn:hover { border-color: var(--coral); color: var(--coral); }

.owc-footer-note { font-size: 10.5px; color: var(--text-muted); text-align: center; line-height: 1.5; }

/* ---- Responsive ---- */
@media (max-width: 780px) {
    .owc-field-grid { grid-template-columns: 1fr; }
    .owc-stats { grid-template-columns: 1fr 1fr; }
    .owc-seg-toggle { flex-direction: column; }
}
