@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&display=swap");

:root {
  color-scheme: dark;
  --bg: #080b12;
  --bg-2: #111827;
  --panel: rgba(14, 20, 34, 0.74);
  --panel-strong: rgba(20, 28, 44, 0.92);
  --panel-soft: rgba(255, 255, 255, 0.055);
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.2);
  --ink: #f5f7fb;
  --muted: #96a1b8;
  --muted-2: #c4ccda;
  --accent: #ff6b4a;
  --accent-dark: #dc3f22;
  --accent-soft: rgba(255, 107, 74, 0.16);
  --cyan: #34d6ff;
  --green: #6ee7a8;
  --yellow: #ffd166;
  --red: #ff5d73;
  --violet: #a78bfa;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
  --shadow-soft: 0 16px 45px rgba(0, 0, 0, 0.24);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --font-ui: "Montserrat";
  --font-display: "Montserrat";
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: var(--font-ui);
  font-feature-settings: "kern" 1, "liga" 1;
  text-rendering: geometricPrecision;
  background:
    radial-gradient(circle at 13% 18%, rgba(52, 214, 255, 0.2), transparent 28rem),
    radial-gradient(circle at 90% 6%, rgba(255, 107, 74, 0.22), transparent 28rem),
    radial-gradient(circle at 50% 100%, rgba(110, 231, 168, 0.16), transparent 34rem),
    linear-gradient(135deg, #070910 0%, #0d1421 46%, #17101a 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 20%, #000 0%, transparent 72%);
}

body::after {
  position: fixed;
  inset: auto -14rem -22rem auto;
  z-index: -1;
  width: 42rem;
  height: 42rem;
  pointer-events: none;
  content: "";
  background: conic-gradient(from 90deg, rgba(255, 107, 74, 0.28), rgba(52, 214, 255, 0.2), rgba(110, 231, 168, 0.2), rgba(255, 107, 74, 0.28));
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.7;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.paste-zone:focus-visible {
  outline: 3px solid rgba(52, 214, 255, 0.34);
  outline-offset: 3px;
}

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 0;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100vh;
  padding: 24px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(9, 13, 22, 0.94), rgba(10, 14, 21, 0.84)),
    rgba(8, 11, 18, 0.88);
  box-shadow: 18px 0 60px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(22px);
}

.brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025));
}

.brand::after {
  position: absolute;
  top: -50%;
  right: -18%;
  width: 130px;
  height: 130px;
  content: "";
  background: radial-gradient(circle, rgba(52, 214, 255, 0.28), transparent 64%);
}

.brand-mark {
  position: relative;
  z-index: 1;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 18px;
  color: #08111d;
  font-size: 30px;
  font-weight: 950;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.24)),
    linear-gradient(135deg, var(--cyan), var(--green));
  box-shadow: 0 14px 34px rgba(52, 214, 255, 0.22);
}

.brand h1,
.topbar h2,
.dialog-head h3 {
  margin: 0;
}

.brand h1 {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 27px;
  line-height: 1;
  letter-spacing: -0.055em;
}

.brand-kicker,
.eyebrow,
.section-title {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sidebar-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
}

.sidebar-tab {
  min-height: 38px;
  border-radius: 13px;
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 950;
  background: transparent;
  transition:
    color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.sidebar-tab:hover,
.sidebar-tab.active {
  color: #07101c;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  box-shadow: 0 12px 28px rgba(52, 214, 255, 0.18);
}

.user-badge {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 255, 255, 0.055);
}

.user-badge:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.09);
}

.user-badge span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #07101c;
  font-size: 12px;
  font-weight: 950;
  background: linear-gradient(135deg, var(--green), var(--cyan));
}

.user-badge strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary,
.ghost {
  min-height: 44px;
  padding: 11px 16px;
  border-radius: 14px;
  font-weight: 900;
  letter-spacing: -0.01em;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.primary {
  color: #160a06;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.5), transparent 36%),
    linear-gradient(135deg, #ffbf69, var(--accent) 48%, var(--accent-dark));
  box-shadow: 0 18px 38px rgba(255, 107, 74, 0.3);
}

.primary:hover,
.ghost:hover {
  box-shadow: 0 0 0 4px rgba(52, 214, 255, 0.1);
}

.ghost {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
}

.ghost:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.1);
}

