:root {
    --primary: #635bff;
    --primary-dark: #5148e5;
    --primary-soft: #eeecff;

    --green: #22a65a;
    --green-soft: #e8f8ee;

    --yellow: #d99a18;
    --yellow-soft: #fff6dc;

    --red: #dc4c4c;
    --red-soft: #ffe9e9;

    --bg: #f5f6fb;
    --surface: #ffffff;
    --surface-2: #f8f9fc;

    --text: #191d2b;
    --muted: #74798b;
    --border: #e8eaf1;

    --shadow:
        0 8px 30px rgba(35, 39, 58, .07);

    --shadow-hover:
        0 12px 38px rgba(35, 39, 58, .12);

    --radius: 20px;
    --radius-small: 13px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    color: var(--text);

    background:
        radial-gradient(
            circle at top right,
            rgba(99,91,255,.09),
            transparent 340px
        ),
        var(--bg);

    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

.container {
    width: min(1120px, calc(100% - 34px));
    margin: auto;
    padding: 26px 0 70px;
}


/* ========================================
   NAVIGATION
======================================== */

.site-nav {
    display: flex;
    align-items: center;

    gap: 5px;

    padding: 7px;

    margin-bottom: 30px;

    background: rgba(255,255,255,.92);

    border: 1px solid rgba(232,234,241,.9);

    border-radius: 17px;

    box-shadow: var(--shadow);

    backdrop-filter: blur(16px);
}

.site-nav a {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    min-height: 44px;

    padding: 10px 15px;

    border-radius: 11px;

    text-decoration: none;

    font-size: 14px;
    font-weight: 700;

    color: var(--muted);

    transition:
        background .15s ease,
        color .15s ease,
        transform .1s ease;
}

.site-nav a:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.site-nav a:active {
    transform: scale(.96);
}

.site-nav a.active {
    color: var(--primary);
    background: var(--primary-soft);
}

.site-nav .add-person {
    margin-left: auto;

    color: white;
    background: var(--primary);

    box-shadow:
        0 4px 12px rgba(99,91,255,.23);
}

.site-nav .add-person:hover {
    color: white;
    background: var(--primary-dark);
}

.nav-icon {
    font-size: 17px;
}


/* Hide leftover old navigation */

.back,
.nav-button {
    display: none !important;
}


/* ========================================
   PAGE HEADINGS
======================================== */

.page-kicker {
    margin-bottom: 7px;

    color: var(--primary);

    font-size: 12px;
    font-weight: 800;

    letter-spacing: .11em;
    text-transform: uppercase;
}

.page-title,
h1 {
    letter-spacing: -.035em;
}

.page-title {
    margin: 0 0 25px;

    font-size: clamp(31px, 5vw, 42px);
    line-height: 1.08;
}

h2 {
    letter-spacing: -.02em;
}


/* ========================================
   DASHBOARD
======================================== */

.dashboard-grid {
    display: grid;

    grid-template-columns:
        repeat(6, minmax(0, 1fr));

    gap: 12px;

    margin: 0 0 36px;
}

.stat-card {
    position: relative;

    min-height: 112px;

    padding: 19px;

    overflow: hidden;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: var(--radius);

    box-shadow: var(--shadow);

    transition:
        transform .16s ease,
        box-shadow .16s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.stat-number {
    position: relative;

    z-index: 2;

    font-size: 31px;
    font-weight: 850;

    letter-spacing: -.045em;
}

.stat-label {
    position: relative;

    z-index: 2;

    margin-top: 8px;

    color: var(--muted);

    font-size: 13px;
    font-weight: 650;
}


/* ========================================
   CONTACT CARDS
======================================== */

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin: 0 0 14px;
}

.section-heading h2 {
    margin: 0;

    font-size: 22px;
}

.people-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0,1fr));

    gap: 14px;
}

.person-card,
.card {
    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: var(--radius);

    padding: 21px;

    box-shadow: var(--shadow);

    transition:
        transform .15s ease,
        box-shadow .15s ease;
}

.person-card:hover {
    transform: translateY(-2px);

    box-shadow: var(--shadow-hover);
}

