/* Extracted from styles.css; original cascade order is preserved by index.html. */
/* Cycle tracker rebuild */
.cycle-hero-empty{padding:28px 20px;border:1px solid #f1dbe2;border-radius:24px;background:linear-gradient(145deg,#fff,#fff4f7);text-align:center;box-shadow:0 18px 40px rgba(92,67,76,.08)}
.cycle-hero-empty span{display:block;font-size:42px}.cycle-hero-empty strong{display:block;margin-top:12px;font-size:18px;color:var(--ink)}.cycle-hero-empty p{margin:8px 0 18px;color:var(--muted);font-size:12px;line-height:1.7}.cycle-hero-empty .primary{width:100%;padding:13px}
.cycle-dashboard{display:grid;gap:12px;margin-bottom:16px}.cycle-status-pill{display:flex;align-items:center;gap:14px;padding:18px;border-radius:24px;border:1px solid rgba(255,255,255,.7);box-shadow:0 16px 38px rgba(92,67,76,.08)}
.cycle-status-pill>span{display:grid;place-items:center;width:56px;height:56px;border-radius:20px;background:rgba(255,255,255,.74);font-size:30px;box-shadow:inset 0 0 0 1px rgba(255,255,255,.8)}
.cycle-status-pill small,.cycle-metric-grid small{display:block;color:var(--muted);font-size:9px;font-weight:800;letter-spacing:1px;text-transform:uppercase}.cycle-status-pill strong{display:block;margin:3px 0;font-size:20px;color:var(--ink)}.cycle-status-pill p{margin:0;color:#7e6870;font-size:12px}
.cycle-status-pill.period{background:linear-gradient(135deg,#ffe6ee,#fff6f8)}.cycle-status-pill.follicular{background:linear-gradient(135deg,#e8f7f1,#fff9f4)}.cycle-status-pill.fertile{background:linear-gradient(135deg,#fff0d2,#fff8e9)}.cycle-status-pill.luteal,.cycle-status-pill.late{background:linear-gradient(135deg,#f1ebff,#fff6fa)}
.cycle-metric-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.cycle-metric-grid>div{min-width:0;padding:13px 10px;border:1px solid #f1dfe4;border-radius:18px;background:rgba(255,255,255,.86)}.cycle-metric-grid strong{display:block;margin:5px 0 3px;color:var(--ink);font-size:15px;white-space:nowrap}.cycle-metric-grid span{display:block;color:var(--muted);font-size:9px;line-height:1.35}
.cycle-section-title{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 10px}.cycle-section-title h4{margin:0}.cycle-section-title button{border:1px solid #f0d8df;border-radius:999px;background:#fff;color:#c65377;padding:8px 13px;font-size:11px;font-weight:800}
.cycle-calendar{padding:14px;border-radius:22px;background:#fff;border:1px solid #f1e2e5;box-shadow:0 12px 28px rgba(92,67,76,.05)}.cycle-cal-grid{gap:5px}.cycle-cal-cell{min-width:0;border-radius:13px;font-weight:700}.cycle-cal-cell span:first-child{position:relative;z-index:1}.cycle-cal-cell em{position:absolute;bottom:2px;font-style:normal;font-size:10px;line-height:1}.cycle-cal-cell.period{background:#ffdce7;color:#d94d74}.cycle-cal-cell.predicted{background:#fff1f5;color:#dd8ca5}.cycle-cal-cell.fertile{background:#fff3dc;color:#d2922f}.cycle-cal-cell.ovulation{background:#ffe6aa;color:#b57910;box-shadow:inset 0 0 0 1px #f3c75d}.cycle-cal-cell.today{box-shadow:inset 0 0 0 2px #3f3238}
.cycle-cal-legend{gap:10px}.cycle-cal-legend b{font-size:12px}.cycle-cal-legend b.period{color:#d94d74}.cycle-cal-legend b.predicted{color:#dd8ca5}.cycle-cal-legend b.fertile{color:#d2922f}.cycle-cal-legend b.ovulation{color:#b57910}.cycle-cal-legend i{display:none}
.cycle-analysis-card{padding:14px;border:1px solid #f1e2e5;border-radius:20px;background:#fffdfd}.cycle-analysis-card>p{margin:0 0 10px;color:#6d5860;font-size:12px;font-weight:800}.cycle-tip{border-radius:15px}.cycle-tip span{display:grid;place-items:center;width:22px;height:22px;border-radius:50%;font-size:11px;font-weight:900}.cycle-tip.warn span{background:#fff;color:#d26a73}.cycle-tip.info span{background:#fff;color:#6680b9}.cycle-tip.good span{background:#fff;color:#4d9a70}
.cycle-record-list{display:grid;gap:10px}.cycle-record-card{position:relative;display:flex;gap:12px;padding:14px;border:1px solid #f1dfe4;border-radius:20px;background:linear-gradient(145deg,#fff,#fff8fa);box-shadow:0 12px 26px rgba(92,67,76,.06)}.cycle-record-dot{width:10px;height:10px;border-radius:50%;margin-top:8px;background:#ef5f8a;box-shadow:0 0 0 5px #ffe6ee;flex:none}.cycle-record-main{min-width:0;flex:1}.cycle-record-top{display:flex;justify-content:space-between;gap:10px}.cycle-record-top small{display:block;color:#d5547b;font-size:11px;font-weight:900}.cycle-record-top strong{display:block;margin-top:4px;color:var(--ink);font-size:19px}.cycle-record-meta{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}.cycle-record-meta span,.cycle-record-tags span{display:inline-flex;align-items:center;min-height:24px;padding:0 9px;border-radius:999px;background:#fff;border:1px solid #f1dfe4;color:#806a72;font-size:10px}.cycle-record-tags{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}.cycle-record-tags span{background:#fff3f7;color:#c65377;font-weight:800}.cycle-record-card p{margin:10px 0 0;color:var(--muted);font-size:11px;line-height:1.6}.cycle-icon-btn{width:32px;height:32px;border-radius:12px}.cycle-icon-btn.edit{background:#fff5f8;color:#9b7a83}.cycle-icon-btn.del{background:#fff0f4;color:#d75f86}
@media (max-width:420px){.cycle-metric-grid{grid-template-columns:1fr}.cycle-status-pill{align-items:flex-start}.cycle-record-top{align-items:flex-start}.cycle-item-actions{gap:3px}}

/* Detailed cycle analysis */
.cycle-analysis-pro{display:grid;gap:12px}.cycle-analysis-head{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:15px;border-radius:18px;background:linear-gradient(135deg,#fff3f7,#fffaf2);border:1px solid #f2dfe4}.cycle-analysis-head small{display:block;color:#c65377;font-size:9px;font-weight:900;letter-spacing:1px}.cycle-analysis-head strong{display:block;margin:4px 0;color:var(--ink);font-size:17px}.cycle-analysis-head p{margin:0;color:var(--muted);font-size:11px;line-height:1.55}.cycle-analysis-head b{display:grid;place-items:center;width:56px;height:56px;border-radius:19px;background:#3f3238;color:#fff;font-size:20px;flex:none;box-shadow:0 12px 24px rgba(63,50,56,.16)}
.cycle-analysis-metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.cycle-analysis-metrics>div{padding:12px 10px;border:1px solid #f1e2e5;border-radius:16px;background:#fff}.cycle-analysis-metrics small{display:block;color:var(--muted);font-size:9px;font-weight:900}.cycle-analysis-metrics strong{display:block;margin:5px 0 3px;color:var(--ink);font-size:15px}.cycle-analysis-metrics span{display:block;color:#8b7880;font-size:9px;line-height:1.35}
.cycle-analysis-item{display:flex;gap:10px;padding:13px;border-radius:17px;border:1px solid #eee0e4;background:#fff}.cycle-analysis-item>span{display:grid;place-items:center;width:24px;height:24px;border-radius:50%;font-size:12px;font-weight:900;flex:none}.cycle-analysis-item strong{display:block;color:var(--ink);font-size:12px}.cycle-analysis-item p{margin:5px 0 0;color:#6f5b63;font-size:11px;line-height:1.65}.cycle-analysis-item.warn{background:#fff8f8;border-color:#f1d5d8}.cycle-analysis-item.warn>span{background:#ffe5e8;color:#d05b6d}.cycle-analysis-item.info{background:#f8fbff;border-color:#dfe8f4}.cycle-analysis-item.info>span{background:#e8f0ff;color:#5d75ad}.cycle-analysis-item.good{background:#f5fcf8;border-color:#dceee4}.cycle-analysis-item.good>span{background:#e2f5e9;color:#3f9565}.cycle-advice-box{padding:14px 15px;border-radius:18px;background:#3f3238;color:#fff}.cycle-advice-box strong{display:block;margin-bottom:8px;font-size:13px}.cycle-advice-box ul{margin:0;padding-left:18px}.cycle-advice-box li{margin:0 0 7px;color:rgba(255,255,255,.82);font-size:11px;line-height:1.65}.cycle-advice-box li:last-child{margin-bottom:0}
.cycle-analysis-score{display:flex;flex-direction:column;align-items:center;gap:7px;flex:none}.cycle-analysis-score b{flex:none}.cycle-analysis-chat-btn{display:flex;align-items:center;justify-content:center;gap:4px;width:56px;padding:6px 4px;border:0;border-radius:12px;background:linear-gradient(135deg,#667eea,#764ba2);color:#fff;font-size:9px;font-weight:900;box-shadow:0 7px 16px rgba(102,126,234,.25)}.cycle-analysis-chat-btn:active{transform:scale(.95)}.cycle-chat-sheet .ai-chat-avatar{background:linear-gradient(135deg,#dc668a,#7657b8)}.cycle-chat-safety{padding:7px 2px 6px;color:#a28f96;font-size:9px;line-height:1.4}.cycle-chat-update-note{align-self:flex-start;margin-top:5px;padding:4px 8px;border-radius:9px;background:#edf8f1;color:#438361;font-size:9px;font-weight:800}
@media (max-width:420px){.cycle-analysis-metrics{grid-template-columns:1fr}.cycle-analysis-head{align-items:flex-start}.cycle-analysis-head b{width:48px;height:48px;border-radius:16px;font-size:18px}.cycle-analysis-chat-btn{width:48px}}

/* Cycle history as an inner scroll window */
.cycle-history-window{position:relative;max-height:min(46vh,420px);overflow:auto;padding:10px;border:1px solid #f1dfe4;border-radius:24px;background:linear-gradient(180deg,#fffdfd,#fff7fa);box-shadow:inset 0 0 0 1px rgba(255,255,255,.75),0 14px 30px rgba(92,67,76,.05);scrollbar-width:thin;scrollbar-color:#ef9db2 #fff3f6}.cycle-history-window::-webkit-scrollbar{width:5px}.cycle-history-window::-webkit-scrollbar-track{background:#fff3f6;border-radius:999px}.cycle-history-window::-webkit-scrollbar-thumb{background:#ef9db2;border-radius:999px}.cycle-history-window .cycle-record-list{gap:9px}.cycle-history-hint{margin:8px 2px 0;color:#b39da5;font-size:10px;text-align:center}.cycle-history-window:before,.cycle-history-window:after{content:"";position:sticky;left:0;right:0;display:block;height:10px;pointer-events:none;z-index:1}.cycle-history-window:before{top:-10px;margin:-10px 0 0;background:linear-gradient(180deg,#fffdfd,rgba(255,253,253,0))}.cycle-history-window:after{bottom:-10px;margin:0 0 -10px;background:linear-gradient(0deg,#fff7fa,rgba(255,247,250,0))}
@media (max-width:420px){.cycle-history-window{max-height:38vh;padding:8px;border-radius:20px}}

/* Cycle phase guide moved into top action */
.cycle-status-text{min-width:0;flex:1}.cycle-phase-help-btn{margin-left:auto;align-self:center;min-width:82px;height:42px;border:1px solid rgba(214,88,119,.18);border-radius:999px;background:rgba(255,255,255,.72);color:#c65377;font-size:11px;font-weight:900;box-shadow:0 8px 20px rgba(198,83,119,.08)}.cycle-phase-help-btn:active{transform:scale(.98);background:#fff}.cycle-phase-sheet-body{max-height:82vh;overflow:auto;padding:12px 20px calc(28px + env(safe-area-inset-bottom));scrollbar-width:none;background:linear-gradient(180deg,#fffafa 0%,#fff5f8 100%)}.cycle-phase-sheet-body .cycle-section{margin-top:0}.cycle-phase-sheet-body .cycle-section-title{display:none}.cycle-phase-sheet-body .cycle-phase-guide{margin-top:8px}
@media (max-width:420px){.cycle-status-pill{gap:10px}.cycle-phase-help-btn{min-width:68px;height:36px;padding:0 10px;font-size:10px}.cycle-status-text strong{font-size:18px}}

/* Cycle history moved to top action sheet */
.cycle-top-actions{display:flex;gap:8px;margin-left:auto;align-items:center}.cycle-history-open-btn,.cycle-analysis-open-btn,.cycle-phase-help-btn{min-width:76px;height:42px;border:1px solid rgba(214,88,119,.18);border-radius:999px;background:rgba(255,255,255,.72);color:#c65377;font-size:11px;font-weight:900;box-shadow:0 8px 20px rgba(198,83,119,.08);white-space:nowrap}.cycle-analysis-open-btn{background:#3f3238;border-color:#3f3238;color:#fff}.cycle-history-open-btn:active,.cycle-analysis-open-btn:active,.cycle-phase-help-btn:active{transform:scale(.98)}.cycle-history-sheet-body,.cycle-analysis-sheet-body{max-height:86vh;overflow:auto;padding:12px 20px calc(28px + env(safe-area-inset-bottom));background:linear-gradient(180deg,#fffafa 0%,#fff5f8 100%);scrollbar-width:none}.cycle-history-sheet-body>.primary{margin:4px 0 12px;padding:13px}.cycle-history-window-sheet{max-height:min(58vh,520px)}
@media (max-width:520px){.cycle-status-pill{align-items:flex-start}.cycle-top-actions{flex-direction:column;gap:6px}.cycle-history-open-btn,.cycle-analysis-open-btn,.cycle-phase-help-btn{min-width:66px;height:34px;padding:0 9px;font-size:10px}.cycle-history-window-sheet{max-height:52vh}}
.cycle-top-actions .cycle-phase-help-btn{margin-left:0}

/* Clear color meaning for cycle calendar */
.cycle-cal-legend-rich{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:12px}.cycle-cal-legend-rich span{min-width:0;display:flex;align-items:center;gap:6px;padding:8px 9px;border:1px solid #f1e2e5;border-radius:13px;background:#fff;font-size:10px}.cycle-cal-legend-rich i{display:inline-block!important;width:14px;height:14px;border-radius:5px;flex:none}.cycle-cal-legend-rich i.period{background:#ffdce7;border:1px solid #f2b5c8}.cycle-cal-legend-rich i.predicted{background:#fff1f5;border:1px solid #efcdda}.cycle-cal-legend-rich i.fertile{background:#fff3dc;border:1px solid #efd29d}.cycle-cal-legend-rich i.ovulation{background:#ffe6aa;border:1px solid #e8bd4c}.cycle-cal-legend-rich b{flex:none;font-size:12px}.cycle-cal-legend-rich em{min-width:0;color:#725e66;font-style:normal;white-space:normal;line-height:1.25}
@media (max-width:420px){.cycle-cal-legend-rich{grid-template-columns:1fr}.cycle-cal-legend-rich span{padding:8px}}

/* Cycle AI refresh */
.cycle-refresh-btn{display:grid;place-items:center;width:34px;height:34px;border:1px solid #f0d8df;border-radius:50%;background:#fff;color:#c65377;font-size:16px;font-weight:900;line-height:1;box-shadow:0 8px 18px rgba(198,83,119,.08)}.cycle-refresh-btn:active{transform:scale(.96);background:#fff5f8}.cycle-refresh-btn.loading{animation:cycleSpin 1s linear infinite;color:#9f8b92}@keyframes cycleSpin{to{transform:rotate(360deg)}}.cycle-analysis-loading{display:flex;flex-direction:column;align-items:center;gap:8px;padding:32px 16px;text-align:center}.cycle-analysis-loading p{margin:0;color:var(--ink);font-size:13px;font-weight:600}.cycle-analysis-loading small{color:var(--muted);font-size:10px}.cycle-analysis-spinner{width:28px;height:28px;border:2.5px solid #f0dae2;border-top-color:#c65377;border-radius:50%;animation:cycleSpin .8s linear infinite}.cycle-analysis-error{display:flex;flex-direction:column;align-items:center;gap:8px;padding:24px 16px;text-align:center}.cycle-analysis-error span{font-size:20px}.cycle-analysis-error p{margin:0;color:#c65377;font-size:12px;line-height:1.6}.cycle-retry-btn{margin-top:6px;padding:8px 22px;border:1px solid #f0d8df;border-radius:20px;background:#fff;color:#c65377;font-size:12px;font-weight:600;cursor:pointer;box-shadow:0 4px 12px rgba(198,83,119,.06)}.cycle-retry-btn:active{transform:scale(.96);background:#fff5f8}.cycle-analysis-ts{color:var(--muted);font-size:10px;font-weight:400;white-space:nowrap}
