* {
  box-sizing: border-box;
}

:root {
  --panel: #17181b;
  --panel-2: #202126;
  --panel-3: #2b2d34;
  --line: rgba(255, 255, 255, 0.1);
  --text: rgba(255, 255, 255, 0.9);
  --muted: rgba(255, 255, 255, 0.46);
  --purple: #5d43d5;
  --purple-2: #4930b4;
  --canvas-bg: #0c0d0f;
  --glass: rgba(24, 25, 30, 0.72);
  --glass-strong: rgba(28, 30, 36, 0.88);
  --glass-line: rgba(255, 255, 255, 0.12);
  --accent: #6f7dff;
  --accent-2: #64d2ff;
  --grid-size: 30px;
  --icon-pointer: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 3l12.2 12.2-5.5.6-2.4 5L4 3z'/%3E%3C/svg%3E");
  --icon-hand: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 11.5V6.2a1.7 1.7 0 0 1 3.4 0V11'/%3E%3Cpath d='M10.4 11V4.7a1.7 1.7 0 0 1 3.4 0V11'/%3E%3Cpath d='M13.8 11V6.2a1.7 1.7 0 0 1 3.4 0v7.2'/%3E%3Cpath d='M7 12l-1.2-1.2a1.8 1.8 0 0 0-2.6 2.5l4.5 5.2A6.2 6.2 0 0 0 12.4 21h1.1a5.7 5.7 0 0 0 5.7-5.7V9.5a1.7 1.7 0 0 0-3.4 0'/%3E%3C/svg%3E");
  --icon-folder: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 6.5h6l2 2h9v9.5a2 2 0 0 1-2 2h-15a2 2 0 0 1-2-2v-9.5a2 2 0 0 1 2-2z'/%3E%3Cpath d='M3.5 8.5h17'/%3E%3C/svg%3E");
  --icon-add: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='5' width='14' height='14' rx='2'/%3E%3Cpath d='M12 8.5v7M8.5 12h7'/%3E%3C/svg%3E");
  --icon-undo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 7H4v5'/%3E%3Cpath d='M4 12a8 8 0 1 0 2.3-5.7L4 8.6'/%3E%3C/svg%3E");
  --icon-redo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 7h5v5'/%3E%3Cpath d='M20 12a8 8 0 1 1-2.3-5.7L20 8.6'/%3E%3C/svg%3E");
  --icon-clock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8'/%3E%3Cpath d='M12 7.5V12l3 2'/%3E%3C/svg%3E");
  --icon-collapse: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='5' width='16' height='14' rx='2'/%3E%3Cpath d='M9 5v14M15 9l-3 3 3 3'/%3E%3C/svg%3E");
  --icon-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='5' width='16' height='14' rx='2'/%3E%3Ccircle cx='9' cy='10' r='1.5'/%3E%3Cpath d='M20 15l-4-4-5 5-2-2-5 5'/%3E%3C/svg%3E");
  --icon-video: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='6' width='12' height='12' rx='2'/%3E%3Cpath d='M16 10l4-2.5v9L16 14'/%3E%3Cpath d='M8 10h4M8 14h4'/%3E%3C/svg%3E");
  --icon-mic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='3' width='6' height='11' rx='3'/%3E%3Cpath d='M5 11a7 7 0 0 0 14 0M12 18v3M9 21h6'/%3E%3C/svg%3E");
  --icon-cube: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l8 4.5v9L12 21l-8-4.5v-9L12 3z'/%3E%3Cpath d='M4 7.5l8 4.5 8-4.5M12 12v9'/%3E%3C/svg%3E");
  --icon-export: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4'/%3E%3Cpath d='M7 9l5-5 5 5'/%3E%3Cpath d='M5 14v4a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-4'/%3E%3C/svg%3E");
  --icon-fit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9V5a1 1 0 0 1 1-1h4M15 4h4a1 1 0 0 1 1 1v4M20 15v4a1 1 0 0 1-1 1h-4M9 20H5a1 1 0 0 1-1-1v-4'/%3E%3Cpath d='M12 8v8M8 12h8'/%3E%3C/svg%3E");
  --icon-layers: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l8 4-8 4-8-4 8-4z'/%3E%3Cpath d='M4 12l8 4 8-4M4 17l8 4 8-4'/%3E%3C/svg%3E");
  --icon-settings: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15.2a3.2 3.2 0 1 0 0-6.4 3.2 3.2 0 0 0 0 6.4z'/%3E%3Cpath d='M19.4 15a1.7 1.7 0 0 0 .3 1.9l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.9-.3 1.7 1.7 0 0 0-1 1.6V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1-1.6 1.7 1.7 0 0 0-1.9.3l-.1.1A2 2 0 1 1 4.2 17l.1-.1a1.7 1.7 0 0 0 .3-1.9 1.7 1.7 0 0 0-1.6-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.6-1 1.7 1.7 0 0 0-.3-1.9L4.3 7A2 2 0 1 1 7.1 4.2l.1.1a1.7 1.7 0 0 0 1.9.3 1.7 1.7 0 0 0 1-1.6V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.6 1.7 1.7 0 0 0 1.9-.3l.1-.1A2 2 0 1 1 19.8 7l-.1.1a1.7 1.7 0 0 0-.3 1.9 1.7 1.7 0 0 0 1.6 1h.1a2 2 0 1 1 0 4H21a1.7 1.7 0 0 0-1.6 1z'/%3E%3C/svg%3E");
  --icon-cli: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 5.5a4 4 0 1 1 4 4'/%3E%3Cpath d='M9.5 18.5a4 4 0 1 1-4-4'/%3E%3Cpath d='M14 10l-4 4'/%3E%3Cpath d='M17 8l2 2M5 14l2 2'/%3E%3C/svg%3E");
  --icon-policy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 10v6M12 7h.01'/%3E%3C/svg%3E");
  --icon-feedback: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12a8 8 0 0 1 16 0v3a3 3 0 0 1-3 3h-2'/%3E%3Cpath d='M7 13v-2a2 2 0 0 1 2-2h.5v6H9a2 2 0 0 1-2-2zM17 13v-2a2 2 0 0 0-2-2h-.5v6h.5a2 2 0 0 0 2-2z'/%3E%3Cpath d='M13 18h-2'/%3E%3C/svg%3E");
  --icon-report: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4l9 16H3L12 4z'/%3E%3Cpath d='M12 9v5M12 17h.01'/%3E%3C/svg%3E");
  --icon-edit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L8 18l-4 1 1-4 11.5-11.5z'/%3E%3C/svg%3E");
  --icon-expand: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5'/%3E%3Cpath d='M9 4L4 9M15 4l5 5M9 20l-5-5M15 20l5-5'/%3E%3C/svg%3E");
  --icon-upscale: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 17l5-5 3 3 6-7'/%3E%3Cpath d='M15 8h4v4'/%3E%3Cpath d='M4 20h16'/%3E%3C/svg%3E");
  --icon-erase: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 16l9-9a2.8 2.8 0 0 1 4 0l1 1a2.8 2.8 0 0 1 0 4l-7 7H6l-2-3z'/%3E%3Cpath d='M10 10l5 5M14 19h6'/%3E%3C/svg%3E");
  --icon-cutout: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3'/%3E%3Cpath d='M4 20c.8-3.3 2.6-5 5-5s4.2 1.7 5 5'/%3E%3Cpath d='M17 4v16M20 7h-6M20 17h-6'/%3E%3C/svg%3E");
  --icon-text: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 5h14M12 5v14M8 19h8'/%3E%3Crect x='3' y='3' width='18' height='18' rx='3'/%3E%3C/svg%3E");
  --icon-crop: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 3v14h14'/%3E%3Cpath d='M3 7h14v14'/%3E%3C/svg%3E");
  --icon-chat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 5h14a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H9l-5 4v-4H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2z'/%3E%3Cpath d='M8 10h8M8 14h5'/%3E%3C/svg%3E");
  --icon-delete: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16'/%3E%3Cpath d='M10 11v6M14 11v6'/%3E%3Cpath d='M6 7l1 13h10l1-13'/%3E%3Cpath d='M9 7V4h6v3'/%3E%3C/svg%3E");
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: #0f1011;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  display: grid;
  grid-template-columns: 392px minmax(0, 1fr);
  min-height: 100vh;
  overflow: hidden;
}