.person-name {
    display: inline-block;

    font-size: 23px;
    font-weight: 820;

    letter-spacing: -.03em;

    text-decoration: none;
}

.person-name.green {
    color: #168a48;
}

.person-name.yellow {
    color: #a76f00;
}

.person-name.red {
    color: #c53c3c;
}

.person-name.unknown {
    color: var(--text);
}

.person-meta,
.info {
    margin-top: 7px;

    color: var(--muted);

    font-size: 14px;
    line-height: 1.55;
}

.status-pill {
    display: inline-flex;
    align-items: center;

    margin-top: 13px;

    padding: 7px 11px;

    border-radius: 999px;

    font-size: 12px;
    font-weight: 800;
}

.status-pill.green {
    color: #13743d;
    background: var(--green-soft);
}

.status-pill.yellow {
    color: #8b6005;
    background: var(--yellow-soft);
}

.status-pill.red {
    color: #a42d2d;
    background: var(--red-soft);
}

.status-pill.unknown {
    color: var(--muted);
    background: #edf0f5;
}


/* ========================================
   BUTTONS
======================================== */

button,
.button,
.called-button,
.call-button,
.save,
.regenerate {
    min-height: 44px;

    border: 0;

    border-radius: 12px;

    font-family: inherit;
    font-size: 14px;
    font-weight: 750;

    cursor: pointer;

    transition:
        transform .1s ease,
        box-shadow .15s ease,
        opacity .15s ease,
        background .15s ease;
}

button:active,
.button:active,
.called-button:active,
.call-button:active,
.save:active,
.regenerate:active {
    transform: scale(.96);
}

.actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 8px;

    margin-top: 18px;
}

.actions form {
    margin: 0;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 10px 14px;

    text-decoration: none;
}

.button-call,
.called-button {
    color: white;

    background: var(--green);

    box-shadow:
        0 4px 12px rgba(34,166,90,.18);
}

.button-edit {
    color: var(--primary);

    background: var(--primary-soft);
}

.button-delete {
    color: #b23b3b;

    background: var(--red-soft);
}

.save {
    width: 100%;

    padding: 12px 18px;

    color: white;

    background: var(--primary);

    box-shadow:
        0 5px 16px rgba(99,91,255,.2);
}


/* ========================================
   FORMS
======================================== */

.page-settings .container,
.page-form .container,
.page-person .container {
    max-width: 820px;
}

label {
    font-weight: 700;
}

input,
select {
    width: 100%;

    min-height: 49px;

    margin-top: 7px;

    padding: 11px 13px;

    color: var(--text);

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 12px;

    outline: 0;

    font: inherit;
    font-size: 16px;

    transition:
        border .15s ease,
        box-shadow .15s ease;
}

input:focus,
select:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 4px rgba(99,91,255,.11);
}

.time-row {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 14px;
}


/* Settings day choices */

.days {
    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 9px;

    margin-top: 13px;
}

.day {
    display: flex;
    align-items: center;

    gap: 9px;

    min-height: 50px;

    padding: 11px 13px;

    color: var(--text);

    background: var(--surface-2);

    border: 1px solid var(--border);

    border-radius: 12px;

    cursor: pointer;

    transition:
        border .15s ease,
        background .15s ease;
}

.day:has(input:checked) {
    color: var(--primary);

    background: var(--primary-soft);

    border-color: rgba(99,91,255,.3);
}

.day input {
    width: 18px;
    height: 18px;

    min-height: 0;

    margin: 0;

    accent-color: var(--primary);
}

.note {
    margin-top: 8px;

    color: var(--muted);

    font-size: 13px;
    line-height: 1.5;
}


/* ========================================
   CALENDAR
======================================== */

.page-calendar .container {
    max-width: 1180px;
}

.page-calendar .header {
    margin-bottom: 15px;
}

.help {
    margin-bottom: 15px;

    padding: 11px 14px;

    color: #54597b;

    background: var(--primary-soft);

    border-radius: 12px;

    font-size: 13px;
}

.regenerate {
    padding: 10px 15px !important;

    color: white !important;

    background: var(--text) !important;
}

