/* ============================================================
   die.app Widget – Floating Button + Sidebar/Drawer
   ============================================================ */

:root {
  --daw-primary: #6366f1;
  --daw-primary-hover: #818cf8;
  --daw-bg: #0f0f11;
  --daw-bg-elevated: #18181b;
  --daw-bg-input: #27272a;
  --daw-border: rgba(255,255,255,.08);
  --daw-border-focus: rgba(99,102,241,.5);
  --daw-text: #fafafa;
  --daw-text-muted: rgba(255,255,255,.5);
  --daw-text-dim: rgba(255,255,255,.3);
  --daw-success: #22c55e;
  --daw-error: #ef4444;
  --daw-warning: #f59e0b;
  --daw-radius: 12px;
  --daw-radius-sm: 8px;
  --daw-sidebar-w: 460px;
  --daw-z: 2147483200;
  --daw-transition: .25s cubic-bezier(.4,0,.2,1);
}

/* ---- Floating Button ---- */
.daw-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--daw-z);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--daw-border);
  background: var(--daw-bg-elevated);
  color: var(--daw-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(0,0,0,.4);
  transition: transform var(--daw-transition), background var(--daw-transition);
}
.daw-fab:hover {
  background: var(--daw-primary);
  color: #fff;
  transform: scale(1.08);
}
.daw-fab svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.daw-fab--active {
  background: var(--daw-primary);
  color: #fff;
}

#daw-widget.daw-widget--open .daw-fab {
  opacity: 0;
  pointer-events: none;
  transform: scale(.96);
}

/* ---- Overlay ---- */
.daw-overlay {
  position: fixed;
  inset: 0;
  z-index: calc(var(--daw-z) + 1);
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--daw-transition);
}
.daw-overlay--open {
  opacity: 1;
  pointer-events: auto;
}

/* ---- Sidebar / Drawer ---- */
.daw-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: calc(var(--daw-z) + 2);
  width: var(--daw-sidebar-w);
  max-width: 100vw;
  background: var(--daw-bg);
  border-left: 1px solid var(--daw-border);
  transform: translateX(100%);
  transition: transform var(--daw-transition);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.daw-sidebar--open {
  transform: translateX(0);
}

/* ---- Sidebar Header ---- */
.daw-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--daw-border);
  flex-shrink: 0;
}
.daw-header__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--daw-text);
  font-family: system-ui, -apple-system, sans-serif;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.daw-header__title .daw-slug {
  font-size: 11px;
  color: var(--daw-primary);
  background: rgba(99,102,241,.12);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}
.daw-header__close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--daw-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--daw-transition);
}
.daw-header__close:hover {
  background: var(--daw-bg-input);
  color: var(--daw-text);
}

/* ---- Nav Tabs ---- */
.daw-nav {
  display: flex;
  padding: 0 20px;
  border-bottom: 1px solid var(--daw-border);
  gap: 2px;
  overflow-x: auto;
  flex-shrink: 0;
}
.daw-nav__tab {
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--daw-text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  font-family: system-ui, -apple-system, sans-serif;
  transition: color var(--daw-transition), border-color var(--daw-transition);
}
.daw-nav__tab:hover {
  color: var(--daw-text);
}
.daw-nav__tab--active {
  color: var(--daw-primary);
  border-bottom-color: var(--daw-primary);
}

/* ---- Content Panels ---- */
.daw-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.daw-panel {
  display: none;
}
.daw-panel--active {
  display: block;
}

/* ---- Login Form ---- */
.daw-login {
  max-width: 320px;
  margin: 40px auto;
}
.daw-login__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--daw-text);
  margin: 0 0 8px;
  font-family: system-ui, -apple-system, sans-serif;
}
.daw-login__sub {
  font-size: 13px;
  color: var(--daw-text-muted);
  margin: 0 0 24px;
  font-family: system-ui, -apple-system, sans-serif;
}
.daw-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--daw-text);
  background: var(--daw-bg-input);
  border: 1px solid var(--daw-border);
  border-radius: var(--daw-radius-sm);
  outline: none;
  transition: border-color var(--daw-transition);
  box-sizing: border-box;
  margin-bottom: 12px;
}
.daw-input:focus {
  border-color: var(--daw-border-focus);
}
.daw-input::placeholder {
  color: var(--daw-text-dim);
}

