:root {
  --navy: #1B3060;
  --navy-d: #0e1d3d;
  --navy-l: #253d78;
  --orange: #E8712A;
  --orange-h: #cf5e1e;
  --orange-s: rgba(232, 113, 42, .12);
  --bg: #F2F5FA;
  --card: #fff;
  --border: #DDE3EF;
  --text: #1B2B4B;
  --muted: #6B7FA3;
  --dim: #C5CEDF;
  --green: #16A87C;
  --blue: #2E7CF6;
  --red: #E84545;
  --yellow: #F59E0B;
  --shadow: 0 2px 16px rgba(27, 48, 96, .09);
  --shadow-md: 0 6px 32px rgba(27, 48, 96, .14);
  --r: 14px;
  --rs: 8px;
  --tr: .2s ease;
  --accent: var(--orange);
  --accent-h: var(--orange-h);
  --accent-s: var(--orange-s);
  --ring-glow: rgba(232, 113, 42, .22);
  --purple: #8B5CF6;
  --ec-color: var(--orange);
  /* Дефолтный цвет для карточек событий */
}

body.m-short {
  --accent: #2E7CF6;
  --accent-h: #1a6ae0;
  --accent-s: rgba(46, 124, 246, .12);
  --ring-glow: rgba(46, 124, 246, .2)
}

body.m-long {
  --accent: #16A87C;
  --accent-h: #118a65;
  --accent-s: rgba(22, 168, 124, .12);
  --ring-glow: rgba(22, 168, 124, .2)
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

html {
  height: 100%;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif
}

a {
  text-decoration: none
}

/* ── HEADER ── */
header {
  background: var(--navy);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  width: 100%;
  max-width: 960px;
  border-radius: 0 0 var(--r) var(--r);
  position: sticky;
  top: 0;
  z-index: 50;
  /* для фиксации при скролле */
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  flex-shrink: 0
}

.logo-mark {
  width: 32px;
  height: 32px;
  background: var(--orange);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0
}

.logo-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1
}

.logo-tagline {
  font-size: 9px;
  color: rgba(255, 255, 255, .45);
  letter-spacing: .05em;
  margin-top: 1px
}

.hdr-sep {
  flex: 1
}

.hdr-quote {
  font-size: 11px;
  color: rgba(255, 255, 255, .5);
  font-style: italic;
  max-width: 280px;
  display: none
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media(min-width:700px) {
  .hdr-quote {
    display: block
  }
}

.hdr-tools {
  display: flex;
  gap: 5px;
  flex-shrink: 0
}

.cd-logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.cd-logo-icon {
  width: 36px;
  height: 36px;
  background: var(--orange);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.cd-logo-text {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.cd-logo-sub {
  color: rgba(255, 255, 255, .5);
  font-size: 10px;
  letter-spacing: .05em;
}

.cd-wrap {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 48px;
}

/* ── STORAGE NOTICE ── */
.storage-notice {
  width: 100%;
  max-width: 980px;
  background: rgba(245, 158, 11, .1);
  border: 1px solid rgba(245, 158, 11, .3);
  border-radius: var(--rs);
  padding: 7px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #92680d;
  margin: 10px 16px 0
}

.storage-notice b {
  font-weight: 700
}

.sn-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: #92680d;
  font-size: 16px;
  line-height: 1;
  opacity: .6
}

.sn-close:hover {
  opacity: 1
}

/* ── APP GRID ── */
.app {
  width: 100%;
  max-width: 980px;
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 0;
  padding: 12px 16px;
  flex: 1
}

.col-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 14px;
  border-right: 1px solid var(--border)
}

.col-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 14px
}

/* ── MODE TABS ── */
.mode-tabs {
  display: flex;
  gap: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 4px;
  box-shadow: var(--shadow)
}

.mtab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  padding: 7px 4px;
  border-radius: var(--rs);
  cursor: pointer;
  transition: all var(--tr);
  white-space: nowrap
}

.mtab.on {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px var(--ring-glow)
}

.mtab:not(.on):hover {
  color: var(--text);
  background: var(--bg)
}

/* ── TIMER CARD ── */
.timer-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden
}

.timer-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transition: background var(--tr)
}

.ring-wrap {
  position: relative;
  width: 164px;
  height: 164px;
  display: flex;
  align-items: center;
  justify-content: center
}

.ring-svg {
  position: absolute;
  transform: rotate(-90deg)
}

.ring-bg {
  fill: none;
  stroke: var(--bg);
  stroke-width: 9
}

.ring-fg {
  fill: none;
  stroke: var(--accent);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 472;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke var(--tr)
}

.ring-center {
  text-align: center
}

.t-num {
  font-size: 44px;
  font-weight: 300;
  letter-spacing: -.02em;
  color: var(--text);
  line-height: 1;
  font-variant-numeric: tabular-nums
}

.t-lbl {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 3px
}

.controls {
  display: flex;
  align-items: center;
  gap: 10px
}





.dots {
  display: flex;
  gap: 6px
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  transition: all .3s
}

.dot.done {
  background: var(--accent)
}

.dot.now {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-s)
}

.info-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  width: 100%;
  padding-top: 10px
}

.info-row b {
  color: var(--text);
  font-weight: 600
}

/* Volume slider */
.vol-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  font-size: 11px;
  color: var(--muted)
}

.vol-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  outline: none;
  cursor: pointer
}