.danger {
  color: #ffb5bf;
}

.wide {
  width: 100%;
}

.branch-panel {
  min-height: 0;
}

.branch-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.branch-node {
  display: grid;
  gap: 10px;
}

.branch-children {
  display: grid;
  gap: 10px;
  margin-left: 18px;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.branch-button {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 64px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  color: #fff;
  cursor: grab;
  text-align: left;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.32);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(0, 0, 0, 0.16)),
    var(--branch-color);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 14px 36px rgba(0, 0, 0, 0.18);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.branch-node-child .branch-button {
  min-height: 56px;
  border-radius: 18px;
}

.branch-node-child .branch-name {
  font-size: 14px;
}

.branch-button::after {
  position: absolute;
  inset: auto -12% -70% auto;
  z-index: -1;
  width: 110px;
  height: 110px;
  content: "";
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28), transparent 62%);
  border-radius: 50%;
}

.branch-button:hover,
.branch-button.active {
  border-color: rgba(255, 255, 255, 0.48);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 0 0 4px rgba(255, 255, 255, 0.08),
    0 20px 46px rgba(0, 0, 0, 0.26);
}

.branch-button.pinned {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.38),
    0 20px 46px rgba(0, 0, 0, 0.26);
}

.branch-button.dragging {
  cursor: grabbing;
  opacity: 0.54;
}

.branch-button.drop-before::before,
.branch-button.drop-after::before {
  position: absolute;
  right: 12px;
  left: 12px;
  height: 3px;
  content: "";
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(52, 214, 255, 0.18);
}

.branch-button.drop-before::before {
  top: -7px;
}

.branch-button.drop-after::before {
  bottom: -7px;
}

.branch-main {
  display: grid;
  min-width: 0;
  margin-right: auto;
}

.branch-name {
  min-width: 0;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.branch-pin {
  display: grid;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: #07101c;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

.branch-pin svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.branch-count {
  flex: 0 0 auto;
  min-width: 30px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #08111d;
  font-size: 12px;
  font-weight: 950;
  text-align: center;
  text-shadow: none;
  background: rgba(255, 255, 255, 0.9);
}

.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  padding: 28px;
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 22px;
  margin-bottom: 22px;
  padding: 24px;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.045)),
    rgba(11, 16, 28, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.topbar::before {
  position: absolute;
  inset: -35% 42% auto auto;
  width: 380px;
  height: 220px;
  pointer-events: none;
  content: "";
  background: radial-gradient(circle, rgba(255, 107, 74, 0.22), transparent 67%);
}

.topbar > div {
  position: relative;
  z-index: 1;
}

.topbar > div:first-child {
  flex: 0 1 500px;
  min-width: 270px;
  max-width: 500px;
}

.topbar h2 {
  max-width: 100%;
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: clamp(30px, 3vw, 46px);
  line-height: 1.02;
  letter-spacing: -0.065em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.workspace-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.workspace-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.055);
}

.workspace-stat strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
}

.workspace-stat small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.topbar-insights {
  display: flex;
  align-items: stretch;
  gap: 14px;
  flex: 1.35 1 780px;
  min-width: min(100%, 560px);
}

.global-calendar {
  position: relative;
  z-index: 3;
  flex: 1 1 330px;
  min-width: 270px;
  max-width: 360px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035)),
    rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

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

.global-calendar-head div:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.global-calendar-head span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.global-calendar-head strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-calendar-nav {
  display: inline-flex;
  gap: 6px;
}

.global-calendar-nav button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  background: rgba(255, 255, 255, 0.07);
}

.global-calendar-nav button:hover {
  background: rgba(52, 214, 255, 0.14);
}

.global-calendar-weekdays,
.global-calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.global-calendar-weekdays {
  margin-bottom: 5px;
}

.global-calendar-weekdays span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-align: center;
}

.global-calendar-day,
.global-calendar-empty {
  position: relative;
  display: grid;
  min-width: 0;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 12px;
}

.global-calendar-day {
  border: 1px solid transparent;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.045);
}

.global-calendar-day.today {
  border-color: rgba(255, 209, 102, 0.36);
  color: #ffe7a1;
}

.global-calendar-day.has-deadlines {
  color: #07101c;
  background: var(--deadline-gradient);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.08),
    0 0 18px rgba(255, 255, 255, 0.09);
}

