/* ==========================================================================
   Моят ден — компоненти. Цветове, шрифтове и форми идват от skins.css.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg { flex: none; }

/* ---------- Typography ---------- */
.display {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  text-transform: var(--display-case);
}
.display em { font-style: var(--display-em-style); color: var(--accent-text, var(--accent)); }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-text, var(--accent)); }
.muted { color: var(--muted); }
h1, h2, h3 { margin: 0; }

/* ---------- Layout ---------- */
.app { min-height: 100vh; min-height: 100dvh; display: flex; }
.main {
  flex: 1; min-width: 0;
  padding: 28px clamp(16px, 4vw, 48px) 48px;
  display: flex; flex-direction: column; gap: 24px;
  max-width: 1320px;
}
.sidebar {
  width: 248px; flex: none;
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
  background: var(--nav-bg);
  border-right: var(--bw, 1px) solid var(--line);
  padding: 28px 18px;
  display: flex; flex-direction: column; gap: 26px;
}
[data-skin="blush"] .sidebar, [data-skin="mocha"] .sidebar { border-right-width: 1px; }
[data-skin="lilac"] .sidebar, [data-skin="peach"] .sidebar { border-right: 0; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: var(--radius-sm);
  background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center;
  border: var(--bw) solid var(--card-border);
}
.brand-name { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 22px; line-height: 1; text-transform: var(--display-case); }
[data-skin="blush"] .brand-name, [data-skin="mocha"] .brand-name { font-style: italic; }
.brand-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-btn {
  display: flex; align-items: center; gap: 12px;
  min-height: 44px; padding: 10px 14px;
  border: var(--bw) solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: var(--nav-ink); font-weight: 500; text-align: left;
}
.nav-btn:hover { background: var(--surface-2); }
.nav-btn.active {
  background: var(--nav-active-bg); color: var(--nav-active-ink); font-weight: 700;
  border-color: var(--card-border); box-shadow: var(--shadow);
}
[data-skin="cherry"] .nav-btn.active { box-shadow: 3px 3px 0 #1A0E14; }
.side-label { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 14px 8px; }
[data-skin="cherry"] .side-label, [data-skin="cherry"] .brand-sub { color: #1A0E14; }
.cat-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 36px; padding: 6px 14px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--nav-ink); text-align: left; font-size: 14px;
}
.cat-btn.on { background: var(--surface-2); color: var(--ink); font-weight: 700; }
[data-skin="cherry"] .cat-btn.on { background: #FFFFFF; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.side-quote {
  margin-top: auto; padding: 16px; border-radius: var(--radius);
  background: var(--surface-2); border: var(--bw) solid var(--card-border);
  transform: rotate(var(--tilt));
}
[data-skin="cherry"] .side-quote { background: #FFE15A; box-shadow: 4px 4px 0 #1A0E14; }
[data-skin="mocha"] .side-quote { background: transparent; border-color: var(--line-soft); }
.side-quote b { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 17px; display: block; }

/* ---------- Top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  border: var(--bw, 1px) solid var(--line); background: var(--surface); color: var(--ink);
  display: grid; place-items: center;
}
[data-skin="lilac"] .icon-btn, [data-skin="peach"] .icon-btn { border: 0; }
[data-skin="cherry"] .icon-btn { border-radius: 13px; box-shadow: 3px 3px 0 #1A0E14; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; border: 0;
  display: grid; place-items: center; flex: none;
  background: var(--ink); color: var(--bg);
  font-family: var(--font-display); font-size: 18px; font-weight: 600;
}
.avatar.sm { width: 24px; height: 24px; font-size: 11px; font-family: var(--font-body); font-weight: 700; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: var(--bw, 1px) solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 600; white-space: nowrap;
}
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--card-border); }
[data-skin="blush"] .btn.primary, [data-skin="mocha"] .btn.primary { border-color: transparent; }
[data-skin="cherry"] .btn { border-radius: 14px; }
[data-skin="cherry"] .btn.primary { box-shadow: 3px 3px 0 #1A0E14; }
.btn.ghost { background: transparent; }
.btn.danger { color: #B3261E; border-color: currentColor; background: transparent; }
[data-skin="mocha"] .btn.danger { color: #FF9C94; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn:disabled { opacity: .55; cursor: default; }
.link-btn { border: 0; background: none; padding: 6px 0; color: var(--muted); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; }

/* ---------- Page head ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px; }
.page-head h1 { font-size: clamp(34px, 5vw, 58px); line-height: 1.02; margin-top: 8px; }
.page-head p { margin: 0; max-width: 320px; color: var(--muted); }

/* ---------- Week strip ---------- */
.week-days { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.day {
  min-height: 64px; padding: 8px 0; border-radius: var(--radius);
  border: var(--bw) solid var(--card-border); background: var(--surface); color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.day small { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.day b { font-family: var(--time-font); font-size: 22px; font-weight: 600; font-style: normal; }
.day.today b { color: var(--accent-text, var(--accent)); }
.day.sel { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow); }
.day.sel small { color: inherit; opacity: .85; }
.day.sel b { color: inherit; }
.day .has { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: .7; }
.day.sel .has { background: currentColor; }
[data-skin="blush"] .day { background: transparent; border: 0; border-radius: 0; border-bottom: 2px solid transparent; }
[data-skin="blush"] .week-days { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
[data-skin="blush"] .day b { font-family: var(--font-display); font-style: italic; font-size: 26px; }
[data-skin="blush"] .day.sel { background: transparent; color: var(--accent); border-bottom-color: var(--accent); box-shadow: none; }
[data-skin="lilac"] .day.sel { background: var(--ink); color: #FFFFFF; }
[data-skin="mocha"] .day { background: transparent; border-color: var(--line-soft); }
[data-skin="mocha"] .day.sel { background: var(--surface-2); color: var(--ink); border-color: var(--accent); }
[data-skin="mocha"] .day.sel small { color: var(--accent); }
[data-skin="mocha"] .day b { font-family: var(--font-display); font-size: 26px; }

/* ---------- Chips ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  min-height: 38px; padding: 0 14px; border-radius: 999px;
  border: var(--bw, 1px) solid var(--line); background: var(--surface); color: var(--ink);
  font-size: 13px; font-weight: 600;
}
[data-skin="lilac"] .chip, [data-skin="peach"] .chip { border-color: transparent; }
.chip.on { background: var(--accent); color: var(--on-accent); border-color: var(--card-border); }
[data-skin="lilac"] .chip.on { background: var(--ink); color: #FFFFFF; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  border: calc(var(--bw) * .8) solid var(--chip-border);
}

/* ---------- Grid & cards ---------- */
.grid { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.col-main { flex: 999 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.col-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.card {
  background: var(--surface);
  border: var(--bw, 1px) solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px;
}
[data-skin="blush"] .card { border-width: 1px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { font-size: 24px; }
.card-sub { font-size: 13px; color: var(--muted); }
.card.hero { background: var(--hero); color: var(--on-hero); }
.card.hero .eyebrow { color: var(--hero-muted); }
.card.soft { background: var(--accent-soft); }
[data-skin="lilac"] .card.soft { background: #E6DDFB; }
[data-skin="peach"] .card.soft { background: #FFD8C2; }

/* ---------- Tasks ---------- */
.tasks { display: flex; flex-direction: column; }
.task {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0; border-top: 1px solid var(--line-soft);
}
.task:first-child { border-top: 0; }
[data-skin="lilac"] .tasks, [data-skin="peach"] .tasks, [data-skin="cherry"] .tasks { gap: 8px; }
[data-skin="lilac"] .task, [data-skin="peach"] .task { border: 0; padding: 8px 10px; border-radius: var(--radius); background: var(--surface-2); }
[data-skin="cherry"] .task { border: 2px solid #1A0E14; border-radius: 14px; padding: 6px 12px; }
.task-time { width: 58px; flex: none; font-family: var(--time-font); font-style: var(--time-style); font-size: 18px; color: var(--ink-2); font-weight: 600; }
[data-skin="mocha"] .task-time { color: var(--accent); font-size: 20px; }
[data-skin="lilac"] .task-time, [data-skin="peach"] .task-time { font-size: 14px; font-weight: 800; }
.task-body { flex: 1; min-width: 0; border: 0; background: none; padding: 0; text-align: left; color: inherit; }
.task-title { font-weight: 600; font-size: 16px; display: block; }
.task-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 5px; font-size: 13px; color: var(--muted); }
.task.done .task-title { text-decoration: line-through; }
.task.done .task-body, .task.done .task-time { opacity: .5; }
.check {
  width: 44px; height: 44px; flex: none; border: 0; background: none; padding: 0;
  display: grid; place-items: center;
}
.check span {
  width: 26px; height: 26px; border-radius: var(--check-radius);
  border: 2px solid var(--line); display: grid; place-items: center; color: transparent;
  transition: background .15s ease, border-color .15s ease;
}
[data-skin="cherry"] .check span { border: 2.5px solid #1A0E14; background: #FFFFFF; }
.check.on span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
[data-skin="peach"] .check.on span { background: #4F6B4A; border-color: #4F6B4A; color: #FFFFFF; }
[data-skin="cherry"] .check.on span { background: var(--accent); border-color: #1A0E14; color: #1A0E14; }

.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }

/* ---------- Focus ring ---------- */
.focus { display: flex; align-items: center; gap: 20px; }
.ring {
  --p: 0;
  width: 110px; height: 110px; flex: none; border-radius: 50%;
  background: conic-gradient(var(--ring, var(--accent)) calc(var(--p) * 1%), var(--ring-track, var(--accent-soft)) 0);
  display: grid; place-items: center;
}
.ring > div {
  width: 88px; height: 88px; border-radius: 50%; background: var(--ring-hole, var(--surface));
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: var(--display-weight); font-size: 26px;
}
.card.hero .ring { --ring-hole: var(--hero); --ring-track: rgba(255,255,255,.18); }
[data-skin="lilac"] .card.hero .ring, [data-skin="peach"] .card.hero .ring { --ring-track: #FFFFFF; --ring: var(--ink); }
[data-skin="peach"] .card.hero .ring { --ring: #4F6B4A; }
[data-skin="cherry"] .ring { border: 3px solid #1A0E14; }
[data-skin="mocha"] .card.hero .ring { --ring: #2A1A1E; --ring-track: rgba(42,26,30,.2); }
.next-time { font-family: var(--font-display); font-size: 30px; line-height: 1; font-weight: var(--display-weight); }

/* ---------- Simple lists (routines, notes) ---------- */
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: var(--surface-2); border: var(--bw) solid var(--card-border); }
.seg button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
[data-skin="cherry"] .seg button.on { background: var(--accent); }
[data-skin="mocha"] .seg button.on { background: var(--accent); color: var(--on-accent); }
.row { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.row .grow { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 8px 0; color: inherit; }
.row.done .grow { text-decoration: line-through; opacity: .55; }
.progress { height: 8px; border-radius: 99px; background: var(--accent-soft); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
[data-skin="cherry"] .progress { height: 14px; border: 2.5px solid #1A0E14; background: #FFFFFF; }

.notes { display: flex; flex-direction: column; gap: 10px; }
.note {
  width: 100%; text-align: left; border: var(--bw) solid var(--card-border);
  background: var(--surface-2); color: inherit; border-radius: var(--radius); padding: 14px 16px;
  white-space: pre-line; line-height: 1.45;
}
[data-skin="blush"] .note, [data-skin="mocha"] .note { font-family: var(--font-display); font-style: italic; font-size: 17px; }
[data-skin="mocha"] .note { background: transparent; border: 0; border-top: 1px solid var(--line-soft); border-radius: 0; padding: 12px 0; }
[data-skin="cherry"] .note:nth-child(odd) { transform: rotate(-.8deg); }
[data-skin="cherry"] .note:nth-child(even) { transform: rotate(.8deg); background: #B8F0D0; }
[data-skin="peach"] .note { font-family: 'Caveat', cursive; font-size: 22px; line-height: 1.15; background: #FFF3C9; }
[data-skin="peach"] .note:nth-child(3n+2) { background: #FFE1E6; }
[data-skin="peach"] .note:nth-child(3n) { background: #E4EFE1; }

/* ---------- Calendar ---------- */
.cal-head { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 14px; }
.cal-head h2 { font-size: 24px; min-width: 200px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line-soft); border-left: 1px solid var(--line-soft); }
.cal-dow { padding: 8px 0; text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.cal-cell {
  min-height: 96px; padding: 6px; border: 0; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
  background: transparent; color: inherit; text-align: left; display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.cal-cell.other { opacity: .4; }
.cal-cell.sel { background: var(--accent-soft); }
.cal-num { font-weight: 700; font-size: 14px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; }
.cal-cell.today .cal-num { background: var(--accent); color: var(--on-accent); }
.cal-label { font-size: 11px; line-height: 1.25; padding: 2px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-more { font-size: 11px; color: var(--muted); padding-left: 4px; }
.cal-dots { display: none; gap: 3px; flex-wrap: wrap; }
.cal-dots i { width: 6px; height: 6px; border-radius: 50%; }

/* ---------- Settings ---------- */
.skins { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.skin-card {
  border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink);
  padding: 10px; text-align: left; display: flex; flex-direction: column; gap: 10px;
}
.skin-card.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.skin-prev { height: 92px; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; justify-content: space-between; }
.skin-prev .sw { display: flex; gap: 6px; }
.skin-prev .sw i { width: 18px; height: 18px; border-radius: 50%; display: block; }
.skin-name { font-weight: 700; font-size: 14px; padding: 0 4px 4px; }
.members { display: flex; flex-direction: column; gap: 10px; }
.member { display: flex; align-items: center; gap: 12px; }

/* ---------- Forms & modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(20, 10, 15, .45);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .15s ease;
}
.modal {
  width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; overflow-y: auto;
  background: var(--surface); color: var(--ink);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border: var(--bw) solid var(--card-border); box-shadow: var(--shadow-pop);
  padding: 22px 20px calc(20px + env(safe-area-inset-bottom));
  animation: up .2s ease;
}
@media (min-width: 700px) {
  .modal-backdrop { align-items: center; padding: 24px; }
  .modal { border-radius: var(--radius-lg); padding: 26px; }
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.modal-head h2 { font-size: 26px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 22px; }
.modal-foot .spacer { flex: 1; }
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.field > label, .field > .label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.input, .field input:not([type=checkbox]):not([type=file]), .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border: var(--bw, 1px) solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--ink); outline: none;
}
[data-skin="lilac"] .field input, [data-skin="lilac"] .field select, [data-skin="lilac"] .field textarea,
[data-skin="peach"] .field input, [data-skin="peach"] .field select, [data-skin="peach"] .field textarea { border: 1px solid var(--line); }
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.fields2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fields2 .field { margin-top: 14px; }
.switch { display: flex; align-items: center; gap: 12px; min-height: 44px; margin-top: 12px; cursor: pointer; font-weight: 600; }
.switch input { width: 22px; height: 22px; accent-color: var(--accent); }
.types { display: flex; flex-wrap: wrap; gap: 8px; }
.warn { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: #FFF3C9; color: #5C4A00; font-size: 14px; }
.error-msg { margin-top: 10px; color: #B3261E; font-size: 14px; font-weight: 600; }
[data-skin="mocha"] .error-msg { color: #FF9C94; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 60; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px;
  font-weight: 600; font-size: 14px; box-shadow: var(--shadow-pop); animation: up .2s ease; max-width: 90vw;
}
@media (min-width: 900px) { .toast { bottom: 32px; } }

/* ---------- Mobile tab bar ---------- */
.tabbar, .fab { display: none; }
@media (max-width: 899px) {
  .sidebar { display: none; }
  .main { padding: calc(16px + env(safe-area-inset-top)) 16px calc(120px + env(safe-area-inset-bottom)); gap: 18px; }
  .topbar .desktop-only { display: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
    background: var(--tab-bg); border-top: var(--bw, 1px) solid var(--line);
  }
  [data-skin="blush"] .tabbar, [data-skin="mocha"] .tabbar { border-top-width: 1px; }
  [data-skin="lilac"] .tabbar {
    left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); border-radius: 999px; border: 0;
    padding: 6px; box-shadow: 0 12px 30px rgba(37, 26, 58, .28);
  }
  [data-skin="peach"] .tabbar { border: 0; border-radius: 26px 26px 0 0; box-shadow: 0 -6px 24px rgba(61,43,38,.08); }
  .tab {
    min-height: 54px; border: 0; background: transparent; color: var(--nav-ink); border-radius: 16px;
    font-size: 11px; font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  }
  [data-skin="lilac"] .tab { color: #D9D0EE; border-radius: 999px; }
  [data-skin="cherry"] .tab { color: #1A0E14; }
  .tab.active { color: var(--tab-active); font-weight: 800; }
  [data-skin="lilac"] .tab.active { background: #FFFFFF; color: #251A3A; }
  [data-skin="peach"] .tab.active { background: #FFD8C2; }
  [data-skin="cherry"] .tab.active { background: #FFFFFF; border: 2.5px solid #1A0E14; box-shadow: 2px 2px 0 #1A0E14; border-radius: 14px; margin: 0 3px; }
  .fab {
    display: grid; place-items: center; position: fixed; z-index: 41;
    right: 18px; bottom: calc(92px + env(safe-area-inset-bottom));
    width: 58px; height: 58px; border-radius: 50%; border: var(--bw) solid var(--card-border);
    background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-pop);
  }
  [data-skin="lilac"] .fab { bottom: calc(94px + env(safe-area-inset-bottom)); }
  [data-skin="cherry"] .fab { background: #FFE15A; border-radius: 18px; box-shadow: 4px 4px 0 #1A0E14; transform: rotate(-4deg); }
  .page-head h1 { font-size: 34px; }
  .day { min-height: 56px; }
  .day b { font-size: 18px; }
  [data-skin="blush"] .day b, [data-skin="mocha"] .day b { font-size: 21px; }
  .card { padding: 18px; }
  .ring { width: 88px; height: 88px; }
  .ring > div { width: 70px; height: 70px; font-size: 21px; }
  .cal-cell { min-height: 58px; padding: 4px; align-items: center; }
  .cal-label, .cal-more { display: none; }
  .cal-dots { display: flex; justify-content: center; }
  .cal-head h2 { min-width: 0; font-size: 20px; }
}

/* ---------- Login ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login .card { width: 100%; max-width: 420px; padding: 32px 26px; }
.login h1 { font-size: 40px; }

@keyframes fade { from { opacity: 0; } }
@keyframes up { from { opacity: 0; transform: translateY(14px); } }
.toast { animation-name: toastup; }
@keyframes toastup { from { opacity: 0; transform: translate(-50%, 14px); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

@media (min-width: 900px) { .mobile-only { display: none !important; } }

@media (max-width: 899px) { .desktop-only { display: none !important; } }
[data-skin="cherry"] .dot { outline: 1.5px solid #1A0E14; }

/* ==========================================================================
   v2 — категории, готвене, курсове, финанси, съдържание, известия
   ========================================================================== */

.icon-btn.sm { width: 36px; height: 36px; flex: none; }
[data-skin="cherry"] .icon-btn.sm { box-shadow: 2px 2px 0 #1A0E14; }
.head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-head h1 { overflow-wrap: anywhere; }
.mini-tag { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; font-size: 12px; font-weight: 600; color: var(--muted); padding: 1px 8px; border-radius: 999px; background: var(--surface-2); vertical-align: middle; }
.sub-h { font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin: 16px 0 6px; }
.sub-h .card-sub { text-transform: none; letter-spacing: 0; font-weight: 500; }
.day-label { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 12px 0 2px; }
.tasks .day-label:first-child { padding-top: 0; }

/* Week navigation */
.week-wrap { display: flex; flex-direction: column; gap: 10px; }
.week-nav { display: flex; align-items: center; gap: 10px; }
.week-nav .icon-btn { width: 40px; height: 40px; }
.week-range { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 18px; text-transform: var(--display-case); min-width: 150px; text-align: center; }
.week-nav .btn { margin-left: auto; }

/* Quick add */
.quick-add { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.quick-add input:not([type=hidden]):not([type=color]) {
  flex: 1; min-width: 0; min-height: 44px; padding: 8px 14px; border-radius: var(--radius-sm);
  border: var(--bw, 1px) solid var(--line); background: var(--surface-2); color: var(--ink); outline: none;
}
[data-skin="lilac"] .quick-add input, [data-skin="peach"] .quick-add input { border: 1px solid var(--line); }
.quick-add input:focus { border-color: var(--accent); }
.quick-add input[type=color] { height: 44px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.quick-add .icon-btn { width: 44px; height: 44px; background: var(--accent); color: var(--on-accent); border-color: var(--card-border); }

/* Banner (notifications) */
.banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--accent-soft); border: var(--bw) solid var(--card-border); }
.banner-icon { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--accent-text, var(--accent)); }

/* Category tiles (Още, Настройки) */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.cat-tile { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 14px; border-radius: var(--radius-sm); border: var(--bw, 1px) solid var(--line); background: var(--surface-2); color: var(--ink); font-weight: 600; text-align: left; }

/* Two lists side by side */
.cards-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; align-items: start; }

/* Segmented tabs (big) */
.seg.big { align-self: flex-start; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg.big button { min-height: 42px; padding: 0 18px; font-size: 14px; white-space: nowrap; }
.seg-opt { position: relative; display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
[data-skin="mocha"] .seg-opt.on, [data-skin="cherry"] .seg-opt.on { background: var(--accent); color: var(--on-accent); }

/* ---------- Готвене ---------- */
.meals { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.meal { padding: 16px; }
.meal-name { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 19px; text-transform: var(--display-case); margin: 0; }
.meal-entry { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px; margin-top: 6px; border: 0; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink); text-align: left; font-weight: 600; }
.meal-entry img, .meal-ph { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text, var(--accent)); }
.meal-empty { width: 100%; min-height: 48px; border: 1.5px dashed var(--line); border-radius: var(--radius-sm); background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; }
[data-skin="cherry"] .meal-empty { border-color: #1A0E14; }

.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; max-height: 300px; overflow-y: auto; padding: 2px; }
.pick { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: var(--radius-sm); border: 2px solid var(--line); background: var(--surface-2); cursor: pointer; font-size: 13px; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pick:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.pick img, .pick-ph { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text, var(--accent)); }
.pick b { font-weight: 700; line-height: 1.2; }

.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.recipe-card {
  display: flex; flex-direction: column; gap: 6px; padding: 8px 8px 12px; text-align: left; color: var(--ink);
  background: var(--surface); border: var(--bw, 1px) solid var(--card-border); border-radius: var(--radius); box-shadow: var(--shadow);
}
[data-skin="blush"] .recipe-card, [data-skin="mocha"] .recipe-card { border: 1px solid var(--line); }
.recipe-card img, .recipe-ph { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: calc(var(--radius) - 6px); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text, var(--accent)); }
.recipe-card b { font-weight: 700; padding: 0 4px; line-height: 1.25; }
.recipe-card .card-sub { padding: 0 4px; }
.recipe-card.add { align-items: center; justify-content: center; text-align: center; min-height: 220px; border-style: dashed; background: transparent; box-shadow: none; color: var(--accent-text, var(--accent)); }
.recipe-hero { width: 100%; max-height: 360px; object-fit: cover; border-radius: var(--radius); margin-bottom: 12px; }
.recipe-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.ing, .steps { margin: 0; padding-left: 20px; line-height: 1.6; }
.steps li { margin-bottom: 6px; }

.photo-zone { position: relative; min-height: 150px; border-radius: var(--radius); border: 2px dashed var(--line); background: var(--surface-2); display: grid; place-items: center; overflow: hidden; outline: none; }
.photo-zone:focus { border-color: var(--accent); }
.photo-zone img { width: 100%; max-height: 300px; object-fit: cover; display: block; }
.photo-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; text-align: center; padding: 20px; }
.photo-busy { position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--surface) 80%, transparent); font-weight: 700; }
.photo-busy[hidden] { display: none; }
.photo-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.photo-btns label.btn { cursor: pointer; }
.inline-input { display: flex; gap: 8px; }
.inline-input input { flex: 1; min-width: 0; }
.search { display: flex; align-items: center; gap: 8px; padding: 0 14px; min-height: 46px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); max-width: 420px; }
.search input { flex: 1; border: 0; outline: none; background: transparent; min-height: 44px; }

/* ---------- Рождени дни ---------- */
.bday-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; align-items: start; }
.bday-head { display: flex; align-items: center; gap: 14px; }
.bday-date { width: 58px; height: 58px; flex: none; border-radius: var(--radius-sm); background: var(--accent-soft); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; border: var(--bw) solid var(--card-border); }
.bday-date b { font-family: var(--font-display); font-size: 24px; font-weight: var(--display-weight); }
.bday-date small { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.bday.soon .bday-date { background: var(--accent); color: var(--on-accent); }
.bday.soon .bday-date small { color: inherit; opacity: .85; }

/* ---------- Съдържание ---------- */
.format-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; align-items: start; }
.format-col { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.format-col .card-head { margin-bottom: 0; }
.idea-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: 100%; padding: 12px 14px; text-align: left; color: var(--ink); border-radius: var(--radius-sm); border: var(--bw, 1px) solid var(--line); border-left: 4px solid var(--fc); background: var(--surface-2); }
.idea-card .card-sub { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.idea-card .mini-tag { margin-left: 0; }
.idea-list { display: flex; flex-direction: column; gap: 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.slides { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 12px; }
.story { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px 10px; margin: 12px 0 0; display: flex; flex-direction: column; gap: 6px; }
.story legend { font-size: 13px; font-weight: 700; color: var(--ink-2); padding: 0 4px; }
.story textarea, .story input { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink); }

/* ---------- Курсове ---------- */
.course-head { display: flex; align-items: flex-start; gap: 14px; }
.course-pct { display: flex; flex-direction: column; align-items: flex-end; }
.course-pct b { font-family: var(--font-display); font-size: 30px; font-weight: var(--display-weight); line-height: 1; color: var(--accent-text, var(--accent)); }
.course-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px 28px; }
.step-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); font-size: 11px; font-weight: 800; margin-right: 8px; color: var(--muted); }
.course-notes { margin-top: 14px; border-top: 1px solid var(--line-soft); padding-top: 10px; }
.course-notes summary { cursor: pointer; font-weight: 700; color: var(--ink-2); min-height: 32px; display: flex; align-items: center; }
.course-notes textarea { width: 100%; margin-top: 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink); }

/* ---------- Финанси ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.stat-num { font-family: var(--font-display); font-weight: var(--display-weight); font-size: clamp(28px, 4vw, 38px); line-height: 1.1; margin: 8px 0 4px; }
.tx-list { display: flex; flex-direction: column; }
.tx { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 0; border: 0; border-top: 1px solid var(--line-soft); background: none; color: inherit; text-align: left; }
.tx:first-child { border-top: 0; }
.tx-ic { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.tx-ic.inv { background: #DCEFD9; color: #2F5E33; }
.tx-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tx-body .card-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-amt { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; }
.tx-amt .pos { color: #2F7A3A; }
[data-skin="mocha"] .tx-amt .pos { color: #9ED79A; }
.acc { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 0; border: 0; border-top: 1px solid var(--line-soft); background: none; color: inherit; text-align: left; }
.acc:first-of-type { border-top: 0; }
.acc span { display: flex; flex-direction: column; }
.acc-bal { font-variant-numeric: tabular-nums; }
.mini-nav { display: flex; align-items: center; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 6px 0; font-size: 14px; }
.bar { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: var(--accent-soft); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 99px; background: var(--accent); }

@media (max-width: 899px) {
  .page-head { align-items: flex-start; }
  .head-actions .btn.primary { min-height: 40px; padding: 0 14px; font-size: 14px; }
  .week-nav .icon-btn { width: 36px; height: 36px; }
  .week-range { font-size: 16px; min-width: 0; flex: 1; text-align: left; }
  .meals { grid-template-columns: 1fr; gap: 12px; }
  .recipe-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .recipe-card.add { min-height: 180px; }
  .bday-grid, .format-cols { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-row .stat:first-child { grid-column: 1 / -1; }
  .stat { padding: 16px; }
  .slides { grid-template-columns: 1fr; }
}
[data-skin="mocha"] .tx-ic.inv { background: rgba(158, 215, 154, .16); color: #9ED79A; }