#calendar {
    padding: 18px;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: var(--radius);

    box-shadow: var(--shadow);

    overflow: hidden;
}

.fc {
    font-family: inherit !important;
}

.fc .fc-toolbar-title {
    color: var(--text);

    font-size: 23px !important;
    font-weight: 820 !important;

    letter-spacing: -.025em;
}

.fc .fc-button {
    min-height: 40px;

    padding: 8px 12px !important;

    border: 0 !important;

    border-radius: 10px !important;

    font-weight: 700 !important;

    box-shadow: none !important;
}

.fc .fc-button-primary {
    color: var(--primary) !important;

    background: var(--primary-soft) !important;
}

.fc .fc-button-primary:hover {
    background: #e5e1ff !important;
}

.fc .fc-button-primary.fc-button-active {
    color: white !important;

    background: var(--primary) !important;
}

.fc .fc-daygrid-day-number,
.fc .fc-col-header-cell-cushion {
    color: var(--text);

    text-decoration: none;
}

.fc .fc-daygrid-day-number {
    padding: 7px !important;

    font-weight: 650;
}

.fc .fc-col-header-cell-cushion {
    padding: 9px 3px !important;

    color: var(--muted);

    font-size: 12px;
    font-weight: 750;
}

.fc .fc-event {
    padding: 3px 5px !important;

    border: 0 !important;

    border-radius: 8px !important;

    font-size: 11px;

    cursor: pointer;
}


/* Agenda */

.fc-list {
    border: 0 !important;
}

.fc .fc-list-day-cushion {
    margin-top: 5px;

    padding: 11px 13px !important;

    color: #44495f;

    background: var(--surface-2) !important;

    border-radius: 11px;

    font-weight: 800;
}

.fc-list-event td {
    padding-top: 14px !important;
    padding-bottom: 14px !important;

    border-color: var(--border) !important;
}

.fc-list-event-time {
    width: 92px;

    color: var(--muted);

    font-weight: 750;
}

.fc-list-event-title {
    font-weight: 750;
}

.fc-list-event-title a {
    color: var(--text) !important;

    text-decoration: none !important;
}


/* ========================================
   CALL POPUP
======================================== */

.modal-background {
    backdrop-filter: blur(6px);
}

.modal {
    border: 1px solid var(--border) !important;

    border-radius: 22px !important;

    box-shadow:
        0 30px 80px rgba(20,24,38,.25) !important;
}


/* ========================================
   MOBILE
======================================== */

@media(max-width: 850px) {

    .dashboard-grid {
        grid-template-columns:
            repeat(3, minmax(0,1fr));
    }

}


