/* =========================================================
   Real Pillbox UI styles
   ========================================================= */

/* =========================================================
   1. COMMON VARIABLES / THEME TOKENS
   ========================================================= */

:root {
    /* Base colors */
    --app-bg: #ffffff;
    --app-dark: #464753;
    --app-card-bg: #ffffff;
    --app-border: rgba(31, 35, 40, 0.09);
    --app-muted: #7a7f8c;
    --app-text: #1f2328;
    --app-text-soft: #5d6470;
    --app-control-bg: #f7f8fb;

    /* Active primary palette */
    --app-primary: #405189;
    --app-primary-hover-bg: #364574;
    --app-primary-hover-border: #33416e;
    --app-primary-active-bg: #33416e;
    --app-primary-active-border: #303d67;
    --app-primary-focus-rgb: 93, 107, 159;
    --app-primary-soft-bg: rgba(64, 81, 137, 0.08);
    --app-primary-soft-bg-strong: rgba(64, 81, 137, 0.10);
    --app-primary-soft-border: rgba(64, 81, 137, 0.28);
    --app-primary-nav-bg: rgba(64, 81, 137, 0.14);
    --app-primary-focus-border: rgba(64, 81, 137, 0.24);

    /* Alternative blue palette */
    /* --app-primary: #0da1fd;
    --app-primary-hover-bg: #0b8fe0;
    --app-primary-hover-border: #0a86d1;
    --app-primary-active-bg: #087cc2;
    --app-primary-active-border: #0774b5;
    --app-primary-focus-rgb: 49, 171, 253;
    --app-primary-soft-bg: rgba(13, 161, 253, 0.08);
    --app-primary-soft-bg-strong: rgba(13, 161, 253, 0.10);
    --app-primary-soft-border: rgba(13, 161, 253, 0.28);
    --app-primary-nav-bg: rgba(13, 161, 253, 0.14);
    --app-primary-focus-border: rgba(13, 161, 253, 0.24); */
   

    /* Status colors */
    --app-success: #166534;
    --app-success-bg: rgba(34, 197, 94, 0.12);
    --app-danger: #991b1b;
    --app-danger-bg: rgba(220, 53, 69, 0.10);
    --app-warning: #92400e;
    --app-warning-text: #6f4e05;
    --app-warning-bg: rgba(245, 158, 11, 0.12);
    --app-warning-bg-strong: rgba(245, 158, 11, 0.14);
    --app-neutral-bg: rgba(107, 114, 128, 0.12);

    /* Layout sizes */
    --app-header-height: 50px;
    --app-logo-top: 10px;
    --app-bottom-nav-height: 78px;
    --app-card-radius: 20px;
    --app-header-total: calc(var(--app-header-height) + env(safe-area-inset-top, 0px));
    --app-bottom-total: calc(var(--app-bottom-nav-height) + env(safe-area-inset-bottom, 0px));
    --app-card-overlap: 24px;
    --app-card-gap: 32px;

    /* rounded buttons */
    --app-floating-action-size: 54px;
    --app-floating-action-icon-size: 26px;
    --app-floating-action-shadow: 0 2px 5px rgba(64, 81, 137, 0.26);

    /* Background pattern */
    --app-pattern-bg: url("/static/project/img/main_bg.png");
    --app-pattern-size: 420px 420px;

    /* Animations */
    --motion-ease-standard: cubic-bezier(0.2, 0.8, 0.2, 1);
    --today-tab-indicator-duration: 500ms; /* top block today/tommorow */
    --today-panel-slide-duration: 600ms; /* content card */
    --today-panel-height-duration: 240ms; /* height animation */
}

/* =========================================================
   2. COMMON BASE / RESET
   ========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--app-bg);
    color: var(--app-text);
    -webkit-font-smoothing: antialiased;
}

/* =========================================================
   3. COMMON BOOTSTRAP OVERRIDES
   ========================================================= */

.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--app-primary);
    --bs-btn-border-color: var(--app-primary);
    --bs-btn-hover-bg: var(--app-primary-hover-bg);
    --bs-btn-hover-border-color: var(--app-primary-hover-border);
    --bs-btn-focus-shadow-rgb: var(--app-primary-focus-rgb);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--app-primary-active-bg);
    --bs-btn-active-border-color: var(--app-primary-active-border);
}

.form-switch .form-check-input:checked {
    background-color: var(--app-primary);
    border-color: var(--app-primary);
}

.form-switch .form-check-input:focus {
    border-color: var(--app-primary);
    box-shadow: none;
}