.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .2)
}

/* ── GOAL BAR ── */


.goal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px
}

.goal-lbl {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted)
}

.goal-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent)
}

.goal-bar {
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden
}

.goal-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width .6s ease
}

.goal-msg {
  font-size: 10px;
  color: var(--muted);
  margin-top: 5px;
  font-style: italic
}

/* ── PANEL ── */


.ph {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px 0
}

.ph-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted)
}

.pb {
  padding: 9px 14px 13px
}

/* ── STATS ── */
.stats4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px
}

.sbox {
  background: var(--bg);
  border-radius: var(--rs);
  padding: 10px 6px;
  text-align: center
}

.sv {
  font-size: 18px;
  font-weight: 300;
  color: var(--accent);
  line-height: 1;
  transition: color var(--tr)
}

.sv2 {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-top: 1px
}

.sl {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px
}

/* ── TASKS ── */
.tpl-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 9px
}

.tpl {
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--tr);
  display: flex;
  align-items: center;
  gap: 4px
}

.tpl:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-s)
}

.tpl-del {
  margin-left: 2px;
  opacity: .5;
  font-size: 11px;
  cursor: pointer
}

.tpl-del:hover {
  opacity: 1;
  color: var(--red)
}

.task-actions-row {
  display: flex;
  gap: 5px;
  margin-bottom: 8px
}

.task-add {
  display: flex;
  gap: 6px;
  margin-bottom: 6px
}

.tinput {
  flex: 1;
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--text);
  font-size: 12px;
  padding: 7px 10px;
  border-radius: var(--rs);
  outline: none;
  transition: border-color var(--tr)
}

.tinput::placeholder {
  color: var(--dim)
}

.tinput:focus {
  border-color: var(--accent)
}



.task-btn-sm {
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--muted);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--tr);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap
}

.task-btn-sm:hover {
  border-color: var(--accent);
  color: var(--accent)
}

/* Priority groups */
.task-groups {
  display: flex;
  flex-direction: column;
  gap: 0
}

.pgroup {
  margin-bottom: 4px
}

.pgroup-header {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 5px 6px 3px;
  display: flex;
  align-items: center;
  gap: 5px
}

.pgroup.g-q1 .pgroup-header {
  color: var(--red)
}

.pgroup.g-q2 .pgroup-header {
  color: var(--blue)
}

.pgroup.g-q3 .pgroup-header {
  color: var(--yellow)
}

.pgroup.g-q4 .pgroup-header {
  color: var(--muted)
}

.tlist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 2px
}

.tlist::-webkit-scrollbar {
  width: 2px
}

.tlist::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px
}

.titem {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 7px 9px;
  background: var(--bg);
  border: 1.5px solid transparent;
  border-radius: var(--rs);
  cursor: pointer;
  transition: all .18s;
  position: relative;
  user-select: none
}

.titem:hover {
  border-color: var(--dim);
  box-shadow: 0 1px 6px rgba(27, 48, 96, .08)
}

.titem.sel {
  border-color: var(--accent);
  background: var(--accent-s)
}

.titem.done .ttxt {
  text-decoration: line-through;
  color: var(--dim)
}

.titem.dragging {
  opacity: .5;
  border-style: dashed
}

.titem.drag-over {
  border-color: var(--accent);
  border-style: solid
}

/* Просроченные задачи */
.titem.overdue {
  background: rgba(232, 69, 69, 0.05);
  border-left: 3px solid var(--red);
}

.titem.overdue:hover {
  background: rgba(232, 69, 69, 0.1);
}

.toverdue {
  font-size: 12px;
  animation: pulse 2s infinite;
}

.tdate {
  font-size: 10px;
  color: var(--muted);
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.drag-handle {
  color: var(--dim);
  font-size: 13px;
  cursor: grab;
  flex-shrink: 0;
  margin-top: 1px;
  padding: 0 2px
}

.drag-handle:active {
  cursor: grabbing
}

.tcheck {
  width: 14px;
  height: 14px;
  border: 2px solid var(--dim);
  border-radius: 3px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  transition: all .18s;
  margin-top: 1px
}

.titem.done .tcheck {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff
}

.ttxt {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  word-break: break-word
}

.tpom {
  font-size: 9px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-s);
  padding: 1px 5px;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0
}

/* Task priority badges */
.tprio {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0
}

.tprio.q1 {
  background: rgba(232, 69, 69, .1);
  color: var(--red)
}

.tprio.q2 {
  background: rgba(46, 124, 246, .1);
  color: var(--blue)
}

.tprio.q3 {
  background: rgba(245, 158, 11, .1);
  color: var(--yellow)
}

.tprio.q4 {
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border)
}

/* Task micro-actions bar */
.tactions {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 5px;
  flex-wrap: wrap
}

.ta-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 5px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap
}

.ta-btn:hover {
  border-color: var(--accent);
  color: var(--accent)
}

.ta-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff
}

/* ── BRAND STRIP ── */
.brand-strip {
  background: linear-gradient(135deg, var(--navy-d) 0%, var(--navy) 60%, var(--navy-l) 100%);
  border-radius: var(--r);
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden
}

.brand-strip::before {
  content: '';
  position: absolute;
  right: -30px;
  top: -30px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(232, 113, 42, .12);
  pointer-events: none
}