.global-calendar-day.has-deadlines > span {
  position: relative;
  z-index: 2;
}

.global-deadline-marker {
  position: absolute;
  right: -4px;
  bottom: -4px;
  z-index: 3;
  display: grid;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  place-items: center;
  border: 2px solid rgba(11, 16, 28, 0.98);
  border-radius: 999px;
  color: #07101c;
  font-size: 9px;
  font-style: normal;
  font-weight: 950;
  background: #fff;
}

.global-deadline-popover {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  z-index: 90;
  display: grid;
  width: max-content;
  min-width: 260px;
  max-width: min(460px, 82vw);
  max-height: 320px;
  padding: 8px;
  overflow: auto;
  pointer-events: none;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  opacity: 0;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06)),
    rgba(11, 16, 28, 0.98);
  box-shadow: var(--shadow);
  transform: translateX(-50%) translateY(6px) scale(0.98);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.global-deadline-popover::after {
  position: absolute;
  bottom: -6px;
  left: 50%;
  width: 10px;
  height: 10px;
  content: "";
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  background: rgba(11, 16, 28, 0.98);
  transform: translateX(-50%) rotate(45deg);
}

.global-calendar-day.has-deadlines:hover .global-deadline-popover,
.global-calendar-day.has-deadlines:focus-within .global-deadline-popover,
.global-calendar-day.has-deadlines:focus-visible .global-deadline-popover {
  pointer-events: auto;
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.global-deadline-item {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 10px 12px 10px 16px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 255, 255, 0.055);
}

.global-deadline-item::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 4px;
  content: "";
  border-radius: 999px;
  background: var(--task-branch-color);
  box-shadow: 0 0 18px color-mix(in srgb, var(--task-branch-color), transparent 45%);
}

.global-deadline-item:hover,
.global-deadline-item:focus-visible {
  border-color: rgba(52, 214, 255, 0.34);
  background: rgba(52, 214, 255, 0.13);
  outline: none;
}

.global-deadline-item strong {
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 950;
  line-height: 1.2;
}

.global-deadline-item span,
.global-deadline-item small {
  overflow-wrap: anywhere;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
}

.global-deadline-time.deadline-overdue {
  color: #ffb5bf;
}

.global-deadline-time.deadline-soon {
  color: #ffe7a1;
}

.global-deadline-time.deadline-safe {
  color: #c7ffdf;
}

.global-calendar-day[data-tooltip]:hover::after,
.global-calendar-day[data-tooltip]:focus-visible::after {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  z-index: 80;
  width: max-content;
  max-width: min(420px, 80vw);
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
  white-space: pre-line;
  content: attr(data-tooltip);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.055)),
    rgba(11, 16, 28, 0.98);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

.global-calendar-day[data-tooltip]:hover::before,
.global-calendar-day[data-tooltip]:focus-visible::before {
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  z-index: 81;
  width: 10px;
  height: 10px;
  content: "";
  background: rgba(11, 16, 28, 0.98);
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  transform: translateX(-50%) rotate(45deg);
}

.global-dashboard {
  position: relative;
  z-index: 3;
  flex: 1 1 390px;
  min-width: 330px;
  max-width: 450px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 100% 0%, rgba(110, 231, 168, 0.15), transparent 48%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.035)),
    rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

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

.global-dashboard-head div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.global-dashboard-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.global-dashboard-head strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 950;
}

.global-dashboard-head b {
  padding: 7px 10px;
  border: 1px solid rgba(110, 231, 168, 0.22);
  border-radius: 999px;
  color: #c7ffdf;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
  background: rgba(110, 231, 168, 0.11);
}

.global-dashboard-progress {
  position: relative;
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.global-dashboard-progress::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--progress, 0%);
  min-width: 11px;
  content: "";
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--cyan));
  box-shadow: 0 0 18px rgba(110, 231, 168, 0.22);
}

.global-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.global-dashboard-card {
  position: relative;
  display: grid;
  align-content: center;
  gap: 6px;
  min-height: 72px;
  padding: 13px 12px 13px 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.095);
  border-radius: 20px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--dash-color) 17%, transparent), transparent 74%),
    rgba(255, 255, 255, 0.052);
}

