/* Mobile-first styles for Deuce & A Half */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #222;
    background: #f4f4f4;
}

.container {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 16px;
}

a { color: #2c5282; text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
    background: #2d3748;
    color: #fff;
    padding: 10px 0;
}

.icon-bar {
    background: #4a5568;
    border-bottom: 1px solid #2d3748;
}

.icon-bar-inner {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 8px;
    min-height: 44px;
}

.icon-bar-item {
    flex: 0 0 auto;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    min-width: 52px;
    padding: 6px 8px;
    color: #e2e8f0;
    text-decoration: none;
    border-radius: 0;
}

.icon-bar-item:hover,
.icon-bar-item:focus {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
}

.icon-bar-svg {
    width: 20px;
    height: 20px;
    display: block;
}

.icon-bar-label {
    font-size: 0.58rem;
    line-height: 1.1;
    max-width: 64px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.icon-bar-settings {
    margin-left: auto;
    color: #cbd5e0;
}

.icon-bar-edit-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.icon-bar-edit-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #edf2f7;
}

.icon-bar-edit-row:last-child {
    border-bottom: none;
}

.icon-bar-edit-enable {
    flex: 0 0 auto;
}

.icon-bar-edit-icon {
    flex: 0 0 auto;
    color: #4a5568;
}

.icon-bar-edit-icon .icon-bar-svg {
    width: 22px;
    height: 22px;
}

.icon-bar-edit-meta {
    flex: 1 1 140px;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.icon-bar-edit-meta strong {
    font-size: 0.92rem;
}

.icon-bar-edit-moves {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-left: auto;
}

.member-notifications {
    background: #edf2f7;
    border-bottom: 1px solid #cbd5e0;
}

.member-notif-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid #e2e8f0;
    min-height: 34px;
}

.member-notif-row:last-child {
    border-bottom: none;
}

.member-notif-link {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    color: #2d3748;
    text-decoration: none;
}

.member-notif-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.member-notif-icon {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    color: #4a5568;
}

.member-notif-icon-pill {
    color: #2b6cb0;
}

.member-notif-link:hover {
    background: #e2e8f0;
    text-decoration: none;
}

.member-notif-summary {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-notif-detail {
    display: none;
    font-size: 0.8rem;
    line-height: 1.3;
    color: #4a5568;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-notif-row:hover .member-notif-detail,
.member-notif-link:focus .member-notif-detail {
    display: block;
}

.member-notif-close {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    padding: 0;
    border: none;
    border-left: 1px solid #e2e8f0;
    background: transparent;
    color: #718096;
    cursor: pointer;
}

.member-notif-close:hover {
    background: #e2e8f0;
    color: #2d3748;
}

.member-notif-close-icon {
    width: 18px;
    height: 18px;
}

.member-notif-row-perk {
    background: #fffaf0;
}

.member-notif-row-perk .member-notif-summary {
    color: #9c4221;
}

.member-notif-row-message {
    background: #ebf8ff;
}

.member-notif-row-reminder-due {
    background: #fefcbf;
}

.member-notif-row-medication {
    background: #ebf8ff;
}

.member-notif-row-medication .member-notif-summary {
    color: #2c5282;
}

.med-reminder-fieldset {
    margin: 16px 0 0;
    padding: 12px 14px 4px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.med-reminder-fieldset legend {
    font-weight: 600;
    padding: 0 6px;
}

.med-reminder-fields {
    margin-top: 10px;
}

.med-weekday-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.med-weekday-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.88rem;
    cursor: pointer;
}

.med-reminder-times {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.med-reminder-icon {
    color: #2b6cb0;
    flex: 0 0 auto;
}

.med-reminder-icon:hover {
    color: #1a4971;
    background: rgba(43, 108, 176, 0.1);
}

.med-reminder-time-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.med-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    align-items: flex-end;
}

.med-log-filters[hidden] {
    display: none !important;
}

.med-log-panel[hidden] {
    display: none !important;
}

.med-log-panel-title {
    margin: 0 0 8px;
    font-size: 1.05rem;
}

.page-title-row .msg-icon-btn.is-active {
    color: #2b6cb0;
    background: #ebf8ff;
}

.med-filter-form .form-group {
    margin: 0;
    min-width: 180px;
}

.label-like {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-inner-identity {
    justify-content: flex-start;
    align-items: flex-start;
    gap: 12px;
}

.nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    margin-left: auto;
    align-self: flex-start;
    margin-top: 2px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}

.header-msg-alert {
    flex: 0 0 auto;
    margin-left: auto;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-top: 2px;
    padding: 4px 6px;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    border-radius: 6px;
}

.header-msg-alert.has-unread {
    color: #f6e05e;
}

.header-msg-alert:hover {
    color: #faf089;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.08);
}

.header-msg-alert + .nav-toggle {
    margin-left: 6px;
}

.header-msg-icon {
    width: 26px;
    height: 26px;
    display: block;
}

.header-msg-flash {
    animation: perk-flash 1s ease-in-out infinite;
}

.header-msg-count {
    min-width: 1.1em;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
}

@media (prefers-reduced-motion: reduce) {
    .header-msg-flash {
        animation: none;
        opacity: 1;
    }
}

.brand-logo {
    flex: 0 0 auto;
    display: block;
    line-height: 0;
    text-decoration: none;
    border: 0;
}

.brand-logo img {
    display: block;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 0;
    outline: none;
    box-shadow: none;
    object-fit: contain;
    background: transparent;
}

.header-level {
    flex: 0 0 auto;
    font-size: 0.72rem;
    opacity: 0.85;
    white-space: nowrap;
}

.header-identity {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.header-line {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.header-who {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: rgba(255,255,255,0.95);
}

.header-who-group {
    flex: 1 1 auto;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.header-who-group .header-who {
    flex: 0 1 auto;
}

a.header-who {
    text-decoration: none;
}

a.header-who:hover {
    text-decoration: underline;
}

.header-line-muted .header-who {
    opacity: 0.75;
    font-size: 0.78rem;
}

.header-partner-link {
    color: #fff;
    text-decoration: none;
}

.header-partner-link:hover {
    text-decoration: underline;
}

.brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
}

.user-label {
    font-size: 0.9rem;
    opacity: 0.85;
}

.site-nav {
    background: #4a5568;
    position: relative;
    z-index: 50;
}

.nav-shell {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0;
}

.nav-inner {
    display: none;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
    padding: 8px 14px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.site-nav:not(.is-open) {
    display: none;
}

.site-nav.is-open .nav-inner {
    display: flex;
}

.nav-toggle[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.22);
}

.nav-toggle-icon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 18px;
}

.nav-toggle-bar {
    display: block;
    width: 100%;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
}

.site-nav a {
    display: inline;
    color: #fff;
    padding: 6px 0;
    border-radius: 4px;
    font-size: 0.9rem;
    text-decoration: none;
}

.site-nav a + a::before {
    content: '·';
    display: inline-block;
    margin: 0 10px;
    color: rgba(255, 255, 255, 0.65);
    pointer-events: none;
}

.site-nav a:hover {
    background: transparent;
    text-decoration: underline;
}

.main-content {
    padding: 14px 16px 40px;
}

.site-footer {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 0.85rem;
}

/* Landing / login — full-screen mockup */
.landing-page {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    background: #1c1a14;
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    color: #f2eee6;
}

.landing-page.landing-modal-open {
    overflow: hidden;
}

.landing-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: linear-gradient(to bottom, rgba(12, 11, 8, 0.82) 0%, rgba(12, 11, 8, 0.35) 70%, transparent 100%);
}

.landing-nav-brand {
    font-family: Oswald, "Arial Narrow", sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #d4b45a;
    text-decoration: none;
    white-space: nowrap;
}

.landing-nav-brand:hover {
    color: #f0d78a;
    text-decoration: none;
}

.landing-nav-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 4px 14px;
}

.landing-nav-links a,
.landing-nav-login {
    font-family: Oswald, "Arial Narrow", sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #f2eee6;
    text-decoration: none;
    background: none;
    border: none;
    padding: 4px 0;
    cursor: pointer;
}

.landing-nav-links a:hover,
.landing-nav-login:hover {
    color: #d4b45a;
    text-decoration: none;
}

.landing-nav-links a.is-active {
    color: #d4b45a;
}

.landing-nav-login {
    border: 1px solid rgba(212, 180, 90, 0.55);
    padding: 4px 10px;
    border-radius: 2px;
}

.landing-screen {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    background: #1c1a14;
    overflow: hidden;
}

.landing-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    pointer-events: none;
    user-select: none;
}