.bs-icon {
  font-size: 26px;
  flex-shrink: 0
}

.bs-body {
  flex: 1
}

.bs-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 2px
}

.bs-title {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px
}

.bs-text {
  font-size: 10px;
  color: rgba(255, 255, 255, .5);
  line-height: 1.45
}



/* ── QUOTE ── */
.quote-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 14px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 8px
}

.q-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px
}

.q-text {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  font-style: italic;
  flex: 1
}

.q-author {
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
  margin-top: 3px;
  font-style: normal
}



/* ── ACHIEVEMENTS ── */
.ach-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px
}

.ach {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--rs);
  padding: 10px 7px;
  text-align: center;
  transition: all .2s
}

.ach.unlocked {
  border-color: var(--accent);
  background: var(--accent-s)
}

.ach.locked {
  opacity: .4;
  filter: grayscale(.7)
}

.ach-ico {
  font-size: 20px;
  margin-bottom: 3px
}

.ach-nm {
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1px
}

.ach-dc {
  font-size: 9px;
  color: var(--muted)
}

/* ── MODALS ── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 29, 61, .5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 12px
}

.overlay.open {
  display: flex
}

.modal {
  background: var(--card);
  border-radius: var(--r);
  width: 100%;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .2);
  animation: mIn .22s ease;
  max-height: 90vh;
  display: flex;
  flex-direction: column
}

@keyframes mIn {
  from {
    opacity: 0;
    transform: scale(.97) translateY(8px)
  }

  to {
    opacity: 1;
    transform: none
  }
}

.mw {
  max-width: 540px
}

.mn {
  max-width: 400px
}

.mxl {
  max-width: 660px
}

.mhd {
  background: var(--navy);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0
}

.mhd-title {
  color: #fff;
  font-size: 14px;
  font-weight: 700
}

.mclose {
  background: rgba(255, 255, 255, .15);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center
}

.mclose:hover {
  background: rgba(255, 255, 255, .3)
}

.mbody {
  padding: 18px;
  overflow-y: auto;
  flex: 1
}

.mftr {
  padding: 0 18px 18px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-shrink: 0
}

/* Mobile modals */
@media (max-width: 768px) {
  .overlay {
    padding: 8px;
    align-items: flex-end;
  }

  .modal {
    max-height: 95vh;
    border-radius: var(--r) var(--r) 0 0;
    width: 100%;
    max-width: 100%;
  }

  .mw,
  .mn,
  .mxl {
    max-width: 100%;
  }

  .mbody {
    padding: 14px;
  }

  .mftr {
    padding: 0 14px 14px;
    flex-wrap: wrap;
  }

  .mftr .btn-g,
  .mftr .btn-p {
    flex: 1;
    min-width: 80px;
  }

  /* Адаптация форм в модалках */
  .mbody .form-group[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  /* Адаптация кнопок приоритета */
  .q-picker {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .qp-btn {
    width: 100%;
    text-align: left;
    padding: 8px 12px;
  }

  /* Уменьшаем заголовок */
  .mhd {
    padding: 12px 14px;
  }

  .mhd-title {
    font-size: 13px;
  }
}

/* Settings */
.sg-ttl {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px
}

.srow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500
}

.srow:last-child {
  border-bottom: none
}

.sg {
  margin-bottom: 18px
}

.step {
  display: flex;
  align-items: center;
  gap: 7px
}

.step-btn {
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--text);
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s
}

.step-btn:hover {
  border-color: var(--accent);
  color: var(--accent)
}

.step-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  min-width: 24px;
  text-align: center
}

.step-val-input: { 
  width: 40px;
  border: none;
  text-align: center;
  font-family: inherit;
  font-weight: 700;
  background: transparent;
}

.tog {
  width: 38px;
  height: 21px;
  background: var(--border);
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  transition: background .2s;
  border: none;
  flex-shrink: 0
}

.tog::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 17px;
  height: 17px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2)
}

.tog.on {
  background: var(--accent)
}

.tog.on::after {
  transform: translateX(17px)
}





/* Goal mode selector */
.goal-mode-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap
}

.gm-btn {
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s
}

.gm-btn.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff
}

/* Report tabs */
.rtabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border-radius: var(--rs);
  padding: 3px;
  margin-bottom: 14px;
  flex-shrink: 0
}

.rtab {
  flex: 1;
  padding: 6px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all .18s
}

.rtab.on {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow)
}

/* Charts */
.sum-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px
}

.sc {
  background: var(--bg);
  border-radius: var(--rs);
  padding: 12px;
  text-align: center
}

.sc-icon {
  font-size: 18px;
  margin-bottom: 4px
}

.sc-val {
  font-size: 20px;
  font-weight: 300;
  color: var(--accent)
}

.sc-lbl {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px
}

.chart-wrap {
  position: relative;
  height: 150px;
  margin-bottom: 8px
}

.chart-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px
}

.cp-btn {
  padding: 4px 9px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all .2s
}

.cp-btn.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff
}

.cnav-btn {
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--muted);
  width: 24px;
  height: 24px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s
}

.cnav-btn:hover {
  border-color: var(--accent);
  color: var(--accent)
}

/* Detail table */
.dtbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px
}

.dtbl th {
  text-align: left;
  padding: 5px 7px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 2px solid var(--border)
}

.dtbl td {
  padding: 7px 7px;
  border-bottom: 1px solid var(--border)
}

