:root {
    --gd-bg: #07130f;
    --gd-card: #10241c;
    --gd-card-2: #142d23;
    --gd-text: #f3fff8;
    --gd-muted: #b7d8c8;
    --gd-accent: #70e6a8;
    --gd-accent-2: #b9ffd6;
    --gd-warn: #ffd166;
    --gd-danger: #ff6b6b;
    --gd-border: rgba(255,255,255,0.12);
    --gd-shadow: 0 20px 60px rgba(0,0,0,0.28);
}

.glucoday-app, .glucoday-app * {
    box-sizing: border-box;
}

.glucoday-app {
    width: 100%;
    min-height: 100vh;
    padding: 16px;
    background: radial-gradient(circle at top left, rgba(112,230,168,0.2), transparent 34%), var(--gd-bg);
    color: var(--gd-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.gd-shell {
    max-width: 860px;
    margin: 0 auto;
    display: grid;
    gap: 14px;
}

.gd-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 4px 4px;
}

.gd-kicker, .gd-label, .gd-small, .gd-subtitle, .gd-card p, .gd-mini-grid small, .gd-scan-meter span {
    color: var(--gd-muted);
}

.gd-kicker {
    margin: 0 0 4px;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.gd-hero h1 {
    margin: 0;
    color: var(--gd-text);
    font-size: clamp(2.2rem, 9vw, 4rem);
    line-height: 0.95;
}

.gd-subtitle {
    margin: 10px 0 0;
    font-size: 1rem;
}

.gd-version {
    flex: 0 0 auto;
    padding: 7px 10px;
    border: 1px solid var(--gd-border);
    border-radius: 999px;
    color: var(--gd-accent-2);
    background: rgba(255,255,255,0.04);
    font-size: 0.85rem;
}

.gd-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02)), var(--gd-card);
    border: 1px solid var(--gd-border);
    border-radius: 24px;
    padding: 18px;
    box-shadow: var(--gd-shadow);
    overflow: hidden;
}

.gd-card h2 {
    margin: 0 0 6px;
    font-size: 1.25rem;
    color: var(--gd-text);
}

.gd-card p {
    margin: 0 0 14px;
}

.gd-status-card {
    background: linear-gradient(135deg, rgba(112,230,168,0.18), rgba(255,255,255,0.03)), var(--gd-card);
}

.gd-status-top, .gd-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.gd-label {
    margin: 0 0 4px;
    font-size: 0.88rem;
}

.gd-score-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
}

.gd-score {
    font-size: clamp(3rem, 17vw, 6rem);
    line-height: 0.9;
    font-weight: 800;
    letter-spacing: -0.06em;
}

.gd-band {
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: var(--gd-accent-2);
    font-weight: 700;
}

.gd-orb {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #052015;
    font-weight: 900;
    font-size: 1.7rem;
    background: var(--gd-muted);
    box-shadow: inset 0 -12px 24px rgba(0,0,0,0.15);
}

.gd-orb.low { background: #70e6a8; }
.gd-orb.moderate { background: #ffd166; }
.gd-orb.high { background: #ff9f43; }
.gd-orb.very-high { background: #ff6b6b; color: #260606; }

.gd-main-message {
    margin: 12px 0 16px !important;
    color: var(--gd-text) !important;
    font-size: 1.2rem;
    line-height: 1.35;
    font-weight: 700;
}

.gd-mini-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.gd-mini-grid div, .gd-scan-meter div, .gd-detail-row {
    min-width: 0;
    border: 1px solid var(--gd-border);
    background: rgba(255,255,255,0.04);
    border-radius: 16px;
    padding: 12px;
}

.gd-mini-grid span, .gd-scan-meter strong {
    display: block;
    color: var(--gd-text);
    font-size: 1.05rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.gd-mini-grid small, .gd-scan-meter span {
    display: block;
    margin-top: 3px;
    font-size: 0.78rem;
}

.gd-button-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.gd-btn, .gd-link-btn, .gd-icon-btn {
    border: 0;
    border-radius: 16px;
    min-height: 48px;
    padding: 12px 14px;
    font-weight: 800;
    cursor: pointer;
    touch-action: manipulation;
    text-align: center;
}

.gd-primary {
    background: var(--gd-accent);
    color: #061c12;
}

.gd-secondary {
    background: rgba(255,255,255,0.08);
    color: var(--gd-text);
    border: 1px solid var(--gd-border);
}

.gd-danger {
    background: rgba(255,107,107,0.18);
    color: #ffd0d0;
    border: 1px solid rgba(255,107,107,0.35);
}

.gd-file-btn {
    display: grid;
    place-items: center;
}

.gd-file-btn input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.gd-link-btn {
    min-height: 40px;
    background: transparent;
    color: var(--gd-accent-2);
    border: 1px solid var(--gd-border);
    white-space: nowrap;
}

.gd-icon-btn {
    width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: var(--gd-text);
    font-size: 1.5rem;
}

.gd-camera-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 20px;
    overflow: hidden;
    background: #020705;
    border: 1px solid var(--gd-border);
}

.gd-camera-wrap video, .gd-camera-wrap canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gd-roi-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 82px;
    height: 82px;
    transform: translate(-50%, -50%);
    border: 3px solid var(--gd-accent);
    border-radius: 50%;
    box-shadow: 0 0 0 999px rgba(0,0,0,0.18);
    pointer-events: none;
}

.gd-scan-meter {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 12px 0;
}

.gd-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.gd-form-grid label {
    display: grid;
    gap: 6px;
    color: var(--gd-muted);
    font-weight: 700;
}

.gd-form-grid input, .gd-form-grid select {
    width: 100%;
    border: 1px solid var(--gd-border);
    border-radius: 14px;
    padding: 12px;
    background: rgba(255,255,255,0.92);
    color: #0a1d14;
    font-size: 16px;
}

.gd-chart {
    width: 100%;
    height: auto;
    min-height: 170px;
    background: rgba(0,0,0,0.14);
    border: 1px solid var(--gd-border);
    border-radius: 18px;
}

.gd-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.gd-detail-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.gd-detail-row span { color: var(--gd-muted); }
.gd-detail-row strong { color: var(--gd-text); }

[hidden] { display: none !important; }

@media (max-width: 560px) {
    .glucoday-app { padding: 12px; }
    .gd-card { padding: 15px; border-radius: 20px; }
    .gd-mini-grid, .gd-scan-meter, .gd-details { grid-template-columns: 1fr; }
    .gd-status-top { align-items: center; }
    .gd-orb { width: 58px; height: 58px; font-size: 1.4rem; }
    .gd-main-message { font-size: 1.08rem; }
    .gd-button-grid { grid-template-columns: 1fr; }
    .gd-hero { padding-top: 10px; }
}

.gd-personal-card {
    background: linear-gradient(135deg, rgba(185,255,214,0.10), rgba(255,255,255,0.025)), var(--gd-card-2);
}

.gd-pill {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    min-height: 36px;
    padding: 7px 11px;
    border-radius: 999px;
    border: 1px solid var(--gd-border);
    background: rgba(255,255,255,0.07);
    color: var(--gd-accent-2);
    font-weight: 800;
    white-space: nowrap;
}


.gd-status-word {
    font-size: clamp(2.8rem, 15vw, 5.2rem);
    letter-spacing: -0.05em;
}

.gd-hidden-score {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}