.landing-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.landing-modal[hidden] {
    display: none !important;
}

.landing-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 7, 5, 0.65);
}

.landing-login,
.landing-login-modal {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 280px;
    padding: 14px 14px 12px;
    background: rgba(12, 11, 8, 0.92);
    border: 1px solid rgba(196, 168, 90, 0.35);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    text-align: center;
}

.landing-modal-close {
    position: absolute;
    top: 4px;
    right: 8px;
    background: none;
    border: none;
    color: #c8c2b4;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
}

.landing-modal-close:hover {
    color: #f2eee6;
}

.landing-login-title {
    margin: 0 0 10px;
    font-family: Oswald, "Arial Narrow", sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #d4b45a;
}

.landing-form {
    text-align: left;
}

.landing-page .form-group {
    margin-bottom: 8px;
}

.landing-page .form-group label {
    color: #c8c2b4;
    font-weight: 600;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.landing-page .form-group input {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(242, 238, 230, 0.25);
    color: #f2eee6;
    border-radius: 2px;
    padding: 6px 8px;
    font-size: 14px;
}

.landing-page .form-group input:focus {
    outline: none;
    border-color: #d4b45a;
    box-shadow: 0 0 0 2px rgba(212, 180, 90, 0.2);
}

.landing-page .form-group input::placeholder {
    color: rgba(242, 238, 230, 0.4);
}

.btn-landing {
    display: block;
    width: 100%;
    margin-top: 2px;
    padding: 7px 10px;
    border: 1px solid #d4b45a;
    border-radius: 2px;
    background: #5a6b3a;
    color: #f7f3e8;
    font-family: Oswald, "Arial Narrow", sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
}

.btn-landing:hover {
    background: #6b7e45;
    text-decoration: none;
}

.landing-links {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 12px;
    font-size: 0.72rem;
}

.landing-links a {
    color: #d4b45a;
}

.landing-links a:hover {
    color: #f0d78a;
}

.landing-page .alert {
    text-align: left;
    margin-bottom: 8px;
    padding: 6px 8px;
    font-size: 0.75rem;
}

.landing-page .alert-error,
.landing-page .alert-warning {
    background: rgba(120, 40, 30, 0.85);
    border: 1px solid rgba(255, 180, 160, 0.35);
    color: #ffe8e0;
}

.landing-page .alert-success {
    background: rgba(40, 80, 40, 0.85);
    border: 1px solid rgba(160, 220, 160, 0.35);
    color: #e8ffe8;
}

.landing-page .error-list {
    margin: 0;
    padding-left: 1.1em;
}

.landing-subpage {
    overflow: auto;
}

.landing-subpage-main {
    max-width: 560px;
    margin: 0 auto;
    padding: 88px 20px 40px;
    text-align: center;
}

/* About page */
.about-page {
    background:
        radial-gradient(ellipse 90% 50% at 50% -10%, rgba(90, 107, 58, 0.22), transparent 55%),
        linear-gradient(180deg, #16140f 0%, #1c1a14 40%, #12100c 100%);
}

.about-main {
    max-width: 720px;
    margin: 0 auto;
    padding: 88px 20px 64px;
}

.about-hero {
    text-align: center;
    margin-bottom: 28px;
}

.about-kicker {
    margin: 0 0 10px;
    font-family: Oswald, "Arial Narrow", sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #d4b45a;
}

.about-title {
    margin: 0 0 22px;
    font-family: Oswald, "Arial Narrow", sans-serif;
    font-size: clamp(1.55rem, 4.5vw, 2.15rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.02em;
    color: #f7f3e8;
}

.about-section {
    margin: 0 0 40px;
    color: #d8d2c4;
    font-size: 1.05rem;
    line-height: 1.65;
}

.about-section h2 {
    margin: 0 0 14px;
    font-family: Oswald, "Arial Narrow", sans-serif;
    font-size: clamp(1.25rem, 3vw, 1.55rem);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #f0d78a;
}

.about-section p {
    margin: 0 0 0.9em;
}

.about-emphasis {
    color: #f2eee6;
    font-weight: 600;
}

.about-figure {
    margin: 0 0 18px;
    overflow: hidden;
    border: 1px solid rgba(212, 180, 90, 0.28);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.about-figure-hero {
    margin-top: 4px;
}

.about-figure img {
    display: block;
    width: 100%;
    height: auto;
    vertical-align: middle;
    object-fit: cover;
    aspect-ratio: 3 / 2;
    opacity: 0;
    transform: translateY(12px);
    animation: about-reveal 0.7s ease forwards;
}

.about-section:nth-of-type(1) .about-figure img { animation-delay: 0.05s; }
.about-section:nth-of-type(2) .about-figure img { animation-delay: 0.1s; }
.about-section:nth-of-type(3) .about-figure img { animation-delay: 0.1s; }

@keyframes about-reveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.about-hero .about-title {
    opacity: 0;
    animation: about-reveal 0.65s ease 0.05s forwards;
}

.about-free-banner {
    margin: 28px 0 0;
    text-align: center;
}

.about-free-banner img {
    display: inline-block;
    width: min(100%, 520px);
    height: auto;
    opacity: 0;
    transform: translateY(10px);
    animation: about-reveal 0.7s ease 0.15s forwards;
}

.about-welcome {
    margin-top: 1.4em !important;
    font-family: Oswald, "Arial Narrow", sans-serif;
    font-size: 1.35rem;
    letter-spacing: 0.04em;
    color: #f7f3e8;
}

.about-tagline {
    font-style: italic;
    color: #d4b45a;
}

.about-cta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
    margin-top: 22px !important;
}

.about-cta {
    display: inline-block;
    width: auto;
    min-width: 140px;
    text-align: center;
    text-decoration: none;
}

.about-cta-secondary {
    color: #d4b45a;
    font-size: 0.95rem;
}

.about-cta-secondary:hover {
    color: #f0d78a;
}

@media (prefers-reduced-motion: reduce) {
    .about-figure img,
    .about-hero .about-title,
    .about-free-banner img {
        opacity: 1;
        transform: none;
        animation: none;
    }
}

.landing-contact {
    text-align: left;
}

.landing-contact h1 {
    text-align: center;
}

.landing-contact-lead,
.landing-contact-email {
    text-align: center;
    color: #c8c2b4;
}

.landing-contact-email a {
    color: #d4b45a;
}

.landing-contact-form {
    margin-top: 20px;
    text-align: left;
}

.landing-contact-form .form-group label {
    color: #e8e2d4;
}

.landing-contact-form input,
.landing-contact-form textarea {
    width: 100%;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(212, 180, 90, 0.35);
    color: #f2eee6;
    padding: 8px 10px;
    border-radius: 2px;
}

.impersonate-banner {
    background: #744210;
    color: #fffbeb;
    text-align: center;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.impersonate-banner .btn {
    margin-left: 8px;
    vertical-align: middle;
}

/* Vault — condensed password list */
.vault-list {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.vault-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    padding: 4px 8px;
    border-bottom: 1px solid #edf2f7;
    min-height: 32px;
    line-height: 1.25;
}

.vault-row:last-child {
    border-bottom: none;
}

.vault-row-main {
    flex: 1 1 140px;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 8px;
}

.vault-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1a202c;
    text-decoration: none;
}

.vault-name:hover {
    text-decoration: underline;
}

.vault-meta {
    font-size: 0.75rem;
    color: #718096;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 42%;
}

.vault-url {
    font-size: 0.75rem;
    color: #2b6cb0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 42%;
    text-decoration: none;
}

.vault-url:hover {
    text-decoration: underline;
    color: #2c5282;
}

.vault-row-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 0 0 auto;
}

.vault-secret {
    flex: 1 1 100%;
    padding: 2px 0 4px;
    font-size: 0.8rem;
}

.vault-password {
    font-family: Consolas, Monaco, monospace;
    background: #f7fafc;
    padding: 1px 6px;
    border-radius: 3px;
    margin-right: 8px;
}

.vault-notes {
    color: #4a5568;
}

.landing-subpage-main h1 {
    font-family: Oswald, "Arial Narrow", sans-serif;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #d4b45a;
    margin: 0 0 16px;
}

.landing-coming-soon {
    font-family: Oswald, "Arial Narrow", sans-serif;
    font-size: 1.6rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #f2eee6;
    margin: 0 0 12px;
}

@media (max-width: 480px) {
    .landing-nav {
        flex-direction: column;
        align-items: flex-start;
        padding-bottom: 14px;
    }

    .landing-nav-links {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Legacy landing helpers (unused by new index, kept for safety) */
.landing {
    text-align: center;
    padding-top: 12px;
}

.truck-photo {
    width: 100%;
    max-width: 480px;
    height: auto;
    border-radius: 8px;
    margin: 0 auto 20px;
    display: block;
    background: #cbd5e0;
    min-height: 180px;
    object-fit: cover;
}

.card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    margin-bottom: 16px;
}

.card h1, .card h2 {
    margin-top: 0;
    font-size: 1.25rem;
}

.form-group {
    margin-bottom: 14px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px; /* prevents iOS zoom */
}

.form-group input[type="checkbox"],
.form-group input[type="radio"] {
    width: auto;
    padding: 0;
    margin: 0 8px 0 0;
    vertical-align: middle;
}

.media-pick-panel {
    margin-top: 4px;
}

.compose-form {
    max-width: 720px;
}

.compose-top-bar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    margin: 0 0 12px;
}

.compose-type-fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    flex: 0 1 auto;
    min-width: 0;
}

.compose-type-radios {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
}

.compose-type-option {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.compose-type-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.compose-type-option span,
.compose-pill-btn {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 999px;
    background: #fff;
    color: #4a5568;
    font-family: inherit;
    font-size: 0.88rem;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
}

.compose-type-option input:checked + span {
    background: #2b6cb0;
    border-color: #2b6cb0;
    color: #fff;
}

.compose-type-option input:focus-visible + span {
    outline: 2px solid #2b6cb0;
    outline-offset: 2px;
}

.compose-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    margin-left: auto;
}

@media (max-width: 480px) {
    .compose-top-bar {
        gap: 4px;
    }

    .compose-type-radios,
    .compose-actions {
        gap: 4px;
    }

    .compose-type-option span,
    .compose-pill-btn {
        padding: 5px 9px;
        font-size: 0.8rem;
    }

    .compose-actions {
        margin-left: 4px;
    }
}

.compose-pill-btn:hover {
    background: #edf2f7;
    color: #2b6cb0;
}

.compose-pill-send {
    background: #2b6cb0;
    border-color: #2b6cb0;
    color: #fff;
}

.compose-pill-send:hover {
    background: #1a4971;
    color: #fff;
}

.compose-pill-send:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.compose-pill-danger {
    color: #c53030;
    border-color: #feb2b2;
}

.compose-pill-danger:hover {
    background: #fff5f5;
    color: #9b2c2c;
    border-color: #fc8181;
}

.note-compose-form .note-title-group {
    margin-bottom: 10px;
}

.note-title-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid #cbd5e0;
    border-radius: 10px;
    font: inherit;
    font-size: 1.05rem;
    font-weight: 600;
}

