/* WORQ-LANA-WORKSPACE-EXECUTE-002 — Workspace Lana widget styles.
   Uses the existing Workspace design tokens so Lana reads as part of the product.
   Contrast targets WCAG 2.2 AA against the dark Workspace surfaces. */

.lana-root {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.6rem;
}

.lana-root[hidden] {
  display: none;
}

.lana-launcher {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #06140f;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.7rem 1.25rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  min-height: 44px;
}

.lana-launcher:hover {
  background: var(--brand-strong);
}

.lana-panel {
  width: min(23rem, calc(100vw - 2rem));
  max-height: min(32rem, calc(100vh - 6rem));
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.lana-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel-raised);
}

.lana-head h2 {
  font-size: 0.95rem;
  margin: 0;
  color: var(--ink);
}

.lana-close {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 0.4rem;
  min-width: 44px;
  min-height: 44px;
}

.lana-close:hover {
  color: var(--ink);
  border-color: var(--line);
}

.lana-log {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.lana-msg p {
  margin: 0.15rem 0 0;
  padding: 0.55rem 0.7rem;
  border-radius: 0.6rem;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.lana-msg-user p {
  background: rgba(37, 184, 135, 0.14);
  border-color: rgba(37, 184, 135, 0.4);
}

.lana-who {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.lana-thinking p {
  color: var(--muted);
}

.lana-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 0.85rem 0.6rem;
}

.lana-chip {
  background: var(--panel-raised);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  min-height: 36px;
}

.lana-chip:hover {
  border-color: var(--brand);
}

.lana-compose {
  display: flex;
  gap: 0.5rem;
  padding: 0.7rem 0.85rem 0.85rem;
  border-top: 1px solid var(--line);
}

.lana-compose input {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 0.5rem;
  padding: 0.55rem 0.65rem;
  min-height: 44px;
}

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

.lana-primary {
  background: var(--brand);
  border: 1px solid var(--brand);
  color: #06140f;
  font-weight: 600;
  border-radius: 0.5rem;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  min-height: 44px;
}

.lana-primary[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
}

.lana-secondary {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 0.5rem;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  min-height: 44px;
}

.lana-support {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem;
  border-top: 1px solid var(--line);
  overflow-y: auto;
}

.lana-support h3 {
  margin: 0;
  font-size: 0.9rem;
}

.lana-support label {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.3rem;
}

.lana-support input,
.lana-support select,
.lana-support textarea {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 0.5rem;
  padding: 0.5rem 0.6rem;
  width: 100%;
  min-height: 40px;
}

.lana-support textarea {
  resize: vertical;
}

.lana-support-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.lana-note {
  margin: 0;
  font-size: 0.76rem;
  color: var(--muted);
}

.lana-error,
.lana-done {
  margin: 0;
  padding: 0.5rem 0.85rem;
  font-size: 0.82rem;
}

.lana-error {
  color: var(--rose);
}

.lana-done {
  color: var(--green);
}

.lana-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 30rem) {
  .lana-root {
    right: 0.5rem;
    bottom: 0.5rem;
    left: 0.5rem;
    align-items: stretch;
  }

  .lana-panel {
    width: auto;
    max-height: calc(100vh - 7rem);
  }

  .lana-launcher {
    align-self: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lana-root * {
    transition: none !important;
  }
}