@media(max-width: 650px) {

    body {
        padding-bottom:
            calc(82px + env(safe-area-inset-bottom));
    }

    .container {
        width: calc(100% - 18px);

        padding-top: 13px;
        padding-bottom: 24px;
    }


    /* Bottom navigation */

    .site-nav {
        position: fixed;

        z-index: 9999;

        left: 8px;
        right: 8px;
        bottom: 7px;

        margin: 0;

        padding:
            6px
            5px
            calc(6px + env(safe-area-inset-bottom));

        border-radius: 20px;

        box-shadow:
            0 -7px 30px rgba(31,35,52,.14);
    }

    .site-nav a,
    .site-nav .add-person {
        flex: 1;
        flex-direction: column;

        gap: 1px;

        margin: 0;

        min-height: 55px;

        padding: 6px 2px;

        color: var(--muted);

        background: transparent;

        font-size: 10px;
    }

    .site-nav a.active,
    .site-nav .add-person.active {
        color: var(--primary);

        background: var(--primary-soft);
    }

    .nav-icon {
        font-size: 20px;
    }


    /* Dashboard */

    .page-title {
        margin-bottom: 18px;

        font-size: 31px;
    }

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

        gap: 9px;

        margin-bottom: 29px;
    }

    .stat-card {
        min-height: 97px;

        padding: 15px;

        border-radius: 16px;
    }

    .stat-number {
        font-size: 27px;
    }

    .stat-label {
        font-size: 12px;
    }


    /* Contacts */

    .people-grid {
        grid-template-columns: 1fr;
    }

    .person-card,
    .card {
        padding: 17px;

        border-radius: 17px;
    }

    .person-name {
        font-size: 22px;
    }

    .actions {
        display: grid;

        grid-template-columns:
            repeat(3, minmax(0,1fr));
    }

    .actions a,
    .actions form,
    .actions button {
        width: 100%;
    }


    /* Forms */

    .time-row {
        grid-template-columns: 1fr;
    }

    .days {
        grid-template-columns: 1fr 1fr;
    }


    /* Calendar */

    #calendar {
        padding: 10px;

        border-radius: 17px;
    }

    .page-calendar .header {
        display: block;
    }

    .fc .fc-toolbar {
        flex-direction: column;

        gap: 8px;

        align-items: stretch !important;
    }

    .fc .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
    }

    .fc .fc-toolbar-title {
        font-size: 20px !important;
    }

    .fc .fc-button {
        font-size: 12px !important;
    }

    .fc-list-event-time {
        width: 78px;

        font-size: 12px;
    }

    .fc-list-event-title {
        font-size: 14px;
    }


    /* Call bottom sheet */

    .modal-background {
        padding: 0 !important;

        align-items: flex-end;
    }

    .modal {
        width: 100% !important;
        max-width: none !important;

        max-height: 88vh;

        margin: 0 !important;

        padding:
            22px
            17px
            calc(
                22px
                + env(safe-area-inset-bottom)
            )
            !important;

        overflow-y: auto;

        border-radius:
            24px 24px 0 0 !important;
    }

}


/* =====================================================
   KEEPINTOUCH APP SHELL V3
===================================================== */

.app-container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 70px;
}

.app-content {
    width: 100%;
}


/* -----------------------------
   DASHBOARD HEADER
------------------------------ */

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin: 8px 0 22px;
}

.dashboard-header h1 {
    margin: 0;

    font-size: 38px;
    font-weight: 850;
    letter-spacing: -.045em;
}

.primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    min-height: 46px;

    padding: 11px 16px;

    color: white;
    background:
        linear-gradient(
            135deg,
            #635bff,
            #8b5cf6
        );

    border-radius: 13px;

    box-shadow:
        0 7px 20px rgba(99,91,255,.25);

    text-decoration: none;

    font-weight: 750;
    font-size: 14px;

    transition:
        transform .12s ease,
        box-shadow .15s ease;
}

.primary-action:active {
    transform: scale(.96);
}


/* -----------------------------
   DASHBOARD STATS
------------------------------ */

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(6, minmax(0, 1fr));

    gap: 12px;

    margin-bottom: 34px;
}

.stats-grid .stat-card {
    position: relative;

    min-height: 128px;

    display: flex;
    flex-direction: column;
    justify-content: flex-end;

    padding: 17px;

    overflow: hidden;
}

.stat-icon {
    position: absolute;

    top: 14px;
    right: 14px;

    width: 32px;
    height: 32px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    font-size: 15px;
    font-weight: 900;

    background: #f2f3f8;
}

.stat-primary .stat-icon,
.stat-purple .stat-icon {
    color: #635bff;
    background: #eeecff;
}

.stat-green .stat-icon {
    color: #168a48;
    background: #e8f8ee;
}

.stat-yellow .stat-icon {
    color: #a56c00;
    background: #fff4d4;
}

.stat-red .stat-icon {
    color: #c43c3c;
    background: #ffe9e9;
}

.stats-grid .stat-number {
    font-size: 31px;
}

.stats-grid .stat-label {
    margin-top: 4px;
}


/* -----------------------------
   PEOPLE SECTION
------------------------------ */

.people-section {
    margin-top: 5px;
}

.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    margin-bottom: 13px;
}

.section-header h2 {
    margin: 0;

    font-size: 23px;
    font-weight: 820;
}

.section-header p {
    margin: 4px 0 0;

    color: var(--muted);

    font-size: 13px;
}


/* -----------------------------
   CONTACT CARDS
------------------------------ */

