@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&family=IBM+Plex+Sans:wght@400;500;600&display=swap");

:root {
  --bg: #0e120b;
  --bg-2: #161c11;
  --bg-3: #1f2715;
  --line: #2a3528;
  --line-2: #3a4730;
  --text: #eef3e3;
  --muted: #96a286;
  --accent: #c6f35a;
  --accent-2: #7ec8a3;
  --danger: #e07a5f;
  --ok: #8fce6a;
  --ring: rgba(198, 243, 90, 0.22);
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: var(--sans); }
body { background-image: radial-gradient(ellipse at top, #1c2618 0%, var(--bg) 55%); }
a { color: var(--accent); }
code { font-family: var(--mono); font-size: 0.9em; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 28px 20px 64px; }
.wrap.wrap-app { max-width: none; }
.brand { display: flex; align-items: baseline; gap: 12px; margin-bottom: 28px; }
.brand h1 { font-family: var(--mono); font-size: 1.15rem; letter-spacing: 0.08em; margin: 0; color: var(--accent); }
.brand span { color: var(--muted); font-size: 0.85rem; }

.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.card h2 { margin: 0 0 8px; font-size: 1.15rem; }
.hint { color: var(--muted); font-size: 0.9rem; margin: 0 0 18px; }

label { display: block; font-size: 0.8rem; color: var(--muted); margin: 12px 0 6px; }
input, textarea, select {
  width: 100%; background: #0d110c; border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 10px 12px; font: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring);
}
select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23a9f27d' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px;
}
select option { background: #12180f; color: var(--text); }
input[type="checkbox"], input[type="radio"] { width: auto; height: auto; padding: 0; accent-color: var(--accent); }
textarea { min-height: 90px; resize: vertical; white-space: pre-wrap; }
button {
  background: var(--accent); color: #10140f; border: 0; border-radius: 8px;
  padding: 10px 16px; font-weight: 600; cursor: pointer; margin-top: 16px;
  font-family: inherit;
  transition: filter .15s ease, border-color .15s ease, background .15s ease, color .15s ease;
}
button:hover:not(:disabled) { filter: brightness(1.08); }
button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
button:disabled { opacity: 0.55; cursor: wait; }
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
button.ghost:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); filter: none; }
button.danger { background: var(--danger); color: #fff; }
.field-check { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; color: var(--text); font-size: 0.9rem; }
.field-check input { width: auto; margin: 0; }
.field-check label, label.field-check { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; color: var(--text); font-size: 0.9rem; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.flash { margin: 12px 0; padding: 10px 12px; border-radius: 8px; font-size: 0.9rem; }
.flash.err { background: #3a1e18; color: #ffc9b8; }
.flash.ok { background: #1c2e18; color: var(--ok); }

.qr-box { background: #fff; padding: 12px; display: inline-block; border-radius: 8px; margin: 12px 0; }
.qr-box svg { display: block; width: 200px; height: 200px; }
.secret { font-family: var(--mono); letter-spacing: 0.12em; color: var(--accent-2); word-break: break-all; }

.top {
  position: sticky; top: 0; z-index: 3500;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  margin: -18px -28px 20px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
}
.top button { margin-top: 0; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.lang-slot.in-bar { position: static; }
.layout { display: grid; grid-template-columns: 260px 1fr; gap: 18px; }
@media (max-width: 800px) { .layout { grid-template-columns: 1fr; } }

.nav-item { display: block; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.nav-item.active, .nav-item:hover { background: #222a1e; }
.pill { font-family: var(--mono); font-size: 0.72rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); }
.pill.open { color: var(--accent); }
.pill.resolved { color: var(--muted); }
.pill.bug { color: var(--danger); }
.pill.feature { color: var(--accent-2); }
.pill.idea { color: var(--accent); }
.pill.draft { color: var(--accent); }
.pill.launched { color: var(--accent-2); }
.ver-panel { margin-top: 16px; }
.ver-item { background: #0d110c; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.ver-item > div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.list { display: grid; gap: 8px; }
.row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.row:hover { border-color: var(--accent); }
.member-row { cursor: default; }
.member-row:hover { border-color: var(--line); }
.member-invite { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-top: 10px; }
.member-invite select { min-width: 220px; flex: 1; }
.member-invite button { margin-top: 0; }
.fix-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-top: 10px; }
.fix-form input[name="title"] { flex: 1 1 220px; }
.fix-form input[name="commit_ref"] { flex: 0 1 160px; }
.fix-form button { margin-top: 0; }
.ver-item button, .mem-panel button, .ver-panel button, .kick-panel button { margin-top: 8px; }
.tester-tree { display: grid; gap: 10px; }
.tester-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #0d110c; }
.tester-card summary { cursor: pointer; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.tester-kids { margin: 10px 0 0 6px; padding-left: 14px; border-left: 2px solid var(--line); display: grid; gap: 6px; }
.tester-leaf { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tester-edit { margin-top: 12px; }
.tester-checks { display: grid; gap: 4px; margin: 8px 0; max-width: 420px; }
.tester-check {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text);
  margin: 0;
  cursor: pointer;
  width: fit-content;
  max-width: 100%;
}
.tester-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: none;
}
.muted { color: var(--muted); font-size: 0.85rem; }
.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
  margin: 8px 0 4px;
}
.thumb-card {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #0d110c;
}
.thumb-card.thumb-audio {
  aspect-ratio: auto;
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 8px;
}
.thumb-link { display: block; width: 100%; height: 100%; }
.thumbs.scanning img { animation: thumb-scan 1.1s ease-in-out infinite; border-color: var(--accent); }
@keyframes thumb-scan {
  0%, 100% { opacity: 1; filter: none; }
  50% { opacity: .55; filter: saturate(1.4); }
}
.prompt-preview { min-height: 0; }
.thumbs img, .thumbs video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.thumbs audio { width: 100%; }
.thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--muted);
  font-size: 0.8rem;
}
.thumb-del {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.thumb-del:hover { background: #c45c4a; }
.thumb-del:disabled { opacity: 0.5; cursor: default; }
.preserve { white-space: pre-wrap; overflow-wrap: anywhere; }
.mem-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 8px 0 6px; }
.mem-head h3 { margin: 0; }
.mem-panel { margin-top: 8px; }
.kick-panel { margin-top: 16px; }
.mem-log { display: grid; gap: 10px; margin: 8px 0 18px; }
.mem-item { background: #0d110c; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.mem-item p { margin: 0; }
.mem-item .muted { margin-bottom: 6px; font-size: 0.78rem; }

.lang-slot { position: fixed; top: 16px; right: 18px; z-index: 4000; }
.lang-dropdown { position: relative; display: inline-block; }
.lang-btn {
  margin-top: 0;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  padding: 8px 12px; border-radius: 18px; font-size: 0.82rem; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; gap: 8px;
}
.lang-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 8px);
  background: #12180f; border: 1px solid var(--line); border-radius: 12px;
  width: 220px; max-height: 420px; overflow-y: auto; flex-direction: column;
  padding: 6px 0; z-index: 4001;
}
.lang-dropdown:hover .lang-menu,
.lang-dropdown:focus-within .lang-menu,
.lang-dropdown.active .lang-menu { display: flex; }
@media (max-width: 720px) {
  .lang-slot {
    position: sticky; top: 0; right: auto;
    display: flex; justify-content: flex-end;
    padding: 10px 16px 8px; background: var(--bg);
  }
  .lang-slot.in-bar { position: static; padding: 0; background: transparent; display: inline-block; }
}
.lang-menu a {
  color: var(--muted); text-decoration: none; font-size: 0.85rem;
  padding: 8px 16px;
}
.lang-menu a:hover, .lang-menu a.active { color: var(--text); background: #222a1e; }

.i18n-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.i18n-tabs button { margin-top: 0; }
.i18n-tabs button.active { background: var(--accent); color: #10140f; border-color: var(--accent); }
.i18n-key { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 0 0 8px; }
.i18n-key header { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.i18n-key .es { color: var(--muted); font-size: 0.85rem; margin: 6px 0 0; }
.i18n-key textarea { min-height: 64px; margin-top: 8px; }
.i18n-key button { margin-top: 8px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 14px; }
.filters select { width: auto; min-width: 160px; margin: 0; }
.filters button { margin-top: 0; }
.filters button.active { background: var(--accent); color: #10140f; border-color: var(--accent); }

.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(8, 12, 6, 0.78);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-box {
  width: min(420px, 100%);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 22px 18px;
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.5);
  color: var(--text);
}
.modal-box.wide {
  width: min(560px, 100%);
  max-height: min(90vh, 720px);
  overflow: auto;
}
.name-hit { background: #0d110c; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 10px; text-align: left; }
.name-hit strong { display: block; margin-bottom: 4px; }
.name-hit .muted { margin: 4px 0 0; }
.modal-box h2 { margin: 0 0 10px; font-size: 1.1rem; }
.modal-box p { margin: 0; color: var(--text); line-height: 1.45; }
.modal-box p.muted, .modal-box .muted { color: var(--muted); }
.progress-track {
  height: 10px; background: #0d110c; border-radius: 999px; overflow: hidden; margin: 16px 0 10px;
}
.progress-fill { height: 100%; width: 0; background: var(--accent); transition: width .2s ease; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions button { flex: 1; margin-top: 0; }
[hidden] { display: none !important; }

.ghost-link {
  color: var(--text); text-decoration: none; font-size: 0.9rem;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px;
}
.ghost-link:hover { border-color: var(--accent); color: var(--accent); }
.btn-account {
  display: inline-block; background: var(--accent); color: #10140f !important;
  text-decoration: none; font-weight: 600; border-radius: 8px; padding: 10px 16px;
}
.landing-nav {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap; margin-bottom: 36px;
}
.landing-nav .brand { margin: 0; }
.landing-nav-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.hero { margin: 24px 0 40px; max-width: 720px; }
.hero h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.15; margin: 0 0 16px;
  letter-spacing: -0.02em;
}
.hero .lead { font-size: 1.05rem; color: var(--muted); margin: 0 0 24px; line-height: 1.55; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.landing-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 8px 0 36px;
}
@media (max-width: 800px) { .landing-grid { grid-template-columns: 1fr; } }
.landing-grid .card h3 { margin: 0 0 8px; font-size: 1.05rem; color: var(--accent); }
.landing-grid .card p { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }

.how-list { display: grid; gap: 10px; margin: 0 0 36px; padding: 0; list-style: none; counter-reset: how; }
.how-list li {
  counter-increment: how; padding: 14px 16px 14px 56px; position: relative;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2);
}
.how-list li::before {
  content: counter(how); position: absolute; left: 16px; top: 12px;
  font-family: var(--mono); color: var(--accent); font-weight: 600;
}

.site-footer {
  margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line);
  text-align: center; color: var(--muted); font-size: 0.82rem;
}
.legal-links { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.legal-links a { color: var(--muted); text-decoration: none; }
.legal-links a:hover, .legal-links a.active { color: var(--accent); }

.legal-wrap { max-width: 820px; }
.legal-card h1 { margin: 8px 0 4px; font-size: 1.6rem; }
.legal-card h2 { margin: 22px 0 8px; font-size: 1.05rem; color: var(--accent); }
.legal-card p { color: var(--text); line-height: 1.6; }
.legal-toc { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0 12px; }
.legal-toc a { color: var(--muted); text-decoration: none; font-size: 0.85rem; }
.legal-toc a.active { color: var(--accent); }
.legal-langs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.legal-langs a {
  color: var(--muted); text-decoration: none; font-size: 0.78rem;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px;
}
.legal-langs a.active, .legal-langs a:hover { color: var(--accent); border-color: var(--accent); }

.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 1500;
  max-width: 720px; margin: 0 auto;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px; display: flex; gap: 16px; align-items: center; justify-content: space-between;
  flex-wrap: wrap; box-shadow: 0 12px 40px rgba(0,0,0,.35);
}
.cookie-banner p { margin: 6px 0 0; color: var(--muted); font-size: 0.85rem; }
.cookie-banner button { margin-top: 0; }
.cookie-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.auth-switch { margin: 18px 0 0; color: var(--muted); font-size: 0.88rem; text-align: center; }
.auth-switch a { font-weight: 600; }
.field-check span { line-height: 1.4; }

.kind-checks { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 12px 0 4px; }
.kind-checks-label { color: var(--muted); font-size: 0.8rem; width: 100%; }
.kind-checks .field-check { margin: 0; }
.module-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0 4px; }
.module-toolbar button { margin-top: 8px; }
button.sm { margin-top: 0; padding: 6px 10px; font-size: 0.8rem; }
.module-card {
  border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 12px 0;
  background: #141a12;
}
.module-card-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.module-card-head select { max-width: 180px; margin: 0; flex: 0 0 160px; }
.module-card-head .module-name { flex: 1 1 180px; margin: 0; }
.module-card-head button { margin-top: 0; margin-left: 0; }
.path-row { display: flex; gap: 8px; align-items: center; }
.path-row input { flex: 1; margin: 0; }
.path-row button { margin-top: 0; white-space: nowrap; }
.module-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 800px) { .module-grid { grid-template-columns: 1fr; } }
.module-card textarea { min-height: 64px; }

/* —— Panel a pantalla completa —— */
.wrap.wrap-app {
  max-width: none;
  width: 100%;
  min-height: 100vh;
  padding: 18px 28px 40px;
  display: flex;
  flex-direction: column;
}
.wrap.wrap-app .site-footer { margin-top: 28px; padding-top: 16px; }
.wrap.wrap-app .layout {
  flex: 1;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
  min-height: 0;
}
.nav-side {
  position: sticky;
  top: 82px;
  align-self: start;
  padding: 12px;
}
.nav-item { padding: 12px 14px; font-size: 0.95rem; }
.workspace {
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 28px 32px;
  min-height: calc(100vh - 140px);
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}
.page-head h2 { margin: 0; font-size: 1.55rem; }
.page-head .hint { margin: 6px 0 0; }
.page-head-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.page-head-actions button, .page-head-actions .ghost-link { margin-top: 0; }
.search-input { min-width: 220px; width: min(320px, 100%); margin: 0; }

.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  width: 100%;
}
.proj-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 200px;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #141a12;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.proj-card:hover { border-color: var(--accent); }
.proj-card .stripe {
  position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: var(--accent);
}
.proj-card h3 { margin: 0; font-size: 1.12rem; padding-left: 8px; }
.proj-card .muted { padding-left: 8px; }
.proj-meta {
  display: flex; flex-wrap: wrap; gap: 6px; padding-left: 8px; margin-top: auto;
}
.proj-stats {
  display: flex; gap: 10px; flex-wrap: wrap; padding-left: 8px;
  font-size: 0.82rem; color: var(--muted);
}

.split-form {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(380px, 1.25fr);
  gap: 20px;
  align-items: start;
  width: 100%;
}
.split-form .stack { min-width: 0; }
.split-form textarea.tall { min-height: 200px; }
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}
.form-actions {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 8px;
}
.form-actions button { margin-top: 0; }

.color-swatches { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.swatch {
  width: 28px; height: 28px; border-radius: 50%; margin: 0; padding: 0;
  background: var(--sw); border: 2px solid transparent; cursor: pointer;
}
.swatch.active { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg-2), 0 0 0 4px var(--sw); }

.ticket-table { display: grid; gap: 0; width: 100%; }
.ticket-table .thead,
.ticket-table .trow {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) minmax(120px, 1.2fr) minmax(140px, 1fr) 110px 90px 90px;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
}
.ticket-table .thead {
  color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--line);
}
.ticket-table .trow {
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.ticket-table .trow:hover { background: #222a1e; }
.ticket-split {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.15fr);
  gap: 20px;
  align-items: start;
}
.ticket-lead {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 10px;
}
.ticket-lead h2 { margin: 0; font-size: 1.25rem; line-height: 1.3; flex: 1; min-width: 0; }
.ticket-lead .ghost { margin-top: 0; flex: none; }
.ticket-excerpt {
  margin: 10px 0 0;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ticket-excerpt.is-open {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}
button.compact { margin-top: 8px; padding: 6px 10px; font-size: 0.8rem; font-weight: 500; }
.ticket-edit { margin-top: 12px; max-width: 640px; }
.ticket-edit textarea { min-height: 88px; }
.ticket-actions { margin: 0 0 12px; }
.ticket-actions button { margin-top: 0; }
.fold {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0d110c;
  margin: 0 0 8px;
}
.fold > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 10px 12px;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after {
  content: "▸";
  margin-left: auto;
  color: var(--muted);
  font-size: 0.8rem;
}
.fold[open] > summary::after { content: "▾"; }
.fold-snip {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
}
.fold-body { padding: 0 12px 12px; }
.fold-body textarea { min-height: 72px; margin-top: 4px; }
.fold-body .form-actions { margin-top: 8px; }
.fold-body .form-actions button { margin-top: 0; }
pre.prompt {
  min-height: 0;
  max-height: 240px;
  overflow: auto;
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.4;
  white-space: pre-wrap;
  user-select: text;
  -webkit-user-select: text;
}
textarea.tall { min-height: 88px; }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

@media (max-width: 1100px) {
  .ticket-table .thead { display: none; }
  .ticket-table .trow {
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
  }
  .ticket-table .trow > :nth-child(n+3):nth-child(-n+4) { grid-column: 1; }
}
@media (max-width: 960px) {
  .wrap.wrap-app { padding: 14px 14px 28px; }
  .wrap.wrap-app .top { margin: -14px -14px 18px; padding: 12px 14px; }
  .wrap.wrap-app .nav-side { top: 0; }
  .wrap.wrap-app .layout { grid-template-columns: 1fr; }
  .nav-side { position: static; }
  .split-form, .ticket-split { grid-template-columns: 1fr; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .workspace { padding: 18px 16px 24px; min-height: 0; }
}

/* ── Navigation sidebar ─────────────────────────────── */
.nav-side {
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px 10px; border-radius: 16px;
}
.nav-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--muted); padding: 14px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; margin-top: 0; padding: 9px 10px;
  background: transparent; color: var(--text);
  border: 0; border-left: 3px solid transparent; border-radius: 0 8px 8px 0;
  font-weight: 500; text-align: left;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.nav-item svg { width: 16px; height: 16px; flex: none; opacity: 0.85; }
.nav-item:hover:not(:disabled) { background: var(--bg-3); filter: none; }
.nav-item.active {
  background: var(--bg-3); color: var(--accent);
  border-left-color: var(--accent); font-weight: 600;
}
.nav-item.active svg { opacity: 1; }
.nav-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-pill { flex: none; }
.nav-pill .pill { font-size: 11px; padding: 1px 7px; }
.nav-empty { padding: 4px 10px; font-size: 12px; }
#nav-projects { display: flex; flex-direction: column; gap: 2px; }
.nav-proj {
  display: flex; align-items: center; gap: 9px;
  width: 100%; margin-top: 0; padding: 7px 10px 7px 12px;
  background: transparent; color: var(--text); border: 0; border-radius: 8px;
  font-weight: 400; font-size: 13.5px; text-align: left; text-decoration: none;
}
.nav-proj:hover:not(:disabled) { background: var(--bg-3); filter: none; }
.nav-proj.active { background: var(--bg-3); color: var(--accent); }
.nav-proj .np-name {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-proj .np-open {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 20px; padding: 1px 7px; flex: none;
}
.nav-proj .np-open.has-open { color: var(--accent); border-color: var(--line-2); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }

/* ── Workspace (fondo transparente, superficies propias) ── */
.card.workspace { background: transparent; border: 0; box-shadow: none; padding: 2px 4px 32px; }

/* ── Dashboard ──────────────────────────────────────── */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px; margin-bottom: 24px;
}
.kpi {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px; margin-top: 0; color: var(--text); font-weight: 400;
  text-align: left; cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .12s ease;
}
.kpi:hover:not(:disabled) { border-color: var(--line-2); background: var(--bg-3); transform: translateY(-1px); filter: none; }
.kpi .kpi-num {
  font-family: var(--mono); font-size: 30px; font-weight: 600;
  color: var(--accent); line-height: 1.1;
}
.kpi .kpi-label { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.home-grid {
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 18px; align-items: start;
}
.home-col h3 { margin: 0 0 4px; }

/* ── Activity feed ──────────────────────────────────── */
.feed { display: flex; flex-direction: column; gap: 8px; }
.feed-item {
  display: flex; align-items: flex-start; gap: 11px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; color: var(--text);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.feed-item:hover { border-color: var(--line-2); background: var(--bg-3); }
.feed-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; margin-top: 5px; }
.feed-body { flex: 1; min-width: 0; }
.feed-body strong { display: block; font-size: 14px; margin-bottom: 2px; }
.feed-body p { margin: 0; font-size: 12px; line-height: 1.4; }
.feed-item .pill {
  flex: none; max-width: 180px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Project tabs ───────────────────────────────────── */
.ptabs {
  display: flex; gap: 4px; overflow-x: auto;
  border-bottom: 1px solid var(--line);
  margin: 4px 0 22px; padding-bottom: 0;
}
.ptab {
  margin-top: 0; padding: 9px 14px; flex: none;
  background: transparent; color: var(--muted);
  border: 0; border-bottom: 2px solid transparent; border-radius: 8px 8px 0 0;
  font-weight: 500; font-size: 13.5px; white-space: nowrap;
}
.ptab:hover:not(:disabled) { color: var(--text); background: var(--bg-3); filter: none; }
.ptab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.ptab-pane[hidden] { display: none; }

/* ── Search inputs ──────────────────────────────────── */
.search-input {
  width: auto; min-width: 200px; max-width: 320px; flex: 1;
  background: var(--bg-2); border-radius: 20px; padding: 8px 16px;
}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.75); cursor: pointer; }

/* ── Cards / rows pulidos ───────────────────────────── */
.proj-card, .ver-item, .mem-item {
  transition: border-color .15s ease, transform .12s ease;
}
.proj-card:hover, .ver-item:hover { border-color: var(--line-2); transform: translateY(-1px); }

/* Scrollbar discreta del tema */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-2); border-radius: 6px; border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

@media (max-width: 1100px) {
  .home-grid { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .nav-side { flex-direction: row; overflow-x: auto; gap: 4px; padding: 8px; }
  .nav-side .nav-label, .nav-side #nav-projects { display: none; }
  .nav-item { border-left: 0; border-bottom: 2px solid transparent; border-radius: 8px; flex: none; }
  .nav-item.active { border-bottom-color: var(--accent); }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Capa de agentes ---------- */
.pill.alert { color: var(--danger); border-color: rgba(224, 122, 95, 0.5); }
.pill.st-running, .pill.stage-running { color: var(--accent); border-color: var(--accent); }
.pill.st-done, .pill.stage-done { color: var(--ok); }
.pill.st-failed { color: var(--danger); }
.pill.st-cancelled { color: var(--muted); }
.pill.stage-review { color: var(--accent-2); border-color: var(--accent-2); }
.pill.stage-queued { color: #f0c14b; }
.pill.stage-refined { color: var(--accent-2); }
.row-pills { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.row-pills button { margin-top: 0; }
.ag-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 14px 0 4px; }
.ag-head h3 { margin: 0; }
.ag-log { max-height: 360px; overflow: auto; font-size: 0.78rem; white-space: pre-wrap; }
.file-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; overflow-wrap: anywhere; }
.file-row.out { border-color: var(--danger); background: rgba(224, 122, 95, 0.08); }
.alert-row.is-open { border-color: rgba(224, 122, 95, 0.5); }
.alert-row code, .mem-row code { overflow-wrap: anywhere; }

.stage-board { display: grid; grid-template-columns: repeat(6, minmax(170px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.stage-col { background: var(--bg-3); border: 1px solid var(--line); border-radius: 10px; padding: 10px; min-height: 120px; }
.stage-col h4 { margin: 0 0 8px; font-size: 0.85rem; }
.stage-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; cursor: pointer; }
.stage-card:hover { border-color: var(--accent); }
.stage-card p { margin: 4px 0 6px; font-size: 0.8rem; }
.stage-steps { display: flex; gap: 4px; flex-wrap: wrap; margin: 6px 0 4px; }
.stage-steps span { font-size: 0.72rem; font-family: var(--mono); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.stage-steps span.on { color: #10140f; background: var(--accent); border-color: var(--accent); }

.work-panel { border: 1px solid var(--line-2); border-radius: 12px; padding: 14px; margin-bottom: 16px; background: var(--bg-3); }
.work-panel .mem-head h3 { margin: 0; }
.work-panel .run-box { margin-top: 10px; }
.code-area { font-family: var(--mono); font-size: 0.85rem; min-height: 180px; }

.mem-group h4 { margin: 18px 0 8px; display: flex; gap: 8px; align-items: center; }
.mem-row { align-items: flex-start; }
.mem-row .mem-sel { width: auto; margin-top: 4px; }
.mem-main { flex: 1; min-width: 0; }
.mem-prev { font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mem-body { max-height: 70vh; overflow: auto; }
.sel-bar { position: sticky; top: 0; z-index: 2; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 10px; background: var(--bg-3); border: 1px solid var(--accent); border-radius: 10px; }
.sel-bar button { margin-top: 0; }

.bar-chart { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 16px; }
.bar-chart .bar { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.bar-chart .bar span { display: block; width: 100%; min-height: 2px; background: var(--accent); border-radius: 3px 3px 0 0; opacity: 0.85; }
.bar-chart .bar:hover span { opacity: 1; }
.hbar { display: grid; grid-template-columns: minmax(90px, 160px) 1fr auto; gap: 10px; align-items: center; margin: 6px 0; font-size: 0.85rem; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 10px; background: var(--bg-3); border-radius: 999px; overflow: hidden; }
.hbar-track span { display: block; height: 100%; background: var(--accent-2); border-radius: 999px; }

@media (max-width: 720px) {
  .stage-board { grid-template-columns: repeat(6, 78%); }
  .hbar { grid-template-columns: 90px 1fr auto; }
}

/* Memorias: que nada se salga por la derecha + carpetas sin proyecto */
.layout > main, .workspace, .mem-group, .mem-main { min-width: 0; }
.mem-row strong, .mem-row .muted, .mem-root-path code, .roots-box code { overflow-wrap: anywhere; word-break: break-word; }
.mem-prev { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mem-group h4 .root-open { margin: 0 0 0 auto; }
.mem-group h4 { flex-wrap: wrap; }
.mem-root-path { margin: -4px 0 8px; font-size: 0.78rem; }
.roots-box { display: grid; gap: 10px; padding: 12px 14px; margin-bottom: 14px; border: 1px solid var(--accent); border-radius: 10px; background: var(--bg-3); }
.roots-box p { margin: 4px 0 0; }
.roots-list { display: flex; flex-wrap: wrap; gap: 6px; }
.roots-list button { margin-top: 0; }
.rm-list { max-height: 40vh; overflow: auto; }
.rm-row { cursor: pointer; justify-content: flex-start; }
.rm-row input { width: auto; }
#rm-name, #rm-proj { margin-bottom: 6px; }
.merge-prev ul { margin: 6px 0 10px; padding-left: 18px; }
.merge-prev li { margin: 2px 0; }
.ticket-delete { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }

/* Imágenes y vídeos que generó el agente en esa sesión */
.mem-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 8px 0 16px; }
.mem-media-item { margin: 0; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; min-width: 0; }
.mem-media-item img, .mem-media-item video { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--bg); }
.mem-media-item figcaption { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; font-size: 12px; min-width: 0; }
.mem-media-item figcaption > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mem-media-acts { display: flex; gap: 6px; margin-top: 4px; }
.mem-media-acts .sm { padding: 2px 8px; font-size: 11px; margin: 0; text-decoration: none; }

/* Adjuntos del proyecto */
.pf-drop { border: 1px dashed transparent; border-radius: 12px; padding: 4px; transition: border-color .15s ease, background .15s ease; }
.pf-drop.over { border-color: var(--accent); background: var(--bg-2); }
.pf-file { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1; background: var(--bg); text-decoration: none; }
.pf-file span { font-weight: 700; font-size: 1.1rem; color: var(--muted, var(--text)); letter-spacing: .04em; }
.pf-file audio { width: 92%; }

/* Premisas */
.prem { max-width: 820px; }
.prem-item { display: flex; gap: 10px; align-items: flex-start; background: #0d110c; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.prem-item.off .prem-body { opacity: .5; text-decoration: line-through; }
.prem-on { margin: 2px 0 0; }
.prem-body { flex: 1; min-width: 0; }
.prem-body textarea { width: 100%; }
.prem-acts { display: flex; gap: 6px; flex-shrink: 0; }
.prem-acts button { margin-top: 0; }
.prem-body .prem-acts { margin-top: 6px; }
.prem-add { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.prem-add textarea { flex: 1; min-height: 44px; }
.prem-add button { margin-top: 0; }
@media (max-width: 640px) { .prem-item { flex-wrap: wrap; } .prem-add { flex-direction: column; align-items: stretch; } }