/* ---- Buttons ---- */
.daw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  font-family: system-ui, -apple-system, sans-serif;
  border-radius: var(--daw-radius-sm);
  border: 1px solid var(--daw-border);
  background: var(--daw-bg-input);
  color: var(--daw-text);
  cursor: pointer;
  transition: background var(--daw-transition), border-color var(--daw-transition);
}
.daw-btn:hover {
  background: rgba(255,255,255,.08);
}
.daw-btn--primary {
  background: var(--daw-primary);
  border-color: var(--daw-primary);
  color: #fff;
  width: 100%;
}
.daw-btn--primary:hover {
  background: var(--daw-primary-hover);
}
.daw-btn--accent {
  background: rgba(99,102,241,.14);
  border-color: rgba(99,102,241,.34);
  color: #e6e9ff;
}
.daw-btn--accent:hover {
  background: rgba(99,102,241,.2);
  border-color: rgba(99,102,241,.48);
}
.daw-btn--sm {
  padding: 6px 12px;
  font-size: 12px;
}
.daw-btn--danger {
  color: var(--daw-error);
  border-color: rgba(239,68,68,.3);
}
.daw-btn--danger:hover {
  background: rgba(239,68,68,.1);
}
.daw-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.daw-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--daw-border);
  background: var(--daw-bg-input);
  color: var(--daw-text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--daw-transition), color var(--daw-transition), border-color var(--daw-transition);
}
.daw-icon-btn:hover {
  background: rgba(255,255,255,.08);
  color: var(--daw-text);
  border-color: rgba(255,255,255,.15);
}
.daw-icon-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- Prompt Entry Types ---- */
.daw-entry-types {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.daw-entry-type {
  padding: 12px 16px;
  border-radius: var(--daw-radius-sm);
  border: 1px solid var(--daw-border);
  background: var(--daw-bg-elevated);
  color: var(--daw-text);
  font-size: 13px;
  font-family: system-ui, -apple-system, sans-serif;
  cursor: pointer;
  transition: border-color var(--daw-transition), background var(--daw-transition);
  text-align: left;
}
.daw-entry-type:hover {
  border-color: var(--daw-primary);
  background: rgba(99,102,241,.06);
}
.daw-entry-type--active {
  border-color: var(--daw-primary);
  background: rgba(99,102,241,.1);
}
.daw-entry-type__label {
  font-weight: 500;
}
.daw-entry-type__desc {
  font-size: 11px;
  color: var(--daw-text-muted);
  margin-top: 2px;
}

/* ---- Prompt Form ---- */
.daw-prompt-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.daw-textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px 14px;
  font-size: 14px;
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--daw-text);
  background: var(--daw-bg-input);
  border: 1px solid var(--daw-border);
  border-radius: var(--daw-radius-sm);
  outline: none;
  resize: none;
  box-sizing: border-box;
  transition: border-color var(--daw-transition);
  overflow-y: hidden;
}
.daw-textarea:focus {
  border-color: var(--daw-border-focus);
}
.daw-textarea::placeholder {
  color: var(--daw-text-dim);
}

/* ---- Log Output ---- */
.daw-log {
  margin-top: 12px;
  padding: 12px;
  background: #09090b;
  border: 1px solid var(--daw-border);
  border-radius: var(--daw-radius-sm);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 11px;
  color: var(--daw-text-muted);
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
  display: none;
}
.daw-log--visible {
  display: block;
}

/* ---- Status Badge ---- */
.daw-status {
  padding: 8px 12px;
  border-radius: var(--daw-radius-sm);
  font-size: 12px;
  font-family: system-ui, -apple-system, sans-serif;
  display: none;
}
.daw-status--visible {
  display: block;
}
.daw-status--success {
  background: rgba(34,197,94,.1);
  color: var(--daw-success);
  border: 1px solid rgba(34,197,94,.2);
}
.daw-status--error {
  background: rgba(239,68,68,.1);
  color: var(--daw-error);
  border: 1px solid rgba(239,68,68,.2);
}

/* ---- History List ---- */
.daw-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.daw-history-item {
  padding: 0;
  border-radius: var(--daw-radius-sm);
  border: 1px solid var(--daw-border);
  background: var(--daw-bg-elevated);
  transition: border-color var(--daw-transition), transform var(--daw-transition);
  overflow: hidden;
}
.daw-history-item:hover {
  border-color: rgba(255,255,255,.15);
  transform: translateY(-1px);
}
.daw-history-item--open {
  border-color: rgba(99,102,241,.24);
}
.daw-history-item__summary {
  position: relative;
  padding: 10px 12px;
}
.daw-history-item__toggle {
  position: relative;
  width: 100%;
  min-width: 0;
  padding: 4px 40px 0 0;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
}
.daw-history-item__summary-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  row-gap: 6px;
  flex-wrap: wrap;
}
.daw-history-item__time {
  font-size: 11px;
  color: var(--daw-text-dim);
  font-family: system-ui, -apple-system, sans-serif;
}
.daw-history-item__status {
  font-size: 10px;
  font-weight: 600;
  font-family: system-ui, -apple-system, sans-serif;
}
.daw-history-item__status--success {
  color: var(--daw-success);
}
.daw-history-item__status--warning {
  color: var(--daw-warning);
}
.daw-history-item__status--error {
  color: var(--daw-error);
}
.daw-history-item__chevron {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 18px;
  height: 18px;
  color: var(--daw-text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--daw-transition), color var(--daw-transition);
}
.daw-history-item__chevron svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.daw-history-item--open .daw-history-item__chevron {
  transform: rotate(180deg);
  color: var(--daw-primary);
}
.daw-history-item__body {
  padding: 0 14px 14px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.daw-history-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-left: auto;
}
.daw-history-item__meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  font-size: 10px;
  line-height: 1.3;
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--daw-text-dim);
}
.daw-history-item__block {
  margin-top: 12px;
}
.daw-history-item__block--prompt {
  margin: 0 14px 12px;
}
.daw-history-item__block-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.daw-history-item__block-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.daw-history-item__block-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.daw-history-item__block-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--daw-text-dim);
}
.daw-history-item__copy-clipboard-btn,
.daw-history-item__insert-btn,
.daw-history-item__fav {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  color: var(--daw-text-dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--daw-transition), color var(--daw-transition), border-color var(--daw-transition);
}
.daw-history-item__copy-clipboard-btn:hover,
.daw-history-item__insert-btn:hover,
.daw-history-item__fav:hover {
  background: rgba(255,255,255,.08);
  color: var(--daw-text);
  border-color: rgba(255,255,255,.16);
}
.daw-history-item__copy-clipboard-btn svg,
.daw-history-item__insert-btn svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.daw-history-item__prompt-full,
.daw-history-item__response {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.03);
  font-size: 13px;
  line-height: 1.6;
  color: var(--daw-text);
  white-space: pre-wrap;
  word-break: break-word;
}
.daw-history-item__response {
  background: #0e0e10;
}
.daw-history-item__prompt-full,
.daw-history-item__response {
  max-height: 220px;
  overflow-y: auto;
}
.daw-history-item__fav {
  font-size: 14px;
  line-height: 1;
}
.daw-history-item__fav--active {
  color: var(--daw-warning);
}