.note-title-input:focus {
    outline: none;
    border-color: #2b6cb0;
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.15);
}

.note-section-label {
    display: block;
    margin: 0 0 8px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #4a5568;
}

.note-keyword-pills {
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.note-reminder-panel {
    margin: 0 0 16px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f7fafc;
}

.note-reminder-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.note-reminder-field {
    flex: 1 1 180px;
    margin-bottom: 0;
}

.note-reminder-field input,
.note-reminder-field select {
    width: 100%;
}

.note-compose-form .note-dropzone {
    margin-top: 10px;
    padding: 14px 12px;
}

.compose-body-wrap {
    position: relative;
    margin-bottom: 14px;
}

.compose-body {
    display: block;
    width: 100%;
    min-height: 280px;
    box-sizing: border-box;
    padding: 14px 14px 48px;
    border: 1px solid #cbd5e0;
    border-radius: 10px;
    font: inherit;
    line-height: 1.45;
    resize: vertical;
}

.compose-body:focus {
    outline: none;
    border-color: #2b6cb0;
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.15);
}

.compose-emoji-bar {
    position: absolute;
    left: 10px;
    bottom: 10px;
}

.compose-emoji-toggle {
    background: #edf2f7;
    color: #4a5568;
}

.compose-emoji-panel {
    position: absolute;
    left: 0;
    bottom: calc(100% + 6px);
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(8, 1.75rem);
    gap: 4px;
    padding: 8px;
    background: #fff;
    border: 1px solid #cbd5e0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.compose-emoji-panel[hidden] {
    display: none;
}

.compose-emoji-btn {
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
}

.compose-emoji-btn:hover {
    background: #edf2f7;
}

.media-pick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.media-pick-btn {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* Large transparent hit-target — Android WebView often ignores tiny/opacity-hidden file inputs */
.media-input-native {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0;
    cursor: pointer;
    border: 0 !important;
    font-size: 100px;
    max-width: none !important;
    z-index: 2;
}

.form-group .media-input-submit {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0 !important;
}

.media-pick-zone {
    position: relative;
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    padding: 28px 14px;
    text-align: center;
    background: #f7fafc;
    min-height: 88px;
    overflow: hidden;
}

.media-pick-text {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    pointer-events: none;
}

.media-pick-zone .meta {
    margin: 6px 0 0;
    pointer-events: none;
}

.media-pick-zone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0.01;
    cursor: pointer;
    font-size: 32px;
    border: 0;
    background: transparent;
}

.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin: 0;
}