.person-card {
    position: relative;

    overflow: hidden;

    border-left: 4px solid transparent;
}

.status-border-green {
    border-left-color: #28a865;
}

.status-border-yellow {
    border-left-color: #dda31e;
}

.status-border-red {
    border-left-color: #df5454;
}

.status-border-unknown {
    border-left-color: #a8afbd;
}

.person-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 14px;
}

.person-role {
    margin-top: 4px;

    color: var(--muted);

    font-size: 13px;
}

.person-details {
    display: grid;

    gap: 8px;

    margin-top: 18px;
}

.detail-row {
    display: flex;
    align-items: center;

    gap: 9px;

    color: #666d80;

    font-size: 14px;
}

.detail-icon {
    width: 24px;
    height: 24px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 24px;

    color: #777e91;

    background: #f2f4f8;

    border-radius: 8px;

    font-size: 12px;
    font-weight: 800;
}

.detail-warning {
    color: #a56c00;
}


/* -----------------------------
   CONTACT ACTION BAR
------------------------------ */

.person-actions {
    display: flex;
    align-items: center;

    gap: 7px;

    margin-top: 19px;

    padding-top: 15px;

    border-top: 1px solid var(--border);
}

.person-actions form {
    margin: 0;
}

.contact-action {
    min-height: 39px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 8px 12px;

    border: 0;
    border-radius: 10px;

    text-decoration: none;

    font: inherit;
    font-size: 13px;
    font-weight: 750;

    cursor: pointer;

    transition:
        transform .1s ease,
        background .15s ease;
}

.contact-action:active {
    transform: scale(.95);
}

.action-called {
    color: white;
    background: #22a65a;
}

.action-phone {
    color: #635bff;
    background: #eeecff;
}

.action-edit {
    color: #525869;
    background: #f0f2f6;
}

.action-more {
    color: #bc4646;
    background: #ffecec;
}


/* -----------------------------
   EMPTY STATE
------------------------------ */

.empty-state {
    padding: 48px 25px;

    text-align: center;

    background: white;

    border: 1px dashed #dfe2ea;
    border-radius: 20px;
}

.empty-icon {
    margin-bottom: 10px;

    font-size: 34px;
}

.empty-state h3 {
    margin: 0 0 18px;
}


/* =====================================================
   PHONE
===================================================== */

@media(max-width: 650px) {

    .app-container {
        width: calc(100% - 18px);

        padding:
            10px
            0
            calc(
                92px
                + env(safe-area-inset-bottom)
            );
    }


    .dashboard-header {
        margin-top: 9px;
        margin-bottom: 17px;
    }

    .dashboard-header h1 {
        font-size: 31px;
    }

    .dashboard-header .primary-action {
        display: none;
    }


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

        gap: 9px;

        margin-bottom: 28px;
    }

    .stats-grid .stat-card {
        min-height: 108px;

        padding: 14px;

        border-radius: 17px;
    }

    .stats-grid .stat-number {
        font-size: 28px;
    }

    .stat-icon {
        width: 29px;
        height: 29px;

        top: 11px;
        right: 11px;
    }


    .people-grid {
        grid-template-columns: 1fr;
    }


    .person-card {
        padding: 16px 16px 15px;

        border-radius: 17px;
    }

    .person-name {
        font-size: 22px;
    }

    .status-pill {
        max-width: 44%;

        text-align: center;
    }


    .person-actions {
        display: grid;

        grid-template-columns:
            repeat(3, minmax(0,1fr));

        gap: 7px;
    }

    .person-actions form,
    .person-actions .contact-action,
    .person-actions button {
        width: 100%;
    }

    .person-actions form:last-child {
        display: none;
    }


    .contact-action {
        min-height: 42px;

        padding: 8px 7px;

        font-size: 12px;
    }

}


/* =====================================================
   CALENDAR + SETTINGS APP UI V5
===================================================== */

.page-eyebrow {
    margin-bottom: 5px;

    color: var(--primary);

    font-size: 11px;
    font-weight: 850;

    letter-spacing: .13em;
}


/* =====================================================
   CALENDAR
===================================================== */