body.sidebar-collapsed {
  grid-template-columns: 76px minmax(0, 1fr);
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.task-sidebar {
  position: relative;
  z-index: 6;
  display: grid;
  grid-template-rows: 72px minmax(0, 1fr) 142px;
  height: 100vh;
  margin: 0;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(28, 29, 33, 0.96), rgba(18, 19, 22, 0.98)),
    var(--panel);
  box-shadow: 18px 0 60px rgba(0, 0, 0, 0.32);
  overflow: hidden;
}

.task-sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent calc(100% - 1px), rgba(255, 255, 255, 0.08)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 26%);
}

.task-sidebar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 18px 20px 8px 20px;
}

.task-logo {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 5px;
  color: #f7f8ff;
  text-decoration: none;
  font-size: 19px;
  font-weight: 850;
  line-height: 1;
}

.task-logo img {
  display: block;
  width: 31px;
  height: 31px;
  filter: brightness(0) invert(1) opacity(0.9);
}

.task-logo span {
  display: block;
}

.task-side-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  min-width: 184px;
}

.task-side-actions button {
  position: relative;
  width: 54px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 25px 0 0;
  background: rgba(255, 255, 255, 0.028);
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  font-weight: 780;
  line-height: 1.05;
  text-align: center;
  white-space: nowrap;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.task-side-actions button::before,
.task-chat-tools button::before,
.task-toolbar button::before,
.task-zoom button[data-zoom="fit"]::before,
.task-zoom button[data-zoom="layers"]::before {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.task-side-actions button::before {
  position: absolute;
  top: 6px;
  left: 50%;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 0;
  background: currentColor;
  -webkit-mask: var(--side-icon) center / contain no-repeat;
  mask: var(--side-icon) center / contain no-repeat;
  transform: translateX(-50%);
}

.task-side-actions button:hover {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.065);
  color: #fff;
  transform: translateY(-1px);
}

.task-side-actions button[data-side-action="new"]::before {
  content: "";
  --side-icon: var(--icon-add);
}

.task-side-actions button[data-side-action="history"]::before {
  content: "";
  --side-icon: var(--icon-clock);
}

.task-side-actions button[data-side-action="collapse"]::before {
  content: "";
  --side-icon: var(--icon-collapse);
}

.task-side-actions button:hover,
.task-toolbar button:hover,
.task-zoom button:hover,
.task-chat-tools button:hover,
.task-refresh:hover,
.task-export:hover,
.task-popover button:hover,
.task-panel button:hover {
  color: #fff;
  filter: brightness(1.08);
}

.task-thread {
  position: relative;
  min-height: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  padding: 13px 50px 18px 27px;
  overflow: auto;
}

.task-thread::-webkit-scrollbar,
.task-panel-body::-webkit-scrollbar {
  width: 8px;
}

.task-thread::-webkit-scrollbar-thumb,
.task-panel-body::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
}

.task-refresh {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, 0.24);
  font-size: 24px;
  line-height: 1;
}

.task-thread h1 {
  width: 100%;
  height: 28px;
  margin: 0;
  padding: 3px 10px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  color: rgba(255, 255, 255, 0.68);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.task-thread p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.29);
  font-size: 12px;
  font-weight: 600;
}

.task-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}

.task-message {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 9px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.035);
}

.task-message strong {
  display: block;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
}

.task-message span,
.task-message pre {
  margin: 0;
  color: rgba(255, 255, 255, 0.54);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.task-message.is-pending {
  border-color: rgba(111, 172, 255, 0.28);
  background: rgba(64, 139, 255, 0.08);
}

.task-message-media {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 188px));
  gap: 10px;
  margin-top: 10px;
}

.task-message-media figure {
  display: grid;
  gap: 7px;
  margin: 0;
}

.task-message-media img,
.task-message-media video {
  width: 100%;
  max-height: 172px;
  object-fit: contain;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
}

.task-message-media audio {
  width: 100%;
}

.task-message-media a {
  width: fit-content;
  color: rgba(128, 190, 255, 0.94);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.task-chat {
  padding: 14px 20px 16px 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.015), rgba(0, 0, 0, 0.14)), var(--panel);
}

.task-chat label {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.task-chat textarea {
  display: block;
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 10px 12px;
  resize: none;
  outline: none;
  background: rgba(0, 0, 0, 0.16);
  color: #fff;
  line-height: 1.5;
}

.task-chat textarea:focus {
  border-color: rgba(111, 125, 255, 0.42);
  box-shadow: 0 0 0 3px rgba(111, 125, 255, 0.1);
}

.task-chat textarea::placeholder {
  color: rgba(255, 255, 255, 0.25);
  font-weight: 700;
}

.task-chat-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 7px;
}

.task-chat-tools button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(255, 255, 255, 0.8);
}

.task-chat-tools button::before {
  content: none;
  display: none;
}

.task-chat-tools button:hover,
.task-chat-tools button:focus-visible {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
}

.task-chat-tools .task-send {
  margin-left: auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: #fff;
  font-size: 0;
  box-shadow: 0 10px 24px rgba(83, 76, 220, 0.28);
}

