/* Captura rápida (ventana en escritorio, hoja en móvil) y panel/hoja del asistente. */
dialog { border: 0; padding: 0; color: var(--ink); background: var(--surface); }
dialog::backdrop { background: rgb(21 23 28 / .42); }

/* ---------- Captura: móvil (hoja desde abajo) ---------- */
.capture {
  width: 100%; max-width: 100%; max-height: 90vh; margin: auto 0 0; overflow-y: auto;
  border-radius: 22px 22px 0 0; padding: 14px 16px calc(18px + env(safe-area-inset-bottom));
}
.capture__types { display: none; }
.capture__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.capture__head h3 { font-size: 18px; font-weight: 700; }
.capture-menu { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.capture-menu__item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg); font-size: 15px; font-weight: 500; text-align: left; color: var(--ink);
}
.capture-menu__item svg { flex: none; }
.capture-form { display: grid; gap: 14px; }
.chip--date { width: auto; min-height: 0; padding: 0 10px; font-size: 13px; }
.capture__foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.capture__hint { font-size: 12px; color: var(--muted); }
.capture__actions { display: flex; gap: 8px; margin-left: auto; }

/* ---------- Captura: escritorio (ventana centrada de 760 px) ---------- */
@media (min-width: 1024px) {
  .capture {
    width: min(760px, calc(100% - 48px)); max-height: calc(100vh - 48px); margin: auto;
    border-radius: 14px; padding: 0; overflow: hidden; display: grid; grid-template-columns: 250px minmax(0, 1fr);
    border: 1px solid var(--line); box-shadow: 0 30px 80px rgb(0 0 0 / .3);
  }
  .capture:not([open]) { display: none; }
  .capture__types { display: flex; flex-direction: column; gap: 6px; background: var(--bg); border-right: 1px solid var(--line); padding: 18px 16px; overflow-y: auto; max-height: calc(100vh - 48px); }
  .capture__types-head { display: flex; justify-content: space-between; align-items: center; padding: 0 2px 8px; }
  .ty {
    display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 12px; border-radius: 10px;
    border: 1px solid var(--line); background: var(--surface); font-size: 13.5px; font-weight: 500; color: var(--ink); text-align: left;
  }
  .ty[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
  .ty svg { width: 18px; height: 18px; flex: none; }
  .ty kbd { margin-left: auto; font: inherit; font-size: 11px; color: var(--muted); }
  .ty[aria-pressed="true"] kbd { color: inherit; opacity: .7; }
  .capture__main { padding: 20px 22px; overflow-y: auto; max-height: calc(100vh - 48px); }
  .capture-menu { display: none; }
  .capture--simple { width: min(560px, calc(100% - 48px)); grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Asistente: móvil (hoja de 640 px) ---------- */
.assistant {
  width: 100%; max-width: 100%; height: 640px; max-height: 88vh; margin: auto 0 0;
  border-radius: 22px 22px 0 0; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 -20px 60px rgb(0 0 0 / .25);
}
.assistant:not([open]) { display: none; }
.assistant__handle { width: 40px; height: 5px; border-radius: 99px; background: var(--box-line); margin: 8px auto 0; flex: none; }
.assistant__head { display: flex; align-items: center; gap: 10px; padding: 10px 16px 12px; border-bottom: 1px solid var(--line-2); flex: none; }
.assistant__mark { width: 36px; height: 36px; border-radius: 50%; background: var(--dark); color: var(--accent); display: grid; place-items: center; flex: none; }
.assistant__mark svg { width: 18px; height: 18px; }
.assistant__head h2 { font-size: 16px; font-weight: 700; }
.assistant__head-text { flex: 1; min-width: 0; }
.assistant__ctx { display: flex; gap: 6px; padding: 10px 16px 0; overflow-x: auto; flex: none; scrollbar-width: none; }
.assistant__log { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.me { align-self: flex-end; max-width: 85%; background: var(--dark); color: var(--on-dark); border-radius: 16px 16px 4px 16px; padding: 10px 14px; font-size: 15px; overflow-wrap: anywhere; }
.ai { align-self: flex-start; max-width: 94%; background: var(--bg); border-radius: 16px 16px 16px 4px; padding: 12px 14px; font-size: 15px; line-height: 1.45; display: flex; flex-direction: column; gap: 8px; overflow-wrap: anywhere; }
.ai__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.act { height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink); }
.assistant__sug { padding: 0 16px 8px; display: flex; gap: 6px; overflow-x: auto; flex: none; scrollbar-width: none; }
.sug { height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; color: var(--ink-2); white-space: nowrap; flex: none; }
.assistant__form { border-top: 1px solid var(--line-2); padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 8px; flex: none; }
.assistant__input { flex: 1; min-width: 0; display: flex; align-items: center; height: 46px; border: 1px solid var(--line); border-radius: 999px; padding: 0 16px; background: var(--surface); }
.assistant__input input { width: 100%; border: 0; outline: 0; font-size: 16px; color: var(--ink); background: transparent; }
.assistant__send { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; padding: 0; flex: none; }
.assistant__send svg { width: 20px; height: 20px; }
.assistant__mic { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: grid; place-items: center; padding: 0; flex: none; }
.assistant__mic[aria-pressed="true"] { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.prop { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.prop__label { font-weight: 600; font-size: 14px; }
.prop__details { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--ink-2); display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.act--pri { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.act:disabled { opacity: .5; }
.ai--wait { color: var(--muted); font-style: italic; }
.md--chat { font-size: inherit; gap: 6px; }
.assistant__foot { display: none; font-size: 11.5px; color: var(--muted); padding: 0 16px 12px; }

/* ---------- Asistente: escritorio (panel abajo a la derecha, 440×700) ---------- */
@media (min-width: 1024px) {
  .assistant {
    position: fixed; inset: auto 24px 24px auto; margin: 0; width: 440px; height: 700px; max-height: calc(100vh - 48px);
    border-radius: 20px; border: 1px solid var(--line); box-shadow: 0 30px 80px rgb(0 0 0 / .28);
  }
  .assistant::backdrop { background: transparent; }
  .assistant__handle { display: none; }
  .assistant__head { padding: 14px 16px; }
  .assistant__head h2 { font-size: 15px; }
  .assistant__mark { width: 34px; height: 34px; }
  .assistant__log { padding: 14px 16px; gap: 12px; }
  .me { font-size: 14px; }
  .ai { font-size: 14px; line-height: 1.5; max-width: 92%; }
  .act { height: 30px; padding: 0 11px; font-size: 12.5px; }
  .sug { height: 32px; font-size: 12.5px; }
  .assistant__form { padding: 12px 16px 8px; }
  .assistant__input { height: 40px; border-radius: 14px; }
  .assistant__input input { font-size: 14px; }
  .assistant__send { width: 36px; height: 36px; border-radius: 10px; }
  .assistant__send svg { width: 16px; height: 16px; }
  .assistant__mic { width: 36px; height: 36px; border-radius: 10px; }
  .assistant__foot { display: block; }
}