.global-dashboard-card::before {
  position: absolute;
  inset: 12px auto 12px 0;
  width: 4px;
  content: "";
  border-radius: 999px;
  background: var(--dash-color);
  box-shadow: 0 0 18px color-mix(in srgb, var(--dash-color) 46%, transparent);
}

.global-dashboard-card strong {
  color: var(--ink);
  font-size: 30px;
  font-weight: 950;
  line-height: 0.9;
}

.global-dashboard-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
}

.global-dashboard-total {
  --dash-color: var(--cyan);
}

.global-dashboard-done {
  --dash-color: var(--green);
}

.global-dashboard-overdue,
.global-dashboard-critical {
  --dash-color: var(--red);
}

.global-dashboard-today {
  --dash-color: var(--yellow);
}

.global-dashboard-blockers {
  --dash-color: var(--violet);
}

.topbar-actions,
.dialog-actions,
.dialog-actions-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-actions {
  align-items: stretch;
  flex: 0 0 218px;
  flex-direction: column;
  flex-wrap: nowrap;
  justify-content: center;
}

.topbar-actions .ghost,
.topbar-actions .primary {
  width: 100%;
  min-height: 40px;
  padding: 9px 14px;
}

.board {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(var(--status-count, 4), minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
  min-width: 0;
}

.bot-settings-view {
  min-width: 0;
}

.bot-settings-shell {
  display: grid;
  gap: 18px;
}

.bot-settings-hero,
.bot-settings-card,
.bot-metric-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.035)),
    rgba(12, 18, 31, 0.72);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.bot-settings-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  min-height: 210px;
  padding: 28px;
  border-radius: 34px;
}

.bot-settings-hero::after {
  position: absolute;
  top: -45%;
  right: 12%;
  width: 420px;
  height: 260px;
  pointer-events: none;
  content: "";
  background: radial-gradient(circle, rgba(110, 231, 168, 0.2), transparent 68%);
}

.bot-settings-hero h2 {
  max-width: 760px;
  margin: 6px 0 10px;
  font-size: clamp(34px, 4vw, 58px);
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.bot-settings-hero p {
  max-width: 620px;
  margin: 0;
  color: var(--muted-2);
  font-weight: 700;
  line-height: 1.55;
}

.bot-status-pill {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.08);
}

.bot-status-pill i,
.bot-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 18px var(--yellow);
}

.bot-status-pill.is-running {
  border-color: rgba(110, 231, 168, 0.28);
  color: #c7ffdf;
  background: rgba(110, 231, 168, 0.1);
}

.bot-status-pill.is-running i {
  background: var(--green);
  box-shadow: 0 0 18px var(--green);
}

.bot-status-pill.is-danger {
  border-color: rgba(255, 93, 115, 0.34);
  color: #ffb5bf;
  background: rgba(255, 93, 115, 0.13);
}

.bot-status-pill.is-danger i {
  background: var(--red);
  box-shadow: 0 0 18px var(--red);
}

.bot-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.bot-metric-card {
  display: grid;
  gap: 7px;
  min-height: 132px;
  padding: 18px;
  border-radius: 24px;
}

.bot-metric-card::before {
  position: absolute;
  inset: 16px auto 16px 0;
  width: 4px;
  content: "";
  border-radius: 999px;
  background: var(--cyan);
  box-shadow: 0 0 18px rgba(52, 214, 255, 0.44);
}

.bot-metric-card span,
.bot-metric-card small,
.bot-muted {
  color: var(--muted);
}

.bot-metric-card span {
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.bot-metric-card strong {
  overflow-wrap: anywhere;
  font-size: 24px;
  font-weight: 950;
  line-height: 1.05;
}

.bot-metric-card small,
.bot-muted {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.bot-settings-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 14px;
}

.bot-settings-card {
  padding: 22px;
  border-radius: 26px;
}

.bot-settings-card h3 {
  margin: 6px 0 14px;
  font-size: 22px;
  letter-spacing: -0.04em;
}

.bot-settings-editor {
  display: grid;
  gap: 18px;
}

.bot-settings-card-head,
.bot-form-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.bot-settings-card-head h3 {
  margin-bottom: 0;
}

.bot-editor-note {
  flex: 0 0 auto;
  padding: 9px 12px;
  border: 1px solid rgba(52, 214, 255, 0.22);
  border-radius: 999px;
  color: var(--cyan);
  background: rgba(52, 214, 255, 0.08);
  font-size: 12px;
  font-weight: 950;
}

.bot-settings-form {
  display: grid;
  gap: 14px;
}

.bot-form-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.4fr) minmax(220px, 1fr) minmax(160px, 0.6fr);
  gap: 14px;
}

