.frdg-app,
.frdg-login-card {
    --frdg-navy: #0b2341;
    --frdg-blue: #135fa7;
    --frdg-orange: #ee7a24;
    --frdg-ink: #172033;
    --frdg-muted: #64748b;
    --frdg-border: #dce4ec;
    --frdg-soft: #f4f7fa;
    --frdg-safe: #15803d;
    --frdg-warning: #d97706;
    --frdg-danger: #dc2626;
    color: var(--frdg-ink);
    font-family: inherit;
}

.frdg-app *,
.frdg-login-card * {
    box-sizing: border-box;
}

.frdg-hero {
    align-items: center;
    background:
        radial-gradient(circle at 88% 20%, rgba(238, 122, 36, .34), transparent 27%),
        linear-gradient(130deg, #07192f 0%, #0b315d 60%, #145895 100%);
    border-radius: 24px;
    box-shadow: 0 18px 45px rgba(11, 35, 65, .18);
    color: #fff;
    display: flex;
    justify-content: space-between;
    margin: 0 0 22px;
    min-height: 210px;
    overflow: hidden;
    padding: 34px clamp(22px, 5vw, 52px);
    position: relative;
}

.frdg-hero::after {
    background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .06) 0 1px, transparent 1px 18px);
    content: '';
    inset: 0;
    mask-image: linear-gradient(to left, #000, transparent 60%);
    pointer-events: none;
    position: absolute;
}

.frdg-hero > div:first-child {
    max-width: 650px;
    position: relative;
    z-index: 1;
}

.frdg-eyebrow {
    color: #ffd2b0;
    display: block;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .13em;
    margin-bottom: 9px;
    text-transform: uppercase;
}

.frdg-hero h2 {
    color: #fff;
    font-size: clamp(28px, 4.4vw, 46px);
    line-height: 1.08;
    margin: 0 0 13px;
}

.frdg-hero p {
    color: rgba(255, 255, 255, .88);
    font-size: 16px;
    line-height: 1.65;
    margin: 0;
}

.frdg-hero-meter {
    background: #f4f0e4;
    border: 8px solid rgba(255, 255, 255, .18);
    border-radius: 18px;
    box-shadow: 0 18px 30px rgba(0, 0, 0, .22);
    color: #07192f;
    flex: 0 0 auto;
    margin-left: 28px;
    padding: 17px 18px 16px;
    position: relative;
    transform: rotate(3deg);
    z-index: 1;
}

.frdg-hero-meter span {
    display: block;
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 5px;
    text-align: right;
}

.frdg-hero-meter strong {
    background: #101820;
    border-radius: 7px;
    color: #fff;
    display: block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 26px;
    letter-spacing: .12em;
    padding: 9px 10px 8px 14px;
}

.frdg-panel,
.frdg-progress-card,
.frdg-chart-card,
.frdg-info,
.frdg-login-card {
    background: #fff;
    border: 1px solid var(--frdg-border);
    border-radius: 18px;
    box-shadow: 0 8px 25px rgba(15, 23, 42, .055);
}

.frdg-panel {
    margin: 0 0 18px;
    padding: 22px;
}

.frdg-panel-heading,
.frdg-panel-heading > div {
    align-items: center;
    display: flex;
}

.frdg-panel-heading {
    justify-content: space-between;
    margin-bottom: 18px;
}

.frdg-panel-heading h3 {
    color: var(--frdg-navy);
    font-size: 20px;
    margin: 0;
}

.frdg-step {
    align-items: center;
    background: #e8f1fa;
    border-radius: 50%;
    color: var(--frdg-blue);
    display: inline-flex;
    flex: 0 0 34px;
    font-size: 14px;
    font-weight: 800;
    height: 34px;
    justify-content: center;
    margin-right: 10px;
    width: 34px;
}

