:root {
    --app-bg: linear-gradient(180deg, #f7f1e8 0%, #eef6f3 100%);
    --card-bg: rgba(255, 255, 255, 0.92);
    --ink: #173229;
    --muted: #5f746b;
    --accent: #1c7c54;
    --accent-dark: #14563a;
    --accent-ink: #f4fbf7;
    --accent-soft: #dff3ea;
    --border: rgba(23, 50, 41, 0.08);
    --shadow: 0 20px 50px rgba(28, 124, 84, 0.10);
    --radius-lg: 28px;
    --radius-md: 22px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--app-bg);
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Manrope", sans-serif;
    color: var(--ink);
    background: var(--app-bg);
}

.app-js .alert {
    display: none !important;
}

.app-version-footer {
    padding: 0.1rem 0 1.25rem;
}

.app-version-footer .container {
    display: flex;
    justify-content: center;
}

.app-version-button {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(23, 50, 41, 0.08);
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(23, 50, 41, 0.05);
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.app-version-button:hover,
.app-version-button:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(23, 50, 41, 0.08);
    border-color: rgba(23, 50, 41, 0.16);
}

.release-notes-modal-content {
    border: 0;
    border-radius: 28px;
    box-shadow: 0 28px 70px rgba(23, 50, 41, 0.2);
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.release-notes-modal .modal-dialog {
    max-height: calc(100vh - 2rem);
}

.release-notes-modal .modal-body {
    overflow-y: auto;
}

.release-notes-list {
    display: grid;
    gap: 1rem;
}

.release-notes-empty {
    display: grid;
    place-items: center;
    gap: 0.55rem;
    min-height: 10rem;
    padding: 1rem;
    text-align: center;
    color: var(--muted);
}

.release-notes-empty i {
    font-size: 1.2rem;
    color: var(--accent);
}

.release-notes-loading i {
    display: inline-block;
    transition: transform 0.24s ease, opacity 0.24s ease, color 0.24s ease;
    will-change: transform;
}

.release-notes-loading.is-flipped i {
    transform: translateY(-1px) rotate(180deg);
}

.release-notes-empty p {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
}

.release-notes-item {
    padding: 1rem 1.05rem;
    border-radius: 22px;
    background: rgba(247, 250, 248, 0.92);
    border: 1px solid rgba(23, 50, 41, 0.08);
}

.release-notes-head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.55rem;
    flex-wrap: wrap;
}

.release-notes-version {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    background: rgba(223, 243, 234, 0.95);
    color: var(--accent-dark);
    font-size: 0.78rem;
    font-weight: 800;
}

.release-notes-date {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.release-notes-summary {
    margin: 0 0 0.55rem;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 800;
}

.release-notes-changes {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.release-notes-changes li + li {
    margin-top: 0.3rem;
}

.app-toast-stack {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2500;
    display: grid;
    gap: 0.75rem;
    width: min(100vw - 2rem, 24rem);
    pointer-events: none;
}

.app-toast-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2400;
    background: rgba(8, 18, 14, 0.78);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.app-toast-backdrop.is-active {
    opacity: 1;
}

.app-toast-stack.is-active {
    z-index: 2501;
}

.app-toast {
    position: relative;
    z-index: 1;
    pointer-events: auto;
    border-radius: 22px;
    border: 1px solid rgba(23, 50, 41, 0.08);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 20px 48px rgba(23, 50, 41, 0.16);
    padding: 0.9rem 0.95rem 0.8rem;
    transform: translateY(12px) scale(0.97);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    overflow: hidden;
    backdrop-filter: blur(12px);
}

.app-toast.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.app-toast.is-success {
    border-color: rgba(28, 124, 84, 0.12);
}

.app-toast.is-error {
    border-color: rgba(176, 63, 34, 0.14);
}

.app-toast-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.app-toast-title {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.84rem;
    font-weight: 800;
    color: var(--ink);
}

.app-toast.is-success .app-toast-title i {
    color: var(--accent);
}

.app-toast.is-error .app-toast-title i {
    color: #b03f22;
}

.app-toast-close {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 0;
    line-height: 1;
    font-size: 1.1rem;
}

.app-toast-message {
    margin-top: 0.5rem;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.app-toast-confirm {
    margin-top: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 2.5rem;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 800;
}

.app-toast.is-error .app-toast-confirm {
    background: linear-gradient(135deg, #c15134 0%, #8f341d 100%);
}

.app-toast-progress {
    height: 4px;
    margin: 0.8rem -0.95rem -0.8rem;
    background: rgba(23, 50, 41, 0.07);
    overflow: hidden;
}

.app-toast-progress span {
    display: block;
    height: 100%;
    width: 100%;
    transform-origin: left center;
    transform: scaleX(1);
    background: linear-gradient(90deg, rgba(28, 124, 84, 0.2), var(--accent));
    animation: app-toast-progress-shrink linear forwards;
}

.app-toast.is-error .app-toast-progress span {
    background: linear-gradient(90deg, rgba(193, 81, 52, 0.18), #c15134);
}

@keyframes app-toast-progress-shrink {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

.medication-reminder-toggle {
    width: 100%;
    justify-content: center;
    gap: 0.45rem;
}

.medication-reminder-collapse {
    margin-top: 0.75rem;
}

.medication-reminder-rows {
    display: grid;
    gap: 0.85rem;
}

.medication-reminder-row + .medication-reminder-row {
    padding-top: 0.9rem;
    margin-top: 0.1rem;
    border-top: 1px solid rgba(23, 50, 41, 0.08);
}

.medication-reminder-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 0.85rem;
}

.medication-reminder-add {
    gap: 0.4rem;
}

.custom-suggestion-field {
    position: relative;
}

.custom-suggestion-panel {
    display: grid;
    gap: 0.3rem;
    margin-top: 0;
    max-height: calc(3 * 2.75rem + 0.6rem);
    overflow-y: auto;
    padding: 0 0.45rem;
    border: 1px solid rgba(23, 50, 41, 0.08);
    border-radius: 18px;
    background: rgba(247, 250, 248, 0.98);
    box-shadow: 0 14px 30px rgba(23, 50, 41, 0.08);
    max-height: 0;
    opacity: 0;
    transform: translateY(-0.45rem) scale(0.985);
    visibility: hidden;
    pointer-events: none;
    transition: max-height 0.22s ease, opacity 0.18s ease, transform 0.18s ease, padding 0.18s ease, visibility 0s linear 0.22s;
}

.custom-suggestion-panel.is-open {
    max-height: calc(3 * 2.75rem + 0.6rem);
    padding: 0.45rem;
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
    pointer-events: auto;
    transition: max-height 0.22s ease, opacity 0.18s ease, transform 0.18s ease, padding 0.18s ease, visibility 0s;
}

.custom-suggestion-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 2.4rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid transparent;
    border-radius: 14px;
    background: rgba(223, 243, 234, 0.55);
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 700;
    text-align: left;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.custom-suggestion-item:hover,
.custom-suggestion-item:focus-visible {
    background: rgba(223, 243, 234, 0.92);
    border-color: rgba(28, 124, 84, 0.16);
    transform: translateY(-1px);
}

.mobile-bottom-nav {
    display: none;
}

body.home-page .hero-card {
    padding: 1.2rem;
}

body.home-page .display-title {
    font-size: clamp(1.8rem, 4.4vw, 2.9rem);
    max-width: 10ch;
}

body.home-page .hero-copy {
    font-size: 0.98rem;
}

body.home-page .date-card {
    min-width: min(100%, 286px);
    padding: 0.85rem;
}

body.home-page .selected-day-card {
    padding: 0.85rem;
}

body.home-page .selected-day-value {
    font-size: 1.15rem;
}

body.home-page .calendar-card {
    padding: 1.15rem;
}

body.home-page .calendar-header {
    margin-bottom: 1rem;
}

body.home-page .calendar-nav {
    gap: 0.55rem;
}

body.home-page .calendar-view-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem;
    border-radius: 999px;
    background: rgba(247, 250, 248, 0.98);
    border: 1px solid rgba(23, 50, 41, 0.08);
}

body.home-page .calendar-view-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    text-decoration: none;
}

body.home-page .calendar-view-link.is-active {
    background: rgba(223, 243, 234, 0.95);
    color: var(--accent-dark);
}

body.home-page .calendar-nav .btn {
    min-width: 96px;
    min-height: 34px;
    padding: 0.48rem 0.72rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
}

body.home-page .calendar-nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.38rem;
}

body.home-page .calendar-nav .btn-outline-primary {
    color: var(--accent-dark);
    background: rgba(247, 250, 248, 0.98);
    border-color: rgba(28, 124, 84, 0.14);
    box-shadow: 0 10px 20px rgba(23, 50, 41, 0.05);
}

body.home-page .calendar-nav .btn-outline-primary:hover,
body.home-page .calendar-nav .btn-outline-primary:focus {
    color: var(--accent-dark);
    background: rgba(223, 243, 234, 0.92);
    border-color: rgba(28, 124, 84, 0.24);
    box-shadow: 0 14px 24px rgba(28, 124, 84, 0.10);
}

body.home-page .calendar-weekdays,
body.home-page .calendar-grid {
    gap: 0.55rem;
}

body.home-page .calendar-day {
    min-height: 94px;
    padding: 0.75rem;
    border-radius: 18px;
}

body.home-page .calendar-day-number {
    font-size: 1.25rem;
}

body.home-page .calendar-day-label {
    font-size: 0.76rem;
}

body.home-page .calendar-day-preview {
    display: grid;
    gap: 0.28rem;
}

body.home-page .calendar-day-entry {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.68rem;
    line-height: 1.2;
    color: var(--muted);
}

body.profile-page .app-shell {
    padding-bottom: 2.5rem;
}

body.profile-page .hero-card {
    padding: 0.95rem;
}

body.profile-page .display-title {
    font-size: clamp(1.6rem, 4vw, 2.35rem);
}

body.profile-page .hero-copy {
    max-width: 54ch;
    font-size: 0.9rem;
}

body.profile-page .profile-hero-logout {
    margin-left: auto;
}

body.profile-page .panel-card {
    padding: 0.95rem;
}

body.profile-page .panel-header {
    margin-bottom: 0.8rem;
}

body.profile-page .panel-kicker {
    padding: 0.26rem 0.6rem;
    font-size: 0.74rem;
}

body.profile-page .panel-title {
    margin-top: 0.38rem;
    font-size: 1.05rem;
}

body.profile-page .form-label {
    margin-bottom: 0.28rem;
    font-size: 0.84rem;
    font-weight: 700;
}

body.profile-page .form-control,
body.profile-page .form-select {
    min-height: 40px;
    border-radius: 13px;
    font-size: 0.9rem;
}

body.profile-page textarea.form-control {
    min-height: 100px;
}

body.profile-page .btn {
    min-height: 40px;
    padding: 0.62rem 0.9rem;
    border-radius: 14px;
    font-size: 0.88rem;
}

.login-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    width: 100%;
    margin: 0;
    padding: 0 0.2rem 0 2.4rem;
    flex-wrap: nowrap;
}

.login-meta-row .form-check {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding-left: 0;
    margin: 0;
    min-width: 0;
}

.login-meta-row .form-check-input {
    margin-top: 0;
    flex: 0 0 auto;
}

.login-meta-row .form-check-label {
    font-size: 0.9rem;
    white-space: nowrap;
}

body.records-page .hero-card {
    padding: 0.95rem;
}

body.records-page .display-title {
    font-size: clamp(1.6rem, 4vw, 2.35rem);
}

body.records-page .hero-copy {
    max-width: 56ch;
    font-size: 0.9rem;
}

body.records-page .panel-card {
    padding: 0.95rem;
}

body.records-page .panel-header {
    margin-bottom: 0.8rem;
}

body.records-page .panel-kicker {
    padding: 0.26rem 0.6rem;
    font-size: 0.74rem;
}

body.records-page .panel-title {
    margin-top: 0.38rem;
    font-size: 1.05rem;
}

body.records-page .form-label {
    margin-bottom: 0.28rem;
    font-size: 0.84rem;
    font-weight: 700;
}

body.records-page .form-control,
body.records-page .form-select {
    min-height: 40px;
    border-radius: 13px;
    font-size: 0.9rem;
}

body.records-page textarea.form-control {
    min-height: 100px;
}

body.records-page .btn {
    min-height: 40px;
    padding: 0.62rem 0.9rem;
    border-radius: 14px;
    font-size: 0.88rem;
}

body.records-page .records-hero-action {
    margin-left: auto;
    flex-shrink: 0;
}

body.medications-page .app-shell {
    padding-top: 9rem;
}

body.medications-page .hero-card {
    padding: 1rem;
}

body.medications-page .display-title {
    font-size: clamp(1.6rem, 4.1vw, 2.35rem);
}

body.medications-page .hero-copy {
    max-width: 56ch;
    font-size: 0.9rem;
}

body.medications-page .panel-card {
    padding: 1rem;
}

body.medications-page .panel-header {
    margin-bottom: 0.8rem;
}

body.medications-page .panel-kicker {
    padding: 0.26rem 0.6rem;
    font-size: 0.74rem;
}

body.medications-page .panel-title {
    margin-top: 0.38rem;
    font-size: 1.05rem;
}

body.medications-page .appointment-hero-head {
    gap: 0.85rem;
}

body.medications-page .appointment-hero-action {
    margin-left: auto;
    flex-shrink: 0;
    min-height: 42px;
    padding: 0.62rem 0.92rem;
    border-radius: 14px;
    font-size: 0.86rem;
}

body.medications-page .meal-overview-grid {
    gap: 0.7rem;
    margin-top: 1rem;
}

body.medications-page .meal-overview-card {
    padding: 0.88rem 0.95rem;
    border-radius: 18px;
}

body.medications-page .meal-overview-card span {
    font-size: 0.72rem;
}

body.medications-page .meal-overview-card strong {
    font-size: 1.45rem;
}

body.medications-page .appointment-results-section {
    margin-top: 1.25rem;
}

body.medications-page .timeline-list {
    gap: 0.7rem;
}

body.medications-page .timeline-item {
    padding: 0.92rem 1rem;
}

body.medications-page .timeline-time {
    min-width: 68px;
    padding: 0.42rem 0.58rem;
    font-size: 0.82rem;
}

body.medications-page .timeline-content h3 {
    font-size: 1rem;
}

body.medications-page .timeline-content strong {
    font-size: 0.9rem;
}

body.medications-page .timeline-content p {
    font-size: 0.84rem;
}

body.medications-page .appointment-modal {
    border-radius: 24px;
}

body.medications-page .appointment-modal .modal-header,
body.medications-page .appointment-modal .modal-body {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
}

body.medications-page .appointment-modal .panel-kicker {
    font-size: 0.72rem;
    padding: 0.34rem 0.66rem;
}

body.medications-page .appointment-modal .panel-title {
    margin-top: 0.55rem !important;
    font-size: 1rem;
}

body.medications-page .appointment-modal .form-label {
    margin-bottom: 0.3rem;
    font-size: 0.82rem;
}

body.medications-page .appointment-modal .form-control,
body.medications-page .appointment-modal .form-select {
    min-height: 40px;
    font-size: 0.9rem;
    border-radius: 14px;
}

body.medications-page .appointment-modal textarea.form-control {
    min-height: 92px;
}

body.medications-page .appointment-modal .btn {
    min-height: 38px;
    padding: 0.56rem 0.82rem;
    font-size: 0.84rem;
    border-radius: 14px;
}

body.medications-page .medications-summary-card {
    min-height: 280px;
}

body.medications-page .medications-summary-placeholder {
    display: grid;
    place-items: center;
    gap: 0.45rem;
    min-height: 160px;
    padding: 1rem 0.75rem 0.25rem;
    text-align: center;
    color: var(--muted);
}

body.medications-page .medications-summary-placeholder i {
    font-size: 1.35rem;
    color: var(--accent);
}

body.medications-page .medications-summary-placeholder p {
    margin-bottom: 0;
    font-size: 0.9rem;
}

body.medications-page .permanent-medication-list {
    display: grid;
    gap: 0.85rem;
}

body.medications-page .permanent-medication-card {
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 1rem 1rem 1rem 1.12rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(246, 251, 248, 0.98));
    box-shadow: var(--soft-shadow);
    position: relative;
    overflow: hidden;
}