.bot-form-footer {
  align-items: center;
}

.bot-form-footer p {
  max-width: 760px;
  margin: 0;
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.bot-form-footer .primary {
  flex: 0 0 auto;
  min-width: 170px;
}

.bot-save-feedback {
  padding: 12px 14px;
  border: 1px solid rgba(103, 229, 161, 0.22);
  border-radius: 16px;
  color: var(--green);
  background: rgba(103, 229, 161, 0.08);
  font-size: 13px;
  font-weight: 900;
}

.bot-save-feedback.is-error {
  border-color: rgba(255, 93, 125, 0.28);
  color: var(--red);
  background: rgba(255, 93, 125, 0.1);
}

.bot-save-feedback[hidden] {
  display: none;
}

.bot-rule-list,
.bot-data-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.bot-rule-list span,
.bot-data-list span {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.065);
}

.bot-data-list strong {
  color: var(--ink);
  font-size: 18px;
}

.bot-history-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.bot-history-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 14px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
}

.bot-history-list strong {
  overflow-wrap: anywhere;
}

.bot-history-list span,
.bot-history-list small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.bot-history-list small {
  text-align: right;
}

.bot-empty-row {
  color: var(--muted);
}

.bot-settings-loading,
.bot-settings-error {
  display: grid;
  gap: 12px;
}

.bot-settings-error code {
  width: fit-content;
  padding: 8px 10px;
  border-radius: 12px;
  color: #ffb5bf;
  background: rgba(255, 93, 115, 0.12);
}

.column {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 430px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035)),
    rgba(12, 18, 31, 0.72);
  box-shadow:
    inset 0 3px 0 var(--status-color, var(--cyan)),
    var(--shadow-soft);
  backdrop-filter: blur(18px);
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.column.column-dragging {
  opacity: 0.62;
}

.column.status-drop-before::before,
.column.status-drop-after::before {
  position: absolute;
  top: 18px;
  bottom: 18px;
  z-index: 2;
  width: 4px;
  border-radius: 999px;
  content: "";
  background: var(--cyan);
  box-shadow: 0 0 0 4px rgba(52, 214, 255, 0.12), 0 0 18px rgba(52, 214, 255, 0.44);
}

.column.status-drop-before::before {
  left: -10px;
}

.column.status-drop-after::before {
  right: -10px;
}

.column.drag-over {
  border-color: rgba(52, 214, 255, 0.62);
  background:
    linear-gradient(180deg, rgba(52, 214, 255, 0.14), rgba(255, 255, 255, 0.035)),
    rgba(12, 18, 31, 0.8);
  box-shadow:
    inset 0 3px 0 var(--status-color, var(--cyan)),
    0 0 0 4px rgba(52, 214, 255, 0.11),
    var(--shadow-soft);
}

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

.column-title {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 8px 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 950;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.055);
}

.status-dot {
  flex: 0 0 auto;
  width: 5px;
  height: 20px;
  border-radius: 999px;
  background: var(--status-color, var(--cyan));
  box-shadow: 0 0 18px var(--status-color, var(--cyan));
}

.status-count {
  min-width: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 950;
  text-align: center;
  background: rgba(255, 255, 255, 0.08);
}

.column-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.column-icon-button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  font-size: 19px;
  font-weight: 950;
  line-height: 1;
  background: rgba(255, 255, 255, 0.08);
  transition:
    transform 160ms ease,
    background 160ms ease,
    color 160ms ease,
    border-color 160ms ease;
}

.column-icon-button svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  pointer-events: none;
}

.column-icon-button:hover {
  color: #08111d;
  border-color: rgba(255, 255, 255, 0.36);
  background: var(--cyan);
}

.column-delete-button {
  color: #ffb5bf;
}

.column-edit-button {
  color: #d6dcff;
  font-size: 16px;
}

.column-edit-button:hover {
  color: #08111d;
  background: var(--violet);
}