.task-chat-tools .task-send::before {
  content: none;
  display: none;
}

.chat-tool-icon,
.chat-send-icon {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-tool-icon {
  width: 18px;
  height: 18px;
}

.chat-send-icon {
  width: 22px;
  height: 22px;
  stroke-width: 2.4;
}

.task-canvas {
  position: relative;
  min-width: 0;
  min-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px) 0 0 / 120px 120px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px) 0 0 / 120px 120px,
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.075) 1.15px, transparent 1.7px) 0 0 / var(--grid-size) var(--grid-size),
    var(--canvas-bg);
}

.task-canvas::before {
  content: none;
}

.task-canvas::after {
  content: none;
}

.task-canvas.is-hand {
  cursor: grab;
}

.task-canvas.is-hand .canvas-asset,
.task-canvas.is-hand .canvas-stage {
  cursor: grab;
}

.task-canvas.is-panning,
.task-canvas.is-panning .canvas-asset,
.task-canvas.is-panning .canvas-stage {
  cursor: grabbing;
}

.task-canvas.is-select {
  cursor: default;
}

.task-canvas.is-performance-mode .canvas-asset:not(.is-selected) {
  box-shadow: none;
}

.task-topbar {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 14px;
  padding: 5px 8px 5px 6px;
  background: rgba(22, 23, 28, 0.76);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px) saturate(140%);
}

.task-export {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  padding: 0 14px;
  background: linear-gradient(135deg, #6f7dff, #5f45df);
  color: rgba(255, 255, 255, 0.88);
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(81, 80, 220, 0.34);
}

.task-export::before {
  content: none;
  display: none;
}

.task-export .task-button-icon {
  width: 17px;
  height: 17px;
  stroke-width: 2.2;
}

.task-avatar {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 35%, #fff 0 20%, transparent 22%),
    radial-gradient(circle at 50% 82%, #fff 0 32%, transparent 34%),
    #ececf0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.task-credits {
  min-width: 78px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.canvas-stage {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
  pointer-events: auto;
  will-change: transform;
  transform-style: preserve-3d;
}

.canvas-empty {
  position: absolute;
  left: 50%;
  top: 48%;
  z-index: 2;
  display: grid;
  width: min(420px, calc(100vw - 48px));
  gap: 14px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 18px;
  background: rgba(22, 23, 28, 0.76);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.28);
  color: rgba(255, 255, 255, 0.86);
  pointer-events: auto;
}

.canvas-empty strong {
  font-size: 16px;
  font-weight: 900;
}

.canvas-empty div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.canvas-empty button {
  display: inline-flex;
  height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 850;
}

.canvas-empty button:hover {
  border-color: rgba(139, 156, 255, 0.38);
  background: rgba(111, 125, 255, 0.22);
  color: #fff;
}

.canvas-empty-icon {
  width: 16px;
  height: 16px;
}

.is-library-dragging .task-canvas {
  outline: 1px solid rgba(139, 156, 255, 0.32);
  outline-offset: -1px;
}

.is-library-dragging .task-asset-panel {
  pointer-events: none;
  opacity: 0.48;
}

.canvas-asset {
  position: absolute;
  border-radius: 2px;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  pointer-events: auto;
  user-select: none;
  touch-action: none;
  transform-origin: center;
  contain: layout paint style;
  content-visibility: auto;
  contain-intrinsic-size: 520px 520px;
  will-change: left, top, width, height, transform;
}

.canvas-asset img,
.canvas-asset video {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 2px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.15);
  -webkit-user-drag: none;
  backface-visibility: hidden;
}

.canvas-asset.is-lightweight {
  contain: strict;
}

.canvas-asset-placeholder {
  display: flex;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(123, 146, 255, 0.22);
  border-radius: 4px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.052), rgba(255, 255, 255, 0.018)),
    rgba(28, 29, 34, 0.74);
  color: rgba(235, 238, 255, 0.72);
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

.canvas-asset-placeholder .task-svg-icon {
  width: 28px;
  height: 28px;
  color: rgba(180, 190, 255, 0.82);
}

.canvas-asset-placeholder strong {
  font-size: 13px;
  font-weight: 850;
}

.canvas-asset-placeholder small {
  max-width: 82%;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.42);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-text-layer,
.canvas-shape-layer,
.canvas-arrow-layer {
  display: flex;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

.canvas-text-layer {
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 10px 14px;
  background: rgba(12, 14, 18, 0.18);
  line-height: 1.16;
  outline: none;
  text-wrap: balance;
  word-break: break-word;
}

.canvas-text-layer[contenteditable="true"] {
  cursor: text;
  user-select: text;
}

.canvas-shape-layer {
  border-style: solid;
  border-radius: 14px;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.18);
}

.canvas-shape-layer.is-circle {
  border-radius: 999px;
}

.canvas-arrow-layer {
  display: block;
  overflow: visible;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.18));
}

.canvas-flow-overlay {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 0;
  width: 3600px;
  height: 2400px;
  overflow: visible;
  pointer-events: none;
}

.canvas-flow-overlay marker path {
  fill: rgba(120, 167, 255, 0.76);
}

.canvas-flow-path {
  fill: none;
  stroke: rgba(120, 167, 255, 0.72);
  stroke-width: 2;
  stroke-dasharray: 7 8;
  filter: drop-shadow(0 8px 14px rgba(50, 100, 255, 0.16));
}

.canvas-flow-label {
  fill: rgba(225, 234, 255, 0.86);
  font-size: 12px;
  font-weight: 800;
  paint-order: stroke;
  stroke: rgba(16, 18, 23, 0.9);
  stroke-width: 4px;
}

.canvas-asset-badges {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: calc(100% - 16px);
  pointer-events: none;
}

.canvas-asset-badges em {
  max-width: 116px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  padding: 4px 7px;
  background: rgba(15, 17, 22, 0.72);
  color: rgba(255, 255, 255, 0.86);
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(12px);
}

.canvas-asset-missing {
  display: flex;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  border: 1px solid rgba(115, 137, 255, 0.22);
  border-radius: 6px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    rgba(18, 18, 23, 0.72);
  color: rgba(255, 255, 255, 0.86);
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

.canvas-asset-missing-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(98, 126, 255, 0.14);
  color: rgba(185, 197, 255, 0.92);
}

.canvas-asset-missing-icon::before {
  display: block;
  width: 100%;
  height: 100%;
  content: "";
  background: currentColor;
  -webkit-mask: var(--icon-image) center / 18px 18px no-repeat;
  mask: var(--icon-image) center / 18px 18px no-repeat;
}

.canvas-asset-missing strong {
  font-size: 15px;
  font-weight: 800;
}