/* ---- Version List ---- */
#daw-version-status {
  margin-bottom: 12px;
}
.daw-version-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.daw-version-item {
  padding: 14px;
  border-radius: var(--daw-radius-sm);
  border: 1px solid var(--daw-border);
  background: var(--daw-bg-elevated);
  font-family: system-ui, -apple-system, sans-serif;
  transition: border-color var(--daw-transition), transform var(--daw-transition);
  cursor: pointer;
}
.daw-version-item:hover {
  border-color: rgba(255,255,255,.15);
  transform: translateY(-1px);
}
.daw-version-item--open {
  border-color: rgba(99,102,241,.32);
}
.daw-version-item__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.daw-version-item__top-right {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-shrink: 0;
}
.daw-version-item__id {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.daw-version-item__hash {
  font-size: 11px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--daw-primary);
  letter-spacing: .02em;
}
.daw-version-item__state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--daw-success);
  font-family: system-ui, -apple-system, sans-serif;
}
.daw-version-item__state-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--daw-success);
  box-shadow: 0 0 0 4px rgba(34,197,94,.14);
  flex-shrink: 0;
}
.daw-version-item__msg {
  font-size: 13px;
  color: var(--daw-text);
  margin: 8px 0 4px;
  line-height: 1.45;
}
.daw-version-item__files {
  margin-top: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.03);
  overflow: hidden;
}
.daw-version-item__files-toggle {
  width: 100%;
  padding: 12px;
  border: none;
  background: transparent;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}