.column-delete-button:hover {
  color: #25070c;
  background: var(--red);
}

.task-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  min-height: 330px;
}

.task-card {
  position: relative;
  display: grid;
  gap: 12px;
  width: 100%;
  padding: 15px 15px 15px 17px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: inherit;
  text-align: left;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.035)),
    rgba(255, 255, 255, 0.045);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.task-card.task-done {
  border-color: rgba(110, 231, 168, 0.34);
}

.task-card.task-done h4,
.task-card.task-done p {
  opacity: 0.72;
}

.task-card.task-blocker {
  border-color: rgba(255, 93, 115, 0.34);
}

.task-card::before {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 4px;
  content: "";
  background: var(--task-accent, var(--cyan));
  border-radius: 0 999px 999px 0;
}

.task-card:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.145), rgba(255, 255, 255, 0.055)),
    rgba(255, 255, 255, 0.06);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.26);
  outline: 1px solid rgba(255, 255, 255, 0.08);
}

.task-card.dragging {
  opacity: 0.56;
}

.task-card.has-deadline {
  border-color: rgba(255, 255, 255, 0.16);
}

.task-card.deadline-soon-card {
  box-shadow:
    0 0 0 1px rgba(255, 209, 102, 0.24),
    0 14px 34px rgba(0, 0, 0, 0.18);
}

.task-card.deadline-overdue-card {
  border-color: rgba(255, 93, 115, 0.42);
  box-shadow:
    0 0 0 1px rgba(255, 93, 115, 0.3),
    0 14px 34px rgba(0, 0, 0, 0.18);
}

.task-card.task-card-calendar-focus {
  border-color: rgba(52, 214, 255, 0.65);
  box-shadow:
    0 0 0 4px rgba(52, 214, 255, 0.16),
    0 24px 48px rgba(52, 214, 255, 0.14);
  animation: calendar-focus-pulse 780ms ease-in-out 2;
}

@keyframes calendar-focus-pulse {
  50% {
    transform: translateY(-2px) scale(1.012);
  }
}

.task-priority-low {
  --task-accent: var(--green);
}

.task-priority-medium {
  --task-accent: var(--yellow);
}

.task-priority-high {
  --task-accent: var(--accent);
}

.task-priority-critical {
  --task-accent: var(--red);
}

.task-card h4 {
  padding-right: 34px;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.task-complete-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(110, 231, 168, 0.38);
  border-radius: 50%;
  color: #0b2417;
  font-size: 16px;
  font-weight: 950;
  line-height: 1;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(110, 231, 168, 0.1);
}

.task-complete-button:hover {
  box-shadow:
    0 0 0 4px rgba(110, 231, 168, 0.16),
    0 0 20px rgba(110, 231, 168, 0.28);
}

.task-done .task-complete-button {
  color: #0b2417;
  background: linear-gradient(135deg, #b6ffd4, var(--green));
}

.task-card p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

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

.task-people span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 100%;
  padding: 4px 8px;
  overflow: hidden;
  border: 1px solid rgba(52, 214, 255, 0.16);
  border-radius: 999px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(52, 214, 255, 0.07);
}

.deadline-timer,
.deadline-complete {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(52, 214, 255, 0.18);
  border-radius: 999px;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.01em;
  background: rgba(52, 214, 255, 0.08);
}

.deadline-timer::before,
.deadline-complete::before {
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  content: "";
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}

.deadline-complete {
  border-color: rgba(110, 231, 168, 0.28);
  color: #c7ffdf;
  background: rgba(110, 231, 168, 0.1);
}

.deadline-complete::before {
  background: var(--green);
  box-shadow: 0 0 12px var(--green);
}

.deadline-timer.deadline-soon {
  border-color: rgba(255, 209, 102, 0.28);
  color: #ffe7a1;
  background: rgba(255, 209, 102, 0.11);
}

.deadline-timer.deadline-soon::before {
  background: var(--yellow);
  box-shadow: 0 0 12px var(--yellow);
}

.deadline-timer.deadline-overdue {
  border-color: rgba(255, 93, 115, 0.34);
  color: #ffb5bf;
  background: rgba(255, 93, 115, 0.13);
}

.deadline-timer.deadline-overdue::before {
  background: var(--red);
  box-shadow: 0 0 12px var(--red);
}

