:root {
  /* Telegram-native dark palette */
  --bg: #17212b;
  --panel: #232e3c;
  --sheet: #1c2733;
  --text: #f5f5f5;
  --muted: #8b9bab;
  --line: rgba(255, 255, 255, 0.08);
  --fill: rgba(255, 255, 255, 0.04);
  --tabs-bg: rgba(0, 0, 0, 0.25);
  --handle: rgba(255, 255, 255, 0.2);
  --backdrop: rgba(0, 0, 0, 0.55);
  --toast-bg: #232e3c;
  --accent: #5288c1;
  --accent-ink: #ffffff;
  --accent-soft: rgba(82, 136, 193, 0.22);
  --danger: #e53935;
  --warn: #f5a623;
  --ok: #4caf50;
  --font: "Manrope", "Segoe UI", sans-serif;
  --radius: 14px;
  --tg-safe-bottom: env(safe-area-inset-bottom);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

#app {
  max-width: 560px;
  margin: 0 auto;
  padding: 12px 14px calc(88px + var(--tg-safe-bottom));
  position: relative;
  animation: fade-in 0.28s ease;
}
@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.event-hero {
  display: block;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  text-align: left;
  max-width: 100%;
  cursor: pointer;
}
.event-hero:active { opacity: 0.75; }
.event-hero .chev {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9em;
}
.tab-label {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}
.ghost {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 1.1rem;
}
.ghost:active { color: var(--text); }

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2px;
  margin-bottom: 12px;
  padding: 3px;
  border-radius: 12px;
  background: var(--tabs-bg);
  border: 1px solid var(--line);
}
.tab {
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 10px;
  padding: 10px 6px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 650;
}
.tab.active {
  background: var(--accent);
  color: var(--accent-ink);
}

.bind-banner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(214, 162, 58, 0.4);
  background: rgba(214, 162, 58, 0.12);
  font-size: 0.84rem;
}
.bind-banner[hidden] {
  display: none !important;
  margin: 0;
  padding: 0;
  border: none;
}
.bind-banner p { margin: 0; color: var(--text); line-height: 1.35; }
.bind-banner .bind-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.bind-banner button {
  border: 1px solid var(--line);
  background: var(--fill);
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 8px 12px;
  min-height: 40px;
  border-radius: 10px;
}
.bind-banner button.quiet {
  color: var(--muted);
  font-weight: 600;
  border-color: transparent;
  background: transparent;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
}
.card h2 {
  margin: 0 0 6px;
  font-size: 1.02rem;
  line-height: 1.3;
}
.meta {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 0 0 8px;
}
.health-strip {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px 4px 4px;
  border-bottom: 1px solid var(--line);
}
.health-strip .label {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 750;
  line-height: 1.25;
}
.health-strip .counts {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.health-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  background: var(--ok);
}
.health-dot.yellow { background: var(--warn); }
.health-dot.orange,
.health-dot.red { background: var(--danger); }