.checkbox-inline input[type="checkbox"] {
    width: auto;
    margin: 0;
    flex-shrink: 0;
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.duration-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.duration-row input[type="number"] {
    flex: 1 1 55%;
    width: auto;
    min-width: 0;
}

.duration-row select {
    flex: 0 0 38%;
    width: auto;
    min-width: 7.5rem;
}

.btn {
    display: inline-block;
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: #2b6cb0;
    color: #fff;
    width: 100%;
}

.btn-primary:hover {
    background: #2c5282;
    color: #fff;
    text-decoration: none;
}

.btn-secondary {
    background: #e2e8f0;
    color: #2d3748;
}

.btn-danger {
    background: #c53030;
    color: #fff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
    width: auto;
}

.form-links {
    margin-top: 12px;
    font-size: 0.9rem;
    text-align: center;
}

.alert {
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.alert-success {
    background: #c6f6d5;
    color: #22543d;
}

.alert-error {
    background: #fed7d7;
    color: #742a2a;
}

.alert-warning {
    background: #fefcbf;
    color: #744210;
}

.error-list {
    margin: 0;
    padding-left: 18px;
}

.module-grid {
    display: grid;
    gap: 12px;
}

.module-card {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.module-card-media {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.module-card-thumb {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    border-radius: 6px;
    object-fit: cover;
    display: block;
    background: #edf2f7;
}

.module-card-thumb-link {
    flex: 0 0 72px;
    display: block;
    line-height: 0;
    text-decoration: none;
}

.module-card-thumb-link:hover .module-card-thumb {
    opacity: 0.9;
    box-shadow: 0 0 0 2px #2c5282;
}

.module-card-title-link {
    color: inherit;
    text-decoration: none;
}

.module-card-title-link:hover {
    text-decoration: underline;
    color: #2c5282;
}

.module-card-body {
    flex: 1 1 auto;
    min-width: 0;
}

.module-card-body h3 {
    margin: 0 0 4px;
}

.module-card-body p {
    margin: 0;
    font-size: 0.9rem;
}

.module-card h3 {
    margin: 0 0 6px;
}

.module-card.disabled {
    opacity: 0.6;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    background: #edf2f7;
    color: #4a5568;
}

.badge-joint { background: #bee3f8; color: #2a4365; }
.badge-solo { background: #feebc8; color: #744210; }

.list-item {
    background: #fff;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.list-item h4 {
    margin: 0 0 6px;
    font-size: 1rem;
}

.meta {
    font-size: 0.85rem;
    color: #666;
}

.actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.msg-toolbar {
    align-items: center;
}

.msg-tabs-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
}

.msg-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
}

.msg-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    background: #fff;
    color: #4a5568;
    text-decoration: none;
    font-size: 0.92rem;
}

.msg-tab:hover {
    background: #edf2f7;
    color: #2b6cb0;
    text-decoration: none;
}

.msg-tab.is-active {
    background: #2b6cb0;
    border-color: #2b6cb0;
    color: #fff;
}

.msg-tab-count {
    display: inline-block;
    min-width: 1.25em;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.08);
    font-size: 0.78rem;
    line-height: 1.4;
    text-align: center;
}

.msg-tab.is-active .msg-tab-count {
    background: rgba(255, 255, 255, 0.22);
}

.msg-page-size-open {
    flex: 0 0 auto;
    color: #4a5568;
}

.msg-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
}

.msg-pager-meta {
    margin: 0;
}

.msg-pager-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.msg-search-wrap {
    flex: 1 1 160px;
    min-width: 140px;
    margin-left: auto;
}

.msg-search-wrap[hidden] {
    display: none !important;
}

.msg-search-toggle {
    flex: 0 0 auto;
    margin-left: auto;
    color: #4a5568;
}

.msg-search-toggle.is-active {
    color: #2b6cb0;
    background: #ebf8ff;
}

.msg-toolbar:has(.msg-search-wrap:not([hidden])) .msg-search-toggle {
    margin-left: 0;
}

.msg-search {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 6px 10px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 0.9rem;
}

.msg-row-filtered-out {
    display: none !important;
}

.rating-stars input {
    width: auto;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    padding: 8px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}

.coming-soon {
    text-align: center;
    padding: 40px 20px;
    color: #718096;
}

.secure-viewer {
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    max-width: 100%;
}

.secure-viewer img,
.secure-viewer video {
    max-width: 100%;
    display: block;
    margin: 0 auto;
}

.privacy-notice {
    font-size: 0.85rem;
    color: #744210;
    background: #fefcbf;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.unlock-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.unlock-row input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
}

.unlock-row input::placeholder {
    color: #a0aec0;
}

.btn-go {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    flex-shrink: 0;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: #2b6cb0;
    color: #fff;
    cursor: pointer;
}

.btn-go:hover {
    background: #2c5282;
}

.msg-section {
    margin-bottom: 12px;
}

.msg-section h2 {
    margin: 0 0 4px;
    font-size: 1rem;
}

.msg-empty {
    margin: 0 0 8px;
}

.msg-list {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    margin-bottom: 8px;
    overflow: hidden;
}

.msg-list-tips {
    overflow: visible;
}

.msg-list-tips .msg-row {
    position: relative;
    z-index: 1;
}

.msg-list-tips .msg-row:has(.msg-preview:hover),
.msg-list-tips .msg-row:has(.msg-preview:focus-within) {
    z-index: 5;
}

.msg-row-unread {
    background: #f7fafc;
}

.msg-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-bottom: 1px solid #edf2f7;
    font-size: 0.85rem;
    line-height: 1.3;
    min-height: 32px;
}

.msg-row:last-child {
    border-bottom: none;
}

.msg-preview {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

.msg-title-link {
    display: block;
    color: inherit;
    font-weight: 400;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-title-link:hover {
    color: #2b6cb0;
    text-decoration: underline;
}

.msg-title-link-unread {
    font-weight: 700;
}

.msg-preview-short {
    display: inline;
}

.msg-preview-full {
    display: none;
}

.msg-read-at {
    flex: 0 0 auto;
    max-width: 9.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.75rem;
    color: #718096;
}

.msg-read-at.is-unread {
    color: #c05621;
    font-weight: 600;
}

.msg-read-at.is-read {
    color: #2f855a;
}

.msg-read-at.is-expired {
    color: #a0aec0;
}

.msg-attach {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: #718096;
}

.msg-attach .msg-icon {
    width: 16px;
    height: 16px;
}

.msg-full-tip {
    left: 0;
    right: auto;
    max-width: min(36rem, calc(100vw - 32px));
    width: max-content;
}

@media (min-width: 720px) {
    .msg-preview-short {
        display: none;
    }

    .msg-preview-full {
        display: inline;
    }

    .msg-read-at {
        max-width: 12rem;
    }
}

.msg-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.msg-delete-form {
    display: inline;
    margin: 0;
}

.msg-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #4a5568;
    cursor: pointer;
    text-decoration: none;
}

.msg-icon-btn:hover {
    background: #edf2f7;
    color: #2b6cb0;
    text-decoration: none;
}

.page-title-row .msg-icon-btn {
    width: 72px;
    height: 72px;
}

.page-title-row .msg-icon-btn .msg-icon {
    width: 44px;
    height: 44px;
}

.graph-icon-btn {
    width: 72px;
    height: 72px;
}

.graph-icon-btn .msg-icon {
    width: 44px;
    height: 44px;
}

.msg-icon-danger:hover {
    background: #fed7d7;
    color: #c53030;
}

.msg-icon {
    width: 16px;
    height: 16px;
    display: block;
}

.list-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 10px;
    color: #718096;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.list-divider::before,
.list-divider::after {
    content: '';
    flex: 1 1 auto;
    height: 1px;
    background: #cbd5e0;
}

.list-divider span {
    flex: 0 0 auto;
}

.compact-list {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    overflow: hidden;
}

.compact-list-tips {
    overflow: visible;
}

.compact-list-tips .compact-row {
    position: relative;
    z-index: 1;
}

.compact-list-tips .compact-row:has(.compact-text-wrap:hover),
.compact-list-tips .compact-row:has(.compact-text-wrap:focus-within) {
    z-index: 5;
}

.compact-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-bottom: 1px solid #edf2f7;
    font-size: 0.85rem;
    line-height: 1.3;
    min-height: 30px;
}