.task-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.priority-badge,
.attachment-badge,
.blocker-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
}

.attachment-badge {
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.08);
}

.blocker-badge {
  color: #32070d;
  background: #ff8796;
}

.priority-low {
  color: #0b2417;
  background: var(--green);
}

.priority-medium {
  color: #281b02;
  background: var(--yellow);
}

.priority-high {
  color: #2d0d04;
  background: #ff9b64;
}

.priority-critical {
  color: #32070d;
  background: #ff8796;
}

.empty-column {
  display: grid;
  place-items: center;
  min-height: 170px;
  padding: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.035);
}

.empty-column span {
  color: var(--muted-2);
  font-weight: 950;
}

.empty-column small {
  max-width: 200px;
  line-height: 1.35;
}

.task-dialog {
  width: min(780px, calc(100vw - 28px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 32px;
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.055)),
    rgba(11, 16, 28, 0.95);
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(28px);
}

.task-dialog::backdrop {
  background:
    radial-gradient(circle at 20% 20%, rgba(52, 214, 255, 0.18), transparent 28rem),
    radial-gradient(circle at 82% 12%, rgba(255, 107, 74, 0.2), transparent 26rem),
    rgba(2, 5, 10, 0.72);
  backdrop-filter: blur(10px);
}

.task-form {
  display: grid;
  gap: 18px;
  padding: 26px;
}

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

.dialog-head h3 {
  margin-top: 5px;
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.065em;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
  background: rgba(255, 255, 255, 0.08);
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.field,
.field-grid {
  display: grid;
  gap: 9px;
}

.field-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field span {
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.04em;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
}

.field input,
.field select {
  min-height: 48px;
  padding: 0 14px;
}

.field textarea {
  min-height: 136px;
  padding: 14px;
  resize: vertical;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--line-strong);
}

.field select {
  color-scheme: dark;
  cursor: pointer;
}

.field select option {
  color: var(--ink);
  background: #1f2635;
}

.field select option:checked,
.field select option:hover {
  color: #07101c;
  background: var(--cyan);
}

.deadline-picker {
  position: relative;
}

.deadline-trigger {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  font-weight: 700;
  text-align: left;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035)),
    rgba(255, 255, 255, 0.07);
}

.deadline-trigger::before {
  margin-right: 9px;
  color: var(--cyan);
  content: "▣";
}

.deadline-trigger:hover {
  border-color: var(--line-strong);
}

.task-history {
  display: grid;
  gap: 12px;
  max-height: 230px;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.task-history[hidden] {
  display: none;
}

.task-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.task-history-head span {
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.04em;
}

.task-history-head small {
  color: var(--muted);
  font-weight: 900;
}

.task-history ul {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.task-history li {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.task-history li div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.task-history strong {
  font-size: 13px;
}

.task-history span,
.task-history p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.task-history p {
  margin: 0;
}

.calendar-popover {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 50;
  width: min(340px, calc(100vw - 56px));
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06)),
    rgba(11, 16, 28, 0.98);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.calendar-head {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.calendar-head strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-nav {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  background: rgba(255, 255, 255, 0.07);
}

.calendar-nav:hover {
  background: rgba(52, 214, 255, 0.16);
}

.calendar-weekdays,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar-weekdays {
  margin-bottom: 7px;
}

.calendar-weekdays span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.calendar-day,
.calendar-day-empty {
  aspect-ratio: 1;
  min-width: 0;
  border-radius: 12px;
}

.calendar-day {
  border: 1px solid transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.065);
}

.calendar-day:hover {
  border-color: rgba(52, 214, 255, 0.36);
  background: rgba(52, 214, 255, 0.14);
}

.calendar-day.today {
  border-color: rgba(255, 209, 102, 0.42);
  color: #ffe7a1;
}

.calendar-day.selected {
  border-color: rgba(110, 231, 168, 0.68);
  color: #07101c;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(110, 231, 168, 0.12);
}

.calendar-time-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
}

.calendar-time-row span {
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 900;
}

.calendar-time {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
}

.calendar-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.calendar-action {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.07);
}

.calendar-action:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.11);
}

.calendar-action.primary-action {
  color: #07101c;
  background: var(--green);
}