.daw-version-item__files-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.daw-version-item__files-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--daw-text-dim);
}
.daw-version-item__files-meta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--daw-text-muted);
}
.daw-version-item__files-meta-sep {
  color: var(--daw-text-dim);
}
.daw-version-item__files-meta-change {
  font-weight: 600;
}
.daw-version-item__files-meta-change--add {
  color: var(--daw-success);
}
.daw-version-item__files-meta-change--del {
  color: var(--daw-error);
}
.daw-version-item__files-chevron {
  width: 18px;
  height: 18px;
  color: var(--daw-text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--daw-transition), color var(--daw-transition);
}
.daw-version-item__files-chevron svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.daw-version-item__files--open .daw-version-item__files-chevron {
  transform: rotate(180deg);
  color: var(--daw-primary);
}
.daw-version-item__files-body {
  padding: 0 12px 12px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.daw-version-item__files-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.daw-version-item__files-empty {
  padding-top: 12px;
  font-size: 12px;
  color: var(--daw-text-muted);
}
.daw-version-item__file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding-top: 10px;
}
.daw-version-item__file-row + .daw-version-item__file-row {
  border-top: 1px solid rgba(255,255,255,.05);
}
.daw-version-item__file-path {
  min-width: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--daw-text);
  word-break: break-word;
}
.daw-version-item__file-stats {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  font-size: 11px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  justify-self: end;
}
.daw-version-item__file-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
}
.daw-version-item__file-badge-part {
  display: inline-flex;
  align-items: center;
}
.daw-version-item__file-badge-part--add {
  color: var(--daw-success);
}
.daw-version-item__file-badge-part--del {
  color: var(--daw-error);
}
.daw-version-item__file-badge--binary {
  color: var(--daw-text-muted);
}
.daw-version-item__date {
  font-size: 11px;
  color: var(--daw-text-dim);
  white-space: nowrap;
}
.daw-version-item--head {
  border-color: rgba(99,102,241,.3);
}
.daw-version-item__menu-wrap {
  position: relative;
  flex-shrink: 0;
  margin-top: -2px;
}
.daw-version-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--daw-border);
  background: #111114;
  box-shadow: 0 16px 32px rgba(0,0,0,.35);
  display: none;
  z-index: 4;
}
.daw-version-menu--open {
  display: block;
}
.daw-version-menu__item {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--daw-text);
  padding: 10px 12px;
  border-radius: 8px;
  text-align: left;
  font-size: 12px;
  cursor: pointer;
  transition: background var(--daw-transition), color var(--daw-transition);
}
.daw-version-menu__item:hover:not(:disabled) {
  background: rgba(255,255,255,.06);
}
.daw-version-menu__item:disabled {
  color: var(--daw-text-dim);
  cursor: not-allowed;
}
.daw-version-menu__item--danger {
  color: #ff8f8f;
}
.daw-version-item__prompt {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.03);
}
.daw-version-item__prompt--empty {
  background: rgba(255,255,255,.02);
}
.daw-version-item__prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.daw-version-item__copy-btn {
  width: auto;
  padding: 6px 10px;
}
.daw-version-item__copy-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.daw-version-item__prompt-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--daw-text-dim);
}
.daw-version-item__prompt-text {
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--daw-text);
  text-align: left;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  cursor: pointer;
}
.daw-version-item__prompt-text:hover {
  color: #fff;
}
.daw-version-item__prompt-empty {
  font-size: 12px;
  color: var(--daw-text-muted);
  line-height: 1.4;
}
.daw-version-item__details {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.daw-version-item--open .daw-version-item__details {
  display: block;
}
.daw-version-item__detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.daw-version-item__detail {
  padding: 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.05);
}
.daw-version-item__detail-label,
.daw-version-item__response-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--daw-text-dim);
  margin-bottom: 6px;
}
.daw-version-item__detail-value {
  font-size: 12px;
  line-height: 1.45;
  color: var(--daw-text);
  word-break: break-word;
}
.daw-version-item__response {
  margin-top: 10px;
  padding: 12px;
  border-radius: 10px;
  background: #0e0e10;
  border: 1px solid rgba(255,255,255,.06);
}
.daw-version-item__response-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--daw-text);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---- Dialog ---- */
.daw-dialog-layer {
  position: fixed;
  inset: 0;
  z-index: calc(var(--daw-z) + 4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--daw-transition);
}
.daw-dialog-layer--open {
  opacity: 1;
  pointer-events: auto;
}
.daw-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.48);
  backdrop-filter: blur(4px);
}
.daw-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(420px, calc(100vw - 32px));
  transform: translate(-50%, -50%);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(32,32,36,.98), rgba(18,18,20,.98));
  box-shadow: 0 24px 48px rgba(0,0,0,.45);
  padding: 20px;
}
.daw-dialog__eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--daw-primary);
  margin-bottom: 10px;
}
.daw-dialog__title {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.3;
  color: var(--daw-text);
}
.daw-dialog__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.daw-dialog__text {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--daw-text-muted);
}
.daw-dialog__text[hidden],
.daw-dialog__custom[hidden] {
  display: none;
}
.daw-dialog__compare {
  display: grid;
  gap: 10px;
}
.daw-dialog__preview {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.03);
}
.daw-dialog__preview--accent {
  border-color: rgba(99,102,241,.28);
  background: linear-gradient(180deg, rgba(99,102,241,.12), rgba(99,102,241,.05));
}
.daw-dialog__preview-label {
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--daw-text-dim);
}
.daw-dialog__preview-text {
  max-height: 180px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.6;
  color: var(--daw-text);
  white-space: pre-wrap;
  word-break: break-word;
}
.daw-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
.daw-dialog__actions--single {
  justify-content: flex-end;
}
.daw-crawl-tabs {
  display: flex;
  gap: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--daw-border);
}
.daw-crawl-tab {
  flex: 1;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 500;
  font-family: system-ui, -apple-system, sans-serif;
  border: none;
  background: transparent;
  color: var(--daw-text-muted);
  cursor: pointer;
  transition: background var(--daw-transition), color var(--daw-transition);
}
.daw-crawl-tab + .daw-crawl-tab {
  border-left: 1px solid var(--daw-border);
}
.daw-crawl-tab:hover {
  color: var(--daw-text);
}
.daw-crawl-tab--active {
  background: rgba(99,102,241,.12);
  color: #c7caff;
}
.daw-dialog__actions .daw-btn {
  min-width: 118px;
  width: auto;
  flex: 0 0 auto;
}