.dtbl tr:last-child td {
  border-bottom: none
}

.dtbl tr:hover td {
  background: var(--bg)
}

/* Weekly popup */
.week-stats-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 14px
}

.wday {
  background: var(--bg);
  border-radius: var(--rs);
  padding: 8px 4px;
  text-align: center
}

.wday-lbl {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px
}

.wday-pom {
  font-size: 16px;
  font-weight: 300;
  color: var(--accent);
  line-height: 1
}

.wday-min {
  font-size: 9px;
  color: var(--muted);
  margin-top: 2px
}

.wday.today {
  border: 1.5px solid var(--accent)
}

/* Copy area */
.copy-area {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--rs);
  padding: 12px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 220px;
  overflow-y: auto;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif
}

/* Paste area */
.paste-area {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--rs);
  padding: 10px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
  outline: none;
  resize: vertical;
  min-height: 100px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif
}

.paste-area:focus {
  border-color: var(--accent)
}

/* Achievement popup */
.ach-popup {
  position: fixed;
  top: 66px;
  right: 16px;
  z-index: 300;
  background: var(--navy);
  color: #fff;
  border-radius: var(--r);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .3);
  transform: translateX(120%);
  transition: transform .4s cubic-bezier(.34, 1.56, .64, 1);
  max-width: 270px;
  border-left: 4px solid var(--orange)
}

.ach-popup.show {
  transform: translateX(0)
}

.ach-emo {
  font-size: 26px;
  flex-shrink: 0
}

.ach-body-ttl {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 2px
}

.ach-nm {
  font-size: 13px;
  font-weight: 700
}

.ach-dc {
  font-size: 10px;
  color: rgba(255, 255, 255, .6);
  margin-top: 1px
}

/* Focus mode */
.focus-mode {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--navy-d);
  z-index: 300;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px
}

.focus-mode.open {
  display: flex
}

.focus-num {
  font-size: 96px;
  font-weight: 200;
  letter-spacing: -.04em;
  color: #fff;
  font-variant-numeric: tabular-nums;
  line-height: 1
}

.focus-sub {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .4)
}

.focus-task {
  font-size: 13px;
  color: rgba(255, 255, 255, .6);
  margin-top: 4px
}

.focus-close {
  position: absolute;
  top: 18px;
  right: 18px
}

/* Notification permission banner */
.notif-banner {
  background: rgba(46, 124, 246, .08);
  border: 1px solid rgba(46, 124, 246, .25);
  border-radius: var(--rs);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #1a4a8a;
  margin-bottom: 6px
}

.notif-banner button {
  background: var(--blue);
  border: none;
  color: #fff;
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer
}

/* Toast */
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: var(--navy);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: 28px;
  z-index: 400;
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25)
}

.toast.show {
  transform: translateX(-50%) translateY(0)
}

/* На мобильной версии toast не показываем, чтобы не мешал меню */
@media (max-width: 768px) {
  .toast {
    display: none;
  }
}



/* KB */
.kb-tbl {
  width: 100%;
  border-collapse: collapse
}

.kb-tbl tr {
  border-bottom: 1px solid var(--border)
}

.kb-tbl tr:last-child {
  border-bottom: none
}

.kb-tbl td {
  padding: 7px 9px;
  font-size: 12px
}

kbd {
  display: inline-block;
  padding: 1px 6px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 4px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
  box-shadow: 0 2px 0 var(--border)
}

.kb-action {
  color: var(--muted);
  font-size: 11px
}

/* ── PiP MINI WINDOW ── */
#pip-window {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(160deg, #0e1d3d 0%, #1B3060 100%);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  padding: 12px;
  gap: 8px;
  box-sizing: border-box;
}

#pip-mode {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .45);
  margin-bottom: 2px
}

#pip-time {
  font-size: 52px;
  font-weight: 200;
  letter-spacing: -.03em;
  color: #fff;
  font-variant-numeric: tabular-nums;
  line-height: 1
}

#pip-task {
  font-size: 10px;
  color: rgba(255, 255, 255, .5);
  max-width: 200px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

#pip-ring-wrap {
  position: relative;
  width: 100px;
  height: 100px
}

#pip-ring-wrap svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg)
}

#pip-controls {
  display: flex;
  gap: 8px;
  margin-top: 4px
}



#pip-progress-bar {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, .15);
  border-radius: 2px;
  overflow: hidden
}

#pip-progress-fill {
  height: 100%;
  background: #E8712A;
  border-radius: 2px;
  transition: width 1s linear
}

#pip-pom {
  font-size: 10px;
  color: rgba(255, 255, 255, .4)
}

.pip-scale-row {
  display: flex;
  align-items: center;
  gap: 6px;
  position: absolute;
  bottom: 8px;
  right: 8px
}

.pip-scale-btn {
  background: rgba(255, 255, 255, .1);
  border: none;
  color: rgba(255, 255, 255, .6);
  width: 22px;
  height: 22px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center
}

.pip-scale-btn:hover {
  background: rgba(255, 255, 255, .22);
  color: #fff
}

.pip-opacity-row {
  display: flex;
  align-items: center;
  gap: 5px;
  position: absolute;
  bottom: 8px;
  left: 8px;
  font-size: 9px;
  color: rgba(255, 255, 255, .4)
}