.calendar-page {
    width: 100%;
}

.calendar-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 18px;

    margin:
        8px 0 18px;
}

.calendar-header h1 {
    margin: 0;

    font-size: 38px;
    font-weight: 850;

    letter-spacing: -.045em;
}

.calendar-header p {
    margin: 6px 0 0;

    color: var(--muted);

    font-size: 14px;
}

.rebalance-button {
    min-height: 43px;

    padding: 9px 14px;

    color: #565d70;

    background: white;

    border: 1px solid var(--border);

    border-radius: 12px;

    box-shadow:
        0 3px 12px rgba(31,35,52,.05);
}

.calendar-help {
    margin-bottom: 13px;

    padding: 11px 14px;

    color: #666c7e;

    background:
        linear-gradient(
            135deg,
            #f0efff,
            #f8f7ff
        );

    border: 1px solid #e9e6ff;

    border-radius: 13px;

    font-size: 13px;
    line-height: 1.45;
}


/* Main calendar shell */

.calendar-page #calendar {
    padding: 18px;

    background: white;

    border: 1px solid var(--border);

    border-radius: 22px;

    box-shadow:
        0 10px 35px rgba(36,40,60,.07);
}


/* FullCalendar toolbar */

.calendar-page .fc .fc-toolbar {
    gap: 10px;
}

.calendar-page .fc-toolbar-title {
    color: var(--text);

    font-size: 22px !important;
    font-weight: 830 !important;

    letter-spacing: -.03em;
}

.calendar-page .fc-button {
    min-height: 40px !important;

    padding: 8px 12px !important;

    color: #555d70 !important;

    background: #f5f6fa !important;

    border: 0 !important;

    border-radius: 11px !important;

    box-shadow: none !important;

    font-family: inherit !important;
    font-weight: 750 !important;
}

.calendar-page .fc-button:hover {
    color: var(--primary) !important;

    background: var(--primary-soft) !important;
}

.calendar-page .fc-button-active {
    color: white !important;

    background:
        linear-gradient(
            135deg,
            #635bff,
            #8b5cf6
        )
        !important;
}


/* Month */

.calendar-page .fc-scrollgrid {
    overflow: hidden;

    border: 1px solid var(--border) !important;

    border-radius: 15px;
}

.calendar-page .fc-theme-standard td,
.calendar-page .fc-theme-standard th {
    border-color: #eceef4 !important;
}

.calendar-page .fc-col-header-cell-cushion {
    padding: 10px 4px !important;

    color: #858a99;

    text-decoration: none;

    font-size: 12px;
    font-weight: 750;
}

.calendar-page .fc-daygrid-day-number {
    padding: 7px !important;

    color: #3f4554;

    text-decoration: none;

    font-weight: 650;
}

.calendar-page .fc-day-today {
    background:
        rgba(99,91,255,.045)
        !important;
}

.calendar-page .fc-day-today
.fc-daygrid-day-number {
    width: 30px;
    height: 30px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin: 4px;

    padding: 0 !important;

    color: white;

    background: var(--primary);

    border-radius: 50%;
}


/* Calendar events */

.calendar-page .fc-event {
    padding: 4px 6px !important;

    border: 0 !important;
    border-radius: 8px !important;

    cursor: pointer;

    font-size: 12px;

    box-shadow:
        0 2px 7px rgba(30,34,50,.08);
}


/* Agenda/List */

.calendar-page .fc-list {
    border: 0 !important;
}

.calendar-page .fc-list-table {
    border-collapse: separate !important;

    border-spacing: 0 7px !important;
}

.calendar-page .fc-list-day-cushion {
    padding: 10px 12px !important;

    color: #656b7c;

    background: #f6f7fb !important;

    border-radius: 10px;

    font-size: 13px;
    font-weight: 800;
}

.calendar-page .fc-list-event td {
    padding-top: 15px !important;
    padding-bottom: 15px !important;

    background: white;

    border-color: #eef0f5 !important;
}

.calendar-page .fc-list-event-time {
    width: 90px;

    color: #656b7c;

    white-space: nowrap;

    font-weight: 750;
}