.form-control,
.form-select {
    max-height: 42px;
    border-radius: 8px;
    font-size: 16px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--app-primary-focus-border);
    box-shadow: none;
    outline: none;
}

.form-check-input:focus {
    box-shadow: none;
    outline: none;
}

.btn {
    min-height: 48px;
    border-radius: 8px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.15;
}

.btn.w-100 {
    display: flex;
}

.btn:focus,
.btn:focus-visible,
.btn:active:focus {
    box-shadow: none;
    outline: none;
}

.alert {
    border-radius: 8px;
}

.readonly-control {
    background: var(--app-control-bg) !important;
    color: #69707d !important;
}

/* =========================================================
   4. COMMON APP SHELL / LAYOUT
   ========================================================= */

.app-root {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: var(--app-bg);
}

.app-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    height: var(--app-header-total);
    background: #4647531f;
}

.app-topbar-logo {
    position: absolute;
    top: calc(env(safe-area-inset-top, 0px) + var(--app-logo-top));
    left: 50%;
    width: 30px;
    height: 30px;
    transform: translateX(-50%);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4ade80, #22c55e);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
    font-size: 20px;
    font-weight: 800;
}

.app-topbar-logo span {
    color: #ffffff;
}

.app-auth-warning {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 8px;
    margin: 0;
    border-radius: 18px;
}

/* COMMON: floating round actions */

.app-floating-action {
    position: fixed;
    z-index: 70;
    width: var(--app-floating-action-size);
    height: var(--app-floating-action-size);
    border-radius: 50%;
    background: var(--app-primary);
    color: #ffffff;
    border: 1px solid rgba(31, 35, 40, 0.08);
    /* box-shadow: var(--app-floating-action-shadow); */
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    transition:
        transform 160ms ease,
        background-color 160ms ease,
        opacity 160ms ease;
}

.assignment-list.has-floating-add {
    padding-bottom: 86px;
}

.app-floating-action i {
    font-size: var(--app-floating-action-icon-size);
    line-height: 1;
}

.app-floating-action:active {
    transform: translateY(1px) scale(0.94);
}

.app-floating-action-add {
    right: 18px;
    bottom: calc(var(--app-bottom-total) + 18px);
}

.app-floating-action-back {
    top: calc(env(safe-area-inset-top, 0px) + 55px);
    left: 14px;
}

@media (min-width: 768px) {
    .app-floating-action-add {
        right: auto;
        left: calc(50% + 188px);
    }

    .app-floating-action-back {
        left: calc(50% - 260px + 14px);
    }
}

/* back round button for assignments form */
.app-floating-back i {
    font-size: 24px;
    line-height: 1;
}

.app-floating-back:active {
    transform: scale(0.94);
    background: rgba(255, 255, 255, 0.9);
}

@media (min-width: 768px) {
    .app-floating-back {
        left: calc(50% - 260px + 14px);
    }
}
/* end back round button */

.app-scroll {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: var(--app-bottom-total);
    z-index: 10;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    scrollbar-width: none;
    background-color: #8ae7dc;
    background-image: var(--app-pattern-bg);
    background-repeat: repeat;
    background-size: var(--app-pattern-size);
    background-position: center top;
}

.app-scroll::-webkit-scrollbar {
    display: none;
}

.app-page-spacer {
    height: calc(var(--app-header-total) + var(--app-card-overlap) + var(--app-card-gap));
    background: transparent;
}

.app-card {
    position: relative;
    z-index: 20;
    min-height: calc(100dvh - var(--app-header-total) - var(--app-bottom-total) - var(--app-card-gap));
    padding: 34px 18px;
    background: var(--app-card-bg);
    border-radius: var(--app-card-radius) var(--app-card-radius) 0 0;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.12);
}

.app-section-today .app-card,
.app-section-assignments .app-card {
    margin-top: calc(var(--app-card-overlap) * -1);
}

.app-section-settings .app-scroll {
    display: flex;
    flex-direction: column;
}

.app-section-settings .app-card {
    margin-top: -26px;
    min-height: 0;
    flex: 1 0 auto;
    padding-top: 34px;
    padding-bottom: 20px;
}

/* =========================================================
   5. COMMON TYPOGRAPHY / CARDS
   ========================================================= */

.content-title {
    margin: 0 0 12px;
    font-size: 31px;
    line-height: 1.12;
    font-weight: 800;
}

.content-subtitle {
    margin-top: -2px;
    margin-bottom: 26px;
    color: var(--app-muted);
    font-size: 15px;
}