.compact-row:last-child {
    border-bottom: none;
}

.compact-text {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

a.compact-text {
    display: block;
    width: 100%;
    text-decoration: none;
    color: inherit;
}

a.compact-text:hover,
a.compact-text:focus {
    color: #2b6cb0;
    outline: none;
}

a.compact-text:focus-visible {
    outline: 2px solid #2b6cb0;
    outline-offset: 2px;
    border-radius: 2px;
}

.compact-text-wrap {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

.compact-text-detail {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compact-text-detail:hover,
.compact-text-detail:focus {
    color: #2b6cb0;
    outline: none;
}

.compact-text-detail:focus-visible {
    outline: 2px solid #2b6cb0;
    outline-offset: 2px;
    border-radius: 2px;
}

.action-desc-tip {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 30;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
    font-size: 0.8rem;
    line-height: 1.45;
    color: #2d3748;
    white-space: normal;
    pointer-events: none;
}

@media (hover: hover) {
    .compact-text-wrap:hover .action-desc-tip,
    .compact-text-wrap:focus-within .action-desc-tip {
        display: block;
    }

    .msg-preview:hover .msg-full-tip,
    .msg-preview:focus-within .msg-full-tip {
        display: block;
    }
}

.list-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: #4a5568;
}

.list-icon-cat {
    color: #2b6cb0;
}

.list-icon-mode {
    color: #718096;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.action-select-filterable {
    min-height: 12rem;
}

.action-select-filterable.action-select-only {
    min-height: 0;
    height: auto;
}

.action-select-filterable option[hidden] {
    display: none;
}

.compact-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    flex: 0 0 auto;
    margin-left: auto;
}

.complete-action-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    margin: 0;
    cursor: pointer;
}

.complete-action-check-input {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: #2b6cb0;
}

.compact-trash-form {
    display: inline-flex;
    margin: 0;
    order: 99; /* always last */
}

.compact-spacer {
    width: 22px;
    flex-shrink: 0;
}

.compact-info-btn {
    flex-shrink: 0;
}

.help-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 1000;
}

.help-overlay[hidden] {
    display: none;
}

.help-popup-modal {
    margin: 0;
    max-width: 420px;
    width: 100%;
    background: #fff;
    border-color: #cbd5e0;
    color: #2d3748;
}

.filter-bar {
    margin-bottom: 10px;
}

.filter-bar[hidden] {
    display: none !important;
}

.page-title-row .msg-search-toggle {
    margin-left: 0;
}

.filter-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-end;
}

.filter-group {
    margin-bottom: 0;
    flex: 1 1 140px;
    min-width: 120px;
}

.filter-group label {
    font-size: 0.8rem;
}

.filter-actions {
    display: flex;
    gap: 6px;
    padding-bottom: 2px;
}

.add-own-details {
    margin-top: 14px;
}

.add-own-details summary {
    cursor: pointer;
    font-weight: 600;
    color: #2b6cb0;
}

.name-female {
    color: #d53f8c;
    font-weight: 600;
}

.name-male {
    color: #3182ce;
    font-weight: 600;
}

.history-detail-body {
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 0.9rem;
    margin: 8px 0 12px;
    padding: 0;
    background: transparent;
    border: none;
}

.history-detail-rate {
    margin: 12px 0;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.view-once-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.view-once-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin: 0;
}

.view-once-label input {
    width: auto;
    margin: 0;
}

.draft-preview {
    margin-bottom: 10px;
    padding: 8px;
    background: #f7fafc;
    border-radius: 6px;
}

.draft-preview img,
.draft-preview video {
    border-radius: 4px;
    margin-bottom: 6px;
}

.help-q {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid #a0aec0;
    border-radius: 50%;
    background: #edf2f7;
    color: #2d3748;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    vertical-align: middle;
}

.help-q:hover {
    background: #bee3f8;
    border-color: #2b6cb0;
    color: #2b6cb0;
}

.help-popup {
    margin-top: 10px;
    padding: 12px 14px;
    background: #ebf8ff;
    border: 1px solid #90cdf4;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #2a4365;
}

.help-popup p {
    margin: 8px 0;
}

.help-popup[hidden] {
    display: none;
}

#view-once-group {
    position: relative;
}

.importance-form {
    display: inline-flex;
    margin: 0;
}

.importance-select {
    width: auto !important;
    min-width: 52px;
    padding: 2px 4px !important;
    font-size: 0.8rem !important;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    background: #fff;
}

.importance-select.importance-badge {
    min-width: 28px;
    width: auto;
    max-width: 40px;
    height: 22px;
    padding: 0 14px 0 6px !important;
    border: 0;
    border-radius: 4px;
    background-color: #ebf8ff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath fill='%232b6cb0' d='M0 0l4 5 4-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
    color: #2b6cb0;
    font-weight: 700;
    text-align: center;
    text-align-last: center;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.importance-form:has(.importance-badge) {
    flex-shrink: 0;
}

.importance-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 22px;
    padding: 0 6px;
    border-radius: 4px;
    background: #ebf8ff;
    color: #2b6cb0;
    font-size: 0.8rem;
    font-weight: 700;
}

.importance-badge-mine {
    background: #f0fff4;
    color: #276749;
}

.compact-row-special {
    background: #fff5f7;
    box-shadow: inset 3px 0 0 #e53e3e;
}

.compact-row-special:hover {
    background: #ffe8ee;
}

.special-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 4px;
    border-radius: 4px;
    background: #fff5f7;
    color: #c53030;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
}

.compact-row-pending {
    background: #fffbeb;
}

.compact-row-pending .compact-text {
    color: #744210;
}

@media (min-width: 600px) {
    .btn-primary { width: auto; min-width: 140px; }
    .module-grid { grid-template-columns: 1fr 1fr; }
}

.android-install-steps {
    margin: 12px 0;
    padding-left: 1.25em;
    line-height: 1.5;
}

.android-install-steps li {
    margin-bottom: 6px;
}

.site-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.site-modal[hidden] {
    display: none !important;
}

.site-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.site-modal-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow: auto;
    background: #fff;
    border-radius: 8px;
    padding: 20px 18px 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.site-modal-panel h2 {
    margin: 0 40px 10px 0;
    font-size: 1.2rem;
}

.site-modal-close {
    position: absolute;
    top: 8px;
    right: 10px;
    border: 0;
    background: transparent;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: #4a5568;
}

body.site-modal-open {
    overflow: hidden;
}

/* Notes */
.inline-form {
    display: inline;
    margin: 0;
    padding: 0;
}

.note-group-label {
    margin: 14px 0 6px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #4a5568;
}

.keyword-list {
    margin: 0 0 12px;
    padding-left: 1.2em;
    font-size: 0.9rem;
}