/* ---- Assets Panel ---- */
.daw-assets {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.daw-assets__toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.daw-assets__toolbar .daw-btn svg {
  flex-shrink: 0;
}
.daw-assets__toolbar--bottom {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--daw-border);
}
.daw-assets__toolbar--bottom .daw-btn {
  flex: 1 1 0;
  box-sizing: border-box;
  height: 34px;
}
.daw-assets__breadcrumb {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  font-family: system-ui, -apple-system, sans-serif;
  min-height: 0;
}
.daw-assets__breadcrumb:empty { display: none; }
.daw-assets__crumb {
  border: none;
  background: none;
  color: var(--daw-text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 11px;
  font-family: inherit;
  transition: color var(--daw-transition);
}
.daw-assets__crumb:hover { color: var(--daw-primary); }
.daw-assets__crumb--current { color: var(--daw-text); cursor: default; }
.daw-assets__crumb-sep { color: var(--daw-text-dim); }
.daw-asset--folder { cursor: pointer; }
.daw-asset--folder .daw-asset__icon { height: 48px; }
.daw-assets__filter {
  display: flex;
  gap: 4px;
}
.daw-assets__filter-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-family: system-ui, -apple-system, sans-serif;
  border-radius: 12px;
  border: 1px solid var(--daw-border);
  background: transparent;
  color: var(--daw-text-muted);
  cursor: pointer;
  transition: background var(--daw-transition), color var(--daw-transition), border-color var(--daw-transition);
}
.daw-assets__filter-btn:hover {
  border-color: rgba(255,255,255,.15);
  color: var(--daw-text);
}
.daw-assets__filter-btn--active {
  background: rgba(99,102,241,.12);
  border-color: rgba(99,102,241,.3);
  color: #c7caff;
}
.daw-assets__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 10px;
  border-radius: var(--daw-radius-sm);
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.04);
}
.daw-asset {
  position: relative;
  border-radius: var(--daw-radius-sm);
  border: 1px solid var(--daw-border);
  background: var(--daw-bg-elevated);
  transition: border-color var(--daw-transition);
}
.daw-asset__preview,
.daw-asset__icon {
  border-radius: var(--daw-radius-sm) var(--daw-radius-sm) 0 0;
  overflow: hidden;
}
.daw-asset:hover {
  border-color: rgba(255,255,255,.15);
}
.daw-asset__preview {
  width: 100%;
  height: 90px;
  background-size: cover;
  background-position: center;
  background-color: rgba(255,255,255,.03);
}
.daw-asset__icon {
  width: 100%;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.03);
  color: var(--daw-text-dim);
}
.daw-asset__icon svg {
  width: 28px;
  height: 28px;
}
.daw-asset__info {
  padding: 6px 8px 2px;
}
.daw-asset__name {
  font-size: 11px;
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--daw-text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
}
.daw-asset__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 0 4px;
}
.daw-asset__actions {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
  padding: 2px 4px 6px;
}
.daw-asset__action {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--daw-text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--daw-transition), background var(--daw-transition);
}
.daw-asset__action:hover {
  color: var(--daw-text);
  background: rgba(255,255,255,.06);
}
.daw-asset__action svg {
  width: 14px;
  height: 14px;
}
.daw-asset__menu-wrap {
  position: relative;
}
.daw-asset__menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 4px);
  right: 0;
  min-width: 140px;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--daw-border);
  background: #111114;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  z-index: 5;
}
.daw-asset__menu--open {
  display: block;
}
.daw-asset__menu-item {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--daw-text);
  padding: 7px 10px;
  border-radius: 6px;
  text-align: left;
  font-size: 12px;
  font-family: system-ui, -apple-system, sans-serif;
  cursor: pointer;
  transition: background var(--daw-transition);
}
.daw-asset__menu-item:hover {
  background: rgba(255,255,255,.06);
}
.daw-asset__menu-item--danger {
  color: #ff8f8f;
}
.daw-asset__menu-item--danger:hover {
  background: rgba(239,68,68,.08);
}

/* ---- Asset Preview Clickable ---- */
.daw-asset__preview--clickable {
  cursor: pointer;
}
.daw-asset__preview--clickable:hover {
  opacity: .85;
}

/* ---- Lightbox ---- */
.daw-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.daw-lightbox--open {
  opacity: 1;
  pointer-events: auto;
}
.daw-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(6px);
}
.daw-lightbox__wrap {
  position: absolute;
  inset: 16px;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  background: var(--daw-bg);
  border: 1px solid var(--daw-border);
  box-shadow: 0 24px 48px rgba(0,0,0,.5);
}
.daw-lightbox__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--daw-border);
  flex-shrink: 0;
}
.daw-lightbox__name {
  font-size: 12px;
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--daw-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: auto;
}
.daw-lightbox__tools {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.daw-lightbox__action {
  padding: 4px 10px;
  font-size: 11px;
  font-family: system-ui, -apple-system, sans-serif;
  border: 1px solid var(--daw-border);
  border-radius: 6px;
  background: transparent;
  color: var(--daw-text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.daw-lightbox__action:hover {
  background: rgba(255,255,255,.06);
  color: var(--daw-text);
}
.daw-lightbox__action:disabled {
  opacity: .4;
  cursor: not-allowed;
}
.daw-lightbox__action--danger:hover {
  color: var(--daw-error);
  border-color: rgba(239,68,68,.3);
  background: rgba(239,68,68,.08);
}
.daw-lightbox__close {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--daw-text-muted);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.daw-lightbox__close:hover {
  background: rgba(255,255,255,.08);
  color: var(--daw-text);
}
.daw-lightbox__body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 8px;
}
.daw-lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
}
.daw-lightbox__pdf {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 4px;
  background: #fff;
}

/* ---- Connector Cards ---- */
.daw-connector-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.daw-connector-card {
  padding: 14px 16px;
  border-radius: var(--daw-radius-sm);
  border: 1px solid var(--daw-border);
  background: var(--daw-bg-elevated);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: system-ui, -apple-system, sans-serif;
}
.daw-connector-card__name {
  font-size: 14px;
  font-weight: 500;
  color: var(--daw-text);
}
.daw-connector-card__status {
  font-size: 11px;
  color: var(--daw-text-dim);
}
.daw-connector-card__status--ok {
  color: var(--daw-success);
}

/* ---- Empty State ---- */
.daw-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--daw-text-dim);
  font-size: 13px;
  font-family: system-ui, -apple-system, sans-serif;
}