.app-section-today .content-title,
.app-section-today .content-subtitle,
.app-section-assignments .content-title,
.app-section-assignments .content-subtitle {
    text-align: center;
}

.soft-card {
    border: 1px solid var(--app-border);
    border-radius: 24px;
    padding: 22px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(31, 35, 40, 0.04);
}

.field-error {
    color: #dc3545;
    font-size: 13px;
}

/* =========================================================
   6. COMMON BOTTOM NAVIGATION
   ========================================================= */

.app-bottom-nav,
.app-bottom-nav-inline {
    height: var(--app-bottom-total);
    padding: 8px 14px calc(8px + env(safe-area-inset-bottom, 0px));
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--app-border);
    backdrop-filter: blur(14px);
}

.app-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    transition:
        opacity 0.16s ease,
        transform 0.16s ease;
}

.app-bottom-nav-inline {
    display: none;
}

.app-bottom-nav-item {
    text-decoration: none;
    min-width: 70px;
    color: #9aa0aa;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 11px;
    font-weight: 700;
}

.app-bottom-nav-item i {
    font-size: 30px;
    line-height: 1;
}

.app-bottom-nav-item.active {
    color: var(--app-primary);
    background: var(--app-primary-nav-bg);
}

.app-bottom-nav-item:active {
    transform: scale(0.98);
}

/* =========================================================
   7. COMMON KEYBOARD / VIEWPORT STATES
   ========================================================= */

html.keyboard-open .app-bottom-nav {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(calc(100% + 24px)) !important;
}

html.keyboard-open .app-scroll {
    bottom: 0 !important;
}

html.keyboard-open .app-bottom-nav-inline {
    display: flex;
}

/* =========================================================
   8. ACCOUNT SECTION: PROFILE HERO
   ========================================================= */

.app-profile-hero {
    position: relative;
    min-height: 300px;
    padding: calc(var(--app-header-total) + 58px) 18px 42px;
    color: #ffffff;
    text-align: center;
    background: transparent;
    overflow: hidden;
}

.app-profile-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(70, 71, 83, 0.0);
    pointer-events: none;
}

.app-profile-hero > * {
    position: relative;
    z-index: 1;
}

.app-profile-avatar {
    width: 128px;
    height: 128px;
    margin: 0 auto 5px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #00baa1ba;
    background: rgba(255, 255, 255, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-profile-avatar span {
    color: #ffffff;
    font-size: 34px;
    font-weight: 800;
}

.app-profile-name {
    font-size: 29px;
    line-height: 1.1;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.38);
}

.app-profile-subtitle {
    margin-top: 5px;
    color: rgba(255, 255, 255);
    font-size: 15px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

/* =========================================================
   9. ACCOUNT SECTION: SETTINGS
   ========================================================= */

.settings-form {
    display: grid;
    gap: 14px;
}

.settings-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.settings-label {
    margin: 0;
    color: var(--app-text-soft);
    font-size: 16px;
    line-height: 1.25;
    font-weight: 750;
}

.settings-control {
    flex: 0 0 52%;
    min-width: 0;
}

.settings-control.is-short {
    flex-basis: 44%;
}

.settings-control.is-switch {
    flex: 0 0 auto;
}

.settings-control .form-control,
.settings-control .form-select {
    width: 100%;
}

.settings-control input[type="date"],
.settings-control input[type="time"],
.settings-control .readonly-control,
.settings-control .form-select {
    text-align: center;
}

.settings-switch {
    margin: 0;
    min-height: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.settings-switch .form-check-input {
    width: 3.75rem;
    height: 2.05rem;
    margin: 0;
    cursor: pointer;
}

.settings-toast {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 50px);
    left: 50%;
    z-index: 90;
    width: 100%;
    padding: 5px 14px;
    background: rgba(31, 35, 40, 0.42);
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 650;
    line-height: 1.2;
    box-shadow: 0 10px 26px rgba(31, 35, 40, 0.1);
    backdrop-filter: blur(10px);
    pointer-events: none;
    opacity: 0;
    text-align: center;
    transform: translate(-50%, -8px);
    animation: settings-toast-in-out 2s ease forwards;
}

@keyframes settings-toast-in-out {
    0% {
        opacity: 0;
        transform: translate(-50%, -8px);
    }

    15% {
        opacity: 1;
        transform: translate(-50%, 0);
    }

    75% {
        opacity: 1;
        transform: translate(-50%, 0);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -8px);
    }
}

/* =========================================================
   10. ASSIGNMENTS SECTION: LIST
   ========================================================= */

.assignment-list {
    display: grid;
    gap: 2px;
}

.assignment-card {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--app-border);
}

