@font-face {
    font-family: "Vazirmatn";
    src: url("/assets/fonts/Vazirmatn-Variable.woff2") format("woff2");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

:root {
    --primary: #7657e8;
    --primary-dark: #5b3fd0;
    --primary-soft: #eee9ff;
    --primary-faint: #f8f6ff;
    --ink: #252233;
    --ink-soft: #5f5a70;
    --muted: #8d889b;
    --line: #e9e6f0;
    --surface: rgba(255, 255, 255, 0.94);
    --surface-solid: #ffffff;
    --background: #f7f5fb;
    --success: #2da66f;
    --warning: #f59c43;
    --danger: #e45b75;
    --blue: #5395ef;
    --shadow: 0 24px 70px rgba(64, 45, 117, 0.12);
    --shadow-soft: 0 10px 35px rgba(64, 45, 117, 0.08);
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 14px;
    --safe-bottom: max(16px, env(safe-area-inset-bottom));
}

/* Visual refresh v3.9 */
:root {
    --primary: #6d55d9;
    --primary-dark: #4f3ca8;
    --primary-soft: #eeebff;
    --primary-faint: #f8f7ff;
    --ink: #211e2f;
    --ink-soft: #605b70;
    --muted: #817b91;
    --line: #e7e3ee;
    --surface: rgba(255, 255, 255, .94);
    --background: #f6f5fa;
    --shadow: 0 24px 70px rgba(49, 38, 86, .12);
    --shadow-soft: 0 10px 30px rgba(49, 38, 86, .08);
}

::selection {
    color: #fff;
    background: var(--primary);
}

:focus-visible {
    outline: 3px solid rgba(109, 85, 217, .28);
    outline-offset: 3px;
}

body {
    font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
    line-height: 1.65;
    text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

.ui-icon {
    display: inline-block;
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: middle;
}

.ui-icon--sm { width: 18px; height: 18px; }
.ui-icon--lg { width: 28px; height: 28px; }

.mobile-shell {
    border-inline: 1px solid rgba(231, 227, 238, .72);
    background:
        radial-gradient(circle at 100% 0, rgba(109, 85, 217, .07), transparent 24rem),
        rgba(250, 249, 252, .96);
    box-shadow: 0 0 70px rgba(49, 38, 86, .05);
}

.mobile-header {
    border-color: rgba(231, 227, 238, .82);
    background: rgba(250, 249, 252, .88);
    box-shadow: 0 8px 24px rgba(49, 38, 86, .035);
}

.mobile-header h1,
.admin-topbar h1 {
    font-weight: 850;
    letter-spacing: -.45px;
}

.mobile-header__subtitle,
.admin-topbar p {
    font-size: 12px;
}

.bottom-nav {
    min-height: 78px;
    border: 1px solid rgba(226, 222, 235, .92);
    border-bottom: 0;
    border-radius: 24px 24px 0 0;
    padding: 8px 12px var(--safe-bottom);
    background: rgba(255, 255, 255, .91);
    box-shadow: 0 -16px 44px rgba(49, 38, 86, .09);
}

.bottom-nav a {
    position: relative;
    gap: 5px;
    transition: color .2s ease, background .2s ease, transform .2s ease;
}

.bottom-nav a:hover {
    color: var(--primary-dark);
    background: rgba(109, 85, 217, .045);
}

.bottom-nav a.is-active {
    color: var(--primary-dark);
    background: linear-gradient(180deg, #f2efff, #faf9ff);
    box-shadow: inset 0 0 0 1px rgba(109, 85, 217, .08);
}

.bottom-nav .ui-icon {
    width: 21px;
    height: 21px;
}

.bottom-nav a.is-active .ui-icon {
    stroke-width: 2.25;
    transform: translateY(-1px);
}

.bottom-nav a small {
    font-size: 10px;
    font-weight: 750;
}

.form-card,
.calendar-card,
.chart-card,
.ticket-thread,
.chat-card,
.admin-card,
.quick-action-card,
.profile-hero,
.profile-links,
.metric-grid > article,
.admin-profile-card {
    border-color: rgba(226, 222, 235, .95);
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow-soft);
}

.quick-action-card,
.feature-tile,
.profile-links a,
.admin-menu a,
.button,
.btn {
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease, color .2s ease;
}

.quick-action-card:hover,
.feature-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(49, 38, 86, .1);
}

.feature-tile {
    border-color: rgba(94, 76, 142, .08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72);
}

.feature-tile--lilac { background: linear-gradient(145deg, #f2eeff, #e9e3ff); }
.feature-tile--mint { background: linear-gradient(145deg, #effaf5, #e3f5ed); }
.feature-tile--pink { background: linear-gradient(145deg, #fff3f8, #fce7f0); }
.feature-tile--peach { background: linear-gradient(145deg, #fff7ed, #ffecd8); }

.feature-tile__icon,
.quick-action-card__icon,
.big-icon,
.partner-hero__mark,
.notice-card__icon {
    display: grid;
    place-items: center;
}

.feature-tile__icon .ui-icon { width: 27px; height: 27px; stroke-width: 1.9; }
.quick-action-card__icon .ui-icon { width: 23px; height: 23px; }
.big-icon .ui-icon { width: 34px; height: 34px; }
.partner-hero__mark .ui-icon { width: 32px; height: 32px; }
.notice-card__icon .ui-icon { width: 21px; height: 21px; }

.button--primary,
.btn-primary {
    background: linear-gradient(135deg, #7d64e4, #5f46c4);
    box-shadow: 0 12px 26px rgba(93, 70, 196, .25);
}

.button--primary:hover,
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(93, 70, 196, .29);
}

.field input,
.field select,
.field textarea,
.admin-filter-bar input,
.admin-filter-bar select,
.inline-update-form input,
.inline-update-form select,
.plan-admin-list input,
.plan-admin-list textarea {
    border-color: #dfdbe7;
    background: #fdfcff;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
    border-color: #c9c1dc;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.admin-filter-bar input:focus,
.admin-filter-bar select:focus {
    border-color: #8f79e4;
    box-shadow: 0 0 0 4px rgba(109, 85, 217, .11);
}

.admin-body {
    background:
        radial-gradient(circle at 85% 0, rgba(109, 85, 217, .08), transparent 28rem),
        #f5f4f8;
}

.admin-sidebar {
    border-color: rgba(226, 222, 235, .9);
    background: rgba(255, 255, 255, .92);
    box-shadow: -12px 0 36px rgba(49, 38, 86, .04);
}

.admin-brand__mark {
    background: linear-gradient(145deg, #8068e3, #543bb6);
    box-shadow: 0 10px 22px rgba(84, 59, 182, .24);
}

.admin-brand__mark .ui-icon { width: 23px; height: 23px; }
.admin-menu .ui-icon { width: 20px; height: 20px; }

.admin-menu a.is-active {
    color: var(--primary-dark);
    background: linear-gradient(90deg, #ece8ff, #f7f5ff);
    box-shadow: inset -3px 0 0 var(--primary);
}

.admin-topbar {
    border-color: rgba(226, 222, 235, .9);
    background: rgba(245, 244, 248, .86);
}

.install-fab__icon {
    width: 19px;
    height: 19px;
}

@media (hover: none) {
    .quick-action-card:hover,
    .feature-tile:hover,
    .button--primary:hover,
    .btn-primary:hover {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--background);
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--ink);
    background:
        radial-gradient(circle at 90% 5%, rgba(147, 116, 244, 0.13), transparent 28rem),
        radial-gradient(circle at 5% 90%, rgba(236, 142, 192, 0.10), transparent 26rem),
        var(--background);
    font-family: Vazirmatn, Tahoma, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input,
a {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    color: inherit;
}

.ambient {
    position: fixed;
    z-index: -1;
    width: 18rem;
    height: 18rem;
    border-radius: 999px;
    filter: blur(90px);
    opacity: .22;
    pointer-events: none;
}

.ambient-one {
    top: -6rem;
    right: -5rem;
    background: #9e83f4;
}

.ambient-two {
    bottom: -8rem;
    left: -6rem;
    background: #f0a8cb;
}

.brand-logo {
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
}

.brand-logo--large {
    width: 92px;
    height: 92px;
}

.eyebrow {
    display: block;
    margin-bottom: 6px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: -.1px;
}

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

.btn {
    display: inline-flex;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 0;
    border-radius: 17px;
    padding: 0 22px;
    cursor: pointer;
    font-weight: 800;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.btn:active {
    transform: translateY(1px) scale(.995);
}

.btn:disabled {
    cursor: wait;
    opacity: .7;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #8062ed, #6849d9);
    box-shadow: 0 14px 30px rgba(118, 87, 232, .28);
}

.btn-primary:hover {
    box-shadow: 0 18px 34px rgba(118, 87, 232, .34);
}

.btn-soft {
    color: var(--primary-dark);
    background: var(--primary-soft);
}

.btn-white {
    min-height: 44px;
    color: var(--primary-dark);
    background: #fff;
}

.btn-compact {
    min-height: 42px;
    padding-inline: 16px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

.icon-button,
.avatar-button {
    display: inline-flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(255, 255, 255, .84);
    cursor: pointer;
}

.avatar-button {
    color: #fff;
    border: 0;
    background: linear-gradient(135deg, #957af2, #6949d6);
    font-weight: 900;
}

.avatar-button--admin {
    background: linear-gradient(135deg, #33275f, #7657e8);
}

.notification-button {
    position: relative;
    font-size: 22px;
}

.notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 7px;
    height: 7px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--danger);
}

.pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 7px 11px;
    color: var(--primary-dark);
    background: var(--primary-soft);
    font-size: 11px;
    font-weight: 800;
}

.pill-light {
    color: #6042ca;
    background: rgba(255, 255, 255, .82);
}

.pill-dark {
    color: #fff;
    background: rgba(37, 34, 51, .28);
}

.text-link {
    display: inline-block;
    color: var(--ink-soft);
    font-size: 13px;
}

.text-link strong {
    color: var(--primary);
}

.text-link--center {
    display: block;
    margin-top: 20px;
    text-align: center;
}

.install-fab {
    position: fixed;
    z-index: 60;
    right: 18px;
    bottom: calc(92px + var(--safe-bottom));
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    padding: 12px 16px;
    color: #fff;
    background: #2e2744;
    box-shadow: 0 12px 30px rgba(31, 23, 56, .24);
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
}

.install-fab[hidden] {
    display: none;
}

.install-fab__icon {
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 50%;
    background: rgba(255,255,255,.16);
}

.toast {
    position: fixed;
    z-index: 100;
    top: 18px;
    left: 50%;
    width: min(calc(100% - 32px), 420px);
    transform: translate(-50%, -130%);
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 16px;
    padding: 14px 18px;
    color: #fff;
    background: rgba(37, 34, 51, .94);
    box-shadow: var(--shadow);
    opacity: 0;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    transition: .25s ease;
}

.toast.is-visible {
    transform: translate(-50%, 0);
    opacity: 1;
}

.toast[data-type="success"] {
    background: rgba(30, 134, 88, .96);
}

.toast[data-type="error"] {
    background: rgba(194, 62, 86, .96);
}

/* Welcome */
.welcome-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 28px 18px;
}

.welcome-card {
    width: min(100%, 480px);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.74);
    border-radius: 38px;
    padding: 20px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.welcome-art {
    position: relative;
    display: grid;
    height: 265px;
    place-items: center;
    overflow: hidden;
    border-radius: 28px;
    background:
        linear-gradient(145deg, rgba(255,255,255,.4), rgba(255,255,255,0)),
        linear-gradient(135deg, #ece6ff, #f7eff8);
}

.welcome-art::after {
    content: "";
    position: absolute;
    bottom: -95px;
    width: 320px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255,255,255,.48);
}

.welcome-art .brand-logo {
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 20px 25px rgba(102,74,205,.18));
}

.orb {
    position: absolute;
    border-radius: 50%;
}

.orb-a {
    top: 32px;
    right: 45px;
    width: 70px;
    height: 70px;
    background: rgba(160, 130, 246, .18);
}

.orb-b {
    bottom: 50px;
    left: 48px;
    width: 44px;
    height: 44px;
    background: rgba(242, 158, 201, .22);
}

.welcome-copy {
    padding: 28px 8px 14px;
    text-align: center;
}

.welcome-copy h1 {
    margin: 0 0 8px;
    font-size: clamp(38px, 10vw, 52px);
    letter-spacing: -2px;
}

.welcome-copy p {
    margin: 0 auto;
    max-width: 360px;
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 2;
}

.welcome-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
    margin: 15px 0 22px;
}

.mini-feature {
    display: grid;
    min-height: 90px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 12px 8px;
    text-align: center;
}

.mini-feature span {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 11px;
    color: var(--primary);
    background: var(--primary-soft);
    font-size: 20px;
}

.mini-feature strong {
    font-size: 11px;
    line-height: 1.6;
}

.welcome-actions {
    display: grid;
    gap: 16px;
    text-align: center;
}

.trial-note {
    margin: 18px 0 2px;
    color: var(--muted);
    text-align: center;
    font-size: 11px;
}

/* Auth */
.auth-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 26px 18px;
}

.auth-card {
    width: min(100%, 450px);
    border: 1px solid rgba(255,255,255,.75);
    border-radius: 32px;
    padding: 26px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.auth-card--wide {
    width: min(100%, 520px);
}

.auth-header {
    display: grid;
    grid-template-columns: 44px 48px 1fr;
    align-items: center;
    gap: 13px;
    margin-bottom: 28px;
}

.auth-header h1 {
    margin: 0 0 5px;
    font-size: 24px;
}

.auth-header p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.auth-header .eyebrow {
    margin-bottom: 2px;
}

.auth-form {
    display: grid;
    gap: 17px;
}

.field {
    display: grid;
    gap: 8px;
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 800;
}

.field input {
    width: 100%;
    height: 54px;
    outline: 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 0 16px;
    color: var(--ink);
    background: #fff;
    transition: border .18s ease, box-shadow .18s ease;
}

.field input:focus {
    border-color: rgba(118, 87, 232, .68);
    box-shadow: 0 0 0 4px rgba(118, 87, 232, .10);
}

.field small {
    min-height: 14px;
    color: var(--danger);
    font-weight: 600;
}

.field.is-invalid input {
    border-color: var(--danger);
}

.password-field {
    position: relative;
    display: block;
}

.password-field input {
    padding-left: 52px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    left: 8px;
    width: 38px;
    height: 38px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 12px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 11px;
}

.check-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--ink-soft);
}

.check-label input {
    accent-color: var(--primary);
}

.link-button {
    border: 0;
    padding: 0;
    color: var(--primary);
    background: transparent;
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
}

.auth-separator {
    position: relative;
    margin: 25px 0;
    border-top: 1px solid var(--line);
    text-align: center;
}

.auth-separator span {
    position: relative;
    top: -10px;
    padding: 0 12px;
    color: var(--muted);
    background: #fff;
    font-size: 11px;
}

.auth-footnote {
    margin: 18px 0 0;
    color: var(--muted);
    text-align: center;
    font-size: 10px;
    line-height: 1.8;
}

.role-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 0;
    border: 0;
    padding: 0;
}

.role-picker legend {
    grid-column: 1 / -1;
    margin-bottom: 1px;
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 800;
}

.role-option {
    display: grid;
    grid-template-columns: 36px 1fr;
    align-items: center;
    gap: 10px;
    min-height: 78px;
    border: 1px solid var(--line);
    border-radius: 17px;
    padding: 12px;
    cursor: pointer;
    transition: .18s ease;
}

.role-option input {
    position: absolute;
    opacity: 0;
}

.role-option.is-selected {
    border-color: rgba(118, 87, 232, .62);
    background: var(--primary-faint);
    box-shadow: 0 0 0 3px rgba(118, 87, 232, .08);
}

.role-option__icon {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 12px;
    color: var(--primary);
    background: var(--primary-soft);
    font-size: 18px;
}

.role-option strong,
.role-option small {
    display: block;
}

.role-option strong {
    margin-bottom: 3px;
    font-size: 12px;
}

.role-option small {
    color: var(--muted);
    font-size: 9px;
    line-height: 1.5;
}

.spinner {
    display: none;
    width: 17px;
    height: 17px;
    border: 2px solid rgba(255,255,255,.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.is-loading .spinner {
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* App shell */
.mobile-app {
    width: min(100%, 860px);
    min-height: 100vh;
    margin: 0 auto;
    padding-bottom: calc(90px + var(--safe-bottom));
    background: rgba(250, 249, 252, .86);
}

.app-header {
    position: sticky;
    z-index: 30;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: max(18px, env(safe-area-inset-top)) 18px 14px;
    border-bottom: 1px solid rgba(233,230,240,.76);
    background: rgba(250, 249, 252, .88);
    backdrop-filter: blur(20px);
}

.app-header h1 {
    margin: 3px 0 0;
    font-size: 22px;
}

.app-header p {
    margin: 5px 0 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashboard-content {
    display: grid;
    gap: 24px;
    padding: 18px;
}

.cycle-hero {
    display: grid;
    grid-template-columns: 1fr 118px;
    align-items: center;
    gap: 20px;
    overflow: hidden;
    border-radius: 28px;
    padding: 25px;
    color: #fff;
    background:
        radial-gradient(circle at 85% 20%, rgba(255,255,255,.18), transparent 8rem),
        linear-gradient(135deg, #8063ea, #6546d3);
    box-shadow: 0 18px 40px rgba(102, 70, 211, .24);
}

.cycle-theme--menstrual { background: linear-gradient(180deg, #fff0f6 0, rgba(255,240,246,0) 420px); }
.cycle-theme--follicular { background: linear-gradient(180deg, #edf9fd 0, rgba(237,249,253,0) 420px); }
.cycle-theme--fertile { background: linear-gradient(180deg, #ebfaf4 0, rgba(235,250,244,0) 420px); }
.cycle-theme--luteal { background: linear-gradient(180deg, #fff8e8 0, rgba(255,248,232,0) 420px); }
.cycle-theme--late { background: linear-gradient(180deg, #f3f1f7 0, rgba(243,241,247,0) 420px); }

.cycle-hero--menstrual {
    background: radial-gradient(circle at 85% 20%, rgba(255,255,255,.2), transparent 8rem), linear-gradient(135deg, #d94f88, #a92d67);
    box-shadow: 0 18px 40px rgba(169,45,103,.25);
}

.cycle-hero--follicular {
    background: radial-gradient(circle at 85% 20%, rgba(255,255,255,.2), transparent 8rem), linear-gradient(135deg, #4dabc8, #277b9b);
    box-shadow: 0 18px 40px rgba(39,123,155,.24);
}

.cycle-hero--fertile {
    background: radial-gradient(circle at 85% 20%, rgba(255,255,255,.2), transparent 8rem), linear-gradient(135deg, #40aa84, #20765d);
    box-shadow: 0 18px 40px rgba(32,118,93,.24);
}

.cycle-hero--luteal {
    background: radial-gradient(circle at 85% 20%, rgba(255,255,255,.2), transparent 8rem), linear-gradient(135deg, #d89b32, #a86818);
    box-shadow: 0 18px 40px rgba(168,104,24,.24);
}

.cycle-hero--late {
    background: radial-gradient(circle at 85% 20%, rgba(255,255,255,.18), transparent 8rem), linear-gradient(135deg, #746987, #51475f);
    box-shadow: 0 18px 40px rgba(81,71,95,.22);
}

.cycle-hero--menstrual .cycle-ring > div { background: #9c285c; }
.cycle-hero--follicular .cycle-ring > div { background: #216f8c; }
.cycle-hero--fertile .cycle-ring > div { background: #19674f; }
.cycle-hero--luteal .cycle-ring > div { background: #945a14; }
.cycle-hero--late .cycle-ring > div { background: #463b52; }

.cycle-copy h2 {
    margin: 14px 0 7px;
    font-size: 21px;
}

.cycle-copy h2 strong {
    font-size: 30px;
}

.cycle-copy p {
    margin: 0;
    color: rgba(255,255,255,.82);
    font-size: 12px;
    line-height: 1.8;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 15px;
}

.hero-tags span {
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 999px;
    padding: 7px 9px;
    background: rgba(255,255,255,.11);
    font-size: 10px;
}

.cycle-ring {
    display: grid;
    width: 112px;
    height: 112px;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(#fff calc(var(--progress) * 1%), rgba(255,255,255,.19) 0);
}

.cycle-ring::before {
    content: "";
    position: absolute;
}

.cycle-ring__inner {
    display: grid;
    width: 88px;
    height: 88px;
    place-items: center;
    align-content: center;
    border-radius: 50%;
    background: #7657e8;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}

.cycle-ring__inner span {
    font-size: 31px;
    font-weight: 900;
    line-height: 1;
}

.cycle-ring__inner small {
    margin-top: 5px;
    color: rgba(255,255,255,.78);
    font-size: 10px;
}

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

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
}

.section-heading h2 {
    margin: 0;
    font-size: 17px;
}

.section-heading a {
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.quick-card {
    display: grid;
    min-height: 128px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 21px;
    padding: 14px 8px;
    background: #fff;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
}

.quick-card__icon {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 15px;
    font-size: 22px;
}

.quick-card__icon--purple { color: #7657e8; background: #eee9ff; }
.quick-card__icon--orange { color: #d8822b; background: #fff1df; }
.quick-card__icon--blue { color: #4488df; background: #eaf3ff; }
.quick-card__icon--pink { color: #d85284; background: #ffeaf2; }

.quick-card strong {
    margin-top: 8px;
    font-size: 12px;
}

.quick-card small {
    color: var(--muted);
    font-size: 9px;
}

.insight-card {
    display: grid;
    grid-template-columns: 48px 1fr 38px;
    align-items: center;
    gap: 13px;
    border: 1px solid #e8e0ff;
    border-radius: 22px;
    padding: 17px;
    background: linear-gradient(135deg, #fbf9ff, #f3efff);
}

.insight-card__icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 16px;
    color: var(--primary);
    background: #fff;
    box-shadow: var(--shadow-soft);
    font-size: 22px;
}

.insight-card h3 {
    margin: 0 0 5px;
    font-size: 14px;
}

.insight-card p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 10px;
    line-height: 1.8;
}

.round-arrow {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 0;
    border-radius: 13px;
    color: var(--primary);
    background: #fff;
    cursor: pointer;
}

.timeline-card {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 23px;
    padding: 10px;
    background: #fff;
}

.timeline-item {
    display: grid;
    min-height: 94px;
    place-items: center;
    border-radius: 17px;
    padding: 9px 5px;
    text-align: center;
}

.timeline-item.is-active {
    color: #fff;
    background: linear-gradient(145deg, #8265ec, #6647d3);
}

.timeline-day {
    font-size: 9px;
    opacity: .78;
}

.timeline-item strong {
    font-size: 12px;
}

.timeline-item small {
    color: var(--muted);
    font-size: 8px;
}

.timeline-item.is-active small {
    color: rgba(255,255,255,.75);
}

.sleep-banner {
    display: grid;
    grid-template-columns: 1fr 110px;
    align-items: center;
    overflow: hidden;
    border-radius: 27px;
    padding: 22px;
    color: #fff;
    background:
        radial-gradient(circle at 80% 25%, rgba(255,255,255,.17), transparent 8rem),
        linear-gradient(135deg, #2f2851, #5b47a2);
}

.sleep-banner h3 {
    margin: 14px 0 6px;
    font-size: 18px;
}

.sleep-banner p {
    margin: 0 0 15px;
    color: rgba(255,255,255,.74);
    font-size: 11px;
    line-height: 1.8;
}

.sleep-visual {
    display: grid;
    width: 100px;
    height: 100px;
    place-items: center;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 50%;
    background: rgba(255,255,255,.08);
    font-size: 57px;
    transform: rotate(-15deg);
}

.bottom-nav {
    position: fixed;
    z-index: 40;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    width: min(100%, 860px);
    min-height: 72px;
    margin: 0 auto;
    padding: 8px 10px var(--safe-bottom);
    border-top: 1px solid rgba(229,225,238,.92);
    background: rgba(255,255,255,.94);
    box-shadow: 0 -12px 35px rgba(58, 43, 99, .07);
    backdrop-filter: blur(22px);
}

.bottom-nav a {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 4px;
    border-radius: 15px;
    color: var(--muted);
}

.bottom-nav a span {
    font-size: 20px;
    line-height: 1;
}

.bottom-nav a small {
    font-size: 9px;
    font-weight: 700;
}

.bottom-nav a.is-active {
    color: var(--primary);
    background: var(--primary-faint);
}

/* Admin */
.mobile-app--admin {
    max-width: 980px;
}

.admin-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    overflow: hidden;
    border-radius: 27px;
    padding: 24px;
    color: #fff;
    background:
        radial-gradient(circle at 87% 20%, rgba(255,255,255,.14), transparent 9rem),
        linear-gradient(135deg, #342a5c, #6950cf);
    box-shadow: 0 18px 38px rgba(48, 36, 91, .20);
}

.admin-welcome h2 {
    margin: 14px 0 5px;
    font-size: 20px;
}

.admin-welcome p {
    margin: 0;
    color: rgba(255,255,255,.75);
    font-size: 11px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 11px;
}

.metric-card {
    display: grid;
    grid-template-columns: 46px 1fr;
    align-items: center;
    gap: 12px;
    min-height: 110px;
    border: 1px solid var(--line);
    border-radius: 21px;
    padding: 15px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.metric-icon {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 15px;
    font-size: 21px;
}

.metric-icon--purple { color: #7657e8; background: #eee9ff; }
.metric-icon--blue { color: #4488df; background: #e9f3ff; }
.metric-icon--orange { color: #d47b24; background: #fff0de; }
.metric-icon--pink { color: #d85284; background: #ffe9f2; }

.metric-card small,
.metric-card strong,
.metric-card span {
    display: block;
}

.metric-card small {
    color: var(--muted);
    font-size: 9px;
}

.metric-card strong {
    margin: 5px 0 2px;
    font-size: 18px;
}

.trend {
    color: var(--muted);
    font-size: 9px;
}

.trend-up {
    color: var(--success);
}

.admin-panel-card {
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 19px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.revenue-number {
    color: var(--primary);
    font-size: 15px;
}

.bar-chart {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    align-items: end;
    gap: 11px;
    height: 185px;
    margin-top: 20px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
}

.bar-chart__item {
    display: grid;
    height: 100%;
    grid-template-rows: 1fr 18px;
    align-items: end;
    gap: 5px;
    text-align: center;
}

.bar-chart__item span {
    display: block;
    width: 70%;
    height: var(--height);
    margin: 0 auto;
    border-radius: 10px 10px 5px 5px;
    background: #dcd5f6;
}

.bar-chart__item.is-highlight span {
    background: linear-gradient(180deg, #8c71ef, #6849d8);
    box-shadow: 0 12px 20px rgba(118,87,232,.2);
}

.bar-chart__item small {
    color: var(--muted);
    font-size: 9px;
}

.admin-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 11px;
}

.admin-actions a {
    display: grid;
    grid-template-columns: 43px 1fr auto;
    align-items: center;
    gap: 11px;
    min-height: 88px;
    border: 1px solid var(--line);
    border-radius: 21px;
    padding: 14px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.admin-action__icon {
    display: grid;
    width: 43px;
    height: 43px;
    place-items: center;
    border-radius: 14px;
    color: var(--primary);
    background: var(--primary-soft);
    font-size: 19px;
}

.admin-actions strong,
.admin-actions small {
    display: block;
}

.admin-actions strong {
    margin-bottom: 4px;
    font-size: 11px;
}

.admin-actions small {
    color: var(--muted);
    font-size: 8px;
    line-height: 1.5;
}

.admin-actions b {
    color: var(--primary);
    font-size: 15px;
}

.badge {
    display: grid;
    min-width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 999px;
    color: #fff !important;
    background: var(--danger);
    font-size: 9px !important;
}

.activity-list {
    display: grid;
    margin-top: 14px;
}

.activity-row {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 14px 2px;
    border-top: 1px solid var(--line);
}

.activity-row:first-child {
    border-top: 0;
}

.activity-row strong,
.activity-row small {
    display: block;
}

.activity-row strong {
    margin-bottom: 4px;
    font-size: 11px;
}

.activity-row small,
.activity-row > span:last-child {
    color: var(--muted);
    font-size: 9px;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.status-dot--green { background: var(--success); }
.status-dot--purple { background: var(--primary); }
.status-dot--orange { background: var(--warning); }

.placeholder-content {
    min-height: calc(100vh - 170px);
    place-items: center;
}

.placeholder-card {
    width: min(100%, 560px);
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 38px 24px;
    background: #fff;
    box-shadow: var(--shadow-soft);
    text-align: center;
}

.placeholder-icon {
    display: grid;
    width: 84px;
    height: 84px;
    margin: 0 auto 18px;
    place-items: center;
    border-radius: 26px;
    color: var(--primary);
    background: var(--primary-soft);
    font-size: 38px;
}

.placeholder-card h2 {
    margin: 17px 0 8px;
}

.placeholder-card p {
    margin: 0 auto;
    max-width: 400px;
    color: var(--ink-soft);
    font-size: 12px;
    line-height: 2;
}

.placeholder-card .muted {
    color: var(--muted);
}

.placeholder-progress {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 170px;
    margin: 24px auto;
}

.placeholder-progress span {
    height: 7px;
    border-radius: 999px;
    background: var(--primary-soft);
}

.placeholder-progress span:first-child {
    background: var(--primary);
}

.back-link {
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
}

.offline-card {
    text-align: center;
}

.offline-card h1 {
    margin: 16px 0 8px;
}

.offline-card p {
    margin: 0 0 22px;
    color: var(--ink-soft);
    font-size: 12px;
    line-height: 2;
}

@media (min-width: 861px) {
    .mobile-app {
        margin-block: 22px;
        min-height: calc(100vh - 44px);
        overflow: hidden;
        border: 1px solid rgba(255,255,255,.85);
        border-radius: 34px;
        box-shadow: var(--shadow);
    }

    .app-header {
        position: relative;
        padding-inline: 26px;
    }

    .dashboard-content {
        padding: 25px;
    }

    .bottom-nav {
        right: 50%;
        left: auto;
        transform: translateX(50%);
        border-radius: 0 0 34px 34px;
    }
}

@media (max-width: 720px) {
    .metrics-grid {
        grid-template-columns: 1fr 1fr;
    }

    .admin-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .welcome-card,
    .auth-card {
        border-radius: 28px;
        padding: 18px;
    }

    .welcome-art {
        height: 235px;
    }

    .welcome-features {
        gap: 6px;
    }

    .mini-feature {
        padding-inline: 5px;
    }

    .role-picker {
        grid-template-columns: 1fr;
    }

    .app-header h1 {
        font-size: 19px;
    }

    .dashboard-content {
        gap: 20px;
        padding: 15px;
    }

    .cycle-hero {
        grid-template-columns: 1fr 96px;
        padding: 20px;
    }

    .cycle-ring {
        width: 94px;
        height: 94px;
    }

    .cycle-ring__inner {
        width: 73px;
        height: 73px;
    }

    .cycle-ring__inner span {
        font-size: 25px;
    }

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

    .quick-card {
        min-height: 112px;
    }

    .timeline-card {
        overflow-x: auto;
        grid-template-columns: repeat(4, minmax(86px, 1fr));
    }

    .sleep-banner {
        grid-template-columns: 1fr 78px;
    }

    .sleep-visual {
        width: 75px;
        height: 75px;
        font-size: 41px;
    }

    .metrics-grid {
        gap: 8px;
    }

    .metric-card {
        grid-template-columns: 38px 1fr;
        gap: 8px;
        padding: 12px;
    }

    .metric-icon {
        width: 38px;
        height: 38px;
        font-size: 17px;
    }

    .admin-welcome {
        align-items: flex-start;
        flex-direction: column;
    }

    .bar-chart {
        gap: 7px;
    }

    .auth-header {
        grid-template-columns: 40px 42px 1fr;
        gap: 9px;
    }

    .auth-header .brand-logo {
        width: 42px;
        height: 42px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* Phase 2: secure browser session authentication */
.logout-button {
    color: var(--danger, #d64562);
}

.logout-button:disabled,
[data-session-logout]:disabled {
    cursor: wait;
    opacity: .55;
}

.access-denied-card {
    max-width: 430px;
    text-align: center;
}

.access-denied-icon {
    display: grid;
    width: 78px;
    height: 78px;
    margin: 0 auto 18px;
    place-items: center;
    border: 1px solid rgba(214, 69, 98, .18);
    border-radius: 26px;
    background: rgba(214, 69, 98, .1);
    color: #d64562;
    font-size: 38px;
    font-weight: 900;
}

.access-denied-card h1 {
    margin: 8px 0 10px;
}

.access-denied-card p {
    margin: 0 0 24px;
    color: var(--muted);
    line-height: 1.9;
}

.header-actions .logout-button {
    flex: 0 0 auto;
}

.avatar-button {
    text-decoration: none;
}

/* ================================================================
   Complete user portal and administration dashboard — v3
   ================================================================ */
:root {
    --surface-raised: #fff;
    --surface-tint: #fbfaff;
    --mint: #eaf8f2;
    --pink-soft: #fff0f6;
    --peach-soft: #fff4e7;
    --admin-sidebar: #ffffff;
}

textarea,
select,
input {
    font: inherit;
}

textarea {
    resize: vertical;
}

.server-flash {
    position: fixed;
    z-index: 200;
    top: max(14px, env(safe-area-inset-top));
    left: 50%;
    width: min(calc(100% - 28px), 560px);
    transform: translateX(-50%);
    border: 1px solid transparent;
    border-radius: 16px;
    padding: 13px 17px;
    box-shadow: 0 18px 50px rgba(44, 34, 79, .18);
    font-size: 13px;
    font-weight: 800;
    text-align: center;
    animation: flash-in .25s ease both;
}

.server-flash--success {
    color: #176946;
    border-color: #bce9d3;
    background: #effcf5;
}

.server-flash--error {
    color: #a2384c;
    border-color: #f4c4ce;
    background: #fff1f4;
}

@keyframes flash-in {
    from { opacity: 0; transform: translate(-50%, -12px); }
}

.mobile-shell {
    position: relative;
    width: min(100%, 860px);
    min-height: 100vh;
    margin: 0 auto;
    background: rgba(249, 248, 252, .92);
}

.mobile-header {
    position: sticky;
    z-index: 30;
    top: 0;
    display: flex;
    min-height: 84px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: max(15px, env(safe-area-inset-top)) 18px 13px;
    border-bottom: 1px solid rgba(233, 230, 240, .78);
    background: rgba(249, 248, 252, .9);
    backdrop-filter: blur(22px);
}

.mobile-header h1 {
    margin: 0;
    font-size: clamp(19px, 5vw, 25px);
    letter-spacing: -.6px;
}

.mobile-header__subtitle {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.avatar-button {
    overflow: hidden;
}

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

.page-content {
    display: grid;
    gap: 18px;
    padding: 18px;
}

.page-content--with-nav {
    padding-bottom: calc(98px + var(--safe-bottom));
}

.section-kicker {
    display: block;
    margin-bottom: 5px;
    color: var(--primary);
    font-size: 10px;
    font-weight: 900;
}

.notice-card {
    display: grid;
    grid-template-columns: 42px 1fr;
    align-items: center;
    gap: 12px;
    border: 1px solid #ded5ff;
    border-radius: 19px;
    padding: 14px;
    background: linear-gradient(135deg, #faf8ff, #f0ebff);
}

.notice-card__icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 14px;
    color: #fff;
    background: var(--primary);
}

.notice-card strong,
.notice-card p {
    display: block;
    margin: 0;
}

.notice-card strong { font-size: 12px; }
.notice-card p { margin-top: 4px; color: var(--ink-soft); font-size: 10px; line-height: 1.7; }

.cycle-hero {
    grid-template-columns: minmax(0, 1fr) 112px;
    min-height: 218px;
    padding: 24px;
}

.cycle-hero__copy h2 {
    margin: 10px 0 4px;
    font-size: 25px;
}

.cycle-hero__copy > p {
    margin: 0;
    color: rgba(255,255,255,.82);
    font-size: 12px;
}

.cycle-hero__copy .section-kicker {
    color: #ede7ff;
}

.cycle-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 17px;
}

.cycle-hero__meta span {
    border: 1px solid rgba(255,255,255,.19);
    border-radius: 999px;
    padding: 6px 9px;
    background: rgba(255,255,255,.1);
    font-size: 9px;
}

.cycle-ring {
    position: relative;
}

.cycle-ring > div {
    display: grid;
    width: 88px;
    height: 88px;
    place-items: center;
    align-content: center;
    border-radius: 50%;
    background: #7657e8;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.13);
}

.cycle-ring strong { font-size: 30px; line-height: 1; }
.cycle-ring span { margin-top: 5px; color: rgba(255,255,255,.75); font-size: 9px; }

.quick-action-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 15px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.quick-action-card > div {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quick-action-card__icon {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 15px;
    color: var(--primary);
    background: var(--primary-soft);
    font-size: 20px;
}

.quick-action-card strong,
.quick-action-card p { display: block; margin: 0; }
.quick-action-card strong { font-size: 12px; }
.quick-action-card p { margin-top: 4px; color: var(--muted); font-size: 9px; }

.round-action {
    display: grid;
    width: 43px;
    height: 43px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, #8569ee, #6545d2);
    box-shadow: 0 10px 20px rgba(118,87,232,.24);
    font-size: 25px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
}

.feature-tile {
    display: grid;
    min-height: 145px;
    align-content: center;
    border: 1px solid rgba(80, 63, 119, .06);
    border-radius: 23px;
    padding: 17px;
    transition: transform .18s ease, box-shadow .18s ease;
}

.feature-tile:active { transform: scale(.985); }
.feature-tile--lilac { background: #f0ebff; }
.feature-tile--mint { background: #eaf8f2; }
.feature-tile--pink { background: #fff0f6; }
.feature-tile--peach { background: #fff4e7; }
.feature-tile__icon { font-size: 26px; }
.feature-tile strong { margin-top: 14px; font-size: 13px; }
.feature-tile p { margin: 5px 0 0; color: var(--ink-soft); font-size: 9px; line-height: 1.6; }

.partner-hero {
    display: grid;
    min-height: 255px;
    place-items: center;
    align-content: center;
    border-radius: 29px;
    padding: 25px;
    color: #fff;
    background: linear-gradient(145deg, #392d63, #7455dc);
    text-align: center;
    box-shadow: 0 20px 42px rgba(62, 45, 111, .23);
}

.partner-hero__mark {
    display: grid;
    width: 65px;
    height: 65px;
    place-items: center;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 22px;
    background: rgba(255,255,255,.1);
    font-size: 34px;
}

.partner-hero .section-kicker { margin-top: 15px; color: #dcd4ff; }
.partner-hero h2 { margin: 4px 0 7px; font-size: 24px; }
.partner-hero p { max-width: 380px; margin: 0; color: rgba(255,255,255,.78); font-size: 11px; line-height: 1.8; }

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 17px;
}
.button-row--center { justify-content: center; }

.button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 16px;
    padding: 0 20px;
    cursor: pointer;
    font-weight: 900;
    transition: .18s ease;
}
.button:active { transform: translateY(1px); }
.button--primary { color: #fff; background: linear-gradient(135deg, #8062ed, #6849d9); box-shadow: 0 12px 25px rgba(118,87,232,.23); }
.button--secondary { color: var(--primary-dark); background: var(--primary-soft); }
.button--white { color: var(--primary-dark); background: #fff; }
.button--ghost-white { color: #fff; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.08); }
.button--danger-ghost { color: var(--danger); border: 1px solid #f2ccd4; background: #fff6f8; }
.button--small { min-height: 40px; border-radius: 13px; padding-inline: 15px; font-size: 11px; }
.button--full { width: 100%; }

.mini-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
}

.mini-stats > div {
    display: grid;
    min-height: 92px;
    place-items: center;
    align-content: center;
    border: 1px solid var(--line);
    border-radius: 19px;
    background: #fff;
    text-align: center;
}
.mini-stats strong { font-size: 19px; }
.mini-stats span { margin-top: 5px; color: var(--muted); font-size: 8px; }
.mini-stats--stacked { grid-template-columns: 1fr 1fr; margin-top: 18px; }

/* General cards and forms */
.form-card,
.calendar-card,
.chart-card,
.ticket-thread,
.chat-card,
.admin-card {
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 18px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}
.form-card--spacious { padding: 20px; }
.form-card--centered { text-align: center; }
.form-card--centered > p { color: var(--ink-soft); font-size: 11px; line-height: 1.8; }
.big-icon { display: grid; width: 70px; height: 70px; margin: 0 auto 14px; place-items: center; border-radius: 24px; color: var(--primary); background: var(--primary-soft); font-size: 34px; }

.stack-form { display: grid; gap: 14px; }
.field-grid { display: grid; gap: 12px; }
.field-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.field span:first-child {
    display: block;
    margin-bottom: 7px;
    color: var(--ink-soft);
    font-size: 10px;
    font-weight: 800;
}

.field input,
.field select,
.field textarea,
.admin-filter-bar input,
.admin-filter-bar select,
.inline-update-form input,
.inline-update-form select,
.plan-admin-list input,
.plan-admin-list textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    outline: 0;
    padding: 12px 13px;
    color: var(--ink);
    background: #fcfbfe;
    transition: border .18s ease, box-shadow .18s ease;
}

.field input,
.field select { min-height: 47px; }
.field input:focus,
.field select:focus,
.field textarea:focus,
.admin-filter-bar input:focus,
.admin-filter-bar select:focus { border-color: #a58ff0; box-shadow: 0 0 0 4px rgba(118,87,232,.09); }

.soft-divider { height: 1px; margin: 5px 0; border: 0; background: var(--line); }
.center-form { text-align: center; }
.text-button { border: 0; padding: 7px; color: var(--primary); background: transparent; cursor: pointer; font-size: 10px; font-weight: 900; }
.text-button--danger { color: var(--danger); }

.status-chip {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 9px;
    font-style: normal;
    font-weight: 900;
}
.status-chip--success { color: #18724b; background: #e8f8f0; }
.status-chip--warning { color: #a45e1b; background: #fff2df; }
.status-chip--muted { color: #6d687a; background: #efedf3; }
.soft-badge { display: inline-flex; border-radius: 999px; padding: 5px 9px; color: var(--primary-dark); background: var(--primary-soft); font-size: 9px; font-style: normal; font-weight: 800; }

.empty-state {
    display: grid;
    min-height: 180px;
    place-items: center;
    align-content: center;
    gap: 7px;
    color: var(--muted);
    text-align: center;
}
.empty-state > span { font-size: 35px; }
.empty-state strong { color: var(--ink); font-size: 13px; }
.empty-state p { max-width: 320px; margin: 0; font-size: 10px; line-height: 1.7; }
.empty-state--compact { min-height: 95px; }

/* Calendar */
.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.calendar-toolbar button { display: grid; width: 36px; height: 36px; place-items: center; border: 0; border-radius: 12px; color: var(--primary); background: var(--primary-soft); cursor: pointer; font-size: 22px; }
.calendar-toolbar strong { font-size: 14px; }
.calendar-weekdays,
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.calendar-weekdays { margin-bottom: 8px; color: var(--muted); text-align: center; font-size: 9px; }
.calendar-day { position: relative; display: grid; min-height: 46px; place-items: center; border: 0; border-radius: 13px; color: #2f2742; background: transparent; cursor: default; font-size: 12px; font-weight: 750; }
.calendar-day.is-muted { opacity: .52; }
.calendar-day.is-today { box-shadow: inset 0 0 0 2px #6543d7; color: #4d2bb7; font-weight: 950; }
.calendar-day.is-period { color: #771744; background: #f8bfd8; }
.calendar-day.is-fertile { color: #12563f; background: #c4ead8; }
.calendar-day.is-ovulation { color: #064f4a; background: #91ddd3; box-shadow: inset 0 0 0 2px #48b9ac; font-weight: 950; }
.calendar-day.is-follicular { color: #15536b; background: #cbe9f3; }
.calendar-day.is-luteal { color: #62400e; background: #f6d58e; }
.calendar-day.is-next { color: #48239e; background: #d8cdfa; font-weight: 850; }
.calendar-day i { position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; color: #554c68; font-size: 9px; font-weight: 700; }
.calendar-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.legend-dot--period { background: #d95b94; }
.legend-dot--follicular { background: #5aaac6; }
.legend-dot--fertile { background: #3dab87; }
.legend-dot--luteal { background: #d99c2c; }
.legend-dot--next { background: #7657e8; }

.stats-banner { display: grid; grid-template-columns: repeat(3, 1fr); overflow: hidden; border-radius: 21px; color: #fff; background: linear-gradient(135deg, #342a5d, #6650b9); }
.stats-banner div { display: grid; min-height: 88px; place-items: center; align-content: center; border-left: 1px solid rgba(255,255,255,.1); text-align: center; }
.stats-banner div:last-child { border-left: 0; }
.stats-banner span { color: rgba(255,255,255,.67); font-size: 8px; }
.stats-banner strong { margin-top: 5px; font-size: 12px; }

.history-list { display: grid; gap: 9px; }
.history-item { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 17px; padding: 12px; background: #fff; }
.history-item__marker { width: 8px; height: 42px; border-radius: 999px; background: linear-gradient(#d6699d, #f3b8d2); }
.history-item strong { font-size: 11px; }
.history-item p { margin: 4px 0 0; color: var(--muted); font-size: 8px; }
.icon-button--danger { color: var(--danger); border-color: #f2d2d9; background: #fff7f8; }

/* Symptoms */
.date-selector { display: flex; align-items: end; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 18px; padding: 12px 15px; background: #fff; }
.date-selector label { flex: 1; }
.date-selector label span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; }
.date-selector input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-weight: 800; }
.question-block { display: grid; gap: 13px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.question-block:last-of-type { border-bottom: 0; }
.question-block__title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.question-block__title strong { font-size: 13px; }
.question-block__title span { color: var(--muted); font-size: 9px; }
.emoji-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.emoji-scale label { cursor: pointer; }
.emoji-scale input { position: absolute; opacity: 0; }
.emoji-scale label > span { display: grid; min-height: 53px; place-items: center; border: 1px solid var(--line); border-radius: 16px; background: #fbfafd; font-size: 23px; transition: .18s; }
.emoji-scale small { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; text-align: center; }
.emoji-scale input:checked + span { border-color: #9d85ef; background: var(--primary-soft); box-shadow: 0 8px 18px rgba(118,87,232,.13); transform: translateY(-2px); }
.segmented-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.segmented-scale input { position: absolute; opacity: 0; }
.segmented-scale span { display: grid; min-height: 38px; place-items: center; border: 1px solid var(--line); border-radius: 12px; color: var(--ink-soft); background: #fbfafd; font-size: 8px; cursor: pointer; }
.segmented-scale input:checked + span { color: #fff; border-color: var(--primary); background: var(--primary); }
.range-input { width: 100%; accent-color: var(--primary); }
.range-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 8px; }
.choice-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.choice-chips input { position: absolute; opacity: 0; }
.choice-chips span { display: inline-flex; min-height: 35px; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 0 12px; color: var(--ink-soft); background: #fff; font-size: 9px; cursor: pointer; }
.choice-chips input:checked + span { color: var(--primary-dark); border-color: #b9a7f5; background: var(--primary-soft); font-weight: 800; }
.log-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 5px; scrollbar-width: none; }
.log-strip::-webkit-scrollbar { display: none; }
.log-strip__item { display: grid; min-width: 82px; min-height: 105px; place-items: center; align-content: center; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.log-strip__item span { color: var(--muted); font-size: 8px; }
.log-strip__item strong { margin: 6px 0; font-size: 22px; }
.log-strip__item small { color: var(--ink-soft); font-size: 7px; }

/* Reports and charts */
.report-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; border-radius: 14px; padding: 4px; background: #ece9f2; }
.report-tabs button,
.report-tabs a { display: grid; min-height: 38px; place-items: center; border: 0; border-radius: 11px; color: var(--muted); background: transparent; cursor: pointer; font-size: 9px; font-weight: 800; }
.report-tabs .is-active { color: var(--primary); background: #fff; box-shadow: 0 6px 14px rgba(70,54,111,.07); }
.report-stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.report-stat-grid article { display: grid; min-height: 105px; place-items: center; align-content: center; border: 1px solid var(--line); border-radius: 20px; background: #fff; text-align: center; }
.report-stat-grid span { color: var(--muted); font-size: 8px; }
.report-stat-grid strong { margin: 7px 0 1px; color: var(--primary-dark); font-size: 22px; }
.report-stat-grid small { color: var(--muted); font-size: 7px; }
.line-chart { position: relative; width: 100%; min-height: 180px; margin-top: 12px; overflow: hidden; }
.line-chart svg { display: block; width: 100%; height: 180px; }
.line-chart .grid-line { stroke: #eeeaf4; stroke-width: 1; }
.line-chart .series-0 { fill: none; stroke: #7657e8; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.line-chart .series-1 { fill: none; stroke: #ef8bb8; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.line-chart .point-0 { fill: #7657e8; }
.line-chart .point-1 { fill: #ef8bb8; }
.chart-legend { display: flex; gap: 15px; color: var(--muted); font-size: 8px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-line { display: inline-block; width: 18px; height: 3px; border-radius: 999px; }
.legend-line--primary { background: #7657e8; }
.legend-line--secondary { background: #ef8bb8; }
.bar-chart[data-bar-chart] { display: flex; align-items: end; gap: 5px; height: 170px; padding: 20px 0 0; border: 0; }
.bar-chart[data-bar-chart] .dynamic-bar { position: relative; display: flex; flex: 1; height: 100%; align-items: end; justify-content: center; }
.bar-chart[data-bar-chart] .dynamic-bar i { display: block; width: 68%; min-height: 3px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, #9d86ef, #6a4bd7); }
.bar-chart[data-bar-chart] .dynamic-bar small { position: absolute; bottom: -16px; color: var(--muted); font-size: 6px; }
.cycle-summary-card { display: grid; grid-template-columns: 108px 1fr; align-items: center; gap: 18px; border-radius: 24px; padding: 19px; color: #fff; background: linear-gradient(135deg, #8063e9, #5f41ca); }
.cycle-summary-card__ring { display: grid; width: 100px; height: 100px; place-items: center; align-content: center; border-radius: 50%; background: conic-gradient(#fff calc(var(--progress) * 1%), rgba(255,255,255,.17) 0); box-shadow: inset 0 0 0 12px #6f50d9; }
.cycle-summary-card__ring strong { font-size: 25px; }
.cycle-summary-card__ring span { color: rgba(255,255,255,.75); font-size: 8px; }
.cycle-summary-card .section-kicker { color: #e8e1ff; }
.cycle-summary-card h2 { margin: 0 0 5px; }
.cycle-summary-card p { margin: 0; color: rgba(255,255,255,.75); font-size: 9px; line-height: 1.8; }
.rank-list { display: grid; gap: 12px; }
.rank-list > div { display: grid; grid-template-columns: 70px 1fr 25px; align-items: center; gap: 9px; font-size: 9px; }
.rank-bar { height: 8px; overflow: hidden; border-radius: 999px; background: #eeeaf5; }
.rank-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8061eb, #d384b5); }
.insight-card { grid-template-columns: 42px 1fr; }
.insight-card > span:first-child { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 14px; background: #fff; font-size: 20px; }
.insight-card strong { font-size: 11px; }
.insight-card p { margin: 4px 0 0; color: var(--ink-soft); font-size: 9px; line-height: 1.7; }
.insight-card--purple { color: #fff; border-color: transparent; background: linear-gradient(135deg, #352c5b, #6b52bd); }
.insight-card--purple p { color: rgba(255,255,255,.75); }

/* Challenges */
.challenge-hero { display: grid; grid-template-columns: 62px 1fr; gap: 15px; border-radius: 27px; padding: 21px; color: #fff; background: linear-gradient(135deg, #312950, #6651aa); }
.challenge-hero__moon { display: grid; width: 62px; height: 62px; place-items: center; border: 1px solid rgba(255,255,255,.16); border-radius: 21px; background: rgba(255,255,255,.09); font-size: 35px; }
.challenge-hero .section-kicker { color: #dbd2ff; }
.challenge-hero h2 { margin: 0 0 5px; font-size: 19px; }
.challenge-hero p { margin: 0; color: rgba(255,255,255,.72); font-size: 9px; line-height: 1.7; }
.challenge-progress { grid-column: 1 / -1; display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 9px; margin-top: 6px; }
.challenge-progress strong { font-size: 15px; }
.challenge-progress span { color: rgba(255,255,255,.7); font-size: 8px; }
.challenge-progress > div { height: 7px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.15); }
.challenge-progress i { display: block; height: 100%; border-radius: inherit; background: #fff; }
.streak-card { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 22px; background: #fff; }
.streak-card > div { display: grid; min-height: 94px; place-items: center; align-content: center; border-left: 1px solid var(--line); text-align: center; }
.streak-card > div:last-child { border-left: 0; }
.streak-card span { font-size: 20px; }
.streak-card strong { margin: 5px 0 2px; font-size: 13px; }
.streak-card small { color: var(--muted); font-size: 7px; }
.sleep-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sleep-actions form { min-width: 0; }
.sleep-action { display: grid; width: 100%; min-height: 132px; place-items: center; align-content: center; gap: 5px; border: 0; border-radius: 21px; color: #fff; cursor: pointer; transition: transform .18s ease, opacity .18s ease; }
.sleep-action:not(:disabled):active { transform: translateY(1px); }
.sleep-action:disabled { cursor: not-allowed; opacity: .42; }
.sleep-action > span { font-size: 31px; }
.sleep-action strong { font-size: 15px; }
.sleep-action small { color: rgba(255,255,255,.78); font-size: 8px; }
.sleep-action--night { background: linear-gradient(135deg, #30274f, #6651aa); box-shadow: 0 13px 28px rgba(49,41,80,.19); }
.sleep-action--morning { background: linear-gradient(135deg, #f0a832, #d47428); box-shadow: 0 13px 28px rgba(212,116,40,.2); }
.switch-list { display: grid; gap: 5px; }
.switch-row { display: grid; grid-template-columns: 1fr 46px; align-items: center; gap: 13px; min-height: 64px; border-bottom: 1px solid var(--line); cursor: pointer; }
.switch-row:last-of-type { border-bottom: 0; }
.switch-row strong, .switch-row span { display: block; }
.switch-row strong { font-size: 10px; }
.switch-row span { margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.5; }
.switch-row input[type="checkbox"] { position: absolute; opacity: 0; }
.switch-row i { position: relative; width: 43px; height: 25px; border-radius: 999px; background: #dcd8e4; transition: .2s; }
.switch-row i::after { content: ''; position: absolute; top: 3px; right: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 2px 7px rgba(0,0,0,.14); transition: .2s; }
.switch-row input:checked + i { background: var(--primary); }
.switch-row input:checked + i::after { transform: translateX(-18px); }
.challenge-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.challenge-days > div { display: grid; min-height: 78px; place-items: center; align-content: center; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.challenge-days span, .challenge-days small { color: var(--muted); font-size: 7px; }
.challenge-days strong { margin: 5px 0; font-size: 12px; }
.challenge-days .is-complete { color: #fff; border-color: var(--primary); background: var(--primary); }
.challenge-days .is-complete span, .challenge-days .is-complete small { color: rgba(255,255,255,.75); }
.challenge-days .is-today { border-color: var(--primary); color: var(--primary); }

/* Couple and messages */
.connection-card,
.invite-hero { display: grid; place-items: center; border: 1px solid var(--line); border-radius: 27px; padding: 24px; background: #fff; text-align: center; box-shadow: var(--shadow-soft); }
.connection-card__avatars { display: flex; align-items: center; margin-bottom: 14px; }
.connection-card__avatars span { display: grid; width: 57px; height: 57px; place-items: center; border: 4px solid #fff; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #a78ef3, #7153d8); font-size: 20px; font-weight: 900; }
.connection-card__avatars span:last-child { margin-right: -10px; background: linear-gradient(135deg, #4c7fc3, #273d6e); }
.connection-card__avatars i { z-index: 2; display: grid; width: 31px; height: 31px; margin-right: -9px; place-items: center; border-radius: 50%; color: var(--primary); background: #fff; box-shadow: var(--shadow-soft); font-style: normal; }
.connection-card h2, .invite-hero h2 { margin: 11px 0 6px; font-size: 20px; }
.connection-card p, .invite-hero p { max-width: 380px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.8; }
.invite-hero__icon { display: grid; width: 72px; height: 72px; place-items: center; border-radius: 25px; color: #fff; background: linear-gradient(135deg, #8f72ee, #6244cd); font-size: 37px; }
.invite-code { display: flex; width: 100%; max-width: 330px; align-items: center; justify-content: space-between; gap: 12px; margin: 15px 0 9px; border: 1px dashed #a18bef; border-radius: 16px; padding: 12px 14px; background: var(--primary-faint); }
.invite-code strong { direction: ltr; color: var(--primary-dark); font-size: 19px; letter-spacing: 3px; }
.invite-code button { border: 0; color: var(--primary); background: transparent; cursor: pointer; font-size: 9px; font-weight: 900; }
.invite-input { direction: ltr; text-align: center; text-transform: uppercase; letter-spacing: 4px; font-weight: 900; }

.chat-card { padding: 0; overflow: hidden; }
.chat-card__header { display: flex; align-items: center; gap: 11px; padding: 14px; border-bottom: 1px solid var(--line); }
.chat-card__header strong, .chat-card__header span { display: block; }
.chat-card__header strong { font-size: 11px; }
.chat-card__header span { margin-top: 3px; color: var(--success); font-size: 8px; }
.chat-card__header span i { display: inline-block; width: 6px; height: 6px; margin-left: 4px; border-radius: 50%; background: var(--success); }
.avatar-circle { display: inline-grid; width: 39px; height: 39px; flex: 0 0 auto; place-items: center; border-radius: 14px; color: #fff; background: linear-gradient(135deg, #9578ef, #6547d0); font-size: 12px; font-style: normal; font-weight: 900; }
.avatar-circle--large { width: 72px; height: 72px; border-radius: 23px; font-size: 24px; }
.chat-thread { display: flex; min-height: 260px; max-height: 520px; flex-direction: column; gap: 9px; overflow-y: auto; padding: 15px; background: #f8f7fb; }
.chat-bubble { align-self: flex-start; max-width: 82%; border-radius: 17px 17px 17px 4px; padding: 10px 12px; color: var(--ink); background: #fff; box-shadow: 0 5px 15px rgba(50,39,82,.06); }
.chat-bubble.is-mine { align-self: flex-end; border-radius: 17px 17px 4px 17px; color: #fff; background: linear-gradient(135deg, #8061eb, #6849d4); }
.chat-bubble strong { display: block; margin-bottom: 5px; font-size: 8px; }
.chat-bubble p { margin: 0; font-size: 10px; line-height: 1.7; white-space: pre-wrap; }
.chat-bubble small { display: block; margin-top: 5px; color: var(--muted); font-size: 7px; text-align: left; }
.chat-bubble.is-mine small { color: rgba(255,255,255,.68); }
.chat-composer { display: grid; grid-template-columns: 1fr 42px; gap: 8px; padding: 11px; border-top: 1px solid var(--line); background: #fff; }
.chat-composer textarea { min-height: 42px; max-height: 110px; border: 1px solid var(--line); border-radius: 14px; outline: 0; padding: 10px 12px; background: #fbfafd; resize: none; }
.chat-composer button { display: grid; width: 42px; height: 42px; place-items: center; border: 0; border-radius: 14px; color: #fff; background: var(--primary); cursor: pointer; }
.ticket-list { display: grid; gap: 8px; margin-top: 12px; }
.ticket-list > a { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 17px; padding: 13px; background: #fff; }
.ticket-list strong { font-size: 10px; }
.ticket-list p { max-width: 230px; margin: 4px 0 0; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.ticket-thread { padding: 0; overflow: hidden; }
.ticket-thread > header { display: flex; align-items: center; justify-content: space-between; padding: 14px; border-bottom: 1px solid var(--line); }
.ticket-thread h2 { margin: 6px 0 0; font-size: 13px; }
.ticket-thread header > a { color: var(--primary); font-size: 9px; }

/* Subscription and profile */
.subscription-status-card { display: grid; grid-template-columns: 55px 1fr; align-items: center; gap: 14px; border: 1px solid #d8cff6; border-radius: 24px; padding: 19px; background: linear-gradient(135deg, #faf8ff, #f0ebff); }
.subscription-status-card.is-active { border-color: #bde6d1; background: linear-gradient(135deg, #f7fffa, #eaf8f1); }
.subscription-status-card__icon { display: grid; width: 55px; height: 55px; place-items: center; border-radius: 18px; color: #fff; background: var(--primary); font-size: 28px; }
.subscription-status-card h2 { margin: 0 0 5px; font-size: 16px; }
.subscription-status-card p { margin: 0; color: var(--ink-soft); font-size: 9px; }
.plan-list { display: grid; gap: 12px; }
.plan-card { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; padding: 18px; background: #fff; box-shadow: var(--shadow-soft); }
.plan-card.is-featured { border: 2px solid var(--primary); }
.plan-badge { position: absolute; top: 0; left: 0; border-radius: 0 0 13px 0; padding: 7px 12px; color: #fff; background: var(--primary); font-size: 8px; font-weight: 900; }
.plan-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.plan-card h2 { margin: 0; font-size: 18px; }
.plan-card header p { margin: 4px 0 0; color: var(--muted); font-size: 8px; }
.plan-card header > strong { color: var(--primary-dark); font-size: 19px; }
.plan-card header > strong small { font-size: 8px; }
.plan-card ul { display: grid; gap: 9px; margin: 17px 0; padding: 0; list-style: none; }
.plan-card li { color: var(--ink-soft); font-size: 9px; }
.plan-card li span { margin-left: 7px; color: var(--success); font-weight: 900; }
.payment-history { display: grid; gap: 8px; }
.payment-history article { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 16px; padding: 12px; background: #fff; }
.payment-history strong { font-size: 10px; }
.payment-history p { margin: 4px 0 0; color: var(--muted); font-size: 7px; }
.payment-history article > div:last-child { display: grid; justify-items: end; gap: 5px; }
.payment-history small { color: var(--muted); font-size: 7px; }

.profile-hero { display: grid; place-items: center; border-radius: 27px; padding: 22px; background: #fff; box-shadow: var(--shadow-soft); text-align: center; }
.avatar-upload { display: grid; justify-items: center; gap: 8px; }
.avatar-upload label { position: relative; display: grid; width: 102px; height: 102px; place-items: center; overflow: visible; border-radius: 50%; cursor: pointer; }
.avatar-upload__frame { display: grid; width: 96px; height: 96px; place-items: center; overflow: hidden; border: 5px solid #fff; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #9b82f0, #6749d0); box-shadow: 0 12px 25px rgba(93,68,173,.18), 0 0 0 1px rgba(109,85,217,.12); font-size: 30px; font-weight: 900; }
.avatar-upload img { display: block; width: 100%; height: 100%; max-width: 100%; border-radius: inherit; object-fit: cover; object-position: center; }
.avatar-upload i { position: absolute; right: -2px; bottom: 1px; display: grid; width: 28px; height: 28px; place-items: center; border: 3px solid #fff; border-radius: 50%; background: var(--primary); font-size: 11px; font-style: normal; }
.avatar-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.avatar-upload.is-uploading label { opacity: .72; pointer-events: none; }
.avatar-upload__hint { display: block; max-width: 260px; margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.8; }
.profile-hero h2 { margin: 12px 0 4px; font-size: 19px; }
.profile-hero p { margin: 0 0 8px; color: var(--muted); font-size: 9px; }
.profile-links { display: grid; overflow: hidden; border: 1px solid var(--line); border-radius: 21px; background: #fff; }
.profile-links a { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 10px; min-height: 68px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.profile-links a:last-child { border-bottom: 0; }
.profile-links > a > span { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 13px; color: var(--primary); background: var(--primary-soft); font-size: 19px; }
.profile-links strong { font-size: 10px; }
.profile-links p { margin: 3px 0 0; color: var(--muted); font-size: 8px; }
.profile-links i { color: var(--muted); font-style: normal; font-size: 18px; }

/* Administration desktop shell */
.admin-body { background: #f4f3f8; }
.admin-shell { display: grid; grid-template-columns: 245px minmax(0, 1fr); min-height: 100vh; }
.admin-sidebar { position: sticky; top: 0; display: flex; height: 100vh; flex-direction: column; border-left: 1px solid var(--line); padding: 22px 16px; background: rgba(255,255,255,.94); backdrop-filter: blur(20px); }
.admin-brand { display: flex; align-items: center; gap: 11px; padding: 5px 8px 22px; }
.admin-brand__mark { display: grid; width: 45px; height: 45px; place-items: center; border-radius: 15px; color: #fff; background: linear-gradient(135deg, #8c70ee, #5f41cc); font-size: 24px; }
.admin-brand strong, .admin-brand small { display: block; }
.admin-brand strong { font-size: 17px; }
.admin-brand small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.admin-menu { display: grid; gap: 5px; }
.admin-menu a { display: flex; min-height: 48px; align-items: center; gap: 11px; border-radius: 14px; padding: 0 13px; color: var(--ink-soft); font-size: 10px; font-weight: 800; }
.admin-menu a span { display: grid; width: 27px; place-items: center; font-size: 17px; }
.admin-menu a.is-active { color: var(--primary-dark); background: var(--primary-soft); }
.admin-sidebar__footer { display: grid; gap: 12px; margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.admin-profile { display: flex; align-items: center; gap: 9px; min-width: 0; }
.admin-profile__avatar { display: grid; width: 39px; height: 39px; flex: 0 0 auto; place-items: center; border-radius: 13px; color: #fff; background: #352b5c; font-weight: 900; }
.admin-profile strong, .admin-profile small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-profile strong { font-size: 9px; }
.admin-profile small { max-width: 145px; margin-top: 3px; color: var(--muted); font-size: 7px; direction: ltr; }
.admin-main { min-width: 0; }
.admin-topbar { position: sticky; z-index: 25; top: 0; display: flex; min-height: 86px; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 25px; border-bottom: 1px solid var(--line); background: rgba(244,243,248,.9); backdrop-filter: blur(20px); }
.admin-topbar h1 { margin: 0; font-size: 23px; }
.admin-topbar p { margin: 5px 0 0; color: var(--muted); font-size: 9px; }
.admin-topbar__actions { display: flex; align-items: center; gap: 10px; }
.admin-content { display: grid; gap: 18px; padding: 24px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.metric-grid > article { display: flex; min-height: 112px; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: 22px; padding: 16px; background: #fff; box-shadow: var(--shadow-soft); }
.metric-grid article div { min-width: 0; }
.metric-grid small, .metric-grid strong, .metric-grid em { display: block; }
.metric-grid small { color: var(--muted); font-size: 8px; }
.metric-grid strong { margin: 6px 0 3px; font-size: 21px; }
.metric-grid em { color: var(--success); font-size: 7px; font-style: normal; }
.metric-grid--compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-grid--compact > article { min-height: 90px; }
.metric-icon--green { color: #248d5f; background: #e8f8f0; }
.metric-icon--orange { color: #b66c21; background: #fff1df; }
.admin-grid { display: grid; gap: 15px; }
.admin-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-grid--support { grid-template-columns: minmax(0, 1fr) 290px; }
.admin-card { min-width: 0; }
.line-chart--admin { min-height: 215px; }
.line-chart--admin svg { height: 215px; }
.line-chart--large { min-height: 270px; }
.line-chart--large svg { height: 270px; }
.bar-chart--admin { height: 215px !important; }
.mini-dashboard-card { display: grid; min-height: 120px; place-items: center; align-content: center; text-align: center; }
.mini-dashboard-card > span { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 14px; color: var(--primary); background: var(--primary-soft); font-size: 20px; }
.mini-dashboard-card strong { margin: 8px 0 2px; font-size: 20px; }
.mini-dashboard-card small { color: var(--muted); font-size: 8px; }
.admin-list { display: grid; margin-top: 12px; }
.admin-list > a,
.admin-list__static { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 10px; min-height: 63px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.admin-list > a:last-child, .admin-list__static:last-child { border-bottom: 0; }
.admin-list__static { grid-template-columns: 1fr auto; }
.admin-list strong, .admin-list small { display: block; }
.admin-list strong { font-size: 9px; }
.admin-list small { margin-top: 3px; color: var(--muted); font-size: 7px; }
.admin-list em { color: var(--muted); font-size: 7px; font-style: normal; }
.ticket-dot { display: block; width: 10px; height: 10px; border-radius: 50%; background: #8b84a0; }
.ticket-dot--high { background: var(--danger); }
.ticket-dot--normal { background: var(--warning); }
.admin-filter-bar { display: grid; grid-template-columns: minmax(220px, 1fr) 160px 160px auto; align-items: center; gap: 10px; }
.search-field { position: relative; }
.search-field > span { position: absolute; top: 50%; right: 13px; transform: translateY(-50%); color: var(--muted); }
.search-field input { padding-right: 37px; }
.admin-table-card { padding: 0; overflow: hidden; }
.admin-table__head,
.admin-table__row { display: grid; grid-template-columns: minmax(220px, 1.5fr) .65fr .65fr 1fr 45px; align-items: center; gap: 10px; min-height: 64px; padding: 9px 16px; }
.admin-table__head { min-height: 45px; color: var(--muted); background: #f8f7fb; font-size: 8px; font-weight: 900; }
.admin-table__row { border-top: 1px solid var(--line); }
.user-cell { display: flex; min-width: 0; align-items: center; gap: 10px; }
.user-cell strong, .user-cell small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-cell strong { font-size: 9px; }
.user-cell small { margin-top: 3px; color: var(--muted); font-size: 7px; direction: ltr; }
.pagination-wrap nav { display: flex; justify-content: center; }
.pagination-wrap svg { width: 16px; }
.admin-profile-card { display: flex; align-items: center; justify-content: space-between; gap: 15px; border: 1px solid var(--line); border-radius: 24px; padding: 20px; background: #fff; box-shadow: var(--shadow-soft); }
.admin-profile-card__identity { display: flex; align-items: center; gap: 14px; }
.admin-profile-card h2 { margin: 0 0 5px; }
.admin-profile-card p { margin: 0 0 8px; color: var(--muted); font-size: 9px; }
.back-link { width: max-content; color: var(--primary); font-size: 9px; font-weight: 900; }
.detail-list h2 { margin: 0 0 13px; font-size: 15px; }
.detail-list dl { display: grid; gap: 0; margin: 0; }
.detail-list dl > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; border-bottom: 1px solid var(--line); }
.detail-list dt { color: var(--muted); font-size: 8px; }
.detail-list dd { margin: 0; font-size: 9px; font-weight: 800; text-align: left; }
.report-tabs--admin { width: max-content; min-width: 340px; grid-auto-flow: column; grid-auto-columns: minmax(80px, 1fr); grid-template-columns: none; }
.support-list { display: grid; }
.support-list > a { display: grid; grid-template-columns: 11px minmax(0, 1fr) 130px; align-items: center; gap: 12px; min-height: 84px; padding: 12px 3px; border-bottom: 1px solid var(--line); }
.support-list > a:last-child { border-bottom: 0; }
.support-list__main { min-width: 0; }
.support-list__main strong, .support-list__main p, .support-list__main small { display: block; }
.support-list__main strong { font-size: 10px; }
.support-list__main p { margin: 5px 0; overflow: hidden; color: var(--ink-soft); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.support-list__main small { color: var(--muted); font-size: 7px; }
.support-list__meta { display: grid; justify-items: end; gap: 7px; }
.support-list__meta small { color: var(--muted); font-size: 7px; }
.ticket-conversation { padding: 0; overflow: hidden; }
.chat-thread--admin { min-height: 390px; max-height: 630px; }
.ticket-conversation > form { padding: 16px; }
.payment-admin-list { display: grid; }
.payment-admin-list > article { display: grid; grid-template-columns: minmax(220px, 1fr) 180px minmax(340px, 1.4fr); align-items: center; gap: 13px; min-height: 90px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.payment-admin-list > article:last-child { border-bottom: 0; }
.payment-admin-list__identity { display: flex; min-width: 0; align-items: center; gap: 10px; }
.payment-admin-list strong, .payment-admin-list small { display: block; }
.payment-admin-list strong { font-size: 9px; }
.payment-admin-list small { margin-top: 4px; color: var(--muted); font-size: 7px; }
.inline-update-form { display: grid; grid-template-columns: 130px 1fr auto; gap: 7px; }
.inline-update-form input, .inline-update-form select { min-height: 39px; padding: 7px 9px; font-size: 8px; }
.funnel-list { display: grid; gap: 15px; margin-top: 18px; }
.funnel-list > div { display: grid; grid-template-columns: 95px 1fr 90px; align-items: center; gap: 10px; font-size: 8px; }
.funnel-list > div > div { height: 9px; overflow: hidden; border-radius: 999px; background: #eeeaf5; }
.funnel-list i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #7f61e9, #bd91dc); }
.funnel-list strong { text-align: left; }
.funnel-list small { color: var(--muted); font-size: 7px; }
.donut-wrap { display: flex; align-items: center; justify-content: center; gap: 25px; margin-top: 18px; }
.donut { display: grid; width: 145px; height: 145px; flex: 0 0 auto; place-items: center; align-content: center; border-radius: 50%; background: radial-gradient(circle at center, #fff 52%, transparent 53%), conic-gradient(#7657e8 calc(var(--female)*1%), #ef9ec2 0); }
.donut strong { font-size: 24px; }
.donut span { color: var(--muted); font-size: 8px; }
.donut-legend { display: grid; gap: 12px; color: var(--ink-soft); font-size: 8px; }
.donut-legend span { display: flex; align-items: center; gap: 7px; }
.settings-panel { padding: 22px; }
.plan-admin-list { display: grid; gap: 12px; }
.plan-admin-list > form { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 16px; padding: 12px; background: #fbfafd; }
.plan-admin-list__head { display: flex; align-items: center; justify-content: space-between; }
.plan-admin-list__head strong { font-size: 10px; }
.plan-admin-list__head span { color: var(--primary); font-size: 8px; }
.plan-admin-list input, .plan-admin-list textarea { min-height: 36px; padding: 8px; font-size: 8px; }
.inline-switch { display: grid; grid-template-columns: 1fr 70px auto; align-items: center; gap: 8px; font-size: 8px; }
.inline-switch input[type="number"] { width: 70px; }
.inline-switch button { min-height: 35px; border: 0; border-radius: 10px; color: #fff; background: var(--primary); cursor: pointer; }
.announcement-list { display: grid; gap: 9px; }
.announcement-list article { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 15px; padding: 12px; }
.announcement-list strong { font-size: 9px; }
.announcement-list p { margin: 4px 0; color: var(--ink-soft); font-size: 8px; line-height: 1.6; }
.announcement-list small { color: var(--muted); font-size: 7px; }

/* Generic modal hook */
.modal-backdrop { position: fixed; z-index: 150; inset: 0; background: rgba(26,20,45,.45); backdrop-filter: blur(4px); }

@media (max-width: 980px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { display: none; }
    .admin-main { padding-bottom: calc(84px + var(--safe-bottom)); }
    .admin-topbar { padding-inline: 18px; }
    .admin-content { padding: 17px; }
    .bottom-nav--admin { display: grid; }
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-grid--support { grid-template-columns: 1fr; }
    .payment-admin-list > article { grid-template-columns: 1fr; }
    .inline-update-form { grid-template-columns: 1fr 1fr auto; }
}

@media (min-width: 981px) {
    .bottom-nav--admin { display: none; }
}

@media (max-width: 700px) {
    .page-content { padding: 14px; }
    .cycle-hero { grid-template-columns: 1fr 95px; padding: 19px; }
    .cycle-ring { width: 92px; height: 92px; }
    .cycle-ring > div { width: 70px; height: 70px; }
    .cycle-ring strong { font-size: 23px; }
    .field-grid--2 { grid-template-columns: 1fr; }
    .metric-grid,
    .metric-grid--compact,
    .admin-grid--2,
    .admin-grid--3 { grid-template-columns: 1fr; }
    .admin-topbar { align-items: flex-start; }
    .admin-topbar__actions { flex-direction: column; align-items: end; }
    .admin-filter-bar { grid-template-columns: 1fr 1fr; }
    .admin-filter-bar .search-field { grid-column: 1 / -1; }
    .admin-table__head { display: none; }
    .admin-table__row { grid-template-columns: 1fr auto; gap: 9px; padding: 13px; }
    .admin-table__row > span:nth-child(2), .admin-table__row > span:nth-child(3), .admin-table__row > span:nth-child(4) { display: inline-flex; grid-column: 1; }
    .admin-table__row > span:last-child { grid-column: 2; grid-row: 1; }
    .support-list > a { grid-template-columns: 10px 1fr; }
    .support-list__meta { grid-column: 2; grid-row: 2; display: flex; justify-items: start; justify-content: space-between; }
    .donut-wrap { flex-direction: column; }
    .funnel-list > div { grid-template-columns: 78px 1fr; }
    .funnel-list strong { grid-column: 2; }
}

@media (max-width: 430px) {
    .dashboard-grid { grid-template-columns: 1fr 1fr; }
    .feature-tile { min-height: 132px; padding: 14px; }
    .cycle-hero { min-height: 195px; }
    .cycle-hero__copy h2 { font-size: 20px; }
    .stats-banner { grid-template-columns: 1fr 1fr; }
    .stats-banner div:last-child { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.1); }
    .emoji-scale { gap: 4px; }
    .emoji-scale label > span { min-height: 46px; font-size: 20px; }
    .segmented-scale span { padding-inline: 2px; font-size: 7px; }
    .challenge-days { gap: 3px; }
    .challenge-days > div { min-height: 67px; border-radius: 12px; }
    .admin-filter-bar { grid-template-columns: 1fr; }
    .admin-filter-bar .search-field { grid-column: auto; }
    .inline-update-form { grid-template-columns: 1fr; }
}

/* Smart cycle tracking — v3.2 */
.calendar-day.is-period-estimated {
    color: #7b2b52;
    background: repeating-linear-gradient(135deg, #fbd1e2, #fbd1e2 5px, #efabc8 5px, #efabc8 10px);
    font-weight: 850;
}

.legend-dot--estimated {
    background: repeating-linear-gradient(135deg, #f7b9d3, #f7b9d3 3px, #ffe5f0 3px, #ffe5f0 6px);
}

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

.smart-period-card {
    overflow: hidden;
}

.smart-period-card__insight {
    display: grid;
    gap: 6px;
    padding: 14px;
    margin-bottom: 16px;
    border: 1px solid rgba(118, 87, 232, .12);
    border-radius: 16px;
    background: linear-gradient(135deg, #f7f4ff, #fff8fc);
}

.smart-period-card__insight span,
.smart-period-card__insight small {
    color: var(--muted);
    font-size: 10px;
}

.smart-period-card__insight strong {
    color: var(--primary);
    font-size: 16px;
}

.status-chip--today {
    color: #7657e8;
    background: #eee9ff;
}

.success-panel,
.notice-card {
    display: grid;
    gap: 10px;
    padding: 16px;
    border-radius: 18px;
}

.success-panel {
    border: 1px solid #ccebdc;
    background: #effaf5;
}

.notice-card--warning {
    border: 1px solid #f2dfb6;
    background: #fff9ed;
}

.success-panel p,
.notice-card p {
    margin: 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.9;
}

.prediction-list {
    display: grid;
    gap: 10px;
}

.prediction-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
}

.prediction-item__number {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 12px;
    color: var(--primary);
    background: var(--primary-soft);
    font-weight: 900;
}

.prediction-item strong,
.prediction-item p {
    display: block;
    margin: 0;
}

.prediction-item p,
.prediction-item small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 9px;
}

.question-block--highlight {
    padding: 14px;
    border: 1px solid rgba(216, 82, 132, .18);
    border-radius: 18px;
    background: #fff7fb;
}

.segmented-scale--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.form-hint {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 9px;
    line-height: 1.8;
}

@media (min-width: 760px) {
    .stats-banner--4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}


/* ===== Cycle foundation v3.3 ===== */
.calendar-day.has-detail {
    cursor: pointer;
}

.calendar-day.has-detail:hover,
.calendar-day.has-detail:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(75, 53, 151, .12);
}

.calendar-day.is-window {
    color: #5133ad;
    background: #e8e0ff;
    box-shadow: inset 0 0 0 1px #bbaaf0;
}

.calendar-day-detail {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(135deg, #fff, #faf8ff);
}

.calendar-day-detail[hidden] {
    display: none;
}

.calendar-day-detail span {
    color: var(--muted);
    font-size: 9px;
}

.calendar-day-detail strong {
    display: block;
    margin-top: 3px;
    font-size: 11px;
}

.calendar-day-detail p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 8px;
    line-height: 1.8;
}

.calendar-day-detail .button {
    min-height: 38px;
    white-space: nowrap;
}

.cycle-alert {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
}

.cycle-alert--warning {
    border-color: #f2d8a5;
    background: #fffaf0;
}

.cycle-alert--info {
    border-color: #d9d1fb;
    background: #faf8ff;
}

.cycle-alert strong {
    font-size: 10px;
}

.cycle-alert p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 8px;
    line-height: 1.8;
}

.prediction-window-card {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: 22px;
    background:
        radial-gradient(circle at 15% 0%, rgba(255,255,255,.52), transparent 38%),
        linear-gradient(135deg, #7657e8, #9e86f0);
    color: #fff;
    box-shadow: 0 18px 38px rgba(89, 66, 183, .22);
}

.prediction-window-card .section-kicker {
    color: rgba(255,255,255,.78);
}

.prediction-window-card strong {
    display: block;
    margin-top: 5px;
    font-size: 12px;
}

.prediction-window-card p {
    margin: 6px 0 0;
    color: rgba(255,255,255,.78);
    font-size: 8px;
}

.confidence-ring {
    display: grid;
    width: 56px;
    height: 56px;
    place-items: center;
    border: 5px solid rgba(255,255,255,.34);
    border-top-color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 900;
}

.history-editor {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    overflow: hidden;
}

.history-editor[open] {
    box-shadow: 0 14px 34px rgba(61, 46, 126, .10);
}

.history-editor > summary {
    list-style: none;
}

.history-editor > summary::-webkit-details-marker {
    display: none;
}

.history-editor .history-item {
    border: 0;
    border-radius: 0;
    cursor: pointer;
}

.history-editor__toggle {
    color: var(--primary);
    font-size: 8px;
    font-weight: 900;
}

.history-editor__body {
    display: grid;
    gap: 12px;
    padding: 0 13px 14px;
    border-top: 1px solid var(--line);
}

.history-editor__body .stack-form {
    padding-top: 13px;
}

.two-column-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.button--danger {
    border: 1px solid #f1c7d2;
    background: #fff5f7;
    color: #b5385d;
}

@media (max-width: 430px) {
    .calendar-day-detail {
        grid-template-columns: 1fr;
    }

    .calendar-day-detail .button {
        width: 100%;
    }

    .two-column-fields {
        grid-template-columns: 1fr;
    }
}
.recovery-code-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.65rem;margin:1rem 0}.recovery-code-list code{direction:ltr;text-align:center;padding:.75rem;border-radius:12px;background:#f2efff;color:#382b67;font-weight:800;letter-spacing:.06em}.break-all{display:block;direction:ltr;overflow-wrap:anywhere;padding:.75rem;margin-top:.5rem;background:#f7f5ff;border-radius:10px}

/* Component polish v3.9 (kept last to override legacy screen rules). */
.mobile-shell {
    border-inline: 1px solid rgba(231, 227, 238, .72);
    background: radial-gradient(circle at 100% 0, rgba(109, 85, 217, .07), transparent 24rem), rgba(250, 249, 252, .96);
    box-shadow: 0 0 70px rgba(49, 38, 86, .05);
}

.mobile-header {
    border-color: rgba(231, 227, 238, .82);
    background: rgba(250, 249, 252, .88);
    box-shadow: 0 8px 24px rgba(49, 38, 86, .035);
}

.mobile-header h1,
.admin-topbar h1 { font-weight: 850; letter-spacing: -.45px; }
.mobile-header__subtitle,
.admin-topbar p { font-size: 12px; }

.bottom-nav {
    min-height: 78px;
    border: 1px solid rgba(226, 222, 235, .92);
    border-bottom: 0;
    border-radius: 24px 24px 0 0;
    padding: 8px 12px var(--safe-bottom);
    background: rgba(255, 255, 255, .91);
    box-shadow: 0 -16px 44px rgba(49, 38, 86, .09);
}

.bottom-nav a { position: relative; gap: 5px; transition: color .2s ease, background .2s ease, transform .2s ease; }
.bottom-nav a:hover { color: var(--primary-dark); background: rgba(109, 85, 217, .045); }
.bottom-nav a.is-active { color: var(--primary-dark); background: linear-gradient(180deg, #f2efff, #faf9ff); box-shadow: inset 0 0 0 1px rgba(109, 85, 217, .08); }
.bottom-nav .ui-icon { width: 21px; height: 21px; }
.bottom-nav a.is-active .ui-icon { stroke-width: 2.25; transform: translateY(-1px); }
.bottom-nav a small { font-size: 10px; font-weight: 750; }

.form-card,
.calendar-card,
.chart-card,
.ticket-thread,
.chat-card,
.admin-card,
.quick-action-card,
.profile-hero,
.profile-links,
.metric-grid > article,
.admin-profile-card {
    border-color: rgba(226, 222, 235, .95);
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow-soft);
}

.quick-action-card:hover,
.feature-tile:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(49, 38, 86, .1); }
.feature-tile { border-color: rgba(94, 76, 142, .08); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72); }
.feature-tile--lilac { background: linear-gradient(145deg, #f2eeff, #e9e3ff); }
.feature-tile--mint { background: linear-gradient(145deg, #effaf5, #e3f5ed); }
.feature-tile--pink { background: linear-gradient(145deg, #fff3f8, #fce7f0); }
.feature-tile--peach { background: linear-gradient(145deg, #fff7ed, #ffecd8); }
.feature-tile__icon .ui-icon { width: 27px; height: 27px; stroke-width: 1.9; }
.quick-action-card__icon .ui-icon { width: 23px; height: 23px; }
.big-icon .ui-icon { width: 34px; height: 34px; }
.partner-hero__mark .ui-icon { width: 32px; height: 32px; }
.notice-card__icon .ui-icon { width: 21px; height: 21px; }

.button--primary,
.btn-primary { background: linear-gradient(135deg, #7d64e4, #5f46c4); box-shadow: 0 12px 26px rgba(93, 70, 196, .25); }
.button--primary:hover,
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 16px 32px rgba(93, 70, 196, .29); }

.field input,
.field select,
.field textarea,
.admin-filter-bar input,
.admin-filter-bar select,
.inline-update-form input,
.inline-update-form select,
.plan-admin-list input,
.plan-admin-list textarea { border-color: #dfdbe7; background: #fdfcff; }
.field input:hover,
.field select:hover,
.field textarea:hover { border-color: #c9c1dc; }
.field input:focus,
.field select:focus,
.field textarea:focus,
.admin-filter-bar input:focus,
.admin-filter-bar select:focus { border-color: #8f79e4; box-shadow: 0 0 0 4px rgba(109, 85, 217, .11); }

.admin-body { background: radial-gradient(circle at 85% 0, rgba(109, 85, 217, .08), transparent 28rem), #f5f4f8; }
.admin-sidebar { border-color: rgba(226, 222, 235, .9); background: rgba(255, 255, 255, .92); box-shadow: -12px 0 36px rgba(49, 38, 86, .04); }
.admin-brand__mark { background: linear-gradient(145deg, #8068e3, #543bb6); box-shadow: 0 10px 22px rgba(84, 59, 182, .24); }
.admin-brand__mark .ui-icon { width: 23px; height: 23px; }
.admin-menu .ui-icon { width: 20px; height: 20px; }
.admin-menu a.is-active { color: var(--primary-dark); background: linear-gradient(90deg, #ece8ff, #f7f5ff); box-shadow: inset -3px 0 0 var(--primary); }
.admin-topbar { border-color: rgba(226, 222, 235, .9); background: rgba(245, 244, 248, .86); }
.metric-icon .ui-icon,
.mini-dashboard-card .ui-icon { width: 22px; height: 22px; }
.profile-links > a > span .ui-icon { width: 21px; height: 21px; }
.profile-links i .ui-icon { width: 17px; height: 17px; }
.empty-state > span .ui-icon { width: 28px; height: 28px; }
.subscription-status-card__icon .ui-icon { width: 28px; height: 28px; }
.challenge-hero__moon .ui-icon { width: 44px; height: 44px; }
.sleep-action .ui-icon { width: 26px; height: 26px; }
.install-fab__icon { width: 19px; height: 19px; }

@media (hover: none) {
    .quick-action-card:hover,
    .feature-tile:hover,
    .button--primary:hover,
    .btn-primary:hover { transform: none; }
}

/* ===== Focused mobile structure v4.0 ===== */
.user-shell {
    width: min(100%, 720px);
    border-inline: 0;
    background: #f8f8f9;
    box-shadow: 0 0 64px rgba(35, 31, 47, .045);
}

.user-shell .mobile-header {
    min-height: 96px;
    padding: max(20px, env(safe-area-inset-top)) 22px 18px;
    border-bottom: 0;
    background: rgba(255, 255, 255, .92);
    box-shadow: none;
}

.mobile-header__copy { min-width: 0; }
.user-shell .mobile-header h1 { font-size: 22px; font-weight: 800; letter-spacing: -.35px; }
.user-shell .mobile-header__subtitle { margin-top: 3px; color: #8b8792; font-size: 12px; }
.user-shell .icon-button,
.user-shell .avatar-button { width: 43px; height: 43px; border-color: #ece9ef; border-radius: 50%; background: #fff; box-shadow: 0 5px 18px rgba(43, 37, 63, .055); }
.user-shell .avatar-button { color: #fff; background: #302c38; }

.user-shell .page-content {
    gap: 22px;
    padding: 24px 22px;
}

.user-shell .page-content--with-nav { padding-bottom: calc(112px + var(--safe-bottom)); }

.user-shell + .bottom-nav,
.user-shell .bottom-nav,
.bottom-nav:not(.bottom-nav--admin) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: min(100%, 720px);
    min-height: 82px;
    border: 0;
    border-top: 1px solid #ece9ef;
    border-radius: 0;
    padding: 9px 18px var(--safe-bottom);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 -8px 28px rgba(43, 37, 63, .045);
}

.bottom-nav:not(.bottom-nav--admin) a,
.bottom-nav:not(.bottom-nav--admin) a:hover,
.bottom-nav:not(.bottom-nav--admin) a.is-active {
    min-width: 0;
    border-radius: 12px;
    background: transparent;
    box-shadow: none;
}

.bottom-nav:not(.bottom-nav--admin) a { color: #99969e; }
.bottom-nav:not(.bottom-nav--admin) a.is-active { color: #315a9a; }
.bottom-nav:not(.bottom-nav--admin) a.is-active .ui-icon { transform: none; stroke-width: 2.35; }
.bottom-nav:not(.bottom-nav--admin) a small { font-size: 11px; font-weight: 600; }

.daily-home { --phase: #6d55d9; --phase-soft: #f0ecff; }
.daily-home.cycle-theme--menstrual { --phase: #d95d8e; --phase-soft: #fff0f5; background: linear-gradient(180deg, #fff7fa 0, #f8f8f9 500px); }
.daily-home.cycle-theme--follicular { --phase: #4b9bb8; --phase-soft: #edf8fc; background: linear-gradient(180deg, #f4fbfd 0, #f8f8f9 500px); }
.daily-home.cycle-theme--fertile { --phase: #2e9d82; --phase-soft: #ebf8f4; background: linear-gradient(180deg, #f3fbf8 0, #f8f8f9 500px); }
.daily-home.cycle-theme--luteal { --phase: #ca8c31; --phase-soft: #fff7e9; background: linear-gradient(180deg, #fffbf4 0, #f8f8f9 500px); }
.daily-home.cycle-theme--late { --phase: #706778; --phase-soft: #f1eff3; background: linear-gradient(180deg, #f7f5f8 0, #f8f8f9 500px); }

.daily-home__content { align-content: start; }
.notice-card--calm { border: 0; border-radius: 20px; background: #fff; box-shadow: 0 8px 28px rgba(43, 37, 63, .055); }

.daily-overview,
.daily-overview.cycle-hero--menstrual,
.daily-overview.cycle-hero--follicular,
.daily-overview.cycle-hero--fertile,
.daily-overview.cycle-hero--luteal,
.daily-overview.cycle-hero--late {
    display: grid;
    gap: 22px;
    overflow: hidden;
    border: 0;
    border-radius: 28px;
    padding: 24px;
    color: var(--ink);
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 12px 38px rgba(43, 37, 63, .065);
}

.daily-overview__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 15px; border-bottom: 1px solid #efedf1; }
.daily-overview__header .section-kicker { color: var(--phase); font-size: 11px; }
.daily-overview__header h2 { margin: 2px 0 0; font-size: 21px; font-weight: 800; }
.daily-overview__date { flex: 0 0 auto; color: #8b8792; font-size: 12px; }
.daily-overview__cycle { display: grid; grid-template-columns: 108px minmax(0, 1fr); align-items: center; gap: 22px; }
.cycle-ring--calm { display: grid; width: 106px; height: 106px; place-items: center; border-radius: 50%; background: conic-gradient(var(--phase) calc(var(--progress, 0) * 1%), #efedf2 0); }
.daily-overview .cycle-ring--calm > div { width: 92px; height: 92px; color: var(--ink); background: #fff; box-shadow: none; }
.daily-overview .cycle-ring--calm strong { color: var(--phase); font-size: 31px; }
.daily-overview .cycle-ring--calm span { color: #8b8792; font-size: 10px; }
.daily-overview__summary strong { display: block; font-size: 15px; line-height: 1.8; }
.daily-overview__summary p { margin: 6px 0 0; color: #77727f; font-size: 12px; line-height: 1.8; }

.daily-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.daily-metrics > div { display: grid; min-height: 94px; place-items: center; align-content: center; border-radius: 19px; background: #f7f7f8; text-align: center; }
.daily-metrics span { color: #77727f; font-size: 11px; }
.daily-metrics strong { margin-top: 7px; font-size: 20px; font-weight: 800; }
.daily-metrics small { margin-top: 1px; color: #aaa6ae; font-size: 9px; }
.daily-overview__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.daily-overview__actions .button { min-height: 52px; border-radius: 17px; font-size: 12px; }
.daily-overview__actions .button--primary { background: var(--phase); box-shadow: 0 10px 22px color-mix(in srgb, var(--phase) 24%, transparent); }
.daily-overview__actions form { display: grid; }
.button--quiet { border: 1px solid #e9e6ed; color: #514b5b; background: #faf9fb; }
.button .ui-icon { width: 19px; height: 19px; }

.daily-overview--partner { --phase: #6d55d9; }
.partner-summary { display: flex; align-items: center; gap: 15px; min-height: 112px; padding: 18px; border-radius: 22px; background: #f7f5ff; }
.partner-summary__icon { display: grid; width: 56px; height: 56px; flex: 0 0 auto; place-items: center; border-radius: 18px; color: #6d55d9; background: #ebe6ff; }
.partner-summary__icon .ui-icon { width: 27px; height: 27px; }
.partner-summary strong { font-size: 15px; }
.partner-summary p { margin: 5px 0 0; color: #77727f; font-size: 12px; line-height: 1.75; }

.today-list { overflow: hidden; border-radius: 28px; background: #fff; box-shadow: 0 12px 38px rgba(43, 37, 63, .055); }
.today-list__heading { padding: 22px 22px 12px; }
.today-list__heading h2 { margin: 2px 0 0; font-size: 19px; }
.today-list__item { display: grid; grid-template-columns: 50px minmax(0, 1fr) 20px; align-items: center; gap: 14px; min-height: 82px; padding: 13px 20px; border-top: 1px solid #f0eef2; }
.today-list__item:first-of-type { border-top: 0; }
.today-list__item:active { background: #faf9fb; }
.today-list__icon { display: grid; width: 50px; height: 50px; place-items: center; border-radius: 17px; }
.today-list__icon .ui-icon { width: 23px; height: 23px; }
.today-list__icon--mint { color: #208469; background: #e6f7f1; }
.today-list__icon--lilac { color: #644ac5; background: #eeeaff; }
.today-list__icon--pink { color: #be4f7b; background: #fdebf2; }
.today-list__icon--peach { color: #b97826; background: #fff1df; }
.today-list__item strong { display: block; font-size: 14px; }
.today-list__item p { margin: 4px 0 0; color: #8b8792; font-size: 11px; }
.today-list__arrow { width: 18px; height: 18px; color: #bbb7bf; }

.cycle-quick-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    border-radius: 26px;
    padding: 17px 12px;
    background: #fff;
    box-shadow: 0 12px 38px rgba(43, 37, 63, .055);
}
.cycle-quick-actions a { display: grid; min-width: 0; justify-items: center; gap: 5px; text-align: center; }
.cycle-quick-actions__icon { display: grid; width: 50px; height: 50px; place-items: center; border-radius: 17px; }
.cycle-quick-actions__icon .ui-icon { width: 24px; height: 24px; }
.cycle-quick-actions__icon--pink { color: #be4f7b; background: #fdebf2; }
.cycle-quick-actions__icon--peach { color: #b97826; background: #fff1df; }
.cycle-quick-actions__icon--mint { color: #208469; background: #e6f7f1; }
.cycle-quick-actions__icon--lilac { color: #644ac5; background: #eeeaff; }
.cycle-quick-actions strong { overflow: hidden; max-width: 100%; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.cycle-quick-actions small { color: #99959e; font-size: 8px; line-height: 1.45; }

.cycle-forecast-section,
.calendar-today-card,
.reminder-list-section {
    display: grid;
    gap: 16px;
    border-radius: 28px;
    padding: 22px;
    background: #fff;
    box-shadow: 0 12px 38px rgba(43, 37, 63, .055);
}
.cycle-forecast-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cycle-forecast-card { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: start; gap: 10px; min-height: 132px; border: 1px solid transparent; border-radius: 22px; padding: 15px; }
.cycle-forecast-card--period { border-color: #f6dbe5; background: #fff5f8; }
.cycle-forecast-card--fertile { border-color: #d7efeb; background: #f1faf8; }
.cycle-forecast-card__icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 14px; color: #fff; background: #d95d8e; }
.cycle-forecast-card--fertile .cycle-forecast-card__icon { background: #2e9d82; }
.cycle-forecast-card__icon .ui-icon { width: 21px; height: 21px; }
.cycle-forecast-card small { color: #817b87; font-size: 9px; }
.cycle-forecast-card strong { display: block; margin-top: 7px; font-size: 12px; line-height: 1.8; }
.cycle-forecast-card p { margin: 7px 0 0; color: #817b87; font-size: 9px; }
.cycle-forecast-section__hint { margin: 0; color: #99959e; font-size: 8px; line-height: 1.8; }

.calendar-page { background: #fff; }
.calendar-page .mobile-header { border-bottom: 1px solid #f0eef2; }
.calendar-page__content { background: #fff; }
.calendar-page__content > * { order: 4; }
.calendar-page__content > .calendar-board { order: 1; }
.calendar-page__content > .cycle-alert { order: 2; }
.calendar-page__content > .calendar-summary-strip { order: 3; }

.calendar-board {
    padding: 4px 0 22px;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
}

.calendar-board .calendar-toolbar { min-height: 58px; margin-bottom: 14px; padding-inline: 4px; }
.calendar-board .calendar-toolbar strong { font-size: 20px; font-weight: 800; }
.calendar-board .calendar-toolbar button { width: 44px; height: 44px; border-radius: 50%; color: #2d2933; background: transparent; font-size: 30px; font-weight: 300; }
.calendar-board .calendar-toolbar button:hover { background: #f6f5f7; }
.calendar-board .calendar-weekdays,
.calendar-board .calendar-grid { gap: 8px; }
.calendar-board .calendar-weekdays { margin-bottom: 12px; color: #99959e; font-size: 10px; font-weight: 500; }
.calendar-board .calendar-day { min-width: 0; min-height: 50px; aspect-ratio: 1; border-radius: 15px; color: #342f3c; background: #f7f7f8; font-size: 13px; font-weight: 650; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.calendar-board .calendar-day.is-muted { color: #b9b6bc; background: #fbfbfc; opacity: .62; }
.calendar-board .calendar-day.is-period { color: #762342; background: #fac7d8; }
.calendar-board .calendar-day.is-period-estimated { color: #762342; background: repeating-linear-gradient(135deg, #ffe4ed, #ffe4ed 6px, #f5bfd2 6px, #f5bfd2 12px); box-shadow: inset 0 0 0 1px #eaaac1; }
.calendar-board .calendar-day.is-next,
.calendar-board .calendar-day.is-window { color: #563889; background: #e5d4f7; box-shadow: none; }
.calendar-board .calendar-day.is-follicular { color: #256377; background: #d6eff3; }
.calendar-board .calendar-day.is-fertile { color: #17666a; background: #bfe7e8; }
.calendar-board .calendar-day.is-ovulation { color: #fff; background: #2aa2a7; box-shadow: none; }
.calendar-board .calendar-day.is-luteal { color: #6c5126; background: #f4e6bd; }
.calendar-board .calendar-day.is-today { outline: 2px dashed #39343e; outline-offset: 3px; box-shadow: none; }
.calendar-board .calendar-day.is-selected { box-shadow: 0 0 0 3px #fff, 0 0 0 5px #6556a7; transform: translateY(-1px); }
.calendar-board .calendar-day i { bottom: 5px; width: 3px; height: 3px; }
.calendar-board .calendar-day.has-daily-log i { width: 5px; height: 5px; background: currentColor; box-shadow: 0 0 0 2px rgba(255, 255, 255, .72); }
.calendar-board .calendar-legend--compact { justify-content: center; gap: 10px 14px; margin-top: 22px; padding-top: 18px; border-top: 1px solid #f0eef2; color: #5f5967; font-size: 10px; }
.calendar-board .legend-dot { width: 11px; height: 11px; }
.calendar-board .calendar-day-detail { margin-top: 18px; border: 0; border-radius: 20px; padding: 16px; background: #f7f6f9; }
.calendar-board .calendar-day-detail strong { font-size: 13px; }
.calendar-board .calendar-day-detail p { font-size: 10px; }

.calendar-summary-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; border: 1px solid #ece9ef; border-radius: 22px; background: #fff; }
.calendar-summary-strip > div { display: grid; min-height: 84px; place-items: center; align-content: center; padding: 10px 6px; border-left: 1px solid #ece9ef; text-align: center; }
.calendar-summary-strip > div:last-child { border-left: 0; }
.calendar-summary-strip span { color: #8b8792; font-size: 9px; }
.calendar-summary-strip strong { margin-top: 6px; font-size: 12px; }

.calendar-today-card { border: 1px solid #ece9ef; border-radius: 24px; box-shadow: none; }
.calendar-today-card__metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.calendar-today-card__metrics > span { display: grid; min-height: 58px; place-items: center; align-content: center; border-radius: 15px; color: #8b8792; background: #f7f7f8; font-size: 9px; }
.calendar-today-card__metrics strong { margin-top: 3px; color: #342f3c; font-size: 13px; }
.calendar-today-card__chips { display: flex; flex-wrap: wrap; gap: 7px; }
.calendar-today-card__chips span { border-radius: 999px; padding: 7px 10px; color: #604d88; background: #f1ecfb; font-size: 9px; }
.calendar-today-card__note { margin: 0; border-right: 3px solid #d95d8e; border-radius: 10px; padding: 10px 12px; color: #6c6671; background: #fff7fa; font-size: 10px; line-height: 1.9; }
.calendar-today-card__empty { display: flex; align-items: center; gap: 10px; color: #817b87; }
.calendar-today-card__empty .ui-icon { width: 28px; height: 28px; color: #d95d8e; }
.calendar-today-card__empty p { margin: 0; font-size: 10px; }
.calendar-today-card__reminder { display: grid; grid-template-columns: 38px minmax(0, 1fr) 18px; align-items: center; gap: 11px; border-top: 1px solid #efedf1; padding-top: 14px; }
.calendar-today-card__reminder > .ui-icon:first-child { width: 38px; height: 38px; border-radius: 13px; padding: 9px; color: #208469; background: #e6f7f1; }
.calendar-today-card__reminder > .ui-icon:last-child { width: 17px; height: 17px; color: #aaa6ae; }
.calendar-today-card__reminder strong { display: block; font-size: 11px; }
.calendar-today-card__reminder small { display: block; margin-top: 3px; color: #8b8792; font-size: 8px; line-height: 1.6; }

.current-period-forecast { display: grid; grid-template-columns: 46px minmax(0, 1fr); align-items: center; gap: 13px; border: 1px solid #f0c3d3; border-radius: 20px; padding: 15px; color: #6d2943; background: #fff4f8; }
.current-period-forecast__icon { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 15px; color: #fff; background: #d95d8e; }
.current-period-forecast__icon .ui-icon { width: 22px; height: 22px; }
.current-period-forecast strong { display: block; font-size: 11px; }
.current-period-forecast p { margin: 5px 0 0; color: #8a5e70; font-size: 9px; line-height: 1.8; }

.direct-cycle-start { display: grid; gap: 13px; }
.direct-cycle-start p { margin: 0; color: #77727f; font-size: 10px; line-height: 1.9; }

.persian-birth-date { margin: 0; border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.persian-birth-date legend { padding-inline: 7px; color: var(--ink); font-size: 10px; font-weight: 800; }
.persian-date-fields { display: grid; grid-template-columns: .8fr 1.25fr 1fr; gap: 8px; }
.persian-birth-date > small { display: block; margin-top: 8px; color: var(--muted); font-size: 8px; }

.cycle-reminders-page { background: #f8f8f9; }
.reminder-create-card { border: 0; border-radius: 28px; box-shadow: 0 12px 38px rgba(43, 37, 63, .055); }
.reminder-create-card__icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 15px; color: #be4f7b; background: #fdebf2; }
.reminder-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin: 0; border: 0; padding: 0; }
.reminder-days legend { margin-bottom: 9px; color: var(--ink); font-size: 10px; font-weight: 750; }
.reminder-days input { position: absolute; opacity: 0; }
.reminder-days span { display: grid; aspect-ratio: 1; place-items: center; border: 1px solid #e8e5eb; border-radius: 12px; color: #77727f; background: #faf9fb; font-size: 10px; cursor: pointer; }
.reminder-days input:checked + span { border-color: #6d55d9; color: #fff; background: #6d55d9; }
.cycle-reminder-list { display: grid; gap: 10px; }
.cycle-reminder { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 12px; border: 1px solid #ece9ef; border-radius: 19px; padding: 13px; transition: opacity .2s ease; }
.cycle-reminder.is-disabled { opacity: .52; }
.cycle-reminder__time { display: grid; min-height: 42px; place-items: center; border-radius: 13px; color: #644ac5; background: #eeeaff; font-size: 11px; font-weight: 800; }
.cycle-reminder strong { display: block; font-size: 11px; }
.cycle-reminder p { margin: 4px 0 0; color: #8b8792; font-size: 8px; line-height: 1.6; }
.cycle-reminder__actions { display: flex; align-items: center; gap: 5px; }
.reminder-toggle { position: relative; width: 38px; height: 22px; border: 0; border-radius: 999px; padding: 2px; background: #d7d4da; cursor: pointer; }
.reminder-toggle i { position: absolute; top: 3px; right: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(43, 37, 63, .18); transition: transform .18s ease; }
.reminder-toggle.is-on { background: #2e9d82; }
.reminder-toggle.is-on i { transform: translateX(-16px); }
.cycle-reminder .icon-button { width: 34px; height: 34px; border-radius: 11px; }
.cycle-reminder .icon-button .ui-icon { width: 16px; height: 16px; }
.reminder-disclaimer { text-align: center; }

.period-action-card { border: 1px solid #ece9ef; border-radius: 24px; box-shadow: none; }
.period-action-card .section-heading h2 { font-size: 18px; }

.organizer-panel { overflow: hidden; border: 1px solid #ece9ef; border-radius: 22px; background: #fff; }
.organizer-panel__summary { position: relative; display: flex; min-height: 78px; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 20px; padding-left: 48px; cursor: pointer; list-style: none; }
.organizer-panel__summary::-webkit-details-marker { display: none; }
.organizer-panel__summary::after { position: absolute; left: 20px; content: '‹'; color: #918c98; font-size: 24px; transition: transform .18s ease; }
.organizer-panel[open] .organizer-panel__summary::after { transform: rotate(-90deg); }
.organizer-panel__summary h2 { margin: 2px 0 0; font-size: 16px; }
.organizer-panel__count { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 10px; color: #6b6374; background: #f2f0f4; font-size: 11px; }
.organizer-panel__body { padding: 4px 18px 18px; border-top: 1px solid #f0eef2; }
.organizer-panel > .form-hint { padding: 0 18px 18px; }

@media (max-width: 520px) {
    .user-shell .page-content { padding-inline: 16px; }
    .daily-overview { padding: 20px; }
    .daily-overview__cycle { grid-template-columns: 92px minmax(0, 1fr); gap: 16px; }
    .cycle-ring--calm { width: 92px; height: 92px; }
    .daily-overview .cycle-ring--calm > div { width: 80px; height: 80px; }
    .daily-overview .cycle-ring--calm strong { font-size: 26px; }
    .daily-overview__summary strong { font-size: 13px; }
    .daily-overview__summary p { font-size: 10px; }
    .daily-metrics > div { min-height: 82px; }
    .daily-metrics strong { font-size: 18px; }
    .calendar-board .calendar-weekdays,
    .calendar-board .calendar-grid { gap: 6px; }
    .calendar-board .calendar-day { min-height: 44px; border-radius: 13px; }
    .calendar-summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .calendar-summary-strip > div:nth-child(2) { border-left: 0; }
    .calendar-summary-strip > div:nth-child(n+3) { border-top: 1px solid #ece9ef; }
    .cycle-forecast-card { grid-template-columns: 1fr; }
    .cycle-reminder { grid-template-columns: 48px minmax(0, 1fr); }
    .cycle-reminder__actions { grid-column: 1 / -1; justify-content: flex-end; border-top: 1px solid #f0eef2; padding-top: 9px; }
}

@media (max-width: 370px) {
    .daily-overview__actions { grid-template-columns: 1fr; }
    .calendar-board .calendar-weekdays { font-size: 8px; }
    .calendar-board .calendar-day { min-height: 40px; font-size: 12px; }
    .cycle-quick-actions { gap: 4px; padding-inline: 7px; }
    .cycle-quick-actions__icon { width: 43px; height: 43px; border-radius: 14px; }
    .cycle-quick-actions strong { font-size: 9px; }
}