.canvas-asset-missing span,
.canvas-asset-missing small {
  max-width: 100%;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-asset-missing small {
  color: rgba(255, 255, 255, 0.42);
}

.canvas-asset-missing-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.canvas-asset-missing-actions button {
  min-height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 800;
}

.canvas-asset-missing-actions button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.canvas-asset-missing-actions button[data-remove-canvas-asset] {
  color: #ffbbbb;
}

.canvas-asset.is-processing img,
.canvas-asset.is-processing video {
  filter: blur(11px) brightness(0.7) saturate(0.88);
  transition: filter 140ms ease;
}

.canvas-asset.is-processing::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 2px;
  background: rgba(18, 18, 22, 0.18);
  pointer-events: none;
}

.canvas-asset.is-selected {
  outline: 2px solid #3478ff;
  outline-offset: 0;
}

.canvas-asset.is-multi-selected {
  outline-color: #5de0ff;
  outline-style: dashed;
}

.canvas-marquee {
  position: absolute;
  z-index: 5;
  border: 1px solid rgba(93, 224, 255, 0.92);
  border-radius: 8px;
  background: rgba(93, 224, 255, 0.13);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16) inset;
  pointer-events: none;
}

.canvas-asset.is-locked {
  cursor: default;
}

.canvas-asset.is-locked.is-selected {
  outline-style: dashed;
  outline-color: #8aa8ff;
}

.canvas-asset-loader {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  width: min(82%, 260px);
  text-align: center;
}

.canvas-asset-loader-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.canvas-asset-loader-dots i {
  display: block;
  width: 15px;
  height: 15px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  animation: canvas-loader-dot 1s ease-in-out infinite;
}

.canvas-asset-loader-dots i:nth-child(2) {
  animation-delay: 0.12s;
}

.canvas-asset-loader-dots i:nth-child(3) {
  animation-delay: 0.24s;
}

.canvas-asset-loader-text {
  display: grid;
  gap: 4px;
  max-width: 100%;
  border-radius: 999px;
  padding: 7px 12px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(18, 18, 24, 0.58);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(10px);
}

.canvas-asset-loader-text strong,
.canvas-asset-loader-text small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-asset-loader-text strong {
  font-size: 12px;
  font-weight: 800;
}

.canvas-asset-loader-text small {
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  font-weight: 700;
}

@keyframes canvas-loader-dot {
  0%,
  80%,
  100% {
    opacity: 0.42;
    transform: scale(0.86);
  }

  40% {
    opacity: 1;
    transform: scale(1);
  }
}

.canvas-size-label {
  position: absolute;
  right: -1px;
  top: -36px;
  z-index: 3;
  border-radius: 7px;
  padding: 7px 10px;
  background: rgba(24, 24, 28, 0.92);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.canvas-resize-dot {
  position: absolute;
  z-index: 3;
  width: 8px;
  height: 8px;
  border: 1px solid #dbe8ff;
  background: #3478ff;
}

.dot-nw { left: -5px; top: -5px; }
.dot-ne { right: -5px; top: -5px; }
.dot-sw { left: -5px; bottom: -5px; }
.dot-se { right: -5px; bottom: -5px; }

.dot-nw,
.dot-se {
  cursor: nwse-resize;
}

.dot-ne,
.dot-sw {
  cursor: nesw-resize;
}

.canvas-rotate-dot {
  position: absolute;
  left: 50%;
  bottom: -30px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: #3478ff;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  padding: 0;
  transform: translateX(-50%);
}

.canvas-asset.is-mask-editing {
  cursor: crosshair;
}

.canvas-mask-box {
  position: absolute;
  z-index: 2;
  display: block;
  border: 2px solid #5de0ff;
  border-radius: 8px;
  background: rgba(93, 224, 255, 0.22);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.38) inset;
  pointer-events: none;
}

.canvas-crop-box {
  position: absolute;
  z-index: 3;
  display: block;
  border: 2px solid #fff;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.42) 1px, transparent 1px) 0 0 / 33.33% 100%,
    linear-gradient(rgba(255, 255, 255, 0.42) 1px, transparent 1px) 0 0 / 100% 33.33%,
    rgba(52, 120, 255, 0.08);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(52, 120, 255, 0.74) inset;
  pointer-events: none;
}

.canvas-mask-paint {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  opacity: 0.48;
  mix-blend-mode: screen;
  pointer-events: none;
}

.canvas-asset.is-mask-editing .canvas-mask-paint {
  pointer-events: auto;
  cursor: crosshair;
}

.canvas-mask-toolbar,
.canvas-crop-toolbar,
.canvas-mask-clear,
.canvas-lock-hint {
  position: absolute;
  z-index: 4;
  left: 12px;
}

.canvas-mask-toolbar {
  right: auto;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(18, 19, 24, 0.82);
  color: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(14px);
}

.canvas-crop-toolbar {
  right: 12px;
  bottom: 12px;
  left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 5px 8px 5px 12px;
  background: rgba(18, 19, 24, 0.86);
  color: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(14px);
}

.canvas-crop-toolbar span {
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.canvas-crop-toolbar button {
  min-height: 26px;
  border: 0;
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 11px;
  font-weight: 850;
}

.canvas-crop-toolbar button[data-apply-crop] {
  background: #fff;
  color: #111217;
}

.canvas-mask-toolbar > span,
.canvas-mask-toolbar label span {
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.canvas-mask-toolbar button {
  min-height: 24px;
  border: 0;
  border-radius: 999px;
  padding: 0 9px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.74);
  font-size: 11px;
  font-weight: 850;
}

.canvas-mask-toolbar button.active {
  background: #5de0ff;
  color: #071012;
}

.canvas-mask-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.canvas-mask-toolbar input {
  width: 76px;
}

.canvas-mask-clear {
  bottom: 48px;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(20, 20, 25, 0.84);
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(12px);
}

.canvas-lock-hint {
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(138, 168, 255, 0.92);
  color: #071029;
  font-size: 12px;
  font-weight: 850;
  pointer-events: none;
}

.canvas-action-menu {
  position: absolute;
  z-index: 6;
  display: grid;
  gap: 4px;
  width: 168px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 8px;
  background: rgba(21, 21, 27, 0.96);
  box-shadow: 0 20px 58px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(18px);
  pointer-events: auto;
}

.canvas-action-menu.is-disabled {
  opacity: 0.52;
  pointer-events: none;
}

.canvas-action-menu button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  width: 100%;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 0 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}

.canvas-action-menu button:disabled {
  cursor: default;
}

.canvas-action-menu button:hover {
  border-color: rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.075);
  color: #fff;
}

.canvas-action-menu button[data-canvas-command="delete"] {
  color: #ffb4b4;
}