body.medications-page .permanent-medication-card.js-permanent-medication-view {
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

body.medications-page .permanent-medication-card.js-permanent-medication-view::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, var(--accent) 0%, rgba(33, 111, 73, 0.34) 100%);
}

body.medications-page .permanent-medication-card.js-permanent-medication-view::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0));
    pointer-events: none;
}

body.medications-page .permanent-medication-card.js-permanent-medication-view:hover,
body.medications-page .permanent-medication-card.js-permanent-medication-view:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(33, 111, 73, 0.22);
    box-shadow: 0 18px 36px rgba(20, 52, 42, 0.1);
    outline: none;
}

body.medications-page .permanent-medication-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    position: relative;
    z-index: 1;
}

body.medications-page .permanent-medication-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.08rem;
    font-weight: 800;
    color: var(--ink);
}

body.medications-page .permanent-medication-subline {
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.82rem;
}

body.medications-page .permanent-medication-stock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0.34rem 0.78rem;
    border-radius: 999px;
    background: rgba(33, 111, 73, 0.1);
    color: var(--accent-dark);
    font-size: 0.8rem;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: inset 0 0 0 1px rgba(33, 111, 73, 0.07);
    position: relative;
    z-index: 1;
}

body.medications-page .permanent-medication-stock.is-low {
    background: rgba(199, 105, 21, 0.12);
    color: #9c5800;
}

body.medications-page .permanent-medication-notes {
    margin-top: 0.9rem;
    color: var(--muted);
    font-size: 0.85rem;
    position: relative;
    z-index: 1;
}

body.medications-page .permanent-medication-view-content {
    display: grid;
    gap: 0.95rem;
}

body.medications-page .permanent-medication-view-card {
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 0.95rem;
    background: var(--surface-soft);
}

body.medications-page .permanent-medication-view-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

body.medications-page .permanent-medication-view-title {
    font-size: 1.1rem;
    font-weight: 800;
}

body.medications-page .permanent-medication-view-subline {
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.84rem;
}

body.medications-page .permanent-medication-view-stat-card {
    margin-top: 0.95rem;
    padding: 0.95rem;
    border-radius: 20px;
    border: 1px solid rgba(33, 111, 73, 0.12);
    background:
        linear-gradient(180deg, rgba(223, 243, 234, 0.92), rgba(255, 255, 255, 0.94));
}

body.medications-page .permanent-medication-view-stat-head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: baseline;
    flex-wrap: wrap;
}

body.medications-page .permanent-medication-view-stat-label {
    display: block;
    font-size: 0.72rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 800;
}

body.medications-page .permanent-medication-view-stat-value {
    display: block;
    color: var(--accent-dark);
    font-size: 1.1rem;
    font-weight: 900;
}

body.medications-page .permanent-medication-view-progress {
    margin-top: 0.75rem;
    height: 0.72rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(33, 111, 73, 0.08);
}

body.medications-page .permanent-medication-view-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent) 0%, rgba(33, 111, 73, 0.62) 100%);
}

body.medications-page .permanent-medication-view-stat-foot {
    margin-top: 0.7rem;
    color: var(--muted);
    font-size: 0.86rem;
}

body.medications-page .permanent-medication-view-stat-foot strong {
    color: var(--ink);
}

body.medications-page .permanent-medication-view-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
    margin-top: 0.85rem;
}

body.medications-page .permanent-medication-view-meta-card {
    padding: 0.78rem 0.82rem;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.85);
}

body.medications-page .permanent-medication-view-meta-card span {
    display: block;
    font-size: 0.72rem;
    color: var(--muted);
}

body.medications-page .permanent-medication-view-meta-card strong {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.92rem;
}