/* ---- Spinner ---- */
.daw-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: daw-spin .6s linear infinite;
}
@keyframes daw-spin {
  to { transform: rotate(360deg); }
}

/* ---- Error Message ---- */
.daw-error {
  color: var(--daw-error);
  font-size: 12px;
  margin-top: 4px;
  font-family: system-ui, -apple-system, sans-serif;
  display: none;
}
.daw-error--visible {
  display: block;
}

/* ---- Block Selection ---- */
.daw-block-selected {
  outline: 2px solid var(--daw-primary) !important;
  outline-offset: 2px;
  border-radius: 4px;
  position: relative;
}

/* On-page badge above selected block */
.daw-block-badge {
  position: absolute;
  top: -28px;
  left: 0;
  display: flex;
  align-items: center;
  gap: 0;
  z-index: calc(var(--daw-z) - 1);
  pointer-events: auto;
}
.daw-block-badge__label {
  font-size: 10px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: #fff;
  background: var(--daw-primary);
  padding: 2px 8px;
  border-radius: 3px 0 0 3px;
  white-space: nowrap;
  line-height: 1.4;
}
.daw-badge-tag { color: #fff; }
.daw-badge-id { color: #fbbf24; }
.daw-badge-cls { color: #34d399; }
.daw-block-badge__parent {
  font-size: 10px;
  font-family: system-ui, -apple-system, sans-serif;
  color: #fff;
  background: rgba(99,102,241,.7);
  padding: 2px 8px;
  border: none;
  border-left: 1px solid rgba(255,255,255,.25);
  border-radius: 0 3px 3px 0;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.4;
  transition: background .15s;
}
.daw-block-badge__parent:hover {
  background: var(--daw-primary-hover);
}

/* ---- Hide expand button in fullscreen mode ---- */
.daw-sidebar:not(.daw-sidebar--compact) #daw-expand-btn {
  display: none;
}

/* ---- Prompt running state ---- */
.daw-prompt-running {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.daw-running-info {
  font-size: 13px;
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--daw-text);
  line-height: 1.5;
  padding: 10px 14px;
  background: var(--daw-bg-input);
  border: 1px solid var(--daw-border);
  border-radius: var(--daw-radius-sm);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 60vh;
  overflow-y: auto;
}
.daw-running-tips {
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--daw-radius-sm);
  background: rgba(255,255,255,.03);
}
.daw-running-tips__head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--daw-text-dim);
  letter-spacing: .02em;
  margin-bottom: 6px;
}
.daw-running-tips__head .daw-spinner {
  width: 13px;
  height: 13px;
  border-width: 2px;
  border-color: rgba(255,255,255,.22);
  border-top-color: var(--daw-primary);
}
.daw-running-tips__text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--daw-text);
  min-height: 36px;
}

/* ---- Block Highlight after reload ---- */
.daw-block-highlight {
  animation: daw-highlight-pulse 1.5s ease-in-out 2;
}
@keyframes daw-highlight-pulse {
  0%, 100% { outline: 2px solid transparent; outline-offset: 2px; }
  50% { outline: 2px solid var(--daw-primary); outline-offset: 2px; }
}

/* ---- Show Changes Button ---- */
.daw-btn--show-changes {
  margin-top: 10px;
  width: auto;
}

/* ---- Response Card after reload ---- */
.daw-response-card {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: min(360px, calc(100vw - 24px));
  max-height: min(42vh, 320px);
  border-radius: 16px;
  border: 1px solid rgba(99,102,241,.22);
  background: linear-gradient(180deg, rgba(20,20,24,.96), rgba(12,12,14,.98));
  box-shadow: 0 22px 44px rgba(0,0,0,.34);
  color: var(--daw-text);
  z-index: calc(var(--daw-z) + 5);
  opacity: 0;
  transform: translateY(10px) scale(.98);
  transition: opacity var(--daw-transition), transform var(--daw-transition);
  overflow: hidden;
}
.daw-response-card--open {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.daw-response-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: rgba(99,102,241,.08);
}
.daw-response-card__title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #dfe4ff;
  font-family: system-ui, -apple-system, sans-serif;
}
.daw-response-card__close {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--daw-text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--daw-transition), color var(--daw-transition);
}
.daw-response-card__close:hover {
  background: rgba(255,255,255,.08);
  color: var(--daw-text);
}
.daw-response-card__body {
  padding: 14px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.6;
  font-family: system-ui, -apple-system, sans-serif;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--daw-text);
}