.calendar-page .fc-list-event-title {
    font-weight: 780;
}

.calendar-page .fc-list-event-title a {
    color: var(--text) !important;

    text-decoration: none !important;
}


/* =====================================================
   CALL SHEET
===================================================== */

.modal-background {
    display: none;

    position: fixed;
    inset: 0;

    z-index: 10000;

    padding: 18px;

    background:
        rgba(16,20,32,.48);

    backdrop-filter:
        blur(7px);
}

.modal {
    width: min(500px, 100%);

    margin: 7vh auto 0;

    padding: 23px;

    background: white;

    border: 1px solid var(--border);

    border-radius: 23px;

    box-shadow:
        0 30px 90px rgba(12,17,30,.28);
}

.modal h2 {
    margin: 0 0 13px;

    font-size: 27px;
    font-weight: 850;

    letter-spacing: -.035em;
}

.modal-info {
    margin: 6px 0;

    color: var(--muted);

    font-size: 14px;
}

.section-title {
    margin-top: 24px;

    color: #474d5c;

    font-size: 13px;
    font-weight: 800;
}

.action-row {
    display: flex;
    flex-wrap: wrap;

    gap: 8px;

    margin-top: 10px;
}

.action-row button {
    flex: 1;

    min-width: 105px;
    min-height: 43px;

    border-radius: 11px;
}

.called-button {
    color: white;
    background: #22a65a;
}

.missed-button {
    color: #ba3c3c;
    background: #ffecec;
}

.unknown-button {
    color: #555c6c;
    background: #eff1f5;
}

.move-button {
    color: var(--primary);
    background: var(--primary-soft);
}

.call-phone {
    display: block;

    margin-top: 16px;
    padding: 12px 15px;

    color: white;

    background:
        linear-gradient(
            135deg,
            #635bff,
            #8b5cf6
        );

    border-radius: 12px;

    text-align: center;
    text-decoration: none;

    font-weight: 800;
}

.time-input {
    width: 100%;

    margin-top: 8px;
}

.close-button {
    width: 100%;

    margin-top: 10px;

    color: #555c6c;
    background: #f0f2f6;
}


/* =====================================================
   SETTINGS
===================================================== */

.settings-page {
    width: min(760px, 100%);

    margin: 0 auto;
}

.settings-header {
    margin:
        8px 0 20px;
}

.settings-header h1 {
    margin: 0;

    font-size: 38px;
    font-weight: 850;

    letter-spacing: -.045em;
}

.settings-header p {
    max-width: 520px;

    margin: 7px 0 0;

    color: var(--muted);

    font-size: 14px;
    line-height: 1.5;
}

.settings-card {
    margin-bottom: 13px;

    padding: 22px;

    background: white;

    border: 1px solid var(--border);

    border-radius: 19px;

    box-shadow:
        0 7px 25px rgba(35,39,58,.055);
}

.settings-card h2 {
    margin:
        0 0 17px;

    font-size: 20px;
    font-weight: 820;

    letter-spacing: -.025em;
}

.settings-card p {
    color: #626879;

    font-size: 14px;
    line-height: 1.45;
}

.settings-page .time-row {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 12px;
}

.settings-page .time-box label {
    display: block;

    color: #4d5362;

    font-size: 13px;
}

.settings-page input,
.settings-page select {
    background: #f8f9fc;
}

.settings-page .note {
    color: #878c9b;

    font-size: 12px;
}


/* Day selectors */

.settings-page .days {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0,1fr));

    gap: 8px;
}

.settings-page .day {
    position: relative;

    min-height: 46px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 9px;

    color: #646a79;

    background: #f6f7fa;

    border: 1px solid #eceef3;

    border-radius: 11px;

    text-align: center;

    font-size: 13px;
    font-weight: 750;

    cursor: pointer;
}

.settings-page .day input {
    position: absolute;

    width: 1px;
    height: 1px;
    min-height: 0;

    opacity: 0;
}

.settings-page .day:has(input:checked) {
    color: var(--primary);

    background: var(--primary-soft);

    border-color:
        rgba(99,91,255,.24);
}