body.medications-page .permanent-medication-view-notes-card {
    padding: 0.92rem 0.95rem;
    border-radius: 18px;
    border: 1px solid rgba(33, 111, 73, 0.12);
    background: linear-gradient(180deg, rgba(247, 251, 249, 0.96), rgba(255, 255, 255, 0.98));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body.medications-page .permanent-medication-view-meal-reminder-card {
    padding: 0.92rem 0.95rem;
    border-radius: 18px;
    border: 1px solid rgba(33, 111, 73, 0.12);
    background: linear-gradient(180deg, rgba(228, 244, 235, 0.95), rgba(255, 255, 255, 0.98));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

body.medications-page .permanent-medication-view-reminder-group {
    padding-top: 0.85rem;
    margin-top: 0.85rem;
    border-top: 1px solid rgba(33, 111, 73, 0.08);
}

body.medications-page .permanent-medication-view-reminder-group:first-of-type {
    padding-top: 0;
    margin-top: 0;
    border-top: 0;
}

body.medications-page .permanent-medication-view-reminder-group-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

body.medications-page .permanent-medication-view-reminder-group-head span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--accent-dark);
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

body.medications-page .permanent-medication-view-reminder-group-head strong {
    font-size: 0.9rem;
    color: var(--ink);
}

body.medications-page .permanent-medication-view-meal-reminder-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

body.medications-page .permanent-medication-view-meal-reminder-head span {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--accent-dark);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

body.medications-page .permanent-medication-view-meal-reminder-head strong {
    font-size: 0.98rem;
    color: var(--ink);
}

body.medications-page .permanent-medication-view-meal-reminder-list {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.7rem;
}

body.medications-page .permanent-medication-view-meal-reminder-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.82rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(33, 111, 73, 0.08);
}

body.medications-page .permanent-medication-view-meal-reminder-item strong {
    font-size: 0.92rem;
}

body.medications-page .permanent-medication-view-meal-reminder-item span {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.45;
    text-align: right;
}

body.medications-page .permanent-medication-view-notes-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.45rem;
    color: var(--accent-dark);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

body.medications-page .permanent-medication-view-notes-label i {
    font-size: 0.9rem;
}

body.medications-page .permanent-medication-view-notes-text {
    margin: 0;
    color: var(--ink);
    font-size: 0.92rem;
    line-height: 1.55;
    white-space: pre-wrap;
}

body.medications-page .permanent-medication-view-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.25rem;
}

body.medications-page .permanent-medication-view-actions > * {
    flex: 0 0 auto;
}

body.medications-page .permanent-medication-view-actions .btn {
    white-space: nowrap;
}

body.medications-page .permanent-medication-view-actions form {
    margin: 0;
}

@media (max-width: 767.98px) {
    body.medications-page .permanent-medication-view-mini-grid {
        grid-template-columns: 1fr;
    }

    body.medications-page .permanent-medication-view-stat-head {
        align-items: flex-start;
    }
}

body.medications-page .medication-alert-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 100%;
    padding-top: 0.8rem;
}

body.medications-page .medication-alert-check .form-check-label {
    font-size: 0.85rem;
}

body.medications-page .permanent-medication-reminder-card {
    padding: 0.5rem 0.55rem 0.65rem;
    border: 1px solid rgba(33, 111, 73, 0.12);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(247, 251, 249, 0.98), rgba(255, 255, 255, 0.98));
}

body.medications-page .permanent-medication-reminder-split {
    height: 1px;
    margin: 1rem 0 0.95rem;
    background: linear-gradient(90deg, rgba(33, 111, 73, 0.06), rgba(33, 111, 73, 0.18), rgba(33, 111, 73, 0.06));
}

body.medications-page .permanent-medication-reminder-toggle {
    padding-top: 0;
}

body.medications-page .permanent-medication-reminder-hint {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.83rem;
    line-height: 1.5;
}

body.medications-page .permanent-medication-after-meal-box {
    border: 1px solid rgba(33, 111, 73, 0.12);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(247, 251, 249, 0.98), rgba(255, 255, 255, 0.98));
}

body.medications-page .permanent-medication-after-meal-rows {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
}

body.medications-page .permanent-medication-after-meal-row,
body.medications-page .permanent-medication-meal-reminder-row {
    padding: 0.72rem 0.72rem 0.78rem;
    border: 1px solid rgba(33, 111, 73, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
}

body.medications-page .permanent-medication-meal-reminder-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    margin-bottom: 0.85rem;
}

