/* Kin (/app): misma estética que rintaro.com.ar. Blanco papel, tinta negra y el verde retro del
   logo para las acciones. Dos tipografías: Source Serif 4 (títulos) e Inter (todo lo demás).
   Móvil primero, botones de 44 px, números alineados (SPEC §15.4). */
:root {
  --paper: #fcfcfa; --paper-2: #f3f4f0; --card: #ffffff;
  --ink: #111111; --ink-2: #3a3a38; --ink-3: #6b6b67;
  --line: rgba(17,17,17,.1); --line-2: rgba(17,17,17,.2);
  --green: #1e6b47; --green-d: #154d33; --green-l: #6cc79a; --green-soft: #e6f2eb;
  --error: #b42318; --warn: #8a5a00; --flag: #fff7e6;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration-color: var(--green-l); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 8px; }
main { max-width: 1440px; margin: 0 auto; padding: 20px 20px 40px; }

.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; background: rgba(252,252,250,.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand img { width: 26px; height: 26px; object-fit: contain; }
.brand b { font-family: var(--serif); font-weight: 500; font-size: 20px; letter-spacing: -.01em; }
.brand span { color: var(--ink-3); font-size: 14px; margin-left: 6px; padding-left: 10px; border-left: 1px solid var(--line-2); }
.app-nav { display: flex; align-items: center; gap: 14px; }

h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 4vw, 44px); line-height: 1.08; letter-spacing: -.02em; margin: 6px 0 12px; }
h2 { font-family: var(--sans); font-weight: 600; font-size: 14px; letter-spacing: 0; color: var(--ink-3); margin: 0 0 12px; }
.ante { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--green); margin: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 22px; margin: 16px 0; }
.narrow { max-width: 440px; margin: 56px auto; }
.muted { color: var(--ink-3); }
.small { font-size: .88rem; }
.error { color: var(--error); font-weight: 600; }
.warning { color: var(--warn); }
.nowrap { white-space: nowrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

label { display: block; font-size: .9rem; color: var(--ink-2); margin-bottom: 12px; }
label.check { display: flex; align-items: center; gap: 8px; color: var(--ink); }
input, select { display: block; width: 100%; min-height: 46px; margin-top: 5px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--card); color: var(--ink); font: inherit; }
input:focus, select:focus { outline: 3px solid var(--green-soft); outline-offset: 0; border-color: var(--green); }
input[type="checkbox"] { width: 18px; height: 18px; min-height: auto; display: inline-block; margin: 0; accent-color: var(--green); flex: none; }
input[type="file"] { padding: 9px; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 10px 22px; border: 1px solid var(--ink); border-radius: 999px; background: var(--ink); color: #fff; font: inherit; font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s; }
button:hover { background: #2a2a2a; }
button.sec { background: transparent; color: var(--ink); border-color: var(--line-2); }
button.sec:hover { background: var(--paper-2); }
button.verde { background: var(--green); border-color: var(--green); color: #fff; }
button.verde:hover { background: var(--green-d); }
button.ancho { width: 100%; }
button.link { background: none; border: 0; color: var(--ink-2); padding: 4px; min-height: auto; font-weight: 400; text-decoration: underline; }

.status { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .78rem; border: 1px solid var(--line-2); color: var(--ink-2); white-space: nowrap; }
.s-parsed { background: var(--green-soft); color: var(--green); border-color: transparent; }
.s-failed { color: var(--error); border-color: var(--error); }
.s-needs_review { color: var(--warn); border-color: var(--warn); }
.stats { display: flex; flex-wrap: wrap; gap: 28px; }
.stats div { display: flex; flex-direction: column; }
.stats strong { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.1; }
.stats span { color: var(--ink-3); font-size: .85rem; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--ink-3); font-weight: 600; white-space: nowrap; font-size: .82rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabla-scroll { overflow-x: auto; margin: 8px 0 12px; }
tr.flag td { background: var(--flag); }

/* Entrar y crear cuenta */
.acceso { max-width: 420px; margin: 48px auto; text-align: center; }
.acceso > img { width: 52px; height: 52px; object-fit: contain; }
.acceso h1 { margin-top: 14px; }
.acceso form { text-align: left; margin-top: 22px; }
.acceso .error { text-align: left; }
.acceso button { margin-top: 6px; }
.cambio { margin-top: 22px; color: var(--ink-3); }
.cambio a { color: var(--green); font-weight: 600; }
.incluye { list-style: none; padding: 16px 18px; margin: 22px 0 0; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 16px; display: grid; gap: 8px; font-size: 14.5px; color: var(--ink-2); }
.incluye li { padding-left: 24px; position: relative; }
.incluye li::before { content: ""; position: absolute; left: 2px; top: 6px; width: 11px; height: 6px; border-left: 2px solid var(--green); border-bottom: 2px solid var(--green); transform: rotate(-45deg); }

/* Tu cuenta */
.nav-link { color: var(--ink-2); font-size: 15px; text-decoration: none; }
.nav-link:hover { color: var(--ink); text-decoration: underline; }
.cuenta { text-align: left; }
.datos { margin: 20px 0; padding: 4px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.datos div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.datos div:last-child { border-bottom: 0; }
.datos dt { color: var(--ink-3); }
.datos dd { margin: 0; font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.borrar { margin-top: 36px; border-top: 1px solid var(--line); padding-top: 18px; }
.borrar summary { cursor: pointer; color: var(--error); font-weight: 600; }
.borrar form { margin-top: 12px; }
button.peligro { background: var(--error); border-color: var(--error); }
button.peligro:hover { background: #8f1c13; }

/* Kin: el chat al frente, primeros pasos, proveedores y listas al costado */
.kin-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.kin-chat { background: var(--card); border: 1px solid var(--line); border-radius: 24px; display: flex; flex-direction: column; min-height: calc(100vh - 116px); overflow: hidden; }

.inicio { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 48px 24px 24px; }
.inicio-logo { width: 56px; height: 56px; object-fit: contain; }
.inicio h1 { margin-top: 18px; }
.inicio > p { max-width: 460px; margin: 0 0 26px; }
.inicio .caja { width: 100%; max-width: 640px; }
.sugerencias { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; max-width: 640px; }
.sugerencias form { margin: 0; }
.chip { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); font-size: 14.5px; font-weight: 500; text-decoration: none; }
button.chip { font-weight: 500; }
.chip:hover { border-color: var(--green); background: var(--green-soft); color: var(--green-d); }

.caja { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 18px; border: 1px solid var(--line-2); border-radius: 20px; background: var(--card); box-shadow: 0 1px 2px rgba(17,17,17,.04), 0 8px 24px rgba(17,17,17,.05); }
.caja:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.caja input { margin: 0; border: 0; padding: 12px 0; min-height: 48px; }
.caja input:focus { outline: none; }
.enviar { flex: none; width: 44px; min-height: 44px; height: 44px; padding: 0; border-radius: 50%; background: var(--green); border-color: var(--green); font-size: 20px; }
.enviar:hover { background: var(--green-d); }

.chat-cab { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.chat-cab img { width: 28px; height: 28px; object-fit: contain; }
.chat-cab b { display: block; font-family: var(--serif); font-weight: 500; font-size: 19px; line-height: 1.1; }
.chat-cab small { color: var(--ink-3); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.punto { width: 7px; height: 7px; border-radius: 50%; background: var(--green-l); }
.chat-msgs { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 22px; overflow-y: auto; max-height: calc(100vh - 300px); }
.bubble { max-width: 86%; padding: 11px 15px; border-radius: 18px; white-space: pre-line; line-height: 1.5; font-variant-numeric: tabular-nums; }
.bubble.kin { align-self: flex-start; background: var(--paper-2); border-bottom-left-radius: 6px; }
.bubble.yo { align-self: flex-end; background: var(--green); color: #fff; border-bottom-right-radius: 6px; }
.bubble a { font-weight: 600; color: var(--green); }
.bubble.form-card { width: 100%; max-width: 680px; white-space: normal; background: var(--card); border: 1px solid var(--line); }
.bubble.form-card p { margin: 0 0 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; margin-top: 6px; }
.form-grid .span { grid-column: 1 / -1; }
.chat-pie { padding: 12px 16px 4px; }

.subir { padding: 6px 16px 16px; }
.inicio + .subir { text-align: center; }
.inicio + .subir .adjuntar:not([open]) { display: none; } /* en el inicio lo abre la sugerencia */
.adjuntar summary { cursor: pointer; list-style: none; display: inline-flex; gap: 8px; align-items: center; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-2); font-size: 14.5px; }
.adjuntar summary::-webkit-details-marker { display: none; }
.adjuntar summary:hover, .adjuntar[open] summary { background: var(--paper-2); }
.clip { width: 10px; height: 16px; border: 2px solid currentColor; border-radius: 6px; transform: rotate(35deg); }
.adjuntar form { margin-top: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; align-items: end; text-align: left; }
.adjuntar form .span { grid-column: 1 / -1; }
.prueba { margin: 10px 0 0; }

.kin-lado { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 16px; }
.lado-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 18px; }
.lado-lista { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 12px; }
.lado-lista li { display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.lado-lista li a { font-weight: 600; text-decoration: none; }
.lado-lista small { color: var(--ink-3); font-size: 12.5px; line-height: 1.4; }
.pasos-cab { display: flex; justify-content: space-between; align-items: baseline; }
.pasos-cab small { color: var(--ink-3); font-size: 13px; }
.barra { height: 6px; border-radius: 99px; background: var(--paper-2); overflow: hidden; margin-bottom: 14px; }
.barra span { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.pasos { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 15px; }
.pasos li { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.pasos li > span:first-child { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; position: relative; }
.pasos li.ok { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-2); }
.pasos li.ok > span:first-child { background: var(--green); border-color: var(--green); }
.pasos li.ok > span:first-child::after { content: ""; position: absolute; left: 5px; top: 3px; width: 6px; height: 9px; border-right: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(45deg); }

@media (max-width: 900px) {
  main { padding: 12px 12px 32px; }
  .kin-layout { grid-template-columns: minmax(0, 1fr); }
  .kin-lado { position: static; }
  .kin-chat { min-height: 70vh; }
  .chat-msgs { max-height: 60vh; }
  .form-grid, .adjuntar form { grid-template-columns: minmax(0, 1fr); }
  .brand span { display: none; }
  .inicio { padding: 36px 16px 16px; }
}

/* REN conectado (D-043): tarjeta del inicio y sección de Tu cuenta */
.ren-datos { list-style: none; margin: 10px 0 12px; padding: 0; display: grid; gap: 6px; font-size: .95rem; color: var(--ink-2); }
.ren-datos b { color: var(--ink); font-variant-numeric: tabular-nums; }
.avisos { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 14px; }
.avisos li { display: grid; gap: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.avisos li:last-child { border-bottom: 0; padding-bottom: 0; }
.avisos p { margin: 0; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.avisos form { margin-top: 4px; }
.ren-acciones { display: flex; flex-wrap: wrap; gap: 6px; }
.ren-acciones form { margin: 0; }
.ren-acciones .chip { min-height: 34px; padding: 6px 12px; font-size: 13.5px; }
.boton-sec { display: flex; justify-content: center; align-items: center; min-height: 40px; margin-top: 10px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14.5px; }
.boton-sec:hover { background: var(--paper-2); border-color: var(--green); }
.ren-cuenta { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 18px; }
.ren-cuenta h2 { margin: 0 0 8px; }
.ren-cuenta summary { cursor: pointer; font-weight: 600; color: var(--green-d); margin: 6px 0; }
.ren-cuenta form { margin-top: 10px; display: grid; gap: 10px; }
.ren-cuenta code { font-size: .9em; }
.ren-cuenta .desconectar { margin-top: 12px; }
p.ok { color: var(--green-d); font-weight: 600; }