.canvas-action-menu button[data-canvas-command="delete"]:hover {
  background: rgba(255, 82, 82, 0.14);
  color: #fff;
}

.canvas-action-icon {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: currentColor;
}

.canvas-action-menu button:hover .canvas-action-icon {
  background: rgba(255, 255, 255, 0.12);
}

.canvas-action-menu button[data-canvas-command="delete"] .canvas-action-icon {
  background: rgba(255, 96, 96, 0.12);
}

.canvas-action-svg {
  width: 16px;
  height: 16px;
}

.canvas-action-menu span[data-canvas-icon="folder"] { --canvas-command-icon: var(--icon-folder); }
.canvas-action-menu span[data-canvas-icon="delete"] { --canvas-command-icon: var(--icon-delete); }
.canvas-action-menu span[data-canvas-icon="edit"] { --canvas-command-icon: var(--icon-edit); }
.canvas-action-menu span[data-canvas-icon="expand"] { --canvas-command-icon: var(--icon-expand); }
.canvas-action-menu span[data-canvas-icon="upscale"] { --canvas-command-icon: var(--icon-upscale); }
.canvas-action-menu span[data-canvas-icon="mask"] { --canvas-command-icon: var(--icon-crop); }
.canvas-action-menu span[data-canvas-icon="erase"] { --canvas-command-icon: var(--icon-erase); }
.canvas-action-menu span[data-canvas-icon="layers"] { --canvas-command-icon: var(--icon-layers); }
.canvas-action-menu span[data-canvas-icon="cutout"] { --canvas-command-icon: var(--icon-cutout); }
.canvas-action-menu span[data-canvas-icon="text"] { --canvas-command-icon: var(--icon-text); }
.canvas-action-menu span[data-canvas-icon="crop"] { --canvas-command-icon: var(--icon-crop); }
.canvas-action-menu span[data-canvas-icon="chat"] { --canvas-command-icon: var(--icon-chat); }

.canvas-note {
  position: absolute;
  left: 50%;
  top: 44%;
  width: min(480px, 42vw);
  max-height: 420px;
  transform: translate(-50%, -50%);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 18px;
  background: rgba(28, 28, 31, 0.92);
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.65;
  white-space: pre-wrap;
  pointer-events: auto;
}

.task-toolbar,
.task-zoom {
  position: absolute;
  z-index: 8;
  display: flex;
  align-items: center;
  border: 1px solid var(--glass-line);
  background: var(--glass);
  box-shadow: 0 20px 64px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(22px) saturate(150%);
}

.task-toolbar {
  left: 50%;
  bottom: 16px;
  gap: 4px;
  min-height: 66px;
  padding: 6px;
  border-radius: 20px;
  transform: translateX(-50%);
}

.task-toolbar button {
  position: relative;
  display: inline-flex;
  width: 62px;
  min-width: 62px;
  height: 54px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: 15px;
  padding: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.task-toolbar button span,
.task-zoom button span {
  display: block;
  line-height: 1;
}

.task-toolbar button:nth-child(5) {
  margin-left: 14px;
}

.task-toolbar button:nth-child(5)::after {
  content: "";
  position: absolute;
  left: -10px;
  top: 9px;
  width: 1px;
  height: 36px;
  background: rgba(255, 255, 255, 0.12);
}

.task-toolbar button::before {
  content: none;
  display: none;
}

.task-toolbar button[data-tool="select"] { --tool-icon: var(--icon-pointer); }
.task-toolbar button[data-tool="hand"] { --tool-icon: var(--icon-hand); }
.task-toolbar button[data-tool="asset"] { --tool-icon: var(--icon-folder); }
.task-toolbar button[data-tool="add"] { --tool-icon: var(--icon-add); }
.task-toolbar button[data-tool="undo"] { --tool-icon: var(--icon-undo); }
.task-toolbar button[data-tool="redo"] { --tool-icon: var(--icon-redo); }

.task-toolbar button[data-tool="add"] {
  padding-right: 0;
}

.task-toolbar button[data-tool="add"]::after {
  content: "⌄";
  position: absolute;
  right: 8px;
  top: 20px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

.task-toolbar button.active {
  border-color: rgba(139, 156, 255, 0.64);
  background:
    linear-gradient(180deg, rgba(120, 132, 255, 0.38), rgba(111, 125, 255, 0.14)),
    rgba(255, 255, 255, 0.05);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 12px 28px rgba(82, 91, 225, 0.26);
}

.task-toolbar button:not(.is-disabled):hover,
.task-zoom button:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-1px);
}

.task-toolbar button[data-tool="hand"].active,
.task-toolbar button[data-tool="hand"]:not(.active) .task-button-icon {
  color: #f2c14f;
}

.task-toolbar button.is-disabled {
  color: rgba(255, 255, 255, 0.28);
  opacity: 1;
  cursor: default;
}