.pip-opa-slider {
  width: 50px;
  -webkit-appearance: none;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .3);
  outline: none;
  cursor: pointer
}

.pip-opa-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #E8712A;
  cursor: pointer
}

footer {
  width: 100%;
  max-width: 980px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 14px;
  font-size: 10px;
  color: var(--dim)
}

footer a {
  color: var(--muted)
}

footer a:hover {
  color: var(--orange)
}

@media(max-width:680px) {
  .app {
    grid-template-columns: 1fr;
    padding: 8px
  }

  .col-left {
    padding-right: 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px
  }

  .col-right {
    padding-left: 0
  }

  .stats4 {
    grid-template-columns: repeat(2, 1fr)
  }

  .focus-num {
    font-size: 68px
  }
}

/* ==========================================================================
   БАЗОВЫЕ КОМПОНЕНТЫ (DESIGN SYSTEM)
   ========================================================================== */

/* ── CARD SYSTEM ── */
.card-base {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-base--compact { border-radius: var(--rs); }
.card-base--thick { border-width: 1.5px; }
.card-base--no-shadow { box-shadow: none; }
.card-base--dashed { border-style: dashed; }
.card-base--bg-muted { background: var(--bg); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-head {
  padding: 18px 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body {
  padding: 16px 22px 22px;
}

.card-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── BUTTON SYSTEM ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: var(--rs);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--tr);
  white-space: nowrap;
  text-decoration: none;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover { background: var(--accent-h); }

.btn--secondary {
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--muted);
}
.btn--secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn--ghost {
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .15);
  color: rgba(255, 255, 255, .75);
}
.btn--ghost:hover {
  background: rgba(255, 255, 255, .2);
  color: #fff;
}

.btn--blue {
  background: var(--blue);
  color: #fff;
}

/* Button sizes */
.btn--xs { height: 26px; font-size: 11px; padding: 5px; }
.btn--sm { height: 32px; font-size: 13px; padding: 5px; }
.btn--md { padding: 8px 18px; font-size: 12px; }
.btn--lg { height: 54px; font-size: 20px; padding: 5px; border-radius: 13px; }
.btn--icon { padding: 6px 10px; font-size: 11px; }

/* Legacy button aliases for backward compatibility */
.btn-p {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 8px 18px;
  border-radius: var(--rs);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--tr);
}
.btn-p:hover { background: var(--accent-h); }

.btn-g {
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--muted);
  padding: 8px 18px;
  border-radius: var(--rs);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--tr);
}
.btn-g:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-blue {
  background: var(--blue);
  border: none;
  color: #fff;
  padding: 8px 18px;
  border-radius: var(--rs);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--tr);
}

/* ── FORM CONTROLS ── */
.form-control {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--rs);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  outline: none;
  transition: border-color var(--tr);
}
.form-control:focus { border-color: var(--accent); }
.form-control::placeholder { color: var(--dim); }

.form-control--input { padding: 7px 10px; font-size: 12px; }
.form-control--select { padding: 5px 9px; font-size: 12px; cursor: pointer; }
.form-control--textarea { padding: 10px; font-size: 12px; line-height: 1.6; resize: vertical; }
.form-control--full { width: 100%; }

/* Legacy aliases for backward compatibility */
.minput {
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--text);
  padding: 7px 10px;
  border-radius: var(--rs);
  font-size: 13px;
  outline: none;
  width: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}
.minput:focus { border-color: var(--accent); }
.minput[type="time"] { cursor: pointer; }

.msel {
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--text);
  padding: 5px 9px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}
.msel:focus { border-color: var(--accent); }

/* ==========================================================================
   ОБЩИЕ КОМПОНЕНТЫ (ДЛЯ ВСЕХ СЕРВИСОВ)
   ========================================================================== */

/* ── БОКОВАЯ НАВИГАЦИЯ (NAV DOCK) ── */
.app-nav-dock {
  position: fixed;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--rs);
  padding: 8px;
  box-shadow: var(--shadow);
}

.nav-dock-item {
  width: 48px;
  height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  transition: all var(--tr);
  border: 1.5px solid transparent;
  cursor: pointer;
  background: var(--bg);
  font-size: 20px;
}

.nav-dock-item:hover {
  color: var(--orange);
  border-color: var(--orange);
  background: var(--orange-s);
}

.nav-dock-item.active {
  background: var(--orange-s);
  color: var(--orange);
  border-color: var(--orange);
}

.nav-dock-item-label {
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-align: center;
  max-width: 42px;
  line-height: 1.1;
  color: inherit;
}

@media (max-width: 768px) {
  .app-nav-dock {
    bottom: 16px;
    top: auto;
    right: 50%;
    transform: translateX(50%);
    flex-direction: row;
    border-radius: 24px;
    padding: 6px 10px;
  }

  .nav-dock-item {
    width: 44px;
    height: 44px;
  }
}

#bsTitle,
#bsText {
  transition: opacity 0.3s ease;
}

.brand-strip {
  /* Добавим минимальную высоту, чтобы страница не прыгала при смене текста */
  min-height: 80px;
}

/* Главный блок (Featured) */
.featured {
  background: linear-gradient(135deg, var(--navy), #0f172a);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 24px;
  padding: 48px 32px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
}

.featured::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(232, 113, 42, .25), transparent);
  pointer-events: none;
}

.feat-name {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 12px;
}