/* Normal Settings checkbox, e.g. notifications */

.settings-page
input[type="checkbox"]:not(.day input) {
    width: 20px;
    height: 20px;

    min-height: 0;

    margin: 0 7px 0 0;

    accent-color: var(--primary);
}


/* Save button */

.settings-page .save {
    min-height: 52px;

    margin-top: 9px;

    color: white;

    background:
        linear-gradient(
            135deg,
            #635bff,
            #8b5cf6
        );

    border-radius: 14px;

    font-weight: 800;

    box-shadow:
        0 7px 20px rgba(99,91,255,.22);
}


/* Test notification */

.settings-page
form[action*="test-notification"]
button {
    width: 100%;

    min-height: 49px;

    margin-top: 10px;

    color: #187848;

    background: #eaf9f1;

    border-radius: 14px;

    font-weight: 800;
}


/* =====================================================
   PHONE CALENDAR + SETTINGS
===================================================== */

@media(max-width: 650px) {

    .calendar-header,
    .settings-header {
        margin-top: 8px;
    }

    .calendar-header h1,
    .settings-header h1 {
        font-size: 31px;
    }

    .calendar-header p,
    .settings-header p {
        font-size: 13px;
    }

    .calendar-header {
        align-items: center;
    }

    .rebalance-button {
        padding: 8px 10px;

        font-size: 12px;
    }


    .calendar-help {
        padding: 9px 11px;

        font-size: 12px;
    }


    .calendar-page #calendar {
        padding: 11px;

        border-radius: 18px;
    }


    /* FullCalendar phone toolbar */

    .calendar-page .fc-header-toolbar {
        display: grid !important;

        grid-template-columns:
            auto 1fr auto;

        align-items: center !important;

        gap: 6px !important;

        margin-bottom: 15px !important;
    }

    .calendar-page
    .fc-header-toolbar
    .fc-toolbar-chunk {
        display: flex;

        align-items: center;
        justify-content: center;
    }

    .calendar-page
    .fc-header-toolbar
    .fc-toolbar-chunk:first-child {
        justify-content: flex-start;
    }

    .calendar-page
    .fc-header-toolbar
    .fc-toolbar-chunk:last-child {
        justify-content: flex-end;
    }

    .calendar-page .fc-toolbar-title {
        font-size: 17px !important;

        white-space: nowrap;
    }

    .calendar-page .fc-button {
        min-height: 37px !important;

        padding: 7px 10px !important;

        font-size: 12px !important;
    }


    .calendar-page .fc-footer-toolbar {
        justify-content: center !important;

        margin:
            2px 0 14px !important;
    }

    .calendar-page
    .fc-footer-toolbar
    .fc-toolbar-chunk {
        width: 100%;

        display: flex;
        justify-content: center;
    }


    /* Mobile agenda */

    .calendar-page .fc-list-event-time {
        width: 73px;

        padding-left: 7px !important;

        font-size: 12px;
    }

    .calendar-page .fc-list-event-title {
        font-size: 14px;
    }


    /* Settings */

    .settings-page .settings-card {
        padding: 17px;

        border-radius: 17px;
    }

    .settings-page
    .settings-card h2 {
        margin-bottom: 14px;

        font-size: 18px;
    }

    .settings-page .time-row {
        grid-template-columns:
            1fr 1fr;

        gap: 8px;
    }

    .settings-page .days {
        grid-template-columns:
            repeat(2, minmax(0,1fr));
    }

    .settings-page .day {
        min-height: 44px;
    }


    /* Mobile call bottom sheet */

    .modal-background {
        align-items: flex-end;

        padding: 0;
    }

    .modal-background[style*="block"] {
        display: flex !important;
    }

    .modal {
        width: 100%;
        max-width: none;

        max-height: 88vh;

        margin: auto 0 0;

        padding:
            21px
            16px
            calc(
                24px
                + env(safe-area-inset-bottom)
            );

        overflow-y: auto;

        border-radius:
            24px 24px 0 0;
    }

    .modal h2 {
        font-size: 25px;
    }

}