.task-button-icon,
.zoom-button-icon {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.task-button-icon {
  width: 22px;
  height: 22px;
}

.task-zoom {
  right: 16px;
  bottom: 92px;
  display: flex;
  gap: 4px;
  width: auto;
  min-height: 58px;
  border-radius: 20px;
  padding: 6px;
}

.task-zoom button {
  position: relative;
  display: inline-flex;
  min-width: 42px;
  width: 42px;
  height: 46px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 0 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 800;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.task-zoom button[data-zoom="fit"],
.task-zoom button[data-zoom="layers"],
.task-zoom button[data-zoom="flow"],
.task-zoom button[data-zoom="minimap"],
.task-zoom button[data-zoom="shortcuts"] {
  width: 56px;
  min-width: 56px;
}

.task-zoom button[data-zoom="fit"] {
  margin-left: 8px;
}

.task-zoom button[data-zoom="fit"]::after {
  content: "";
  position: absolute;
  left: -7px;
  top: 8px;
  width: 1px;
  height: 30px;
  background: rgba(255, 255, 255, 0.12);
}

.task-zoom button[data-zoom="fit"]::before,
.task-zoom button[data-zoom="layers"]::before,
.task-zoom button[data-zoom="flow"]::before,
.task-zoom button[data-zoom="minimap"]::before,
.task-zoom button[data-zoom="shortcuts"]::before {
  content: none;
  display: none;
}

.task-zoom button[data-zoom="fit"] { --zoom-icon: var(--icon-fit); }
.task-zoom button[data-zoom="layers"] { --zoom-icon: var(--icon-layers); }

.task-zoom button.active {
  border-color: rgba(139, 156, 255, 0.42);
  background: linear-gradient(180deg, rgba(111, 125, 255, 0.28), rgba(255, 255, 255, 0.06));
  color: #fff;
}

.task-zoom strong {
  display: inline-flex;
  min-width: 0;
  width: 58px;
  height: 46px;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.26);
  font-size: 13px;
  font-weight: 800;
}

.zoom-button-icon {
  width: 19px;
  height: 19px;
}

.task-minimap {
  position: absolute;
  right: 16px;
  top: 74px;
  z-index: 7;
  width: 208px;
  border: 1px solid var(--glass-line);
  border-radius: 16px;
  padding: 10px;
  background: var(--glass);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(20px) saturate(145%);
}

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

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

.task-minimap-head strong,
.task-minimap > strong {
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.task-minimap-head button {
  width: auto;
  min-height: 24px;
  border: 0;
  border-radius: 7px;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 850;
}

.task-minimap > span {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.46);
  font-size: 12px;
}

.task-minimap-map {
  display: block;
  width: 100%;
  height: 134px;
  cursor: crosshair;
}

.task-minimap-bg {
  fill: rgba(255, 255, 255, 0.045);
  stroke: rgba(255, 255, 255, 0.12);
}

.task-minimap-item {
  fill: rgba(255, 255, 255, 0.22);
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 1;
}

.task-minimap-item.is-selected {
  fill: rgba(93, 224, 255, 0.46);
  stroke: rgba(126, 150, 255, 0.96);
}

.task-minimap-viewport {
  fill: rgba(126, 150, 255, 0.08);
  stroke: rgba(126, 150, 255, 0.92);
  stroke-width: 1.8;
  stroke-dasharray: 5 4;
}

.task-shortcuts-panel {
  right: 18px;
  bottom: 92px;
  top: auto;
  width: 330px;
}

.task-shortcuts {
  display: grid;
  gap: 8px;
}

.task-shortcuts div {
  display: grid;
  grid-template-columns: minmax(126px, auto) 1fr;
  gap: 10px;
  align-items: center;
  border-radius: 9px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.task-shortcuts kbd {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  padding: 0 9px;
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 900;
}

.task-shortcuts span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 760;
}

@media (max-width: 1180px) {
  .task-zoom {
    right: 16px;
    bottom: 88px;
  }

  .task-toolbar {
    max-width: calc(100vw - 424px);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .task-toolbar::-webkit-scrollbar {
    display: none;
  }
}

.task-popover,
.task-panel {
  position: fixed;
  z-index: 30;
  border: 1px solid var(--glass-line);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(31, 33, 39, 0.95), rgba(20, 21, 25, 0.96)),
    var(--panel-2);
  box-shadow: 0 24px 76px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(20px) saturate(145%);
}

.task-popover {
  right: 18px;
  top: 70px;
  width: 260px;
  padding: 14px;
}

.task-popover.is-bottom {
  top: auto;
  right: 18px;
  bottom: 92px;
}

.task-popover.is-center {
  top: auto;
  right: auto;
  left: 50%;
  bottom: 92px;
  width: 300px;
  transform: translateX(-50%);
}

.task-account-menu {
  right: 18px;
  top: 78px;
  width: 200px;
  padding: 14px 0 0;
  border-radius: 14px;
}

.task-account-head,
.task-account-uid {
  padding: 0 16px;
}

.task-account-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.task-account-head strong {
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
}

.task-account-head span {
  color: rgba(255, 255, 255, 0.42);
  font-size: 20px;
}

.task-account-uid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  color: rgba(255, 255, 255, 0.34);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.task-account-uid button {
  width: auto;
  min-width: auto;
  min-height: 0;
  padding: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  font-size: 12px;
  line-height: 1;
}

.task-account-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 36px;
  margin: 0;
  border-radius: 0;
  padding: 0 16px;
  background: transparent;
  color: rgba(255, 255, 255, 0.86);
  font-size: 15px;
  font-weight: 800;
  text-align: left;
}

.task-account-item span {
  display: block;
  width: 16px;
  height: 16px;
  margin-right: 12px;
  background: rgba(255, 255, 255, 0.62);
  -webkit-mask: var(--account-icon) center / contain no-repeat;
  mask: var(--account-icon) center / contain no-repeat;
}

.task-account-item span[data-account-icon="settings"] { --account-icon: var(--icon-settings); }
.task-account-item span[data-account-icon="cli"] { --account-icon: var(--icon-cli); }
.task-account-item span[data-account-icon="policy"] { --account-icon: var(--icon-policy); }
.task-account-item span[data-account-icon="feedback"] { --account-icon: var(--icon-feedback); }
.task-account-item span[data-account-icon="report"] { --account-icon: var(--icon-report); }

.task-account-logout {
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  border-radius: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
  background: transparent;
  color: rgba(255, 255, 255, 0.74);
  font-size: 15px;
  font-weight: 700;
}

.task-account-menu .task-account-uid button:hover,
.task-account-menu .task-account-item:hover,
.task-account-menu .task-account-logout:hover {
  background: transparent;
  color: #fff;
}

.task-popover h3,
.task-panel h3 {
  margin: 0 0 10px;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.task-popover p,
.task-panel p {
  margin: 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-line;
}

.task-popover-actions,
.task-panel-actions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.task-popover button,
.task-panel button {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-weight: 700;
  text-align: center;
}

.task-popover button.primary,
.task-panel button.primary {
  background: var(--purple);
}

.task-popover.task-account-menu .task-account-uid button {
  width: auto;
  min-width: 0;
  min-height: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.task-popover.task-account-menu .task-account-item {
  width: 100%;
  min-height: 34px;
  margin: 0;
  border-radius: 0;
  padding: 0 16px;
  background: transparent;
  color: rgba(255, 255, 255, 0.86);
  font-size: 15px;
  font-weight: 800;
  text-align: left;
}

.task-popover.task-account-menu .task-account-logout {
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  border-radius: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
  padding: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.74);
  font-size: 15px;
  font-weight: 700;
}

.task-popover.task-account-menu .task-account-uid button:hover,
.task-popover.task-account-menu .task-account-item:hover,
.task-popover.task-account-menu .task-account-logout:hover {
  background: transparent;
  color: #fff;
}

.task-popover.task-account-menu {
  right: 14px;
  top: 66px;
  width: 236px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(30, 31, 36, 0.98), rgba(18, 19, 23, 0.98)),
    #17181c;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(22px) saturate(140%);
}

.task-popover.task-account-menu .task-account-head,
.task-popover.task-account-menu .task-account-uid {
  padding: 0;
}

.task-popover.task-account-menu .task-account-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  margin: 2px 4px 0;
}

.task-popover.task-account-menu .task-account-head strong {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.94);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-popover.task-account-menu .task-account-head span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.42);
  font-size: 16px;
}

.task-popover.task-account-menu .task-account-uid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  margin: 0 4px 10px;
  color: rgba(255, 255, 255, 0.38);
  font-size: 11px;
  font-weight: 720;
}

