/* ============================================================
   КОНТЕНТ ЗАВОД — mini-app / layout base
   Каркас, сетки и адаптив. Финальная визуальная тема «бумага,
   тушь, оранжевый» лежит в theme-paper.css и загружается после.
   ============================================================ */

:root {
  --brand: #6d5efc;
  --brand-2: #a78bfa;
  --brand-3: #4f46e5;
  --bg: #0a0916;
  --bg-2: #0e0c1e;
  --surface: #141227;
  --surface-2: #1a1730;
  --surface-3: #211d3d;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f6f4ff;
  --muted: #a7a1c7;
  --muted-2: #7d7799;
  --ok: #34d399;
  --ok-bg: rgba(52, 211, 153, 0.12);
  --warn: #fbbf24;
  --warn-bg: rgba(251, 191, 36, 0.12);
  --bad: #fb7185;
  --bad-bg: rgba(251, 113, 133, 0.12);
  --info: #60a5fa;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 18px 50px -24px rgba(0, 0, 0, 0.85);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(1000px 500px at 85% -10%, rgba(109, 94, 252, 0.22), transparent 60%),
    radial-gradient(700px 380px at -10% 10%, rgba(167, 139, 250, 0.12), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  min-height: 100vh;
  min-height: 100dvh;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
}

h1,
h2,
h3,
p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

svg {
  display: block;
}

::selection {
  background: var(--brand);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ——— Каркас ——— */

.app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(var(--safe-top) + 14px) 16px calc(var(--safe-bottom) + 118px);
  position: relative;
}

.view {
  position: relative;
}

.screen {
  animation: fade-up 0.32s cubic-bezier(0.22, 0.8, 0.28, 1);
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-out {
  to {
    opacity: 0;
    transform: translateY(-6px);
  }
}

/* ——— Шапка ——— */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 12px;
  background: linear-gradient(140deg, var(--brand-2), var(--brand-3) 55%, #2e2470);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px -10px rgba(109, 94, 252, 0.9);
  position: relative;
  overflow: hidden;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: -30%;
  background: linear-gradient(
    115deg,
    transparent 40%,
    rgba(255, 255, 255, 0.5) 50%,
    transparent 60%
  );
  transform: translateX(-70%);
  animation: sheen 5.5s ease-in-out infinite;
}

@keyframes sheen {
  0%,
  60% {
    transform: translateX(-70%);
  }
  85%,
  100% {
    transform: translateX(70%);
  }
}

.brand-mark span {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.5px;
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
  position: relative;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-title {
  font-weight: 750;
  font-size: 19px;
  letter-spacing: -0.4px;
  line-height: 1.1;
  white-space: nowrap;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  transition:
    transform 0.12s ease,
    background 0.2s ease,
    color 0.2s ease;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--surface-3);
}

.icon-btn:active {
  transform: scale(0.96);
}

.avatar {
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(140deg, #7c6cff, #4636b8);
  overflow: hidden;
  flex: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.avatar-btn {
  width: 38px;
  height: 38px;
  font-size: 14px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    0 0 0 3px rgba(109, 94, 252, 0.18);
  transition: transform 0.12s ease;
}

.avatar-btn:active {
  transform: scale(0.95);
}

/* ——— Типографика экранов ——— */

.eyebrow {
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}

.screen-head {
  padding: 2px 2px 10px;
}

.screen-head h1 {
  font-size: 26px;
  line-height: 1.12;
  letter-spacing: -0.8px;
  font-weight: 780;
  margin-top: 6px;
}

.screen-head p {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 8px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 22px 2px 10px;
}

.section-head h2 {
  font-size: 16.5px;
  letter-spacing: -0.3px;
  font-weight: 700;
}

.hint {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.link {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--brand-2);
  padding: 2px;
  white-space: nowrap;
}

.link:hover {
  color: #c9c1ff;
}

/* ——— Карточки ——— */

.card {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  position: relative;
}

.card + .card {
  margin-top: 12px;
}

.card.tight {
  padding: 14px;
}

.card.list {
  padding: 4px 16px;
}

.card.cal-card {
  padding: 16px;
}

.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.card-title h3 {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ——— Списки ——— */

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.row:last-child {
  border-bottom: 0;
}

.row.static,
.post-row {
  cursor: default;
}

.row-main {
  flex: 1;
  min-width: 0;
}

.row-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.row-sub {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-end {
  flex: none;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.chev {
  flex: none;
  color: var(--muted-2);
  display: grid;
  place-items: center;
}

.tile {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(109, 94, 252, 0.14);
  border: 1px solid rgba(109, 94, 252, 0.18);
  color: #beb4ff;
}

.tile svg {
  width: 18px;
  height: 18px;
}

.tile-sm {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.task-line {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 2px 0;
}

.task-line:last-child {
  border-bottom: 0;
}

.task-line .row {
  flex: 1;
  min-width: 0;
  border-bottom: 0;
  padding: 10px 0;
}

.advance {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--muted);
  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    transform 0.12s ease;
}

.advance:hover {
  background: rgba(109, 94, 252, 0.22);
  border-color: rgba(109, 94, 252, 0.45);
  color: #fff;
}

.advance:active {
  transform: scale(0.94);
}

.done-check {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ok-bg);
  border: 1px solid rgba(52, 211, 153, 0.25);
  color: var(--ok);
}

/* ——— Пилюли и чипы ——— */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  background: var(--surface-3);
  color: var(--muted);
  border: 1px solid var(--line);
  white-space: nowrap;
  line-height: 1.2;
}

.pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.pill.brand {
  background: rgba(109, 94, 252, 0.15);
  color: #beb4ff;
  border-color: rgba(109, 94, 252, 0.3);
}

.pill.ok {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: rgba(52, 211, 153, 0.25);
}

.pill.warn {
  background: var(--warn-bg);
  color: var(--warn);
  border-color: rgba(251, 191, 36, 0.25);
}

.pill.bad {
  background: var(--bad-bg);
  color: var(--bad);
  border-color: rgba(251, 113, 133, 0.25);
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -16px;
  padding: 2px 16px 10px;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip-btn {
  flex: none;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease;
}

.chip-btn.is-active {
  background: rgba(109, 94, 252, 0.2);
  border-color: rgba(109, 94, 252, 0.45);
  color: #d6d0ff;
}

/* ——— Кнопки ——— */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 650;
  font-size: 14.5px;
  transition:
    transform 0.12s ease,
    filter 0.2s ease,
    background 0.2s ease;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.975);
}

.btn-primary {
  background: linear-gradient(135deg, #7c6cff, #5b49e8);
  color: #fff;
  box-shadow:
    0 12px 28px -12px rgba(109, 94, 252, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn-primary:disabled {
  filter: grayscale(0.4) brightness(0.7);
  cursor: default;
}

.btn-soft {
  background: rgba(109, 94, 252, 0.14);
  color: #c9c1ff;
  border: 1px solid rgba(109, 94, 252, 0.24);
}

.btn-ghost {
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-danger {
  background: var(--bad-bg);
  color: var(--bad);
  border: 1px solid rgba(251, 113, 133, 0.3);
}

.btn-danger.is-armed {
  background: var(--bad);
  color: #1a0308;
  border-color: var(--bad);
}

.btn-block {
  width: 100%;
}

.btn-link {
  color: var(--brand-2);
  font-weight: 600;
  font-size: 13.5px;
  padding: 8px;
}

.btn-row {
  display: flex;
  gap: 8px;
}

.btn-row .btn {
  flex: 1;
}

/* ——— Герой ——— */

.hero-card {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(420px 220px at 100% 0%, rgba(139, 123, 255, 0.35), transparent 65%),
    linear-gradient(160deg, #241f4d 0%, #16132c 55%, #121026 100%);
  border: 1px solid rgba(139, 123, 255, 0.22);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.hero-copy {
  min-width: 0;
}

.hero-card h1 {
  font-size: 26px;
  text-wrap: balance;
  line-height: 1.12;
  letter-spacing: -0.8px;
  font-weight: 780;
  margin-top: 6px;
}

.hero-card p {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 8px;
  max-width: 300px;
}

.ring {
  position: relative;
  width: 86px;
  height: 86px;
  flex: none;
  display: grid;
  place-items: center;
}

.ring svg {
  display: block;
}

.ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.05;
}

.ring-label b {
  font-size: 20px;
  letter-spacing: -0.6px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.ring-label span {
  font-size: 9.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.hero-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.hero-time {
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.hero-actions .btn {
  flex: 1;
  padding-inline: 10px;
}

/* ——— Метрики ——— */

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.stats.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
}

.stat-label {
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-value {
  font-size: 21px;
  font-weight: 760;
  letter-spacing: -0.5px;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.stat-sub {
  font-size: 11px;
  color: var(--muted-2);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ——— Загрузка / прогресс ——— */

.load-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 9px 0;
}

.load-row + .load-row {
  border-top: 1px solid var(--line);
}

.load-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.load-top span {
  font-size: 13px;
  color: var(--text);
}

.load-top b {
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.bar {
  height: 7px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
}

.bar > i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width 0.6s cubic-bezier(0.22, 0.8, 0.28, 1);
}

.bar.ok > i {
  background: linear-gradient(90deg, #10b981, var(--ok));
}

/* ——— Совет ——— */

.tip-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 16px;
}

.tip-card .row-title {
  font-size: 13.5px;
}

.tip-card .row-sub {
  white-space: normal;
  font-size: 12px;
  line-height: 1.45;
  margin-top: 3px;
}

/* ——— Календарь ——— */

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.cal-title {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.4px;
  text-transform: capitalize;
  white-space: nowrap;
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cal-nav .icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.cal-today {
  font-size: 11.5px;
  font-weight: 650;
  color: var(--brand-2);
  padding: 6px;
  border-radius: 8px;
  white-space: nowrap;
}

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding-bottom: 4px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
  text-align: center;
}

.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.day {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  transition:
    background 0.16s ease,
    color 0.16s ease,
    border-color 0.16s ease;
}

.day:hover {
  background: rgba(255, 255, 255, 0.05);
}

.day.is-out {
  color: var(--muted-2);
  opacity: 0.4;
  pointer-events: none;
}

.day.is-today {
  border-color: rgba(167, 139, 250, 0.5);
  color: #d6d0ff;
}

.day.is-selected {
  background: linear-gradient(135deg, #7c6cff, #5b49e8);
  border-color: transparent;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 20px -10px rgba(109, 94, 252, 0.9);
}

.day .dots {
  display: flex;
  gap: 2px;
  height: 3px;
}

.day .dots i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--brand-2);
  display: block;
}

.day.is-selected .dots i {
  background: rgba(255, 255, 255, 0.85);
}

.post-time {
  font-size: 12px;
  color: var(--muted-2);
  width: 38px;
  flex: none;
  font-variant-numeric: tabular-nums;
}

/* ——— Цифры ——— */

.seg {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  margin: 2px 0 12px;
}

.seg-btn {
  padding: 8px 14px;
  border-radius: 11px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--muted);
  transition:
    background 0.18s ease,
    color 0.18s ease;
}

.seg-btn.is-active {
  background: var(--surface-3);
  color: var(--text);
}

.reach-value {
  font-size: 30px;
  font-weight: 780;
  letter-spacing: -1px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.reach-value small {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
  margin-left: 6px;
}

.chart {
  position: relative;
  height: 150px;
  margin-top: 16px;
}

.chart-grid {
  position: absolute;
  inset: 0 0 18px;
  background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 100% 33.333%;
  pointer-events: none;
}

.bars {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 100%;
}

.bar-col {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.bar {
  width: 100%;
  max-width: 26px;
  height: var(--h);
  border-radius: 7px;
  background: linear-gradient(180deg, var(--brand-2), var(--brand-3));
  transform-origin: bottom;
  animation: grow-bar 0.6s cubic-bezier(0.22, 0.8, 0.28, 1) both;
  animation-delay: calc(var(--i, 0) * 40ms);
}

.bar.is-max {
  background: linear-gradient(180deg, #d8ccff, #8b7bff);
}

@keyframes grow-bar {
  from {
    transform: scaleY(0.02);
    opacity: 0.4;
  }
}

.bar-val {
  font-size: 10px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

.bar-lab {
  font-size: 10px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rank {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-2);
  width: 20px;
  flex: none;
  font-variant-numeric: tabular-nums;
}

.demo-note {
  margin-top: 16px;
  text-align: center;
  font-size: 11px;
  color: var(--muted-2);
}

/* ——— Таббар ——— */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  justify-content: center;
  padding: 18px 12px calc(var(--safe-bottom) + 8px);
  pointer-events: none;
  background: linear-gradient(to top, var(--bg) 62%, transparent);
}

.tabbar-inner {
  pointer-events: auto;
  display: flex;
  width: min(480px, 100%);
  background: rgba(14, 12, 28, 0.96);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 6px;
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow:
    0 -10px 34px -12px rgba(0, 0, 0, 0.65),
    0 20px 50px -18px rgba(0, 0, 0, 0.8);
}

.tab {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 4px 6px;
  border-radius: 14px;
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 600;
  min-width: 0;
  transition:
    color 0.18s ease,
    background 0.18s ease;
}

.tab.is-active {
  color: var(--text);
  background: linear-gradient(180deg, rgba(109, 94, 252, 0.24), rgba(109, 94, 252, 0.08));
}

.tab svg {
  width: 21px;
  height: 21px;
}

.tab.is-active svg {
  color: #b9aeff;
}

.tab-badge {
  position: absolute;
  top: 4px;
  left: calc(50% + 6px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #8b7bff, #6d5efc);
  color: #fff;
  font-size: 9.5px;
  font-style: normal;
  font-weight: 700;
  box-shadow: 0 4px 10px -3px rgba(109, 94, 252, 0.9);
}

/* ——— Шторка ——— */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 3, 12, 0.62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 60;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.sheet-backdrop.is-open {
  opacity: 1;
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 61;
  max-width: 560px;
  margin: 0 auto;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  border-radius: 26px 26px 0 0;
  padding: 10px 18px calc(var(--safe-bottom) + 22px);
  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 -24px 60px -20px rgba(0, 0, 0, 0.7);
  transform: translateY(40px);
  opacity: 0;
  transition:
    transform 0.3s cubic-bezier(0.22, 0.8, 0.28, 1),
    opacity 0.25s ease;
}

.sheet.is-open {
  transform: translateY(0);
  opacity: 1;
}

@media (min-width: 640px) {
  .sheet {
    bottom: 16px;
    border-radius: 26px;
    border-bottom: 1px solid var(--line-strong);
    max-height: calc(100dvh - 40px);
  }
}

.sheet-handle {
  width: 38px;
  height: 4px;
  border-radius: 99px;
  background: var(--line-strong);
  margin: 2px auto 14px;
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.sheet-head h2 {
  font-size: 21px;
  letter-spacing: -0.5px;
  font-weight: 740;
  line-height: 1.2;
}

.sheet-head p {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
}

.sheet-head p:empty {
  display: none;
}

.sheet-head .icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  flex: none;
}

.sheet-body {
  font-size: 14px;
}

/* ——— Детали задачи ——— */

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.soft-tile {
  background: rgba(109, 94, 252, 0.1);
  border: 1px solid rgba(109, 94, 252, 0.18);
  border-radius: 14px;
  padding: 12px 13px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #ded9ff;
  margin-bottom: 16px;
}

.stage-block {
  margin-bottom: 16px;
}

.stage-track {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  margin-top: 8px;
}

.stage-track i {
  height: 6px;
  border-radius: 99px;
  background: var(--surface-3);
}

.stage-track i.on {
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.stage-labels {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  margin-top: 6px;
  font-size: 10px;
  color: var(--muted-2);
  text-align: center;
}

.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

/* ——— Формы ——— */

.field {
  display: block;
  margin-top: 14px;
}

.field:first-child {
  margin-top: 0;
}

.field-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px 13px;
  color: var(--text);
  outline: none;
  font-size: 16px;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.input::placeholder {
  color: var(--muted-2);
}

.input:focus {
  border-color: rgba(124, 108, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(109, 94, 252, 0.16);
}

.has-error .input {
  border-color: rgba(251, 113, 133, 0.6);
}

.form-error {
  font-size: 11.5px;
  color: var(--bad);
  margin: 6px 0 0;
  line-height: 1.4;
}

.form-error:empty {
  display: none;
}

.plat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.plat {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease;
}

.plat[aria-pressed="true"] {
  background: rgba(109, 94, 252, 0.2);
  border-color: rgba(109, 94, 252, 0.45);
  color: #d6d0ff;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stepper button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 19px;
  line-height: 1;
  transition: background 0.18s ease;
}

.stepper button:hover {
  background: #2a2550;
}

.stepper output {
  min-width: 64px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.form-hint {
  font-size: 11.5px;
  color: var(--muted-2);
  margin-top: 10px;
  line-height: 1.45;
}

/* ——— Профиль и настройки ——— */

.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.avatar-lg {
  width: 54px;
  height: 54px;
  font-size: 19px;
}

.avatar-sm {
  width: 36px;
  height: 36px;
  font-size: 12px;
}

.profile-name {
  display: block;
  font-size: 17px;
  font-weight: 740;
  letter-spacing: -0.3px;
}

.profile-role {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

.profile-card .pill {
  margin-left: auto;
}

.kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.kv:last-child {
  border-bottom: 0;
}

.kv span {
  font-size: 13px;
  color: var(--muted);
}

.kv b {
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

.sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}

.version {
  text-align: center;
  font-size: 10.5px;
  color: var(--muted-2);
  margin-top: 16px;
  letter-spacing: 0.04em;
}

/* ——— Пустые состояния ——— */

.empty {
  padding: 26px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.empty b {
  display: block;
  color: var(--text);
  font-size: 14px;
  margin-bottom: 4px;
  font-weight: 650;
}

.empty-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  background: rgba(109, 94, 252, 0.12);
  border: 1px solid rgba(109, 94, 252, 0.2);
  color: var(--brand-2);
}

/* ——— Тосты ——— */

.toasts {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(var(--safe-bottom) + 102px);
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  max-width: 420px;
  background: rgba(30, 26, 58, 0.96);
  border: 1px solid var(--line-strong);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.8);
  animation: fade-up 0.2s ease;
  text-align: center;
}

.toast.is-out {
  animation: fade-out 0.25s ease forwards;
}

/* ——— Прочее ——— */

.noscript {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
  color: var(--text);
  text-align: center;
}

/* ——— Узкие экраны ——— */

@media (max-width: 360px) {
  .brand-sub {
    display: none;
  }

  .brand-title {
    font-size: 17px;
  }

  .hero-card {
    padding: 16px;
  }

  .hero-card h1 {
    font-size: 23px;
    letter-spacing: -0.6px;
  }

  .ring {
    width: 76px;
    height: 76px;
  }

  .ring-label b {
    font-size: 17px;
  }

  .hero-actions {
    gap: 8px;
  }

  .hero-status {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .hero-time {
    font-size: 12px;
  }

  .btn {
    font-size: 13.5px;
    padding: 11px 12px;
  }

  .stats {
    gap: 8px;
  }

  .stat {
    padding: 10px;
  }

  .stat-value {
    font-size: 19px;
  }

  .stat-label {
    font-size: 9.5px;
    letter-spacing: 0.01em;
  }

  .stat-sub {
    font-size: 10px;
  }

  .card {
    padding: 14px;
  }

  .card.list {
    padding: 2px 14px;
  }

  .section-head h2 {
    font-size: 15.5px;
  }

  .tabbar-inner {
    padding: 5px;
  }

  .tab {
    font-size: 9.5px;
  }

  .tab svg {
    width: 19px;
    height: 19px;
  }

  .sheet {
    padding-inline: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .bar {
    transform: none !important;
  }
}

/* ============================================================
   Рабочий кабинет: авторизация, задания, ролики, загрузка
   ============================================================ */

.app.is-auth .topbar,
.app.is-auth .tabbar,
.app.is-auth .dev-banner {
  display: none !important;
}

.app.is-auth .view {
  padding-top: calc(var(--safe-top) + 18px);
}

/* ——— Тестовый режим ——— */

.dev-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 9px 12px;
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: 13px;
  background: rgba(251, 191, 36, 0.09);
  color: #fde68a;
  font-size: 11.5px;
  line-height: 1.4;
}

.dev-banner b {
  flex: none;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(251, 191, 36, 0.18);
  color: #fbbf24;
}

/* ——— Вход ——— */

.login {
  min-height: calc(100dvh - 40px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px 0 34px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.login-brand .brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 15px;
}

.login-brand .brand-mark span {
  font-size: 18px;
}

.login-brand b {
  display: block;
  font-size: 15px;
  letter-spacing: -0.2px;
}

.login-brand small {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 2px;
}

.login h1 {
  font-size: 32px;
  line-height: 1.08;
  letter-spacing: -1.2px;
  font-weight: 780;
  margin: 0;
}

.login > p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  margin: 12px 0 22px;
  max-width: 34ch;
}

.login-card {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.login-card h2 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.login-card p {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
  margin: 7px 0 14px;
}

.login-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-actions .btn {
  width: 100%;
}

.login-note {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.45;
}

.login-note b {
  color: var(--warn);
  font-weight: 650;
}

.login-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bad-bg);
  border: 1px solid rgba(251, 113, 133, 0.28);
  color: #fecdd3;
  font-size: 12px;
  line-height: 1.45;
}

.login-foot {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted-2);
  font-size: 11px;
}

.login-foot a {
  color: var(--brand-2);
  text-decoration: none;
  font-weight: 600;
}

/* ——— Служебное ——— */

.loading {
  padding: 54px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.spinner {
  width: 26px;
  height: 26px;
  margin: 0 auto 12px;
  border-radius: 50%;
  border: 2px solid rgba(167, 139, 250, 0.2);
  border-top-color: var(--brand-2);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.section-sub {
  color: var(--muted);
  font-size: 12.5px;
  margin: 6px 2px 0;
  line-height: 1.5;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stack-sm {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.mono-sm {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 16px 0;
}

/* ——— Задания ——— */

.job-card {
  display: block;
  width: 100%;
  text-align: left;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.008));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  color: inherit;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}

.job-card + .job-card {
  margin-top: 9px;
}

.job-card:hover {
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--line-strong);
}

.job-card:active {
  transform: scale(0.995);
}

.job-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.job-card-title {
  font-size: 14.5px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.15px;
  min-width: 0;
}

.job-card-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.job-card .bar {
  height: 4px;
  margin-top: 9px;
}

.job-card .bar > i {
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.job-card-wait {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  color: var(--warn);
  font-size: 11px;
}

.job-card-wait::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.job-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.pill.muted {
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  border-color: var(--line);
}

/* ——— Требуют решения ——— */

.review-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: left;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
}

.review-row:last-child {
  border-bottom: 0;
}

.review-row .row-main {
  min-width: 0;
}

.review-row .row-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-cta {
  flex: none;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--brand-2);
}

/* ——— Worker / предупреждения ——— */

.worker-card {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.worker-icon {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--muted);
}

.worker-card.online .worker-icon {
  background: var(--ok-bg);
  border-color: rgba(52, 211, 153, 0.24);
  color: var(--ok);
}

.worker-card.offline .worker-icon {
  background: var(--warn-bg);
  border-color: rgba(251, 191, 36, 0.24);
  color: var(--warn);
}

.worker-card .row-title {
  font-size: 13.5px;
}

.worker-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}

.worker-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 650;
  color: var(--muted);
  margin-top: 3px;
}

.worker-state i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.worker-state.online { color: var(--ok); }
.worker-state.offline { color: var(--warn); }

.alert {
  padding: 12px 13px;
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.5;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.alert b {
  display: block;
  color: var(--text);
  font-size: 12.5px;
  margin-bottom: 3px;
}

.alert.warn {
  background: var(--warn-bg);
  border-color: rgba(251, 191, 36, 0.25);
  color: #fde68a;
}

.alert.warn b { color: #fef3c7; }

.alert.bad {
  background: var(--bad-bg);
  border-color: rgba(251, 113, 133, 0.25);
  color: #fecdd3;
}

.alert.bad b { color: #ffe4e6; }

.alert.brand {
  background: rgba(109, 94, 252, 0.1);
  border-color: rgba(109, 94, 252, 0.22);
  color: #ded9ff;
}

.alert.brand b { color: #f0edff; }

/* ——— Карточка задания ——— */

.status-panel {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  margin-bottom: 12px;
}

.status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.status-line .pill {
  flex: none;
}

.status-stage {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

.status-bar {
  height: 5px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
  margin-top: 11px;
}

.status-bar > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width 0.35s ease;
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  margin-top: 13px;
}

.meta-cell span {
  display: block;
  font-size: 10px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 650;
}

.meta-cell b {
  display: block;
  font-size: 12px;
  font-weight: 550;
  color: var(--text);
  margin-top: 3px;
  line-height: 1.4;
}

.job-block {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.job-block:first-of-type {
  border-top: 0;
}

.block-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 10px;
}

.block-title span {
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

.source-line {
  display: flex;
  align-items: center;
  gap: 11px;
}

.source-icon {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(109, 94, 252, 0.1);
  border: 1px solid rgba(109, 94, 252, 0.2);
  color: var(--brand-2);
}

.source-name {
  font-size: 13px;
  font-weight: 600;
  word-break: break-word;
  line-height: 1.3;
}

.source-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}

/* ——— Ролики ——— */

.clip-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  margin-top: 10px;
}

.clip-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.clip-title {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.3;
}

.clip-sub {
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

.clip-video {
  display: block;
  width: 100%;
  max-height: 380px;
  margin-top: 11px;
  border-radius: 13px;
  background: #030208;
  outline: 1px solid rgba(255, 255, 255, 0.06);
  outline-offset: -1px;
}

.clip-placeholder {
  margin-top: 11px;
  padding: 20px 12px;
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--muted-2);
  font-size: 11.5px;
  text-align: center;
}

.version-list {
  margin-top: 10px;
}

.version-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
}

.version-row b {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
}

.version-note {
  color: var(--muted);
  overflow-wrap: anywhere;
  font-size: 11.5px;
  line-height: 1.45;
  margin-top: 8px;
}

.review-box {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.review-box .field {
  margin-top: 0;
}

.review-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.review-actions .btn {
  flex: 1;
  padding-inline: 9px;
  font-size: 13px;
}

.return-form {
  margin-top: 9px;
  display: none;
}

.return-form.is-open {
  display: block;
}

.schedule-box {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.schedule-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.schedule-grid .field {
  margin-top: 0;
}

@media (max-width: 370px) {
  .schedule-grid {
    grid-template-columns: 1fr;
  }
}

.target-list {
  margin-top: 10px;
}

.target-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.target-main {
  min-width: 0;
}

.target-time {
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.target-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.4;
}

.target-link {
  font-size: 11px;
  color: var(--brand-2);
  text-decoration: none;
  font-weight: 600;
}

.publisher-note {
  margin-top: 9px;
  padding: 9px 11px;
  border-radius: 11px;
  background: rgba(251, 191, 36, 0.07);
  border: 1px solid rgba(251, 191, 36, 0.18);
  color: #fde68a;
  font-size: 11px;
  line-height: 1.45;
}

/* ——— Загрузка ——— */

.upload-panel {
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(109, 94, 252, 0.07);
  border: 1px solid rgba(109, 94, 252, 0.18);
}

.upload-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.upload-top b {
  font-size: 12px;
  font-weight: 650;
}

.upload-top span {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.upload-bar {
  height: 6px;
  margin-top: 9px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.upload-bar > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width 0.25s ease;
}

.upload-note {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
}

.upload-actions {
  display: flex;
  gap: 8px;
  margin-top: 9px;
}

.upload-actions .btn {
  flex: 1;
}

.file-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 13px;
  color: var(--muted);
  font-size: 11.5px;
}

.file-hint b {
  color: var(--text);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ——— Журнал ——— */

.event-list {
  position: relative;
}

.event-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.event-item:last-child {
  border-bottom: 0;
}

.event-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-2);
  margin-top: 6px;
  flex: none;
  box-shadow: 0 0 0 3px rgba(109, 94, 252, 0.12);
}

.event-item.is-warn .event-dot { background: var(--warn); box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.1); }
.event-item.is-bad .event-dot { background: var(--bad); box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.1); }
.event-item.is-ok .event-dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.1); }

.event-main {
  flex: 1;
  min-width: 0;
}

.event-text {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text);
  word-break: break-word;
}

.event-time {
  font-size: 10px;
  color: var(--muted-2);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

/* ——— Формы в карточках ——— */

.textarea {
  width: 100%;
  min-height: 82px;
  resize: vertical;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 11px 12px;
  color: var(--text);
  outline: none;
  font-size: 16px;
  line-height: 1.45;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.textarea::placeholder { color: var(--muted-2); }

.textarea:focus {
  border-color: rgba(124, 108, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(109, 94, 252, 0.16);
}

.select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--bg-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23a7a1c7' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px 36px 12px 12px;
  color: var(--text);
  outline: none;
  font-size: 16px;
}

.select:focus {
  border-color: rgba(124, 108, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(109, 94, 252, 0.16);
}

.select option {
  background: var(--surface-2);
  color: var(--text);
}

input[type="date"],
input[type="datetime-local"] {
  color-scheme: dark;
}

.field-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.field-row .field {
  flex: 1;
  margin-top: 0;
}

.btn.small {
  padding: 9px 12px;
  font-size: 12.5px;
  border-radius: 12px;
}

.btn-xs {
  padding: 7px 10px;
  font-size: 11.5px;
  border-radius: 10px;
}

.text-right {
  text-align: right;
}

.full {
  width: 100%;
}

.hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ——— План и цифры ——— */

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.cal-title {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.2px;
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cal-nav button {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.cal-nav button:active { transform: scale(0.95); }

.day .dots i.ok { background: var(--ok); }
.day .dots i.bad { background: var(--bad); }
.day .dots i.warn { background: var(--warn); }

.plan-list {
  margin-top: 12px;
}

.plan-item {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.plan-item:last-child { border-bottom: 0; }

.plan-time {
  flex: none;
  width: 42px;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-top: 1px;
}

.plan-main { flex: 1; min-width: 0; }

.plan-title {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}

.plan-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.4;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.metric-card {
  padding: 13px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid var(--line);
}

.metric-card .stat-label {
  margin: 0;
}

.metric-value {
  font-size: 25px;
  font-weight: 750;
  letter-spacing: -0.7px;
  margin-top: 4px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.metric-sub {
  font-size: 10.5px;
  color: var(--muted-2);
  margin-top: 5px;
}

.simple-bars {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.simple-bar-row {
  display: grid;
  grid-template-columns: 88px 1fr 28px;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  color: var(--muted);
}

.simple-bar-row .bar {
  height: 5px;
}

.simple-bar-row b {
  text-align: right;
  font-size: 11px;
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ——— Настройки ——— */

.settings-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid var(--line);
}

.settings-profile .avatar {
  width: 46px;
  height: 46px;
  font-size: 16px;
}

.settings-profile b {
  display: block;
  font-size: 14px;
}

.settings-profile small {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 3px;
}

.channel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.channel-row:last-child { border-bottom: 0; }

.channel-main { min-width: 0; }

.channel-name {
  font-size: 12.5px;
  font-weight: 600;
}

.channel-sub {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

.check input {
  accent-color: var(--brand);
  width: 14px;
  height: 14px;
  margin: 0;
}

.check:has(input:checked) {
  background: rgba(109, 94, 252, 0.14);
  border-color: rgba(109, 94, 252, 0.35);
  color: #ded9ff;
}

.check.disabled {
  opacity: 0.6;
}

/* ——— Мобильные уточнения ——— */

@media (max-width: 360px) {
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .simple-bar-row {
    grid-template-columns: 74px 1fr 24px;
    font-size: 10.5px;
  }

  .review-actions {
    flex-direction: column;
  }
}

/* Служебные подписи статистики должны быть блочными, иначе inline-спаны
   растягивают карточку и создают горизонтальный скролл. */
.stat-label,
.stat-value,
.stat-sub {
  display: block;
}

/* Убираем горизонтальный скролл: кольцо и статус-пилюля не должны
   выходить за пределы узкой карточки. */
.pill {
  flex: 0 0 auto;
}

.job-card-top > div:first-child {
  min-width: 0;
}

@media (max-width: 360px) {
  .ring svg {
    width: 100%;
    height: 100%;
  }
}

/* onboarding: project facts */
.form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.7fr);
  gap: 8px;
  margin-top: 8px;
}
.form-row .input, .field > .input + .btn, .field > .select + .btn { margin-top: 8px; }
.detail-list {
  display: grid;
  grid-template-columns: minmax(84px, 0.38fr) minmax(0, 1fr);
  gap: 8px 12px;
  margin: 14px 0;
  font-size: 13px;
}
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 360px) {
  .form-row { grid-template-columns: 1fr; }
}