body.medications-page .permanent-medication-meal-reminder-row-title {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

body.medications-page .permanent-medication-meal-reminder-row-head .btn {
    white-space: nowrap;
}

body.medications-page .medication-reminder-box {
    padding: 0;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.medications-page .medication-reminder-box[data-reminder-prefix="permanent_medication_meal_reminder"]:has(.medication-reminder-rows.d-none) {
    display: contents;
}

body.medications-page .medication-reminder-box[data-reminder-prefix="permanent_medication_scheduled_reminder"]:has(.medication-reminder-rows.d-none) {
    display: contents;
}

body.medications-page .medication-reminder-box .d-flex.flex-wrap.gap-2.align-items-center.justify-content-between.mt-3 {
    margin-top: 0.9rem !important;
    align-items: flex-start !important;
}

body.medications-page .permanent-medication-after-meal-types,
body.medications-page .permanent-medication-meal-reminder-meal-types {
    display: block;
    width: 100%;
    margin-top: 0.95rem;
    padding: 0.78rem 0.68rem 0.1rem;
    border-top: 1px solid rgba(33, 111, 73, 0.08);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(247, 251, 249, 0.92), rgba(255, 255, 255, 0.96));
}

body.medications-page .permanent-medication-scheduled-reminder-fields {
    display: block;
    width: 100%;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(33, 111, 73, 0.08);
}

body.medications-page .permanent-medication-after-meal-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(33, 111, 73, 0.14);
    background: #fff;
    color: var(--heading);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

body.medications-page .permanent-medication-meal-reminder-row .row {
    row-gap: 0.7rem;
}

body.medications-page .permanent-medication-meal-reminder-row .form-label.small {
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.72rem;
}

body.medications-page .permanent-medication-meal-reminder-row .form-select,
body.medications-page .permanent-medication-meal-reminder-row .form-control {
    border-radius: 14px;
}

body.medications-page .permanent-medication-meal-reminder-meal-types-label {
    color: var(--heading);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

body.medications-page .permanent-medication-meal-reminder-meal-types .permanent-medication-after-meal-types {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.75rem;
    padding-top: 0;
    border-top: 0;
}

body.medications-page .permanent-medication-after-meal-chip input {
    margin: 0;
}

body.medications-page .permanent-medication-after-meal-chip span {
    line-height: 1;
}

body.medications-page .permanent-medication-after-meal-chip:has(input:checked) {
    border-color: rgba(33, 111, 73, 0.34);
    background: #e6f4ec;
    transform: translateY(-1px);
}

body.medications-page .permanent-medication-scheduled-reminder-dropdown .dropdown-toggle {
    min-height: 38px;
    border-radius: 14px;
    padding: 0.55rem 0.9rem;
    border-color: rgba(33, 111, 73, 0.18);
    background: #fff;
    color: var(--heading);
    font-weight: 600;
    font-size: 0.93rem;
}

body.medications-page .permanent-medication-scheduled-reminder-dropdown .dropdown-toggle::after {
    margin-left: auto;
}

body.medications-page .permanent-medication-scheduled-reminder-dropdown-menu {
    max-height: 280px;
    overflow: auto;
    border-radius: 18px;
    border-color: rgba(33, 111, 73, 0.12);
    box-shadow: 0 16px 36px rgba(20, 52, 42, 0.12);
}

body.medications-page .js-permanent-scheduled-reminder-weekday-label {
    font-weight: 500;
}

body.medications-page .permanent-medication-scheduled-reminder-weekday-list {
    display: grid;
    gap: 0.35rem;
}

body.medications-page .permanent-medication-scheduled-reminder-weekday-list .dropdown-item {
    border: 1px solid transparent;
    font-size: 0.88rem;
    font-weight: 600;
}

body.medications-page .permanent-medication-scheduled-reminder-weekday-list .dropdown-item:hover,
body.medications-page .permanent-medication-scheduled-reminder-weekday-list .dropdown-item:focus {
    background: #f3faf6;
}

body.medications-page .permanent-medication-scheduled-reminder-weekday-list .form-check-input {
    margin-top: 0;
}

body.record-view-page .hero-card {
    padding: 0.95rem;
}

body.record-view-page .record-view-hero-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

body.record-view-page .record-view-hero-text {
    min-width: 0;
    flex: 1 1 auto;
}

body.record-view-page .record-view-back-button {
    align-self: flex-start;
    flex: 0 0 auto;
    white-space: nowrap;
}

body.record-view-page .display-title {
    font-size: clamp(1.5rem, 3.8vw, 2.15rem);
}

body.record-view-page .hero-copy {
    font-size: 0.9rem;
}

body.record-view-page .panel-card {
    padding: 0.95rem;
}

body.record-view-page .panel-header {
    margin-bottom: 0.8rem;
}

body.record-view-page .panel-kicker {
    padding: 0.26rem 0.6rem;
    font-size: 0.74rem;
}

body.record-view-page .panel-title {
    margin-top: 0.38rem;
    font-size: 1.05rem;
}

body.record-view-page .btn {
    min-height: 40px;
    padding: 0.62rem 0.9rem;
    border-radius: 14px;
    font-size: 0.88rem;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    align-items: center;
    padding-top: 7.5rem;
}

.app-shell {
    min-height: 100vh;
    padding-top: 9rem;
    padding-bottom: 3rem;
}

.app-shell > .container {
    padding-top: 0.75rem;
}

.auth-container {
    padding-top: 0.75rem;
    padding-bottom: 3rem;
}

.auth-inline-link {
    color: var(--accent);
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: none;
}

.auth-inline-link:hover,
.auth-inline-link:focus {
    color: var(--accent-dark);
    text-decoration: underline;
}

.auth-code-shell {
    position: relative;
    width: fit-content;
}

.auth-card .auth-code-shell {
    display: flex;
    justify-content: center;
    width: 100%;
}

.auth-code-input {
    position: absolute;
    inset: 0;
    z-index: 2;
    opacity: 0;
    cursor: text;
}

.auth-code-boxes {
    display: inline-grid;
    grid-template-columns: repeat(3, auto) auto repeat(3, auto);
    gap: 0.4rem;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

body.profile-page .profile-auth-modal .auth-code-shell {
    display: flex;
    justify-content: center;
    width: 100%;
}

.auth-code-box {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    min-height: 46px;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    border: 1px solid rgba(23, 50, 41, 0.12);
    background: rgba(247, 250, 248, 0.94);
    color: var(--accent-dark);
    font-size: 0.96rem;
    font-weight: 800;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.auth-code-box.is-filled {
    border-color: rgba(28, 124, 84, 0.22);
    background: rgba(223, 243, 234, 0.92);
}

.auth-code-box.is-active {
    border-color: rgba(28, 124, 84, 0.42);
    box-shadow: 0 0 0 0.18rem rgba(28, 124, 84, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.auth-code-box.is-active::after {
    content: "";
    position: absolute;
    width: 2px;
    height: 18px;
    border-radius: 999px;
    background: var(--accent);
    animation: auth-code-caret 1s steps(1, end) infinite;
}

.auth-code-divider {
    width: 10px;
    height: 2px;
    border-radius: 999px;
    background: rgba(23, 50, 41, 0.24);
}

@keyframes auth-code-caret {
    0%,
    49% {
        opacity: 1;
    }

    50%,
    100% {
        opacity: 0;
    }
}

.totp-setup-card {
    display: grid;
    gap: 0.6rem;
    padding: 1rem 1.1rem;
    border-radius: 20px;
    background: rgba(247, 250, 248, 0.96);
    border: 1px solid rgba(23, 50, 41, 0.08);
}

.totp-setup-grid {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.totp-qr-card {
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 20px;
    background: rgba(247, 250, 248, 0.96);
    border: 1px solid rgba(23, 50, 41, 0.08);
    justify-items: center;
}

.totp-qr-card.js-totp-toggle {
    cursor: pointer;
}

.totp-qr-card.js-totp-toggle:hover {
    border-color: rgba(28, 124, 84, 0.22);
    box-shadow: 0 14px 28px rgba(20, 52, 42, 0.08);
}

.totp-qr-card.is-secret-visible .totp-qr-image,
.totp-qr-card.is-secret-visible .js-totp-hint {
    display: none;
}

.totp-qr-card.is-secret-visible .js-totp-secret {
    display: grid !important;
    gap: 0.55rem;
    justify-items: center;
    width: 100%;
}

.totp-secret-value {
    width: 100%;
    max-width: 220px;
    padding: 0.85rem 0.9rem;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(23, 50, 41, 0.1);
    color: var(--text);
    font-family: monospace;
    font-size: 0.94rem;
    text-align: center;
    word-break: break-all;
    cursor: default;
    user-select: text;
    -webkit-user-select: text;
}

.totp-qr-image {
    width: 100%;
    max-width: 220px;
    height: auto;
    display: block;
    border-radius: 16px;
    background: #fff;
    padding: 0.55rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.totp-copy-hint {
    color: var(--muted);
    font-size: 0.78rem;
    text-align: center;
}

.totp-setup-label {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.totp-secret {
    display: inline-block;
    width: fit-content;
    padding: 0.55rem 0.8rem;
    border-radius: 14px;
    background: rgba(223, 243, 234, 0.8);
    color: var(--accent-dark);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    word-break: break-word;
}

.totp-uri a {
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}

.totp-uri a:hover,
.totp-uri a:focus {
    color: var(--accent-dark);
    text-decoration: underline;
}

.top-nav-shell {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    padding: 1rem 0;
    transition: padding 0.32s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.32s ease;
}

.top-nav-shell.is-scrolled {
    padding: 0.5rem 0;
}

.main-nav {
    width: min(1320px, calc(100% - 1.5rem));
    padding: 0.75rem 1rem;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(23, 50, 41, 0.08);
    border-radius: 24px;
    box-shadow: 0 14px 34px rgba(23, 50, 41, 0.06);
    backdrop-filter: blur(14px);
    will-change: width, border-radius, box-shadow, background-color, border-color, padding;
    transition:
        width 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        padding 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        border-radius 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.32s ease,
        background-color 0.32s ease,
        border-color 0.32s ease;
}

.top-nav-shell.is-scrolled .main-nav {
    width: min(1320px, calc(100% - 1rem));
    padding: 0.55rem 0.85rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(23, 50, 41, 0.07);
    box-shadow: 0 18px 36px rgba(23, 50, 41, 0.10);
}

.main-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--ink);
    text-decoration: none;
    margin-right: 0.85rem;
}

.main-brand strong,
.main-brand small {
    display: block;
    line-height: 1.1;
}

.main-brand strong {
    font-size: 0.95rem;
    font-weight: 800;
}

.main-brand small {
    color: var(--muted);
    font-size: 0.76rem;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.brand-mark .bi {
    margin-right: 0;
    font-size: 1rem;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0;
    display: block;
}

.nav-toggle {
    padding: 0.45rem 0.7rem;
    border: 1px solid rgba(28, 124, 84, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.8);
}

.nav-toggle:focus {
    box-shadow: 0 0 0 0.25rem rgba(28, 124, 84, 0.12);
}

.main-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    padding: 0.58rem 0.72rem !important;
    border-radius: 14px;
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.main-nav-link:hover,
.main-nav-link:focus {
    color: var(--accent-dark);
    background: rgba(223, 243, 234, 0.9);
    transform: translateY(-1px);
}

.nav-link-active,
.nav-link-accent {
    color: var(--accent-dark);
    background: rgba(223, 243, 234, 0.95);
}

.nav-actions {
    display: flex;
    align-items: center;
}

.hero-card,
.panel-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.hero-card {
    padding: 1.5rem;
}

.panel-card {
    padding: 1.4rem;
}

.eyebrow,
.panel-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.auth-card .eyebrow {
    padding: 0.3rem 0.68rem;
    font-size: 0.76rem;
}

.display-title {
    font-size: clamp(2rem, 5vw, 3.6rem);
    font-weight: 800;
    line-height: 1.02;
    max-width: 12ch;
}

.hero-copy,
.empty-state,
.timeline-content p {
    color: var(--muted);
}

.date-card {
    min-width: min(100%, 320px);
    padding: 1rem;
    border-radius: var(--radius-md);
    background: rgba(248, 252, 250, 0.95);
    border: 1px solid rgba(28, 124, 84, 0.10);
}

.selected-day-card {
    display: grid;
    gap: 0.35rem;
    padding: 1rem;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(223, 243, 234, 0.95), rgba(255, 255, 255, 0.95));
    border: 1px solid rgba(28, 124, 84, 0.12);
}

.selected-day-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.selected-day-value {
    font-size: 1.35rem;
    font-weight: 800;
}

.selected-day-summary {
    color: var(--muted);
    font-size: 0.95rem;
}

.profile-hero .display-title {
    max-width: none;
}

.profile-hero-layout {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.profile-hero-logout {
    flex-shrink: 0;
}

.profile-summary-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.9rem;
}

.profile-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    border-radius: 26px;
    color: #fff;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    box-shadow: 0 18px 32px rgba(28, 124, 84, 0.22);
}

.profile-avatar .bi {
    margin-right: 0;
    font-size: 2.2rem;
}

.profile-name {
    margin: 0;
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 800;
}

.profile-email {
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
}

.profile-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.profile-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    background: rgba(223, 243, 234, 0.92);
    color: var(--accent-dark);
    font-size: 0.92rem;
    font-weight: 700;
}

.profile-info-list {
    display: grid;
    gap: 1rem;
}

.profile-info-item {
    display: grid;
    gap: 0.35rem;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    border: 1px solid rgba(23, 50, 41, 0.08);
    background: rgba(255, 255, 255, 0.84);
}

.profile-info-label {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.profile-info-value {
    font-size: 1.05rem;
    font-weight: 800;
}

body.profile-page .profile-summary-card {
    gap: 0.68rem;
}

body.profile-page .profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    box-shadow: 0 12px 22px rgba(28, 124, 84, 0.16);
}

body.profile-page .profile-avatar .bi {
    font-size: 1.65rem;
}

body.profile-page .profile-name {
    font-size: clamp(1.28rem, 3vw, 1.7rem);
}

body.profile-page .profile-email {
    font-size: 0.88rem;
}

body.profile-page .profile-chip-row {
    gap: 0.45rem;
}

body.profile-page .profile-chip {
    padding: 0.42rem 0.62rem;
    font-size: 0.76rem;
}

body.profile-page .profile-auth-card {
    display: grid;
    gap: 0.62rem;
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.75rem;
    border-radius: 16px;
    background: rgba(247, 250, 248, 0.96);
    border: 1px solid rgba(23, 50, 41, 0.08);
}

body.profile-page .profile-auth-header {
    margin-bottom: 0.1rem;
}

body.profile-page .profile-auth-copy {
    margin: 0;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.45;
}

body.profile-page .profile-auth-trigger {
    width: 100%;
}

body.profile-page .push-manager-card {
    display: grid;
    gap: 0.75rem;
}

body.profile-page .push-manager-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

body.profile-page .push-manager-actions {
    display: grid;
    gap: 0.55rem;
}

body.profile-page .push-manager-test {
    display: flex;
    justify-content: flex-start;
    width: 100%;
}

body.profile-page .push-manager-test form {
    margin: 0;
    width: 100%;
}

body.profile-page .push-manager-test .btn {
    width: 100%;
}

body.profile-page .push-manager-feedback {
    font-size: 0.82rem;
    color: var(--muted);
}

body.profile-page .push-manager-feedback.is-success {
    color: var(--accent-dark);
}

body.profile-page .push-manager-feedback.is-error {
    color: #a1483f;
}

body.profile-page .profile-auth-modal .modal-header,
body.profile-page .profile-auth-modal .modal-body {
    padding-left: 1rem;
    padding-right: 1rem;
}

body.profile-page .profile-totp-modal-dialog {
    max-width: 620px;
}

body.profile-page .profile-info-list {
    gap: 0.65rem;
}

body.profile-page .profile-info-item {
    gap: 0.22rem;
    padding: 0.72rem 0.82rem;
    border-radius: 15px;
}

body.profile-page .profile-info-label {
    font-size: 0.74rem;
}

body.profile-page .profile-info-value {
    font-size: 0.9rem;
}

body.profile-page .totp-setup-grid {
    gap: 0.85rem;
    grid-template-columns: 1fr;
}

body.profile-page .totp-qr-card,
body.profile-page .totp-setup-card {
    padding: 0.8rem;
    border-radius: 16px;
}

body.profile-page .totp-qr-image {
    max-width: 152px;
}

body.profile-page .totp-secret {
    font-size: 0.94rem;
    padding: 0.75rem 0.85rem;
}

body.profile-page .totp-setup-label {
    font-size: 0.7rem;
}

.record-list {
    display: grid;
    gap: 1rem;
}

body.records-page .record-list {
    gap: 0.75rem;
}

.records-search-form {
    margin-bottom: 0.95rem;
}

.records-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 1042;
}

.records-search-input-wrap {
    position: relative;
    flex: 1 1 auto;
}

.records-search-input-wrap .bi {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 0.92rem;
    pointer-events: none;
}

.records-search-input-wrap .form-control {
    padding-left: 2.45rem;
}

.records-filter-panel {
    margin-top: 0.85rem;
    padding: 0.9rem;
    border-radius: 18px;
    border: 1px solid rgba(23, 50, 41, 0.08);
    background: rgba(247, 250, 248, 0.94);
    position: relative;
    z-index: 1042;
}


.records-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(23, 50, 41, 0.08);
}

.records-pagination-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
}

.records-pagination-numbers {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.records-page-number {
    min-width: 40px;
    box-shadow: none;
}

.records-page-number.is-active {
    color: var(--accent-ink);
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    border-color: rgba(20, 86, 58, 0.55);
    box-shadow: none;
}

.record-item {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 1rem;
    padding: 1rem;
    border-radius: 20px;
    border: 1px solid rgba(23, 50, 41, 0.08);
    background: rgba(255, 255, 255, 0.88);
}

body.records-page .record-item {
    grid-template-columns: 56px 1fr;
    gap: 0.85rem;
    padding: 0.82rem;
    border-radius: 18px;
}

.record-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 20px;
    color: var(--accent-dark);
    background: rgba(223, 243, 234, 0.92);
    font-size: 1.5rem;
    align-self: center;
}

body.records-page .record-item-icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    font-size: 1.28rem;
}

.record-item-content {
    display: grid;
    gap: 0.55rem;
}

body.records-page .record-item-content {
    gap: 0.42rem;
}

.record-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: flex-end;
    align-self: center;
}