.task-popover.task-account-menu .task-account-uid > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-popover.task-account-menu .task-account-uid button {
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: rgba(255, 255, 255, 0.055);
  color: rgba(255, 255, 255, 0.52);
  font-size: 11px;
  font-weight: 800;
}

.task-popover.task-account-menu .task-account-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  margin: 1px 0;
  border-radius: 12px;
  padding: 0 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  font-weight: 820;
  text-align: left;
}

.task-popover.task-account-menu .task-account-item span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  -webkit-mask: none;
  mask: none;
}

.task-popover.task-account-menu .task-account-item span::before {
  content: "";
  display: block;
  width: 15px;
  height: 15px;
  background: rgba(255, 255, 255, 0.68);
  -webkit-mask: var(--account-icon) center / contain no-repeat;
  mask: var(--account-icon) center / contain no-repeat;
}

.task-popover.task-account-menu .task-account-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.task-popover.task-account-menu .task-account-item:hover span {
  background: rgba(111, 125, 255, 0.18);
}

.task-popover.task-account-menu .task-account-logout {
  min-height: 42px;
  margin: 10px -10px -10px;
  border-radius: 0 0 18px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
  padding: 0;
  background: rgba(255, 255, 255, 0.025);
  color: rgba(255, 255, 255, 0.68);
  font-size: 14px;
  font-weight: 820;
}

.task-popover.task-account-menu .task-account-uid button:hover,
.task-popover.task-account-menu .task-account-logout:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.task-panel {
  left: 428px;
  bottom: 92px;
  width: 320px;
  max-height: min(480px, calc(100vh - 130px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.task-chat-panel {
  left: 18px;
  bottom: 126px;
  width: min(348px, calc(404px - 36px));
  max-height: min(360px, calc(100vh - 160px));
  border-radius: 16px;
  background: rgba(24, 24, 29, 0.97);
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(18px);
}

.task-chat-panel .task-panel-body {
  padding: 10px;
}

.task-chat-panel .task-panel-row {
  min-height: 58px;
  border-radius: 12px;
  padding: 11px;
  background: rgba(255, 255, 255, 0.055);
}

.task-chat-panel .task-panel-row button {
  border-radius: 10px;
}

.task-asset-panel {
  left: 50%;
  top: 49%;
  bottom: auto;
  width: min(1000px, calc(100vw - 460px));
  min-height: 680px;
  max-height: min(680px, calc(100vh - 116px));
  transform: translate(-50%, -50%);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(29, 29, 34, 0.98) 0 58%, rgba(86, 86, 89, 0.9) 100%),
    #1e1e23;
  backdrop-filter: blur(22px);
}

.task-add-menu {
  left: 50%;
  bottom: 76px;
  width: 144px;
  max-height: none;
  transform: translateX(-50%);
  background: #1c1c20;
  overflow: visible;
}

.task-add-menu .task-panel-header {
  display: none;
}

.task-add-menu .task-panel-body {
  padding: 10px;
}

.task-add-list {
  display: grid;
  gap: 2px;
}

.task-add-list button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 28px;
  border-radius: 6px;
  padding: 0 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  text-align: left;
}

.task-add-list button::before {
  width: 18px;
  margin-right: 8px;
  color: rgba(255, 255, 255, 0.62);
}

.task-add-list button:nth-child(1)::before { content: "▧"; }
.task-add-list button:nth-child(2)::before { content: "▣"; }
.task-add-list button:nth-child(3)::before { content: "T"; }
.task-add-list button:nth-child(4)::before { content: "□"; }
.task-add-list button:nth-child(5)::before { content: "○"; }
.task-add-list button:nth-child(6)::before { content: "→"; }

.task-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 21px 20px 14px;
}

.task-panel-header h3 {
  white-space: nowrap;
  margin: 0;
  font-size: 20px;
  line-height: 1;
}

.task-panel-close {
  display: grid;
  place-items: center;
  width: 28px;
  min-width: 28px;
  flex: 0 0 28px;
  min-height: 28px;
  border-radius: 8px;
  padding: 0;
  color: rgba(255, 255, 255, 0.54);
}

.task-panel .task-panel-close {
  width: 28px;
  min-width: 28px;
  padding: 0;
}

.task-panel-body {
  overflow: auto;
  padding: 0 20px 20px;
}

.task-asset-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.task-asset-filters button,
.task-asset-filters label {
  width: auto;
  min-height: 36px;
  border-radius: 7px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.11);
  color: rgba(255, 255, 255, 0.84);
  font-size: 14px;
  font-weight: 800;
}

.task-asset-filters button:disabled {
  color: rgba(255, 255, 255, 0.34);
  opacity: 0.58;
  cursor: default;
}

.task-asset-filters .task-asset-search {
  width: min(260px, 100%);
  padding: 0 10px;
}

.task-asset-search span {
  color: rgba(255, 255, 255, 0.44);
  font-size: 12px;
}

.task-asset-search input {
  width: 170px;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font: inherit;
}

.task-asset-filters label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.task-asset-date {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 700;
}

.task-asset-date span {
  color: rgba(255, 255, 255, 0.42);
  font-size: 11px;
  font-weight: 600;
}

.task-asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  grid-auto-rows: 158px;
  gap: 10px;
  align-items: start;
  min-height: 260px;
}

.task-asset-card,
.task-asset-empty {
  min-height: 112px;
  border: 0;
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)),
    #313136;
}

.task-asset-card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: auto;
  height: 158px;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  text-align: left;
  contain: layout paint style;
  cursor: grab;
}

.task-asset-card:active {
  cursor: grabbing;
}

.task-asset-card.is-selected {
  outline: 2px solid rgba(111, 144, 255, 0.85);
  outline-offset: -2px;
}

.task-asset-check {
  position: absolute;
  z-index: 5;
  left: 8px;
  top: 8px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  background: rgba(16, 16, 20, 0.72);
  backdrop-filter: blur(10px);
}

.task-asset-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.task-asset-check span {
  display: block;
  width: 15px;
  height: 15px;
  border: 1.5px solid rgba(255, 255, 255, 0.72);
  border-radius: 4px;
}