.feat-title {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.feat-date {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, .5);
  margin-bottom: 40px;
}

/* Обратный отсчёт - Шаблоны */
.preset-btn.holiday-btn {
  display: inline-block;
  min-width: 120px;
  text-align: center;
}

.presets--grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.countdown-blocks {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.cb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 16px;
  padding: 18px 22px;
  min-width: 90px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .1), inset 0 1px 0 rgba(255, 255, 255, .05);
  backdrop-filter: blur(10px);
}

.cb-num {
  font-size: 48px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -2px;
  text-shadow: 0 4px 12px rgba(0, 0, 0, .2);
}

.cb-lbl {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .4);
}

.cb-sep {
  font-size: 40px;
  font-weight: 200;
  color: rgba(255, 255, 255, .1);
  line-height: 1;
  align-self: center;
  padding-bottom: 16px;
}

.feat-done {
  font-size: 32px;
  font-weight: 300;
  color: var(--orange);
  display: none;
}

.feat-progress {
  margin-top: 28px;
}

.prog-bar {
  height: 4px;
  background: rgba(255, 255, 255, .1);
  border-radius: 2px;
  overflow: hidden;
}

.prog-fill {
  height: 100%;
  background: var(--orange);
  border-radius: 2px;
  transition: width .5s ease;
}

.prog-pct {
  font-size: 11px;
  color: rgba(255, 255, 255, .3);
  margin-top: 6px;
  text-align: right;
}

/* Сетка событий */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.event-card {
  background: linear-gradient(145deg, var(--card), var(--bg));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 18px;
  z-index: 1;
}

.event-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--ec-color);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.event-card::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  right: 0;
  background: var(--ec-color);
  opacity: 0.02;
  z-index: -1;
  transition: opacity 0.3s;
}

.event-card:hover {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  transform: translateY(-4px);
}

.event-card:hover::before {
  width: 6px;
}

.event-card:hover::after {
  opacity: 0.05;
}

.event-card.done {
  opacity: 0.6;
  filter: grayscale(0.5);
}

.event-card.done .mc-num {
  color: var(--muted);
}

.ec-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 2px;
}

.ec-emoji {
  width: 46px;
  height: 46px;
  background: var(--ec-color);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.ec-info {
  flex: 1;
  min-width: 0;
}

.ec-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.ec-date {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.ec-actions {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity .15s;
}

.event-card:hover .ec-actions {
  opacity: 1;
}

.ec-act {
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ec-act:hover {
  border-color: var(--ec-color);
  color: var(--ec-color);
  background: var(--card);
  transform: scale(1.1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.mini-countdown {
  display: flex;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  align-items: center;
}

.mc {
  text-align: center;
}

.mc-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--ec-color);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -1px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.mc-lbl {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}

.mc-sep {
  font-size: 20px;
  font-weight: 300;
  color: var(--dim);
  line-height: 1;
  align-self: flex-start;
  margin-top: 2px;
}

.ec-done-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(22, 168, 124, .1);
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(22, 168, 124, .2);
}

.ec-past-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(232, 69, 69, .1);
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(232, 69, 69, .2);
}

/* Фильтры и формы таймера */
.ftabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.ftabs::-webkit-scrollbar {
  display: none;
}

.ftab {
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  border-radius: 20px;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}

.ftab.on {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
  box-shadow: 0 4px 12px var(--orange-s);
}

.section-title {
  grid-column: 1 / -1;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 24px 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::after {
  content: '';
  height: 1px;
  background: var(--border);
  flex: 1;
}

.form-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  display: block;
}

.form-group {
  margin-bottom: 16px;
}

.emoji-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ep {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}

.ep.sel,
.ep:hover {
  border-color: var(--orange);
  background: var(--orange-s);
}

.color-row {
  display: flex;
  gap: 8px;
}

.cp {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: border-color .15s;
}

.cp.sel {
  border-color: var(--text);
}

.presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.preset-btn {
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--muted);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}

.preset-btn:hover {
  border-color: var(--orange);
  color: var(--orange);
}

/* ==========================================================================
   МИКРО-СЕРВИС: ТРЕКЕР ПРИВЫЧЕК (HABIT TRACKER)
   ========================================================================== */

/* Сетка недели: 1 колонка под название (200px) + 7 колонок под дни */
.week-days,
.hrow {
  display: grid;
  grid-template-columns: 200px repeat(7, 1fr);
  gap: 0;
  align-items: center;
}

.wd-cell {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 8px;
}

.wd-cell.today {
  color: var(--orange);
}

.hrow {
  background: var(--bg);
  border-radius: var(--rs);
  margin-bottom: 4px;
  border: 1.5px solid transparent;
  transition: var(--tr);
}

.hrow:hover {
  border-color: var(--dim);
}

.hname {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
}

.hname span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hstreak {
  font-size: 10px;
  font-weight: 700;
  color: var(--orange);
}

/* Чекбоксы привычек */
.hcell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
}

.hcheck {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all .2s;
}