.keyword-checks {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.note-dropzone {
    position: relative;
    border: 2px dashed #cbd5e0;
    border-radius: 6px;
    padding: 20px 12px;
    text-align: center;
    background: #f7fafc;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.note-dropzone-active,
.note-dropzone:hover {
    border-color: #2b6cb0;
    background: #ebf8ff;
}

.note-dropzone-text {
    margin: 0;
    font-size: 0.9rem;
    color: #4a5568;
    pointer-events: none;
}

.note-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.01;
    cursor: pointer;
    font-size: 32px;
    margin: 0;
    padding: 0;
    border: 0;
}

.note-photo-preview {
    margin-top: 10px;
}

.note-photo-preview img,
.note-photo-preview video,
.note-media-preview {
    max-width: 100%;
    max-height: 240px;
    border-radius: 6px;
    display: block;
}

.note-title-link {
    color: inherit;
    font-weight: 600;
    text-decoration: none;
}

.note-title-link:hover {
    color: #2b6cb0;
    text-decoration: underline;
}

button.history-detail-link {
    color: #2b6cb0;
    text-decoration: underline;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-family: inherit;
    font-size: inherit;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}

button.history-detail-link:hover {
    color: #1a4f8b;
}

/* Relationship test */
.test-progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.test-progress-bar > span {
    display: block;
    height: 100%;
    background: #2b6cb0;
    border-radius: 4px;
}

.test-results-icon {
    color: #2b6cb0;
}

.test-results-icon:hover {
    color: #1a4971;
    background: rgba(43, 108, 176, 0.1);
}

.test-print-icon {
    color: #3d4a2e;
}

.test-print-icon:hover {
    color: #243018;
    background: rgba(61, 74, 46, 0.1);
}

.test-question {
    border: none;
    border-bottom: 1px solid #e2e8f0;
    margin: 0 0 16px;
    padding: 0 0 14px;
}

.test-question legend {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 10px;
    padding: 0;
}

.test-likert-ends {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 0.72rem;
    color: #718096;
    white-space: nowrap;
}

.test-likert {
    display: flex;
    flex-wrap: nowrap;
    gap: 3px;
    width: 100%;
}

.test-likert-option {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    min-width: 0;
    padding: 8px 0;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    background: #fff;
    box-sizing: border-box;
    white-space: nowrap;
}

.test-likert-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.test-likert-option:has(input:checked),
.test-likert-option.is-selected {
    border-color: #2b6cb0;
    background: #ebf8ff;
    color: #2b6cb0;
}

.test-likert-num {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
}

.test-likert-label {
    display: none;
}

.test-results-group h2 {
    margin-top: 0;
    font-size: 1.05rem;
}

.test-score-row {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #edf2f7;
}

.test-score-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.test-score-label {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.test-score-axis {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #718096;
    margin-bottom: 4px;
}

.test-bar-wrap {
    position: relative;
    height: 22px;
    background: #edf2f7;
    border-radius: 4px;
    margin-bottom: 6px;
    overflow: hidden;
}

.test-bar {
    height: 100%;
    border-radius: 4px;
    min-width: 2px;
}

.test-bar-mine {
    background: #2b6cb0;
}

.test-bar-partner {
    background: #c53070;
}

.test-bar-caption {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.72rem;
    font-weight: 700;
    color: #1a202c;
    text-shadow: 0 0 4px #fff;
}

.test-insights {
    margin: 0;
    padding-left: 1.2em;
    font-size: 0.9rem;
}

/* Relationship health meter + perk */
.rh-dashboard {
    display: grid;
    gap: 12px;
    margin: 14px 0 18px;
}

@media (min-width: 600px) {
    .rh-dashboard {
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
    }
    .rh-dashboard > .meta {
        grid-column: 1 / -1;
    }
}

.rh-meter-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 12px 14px;
}

.rh-meter-panel .rh-meter-link {
    flex: 1 1 auto;
}

.rh-meter-panel .rh-meter-list-link {
    margin-top: auto;
    padding-top: 10px;
}

.rh-columns {
    display: grid;
    gap: 14px;
}

@media (min-width: 720px) {
    .rh-columns {
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
    }

    .rh-columns > .card {
        height: 100%;
        display: flex;
        flex-direction: column;
    }
}

.rh-card-title {
    margin: 0 0 12px;
    font-size: 1.05rem;
}

.rh-card-title-row {
    margin-bottom: 8px;
}

.rh-card-title-row .rh-card-title {
    margin: 0;
}

.rh-meter-list-link {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    margin-top: auto;
    padding-top: 12px;
}

.rh-columns > .card > .rh-meter-editor-form,
.rh-columns > .card > .rh-meter {
    flex: 1 1 auto;
}

.rh-love-list-icon {
    flex: 0 0 auto;
    color: #c05621;
}

.rh-love-list-icon:hover {
    color: #9c4221;
    background: rgba(192, 86, 33, 0.1);
}

.rh-perk-open-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 4px;
    margin: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    color: inherit;
}

.rh-partner-perk-indicator {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 4px;
    line-height: 0;
}

.rh-perk-open-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

.rh-meter {
    margin-bottom: 10px;
}

a.rh-meter-link {
    display: block;
    color: inherit;
    text-decoration: none;
    border-radius: 8px;
}

a.rh-meter-link:hover {
    text-decoration: none;
    background: rgba(0, 0, 0, 0.04);
}

a.rh-meter-link .rh-meter {
    margin-bottom: 0;
}

.rh-meter-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.rh-meter-label {
    color: #4a5568;
    font-size: 0.8rem;
}