.record-item-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
}

.record-item-top h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
}

body.records-page .record-item-top h3 {
    font-size: 0.96rem;
}

.record-item-text {
    display: grid;
    gap: 0.18rem;
}

.record-item-type,
.record-item-date,
.record-item-notes {
    margin: 0;
    color: var(--muted);
}

body.records-page .record-item-type,
body.records-page .record-item-date,
body.records-page .record-item-notes,
body.records-page .form-text,
body.records-page .empty-state {
    font-size: 0.88rem;
}

.record-item-type {
    font-weight: 600;
    font-size: 0.86rem;
    letter-spacing: 0.01em;
}

.record-view-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
}

body.record-view-page .record-view-actions {
    gap: 0.55rem;
    justify-content: center;
}

.record-preview-frame {
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid rgba(23, 50, 41, 0.08);
    background: rgba(255, 255, 255, 0.92);
    min-height: 70vh;
}

body.record-view-page .record-preview-frame {
    border-radius: 18px;
    min-height: 62vh;
}

.record-preview-iframe,
.record-preview-image {
    display: block;
    width: 100%;
    min-height: 70vh;
    border: 0;
}

body.record-view-page .record-preview-iframe,
body.record-view-page .record-preview-image {
    min-height: 62vh;
}

.record-preview-image {
    object-fit: contain;
    background: #f7faf8;
}

.appointment-list {
    display: grid;
    gap: 1rem;
}

.appointment-item {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 1rem;
    padding: 1rem;
    border-radius: 24px;
    border: 1px solid rgba(23, 50, 41, 0.08);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 26px rgba(23, 50, 41, 0.05);
}

.appointment-item-body {
    display: grid;
    gap: 0.85rem;
}

.appointment-section + .appointment-section {
    margin-top: 1.5rem;
}

.appointment-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

.appointment-section-head h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}

.appointment-section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    background: rgba(223, 243, 234, 0.9);
    color: var(--accent-dark);
    font-size: 0.82rem;
    font-weight: 800;
}

.appointment-date-badge {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 0.2rem;
    padding: 0.75rem 0.5rem;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(223, 243, 234, 0.95), rgba(248, 252, 250, 0.98));
    border: 1px solid rgba(28, 124, 84, 0.12);
    color: var(--accent-dark);
}

.appointment-date-month {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.appointment-date-badge strong {
    font-size: 1.8rem;
    line-height: 1;
}

.appointment-date-badge small {
    font-size: 0.88rem;
    font-weight: 700;
}

.appointment-hero {
    display: grid;
    gap: 0.25rem;
    justify-items: start;
}

.appointment-hero-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.appointment-hero-action {
    flex: 0 0 auto;
}

.appointment-overview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 1.4rem;
}

.appointment-overview-card {
    display: grid;
    gap: 0.3rem;
    padding: 1rem 1.05rem;
    border-radius: 20px;
    background: rgba(248, 252, 250, 0.92);
    border: 1px solid rgba(28, 124, 84, 0.10);
}

.appointment-overview-card span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.appointment-overview-card strong {
    font-size: 2rem;
    line-height: 1;
}

.meal-overview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 1.4rem;
}

.meal-overview-card {
    display: grid;
    gap: 0.3rem;
    padding: 1rem 1.05rem;
    border-radius: 20px;
    background: rgba(248, 252, 250, 0.92);
    border: 1px solid rgba(28, 124, 84, 0.10);
}

.meal-overview-card span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.meal-overview-card strong {
    font-size: 1.8rem;
    line-height: 1.1;
}

.appointment-filter-form {
    margin-bottom: 1.25rem;
    padding: 1rem;
    border-radius: 20px;
    background: rgba(247, 250, 248, 0.88);
    border: 1px solid rgba(23, 50, 41, 0.08);
}

.appointment-results-section {
    margin-top: 1.75rem;
}

.appointment-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.appointment-modal {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(23, 50, 41, 0.08);
    border-radius: 28px;
    box-shadow: 0 24px 54px rgba(23, 50, 41, 0.14);
    backdrop-filter: blur(14px);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 2rem);
    overflow: hidden;
}

.appointment-modal .modal-header,
.appointment-modal .modal-body {
    padding-left: 1.4rem;
    padding-right: 1.4rem;
}

.appointment-modal .modal-body {
    overflow-y: auto;
    min-height: 0;
}

body.home-page .modal-dialog.modal-lg {
    max-width: 620px;
}

body.home-page .appointment-modal {
    border-radius: 24px;
    box-shadow: 0 18px 40px rgba(23, 50, 41, 0.12);
}

body.home-page .appointment-modal .modal-header,
body.home-page .appointment-modal .modal-body {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
}

body.home-page .appointment-modal .panel-kicker {
    font-size: 0.72rem;
    padding: 0.34rem 0.66rem;
}

body.home-page .appointment-modal .panel-title {
    margin-top: 0.55rem !important;
    font-size: 1rem;
}

body.home-page .appointment-modal .form-label {
    margin-bottom: 0.3rem;
    font-size: 0.82rem;
}

body.home-page .appointment-modal .form-control,
body.home-page .appointment-modal .form-select {
    min-height: 40px;
    font-size: 0.9rem;
    border-radius: 14px;
}

body.home-page .appointment-modal textarea.form-control {
    min-height: 92px;
}

body.home-page .appointment-modal .btn {
    min-height: 38px;
    padding: 0.56rem 0.82rem;
    font-size: 0.84rem;
    border-radius: 14px;
}

.appointment-item-time {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
}

.appointment-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.appointment-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.8rem;
    border-radius: 999px;
    background: rgba(247, 250, 248, 0.98);
    border: 1px solid rgba(23, 50, 41, 0.08);
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 700;
}

.appointment-smart-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.7rem 0.9rem;
    border-radius: 16px;
    background: rgba(223, 243, 234, 0.65);
    color: var(--accent-dark);
    font-size: 0.9rem;
    font-weight: 700;
}

.appointment-item-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
}

.appointment-item-head h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
}

.appointment-item-notes {
    margin: 0;
    color: var(--muted);
}

.appointment-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding-top: 0.2rem;
}

.appointment-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(23, 50, 41, 0.08);
}

.appointment-pagination-info {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.appointment-pagination-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.appointment-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.8rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 800;
    white-space: nowrap;
}

.status-scheduled {
    color: #8b6300;
    background: #fff4cf;
}

.status-completed {
    color: #14563a;
    background: #dff3ea;
}

.status-cancelled {
    color: #8a2424;
    background: #ffe3e3;
}

.btn-outline-danger {
    color: #a13a3a;
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(161, 58, 58, 0.18);
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
    color: #8a2424;
    background: rgba(255, 235, 235, 0.96);
    border-color: rgba(161, 58, 58, 0.28);
    box-shadow: 0 10px 22px rgba(161, 58, 58, 0.10);
}

.auth-card {
    padding: 1.2rem;
    max-width: 460px;
    margin: 0 auto;
}

.auth-title {
    font-size: clamp(1.55rem, 3.4vw, 2.1rem);
    font-weight: 800;
}