.frdg-form {
    align-items: start;
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.frdg-reading-form {
    grid-template-columns: 1fr 1fr 2fr auto;
}

.frdg-field label {
    color: #24324a;
    display: block;
    font-size: 13px;
    font-weight: 750;
    margin: 0 0 7px;
}

.frdg-field input,
.frdg-field select {
    appearance: none;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    color: #111827;
    font: inherit;
    font-size: 15px;
    min-height: 46px;
    padding: 10px 12px;
    width: 100%;
}

.frdg-field select {
    background-image: linear-gradient(45deg, transparent 50%, #64748b 50%), linear-gradient(135deg, #64748b 50%, transparent 50%);
    background-position: calc(100% - 17px) 19px, calc(100% - 12px) 19px;
    background-repeat: no-repeat;
    background-size: 5px 5px, 5px 5px;
    padding-right: 35px;
}

.frdg-field input:focus,
.frdg-field select:focus {
    border-color: var(--frdg-blue);
    box-shadow: 0 0 0 3px rgba(19, 95, 167, .14);
    outline: none;
}

.frdg-field small {
    color: var(--frdg-muted);
    display: block;
    font-size: 11px;
    line-height: 1.45;
    margin-top: 5px;
}

.frdg-check {
    align-items: flex-start;
    color: #334155;
    display: flex;
    font-size: 13px;
    gap: 9px;
    grid-column: 1 / -1;
    line-height: 1.45;
}

.frdg-check input {
    accent-color: var(--frdg-blue);
    height: 17px;
    margin: 1px 0 0;
    width: 17px;
}

.frdg-form-actions {
    align-self: end;
}

.frdg-settings-form .frdg-form-actions {
    grid-column: 1 / -1;
}

.frdg-button {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    font-size: 14px;
    font-weight: 800;
    justify-content: center;
    min-height: 46px;
    padding: 10px 18px;
    text-decoration: none !important;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.frdg-button:hover {
    transform: translateY(-1px);
}

.frdg-button:disabled {
    cursor: wait;
    opacity: .65;
    transform: none;
}

.frdg-button-primary {
    background: var(--frdg-orange);
    box-shadow: 0 7px 15px rgba(238, 122, 36, .2);
    color: #fff !important;
}

.frdg-button-primary:hover {
    background: #d96715;
}

.frdg-button-secondary {
    background: #fff;
    border-color: #b9c8d7;
    color: var(--frdg-navy) !important;
}

.frdg-text-button,
.frdg-delete {
    background: none;
    border: 0;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 750;
    padding: 5px;
}

.frdg-text-button {
    color: var(--frdg-blue);
}

.frdg-collapsed {
    display: none;
}

.frdg-pill {
    border-radius: 999px;
    font-size: 12px;
    font-weight: 750;
    padding: 6px 10px;
}

.frdg-pill-safe {
    background: #dcfce7;
    color: #166534;
}

.frdg-pill-warning {
    background: #fff7d6;
    color: #92400e;
}

.frdg-notice {
    border-left: 4px solid;
    border-radius: 9px;
    font-size: 14px;
    margin: 0 0 17px;
    padding: 13px 15px;
}

.frdg-notice-success {
    background: #ecfdf3;
    border-color: var(--frdg-safe);
    color: #166534;
}

.frdg-notice-error {
    background: #fef2f2;
    border-color: var(--frdg-danger);
    color: #991b1b;
}

.frdg-empty {
    background: var(--frdg-soft);
    border: 1px dashed #b9c8d7;
    border-radius: 18px;
    margin-bottom: 18px;
    padding: 30px 22px;
    text-align: center;
}

.frdg-empty > div {
    font-size: 38px;
}

.frdg-empty h3 {
    color: var(--frdg-navy);
    font-size: 20px;
    margin: 8px 0 8px;
}

.frdg-empty p {
    color: var(--frdg-muted);
    margin: 0 auto;
    max-width: 640px;
}

.frdg-status-card {
    align-items: center;
    border: 1px solid;
    border-radius: 18px;
    display: flex;
    gap: 16px;
    margin: 0 0 16px;
    padding: 20px;
}

.frdg-status-icon {
    align-items: center;
    border-radius: 50%;
    display: flex;
    flex: 0 0 48px;
    font-size: 25px;
    font-weight: 900;
    height: 48px;
    justify-content: center;
}

.frdg-status-card span {
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.frdg-status-card h3 {
    color: inherit;
    font-size: 22px;
    margin: 0 0 4px;
}

.frdg-status-card p {
    margin: 0;
}

.frdg-status-safe {
    background: #f0fdf4;
    border-color: #a7e6ba;
    color: #166534;
}

.frdg-status-safe .frdg-status-icon {
    background: #dcfce7;
}

.frdg-status-warning {
    background: #fffbeb;
    border-color: #f5d48a;
    color: #92400e;
}

.frdg-status-warning .frdg-status-icon {
    background: #fef3c7;
}

.frdg-status-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.frdg-status-danger .frdg-status-icon {
    background: #fee2e2;
}

.frdg-metric-grid {
    display: grid;
    gap: 13px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 16px;
}

.frdg-metric {
    background: #fff;
    border: 1px solid var(--frdg-border);
    border-radius: 15px;
    min-width: 0;
    padding: 17px;
}

.frdg-metric > span {
    color: var(--frdg-muted);
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
}

.frdg-metric strong {
    color: var(--frdg-navy);
    display: block;
    font-size: clamp(20px, 2.7vw, 26px);
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.frdg-metric small {
    color: var(--frdg-muted);
    display: block;
    font-size: 11px;
    line-height: 1.4;
    margin-top: 7px;
}

.frdg-progress-card,
.frdg-chart-card {
    margin-bottom: 16px;
    padding: 20px;
}

.frdg-progress-heading,
.frdg-chart-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.frdg-progress-heading {
    color: var(--frdg-navy);
    font-size: 13px;
    font-weight: 750;
    margin-bottom: 9px;
}

.frdg-progress {
    background: #e8edf2;
    border-radius: 999px;
    height: 13px;
    overflow: hidden;
}

.frdg-progress span {
    border-radius: inherit;
    display: block;
    height: 100%;
    min-width: 2px;
    transition: width .45s ease;
}

.frdg-progress-safe { background: var(--frdg-safe); }
.frdg-progress-warning { background: var(--frdg-warning); }
.frdg-progress-danger { background: var(--frdg-danger); }

.frdg-progress-card p {
    color: #475569;
    font-size: 13px;
    line-height: 1.55;
    margin: 12px 0 0;
}

.frdg-chart-heading {
    gap: 15px;
    margin-bottom: 10px;
}

.frdg-chart-heading h3 {
    color: var(--frdg-navy);
    font-size: 17px;
    margin: 0 0 3px;
}

.frdg-chart-heading p {
    color: var(--frdg-muted);
    font-size: 11px;
    margin: 0;
}

.frdg-legend {
    color: var(--frdg-muted);
    flex: 0 0 auto;
    font-size: 11px;
}

.frdg-legend span {
    border-top: 2px dashed var(--frdg-warning);
    display: inline-block;
    margin: 0 5px 3px 0;
    width: 20px;
}

#frdg-chart {
    display: block;
    max-width: 100%;
    width: 100%;
}

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

.frdg-table {
    border-collapse: collapse;
    margin: 0;
    min-width: 680px;
    width: 100%;
}

.frdg-table th,
.frdg-table td {
    border-bottom: 1px solid #e8edf2;
    font-size: 13px;
    padding: 12px 10px;
    text-align: left;
}

.frdg-table th {
    color: #475569;
    font-size: 11px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.frdg-table td {
    color: #334155;
}

.frdg-table tbody tr:last-child td {
    border-bottom: 0;
}

.frdg-row-action {
    text-align: right !important;
}

.frdg-delete {
    color: #b91c1c;
}

.frdg-delete:disabled {
    opacity: .5;
}

.frdg-table-empty {
    color: var(--frdg-muted) !important;
    padding: 24px !important;
    text-align: center !important;
}

.frdg-muted {
    color: var(--frdg-muted);
    font-size: 12px;
}

.frdg-info {
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    line-height: 1.6;
    padding: 17px 19px;
}

.frdg-info strong {
    color: var(--frdg-navy);
}

.frdg-info p {
    margin: 5px 0 0;
}

.frdg-info a {
    color: var(--frdg-blue);
    font-weight: 700;
}

.frdg-login-card {
    background: linear-gradient(145deg, #fff 0%, #f5f9fd 100%);
    margin: 25px auto;
    max-width: 700px;
    padding: clamp(27px, 6vw, 50px);
    text-align: center;
}

.frdg-login-icon {
    font-size: 46px;
}

.frdg-login-card h2 {
    color: var(--frdg-navy);
    font-size: clamp(25px, 4vw, 36px);
    margin: 10px 0;
}

.frdg-login-card p {
    color: var(--frdg-muted);
    margin: 0 auto 22px;
    max-width: 540px;
}

.frdg-login-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

@media (max-width: 900px) {
    .frdg-form,
    .frdg-reading-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .frdg-form-actions {
        grid-column: 1 / -1;
    }

    .frdg-form-actions .frdg-button {
        width: 100%;
    }

    .frdg-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .frdg-hero {
        align-items: flex-start;
        border-radius: 18px;
        min-height: 0;
        padding: 27px 20px 25px;
    }

    .frdg-hero-meter {
        display: none;
    }

    .frdg-hero h2 {
        font-size: 30px;
    }

    .frdg-hero p {
        font-size: 14px;
    }

    .frdg-panel {
        border-radius: 15px;
        padding: 17px;
    }

    .frdg-panel-heading {
        align-items: flex-start;
        gap: 10px;
    }

    .frdg-panel-heading h3 {
        font-size: 17px;
    }

    .frdg-pill {
        max-width: 125px;
        text-align: center;
    }

    .frdg-form,
    .frdg-reading-form,
    .frdg-metric-grid {
        grid-template-columns: 1fr;
    }

    .frdg-field-wide,
    .frdg-form-actions,
    .frdg-check {
        grid-column: auto;
    }

    .frdg-status-card {
        align-items: flex-start;
        padding: 17px;
    }

    .frdg-status-card h3 {
        font-size: 19px;
    }

    .frdg-status-icon {
        flex-basis: 40px;
        height: 40px;
    }

    .frdg-chart-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .frdg-table {
        min-width: 0;
    }

    .frdg-table thead {
        display: none;
    }

    .frdg-table,
    .frdg-table tbody,
    .frdg-table tr,
    .frdg-table td {
        display: block;
        width: 100%;
    }

    .frdg-table tr {
        border-bottom: 1px solid var(--frdg-border);
        padding: 10px 0;
    }

    .frdg-table td {
        align-items: center;
        border: 0;
        display: flex;
        justify-content: space-between;
        padding: 5px 2px;
        text-align: right;
    }

    .frdg-table td::before {
        color: var(--frdg-muted);
        content: attr(data-label);
        font-size: 11px;
        font-weight: 750;
        margin-right: 12px;
        text-transform: uppercase;
    }

    .frdg-row-action {
        justify-content: flex-end !important;
    }

    .frdg-row-action::before {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .frdg-button,
    .frdg-progress span {
        transition: none;
    }
}