.checkbox-field {
  align-self: end;
  min-height: 48px;
  grid-template-columns: auto 1fr;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
}

.checkbox-field input {
  width: 18px;
  min-height: auto;
  height: 18px;
  padding: 0;
  accent-color: var(--red);
}

.checkbox-field input:disabled + span {
  color: var(--muted);
}

.paste-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(52, 214, 255, 0.24);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(52, 214, 255, 0.13), rgba(110, 231, 168, 0.08)),
    rgba(255, 255, 255, 0.045);
}

.paste-zone p {
  margin: 5px 0 0;
  color: var(--muted);
}

.paste-hint {
  flex: 0 0 auto;
  padding: 8px 11px;
  border-radius: 999px;
  color: #06131d;
  font-size: 12px;
  font-weight: 950;
  background: var(--cyan);
}

.attachments {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.attachment {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.attachment img {
  display: block;
  width: 100%;
  height: 122px;
  object-fit: cover;
}

.attachment button {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 950;
  background: rgba(8, 11, 18, 0.72);
  backdrop-filter: blur(8px);
}

.attachment-name {
  padding: 9px 10px;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialog-actions {
  justify-content: space-between;
  padding-top: 4px;
}

.branch-context-menu {
  position: fixed;
  z-index: 30;
  width: 244px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.055)),
    rgba(11, 16, 28, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.branch-menu-title {
  margin-bottom: 10px;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.branch-menu-action {
  width: 100%;
  min-height: 39px;
  margin-bottom: 8px;
  padding: 9px 11px;
  border-radius: 13px;
  color: #08111d;
  font-weight: 950;
  background: var(--cyan);
}

.branch-menu-action:hover {
  background: #75e5ff;
}

.branch-menu-action-secondary {
  margin-bottom: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.09);
}

.branch-menu-action-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.branch-menu-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.branch-menu-label-presets {
  margin-top: 12px;
}

.branch-custom-color {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.06);
}

.branch-custom-color input {
  width: 48px;
  height: 32px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  cursor: pointer;
  background: transparent;
}

.branch-color-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.branch-color-choice {
  width: 29px;
  height: 29px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: var(--choice-color);
}

.branch-color-choice:hover,
.branch-color-choice.selected {
  border-color: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 20% 20%, rgba(52, 214, 255, 0.18), transparent 28rem),
    radial-gradient(circle at 82% 12%, rgba(255, 107, 74, 0.2), transparent 26rem),
    rgba(2, 5, 10, 0.82);
  backdrop-filter: blur(18px);
}

.auth-card {
  display: grid;
  gap: 18px;
  width: min(440px, 100%);
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.055)),
    rgba(11, 16, 28, 0.96);
  box-shadow: var(--shadow);
}

.auth-card h2 {
  margin: 5px 0 0;
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.06em;
}

.auth-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.auth-feedback {
  min-height: 22px;
  color: #ffb5bf;
  font-size: 13px;
  font-weight: 850;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  max-width: min(420px, calc(100vw - 48px));
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  font-weight: 950;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.06)),
    rgba(11, 16, 28, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  animation: toast-in 180ms ease both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .workspace,
  .sidebar {
    padding: 20px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .topbar-insights {
    width: 100%;
    min-width: 0;
  }

  .global-calendar,
  .global-dashboard {
    width: 100%;
    max-width: none;
  }

  .bot-settings-grid,
  .bot-form-grid,
  .bot-settings-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .workspace {
    padding: 16px;
  }

  .topbar h2 {
    white-space: normal;
  }

  .bot-settings-hero {
    flex-direction: column;
    min-height: 0;
  }

  .bot-settings-card-head,
  .bot-form-footer {
    flex-direction: column;
  }

  .bot-editor-note,
  .bot-form-footer .primary {
    width: 100%;
  }

  .topbar-actions,
  .dialog-actions,
  .dialog-actions-right {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-insights {
    flex-direction: column;
    min-width: 0;
  }

  .global-calendar,
  .global-dashboard {
    min-width: 0;
  }

  .bot-history-list li {
    grid-template-columns: 1fr;
  }

  .bot-history-list small {
    text-align: left;
  }

  .board,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .task-history li div {
    display: grid;
  }

  .paste-zone {
    align-items: flex-start;
    flex-direction: column;
  }
}