.auth-switch {
    color: var(--muted);
    font-size: 0.92rem;
}

.auth-switch a {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

.auth-card .hero-copy {
    font-size: 0.92rem;
}

.auth-card .form-label {
    font-size: 0.88rem;
    margin-bottom: 0.35rem;
}

.auth-card .form-control {
    min-height: 44px;
    padding: 0.62rem 0.85rem;
    font-size: 0.92rem;
}

.auth-card .btn {
    min-height: 44px;
    padding: 0.68rem 1rem;
    font-size: 0.92rem;
}

.password-requirements {
    display: none;
    margin-top: 0.85rem;
    padding: 0.85rem 0.95rem;
    border-radius: 18px;
    background: rgba(247, 250, 248, 0.9);
    border: 1px solid rgba(23, 50, 41, 0.08);
}

.password-requirements.is-visible {
    display: block;
}

.password-requirements-title {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.password-requirements-list {
    display: grid;
    gap: 0.45rem;
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
}

.password-requirement-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: #b03d3d;
    font-size: 0.86rem;
    font-weight: 700;
}

.password-requirement-item::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 0 3px rgba(176, 61, 61, 0.12);
    flex: 0 0 auto;
}

.password-requirement-item.is-valid {
    color: #1d9156;
}

.password-requirement-item.is-valid::before {
    box-shadow: 0 0 0 3px rgba(29, 145, 86, 0.12);
}

.bi {
    line-height: 1;
}

.eyebrow .bi,
.panel-kicker .bi,
.form-label .bi,
.btn .bi,
.empty-state .bi,
.timeline-time .bi,
.timeline-content h3 .bi {
    margin-right: 0.45rem;
}

.user-badge {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-bottom: 0.9rem;
    margin-bottom: 0.9rem;
    border-bottom: 1px solid rgba(23, 50, 41, 0.08);
}

.user-badge span {
    color: var(--muted);
    font-size: 0.92rem;
}