/* ---- Compact Mode (block-select entry) ---- */
.daw-sidebar--compact {
  z-index: 100000;
  top: auto;
  bottom: auto;
  left: auto;
  right: auto;
  width: 50vw;
  max-width: calc(100vw - 24px);
  height: auto;
  max-height: 50vh;
  border: 1px solid var(--daw-border);
  border-radius: var(--daw-radius);
  box-shadow: 0 12px 40px rgba(0,0,0,.45);
  transform: translateY(8px);
  opacity: 0;
  transition: transform var(--daw-transition), opacity var(--daw-transition);
}
.daw-sidebar--compact.daw-sidebar--open {
  transform: translateY(0);
  opacity: 1;
}
.daw-sidebar--compact .daw-header,
.daw-sidebar--compact .daw-nav,
.daw-sidebar--compact .daw-entry-types {
  display: none;
}
.daw-sidebar--compact .daw-content {
  padding: 12px 16px;
}
.daw-sidebar--compact .daw-textarea {
  min-height: 60px;
}

/* ---- Compact toolbar (expand + block info + close in one row) ---- */
.daw-compact-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.daw-compact-bar__btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--daw-border);
  background: var(--daw-bg-input);
  color: var(--daw-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--daw-transition), color var(--daw-transition);
}
.daw-compact-bar__btn:hover {
  background: rgba(255,255,255,.08);
  color: var(--daw-text);
}
.daw-compact-bar__block {
  flex: 1;
  font-size: 11px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--daw-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- Inline Send Button (floats inside textarea wrapper) ---- */
.daw-prompt-wrap {
  position: relative;
}
.daw-prompt-wrap .daw-textarea {
  padding-right: 88px;
}
.daw-prompt-inline-tools {
  position: absolute;
  right: 8px;
  bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1;
}
.daw-inline-tool {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--daw-transition), opacity var(--daw-transition), filter var(--daw-transition);
}
.daw-inline-tool:hover {
  transform: translateY(-1px) scale(1.05);
}
.daw-inline-tool:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}
.daw-inline-tool--magic {
  background: linear-gradient(135deg, #f59e0b, #ec4899);
  box-shadow: 0 10px 22px rgba(236,72,153,.22);
}
.daw-inline-tool--magic:hover {
  filter: brightness(1.05);
}
.daw-inline-tool svg,
.daw-send-inline svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.daw-inline-tool .daw-spinner {
  width: 14px;
  height: 14px;
}
.daw-send-inline {
  position: static;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--daw-primary);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--daw-transition), transform var(--daw-transition), opacity var(--daw-transition);
}
.daw-send-inline:hover {
  background: var(--daw-primary-hover);
  transform: scale(1.1);
}
.daw-send-inline:disabled {
  opacity: .4;
  cursor: not-allowed;
  transform: none;
}
/* ---- Chat Layout ---- */
.daw-panel--prompt {
  display: none;
  padding: 0 !important;
}
.daw-panel--prompt.daw-panel--active {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.daw-prompt-input {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.daw-chat {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.daw-chat__scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px 4px 6px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
}
.daw-chat__msg {
  font-size: 12px;
  line-height: 1.45;
  font-family: system-ui, -apple-system, sans-serif;
  max-width: 88%;
  padding: 5px 12px;
  border-radius: 12px;
  word-break: break-word;
  animation: daw-chat-fadein .15s ease-out;
}
@keyframes daw-chat-fadein {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.daw-chat__msg--system {
  align-self: flex-start;
  background: var(--daw-bg-input);
  color: var(--daw-text-muted);
  border: 1px solid var(--daw-border);
  border-bottom-left-radius: 4px;
}
.daw-chat__msg--user {
  align-self: flex-end;
  background: rgba(99,102,241,.14);
  color: #d4d7ff;
  border: 1px solid rgba(99,102,241,.24);
  border-bottom-right-radius: 4px;
}
.daw-chat__msg--asset {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
}
.daw-chat__asset-thumb {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}
.daw-chat__asset-icon {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--daw-text-dim);
}
.daw-chat__asset-icon svg {
  width: 16px;
  height: 16px;
}
.daw-chat__asset-name {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
}
.daw-chat__asset-remove {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--daw-text-dim);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color .15s, background .15s;
}
.daw-chat__asset-remove:hover {
  color: var(--daw-error);
  background: rgba(239,68,68,.12);
}

/* ---- Chat Input Bar ---- */
.daw-chat__bar {
  flex-shrink: 0;
  padding: 8px 4px;
  border-top: 1px solid var(--daw-border);
  background: var(--daw-bg);
  position: sticky;
  bottom: 0;
  z-index: 2;
}
.daw-chat__inputbox {
  background: var(--daw-bg-input);
  border: 1px solid var(--daw-border);
  border-radius: 16px;
  transition: border-color var(--daw-transition);
}
.daw-chat__inputbox:focus-within {
  border-color: var(--daw-border);
}
.daw-chat__input {
  display: block;
  width: 100%;
  padding: 10px 12px 4px;
  font-size: 13px;
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--daw-text);
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  overflow-y: hidden;
  line-height: 1.45;
  min-height: 24px;
  max-height: 120px;
  box-sizing: border-box;
}
.daw-chat__input::placeholder {
  color: var(--daw-text-dim);
}
.daw-chat__tool-btn--compact-only {
  display: none;
}
.daw-chat__inputbox-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  padding: 2px 6px 6px;
}
.daw-chat__tool-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--daw-text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--daw-transition);
}
.daw-chat__tool-btn:hover {
  color: var(--daw-text);
}
.daw-chat__tool-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}
.daw-chat__tool-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.daw-chat__tool-btn .daw-spinner {
  width: 14px;
  height: 14px;
}
.daw-chat__send-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--daw-primary);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--daw-transition), opacity var(--daw-transition);
}
.daw-chat__send-btn:hover {
  background: var(--daw-primary-hover);
}
.daw-chat__send-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}
.daw-chat__send-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- Wizard Chips ---- */
.daw-wiz__opts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  padding: 2px 4px;
  animation: daw-chat-fadein .15s ease-out;
}
.daw-wiz__chip {
  padding: 5px 13px;
  border-radius: 14px;
  border: 1px solid var(--daw-border);
  background: var(--daw-bg-elevated);
  color: var(--daw-text);
  font-size: 12px;
  font-weight: 400;
  font-family: system-ui, -apple-system, sans-serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color var(--daw-transition), background var(--daw-transition);
}
.daw-wiz__chip:hover {
  border-color: var(--daw-primary);
  background: rgba(99,102,241,.08);
}
.daw-wiz__chip:focus,
.daw-wiz__chip:focus-visible,
.daw-wiz__chip:active {
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none;
  border-color: var(--daw-border);
  background: var(--daw-bg-elevated);
}