.hcheck.done {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

.hcheck.future {
  opacity: .3;
  cursor: not-allowed;
}

.hcheck.missed {
  background: rgba(232, 69, 69, .05);
  border-color: rgba(232, 69, 69, .2);
}

/* Эмодзи пикер */
.emoji-pick {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.ep {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--tr);
}

.ep.sel,
.ep:hover {
  border-color: var(--orange);
  background: var(--orange-s);
}

/* Статистика */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.sval {
  font-size: 28px;
  font-weight: 300;
  color: var(--orange);
  line-height: 1;
}

.slbl {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}

@media(max-width: 650px) {

  .week-days,
  .hrow {
    grid-template-columns: 120px repeat(7, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Кнопки выбора (Frequency & Sound) */
.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.choice-btn {
  background: var(--card);
  border: 1.5px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--rs);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
}

.choice-btn:hover {
  border-color: var(--orange);
  color: var(--orange);
}

.choice-btn.on {
  background: var(--orange-s);
  border-color: var(--orange);
  color: var(--orange);
}

/* Выпадающие списки и инпуты времени */
.minput[type="time"] {
  cursor: pointer;
}

/* Habit-tracker specific msel variant */
.msel {
  width: 100%;
}

/* Шаблоны привычек */
.habit-templates { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.habit-templates .preset-btn { 
  background: var(--bg); border: 1.5px solid var(--border); border-radius: 12px; 
  padding: 8px 14px; font-size: 11px; font-weight: 600; cursor: pointer; 
  transition: all .2s; color: var(--text); display: flex; align-items: center; gap: 6px;
}
.habit-templates .preset-btn:hover { border-color: var(--orange); background: #fff; transform: translateY(-2px); box-shadow: var(--shadow-sm); }


/* ==========================================================================
   МИКРО-СЕРВИС: ТАЙМ-ТРЕКЕР (TIME TRACKER)
   ========================================================================== */

.tt-timer-display {
  font-size: 48px;
  font-weight: 200;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
  margin: 10px 0;
}

.tt-timer-display.running {
  color: var(--orange);
  animation: pulse-text 2s infinite;
}

@keyframes pulse-text {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }

  100% {
    opacity: 1;
  }
}

/* Сетка записей (Entries) */
.entries-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.entry-card {
  display: grid;
  grid-template-columns: 4px 120px 1fr 100px 80px 30px;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  padding: 12px;
  border-radius: var(--rs);
  transition: var(--tr);
}

.entry-card:hover {
  background: var(--card);
  box-shadow: var(--shadow);
  transform: scale(1.01);
}

.entry-proj {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-desc {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.entry-time {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
}

.entry-dur {
  font-size: 14px;
  font-weight: 700;
  color: var(--orange);
  text-align: right;
}

/* Полоски прогресса проектов */
.proj-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.pb-name {
  font-size: 12px;
  font-weight: 600;
  width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pb-track {
  flex: 1;
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}

.pb-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
}

@media (max-width: 768px) {
  .entry-card {
    grid-template-columns: 4px 1fr 80px 30px;
  }

  .entry-proj,
  .entry-time {
    display: none;
  }
}

/* ==========================================================================
   МИКРО-СЕРВИС: ТКАНЬ ДНЯ (FABRIC OF DAY)
   ========================================================================== */

/* Контейнер таймлайна */
.fabric-tapestry {
  position: relative;
  padding-left: 60px;
  margin: 20px 0;
  border-left: 2px solid var(--border);
}

/* Часовые метки */
.fabric-hour-mark {
  position: absolute;
  left: -65px;
  width: 50px;
  text-align: right;
  font-size: 11px;
  font-weight: 700;
  color: var(--dim);
}

/* Блоки активности */
.f-block {
  margin-bottom: 8px;
  padding: 12px 16px;
  border-radius: var(--rs);
  background: var(--card);
  border: 1px solid var(--border);
  position: relative;
  transition: var(--tr);
  display: flex;
  align-items: center;
  gap: 12px;
}

.f-block:hover {
  transform: translateX(5px);
  box-shadow: var(--shadow);
}

/* Индикаторы источников */
.f-indicator {
  width: 4px;
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  border-radius: 0 4px 4px 0;
}

.f-source-pom {
  background: var(--orange);
}

.f-source-track {
  background: var(--blue);
}

.f-source-habit {
  background: var(--green);
}

.f-source-manual {
  background: var(--navy-l);
}

.f-time {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  min-width: 45px;
}

.f-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.f-tag {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg);
  color: var(--muted);
}

/* Аналитика плотности */
.density-meter {
  height: 12px;
  background: var(--bg);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  margin: 15px 0;
}

.density-fill {
  height: 100%;
  transition: width 1s ease;
}

/* Статистика плотности */
.density-stat {
  font-size: 12px;
  color: var(--muted);
}

.density-stat b {
  color: var(--text);
  font-weight: 700;
}

/* Легенда плотности */
.density-legend {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.dl-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
}

.dl-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ── ОБНОВЛЕННЫЙ ТАЙМЛАЙН ── */
.fabric-container {
  position: relative;
  padding: 20px 0;
  margin-left: 100px;
  /* Отступ для временны́х меток (left: -80px) */
}

/* Вертикальная нить (линия) */
.fabric-line {
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
  z-index: 1;
}

.fabric-item {
  position: relative;
  margin-bottom: 20px;
  padding-left: 50px;
  z-index: 2;
}

/* Точка на линии */
.fabric-dot {
  position: absolute;
  left: 12px;
  top: 14px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--card);
  border: 3px solid var(--orange);
  box-shadow: 0 0 0 4px var(--bg);
}

.fabric-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--rs);
  padding: 12px 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 15px;
  transition: var(--tr);
}

.fabric-card:hover {
  transform: translateX(5px);
  box-shadow: var(--shadow-md);
}

/* Кнопка удаления ручной заметки */
.fabric-card-del {
  background: none;
  border: none;
  color: var(--dim);
  font-size: 14px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s;
  padding: 0 2px;
  flex-shrink: 0;
}

.fabric-card:hover .fabric-card-del {
  opacity: 1;
}

.fabric-card-del:hover {
  color: var(--red);
}

/* Временна́я метка */
.f-time-label {
  position: absolute;
  left: -80px;
  top: 14px;
  width: 60px;
  text-align: right;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

/* Иконка источника */
.f-source-icon {
  font-size: 20px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: 8px;
  flex-shrink: 0;
}

/* Цвета точек для разных типов */
.dot-pom {
  border-color: var(--orange);
}

.dot-track {
  border-color: var(--blue);
}

.dot-habit {
  border-color: var(--green);
}

.dot-manual {
  border-color: var(--purple);
}

.dot-gap {
  border-color: var(--muted);
  opacity: 0.5;
}

/* Вступительная сетка по типам нитей */
.intro-threads {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.thread-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--rs);
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
}

.thread-stripe {
  width: 4px;
  min-height: 36px;
  border-radius: 2px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Ручной ввод */
.manual-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.manual-row .minput {
  min-width: 0;
}

.manual-row .minput-time {
  width: 110px;
  flex-shrink: 0;
}

/* Пустое состояние */
.fabric-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}

.fabric-empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.fabric-empty-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.fabric-empty-sub {
  font-size: 12px;
  line-height: 1.6;
}

/* ── FABRIC OF DAY: EDIT/DELETE BUTTONS ────────────────────────────── */
.fabric-card-edit {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all 0.2s;
  opacity: 0.6;
}

.fabric-card-edit:hover {
  opacity: 1;
  background: rgba(232, 113, 42, 0.1);
  transform: scale(1.2);
}

.fabric-card-del {
  opacity: 0.6;
}

.fabric-card-del:hover {
  opacity: 1;
}

.fabric-item:hover .fabric-card-edit,
.fabric-item:hover .fabric-card-del {
  opacity: 1;
}

/* ── FABRIC OF DAY: GAP (PERIODS) STYLES ───────────────────────────── */
.fabric-item.gap {
  opacity: 1;
}

.fabric-item.gap .fabric-card {
  background: repeating-linear-gradient(-45deg,
      #fff,
      #fff 8px,
      rgba(128, 128, 128, 0.08) 8px,
      rgba(128, 128, 128, 0.08) 16px);
  border: 2px dashed rgba(128, 128, 128, 0.4);
  position: relative;
}

.fabric-item.gap .fabric-card::before {
  content: '☕';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
  opacity: 0.3;
}

.fabric-item.gap .f-text {
  font-style: italic;
  color: var(--muted);
  font-weight: 500;
}

.fabric-item.gap .f-time-label {
  color: var(--dim);
  font-weight: 600;
}

.fabric-item.gap .fabric-dot {
  border-color: var(--muted);
  opacity: 0.5;
}

@media (max-width: 600px) {
  .intro-threads {
    grid-template-columns: 1fr;
  }

  .fabric-container {
    margin-left: 70px;
  }

  .manual-row {
    flex-direction: column;
    align-items: stretch;
  }

  .manual-row .minput-time {
    width: 100%;
  }
}

/* ==========================================================================
   UTILITY CLASSES (УТИЛИТЫ)
   ========================================================================== */

/* ── BORDER UTILITIES ── */
.border { border: 1px solid var(--border); }
.border--thick { border: 1.5px solid var(--border); }
.border--dashed { border: 1px dashed var(--border); }
.border--top { border-top: 1px solid var(--border); }
.border--right { border-right: 1px solid var(--border); }
.border--bottom { border-bottom: 1px solid var(--border); }
.border--left { border-left: 1px solid var(--border); }

/* Semantic borders */
.border--accent { border-color: var(--accent); }
.border--warning { border: 1px solid rgba(245, 158, 11, .3); }
.border--glass { border: 1px solid rgba(255, 255, 255, .15); }

/* ── SPACING UTILITIES ── */
.p-0 { padding: 0; }
.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-5 { padding: 24px; }

.m-0 { margin: 0; }
.m-1 { margin: 4px; }
.m-2 { margin: 8px; }
.m-3 { margin: 12px; }
.m-4 { margin: 16px; }
.m-5 { margin: 24px; }

/* ── DISPLAY UTILITIES ── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.w-full { width: 100%; }
.h-full { height: 100%; }

/* ═════════════════════════════════════════════════════════════════════════════
   PWA IN-APP TABS
   ═════════════════════════════════════════════════════════════════════════════ */

.app-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--rs) var(--rs) 0 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  transition: all var(--tr);
  user-select: none;
}

.app-tab:hover {
  background: var(--card);
  color: var(--text);
}

.app-tab.active {
  background: var(--card);
  color: var(--accent);
  border-bottom-color: var(--card);
  font-weight: 600;
}

.app-tab-title {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-tab-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
  transition: all var(--tr);
  padding: 0;
}

.app-tab-close:hover {
  background: var(--orange-s);
  color: var(--orange);
}

.app-tab-content {
  width: 100%;
  height: 100%;
  border: none;
  display: none;
}