.state-card {
  margin: 4px 0 16px;
  padding: 14px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.state-card.level-red {
  border-color: rgba(255, 120, 120, 0.35);
}
.state-card.level-orange,
.state-card.level-yellow {
  border-color: rgba(245, 166, 35, 0.35);
}
.state-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.state-title {
  margin: 4px 0 0;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.state-readiness {
  margin: 10px 0 0;
  color: var(--text);
  font-size: 1.02rem;
  font-weight: 650;
}
.state-readiness strong {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.state-label {
  margin-left: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}
.state-meters { margin-top: 10px; }
.state-meter-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.state-meter-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}
.state-card.level-red .state-meter-fill { background: var(--danger); }
.state-card.level-yellow .state-meter-fill,
.state-card.level-orange .state-meter-fill { background: var(--warn); }
.state-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.state-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.state-stat .n {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.state-stat .t {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.state-stat.ok .n { color: #8fd9a8; }
.state-stat.hot .n { color: #ffb0b0; }
.state-stat.warn .n { color: #ffd789; }
.state-dirs {
  display: grid;
  gap: 0;
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 4px;
}
.state-dir {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.state-dir:last-child { border-bottom: none; }
.state-dir:active { background: var(--fill); border-radius: 8px; }
.state-dir-name {
  font-size: 0.9rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.state-dir-mark { font-size: 0.95rem; line-height: 1; }

.action, .cta, .chip {
  border: 1px solid var(--line);
  background: var(--fill);
  color: var(--text);
  border-radius: 12px;
  padding: 11px 14px;
  font: inherit;
  font-weight: 600;
}
.action.primary, .cta.primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
}
.action.danger {
  background: rgba(226, 85, 85, 0.12);
  border-color: rgba(226, 85, 85, 0.3);
}
.action.text,
.sheet-cancel {
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}
.action.text:active,
.sheet-cancel:active { color: var(--text); }

.badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}
.badge.overdue { background: rgba(229, 57, 53, 0.2); color: #ffb0b0; }
.badge.blocked { background: rgba(245, 166, 35, 0.2); color: #ffd789; }
.badge.due { background: rgba(82, 136, 193, 0.22); color: #a8c7e8; }

.empty {
  color: var(--muted);
  text-align: left;
  padding: 8px 2px 28px;
}
.empty h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 1.12rem;
  font-weight: 750;
}
.empty p {
  margin: 0;
  line-height: 1.45;
  font-size: 0.95rem;
}
.empty-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
.empty .cta { margin-top: 0; }

.section-title {
  font-size: 0.78rem;
  margin: 18px 4px 6px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.section-title.section-danger {
  color: #ffb0b0;
}
.section-title.section-ok {
  color: #8fd9a8;
}

.section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin: 14px 0 4px;
  padding: 8px 4px;
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  border-radius: 10px;
}
.section-toggle:active {
  background: var(--fill);
}
.section-toggle.section-danger {
  color: #ffb0b0;
}
.section-toggle.section-ok {
  color: #8fd9a8;
}
.section-toggle-label {
  min-width: 0;
}
.section-chev {
  flex-shrink: 0;
  font-size: 0.85rem;
  opacity: 0.85;
  color: inherit;
}

.today-intro {
  margin: 2px 0 10px;
}
.today-status {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.today-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.35;
}

.focus-card {
  margin: 0 0 14px;
  padding: 14px 14px 12px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.focus-card.is-hot {
  border-color: rgba(255, 120, 120, 0.35);
  background: rgba(255, 80, 80, 0.08);
}
.focus-card.leaving {
  opacity: 0;
  transform: translateX(12px);
  pointer-events: none;
}
.focus-kicker {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.focus-card.is-hot .focus-kicker {
  color: #ffb0b0;
}
.focus-title {
  margin: 0;
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  word-break: break-word;
}
.focus-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}
.focus-card.is-hot .focus-meta {
  color: #ffb0b0;
}
.focus-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.focus-done,
.focus-more {
  flex: 1;
  border: none;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 11px 12px;
  cursor: pointer;
}
.focus-done {
  background: var(--accent);
  color: var(--accent-ink);
}
.focus-more {
  background: var(--fill);
  color: var(--text);
}

.sec-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 8px;
}
.sec-chip {
  border: 1px solid var(--line);
  background: var(--fill);
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.sec-chip:active {
  background: var(--accent-soft);
  color: var(--text);
}
.sec-chip.ok {
  color: #8fd9a8;
  border-color: rgba(143, 217, 168, 0.25);
}

.risk {
  border-left: 3px solid var(--warn);
  padding: 2px 0 2px 10px;
  margin: 10px 0;
}
.risk.critical { border-left-color: var(--danger); }
.risk p { margin: 2px 0 0; color: var(--muted); font-size: 0.86rem; }
.risk strong { font-size: 0.95rem; }

.week-head {
  margin: 0 0 12px;
}

.task-list {
  display: flex;
  flex-direction: column;
  margin-bottom: 4px;
}
.task-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border-bottom: 1px solid var(--line);
  padding: 4px 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.task-row.leaving {
  opacity: 0;
  transform: translateX(12px);
  pointer-events: none;
}
.task-row.is-done .row-title {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
.task-check {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.task-check.overdue {
  border-color: rgba(255, 120, 120, 0.65);
}
.task-check.due {
  border-color: var(--accent);
}
.task-check.blocked {
  border-color: var(--warn);
}
.task-check.done {
  border-color: var(--ok);
  background: rgba(143, 217, 168, 0.18);
  color: var(--ok);
}
.task-check:active {
  background: var(--accent-soft);
}
.task-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 10px;
  align-items: center;
  flex: 1;
  min-width: 0;
  text-align: left;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 8px 2px;
  cursor: pointer;
}
.task-main:active {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
}
.task-row .row-main {
  min-width: 0;
}
.task-row .row-title {
  font-weight: 650;
  font-size: 0.95rem;
  line-height: 1.3;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-row .row-sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-row .row-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.task-row .row-comments {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.task-row .row-time {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
  text-align: right;
  white-space: nowrap;
}
.task-row .row-time.hot { color: #ffb0b0; }
.task-row .row-time.warn { color: #ffd789; }
.task-row .row-time.done { color: var(--ok); }

.show-more {
  width: 100%;
  margin: 6px 0 10px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  padding: 10px;
}

.meeting-quiet {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
  padding: 8px 4px;
  color: var(--muted);
  font-size: 0.84rem;
  border-bottom: 1px solid var(--line);
}
.meeting-quiet strong { color: var(--text); font-weight: 650; }
.meeting-quiet .action {
  flex-shrink: 0;
  padding: 8px 12px;
  font-size: 0.8rem;
  border-radius: 10px;
}

.comment-list {
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
  max-height: 40vh;
  overflow: auto;
}
.comment-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.comment-item .who {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 650;
  margin: 0 0 4px;
}
.comment-item .body {
  margin: 0;
  font-size: 0.92rem;
  word-break: break-word;
}
.skeleton-row {
  height: 48px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.skeleton-row::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  animation: shine 1.1s infinite;
}
@keyframes shine {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

.fab {
  position: fixed;
  right: max(16px, calc(50% - 280px + 16px));
  bottom: calc(18px + var(--tg-safe-bottom));
  width: 54px;
  height: 54px;
  border-radius: 16px;
  border: none;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 1.55rem;
  font-weight: 700;
  z-index: 20;
  transition: transform 0.15s ease;
}
.fab:active { transform: scale(0.94); }

.help-fab {
  position: fixed;
  right: max(16px, calc(50% - 280px + 16px));
  bottom: calc(82px + var(--tg-safe-bottom));
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  z-index: 20;
}
.help-fab:active {
  color: var(--text);
  background: var(--accent-soft);
}
.help-fab[hidden] {
  display: none;
}

.guide {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.guide[hidden] {
  display: none;
}
.guide.spotlight-mode {
  align-items: stretch;
}
.guide-backdrop {
  position: absolute;
  inset: 0;
  background: var(--backdrop);
}
.guide-backdrop.dim-soft {
  background: transparent;
}
.guide-spotlight {
  position: fixed;
  z-index: 81;
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.72);
  outline: 2px solid var(--accent);
  pointer-events: none;
  transition: top 0.2s ease, left 0.2s ease, width 0.2s ease, height 0.2s ease;
}
.guide-spotlight[hidden] {
  display: none;
}
.tour-pulse {
  position: relative;
  z-index: 82;
  animation: tour-pulse 1.4s ease-in-out infinite;
}
@keyframes tour-pulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.15);
  }
}
.guide-panel {
  position: relative;
  z-index: 83;
  width: min(100%, 560px);
  max-height: min(88vh, 640px);
  overflow: auto;
  margin: 0;
  padding: 8px 18px calc(18px + var(--tg-safe-bottom));
  border-radius: 20px 20px 0 0;
  background: var(--sheet);
  color: var(--text);
}
.guide-panel[hidden] {
  display: none;
}
.guide-tip {
  position: fixed;
  left: 12px;
  right: 12px;
  z-index: 84;
  max-height: min(52vh, 420px);
  overflow: auto;
  padding: 12px 16px 14px;
  border-radius: 16px;
  background: var(--sheet);
  color: var(--text);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.guide-tip[hidden] {
  display: none;
}
.guide-step {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.guide-points {
  margin: 12px 0 0;
  padding-left: 1.1rem;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.45;
}
.guide-points li + li {
  margin-top: 6px;
}
.guide-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin: 18px 0 8px;
}
.guide-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}
.guide-dot.active {
  background: var(--accent);
}
.guide-actions {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.setup-card {
  margin: 0 0 14px;
  padding: 14px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.setup-kicker {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.setup-title {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.setup-text {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}
.setup-card .focus-done {
  width: 100%;
  margin-top: 14px;
}
.setup-link {
  display: block;
  width: 100%;
  margin-top: 8px;
  border: none;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 650;
  padding: 8px 0 0;
  cursor: pointer;
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + var(--tg-safe-bottom));
  transform: translateX(-50%);
  z-index: 50;
  max-width: min(92vw, 420px);
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--toast-bg);
  border: 1px solid rgba(226, 85, 85, 0.45);
  color: var(--danger);
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.toast.ok {
  border-color: var(--accent);
  color: var(--text);
}
.toast[hidden] { display: none; }

.sheet[hidden] { display: none; }
.sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: var(--backdrop);
}
.sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--sheet);
  color: var(--text);
  border-radius: 20px 20px 0 0;
  padding: 8px 16px calc(18px + var(--tg-safe-bottom));
  border-top: 1px solid var(--line);
  max-height: min(88vh, 640px);
  overflow: auto;
  animation: sheet-up 0.22s ease;
}
@keyframes sheet-up {
  from { transform: translateY(18px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}
.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: var(--handle);
  margin: 4px auto 14px;
}
.sheet-panel h2 { margin: 0 0 4px; font-size: 1.12rem; color: var(--text); }
.sheet-sub { margin: 0 0 12px; color: var(--muted); font-size: 0.9rem; }
.sheet-sub.sheet-title-full {
  color: var(--text);
  font-weight: 600;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-height: 6.5em;
  overflow-y: auto;
}
.sheet-list, .sheet-reasons {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}
.sheet-list .action,
.sheet-reasons .action {
  width: 100%;
  text-align: left;
  border-radius: 12px;
  background: var(--fill);
  color: var(--text);
  border: 1px solid var(--line);
}
.sheet-list .action.active-event {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.sheet-cancel { width: 100%; margin-top: 4px; padding: 12px; }
.sheet-submit {
  display: block;
  width: 100%;
  margin-top: 8px;
  text-align: center;
}
.sheet-panel > .action.primary,
.sheet-panel > .action.sheet-submit {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
}
.action.danger-text {
  border: none;
  background: transparent;
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 2px 10px;
  text-align: left;
}

.budget-card {
  margin: 4px 0 8px;
  padding: 14px 14px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--fill);
}
.budget-kicker {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.budget-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.budget-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}
.budget-row span {
  color: var(--muted);
}
.budget-forecast {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.budget-forecast p {
  margin: 0 0 4px;
  font-size: 14px;
}
.budget-forecast.hot strong {
  color: var(--danger);
}
.sales-alert {
  margin-top: 10px;
}
.budget-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.budget-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--fill);
}
.budget-line-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.form-field { margin-bottom: 12px; }
.form-field label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}
.form-field input,
.form-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--fill);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
}
.form-field textarea {
  min-height: 72px;
  resize: vertical;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
}

.days-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.days-row input[type="number"] {
  width: 100px;
  flex-shrink: 0;
}
#create-date-wrap[hidden] {
  display: none !important;
}

.brief-card {
  margin: 10px 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--fill);
}
.brief-card .label {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.brief-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.brief-level {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}
.brief-card.level-red .brief-level { color: var(--danger); }
.brief-card.level-orange .brief-level,
.brief-card.level-yellow .brief-level { color: var(--warn); }
.brief-summary {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.35;
}
.brief-action {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--accent-soft);
  font-size: 13px;
  line-height: 1.35;
}
.brief-action span {
  color: var(--muted);
  margin-right: 4px;
}
.brief-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.brief-card li + li {
  margin-top: 4px;
}

.team-panel {
  margin: 18px 0 8px;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}
.section-head .section-title {
  margin-bottom: 0;
}

.subtabs {
  display: flex;
  gap: 6px;
  margin: 0 0 12px;
  padding: 3px;
  border-radius: 12px;
  background: var(--fill);
  border: 1px solid var(--line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.subtabs::-webkit-scrollbar {
  display: none;
}
.subtab {
  flex: 1 0 auto;
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
}
.subtab.active {
  background: var(--panel);
  color: var(--text);
}
.unassigned-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.unassigned-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--fill);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.unassigned-row:active {
  background: var(--panel);
}
.cascade-card .action {
  margin-top: 6px;
}
.cascade-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}
.deps-block {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.dep-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
}
.team-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 4px;
}
.sheet-team-actions {
  margin-bottom: 4px;
}
.chip.team-chip {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 650;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
}
.chip.team-chip.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink, #fff);
}

.team-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
}
.team-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}
.team-filter {
  margin-bottom: 8px;
}
.team-filter input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--fill);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.9rem;
  box-sizing: border-box;
}
.team-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}
.team-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--fill);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
}
.team-row:active {
  background: var(--panel);
}
.team-row[hidden] {
  display: none;
}
.team-avatar {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
}
.team-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.team-row-main strong {
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.team-row-main .meta {
  margin: 0;
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.team-role {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.team-chev {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
}
.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.cue-list,
.vendor-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px 0 12px;
}
.vendor-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--fill);
}
.vendor-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.vendor-card-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.vendor-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.vendor-next {
  margin: 8px 0 0;
}
.cue-row,
.vendor-row,
.team-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--fill);
  width: 100%;
  text-align: left;
  color: inherit;
  font: inherit;
}
button.cue-row {
  cursor: pointer;
}
.cue-row.done {
  opacity: 0.45;
}
.cue-row.now {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.cue-check {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.cue-time {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 15px;
  min-width: 3.2em;
  flex-shrink: 0;
}
.cue-body {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: baseline;
  font-size: 14px;
  min-width: 0;
}
.vendor-row,
.team-row {
  justify-content: space-between;
}
.vendor-main {
  min-width: 0;
}
.vendor-main .meta {
  display: inline;
  margin-left: 6px;
}
.action.text {
  width: auto;
  border: none;
  background: transparent;
  color: var(--accent);
  padding: 8px 0;
  justify-content: flex-start;
}
.text-link {
  border: none;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 650;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
#cue-time-wrap[hidden] {
  display: none !important;
}