.user-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.2rem;
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-control,
.form-select {
    min-height: 48px;
    border-radius: 16px;
    border-color: rgba(23, 50, 41, 0.10);
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(28, 124, 84, 0.45);
    box-shadow: 0 0 0 0.25rem rgba(28, 124, 84, 0.15);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 48px;
    padding: 0.8rem 1.15rem;
    border-radius: 18px;
    border-width: 1px;
    font-weight: 800;
    letter-spacing: 0.01em;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

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

.btn:active {
    transform: translateY(0);
}

.btn:focus-visible {
    box-shadow: 0 0 0 0.25rem rgba(28, 124, 84, 0.18);
}

@media (max-width: 1120px) {
    .form-control,
    .form-select,
    textarea.form-control {
        font-size: 16px;
        line-height: 1.35;
    }

    body.medications-page .permanent-medication-meta-grid {
        grid-template-columns: 1fr;
    }

    body.medications-page .permanent-medication-head {
        flex-direction: column;
    }
}

.btn-sm {
    min-height: 40px;
    padding: 0.6rem 0.9rem;
    border-radius: 14px;
    font-size: 0.9rem;
}

.btn-primary {
    color: var(--accent-ink);
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    border-color: rgba(20, 86, 58, 0.55);
    box-shadow: 0 12px 24px rgba(28, 124, 84, 0.18);
}

.btn-primary:hover,
.btn-primary:focus {
    color: #fff;
    background: linear-gradient(135deg, #22845b 0%, #14563a 100%);
    border-color: rgba(20, 86, 58, 0.75);
    box-shadow: 0 16px 28px rgba(28, 124, 84, 0.24);
}

.btn-outline-primary {
    color: var(--accent);
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(28, 124, 84, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    color: var(--accent-dark);
    background: rgba(223, 243, 234, 0.92);
    border-color: rgba(28, 124, 84, 0.3);
    box-shadow: 0 10px 22px rgba(28, 124, 84, 0.12);
}

.btn-outline-primary:active {
    color: var(--accent-dark) !important;
    background: rgba(223, 243, 234, 1) !important;
    border-color: rgba(28, 124, 84, 0.35) !important;
}

.calendar-nav .btn {
    min-width: 118px;
}

.user-badge .btn {
    white-space: nowrap;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.panel-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0.6rem 0 0;
}

.calendar-card {
    overflow: hidden;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.calendar-nav {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.calendar-controls {
    display: grid;
    justify-items: end;
    gap: 0.7rem;
}

body.home-page .calendar-view-switch {
    justify-self: end;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.calendar-weekday {
    padding: 0.6rem 0.4rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.75rem;
}

.calendar-day {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 112px;
    padding: 0.9rem;
    border-radius: 22px;
    border: 1px solid rgba(23, 50, 41, 0.08);
    background: rgba(255, 255, 255, 0.96);
    color: var(--ink);
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(23, 50, 41, 0.05);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.calendar-day:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(28, 124, 84, 0.10);
    border-color: rgba(28, 124, 84, 0.18);
}

.calendar-day-number {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
}

.calendar-day-label {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.calendar-day-preview {
    display: grid;
    gap: 0.4rem;
}

.calendar-day-entry {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-size: 0.74rem;
    line-height: 1.25;
}

.calendar-day.is-selected {
    background: linear-gradient(180deg, #1c7c54 0%, #21694b 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 18px 30px rgba(28, 124, 84, 0.24);
}

.calendar-day.is-selected .calendar-day-label {
    color: rgba(255, 255, 255, 0.82);
}

.calendar-day.is-selected .calendar-day-entry {
    color: rgba(255, 255, 255, 0.92);
}

.calendar-day.is-today:not(.is-selected) {
    border-color: rgba(28, 124, 84, 0.35);
    background: rgba(223, 243, 234, 0.65);
}

.calendar-day.is-outside {
    opacity: 0.45;
}

.week-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.75rem;
}

.week-day-card {
    display: grid;
    gap: 0.55rem;
    align-content: start;
    min-height: 200px;
    padding: 0.9rem;
    border-radius: 22px;
    border: 1px solid rgba(23, 50, 41, 0.08);
    background: rgba(255, 255, 255, 0.96);
    color: var(--ink);
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(23, 50, 41, 0.05);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.week-day-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(28, 124, 84, 0.10);
    border-color: rgba(28, 124, 84, 0.18);
}

.week-day-name {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.week-day-number {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
}

.week-day-card.is-selected {
    background: linear-gradient(180deg, #1c7c54 0%, #21694b 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 18px 30px rgba(28, 124, 84, 0.24);
}

.week-day-card.is-selected .week-day-name,
.week-day-card.is-selected .calendar-day-label,
.week-day-card.is-selected .calendar-day-entry {
    color: rgba(255, 255, 255, 0.86);
}

.day-focus-card {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 1rem;
    padding: 1rem;
    border-radius: 24px;
    background: rgba(250, 252, 251, 0.96);
    border: 1px solid rgba(23, 50, 41, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.day-focus-badge {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 0.25rem;
    min-height: 164px;
    padding: 0.95rem 0.85rem;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(223, 243, 234, 0.92), rgba(248, 252, 250, 1));
    border: 1px solid rgba(28, 124, 84, 0.10);
    color: var(--accent-dark);
}

.day-focus-month {
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.day-focus-badge strong {
    font-size: clamp(3.4rem, 8vw, 4.8rem);
    line-height: 1;
}

.day-focus-weekday {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.day-focus-content {
    display: grid;
    align-content: center;
    gap: 0.75rem;
    min-width: 0;
}

.day-focus-summary {
    display: grid;
    gap: 0.55rem;
    min-width: 0;
}

.day-focus-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.day-focus-content h3 {
    margin: 0;
    font-size: clamp(1.55rem, 4vw, 2.2rem);
    font-weight: 800;
}

.day-focus-content p {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
    max-width: 46ch;
}

.day-focus-kicker {
    color: var(--accent);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.day-focus-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.day-focus-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    background: rgba(223, 243, 234, 0.72);
    color: var(--accent-dark);
    font-size: 0.76rem;
    font-weight: 700;
}

.day-focus-inline-menu {
    display: inline-flex;
}

.day-focus-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-top: 0;
    justify-content: flex-end;
    flex: 0 0 auto;
}

.day-action-button {
    min-width: 0;
}

.day-focus-menu-button::after {
    margin-left: 0.55rem;
}

.day-focus-menu {
    min-width: 240px;
    padding: 0.5rem;
    border: 1px solid rgba(23, 50, 41, 0.08);
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(23, 50, 41, 0.12);
}

.day-focus-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 0.85rem;
    border-radius: 14px;
    font-weight: 700;
}

.day-focus-menu .dropdown-item:hover,
.day-focus-menu .dropdown-item:focus {
    background: rgba(223, 243, 234, 0.9);
    color: var(--accent-dark);
}

.day-focus-timeline {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(23, 50, 41, 0.08);
}

.timeline-list {
    display: grid;
    gap: 0.9rem;
}

.timeline-item {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    cursor: pointer;
    border-radius: 22px;
}

.timeline-item:focus-visible {
    outline: 2px solid rgba(28, 124, 84, 0.35);
    outline-offset: 3px;
}

.timeline-rail {
    position: relative;
    display: flex;
    justify-content: center;
    align-self: stretch;
}

.timeline-rail::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: -1.1rem;
    width: 2px;
    background: rgba(28, 124, 84, 0.12);
}

.timeline-item:first-child .timeline-rail::after {
    top: 50%;
}

.timeline-item:last-child .timeline-rail::after {
    bottom: 50%;
}

.timeline-time {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 62px;
    min-height: 32px;
    padding: 0.35rem 0.55rem;
    border-radius: 12px;
    background: rgba(223, 243, 234, 0.88);
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    flex-shrink: 0;
}

.timeline-dot {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #1c7c54;
    box-shadow: 0 0 0 6px rgba(223, 243, 234, 0.9);
}

.timeline-card {
    position: relative;
    padding: 0.95rem 0.9rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(23, 50, 41, 0.07);
    box-shadow: 0 12px 26px rgba(23, 50, 41, 0.05);
}

.timeline-card::before {
    content: "";
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 2px;
    background: rgba(28, 124, 84, 0.14);
}

.timeline-content {
    min-width: 0;
}

.timeline-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.timeline-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    min-width: 0;
}

.timeline-content h3 {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.98rem;
    margin: 0;
    font-weight: 800;
}

.timeline-meta-row {
    margin-top: 0.35rem;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.45;
}

.timeline-note {
    margin: 0.45rem 0 0;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.55;
}

.calendar-day-modal-list {
    display: grid;
    gap: 0.9rem;
}

.calendar-day-modal-item {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
}

.calendar-day-modal-rail {
    position: relative;
    display: flex;
    justify-content: center;
    align-self: stretch;
}

.calendar-day-modal-rail::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: -1.1rem;
    width: 2px;
    background: rgba(28, 124, 84, 0.12);
}

.calendar-day-modal-item:first-child .calendar-day-modal-rail::after {
    top: 50%;
}

.calendar-day-modal-item:last-child .calendar-day-modal-rail::after {
    bottom: 50%;
}

.calendar-day-modal-dot {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #1c7c54;
    box-shadow: 0 0 0 6px rgba(223, 243, 234, 0.9);
}

.calendar-day-modal-card {
    position: relative;
    padding: 0.95rem 0.95rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(23, 50, 41, 0.07);
    box-shadow: 0 12px 26px rgba(23, 50, 41, 0.05);
}

.calendar-day-modal-card::before {
    content: "";
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 2px;
    background: rgba(28, 124, 84, 0.14);
}

.calendar-day-modal-time {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 62px;
    min-height: 32px;
    padding: 0.35rem 0.55rem;
    border-radius: 12px;
    background: rgba(223, 243, 234, 0.88);
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
}

.calendar-day-modal-text {
    min-width: 0;
    color: var(--ink);
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.35;
}

.calendar-day-modal-content {
    min-width: 0;
}

.calendar-day-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.calendar-day-modal-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    min-width: 0;
}

.calendar-day-modal-meta {
    display: block;
    margin-top: 0.35rem;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.45;
}

.calendar-day-modal-status {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(248, 228, 170, 0.6);
    color: #9a6a00;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
}

.calendar-day-modal-empty {
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: rgba(247, 250, 248, 0.96);
    color: var(--muted);
    font-weight: 700;
}

.calendar-day-modal-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1rem;
}

.calendar-day-modal-actions .btn {
    padding: 0.8rem 1.2rem;
    border-radius: 18px;
    font-size: 0.86rem;
    font-weight: 700;
}

.timeline-view-modal-list {
    display: grid;
    gap: 0.85rem;
}

.timeline-view-modal-item {
    padding: 0.95rem 1rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(23, 50, 41, 0.07);
    box-shadow: 0 12px 26px rgba(23, 50, 41, 0.05);
}

.timeline-view-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.timeline-view-modal-time {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 62px;
    min-height: 32px;
    padding: 0.35rem 0.55rem;
    border-radius: 12px;
    background: rgba(223, 243, 234, 0.88);
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
}

.timeline-view-modal-status {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(223, 243, 234, 0.9);
    color: var(--accent-dark);
    font-size: 0.72rem;
    font-weight: 800;
}

.timeline-view-modal-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.7rem;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 800;
}

.timeline-view-meta-row {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    margin-top: 0.55rem;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.timeline-view-meta-row span {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 800;
    color: var(--accent);
}

.timeline-view-note {
    margin-top: 0.6rem;
    padding: 0.85rem 0.9rem;
    border-radius: 16px;
    background: rgba(223, 243, 234, 0.55);
    border: 1px solid rgba(28, 108, 74, 0.08);
}

.timeline-view-note span {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 800;
    color: var(--accent);
}

.timeline-view-note p {
    margin: 0;
    color: var(--ink);
    font-size: 0.9rem;
    line-height: 1.5;
}

.calendar-day-modal-menu-button::after {
    margin-left: 0.5rem;
}

.calendar-day-modal .modal-header {
    align-items: flex-start;
}

.calendar-day-modal .btn-close {
    margin-top: -0.15rem;
}

.calendar-day-modal .panel-kicker {
    font-size: 0.78rem;
    padding: 0.45rem 0.8rem;
}

.calendar-day-modal .panel-title {
    font-size: 1.05rem;
}

@media (max-width: 768px) {
    body.home-page .calendar-nav .btn {
        min-width: 84px;
        min-height: 31px;
        padding: 0.42rem 0.62rem;
        font-size: 0.72rem;
    }

    body.home-page .calendar-grid .calendar-day {
        min-height: 4.25rem;
        padding: 0.6rem;
        justify-content: center;
    }

    body.home-page .calendar-grid .calendar-day-preview {
        display: none;
    }

    body.home-page .calendar-grid .calendar-day-number {
        font-size: 1.15rem;
    }
}

@media (max-width: 1120px) {
    .top-nav-shell {
        display: none;
    }

    .app-shell,
    .auth-shell {
        padding-top: 1rem;
    }

    body.medications-page .app-shell {
        padding-top: 0.45rem;
    }

    body {
        padding-bottom: 7.85rem;
    }

    .mobile-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1030;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
        gap: 0.15rem;
        padding: 1rem 1.45rem calc(1.2rem + env(safe-area-inset-bottom));
        background: rgba(247, 250, 248, 0.96);
        border-top: 1px solid rgba(23, 50, 41, 0.08);
        border-radius: 0;
        box-shadow: 0 -10px 26px rgba(23, 50, 41, 0.08);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }

    .mobile-bottom-nav-link {
        display: grid;
        justify-items: center;
        gap: 0.22rem;
        min-height: 66px;
        padding: 0.62rem 0.25rem 0.68rem;
        border-radius: 16px;
        color: var(--muted);
        text-decoration: none;
        font-size: 0.68rem;
        font-weight: 800;
    }

    .mobile-bottom-nav-link i {
        font-size: 1.28rem;
        line-height: 1;
    }

    .mobile-bottom-nav-link span {
        line-height: 1;
        text-align: center;
        white-space: nowrap;
    }

    .mobile-bottom-nav-link.is-active {
        background: rgba(223, 243, 234, 0.95);
        color: var(--accent-dark);
        box-shadow: inset 0 0 0 1px rgba(28, 124, 84, 0.08);
    }
}

@media (max-width: 575.98px) {
    body.medications-page .app-shell {
        padding-top: 0.2rem;
    }

    body.record-view-page .profile-info-list {
        gap: 0.8rem;
    }

    body.record-view-page .profile-info-item {
        padding: 0.75rem 0.8rem 0.7rem;
    }

    body.record-view-page .profile-info-label {
        margin-top: 0.05rem;
        font-size: 0.66rem;
        letter-spacing: 0.03em;
    }

    body.record-view-page .profile-info-value {
        font-size: 0.86rem;
        line-height: 1.2;
    }

    body.record-view-page .record-view-actions {
        gap: 0.4rem;
        justify-content: center;
        flex-wrap: wrap;
        overflow-x: visible;
        padding-bottom: 0;
    }

    body.record-view-page .record-view-actions .btn,
    body.record-view-page .record-view-actions button[type="submit"] {
        min-height: 32px;
        padding: 0.36rem 0.62rem;
        border-radius: 12px;
        font-size: 0.76rem;
        flex: 1 1 0;
        min-width: 0;
        white-space: nowrap;
    }

    body.record-view-page .record-view-back-button {
        min-height: 34px;
        padding: 0.42rem 0.72rem;
        border-radius: 12px;
        font-size: 0.8rem;
        align-self: flex-start;
    }

    body.record-view-page .record-view-hero-head {
        gap: 0.75rem;
    }

    body.record-view-page .record-view-actions .btn i,
    body.record-view-page .record-view-actions button[type="submit"] i {
        font-size: 0.9em;
    }

    body.record-view-page .record-preview-frame {
        min-height: 54vh;
    }

    body.record-view-page .record-preview-iframe,
    body.record-view-page .record-preview-image {
        min-height: 54vh;
    }

    body.home-page .day-focus-card {
        gap: 0.75rem;
        padding: 0.8rem;
        border-radius: 20px;
    }

    body.home-page .day-focus-badge {
        min-height: auto;
        padding: 0.75rem;
        border-radius: 18px;
        gap: 0.18rem;
    }

    body.home-page .day-focus-month {
        font-size: 0.78rem;
    }

    body.home-page .day-focus-badge strong {
        font-size: clamp(2.35rem, 11vw, 3rem);
    }

    body.home-page .day-focus-weekday {
        font-size: 0.72rem;
    }

    body.home-page .day-focus-content {
        gap: 0.55rem;
    }

    body.home-page .day-focus-summary {
        gap: 0.42rem;
    }

    body.home-page .day-focus-topbar {
        gap: 0.5rem;
        align-items: flex-start;
    }

    body.home-page .day-focus-kicker {
        font-size: 0.66rem;
    }

    body.home-page .day-focus-content h3 {
        font-size: 1.45rem;
    }

    body.home-page .day-focus-content p {
        font-size: 0.8rem;
    }

    body.home-page .day-focus-meta {
        gap: 0.45rem;
    }

    body.home-page .day-focus-pill {
        padding: 0.36rem 0.58rem;
        font-size: 0.68rem;
    }

    body.home-page .day-focus-actions {
        gap: 0.5rem;
        justify-content: flex-end;
        margin-left: auto;
    }

    body.home-page .day-focus-actions .btn {
        min-height: 39px;
        padding: 0.58rem 0.9rem;
        font-size: 0.82rem;
    }

    body.home-page .day-focus-menu {
        min-width: 188px;
        padding: 0.38rem;
        border-radius: 16px;
    }

    body.home-page .day-focus-menu .dropdown-item {
        gap: 0.45rem;
        padding: 0.56rem 0.68rem;
        font-size: 0.78rem;
        border-radius: 12px;
    }

    body.home-page .day-focus-timeline {
        margin-top: 1.15rem;
        padding-top: 1.15rem;
    }

    body.home-page .day-focus-timeline .panel-kicker {
        font-size: 0.7rem;
        padding: 0.34rem 0.65rem;
    }

    body.home-page .day-focus-timeline .panel-title {
        font-size: 0.98rem;
    }

    body.home-page .timeline-list {
        gap: 0.75rem;
    }

    body.home-page .timeline-item {
        grid-template-columns: 74px minmax(0, 1fr);
        align-items: start;
        gap: 0.65rem;
    }

    body.home-page .timeline-rail {
        justify-items: stretch;
        gap: 0.35rem;
    }

    body.home-page .timeline-rail::after,
    body.home-page .timeline-dot {
        display: none;
    }

    body.home-page .timeline-time {
        min-width: 0;
        width: 100%;
        padding: 0.5rem 0.55rem;
        font-size: 0.84rem;
        text-align: center;
        border-radius: 14px;
    }

    body.home-page .timeline-card {
        border-radius: 18px;
    }

    body.home-page .timeline-content {
        padding: 0.78rem 0.82rem;
        gap: 0.38rem;
    }

    body.home-page .timeline-content h3 {
        font-size: 0.96rem;
        line-height: 1.35;
    }

    body.home-page .timeline-meta-row,
    body.home-page .timeline-content p,
    body.home-page .timeline-note {
        font-size: 0.75rem;
        line-height: 1.45;
    }

    body.home-page .appointment-status {
        padding: 0.34rem 0.62rem;
        font-size: 0.7rem;
    }

    body.home-page .calendar-controls {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 0.5rem;
        width: 100%;
    }

    body.home-page .calendar-view-switch {
        width: fit-content;
        max-width: 100%;
        min-width: 0;
        justify-self: start;
    }

    body.home-page .calendar-nav {
        width: auto;
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
        justify-self: end;
        gap: 0.35rem;
    }

    body.home-page .calendar-nav .btn {
        flex: 0 0 auto;
        min-width: 2.2rem;
        min-height: 2.2rem;
        padding: 0.42rem 0.58rem;
        border-radius: 999px;
    }

    body.home-page .calendar-nav-button.is-previous,
    body.home-page .calendar-nav-button.is-next {
        width: 2.2rem;
        padding-left: 0;
        padding-right: 0;
    }

    body.home-page .calendar-nav-button.is-previous .calendar-nav-label,
    body.home-page .calendar-nav-button.is-next .calendar-nav-label {
        display: none;
    }

    body.home-page .calendar-nav-button.is-previous .bi,
    body.home-page .calendar-nav-button.is-next .bi {
        margin: 0;
    }

    .hero-card,
    .panel-card {
        padding: 1rem;
        border-radius: 22px;
    }

    body.home-page .timeline-item {
        grid-template-columns: 22px minmax(0, 1fr);
        gap: 0.65rem;
        align-items: center;
    }

    body.home-page .timeline-rail {
        display: flex;
        justify-content: center;
        align-self: stretch;
    }

    body.home-page .timeline-rail::after {
        display: block;
        top: 0;
        bottom: -0.85rem;
    }

    body.home-page .timeline-dot {
        display: block;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 10px;
        height: 10px;
        box-shadow: 0 0 0 5px rgba(223, 243, 234, 0.9);
    }

    body.home-page .timeline-card {
        padding: 0.82rem 0.72rem;
        border-radius: 18px;
        border-left: 0;
    }

    body.home-page .timeline-card::before {
        display: block;
        left: -16px;
        top: 50%;
        transform: translateY(-50%);
        width: 16px;
    }

    body.home-page .timeline-head {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.45rem;
    }

    body.home-page .timeline-title-row {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        gap: 0.35rem;
        width: 100%;
    }

    .calendar-day-modal-item {
        grid-template-columns: 22px minmax(0, 1fr);
        gap: 0.65rem;
    }

    .calendar-day-modal-rail::after {
        top: 0;
        bottom: -0.85rem;
    }

    .calendar-day-modal-dot {
        width: 10px;
        height: 10px;
        box-shadow: 0 0 0 5px rgba(223, 243, 234, 0.9);
    }

    .calendar-day-modal-card {
        padding: 0.82rem 0.72rem;
        border-radius: 18px;
    }

    .calendar-day-modal-card::before {
        left: -16px;
        top: 50%;
        width: 16px;
    }

    .calendar-day-modal-time {
        min-width: 52px;
        min-height: 28px;
        padding: 0.3rem 0.42rem;
        font-size: 0.72rem;
        border-radius: 10px;
    }

    .calendar-day-modal-head {
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.45rem;
    }

    .calendar-day-modal-title-row {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        gap: 0.35rem;
        width: 100%;
    }

    .calendar-day-modal-text {
        font-size: 0.94rem;
        line-height: 1.35;
    }

    .calendar-day-modal-meta {
        font-size: 0.76rem;
        line-height: 1.45;
    }

    .timeline-view-modal-item {
        padding: 0.82rem 0.84rem;
        border-radius: 18px;
    }

    .timeline-view-modal-title {
        font-size: 0.94rem;
    }

    .timeline-view-modal-time {
        min-width: 52px;
        min-height: 28px;
        padding: 0.3rem 0.42rem;
        font-size: 0.72rem;
        border-radius: 10px;
    }

    .timeline-view-modal-status {
        padding: 0.28rem 0.62rem;
        font-size: 0.68rem;
    }

    .profile-hero-layout {
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-hero-logout {
        margin-left: 0;
    }

    body.home-page .timeline-time {
        justify-content: center;
        width: auto;
        min-width: 52px;
        min-height: 28px;
        padding: 0.3rem 0.42rem;
        font-size: 0.72rem;
        border-radius: 10px;
    }

    body.home-page .timeline-content h3 {
        font-size: 0.94rem;
        line-height: 1.35;
    }

    body.home-page .timeline-meta-row,
    body.home-page .timeline-note {
        font-size: 0.76rem;
        line-height: 1.45;
    }

    body.records-page .record-item-top h3 {
        font-size: 0.88rem;
    }

    body.records-page .record-item-type,
    body.records-page .record-item-date {
        font-size: 0.76rem;
    }

    body.records-page .record-item-actions .btn {
        padding: 0.42rem 0.64rem;
        font-size: 0.74rem;
    }

    .user-badge {
        flex-direction: column;
        align-items: flex-start;
    }

    .app-shell,
    .auth-shell {
        padding-top: 1rem;
    }

    body {
        padding-bottom: 7.45rem;
    }

    .mobile-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1030;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
        gap: 0.25rem;
        padding: 0.92rem 0.6rem calc(1rem + env(safe-area-inset-bottom));
        background: rgba(247, 250, 248, 0.96);
        border-top: 1px solid rgba(23, 50, 41, 0.08);
        box-shadow: 0 -12px 28px rgba(23, 50, 41, 0.08);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }

    .mobile-bottom-nav-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 52px;
        border-radius: 16px;
        color: var(--muted);
        text-decoration: none;
        font-size: 1.05rem;
        font-weight: 800;
    }

    .mobile-bottom-nav-link.is-active {
        background: rgba(223, 243, 234, 0.95);
        color: var(--accent-dark);
        box-shadow: inset 0 0 0 1px rgba(28, 124, 84, 0.08);
    }

    .calendar-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .calendar-weekdays,
    .calendar-grid {
        gap: 0.4rem;
    }

    .calendar-weekday {
        font-size: 0.72rem;
        padding: 0.35rem 0.2rem;
    }

    .calendar-day {
        min-height: 84px;
        padding: 0.7rem;
        border-radius: 18px;
    }

    .calendar-day-number {
        font-size: 1.15rem;
    }

    .calendar-day-label {
        font-size: 0.72rem;
    }

    .calendar-day-preview {
        gap: 0.25rem;
    }

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

    .week-day-card {
        min-height: auto;
    }

    .calendar-day-entry {
        font-size: 0.62rem;
    }

    .day-focus-card {
        grid-template-columns: 1fr;
    }

    .day-focus-badge {
        min-height: auto;
        width: 100%;
    }

    .day-focus-content h3 {
        font-size: 2rem;
    }

    .day-focus-topbar {
        align-items: flex-start;
        justify-content: space-between;
    }

    .day-focus-summary {
        min-width: 0;
        flex: 1 1 auto;
    }

    .day-focus-actions {
        margin-left: auto;
    }

    .appointment-overview {
        grid-template-columns: 1fr;
    }

    .meal-overview-grid {
        grid-template-columns: 1fr;
    }

    .appointment-item {
        grid-template-columns: 1fr;
    }

    .appointment-date-badge {
        width: 100%;
        grid-template-columns: repeat(3, auto);
        justify-content: space-between;
        align-items: center;
        justify-items: start;
    }

    .appointment-date-badge strong {
        font-size: 1.4rem;
    }

    .appointment-item-head,
    .appointment-section-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .totp-setup-grid {
        grid-template-columns: 1fr;
    }

    .appointment-hero-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .appointment-pagination {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 440px) {
    body.record-view-page .record-view-actions {
        flex-direction: column;
        align-items: stretch;
    }

    body.record-view-page .record-view-actions .btn,
    body.record-view-page .record-view-actions button[type="submit"] {
        width: 100%;
        flex: 0 0 auto;
    }
}

@media (max-width: 580px) {
    body {
        padding-bottom: 7.65rem;
    }

    .mobile-bottom-nav {
        gap: 0.05rem;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 0.94rem 1.15rem calc(1.08rem + env(safe-area-inset-bottom));
    }

    .mobile-bottom-nav-link {
        min-height: 66px;
        padding: 0.5rem 0.14rem 0.58rem;
        gap: 0;
        font-size: 0;
    }

    .mobile-bottom-nav-link i {
        font-size: 1.62rem;
        margin-bottom: 0.24rem;
    }

    .mobile-bottom-nav-link span {
        display: none;
    }

    .login-meta-row {
        gap: 0.65rem;
        padding: 0 0.25rem 0 1.4rem;
    }
}
