/* МОЙ РИТМ 5.2. Mobile-first design, iPhone 16 Pro / 18 Pro. */
:root {
  --bg: #f5f6fb;
  --surface: #ffffff;
  --dark: #28334a;
  --muted: #7c8193;
  --purple: #842b4e;
  --deep: #702b48;
  --lavender: #faeaf0;
  --line: #e7eaf2;
  --rose: #f6d9e3;
  --mint: #e1f3ed;
  --mint-dark: #24765b;
  --orange: #f1b98f;
  --sky: #9bcbea;
  --sky-soft: #e6f3ff;
  --sky-deep: #397eb7;
  --burgundy: #702b48;
  --burgundy-bright: #a84b72;
  --shadow: 0 7px 27px rgba(47, 56, 96, .06);
}
html {width:100%; min-width:320px; -webkit-text-size-adjust:100%;}
body {margin:0; min-width:320px; width:100%; overflow-x:clip;
  background:radial-gradient(ellipse at 16% 0%,#e7f3fd 0,transparent 35%),
             radial-gradient(ellipse at 90% 17%,#fae4ed 0,transparent 34%),var(--bg);
  color:var(--dark); font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Arial,sans-serif;
  -webkit-tap-highlight-color:transparent;
}
button,input,select,textarea{font-family:inherit;}
button{touch-action:manipulation;cursor:pointer;}
button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{
  outline:2px solid var(--sky-deep);outline-offset:2px;
}
/* PWA layout: one compact column on every screen, never a desktop dashboard. */
.app-shell{display:block!important;min-height:100vh;min-height:100dvh;}
.sidebar{display:none!important;}
.app-content{width:100%;max-width:520px;min-width:0;margin:0 auto;
  background:linear-gradient(165deg,#fafbff 0,#f5f6fb 36%,#f7f6fb 100%);
  min-height:100vh;min-height:100dvh;
  box-shadow:0 0 85px rgba(55,44,81,.075);
}
.topbar{height:calc(58px + env(safe-area-inset-top));
  padding:env(safe-area-inset-top) max(18px,env(safe-area-inset-right)) 0 max(18px,env(safe-area-inset-left));
  position:sticky;top:0;z-index:45;justify-content:space-between;
  background:rgba(255,255,255,.86);border-bottom:1px solid rgba(227,230,240,.75);
  -webkit-backdrop-filter:blur(22px);backdrop-filter:blur(22px);
}
.mobile-brand{display:flex;align-items:center;gap:8px;}
.mobile-brand .brand-icon{width:30px;height:30px;border-radius:10px;font-size:21px;
  background:linear-gradient(135deg,#722b49,#b6577d);box-shadow:0 3px 12px rgba(112,43,72,.18);
}
.mobile-brand b{font-size:19px;color:var(--burgundy);letter-spacing:-.7px;}
.topbar-right{gap:10px;}
.private-mark{display:none;}
.icon-button,.capsule-top-link{width:38px;height:38px;background:#fff;border:1px solid #e7e7ef;
  display:grid;place-items:center;border-radius:12px;color:var(--burgundy);
}
.capsule-top-link{font-size:18px;background:var(--sky-soft);border-color:#cbe5f7;}
.main-content{width:100%;max-width:none;min-height:calc(100dvh - 58px);
  padding:24px 17px calc(106px + env(safe-area-inset-bottom))!important;
}
.section-header{display:flex;flex-direction:column;align-items:flex-start;gap:13px;margin-bottom:19px;}
.section-header h1{color:#3a273b;font-size:clamp(26px,7vw,31px);margin:4px 0 7px;letter-spacing:-1.1px;}
.section-header p{color:#848598;font-size:12px;line-height:1.53;}
.eyebrow{color:var(--burgundy-bright);letter-spacing:2.1px;font-weight:850;}
.date-controls{align-self:stretch;justify-content:space-between;padding:5px;width:100%;border-color:#e9e9f2;
  box-shadow:0 4px 12px #51628606;}
.date-controls button{min-width:44px;min-height:44px;background:#f2f5fa;color:var(--burgundy);}
.date-controls .date-button{min-width:0;min-height:44px;flex:1;font-size:12px;}
/* The burgundy/sky welcome panel is the visual focus. */
.welcome-panel{background:linear-gradient(113deg,#712a49 0%,#884365 62%,#5e80ad 140%);
  border:1px solid #c882a14d;border-radius:22px;min-height:134px;padding:20px;
  box-shadow:0 15px 33px rgba(114,43,73,.16);isolation:isolate;
}
.welcome-panel:before{content:'';position:absolute;width:166px;height:166px;right:-46px;top:-63px;
  border-radius:50%;background:radial-gradient(circle,#b7dbf46e 0,transparent 73%);pointer-events:none;}
.welcome-panel:after{content:'✦';right:3%;top:-10px;font-size:120px;color:#ffffff12;}
.welcome-panel h2{font-size:19px;max-width:245px;color:#fff;}
.welcome-panel p{color:#fce7f1;max-width:260px;}
.welcome-panel .tiny{color:#cee7f8;font-size:10px;}
.ring{width:80px;height:80px;
  background:conic-gradient(#9dcfec var(--progress,0%),#ffffff38 0);border:1px solid #d8eefa55;
  box-shadow:0 0 24px rgba(156,207,239,.17);
}
.ring:before{background:#762f50;inset:8px;}
.ring strong{font-size:23px;}
.subheading-row h2{color:#40334a;}
.habit-grid,.books-grid{grid-template-columns:1fr;gap:12px;}
.habit-card,.panel,.note-panel,.stat-tile{background:#fff;border-color:#e9eaf2;
  box-shadow:0 8px 26px rgba(73,67,107,.047);
}
.habit-card{border-radius:19px;padding:16px 17px;}
.habit-card.done{border-color:#bbded6;background:#fcfffd;}
.habit-card[data-habit] .habit-emoji{background:#faeaf0;}
.habit-card[data-habit='reading'] .habit-emoji,
.habit-card[data-habit='video'] .habit-emoji,
.habit-card[data-habit='thesis'] .habit-emoji{background:#e8f4fc;}
.habit-card[data-habit='food'] .habit-emoji,
.habit-card[data-habit='skincare'] .habit-emoji{background:#f7edf2;}
.habit-card h3,.panel-header h2{color:#352c3e;}
.habit-card .status-pill{background:#f8ecf1;color:#9e5172;}
.habit-card.done .status-pill{background:#dff3e8;color:#327b60;}
.primary-button{background:linear-gradient(135deg,#712b49,#9b426b);color:#fff;
  box-shadow:0 5px 17px #772b492e;border:1px solid #702b4814;}
.primary-button:hover{background:linear-gradient(135deg,#63233f,#8e395c);}
.quick-button{background:#e8f3fd;color:#3a7cb4;}
.quick-button:hover{background:#d5eafd;}
.ghost-button{color:#772e4e;border-color:#e8dce4;}
.ghost-button:hover{background:#fcf4f7;}
.value-input,.small-select,.small-text,.note-panel textarea,.task-form input,
.knowledge-form input,.knowledge-form textarea,.thesis-progress input,
.capsule-form textarea,.login-card input{background:#fbfcff;border-color:#e4e8f0;color:#3b3850;}
.switch:checked{background:#77b8df;}
.food-choice.active{background:#792e50;border-color:#792e50;}
.stat-summary{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
.stat-tile{border-radius:17px;padding:15px;}
.stat-tile h3{color:var(--burgundy);}
.progress-fill{background:linear-gradient(90deg,#ae5778,#8fc6ea);}
.week-bar{background:linear-gradient(180deg,#a3d6f7,#8a3359);}
.week-bar-column{background-image:repeating-linear-gradient(to top,#f5edf2 0 1px,transparent 1px 38px);}
.pill-group{width:100%;justify-content:space-between;}
.pill-group button{min-height:40px;flex:1;padding:9px 7px;}
.pill-group button.active{background:#772e50;color:white;}
.task-row.task-work{background:#f1f8ff;border-left-color:#78b5df;}
.task-row.task-personal{background:#fff5f8;border-left-color:#a84b72;}
.work-label{color:#357eb1;}.personal-label{color:#9a4063;}
.agenda-task{background:#eaf5ff;border-left-color:#78b5df;}
.agenda-task.task-personal{background:#fdf0f5;border-left-color:#a84b72;}
.task-pill.work-dot{background:#dff0fd;color:#377fae;}
.task-pill.personal-dot{background:#fbe1ec;color:#963e63;}
.calendar-view-switch button.active{background:#772e50;color:white;}
.week-day-card.selected{background:#f9ecf2;border-color:#9c4569;}
.day-cell.frozen-day,.week-day-card.frozen-day{background:#eaf6ff;border-color:#afd7ef;}
.freeze-section{background:linear-gradient(110deg,#eef8ff,#fdf2f6);border-color:#d3e4f1;}
.freeze-section b{color:#387ba8;}
.capsule-banner{background:linear-gradient(113deg,#73314f,#7d6291 100%);}
.capsule-summary span{background:#f2f7fc;color:#62728b;}
.capsule-summary b{color:#842f53;}
.login-page{min-height:100vh;min-height:100dvh;background:linear-gradient(160deg,#eef7ff,#fff5f9 70%,#f4f3fb);
  padding:calc(20px + env(safe-area-inset-top)) 18px calc(20px + env(safe-area-inset-bottom));}
.login-card{width:100%;max-width:440px;border-radius:27px;box-shadow:0 25px 65px #712b4920;}
.login-card h1{color:var(--burgundy);}
.login-symbol{color:var(--burgundy);}
.login-card input{min-height:48px;}
.startup{background:#f7f7fc;color:var(--burgundy);}
/* Five navigation items comfortably fit the 402pt iPhone 16 Pro / iPhone 18 Pro. */
.bottom-nav{display:flex!important;position:fixed;bottom:0;left:50%;right:auto;
  transform:translateX(-50%);width:100%;max-width:520px;z-index:80;
  height:calc(72px + env(safe-area-inset-bottom));
  padding:6px max(9px,env(safe-area-inset-right)) env(safe-area-inset-bottom) max(9px,env(safe-area-inset-left));
  justify-content:space-around;gap:4px;
  background:rgba(255,255,255,.95);border:1px solid #e8e7f0;border-bottom:0;
  border-radius:22px 22px 0 0;
  box-shadow:0 -8px 28px rgba(85,62,102,.09);
  -webkit-backdrop-filter:blur(24px);backdrop-filter:blur(24px);
  transition:transform .24s ease;
}
.bottom-link{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:2px;
  min-width:0;min-height:52px;flex:1;border:0;border-radius:14px;color:#8992a7;
  transition:background-color .2s,color .2s,transform .17s;
}
.bottom-link span{font-size:23px;line-height:1.08;}
.bottom-link small{display:block;white-space:nowrap;font-size:10.5px;line-height:1.2;margin-top:2px;
  letter-spacing:-.1px;font-weight:750;}
.bottom-link.active{background:linear-gradient(180deg,#fbeaf0,#f8f3fa);color:#782d4c;}
.bottom-link.active:after{content:'';width:13px;height:2px;background:#9ecbed;border-radius:5px;position:absolute;
  margin-top:47px;}
.bottom-link:active{transform:scale(.94);}
body.keyboard-open .bottom-nav{transform:translate(-50%,calc(100% + 10px));pointer-events:none;}
/* iOS Safari zooms forms with font sizes smaller than 16px. */
@media (pointer:coarse){
 input:not([type=checkbox]):not([type=radio]),textarea,select{font-size:16px!important;}
 .date-controls button{min-height:44px;}
 .bottom-link{min-height:52px;}
}
/* Soft slide-up 'More' drawer with usable 44px actions. */
.more-menu[hidden]{display:none!important;}
.more-menu{position:fixed;inset:0;z-index:115;display:flex;align-items:flex-end;justify-content:center;isolation:isolate;}
.more-backdrop{position:absolute;inset:0;width:100%;height:100%;background:rgba(30,23,45,.29);
  border:0;opacity:0;transition:opacity .24s ease;
  -webkit-backdrop-filter:blur(0);backdrop-filter:blur(0);}
.more-sheet{position:relative;width:100%;max-width:520px;max-height:calc(92dvh - env(safe-area-inset-top));
  overflow-y:auto;overscroll-behavior:contain;
  background:linear-gradient(172deg,#ffffff,#f8f7fb);
  border:1px solid #e8e6ee;border-bottom:0;border-radius:27px 27px 0 0;
  padding:14px 18px calc(22px + env(safe-area-inset-bottom));
  box-shadow:0 -10px 45px rgba(53,34,65,.18);
  transform:translateY(105%);opacity:.75;
  transition:transform .27s cubic-bezier(.23,.83,.3,1),opacity .27s;
  outline:none;
}
.more-menu.open .more-backdrop{opacity:1;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);}
.more-menu.open .more-sheet{transform:translateY(0);opacity:1;}
.sheet-grabber{width:44px;height:5px;border-radius:5px;background:#d9d9e3;margin:0 auto 19px;}
.more-sheet-title{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:17px;}
.more-sheet-title h2{margin:6px 0 0;font-size:20px;letter-spacing:-.65px;color:#5e2b48;}
.more-sheet-title .icon-button{width:39px;height:39px;font-size:26px;color:#7d4b67;}
.more-items{display:grid;gap:9px;}
.more-item{display:flex;align-items:center;gap:13px;text-align:left;width:100%;min-height:65px;
  background:white;border:1px solid #e9e9f2;border-radius:17px;padding:11px 13px;
  color:#394052;box-shadow:0 4px 15px rgba(66,63,95,.035);
}
.more-item:active{transform:scale(.987);}
.more-item>span:nth-child(2){display:grid;gap:4px;flex:1;min-width:0;}
.more-item b{font-size:13px;font-weight:800;}
.more-item small{font-size:11px;color:#9293a1;font-weight:500;}
.more-ico{display:grid;place-items:center;min-width:42px;width:42px;height:42px;border-radius:13px;font-size:21px;}
.more-ico.sky{background:#e8f5fd;}.more-ico.rose{background:#fae7ee;}
.more-arrow{color:#91b5d5;font-size:28px;font-weight:400;line-height:1;}
.more-sheet-footer{text-align:center;font-size:11px;color:#a69aa4;padding:18px 0 0;}
body.sheet-open{overflow:hidden;}
/* Gentle, functional animations. Static during repeated data entry; animated on navigation. */
@keyframes ritmViewEnter{from{opacity:.55;transform:translate3d(0,9px,0)}to{opacity:1;transform:translate3d(0,0,0)}}
#screen.ritm-enter{animation:ritmViewEnter .22s cubic-bezier(.2,.7,.2,1) both;}
.habit-card,.stat-tile,.film-item,.book-card{transition:background-color .24s,border-color .24s,box-shadow .25s,transform .17s;}
.habit-card:active{transform:scale(.994);}
.habit-card.done{box-shadow:0 5px 22px rgba(52,136,105,.075);}
.primary-button,.ghost-button,.quick-button{transition:background-color .2s,box-shadow .2s,transform .17s;}
.primary-button:active,.ghost-button:active,.quick-button:active{transform:scale(.973);}
.week-bar,.ig-bar,.progress-fill,.ring{transition:height .45s ease,width .45s ease,background-color .3s ease;}
.switch,.switch:before{transition:background-color .24s,transform .24s cubic-bezier(.25,.7,.2,1);}
@media(prefers-reduced-motion:reduce){
 #screen.ritm-enter{animation:none!important;}
 .more-sheet,.more-backdrop,.bottom-nav,.bottom-link,.habit-card,.stat-tile,.film-item,.book-card,
 .primary-button,.ghost-button,.quick-button,.switch,.switch:before,.week-bar,.ig-bar,.progress-fill,.ring{transition:none!important;}
}
@media(max-width:370px){
 .main-content{padding-left:12px!important;padding-right:12px!important;}
 .topbar{padding-left:12px;padding-right:12px;}
 .bottom-nav{gap:0;padding-left:3px;padding-right:3px;}
 .bottom-link small{font-size:9.5px;}
 .welcome-panel{padding:17px;}
}
@media(min-width:521px){
 .main-content{padding-left:25px!important;padding-right:25px!important;}
 .more-sheet{border-radius:24px 24px 0 0;}
}
/* Prevent nested task controls from setting a too-wide flex min-content size on smaller iPhones. */
.task-row{width:100%;max-width:100%;min-width:0;}
.task-row .task-body{flex:1 1 0;min-width:0;}
.task-row .task-transfer{max-width:100%;min-width:0;}
.task-row .task-transfer label{min-width:0;max-width:100%;}
@media(max-width:395px){
 .task-row{gap:7px;padding:10px 8px;}
 .task-check{width:29px;height:29px;}
 .task-remove{padding:3px;}
 .task-transfer input{max-width:120px;}
}

/* 5.1: personal welcome, one soft blue sunrise on the first morning opening. */
.greeting-section{gap:14px;}
.greeting-card{
  box-sizing:border-box;width:100%;min-width:0;position:relative;isolation:isolate;overflow:hidden;
  padding:19px 20px 18px;border-radius:22px;
  background:linear-gradient(120deg,rgba(255,255,255,.98) 10%,rgba(235,246,255,.93) 100%);
  border:1px solid rgba(168,205,235,.48);
  box-shadow:0 9px 25px rgba(88,105,154,.07);
}
.greeting-card::before{
  content:'';position:absolute;z-index:-1;pointer-events:none;
  width:240px;height:240px;right:-65px;top:-133px;border-radius:50%;
  background:radial-gradient(circle,rgba(144,204,247,.55) 0,rgba(181,223,249,.31) 39%,transparent 71%);
}
.greeting-card .greeting-eyebrow{font-size:10px;letter-spacing:1.35px;color:#8a5676;font-weight:850;}
.greeting-card h1{
  position:relative;z-index:1;letter-spacing:-.75px;font-weight:850;
  font-size:clamp(23px,6.55vw,29px);line-height:1.19;
  color:#762e4f;margin:11px 0 8px;max-width:305px;
}
.greeting-card p{font-size:11.5px;line-height:1.5;color:#6b758f;max-width:290px;margin:0;position:relative;z-index:1;}
.greeting-sparkle{position:absolute;right:18px;top:38px;font-size:31px;line-height:1;color:#9bcbea;opacity:.95;pointer-events:none;}
@keyframes greetingAppear{from{opacity:.25;transform:translate3d(0,10px,0)}to{opacity:1;transform:translate3d(0,0,0)}}
@keyframes greetingGlow{0%{opacity:.2;transform:scale(.76)}50%{opacity:1;transform:scale(1.10)}100%{opacity:1;transform:scale(1)}}
@keyframes greetingSparkle{0%{opacity:0;transform:translateY(4px) scale(.85)}60%{opacity:1;transform:translateY(0) scale(1.12)}100%{opacity:.95;transform:none}}
.greeting-intro{animation:greetingAppear .7s cubic-bezier(.18,.8,.27,1) both;}
.greeting-intro::before{animation:greetingGlow 1.28s ease-out both;}
.greeting-intro .greeting-sparkle{animation:greetingSparkle 1.1s ease-out both;}
@media(max-width:365px){.greeting-card{padding:17px 16px;}.greeting-card h1{font-size:23px;}.greeting-sparkle{right:13px;top:26px;}}
@media(prefers-reduced-motion:reduce){
 .greeting-intro,.greeting-intro::before,.greeting-intro .greeting-sparkle{animation:none!important;}
}

/* v5.2: login is an actual gate.  !important display must never override [hidden]. */
.app-shell[hidden], .login-page[hidden], .startup[hidden] {display:none!important;}
/* Daily self-care cards, independent of skincare. */
.habit-card[data-habit="vitamins"] .habit-emoji{background:linear-gradient(135deg,#f8e4ec,#eff6ff);}
.habit-card[data-habit="haircare"] .habit-emoji{background:linear-gradient(135deg,#e8f4ff,#fbe9f0);}
/* Short, neutral welcome with no inspirational tagline. */
.greeting-card h1{margin-bottom:2px;}