.assignment-card:last-child {
    border-bottom: 0;
}

.assignment-icon {
    width: 50px;
    height: 50px;
    border-radius: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--app-primary-soft-bg);
    font-size: 25px;
    overflow: hidden;
}

.assignment-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.assignment-body {
    min-width: 0;
}

.assignment-head {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
}

.assignment-title {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--app-text);
    font-size: 17px;
    font-weight: 850;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.assignment-meta {
    margin-top: 4px;
    color: var(--app-muted);
    font-size: 13px;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.assignment-schedule-line {
    margin-top: 5px;
    color: #3f4652;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.assignment-notes {
    margin-top: 5px;
    color: var(--app-text-soft);
    font-size: 13px;
    line-height: 1.35;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.assignment-status {
    flex: 0 0 auto;
    max-width: 92px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.assignment-status-active {
    color: var(--app-success);
    background: var(--app-success-bg);
}

.assignment-status-finished {
    color: var(--app-text-soft);
    background: var(--app-neutral-bg);
}

.assignment-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.assignment-actions form {
    margin: 0;
}

.assignment-action {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #9aa0aa;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.assignment-action i {
    font-size: 19px;
}

.assignment-action-danger {
    color: #dc3545;
}

.assignment-floating-add:active {
    transform: translateY(1px) scale(0.96);
}

/* =========================================================
   11. ASSIGNMENTS SECTION: FORM
   ========================================================= */

.assignment-form {
    display: grid;
    gap: 20px;
}

.assignment-section {
    display: grid;
    gap: 14px;
}

.assignment-section-title {
    color: var(--app-text);
    font-size: 18px;
    font-weight: 850;
}

.assignment-field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.assignment-control {
    flex: 0 0 56%;
    min-width: 0;
}

.assignment-control.is-short {
    flex-basis: 44%;
}

.assignment-control .form-control,
.assignment-control .form-select {
    width: 100%;
}

.assignment-control input[type="date"],
.assignment-control input[type="time"],
.assignment-control input[type="number"],
.assignment-control .form-select {
    text-align: center;
}

.assignment-stack-field {
    display: grid;
    gap: 8px;
}

.assignment-form-field {
    display: grid;
    gap: 8px;
}

.assignment-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.assignment-form-actions {
    display: grid;
    gap: 10px;
    margin-top: 2px;
}

.dosage-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.dosage-unit-label {
    min-width: 42px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--app-muted);
    font-size: 14px;
    font-weight: 750;
    line-height: 1.2;
    text-align: left;
    white-space: nowrap;
}

.weekday-picker {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.weekday-chip {
    position: relative;
    cursor: pointer;
}

.weekday-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.weekday-chip span {
    min-height: 38px;
    border-radius: 10px;
    border: 1px solid var(--app-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #69707d;
    background: #ffffff;
    font-size: 13px;
    font-weight: 750;
}

.weekday-chip input:checked + span {
    color: var(--app-primary);
    background: var(--app-primary-soft-bg);
    border-color: var(--app-primary-soft-border);
}

.assignment-time-field {
    align-items: flex-start;
}

.assignment-time-field > .settings-label {
    padding-top: 9px;
}

.time-list {
    display: grid;
    gap: 8px;
}

.time-row {
    min-width: 0;
}

.time-input-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    width: 100%;
}

.time-input-group .form-control {
    width: 100%;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.time-row-addon {
    width: 42px;
    height: 42px;
    border: 1px solid #dee2e6;
    border-left: 0;
    border-radius: 0 8px 8px 0;
    background: var(--app-control-bg);
    color: #9aa0aa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.time-row-addon i {
    font-size: 17px;
    line-height: 1;
}

.time-row-addon-muted {
    pointer-events: none;
}

.time-row .form-control {
    width: 100%;
    padding-right: 42px;
}

.time-remove-btn {
    padding: 0;
    cursor: pointer;
}

.time-remove-btn:hover {
    color: #dc3545;
    background: #fff5f5;
}

.time-remove-btn.invisible {
    visibility: hidden;
}

.assignment-add-time-btn {
    width: 100%;
    min-height: 36px;
    height: 36px;
    margin-top: 8px;
    padding: 0;
    border-radius: 8px;
    color: var(--app-text);
    font-size: 24px;
    font-weight: 850;
    line-height: 1;
}

textarea.form-control.assignment-notes-input {
    min-height: 42px;
    max-height: 180px !important;
    height: auto;
    overflow-y: hidden;
    resize: none;
    line-height: 1.35;
    padding-top: 10px;
    padding-bottom: 10px;
}

.assignment-duplicate-alert {
    border: 0;
    border-radius: 14px;
    background: var(--app-warning-bg);
    color: var(--app-warning-text);
}

.assignment-duplicate-alert .btn {
    min-height: 38px;
    border-radius: 8px;
}

/* =========================================================
   12. ASSIGNMENTS SECTION: EMPTY STATE
   ========================================================= */

.assignment-empty-state {
    min-height: calc(
        100dvh
        - var(--app-header-total)
        - var(--app-bottom-total)
        - 210px
    );
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 26px;
}

.assignment-empty-content {
    padding-top: 28px;
    text-align: center;
}

.assignment-empty-icon {
    margin-bottom: 18px;
    font-size: 34px;
    line-height: 1;
}

.assignment-empty-title {
    margin: 0 0 12px;
    color: var(--app-text);
    font-size: 23px;
    line-height: 1.2;
    font-weight: 800;
}

.assignment-empty-text {
    max-width: 360px;
    margin: 0 auto;
    color: var(--app-text-soft);
    font-size: 17px;
    line-height: 1.45;
}

/* =========================================================
   13. TODAY SECTION: EVENT LIST
   ========================================================= */

.today-event-list {
    display: grid;
    gap: 0;
}

.today-event-card {
    display: grid;
    grid-template-columns: 48px 50px minmax(0, 1fr);
    gap: 12px;
    align-items: flex-start;
    padding: 15px 0;
    border-bottom: 1px solid var(--app-border);
}

.today-event-card:last-child {
    border-bottom: 0;
}

.today-event-time {
    padding-top: 13px;
    color: var(--app-text);
    font-size: 15px;
    font-weight: 850;
    line-height: 1.1;
    text-align: center;
}

.today-event-icon {
    width: 50px;
    height: 50px;
    border-radius: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--app-primary-soft-bg);
    font-size: 25px;
    overflow: hidden;
}

.today-event-body {
    min-width: 0;
}

.today-event-head {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
}

.today-event-title {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--app-text);
    font-size: 17px;
    font-weight: 850;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.today-event-status {
    flex: 0 0 auto;
    max-width: 92px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.today-event-status-pending {
    color: var(--app-primary);
    background: var(--app-primary-soft-bg-strong);
}

.today-event-status-done {
    color: var(--app-success);
    background: var(--app-success-bg);
}

.today-event-status-skipped {
    color: var(--app-danger);
    background: var(--app-danger-bg);
}

.today-event-status-missed {
    color: var(--app-warning);
    background: var(--app-warning-bg-strong);
}

.today-event-meta {
    margin-top: 4px;
    color: var(--app-muted);
    font-size: 13px;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.today-event-note {
    margin-top: 5px;
    color: var(--app-text-soft);
    font-size: 13px;
    line-height: 1.35;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.today-event-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    transition:
        opacity 0.14s ease,
        transform 0.14s ease;
}

.today-event-actions.is-removing {
    opacity: 0;
    transform: translateY(-4px);
}

.today-event-actions form {
    flex: 1 1 0;
    margin: 0;
}

.today-event-btn {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    font-size: 13px;
    border-radius: 8px;
}

.today-event-card-done,
.today-event-card-skipped {
    opacity: 0.76;
}

.today-event-card.is-updating {
    opacity: 0.65;
    pointer-events: none;
}

/* TODAY: tabs */

.today-tabs {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin: -6px 0 18px;
    padding: 4px;
    border-radius: 14px;
    background: #f7f8fb;
    border: 1px solid var(--app-border);
    overflow: hidden;
    isolation: isolate;
}

.today-tabs::before {
    content: "";
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    z-index: 0;
    width: calc((100% - 14px) / 2);
    border-radius: 11px;
    background: var(--app-primary-soft-bg);
    transform: translateX(0);
    transition:
        transform var(--today-tab-indicator-duration) var(--motion-ease-standard),
        background-color 0.18s ease;
    will-change: transform;
}

.today-tabs.is-tomorrow::before {
    transform: translateX(calc(100% + 6px));
}

.today-tab {
    position: relative;
    z-index: 1;
    min-height: 38px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--app-muted);
    font-size: 14px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        color 0.16s ease,
        transform 0.16s ease;
}

.today-tab.is-active {
    color: var(--app-primary);
    background: transparent;
}

.today-tab:active {
    transform: scale(0.97);
}

.today-tab-panels {
    display: flex;
    align-items: flex-start;
    width: 100%;
    overflow: hidden;
    touch-action: pan-y;
    transition: height var(--today-panel-height-duration) var(--motion-ease-standard);
    will-change: height;
}

.today-tab-panel {
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
    pointer-events: none;
    transform: translateX(0);
    transition: transform var(--today-panel-slide-duration) var(--motion-ease-standard);
    will-change: transform;
}

.today-tab-panel.is-active {
    pointer-events: auto;
}

.today-tab-panels.is-tomorrow .today-tab-panel {
    transform: translateX(-100%);
}

/* =========================================================
   14. TODAY SECTION: EMPTY STATE
   ========================================================= */

.today-empty-state {
    min-height: calc(
        100dvh
        - var(--app-header-total)
        - var(--app-bottom-total)
        - 230px
    );
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    text-align: center;
}

.today-empty-icon {
    font-size: 36px;
    line-height: 1;
}

.today-empty-title {
    margin: 0;
    color: var(--app-text);
    font-size: 23px;
    line-height: 1.2;
    font-weight: 850;
}

.today-empty-text {
    max-width: 360px;
    margin: 0 auto 8px;
    color: var(--app-text-soft);
    font-size: 16px;
    line-height: 1.45;
}

/* =========================================================
   15. RESPONSIVE: DESKTOP PREVIEW
   ========================================================= */

@media (min-width: 768px) {
    body {
        background-color: #8ae7dc;
        background-image: var(--app-pattern-bg);
        background-repeat: repeat;
        background-size: 360px auto;
        background-position: center top;
    }

    .app-root,
    .app-topbar,
    .app-scroll,
    .app-bottom-nav,
    .app-bottom-nav-inline {
        max-width: 520px;
        margin-left: auto;
        margin-right: auto;
    }

    .app-root {
        overflow: hidden;
    }

    .app-topbar {
        left: 50%;
        right: auto;
        width: 520px;
        transform: translateX(-50%);
    }

    .app-scroll {
        left: 50%;
        right: auto;
        width: 520px;
        transform: translateX(-50%);
    }

    .app-bottom-nav {
        left: 50%;
        right: auto;
        width: 520px;
        transform: translateX(-50%);
        border-left: 1px solid var(--app-border);
        border-right: 1px solid var(--app-border);
    }

    html.keyboard-open .app-bottom-nav {
        transform: translateX(-50%) translateY(calc(100% + 24px)) !important;
    }

    .assignment-floating-add {
        right: auto;
        left: calc(50% + 188px);
    }
}

/* =========================================================
   16. RESPONSIVE: SMALL MOBILE WIDTH
   ========================================================= */

@media (max-width: 380px) {
    .settings-label {
        font-size: 15px;
    }

    .assignment-card {
        grid-template-columns: 44px minmax(0, 1fr) auto;
        gap: 10px;
        padding: 14px 0;
    }

    .assignment-icon {
        width: 44px;
        height: 44px;
        border-radius: 15px;
        font-size: 23px;
    }

    .assignment-title {
        font-size: 16px;
    }

    .assignment-meta,
    .assignment-schedule-line,
    .assignment-notes {
        font-size: 12px;
    }

    .assignment-status {
        max-width: 84px;
        padding: 4px 7px;
        font-size: 10px;
    }

    .assignment-action {
        width: 31px;
        height: 31px;
        border-radius: 10px;
    }

    .assignment-action i {
        font-size: 17px;
    }

    .assignment-field-row {
        gap: 10px;
    }

    .assignment-control {
        flex-basis: 58%;
    }

    .assignment-control.is-short {
        flex-basis: 48%;
    }

    .assignment-form-grid {
        grid-template-columns: 1fr;
    }

    .weekday-picker {
        grid-template-columns: repeat(4, 1fr);
    }

    .today-event-card {
        grid-template-columns: 42px 44px minmax(0, 1fr);
        gap: 10px;
        padding: 14px 0;
    }

    .today-event-time {
        font-size: 14px;
    }

    .today-event-icon {
        width: 44px;
        height: 44px;
        border-radius: 15px;
        font-size: 23px;
    }

    .today-event-title {
        font-size: 16px;
    }

    .today-event-meta,
    .today-event-note {
        font-size: 12px;
    }

    .today-event-status {
        max-width: 84px;
        padding: 4px 7px;
        font-size: 10px;
    }
}