.rh-meter-track {
    position: relative;
    height: 18px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.rh-meter-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.2s ease;
    background: linear-gradient(90deg, #e53e3e, #dd6b20, #d69e2e, #38a169);
    background-size: 100vw 100%;
}

.rh-meter-critical .rh-meter-fill { background: #c53030; }
.rh-meter-low .rh-meter-fill { background: #dd6b20; }
.rh-meter-ok .rh-meter-fill { background: #d69e2e; }
.rh-meter-good .rh-meter-fill { background: #38a169; }
.rh-meter-great .rh-meter-fill { background: #2f855a; }

.rh-meter-mini {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 112px;
    width: 112px;
    margin-left: auto;
    text-decoration: none;
    color: inherit;
}

.rh-meter-mini-track {
    position: relative;
    flex: 1 1 auto;
    width: 0;
    min-width: 0;
    height: 6px;
    border-radius: 3px;
    background: rgba(255,255,255,0.2);
    overflow: hidden;
}

.rh-meter-mini-score {
    font-size: 0.7rem;
    opacity: 0.9;
    flex: 0 0 auto;
    width: 2.2em;
    text-align: right;
}

.rh-meter-mini-fill {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: #68d391;
}

.rh-meter-mini.rh-meter-critical .rh-meter-mini-fill { background: #fc8181; }
.rh-meter-mini.rh-meter-low .rh-meter-mini-fill { background: #f6ad55; }
.rh-meter-mini.rh-meter-ok .rh-meter-mini-fill { background: #f6e05e; }
.rh-meter-mini.rh-meter-good .rh-meter-mini-fill { background: #68d391; }
.rh-meter-mini.rh-meter-great .rh-meter-mini-fill { background: #48bb78; }

.perk-icon-sm svg {
    width: 16px;
    height: 16px;
    vertical-align: -3px;
    margin-left: 2px;
}

.header-perk-alert {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    color: #e53e3e;
    text-decoration: none;
}

.header-perk-alert .perk-icon {
    color: #e53e3e;
}

.perk-icon-flash {
    animation: perk-flash 1s ease-in-out infinite;
}

@keyframes perk-flash {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.25; transform: scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
    .perk-icon-flash {
        animation: none;
        opacity: 1;
    }
}

.page-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin: 0 0 16px;
}

.page-hero-wrap {
    display: block;
}

.page-hero-wrap::after {
    content: '';
    display: table;
    clear: both;
}

.page-hero-wrap .page-hero-img {
    float: right;
    margin: 0 0 10px 14px;
    order: unset;
}

.page-hero-wrap .page-hero-text {
    order: unset;
}

.page-hero-wrap .page-hero-text h1 {
    margin: 0 0 8px;
    text-align: left;
}

.page-hero-wrap .page-hero-text .meta {
    font-size: 0.88rem;
    line-height: 1.55;
    color: #555;
}

.page-hero-text {
    flex: 1 1 auto;
    min-width: 0;
    order: 1;
}

.page-hero-img {
    order: 2;
}

.page-hero-text h1 {
    margin: 0 0 4px;
}

.page-hero-collapsible .page-hero-text h1 {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.page-hero-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    background: #fff;
    color: #4a5568;
    cursor: pointer;
    flex-shrink: 0;
    vertical-align: middle;
}

.page-hero-toggle:hover {
    background: #edf2f7;
    color: #2b6cb0;
    border-color: #a0aec0;
}

.page-hero-toggle-icon {
    width: 18px;
    height: 18px;
    display: none;
}

.page-hero-collapsible:not(.is-condensed) .page-hero-toggle-collapse {
    display: block;
}

.page-hero-collapsible.is-condensed .page-hero-toggle-expand {
    display: block;
}

.page-hero-collapsible.is-condensed .page-hero-img,
.page-hero-collapsible.is-condensed .page-hero-text .meta {
    display: none;
}

.page-hero-collapsible.is-condensed {
    margin-bottom: 10px;
}

.page-hero-collapsible.is-condensed.page-hero-wrap::after {
    display: none;
}

.page-hero-text .meta {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.45;
    color: #444;
}

.page-hero-img {
    flex: 0 0 auto;
    width: min(54vw, 300px);
    max-width: 330px;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

@media (min-width: 600px) {
    .page-hero-img {
        width: 330px;
    }
}

@media (max-width: 599px) {
    .page-hero:not(.page-hero-wrap) {
        display: block;
    }

    .page-hero:not(.page-hero-wrap)::after {
        content: '';
        display: table;
        clear: both;
    }

    .page-hero:not(.page-hero-wrap) .page-hero-img {
        float: right;
        margin: 0 0 10px 12px;
    }

    .page-hero {
        align-items: flex-start;
        gap: 12px;
    }

    .page-hero-img {
        width: 165px;
    }

    .page-hero-text h1 {
        font-size: 1.35rem;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .page-hero-text .meta {
        font-size: 0.88rem;
    }
}

.home-reminder-row {
    padding-top: 4px;
    padding-bottom: 4px;
    min-height: 0;
}

.home-reminder-row .compact-text {
    font-size: 0.85rem;
    line-height: 1.3;
}

.note-reminder-card {
    margin-top: 0;
}

.note-reminder-title {
    margin: 0 0 6px;
    font-size: 1.35rem;
}

.rh-meter-ticks {
    position: absolute;
    inset: 0;
    display: flex;
    pointer-events: none;
}

.rh-meter-ticks span {
    flex: 1;
    border-right: 1px solid rgba(255,255,255,0.35);
}

.rh-meter-ticks span:last-child {
    border-right: none;
}

.rh-meter-updated {
    margin: 4px 0 0;
}

.rh-meter-note {
    margin: 6px 0 0;
    font-size: 0.95rem;
    line-height: 1.4;
    font-style: italic;
    color: #4a5568;
}

.rh-meter-note-interactive {
    cursor: help;
}

.rh-meter-note-updated {
    display: none;
    margin-top: 4px;
    font-style: normal;
    font-size: 0.92em;
    color: #718096;
}

.rh-meter-note-interactive:hover .rh-meter-note-updated,
.rh-meter-note-interactive.is-showing-updated .rh-meter-note-updated {
    display: block;
}

.rh-mood-reason-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
}

.rh-mood-reason-text {
    flex: 1 1 auto;
    margin: 0;
    min-width: 0;
    font-size: 0.95rem;
    line-height: 1.4;
}

.rh-mood-reason-text.is-placeholder {
    color: #a0aec0;
    font-style: italic;
}

.rh-mood-reason-edit {
    flex: 0 0 auto;
    margin-top: 0;
    color: #4a5568;
}

.rh-mood-reason-edit:hover {
    color: #2b6cb0;
    background: rgba(0, 0, 0, 0.06);
}

.rh-editor-mood-note {
    margin-top: 10px;
}

.rh-meter-track-editable {
    cursor: grab;
    touch-action: none;
    overflow: visible;
}

.rh-meter-editor.is-dragging .rh-meter-track-editable {
    cursor: grabbing;
}

.rh-meter-editor.is-dragging .rh-meter-fill,
.rh-meter-editor.is-dragging .rh-meter-thumb {
    transition: none;
}

.rh-meter-thumb {
    position: absolute;
    top: 50%;
    width: 22px;
    height: 22px;
    margin-top: -11px;
    margin-left: -11px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #2d3748;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    transition: left 0.15s ease;
    z-index: 2;
}

.rh-meter-editor-form .form-group {
    margin-bottom: 10px;
}

.rh-meter-editor-form .form-group:last-of-type {
    margin-bottom: 0;
}

.rh-editor-perk {
    margin-top: 12px;
}

.rh-editor-actions {
    margin-top: 10px;
}

.rh-editor-clear-perk {
    margin-top: 10px;
}

.module-card-health .meta {
    margin-top: 0;
    margin-bottom: 10px;
}

.perk-icon {
    display: inline-flex;
    color: #c05621;
    flex-shrink: 0;
}

.perk-icon svg {
    display: block;
}

.perk-icon-lg {
    color: #c05621;
}

.perk-icon-lg svg {
    width: 40px;
    height: 40px;
}

.perk-icon-inline {
    vertical-align: middle;
    margin-right: 4px;
}

.perk-icon-inline svg {
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: -4px;
}

.perk-alert {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px 16px;
    margin: 12px 0;
    background: #fffaf0;
    border: 2px solid #ed8936;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(237, 137, 54, 0.2);
}

.perk-alert-body {
    flex: 1;
    min-width: 0;
}

.perk-alert-body strong {
    display: block;
    font-size: 1.05rem;
    color: #9c4221;
    margin-bottom: 4px;
}

.perk-alert-body p {
    margin: 0 0 10px;
    font-size: 0.9rem;
    color: #744210;
}

.perk-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 10px;
    background: #fffaf0;
    border-radius: 6px;
    color: #9c4221;
    font-size: 0.9rem;
    font-weight: 600;
}

#mood_level {
    width: 100%;
    padding: 0;
    height: 28px;
}

/* Workout stopwatch */
.module-card-stopwatch .meta {
    margin-top: 0;
    margin-bottom: 14px;
}

.workout-stopwatch {
    text-align: center;
}

#ws-log-card[hidden] {
    display: none !important;
}

.ws-display {
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: clamp(2.4rem, 12vw, 3.4rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.1;
    color: #1a202c;
    padding: 18px 12px;
    margin-bottom: 12px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    text-align: center;
}

.ws-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.ws-laps {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
    max-height: 220px;
    overflow: auto;
    text-align: left;
    border-top: 1px solid #edf2f7;
}

.ws-laps li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 2px;
    border-bottom: 1px solid #edf2f7;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}

.ws-lap-num {
    color: #718096;
}

.ws-lap-time {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 600;
    color: #2d3748;
}

.fitness-runner {
    container-type: inline-size;
}

.fitness-runner-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.fitness-runner-head h2 {
    margin: 0;
    font-size: 1.2rem;
}

.fitness-runner .ws-display {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-size: clamp(4.5rem, calc(100cqw / 5), 22rem);
    letter-spacing: 0.01em;
    line-height: 0.92;
    padding: 6px 0 10px;
    margin-bottom: 14px;
    white-space: nowrap;
    overflow: hidden;
}

.fitness-runner .ws-display.is-long-time {
    font-size: clamp(3.5rem, calc(100cqw / 7), 18rem);
}

.fitness-runner-progress {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-size: clamp(4.5rem, calc(100cqw / 5), 22rem);
    letter-spacing: 0.01em;
    line-height: 0.92;
    padding: 0;
    margin: 0 0 14px;
    text-align: center;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
}

.fitness-runner-current {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    text-align: center;
    font-size: clamp(2.25rem, calc(100cqw / 10), 11rem);
    letter-spacing: 0.01em;
    line-height: 1.05;
    font-weight: 700;
    margin: 0 0 4px;
    padding: 0 4px;
}

.fitness-runner-status {
    display: block;
    width: 100%;
    text-align: center;
    font-size: clamp(2.25rem, calc(100cqw / 10), 11rem);
    letter-spacing: 0.01em;
    line-height: 1.05;
    font-weight: 700;
    margin: 0 0 8px;
    padding: 0 4px;
}

.fitness-runner-status:empty {
    display: none;
    margin: 0;
}

.fitness-runner .meta {
    text-align: center;
    margin-bottom: 12px;
}

.fitness-segment-list {
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
    border-top: 1px solid #edf2f7;
}

.fitness-segment-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    padding: 10px 8px;
    border-bottom: 1px solid #edf2f7;
    border-radius: 6px;
    cursor: pointer;
}

.fitness-segment-row:hover {
    background: #f7fafc;
}

.fitness-segment-row.is-active {
    background: #ebf8ff;
    border-color: #bee3f8;
}

.fitness-segment-row.is-active:hover {
    background: #dbeafe;
}

.fitness-segment-row.is-done {
    opacity: 0.55;
}

.fitness-seg-name {
    appearance: none;
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    font: inherit;
    font-weight: 600;
    color: #2b6cb0;
    text-align: left;
    cursor: pointer;
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.25;
}

.fitness-seg-name:hover {
    text-decoration: underline;
    color: #2c5282;
}

.fitness-seg-meta {
    font-size: 0.9rem;
    color: #4a5568;
    font-weight: 600;
    white-space: nowrap;
    flex: 0 0 auto;
    margin-left: 8px;
}

.fitness-seg-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    color: #2b6cb0;
    border-radius: 4px;
    text-decoration: none;
}

.fitness-seg-link:hover {
    color: #2c5282;
    background: #ebf8ff;
}

.fitness-seg-link .msg-icon {
    width: 18px;
    height: 18px;
}

.fitness-seg-link-lg {
    width: 32px;
    height: 32px;
}

.fitness-seg-link-lg .msg-icon {
    width: 20px;
    height: 20px;
}

.fitness-seg-link[hidden] {
    display: none !important;
}

.fitness-timer-edit .fitness-timer-name {
    margin-bottom: 10px;
}

.fitness-timer-sounds {
    display: grid;
    gap: 8px;
}

@media (min-width: 600px) {
    .fitness-timer-sounds {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
}

.fitness-ex-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.fitness-ex-card {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    padding: 8px 10px;
}

.fitness-ex-card-main {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.fitness-ex-card-body {
    flex: 1 1 auto;
    min-width: 0;
}

.fitness-ex-card-body strong {
    display: block;
    margin-bottom: 2px;
}

.fitness-ex-card-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.fitness-ex-modal-panel {
    max-width: 520px;
    max-height: calc(100vh - 32px);
    overflow: auto;
}

.fitness-ex-modal-form .checkbox-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.fitness-custom-sounds-panel {
    max-width: 480px;
}

.fitness-custom-sounds-list-wrap {
    margin-bottom: 12px;
}

.fitness-custom-sound-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.fitness-custom-sound-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid #edf2f7;
}

.fitness-custom-sound-row:last-child {
    border-bottom: none;
}

.fitness-custom-sound-label {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.95rem;
}

.fitness-custom-sound-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.fitness-tts-box {
    margin: 0 0 12px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f7fafc;
}

.fitness-tts-box .form-group {
    margin-bottom: 10px;
}

.fitness-seg-list {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    overflow: hidden;
}

.fitness-seg-edit {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 0;
    padding: 6px 8px;
    border-bottom: 1px solid #edf2f7;
    background: #fff;
}

.fitness-seg-edit:last-child {
    border-bottom: none;
}

.fitness-seg-edit-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.fitness-seg-url-input {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 5px 8px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #2d3748;
}

.fitness-seg-order {
    flex: 0 0 1.25rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #718096;
    text-align: center;
}

.fitness-seg-sort-btns {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.fitness-seg-up:disabled,
.fitness-seg-down:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.fitness-seg-name-input {
    flex: 1 1 180px;
    min-width: 140px;
    margin: 0;
    padding: 6px 8px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 0.9rem;
}

.fitness-seg-duration {
    flex: 0 0 auto;
    margin: 0;
    gap: 2px;
}

.fitness-seg-duration input[type="number"] {
    flex: 0 0 auto;
    width: 3.2rem;
    min-width: 0;
    padding: 6px 4px;
    margin: 0;
    font-size: 0.85rem;
}

.fitness-seg-duration select {
    flex: 0 0 auto;
    width: 3.4rem;
    min-width: 0;
    padding: 6px 2px;
    margin: 0;
    font-size: 0.8rem;
}

.fitness-sound-row {
    display: flex;
    gap: 6px;
    align-items: center;
    width: 100%;
    max-width: 100%;
}

.fitness-sound-row select,
.fitness-sound-select {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    max-width: none;
    padding: 8px 10px;
    margin: 0;
    font-size: 0.95rem;
}

.fitness-sound-row .fitness-sound-preview,
.fitness-sound-row .msg-icon-btn {
    flex: 0 0 auto;
}

.fitness-seg-edit .fitness-seg-remove {
    margin-left: auto;
}

.inline-form {
    display: inline;
}

.page-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.page-title-row h1 {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
}

@media (max-width: 599px) {
    .page-title-row h1 {
        font-size: 1.15rem;
        line-height: 1.25;
    }
}

.health-graph-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 12px 0 8px;
}

.health-graph-modes {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.health-graph-metrics {
    margin-bottom: 4px;
}

.health-graph-modes .btn.is-active {
    background: #2b6cb0;
    color: #fff;
    border-color: #2b6cb0;
}

.health-graph-filter-btn {
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
}

.health-graph-filter-btn .msg-icon {
    width: 20px;
    height: 20px;
}

.health-graph-filter-btn.is-active {
    color: #2b6cb0;
    background: #ebf8ff;
}

.health-graph-filters-form {
    margin: 0;
}

.health-graph-filter-modal .health-graph-filter-fieldset legend {
    display: none;
}

.health-graph-nav {
    display: flex;
    gap: 6px;
}

.health-graph-period {
    margin: 0 0 4px;
    font-size: 1.15rem;
}

.health-graph-subtitle {
    margin: 0 0 12px;
}

.health-graph-wrap {
    padding: 12px 10px 6px;
}

.health-graph-canvas {
    display: block;
    width: 100%;
    max-height: 380px;
}

.health-graph-filters {
    margin-bottom: 12px;
    padding: 12px 14px;
}

.health-graph-filter-fieldset {
    border: 0;
    margin: 0;
    padding: 0;
}

.health-graph-filter-fieldset legend {
    font-weight: 600;
    margin-bottom: 8px;
    padding: 0;
}

.health-graph-filter-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 10px;
}

.health-graph-filter-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    cursor: pointer;
}

.health-graph-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
