/* Personal workspace: the same blue, navy and neutral palette as Teryvo CRM. */
:root {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #14243D;
  background: #FAF9F6;
  --accent: #28549A;
  --accent-dark: #1B3154;
  --navy: #14243D;
  --muted: #59677B;
  --line: #e6eaf0;
  --soft: #eef2f7;
  --shadow: 0 8px 32px rgba(25, 36, 61, .035);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 48px; max-width: 100%; padding: 12px 21px;
  border: 1px solid transparent; border-radius: 13px;
  background: var(--accent); color: #fff; font-size: .9rem; font-weight: 600;
  cursor: pointer; white-space: normal; overflow-wrap: anywhere;
  box-shadow: 0 4px 12px rgba(61, 101, 220, .13);
  transition: background .18s, box-shadow .18s, transform .18s;
}
button.secondary { color: #40516f; border-color: var(--line); background: #fff; box-shadow: none; }
button:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
@media (hover: hover) {
  button:not(:disabled):hover { background: var(--accent-dark); box-shadow: 0 6px 16px rgba(61, 101, 220, .18); transform: translateY(-1px); }
  button.secondary:not(:disabled):hover { color: var(--accent); background: var(--soft); border-color: #ccd8fa; box-shadow: none; }
  .bottom a:hover { background: #f4f7fd; color: var(--accent); }
}
:focus-visible { outline: 3px solid #7c9bf1; outline-offset: 4px; }
h1 { margin: 7px 0 13px; font-size: clamp(1.9rem, 3.8vw, 2.9rem); font-weight: 650; line-height: 1.15; letter-spacing: -.045em; }
h2 { margin: 0 0 14px; font-size: 1.13rem; font-weight: 650; line-height: 1.35; letter-spacing: -.025em; }
h3 { margin: 0; font-size: 1rem; font-weight: 600; line-height: 1.5; }
p { margin: 10px 0 20px; color: var(--muted); }
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; color: var(--accent-dark); font-size: .7rem; font-weight: 650; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 20px; height: 1px; background: currentColor; opacity: .65; }
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  min-height: 88px; padding: 20px 36px; border-bottom: 1px solid var(--line);
  background: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--navy); text-decoration: none; flex-shrink: 0; }
.brand img { display: block; object-fit: contain; }
.brand-name { font-size: 1.36rem; font-weight: 750; letter-spacing: -.045em; }
.brand-name > span { color: var(--accent); font-size: .66rem; font-weight: 650; letter-spacing: .025em; margin-left: 5px; }
.brand-caption { border-left: 1px solid var(--line); padding-left: 18px; margin-left: 12px; color: var(--muted); font-size: .75rem; }
.account-link { display: flex; align-items: center; gap: 11px; max-width: 40%; min-height: 44px; color: #40516f; font-size: .82rem; font-weight: 600; text-decoration: none; }
.account-link svg { flex-shrink: 0; width: 38px; height: 38px; padding: 10px; border: 1px solid var(--line); border-radius: 50%; background: #f7f9fc; }
.account-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
svg { max-width: 100%; }
button svg, .bottom svg, .account-link svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
button svg { width: 20px; height: 20px; flex-shrink: 0; }
.shell { max-width: 1136px; margin: 0 auto; padding: 44px 32px 132px; }
section[hidden] { display: none; }
.shell > section > p:not(.eyebrow) { max-width: 640px; font-size: .93rem; }
.card {
  min-width: 0; margin: 22px 0; padding: 28px; border: 1px solid var(--line);
  border-radius: 24px; background: #fff; box-shadow: var(--shadow); overflow-wrap: anywhere;
}
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.grid > .card { margin: 0; }
.hero {
  position: relative; isolation: isolate; padding: 30px 34px; margin-top: 30px; overflow: hidden;
  color: #fff; border-color: transparent;
  background: linear-gradient(115deg, #14243D, #1B3154);
  box-shadow: 0 12px 30px rgba(25, 50, 98, .12);
}
.hero h2 { color: #fff; font-size: 1.14rem; margin: 10px 0 0; }
.hero-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hero-heading h2 { margin: 0; order: -1; }
.hero p { color: #d2def4; font-size: .88rem; max-width: 580px; }
.hero .tag { border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.08); color: #dbe7ff; font-weight: 500; font-size: .67rem; }
.macro { display: grid; grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); align-items: end; gap: 14px; margin: 22px 0; font-variant-numeric: tabular-nums; }
.macro > div { min-width: 0; }
.macro strong { display: block; font-size: 1.65rem; font-weight: 600; line-height: 1.2; letter-spacing: -.04em; overflow-wrap: anywhere; }
.macro span { display: block; margin-top: 7px; font-size: .75rem; font-weight: 500; color: var(--muted); }
.hero .macro { margin: 27px 0 29px; }
.hero .macro strong { font-size: 2.1rem; font-weight: 500; }
.hero .macro > div:first-child strong { font-size: 3.65rem; font-weight: 550; line-height: 1; }
.hero .macro > div:not(:first-child) { border-left: 1px solid rgba(255,255,255,.15); padding: 0 0 2px 22px; }
.hero .macro span { color: #cedbf3; }
.hero-action { color: #234989; background: #fff; border-color: #fff; box-shadow: 0 4px 18px rgba(0,0,0,.06); }
@media (hover: hover) { .hero-action:not(:disabled):hover { color: #183c80; background: #eef2f7; } }
.card-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.card-heading h2 { margin: 0; }
.section-number { font-size: .68rem; font-weight: 600; color: #7385aa; border: 1px solid var(--line); border-radius: 8px; padding: 4px 7px; font-variant-numeric: tabular-nums; }
.plan-card .row { font-size: .87rem; padding: 16px 0; }
.plan-card .row:last-child { padding-bottom: 0; }
.reminder-card { background: linear-gradient(135deg, #fff, #f8faff); }
.reminder-card h3 { margin-top: 26px; font-size: 1.1rem; }
.reminder-card p { font-size: .85rem; }
.reminder-card .secondary { margin-top: 6px; }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 20px 0; }
.toolbar h2 { flex: 1; margin: 0; }
.toolbar label { flex: 1; min-width: 140px; }
.hint { font-size: .8rem; line-height: 1.65; }
.tag { display: inline-block; padding: 5px 11px; border-radius: 7px; background: var(--soft); color: var(--accent-dark); font-size: .7rem; font-weight: 600; letter-spacing: .02em; }
.card > .tag { margin-bottom: 15px; }
label { display: block; margin: 14px 0; color: #40516f; font-size: .82rem; font-weight: 600; }
input, select, textarea { display: block; width: 100%; min-width: 0; max-width: 100%; min-height: 48px; margin-top: 7px; padding: 12px 14px; border: 1px solid #dce3ee; border-radius: 12px; background: #fbfcfe; color: #14243D; font-size: 1rem; font-weight: 400; transition: border-color .18s, box-shadow .18s; }
input:focus, select:focus, textarea:focus { border-color: #8da6ed; box-shadow: 0 0 0 4px rgba(61,101,220,.08); outline: none; background: #fff; }
input[type=checkbox] { width: 21px; min-height: 21px; flex-shrink: 0; margin: 0; accent-color: var(--accent); }
.check { display: flex; align-items: center; gap: 12px; min-height: 32px; }
.row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); }
.row > div { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.row small { display: block; margin-top: 4px; color: var(--muted); font-size: .78rem; }
.row .actions { flex: 0 1 auto; display: flex; flex-wrap: wrap; gap: 8px; }
.actions button { padding: 9px 13px; font-size: .78rem; }
.company { padding: 24px 0; border-top: 1px solid var(--line); }
.bottom {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(225,231,242,.85); background: rgba(255,255,255,.96);
  box-shadow: 0 -4px 24px rgba(25,36,61,.035);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.bottom a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 124px; min-height: 58px; padding: 6px; border-radius: 14px; color: #6b7891; text-decoration: none; font-size: .74rem; font-weight: 500; transition: color .18s, background .18s; }
.bottom svg { width: 23px; height: 23px; flex-shrink: 0; }
.bottom a[aria-current=page] { color: var(--accent); background: var(--soft); font-weight: 650; }
dialog { width: min(580px, calc(100% - 24px)); max-height: calc(100dvh - 32px); padding: 28px; border: 1px solid #e6eaf0; border-radius: 25px; background: #fff; color: #14243D; box-shadow: 0 28px 100px rgba(13,28,66,.2); overflow-y: auto; }
dialog::backdrop { background: rgba(17,31,60,.44); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
dialog form { min-width: 0; }
dialog .toolbar { margin-top: 0; }
#close-editor { width: 42px; min-height: 42px; flex: 0 0 42px; padding: 8px; border-radius: 50%; }
#save { min-width: 150px; }
.fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 14px; }
#form-error { color: #a22d40; font-size: .88rem; }
#status:not(:empty) { position: sticky; top: 12px; z-index: 11; margin-bottom: 18px; padding: 13px 18px; border: 1px solid #cad8ff; border-radius: 13px; background: #eef2f7; color: #294caa; box-shadow: var(--shadow); font-size: .86rem; }
.chart { display: block; width: 100%; height: 250px; margin-top: 20px; }
.chart text { font-family: inherit; font-size: 12px; fill: var(--muted); }
.assistant { min-height: min(550px,65dvh); display: flex; flex-direction: column; justify-content: space-between; gap: 35px; background: radial-gradient(ellipse at 100% 0%, #eef2f7, transparent 60%), #fff; }
.assistant h2 { margin-top: 24px; font-size: 1.6rem; }
.assistant p { max-width: 540px; }
.assistant fieldset { border: 0; padding: 0; margin: 0; }
body.keyboard .bottom { display: none; }
body.keyboard .shell { padding-bottom: 24px; }
.empty { padding: 28px 0; }
.ingredient { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr) auto; align-items: end; gap: 8px; }
.ingredient button { margin-bottom: 14px; }
@media (min-width: 1100px) {
  .bottom { top: 123px; bottom: auto; left: 28px; right: auto; width: 204px; flex-direction: column; align-items: stretch; gap: 8px; padding: 20px 12px; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: var(--shadow); }
  .bottom::before { content: "ВАШЕ ПРОСТРАНСТВО"; margin: 0 12px 14px; color: var(--muted); font-size: .58rem; font-weight: 600; letter-spacing: .11em; }
  .bottom a { flex-direction: row; justify-content: flex-start; gap: 13px; width: 100%; min-height: 52px; padding: 13px; font-size: .84rem; }
  .bottom svg { width: 21px; height: 21px; }
  body:has(.bottom) .shell { width: calc(100% - 260px); max-width: 1210px; margin-left: 260px; padding: 40px 42px 70px 18px; }
}
@media (min-width: 1500px) { body:has(.bottom) .shell { margin-left: max(260px, calc((100vw - 1080px)/2)); max-width: 1136px; } }
@media (max-width: 700px) {
  .top { min-height: 76px; padding: 16px 20px; gap: 16px; }
  .brand img { width: 32px; height: 32px; }
  .brand-caption { display: none; }
  .brand-name { font-size: 1.2rem; }
  .account-link { gap: 7px; font-size: .73rem; }
  .account-link svg { width: 32px; height: 32px; padding: 8px; }
  .shell { padding: 30px 20px 128px; }
  h1 { font-size: clamp(1.8rem,6vw,2.3rem); max-width: 440px; }
  .shell > section > p:not(.eyebrow) { font-size: .88rem; }
  .grid { grid-template-columns: minmax(0,1fr); gap: 18px; }
  .card { padding: 22px; border-radius: 24px; margin: 20px 0; }
  .hero { margin-top: 26px; padding: 24px; }
  .hero-heading { align-items: flex-start; gap: 10px; }
  .hero-heading h2 { font-size: 1.04rem; }
  .hero .tag { font-size: .6rem; padding: 4px 8px; }
  .macro { gap: 10px; grid-template-columns: repeat(4,minmax(0,1fr)); }
  .macro strong { font-size: 1.3rem; }
  .macro span { font-size: .66rem; }
  .hero .macro { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px 8px; margin: 23px 0; }
  .hero .macro > div:first-child { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 10px; }
  .hero .macro > div:first-child strong { font-size: 3.2rem; }
  .hero .macro > div:first-child span { font-size: .82rem; }
  .hero .macro > div:not(:first-child) { padding: 0; border-left: 0; }
  .hero .macro > div:nth-child(n+3) { padding-left: 14px; border-left: 1px solid rgba(255,255,255,.15); }
  .hero .macro strong { font-size: 1.35rem; }
  .hero-action { width: 100%; }
  .card-heading { margin-bottom: 16px; }
  .plan-card .row { font-size: .82rem; }
  .plan-card .row button { padding: 10px 13px; font-size: .75rem; }
  .reminder-card h3 { margin-top: 20px; }
  .toolbar > button { flex-grow: 1; }
  .row .actions { width: 100%; }
  .bottom { gap: 2px; padding-left: 8px; padding-right: 8px; }
  .bottom a { width: 20%; font-size: .65rem; min-height: 58px; padding: 5px 2px; border-radius: 12px; }
  .bottom svg { width: 22px; height: 22px; }
  dialog { padding: 22px; border-radius: 22px; }
  .ingredient { grid-template-columns: minmax(0,1fr) 76px auto; }
  .ingredient button { padding: 10px; }
  .assistant h2 { font-size: 1.35rem; }
}
@media (max-width: 360px) {
  .shell { padding-left: 15px; padding-right: 15px; }
  .top { padding-inline: 15px; }
  .account-link span { max-width: 64px; }
  .card, .hero { padding: 20px; }
  .hero-heading { display: block; }
  .hero-heading .tag { margin-bottom: 8px; }
  .bottom { padding-inline: 4px; }
  .bottom a { font-size: .61rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Personal concierge composition. All displayed values come from account data. */
h1 { font-weight: 600; letter-spacing: -.035em; overflow-wrap: anywhere; }
.welcome-copy { line-height: 1.8; }
.daily-primary { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); gap: 24px; margin: 32px 0 24px; }
.daily-primary > .card { margin: 0; }
.daily-primary .hero { padding: 30px; }
.card { border-color: #e8e9eb; box-shadow: 0 5px 24px rgba(20,36,61,.025); }
.personal-plan { display: flex; flex-direction: column; align-items: flex-start; }
.personal-plan h2 { font-size: 1.45rem; line-height: 1.45; }
.personal-plan p { font-size: .87rem; }
.program-summary { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); width: 100%; }
.program-summary h3 { font-size: .87rem; }
.program-summary p { margin-bottom: 10px; }
.program-item { margin-top: 16px; }
.program-item form { margin-top: 10px; }
.energy { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 30px 0 18px; font-variant-numeric: tabular-nums; }
.energy strong { font-size: clamp(2.8rem,4.2vw,4rem); line-height: 1; font-weight: 500; letter-spacing: -.05em; }
.energy span { color: #d8e0ec; font-size: .82rem; }
progress { display: block; appearance: none; border: none; width: 100%; height: 5px; border-radius: 5px; overflow: hidden; background: #e5e9ef; }
progress::-webkit-progress-bar { background: #e5e9ef; border-radius: 5px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 5px; transition: width .25s ease; }
progress::-moz-progress-bar { background: var(--accent); }
.hero progress, .hero progress::-webkit-progress-bar { background: #42536d; }
.hero progress::-webkit-progress-value { background: #d2bb97; }
.hero progress::-moz-progress-bar { background: #d2bb97; }
.hero .nutrition-caption { font-size: .78rem; margin: 10px 0 24px; }
.nutrient-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; }
.nutrient-grid > div { min-width: 0; }
.nutrient-grid span, .nutrient-grid small { display: block; color: #d8e0ec; font-size: .72rem; }
.nutrient-grid strong { display: block; margin: 5px 0 12px; font-size: 1.45rem; font-weight: 500; }
.nutrient-grid strong small { display: inline; }
.nutrient-grid progress { margin-bottom: 8px; height: 3px; }
.nutrition-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.quiet-button { color: #fff; background: transparent; box-shadow: none; padding-inline: 12px; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; font-size: .85rem; font-weight: 600; text-decoration: none; gap: 8px; }
.text-link:hover { text-decoration: underline; text-underline-offset: 5px; }
.card-heading { justify-content: space-between; flex-wrap: wrap; }
.today-grid .card { margin: 0; }
.reminder-card { background: #fff; }
.reminder-card h2 { margin-top: 14px; }
.progress-value { font-size: 2.5rem; letter-spacing: -.035em; line-height: 1.2; margin-bottom: 8px; }
.progress-value small { font-size: 1rem; color: var(--muted); }
.spark { display: block; width: 100%; height: 90px; margin-top: 18px; }
.assistant-preview { position: relative; background: #f3f5f8; }
.assistant-preview h2 { margin-top: 22px; }
.assistant-preview > small { display: block; }
.assistant-symbol { width: 46px; height: 46px; border-radius: 50%; background: #e5eaf1; color: #28549a; display: grid; place-items: center; font-size: 1.8rem; margin-bottom: 20px; }
.assistant-preview .text-link { margin-top: 12px; }
.bottom a { color: #59677B; }
.shell > section:not([hidden]) { animation: enter .22s ease-out; }
@keyframes enter { from { opacity: .6; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 850px) {
  .daily-primary { grid-template-columns: minmax(0,1fr); gap: 18px; margin-top: 24px; }
  .daily-primary .hero { padding: 24px; }
  .energy { margin-top: 26px; }
  .nutrition-actions .hero-action { width: auto; flex: 1; }
  .nutrient-grid { gap: 14px; }
}
@media (max-width: 360px) {
  .daily-primary .hero { padding: 20px; }
  .nutrition-actions { flex-direction: column; align-items: stretch; }
  .nutrition-actions .hero-action { width: 100%; }
  .nutrient-grid { gap: 10px; }
}

@media (max-width: 700px) {
  .nutrition-actions { flex-direction: column; align-items: stretch; gap: 4px; }
  .nutrition-actions .hero-action { width: 100%; flex: auto; }
  .nutrition-actions .quiet-button { min-height: 44px; padding: 8px; }
}