.task-asset-check input:checked + span {
  border-color: #8aa8ff;
  background:
    linear-gradient(135deg, transparent 0 46%, #fff 47% 55%, transparent 56%),
    #5f72ff;
}

.task-panel .task-asset-open {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 7px;
  padding: 0;
  overflow: hidden;
  background: transparent;
  color: inherit;
  text-align: left;
}

.task-panel .task-asset-delete {
  position: absolute;
  z-index: 4;
  top: 7px;
  right: 7px;
  display: grid;
  width: 30px;
  height: 30px;
  min-height: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  padding: 0;
  background: rgba(17, 17, 22, 0.72);
  color: rgba(255, 190, 190, 0.95);
  opacity: 0.86;
  backdrop-filter: blur(10px);
}

.task-panel .task-asset-delete:hover {
  border-color: rgba(255, 110, 110, 0.34);
  background: rgba(174, 46, 46, 0.34);
  color: #fff;
  opacity: 1;
}

.task-panel .task-asset-delete:disabled {
  opacity: 0.45;
  cursor: default;
}

.task-asset-delete-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.task-asset-card img,
.task-asset-card video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 160ms ease;
}

.task-asset-card:hover img,
.task-asset-card:hover video {
  transform: scale(1.04);
}

.task-asset-card.is-missing img,
.task-asset-card.is-loading img,
.task-asset-card.is-missing video,
.task-asset-card.is-loading video {
  opacity: 0;
}

.task-asset-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: none;
  place-items: center;
  gap: 7px;
  padding: 18px;
  color: rgba(255, 255, 255, 0.64);
  font-style: normal;
  text-align: center;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
    rgba(28, 28, 34, 0.96);
}

.task-asset-card.is-missing .task-asset-fallback,
.task-asset-card.is-loading .task-asset-fallback {
  display: grid;
}

.task-asset-fallback-icon {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.task-asset-fallback b {
  display: block;
  max-width: 100%;
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-asset-card span,
.task-asset-card small,
.task-asset-card em {
  position: relative;
  z-index: 1;
}

.task-asset-card span {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  display: block;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-asset-card small {
  position: absolute;
  top: 8px;
  right: 8px;
  border-radius: 5px;
  padding: 2px 5px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 10px;
}

.task-asset-card em {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  display: grid;
  place-items: center;
  min-height: 30px;
  border-radius: 7px;
  background: rgba(28, 28, 31, 0.82);
  color: #fff;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.task-asset-card:hover em {
  opacity: 1;
  transform: translateY(0);
}

.task-asset-empty {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  min-height: 230px;
  color: rgba(255, 255, 255, 0.54);
}

.task-asset-empty strong {
  color: #fff;
}

.task-panel-list {
  display: grid;
  gap: 8px;
}

.task-panel-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border-radius: 9px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.055);
}

.task-panel-row strong {
  display: block;
  color: #fff;
  font-size: 13px;
}

.task-panel-row span {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 12px;
  line-height: 1.35;
}

.task-panel-row small {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: rgba(154, 177, 255, 0.76);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-layer-row {
  align-items: flex-start;
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
  border: 1px solid transparent;
}

.task-layer-row.is-active {
  border-color: rgba(126, 150, 255, 0.34);
  background: rgba(94, 112, 255, 0.12);
}

.task-layer-bulk {
  display: grid;
  gap: 9px;
  border: 1px solid rgba(93, 224, 255, 0.24);
  border-radius: 12px;
  padding: 10px;
  background: rgba(93, 224, 255, 0.08);
}

.task-layer-bulk strong {
  color: #dbeaff;
  font-size: 12px;
}

.task-layer-bulk div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.task-layer-bulk button {
  width: auto;
  min-width: 58px;
  min-height: 28px;
  border-radius: 8px;
  padding: 0 9px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
}

.task-layer-row em {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.36);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.task-panel-row button {
  width: auto;
  min-width: 70px;
}

.task-layer-actions button {
  min-width: 48px;
  min-height: 28px;
  border-radius: 8px;
  padding: 0 9px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.76);
  font-size: 11px;
}

.task-layer-actions button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.task-layer-actions button:disabled {
  opacity: 0.38;
  cursor: default;
}

.task-layer-actions button.danger {
  color: rgba(255, 184, 184, 0.94);
}

.task-toast {
  position: fixed;
  left: 50%;
  bottom: 108px;
  z-index: 40;
  transform: translateX(-50%) translateY(12px);
  border-radius: 999px;
  padding: 9px 14px;
  background: rgba(35, 35, 40, 0.96);
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.task-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.sidebar-collapsed .task-sidebar {
  grid-template-rows: 70px 1fr;
  margin-left: 8px;
  border-radius: 10px;
}

.sidebar-collapsed .task-logo,
.sidebar-collapsed .task-thread,
.sidebar-collapsed .task-chat,
.sidebar-collapsed .task-side-actions button:not([data-side-action="collapse"]) {
  display: none;
}

.sidebar-collapsed .task-sidebar-header {
  justify-content: center;
  padding: 18px 0;
}

.sidebar-collapsed .task-side-actions {
  min-width: 0;
}

.sidebar-collapsed .task-side-actions button[data-side-action="collapse"] {
  width: 42px;
  padding-top: 25px;
}

.sidebar-collapsed .task-side-actions button[data-side-action="collapse"]::before {
  content: "›";
}

.sidebar-collapsed .task-panel {
  left: 88px;
}

.sidebar-collapsed .task-chat-panel {
  display: none;
}

.sidebar-collapsed .task-asset-panel,
.sidebar-collapsed .task-add-menu {
  left: 50%;
}

@media (max-width: 760px) {
  body {
    grid-template-columns: 1fr;
    grid-template-rows: 362px minmax(420px, 1fr);
    overflow: auto;
  }

  .task-sidebar {
    height: 352px;
    margin: 8px;
  }

  .task-sidebar-header {
    gap: 8px;
    padding-right: 12px;
  }

  .task-logo img {
    width: 30px;
    height: 30px;
  }

  .task-side-actions {
    gap: 8px;
    min-width: 150px;
  }

  .task-canvas {
    min-height: 520px;
  }

  .task-topbar {
    top: 10px;
    right: 8px;
  }

  .task-toolbar {
    left: 8px;
    right: 8px;
    justify-content: center;
    transform: none;
    overflow: visible;
  }

  .task-toolbar button {
    width: 49px;
    min-width: 49px;
    height: 54px;
    gap: 4px;
    font-size: 10px;
  }

  .task-toolbar .task-button-icon {
    width: 20px;
    height: 20px;
  }

  .task-toolbar button:nth-child(5) {
    margin-left: 6px;
  }

  .task-toolbar button:nth-child(5)::after {
    left: -5px;
  }

  .task-zoom {
    display: none;
  }

  .task-panel {
    left: 8px;
    right: 8px;
    bottom: 88px;
    width: auto;
  }

  .task-asset-panel {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: 88px;
    width: auto;
    min-height: 360px;
    transform: none;
  }

  .task-asset-filters {
    overflow-x: auto;
  }

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

  .task-add-menu {
    left: 50%;
    right: auto;
    width: 144px;
    transform: translateX(-50%);
  }
}