/* ---- Reset Chip ---- */
.daw-wiz__chip--reset {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--daw-text-dim);
  font-size: 11px;
}
.daw-wiz__chip--reset:hover {
  color: var(--daw-text-muted);
}
.daw-wiz__chip-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* ---- Compact mode: show only assets, hide chat + options ---- */
.daw-sidebar--compact .daw-chat__scroll {
  max-height: 80px;
  padding: 4px 4px 2px;
  gap: 4px;
}
.daw-sidebar--compact .daw-chat__msg:not(.daw-chat__msg--asset),
.daw-sidebar--compact .daw-wiz__opts {
  display: none;
}
.daw-sidebar--compact .daw-chat__msg--asset {
  display: flex;
}
.daw-sidebar--compact .daw-chat__scroll:empty,
.daw-sidebar--compact .daw-chat__scroll:not(:has(.daw-chat__msg--asset)) {
  display: none;
}
.daw-sidebar--compact .daw-chat__bar {
  padding-top: 0;
}
  text-wrap: balance;
}
.daw-sidebar--compact .daw-wiz__chip--reset {
  display: none;
}
.daw-chat__reset-compact {
  margin-right: auto;
}

/* ---- Mobile Responsive ---- */
@media (max-width: 480px) {
  .daw-sidebar:not(.daw-sidebar--compact) {
    width: 100vw;
  }
  .daw-sidebar--compact {
    min-width: calc(100vw - 30px) !important;
    width: calc(100vw - 30px) !important;
    left: 15px !important;
    right: 15px !important;
    top: auto !important;
    bottom: 12px !important;
    max-height: 60vh;
  }
  .daw-sidebar--compact .daw-compact-bar {
    display: none;
  }
  .daw-sidebar--compact .daw-chat__tool-btn--compact-only {
    display: flex;
  }
  .daw-sidebar--compact .daw-chat__inputbox-tools {
    justify-content: space-between;
  }
  .daw-sidebar--compact .daw-chat__reset-compact {
    margin-right: 0;
  }
  .daw-sidebar--compact .daw-chat__bar {
    padding: 0;
  }
  .daw-sidebar--compact .daw-content {
    padding: 0;
  }
  .daw-sidebar--compact {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
  }
  .daw-sidebar--compact .daw-chat__inputbox {
    box-shadow: 0 4px 24px rgba(0,0,0,.4);
  }
  .daw-sidebar--compact .daw-chat__input:focus {
    border-color: var(--daw-border);
  }
  .daw-fab {
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
  }
  .daw-version-item__top {
    align-items: flex-start;
  }
  .daw-version-item__top-right {
    flex-direction: row;
    align-items: center;
    gap: 6px;
  }
  .daw-history-item__meta {
    gap: 6px;
    justify-content: flex-start;
    margin-left: 0;
  }
  .daw-history-item__summary-meta {
    align-items: center;
    flex-direction: row;
    gap: 8px;
  }
  .daw-history-item__block--prompt {
    margin: 0 14px 12px;
  }
  .daw-version-item__detail-grid {
    grid-template-columns: 1fr;
  }
  .daw-response-card {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    max-height: 46vh;
  }
  .daw-dialog__actions {
    flex-direction: column-reverse;
  }
  .daw-dialog__actions .daw-btn {
    width: 100%;
  }
}
