/* Panel de pedidos Vergel — verde de marca, pensado para usar desde el celular */
:root {
  --bg: #f3f5f0;
  --surface: #ffffff;
  --surface-2: #f8faf6;
  --line: #dde3d6;
  --fg: #1c251a;
  --muted: #5e6a59;
  --accent: #1f7a3a;
  --accent-ink: #ffffff;
  --accent-soft: #e1efe3;
  --pend: #9a6408;   --pend-bg: #f8edd6;
  --conf: #2c5f9e;   --conf-bg: #e3ecf7;
  --ok: #1f7a3a;     --ok-bg: #dcefe0;
  --bad: #a23a32;    --bad-bg: #f6e1de;
  --pause: #6b4fa0;  --pause-bg: #ece6f6;
  --off: #7a8275;    --off-bg: #eceee8;
  --shadow: 0 12px 40px rgba(20, 40, 20, .2);
  --f-display: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Public Sans", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111510; --surface: #191f18; --surface-2: #1e251c; --line: #2b3428; --fg: #e5ebe1; --muted: #98a592;
    --accent: #4cbb6c; --accent-ink: #0d1a10; --accent-soft: #1c3221;
    --pend: #e5b55a; --pend-bg: #352a14;
    --conf: #8db6ea; --conf-bg: #1c2a3c;
    --ok: #6fd08b; --ok-bg: #183222;
    --bad: #ec8f86; --bad-bg: #3a1f1c;
    --pause: #c3aef0; --pause-bg: #2a2340;
    --off: #a3ab9e; --off-bg: #262c24;
    --shadow: 0 12px 40px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 15px/1.45 var(--f-body); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--f-display); margin: 0; text-wrap: balance; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Estructura */
.top { position: sticky; top: 0; z-index: 10; background: var(--accent); color: var(--accent-ink);
  padding: calc(env(safe-area-inset-top, 0px) + 10px) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); }
.top-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 18px; }
.brand { font-family: var(--f-display); font-weight: 700; font-size: 20px; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand small { font-family: var(--f-body); font-weight: 500; font-size: 13px; opacity: .8; align-self: flex-end; padding-bottom: 2px; }
.brand-logo { width: 30px; height: 30px; border-radius: 7px; display: block; }
.tabs { display: flex; gap: 4px; margin-left: auto; }
.tab { border: 0; background: transparent; color: inherit; padding: 8px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; opacity: .8; display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { opacity: 1; background: rgba(255,255,255,.12); }
.tab.on { opacity: 1; background: rgba(255,255,255,.2); }
.tab .ico { font-size: 17px; line-height: 1; }
.badge { background: #ffd54a; color: #3a2a00; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 0 7px; min-width: 20px; text-align: center; }
main { max-width: 1100px; margin: 0 auto; padding: 18px max(16px, env(safe-area-inset-right, 0px)) 110px max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 760px) {
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; background: var(--surface); border-top: 1px solid var(--line); color: var(--fg);
    padding: 6px max(8px, env(safe-area-inset-left, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)); justify-content: space-around; z-index: 20; }
  .tab { flex-direction: column; gap: 2px; font-size: 12px; padding: 6px 8px; opacity: .65; position: relative; }
  .tab.on { background: var(--accent-soft); color: var(--accent); opacity: 1; }
  .tab:hover { background: var(--accent-soft); }
  .tab .badge { position: absolute; top: 0; right: 0; }
}

/* Comunes */
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 9px 14px; cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; text-decoration: none; color: var(--fg); }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.btn.danger { color: var(--bad); }
.btn.danger.armed { background: var(--bad); border-color: var(--bad); color: var(--surface); }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .5; cursor: default; }
.field { border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 9px 11px; width: 100%; min-width: 0; }
textarea.field { resize: vertical; min-height: 70px; }
.label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .grid2 { grid-template-columns: 1fr; } }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.section-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.section-title h1 { font-size: 26px; letter-spacing: -.01em; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.empty strong { color: var(--fg); font-family: var(--f-display); font-size: 19px; }

.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; overflow-x: auto; max-width: 100%; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 7px; cursor: pointer; font-weight: 600; color: var(--muted); white-space: nowrap; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-Pendiente { color: var(--pend); background: var(--pend-bg); }
.st-Confirmado { color: var(--conf); background: var(--conf-bg); }
.st-Entregado { color: var(--ok); background: var(--ok-bg); }
.st-Rechazado, .st-Cancelado { color: var(--bad); background: var(--bad-bg); }
.st-En-pausa { color: var(--pause); background: var(--pause-bg); }
.tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; border-radius: 5px; padding: 1px 6px; }
.tag.new { background: var(--pend-bg); color: var(--pend); }
.tag.paid { background: var(--ok-bg); color: var(--ok); }
.tag.unpaid { background: var(--off-bg); color: var(--off); }
.tag.paused { background: var(--pause-bg); color: var(--pause); }

/* Pedidos */
.day { display: flex; flex-direction: column; gap: 10px; }
.day-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.day-head h2 { font-size: 19px; text-transform: capitalize; }
.totals { background: var(--accent-soft); border-radius: 12px; padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.totals .t { display: flex; gap: 6px; align-items: baseline; }
.totals .n { font-family: var(--f-display); font-weight: 700; font-size: 22px; color: var(--accent); font-variant-numeric: tabular-nums; }
.orders { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 12px; }
.order { padding: 14px; display: flex; flex-direction: column; gap: 9px; cursor: pointer; border-left: 4px solid var(--line); }
.order:hover { border-color: var(--muted); }
.order.e-Pendiente { border-left-color: var(--pend); }
.order.e-Confirmado { border-left-color: var(--conf); }
.order.e-Entregado { border-left-color: var(--ok); }
.order.e-En-pausa { border-left-color: var(--pause); }
.order.e-Rechazado, .order.e-Cancelado { border-left-color: var(--bad); opacity: .75; }
.o-head { display: flex; gap: 8px; align-items: flex-start; }
.o-name { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.o-id { font-family: var(--f-display); color: var(--muted); font-weight: 600; }
.o-meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.o-items { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.o-items li { display: flex; gap: 8px; }
.o-items li span:first-child { flex: 1; min-width: 0; }
.o-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px dashed var(--line); padding-top: 8px; }
.o-total b { font-family: var(--f-display); font-size: 19px; font-variant-numeric: tabular-nums; }
.o-note { font-size: 13px; background: var(--surface-2); border-radius: 8px; padding: 6px 9px; overflow-wrap: anywhere; }
.o-warn { font-size: 13px; color: var(--bad); background: var(--bad-bg); border-radius: 8px; padding: 6px 9px; }
.o-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Productos */
.plist { display: flex; flex-direction: column; }
.prod { display: grid; grid-template-columns: minmax(0, 1.6fr) 150px 110px 110px auto; gap: 12px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line); }
.prod:first-child { border-top: 0; }
.prod.off .p-name { opacity: .55; }
.p-name { font-weight: 700; overflow-wrap: anywhere; }
.price-in { position: relative; }
.price-in span { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.price-in input { padding-left: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 600; user-select: none; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; margin: 0; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); transition: transform .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(16px); }
@media (max-width: 760px) {
  .prod { grid-template-columns: 1fr 1fr; }
  .prod .p-info { grid-column: 1 / -1; }
  .prod .p-act { grid-column: 1 / -1; justify-content: flex-start; }
}

/* Clientes */
.clist { display: flex; flex-direction: column; }
.cli { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr) 120px 110px; gap: 12px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line); cursor: pointer; }
.cli:first-child { border-top: 0; }
.cli:hover { background: var(--surface-2); }
@media (max-width: 760px) { .cli { grid-template-columns: 1fr auto; } .cli .c-hide { display: none; } }

/* Órdenes de compra */
.oc-list { display: flex; flex-direction: column; }
.oc-order { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.oc-order:first-child { border-top: 0; }
.oc-order input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.oc-order.auto { cursor: default; }
.oc-check { color: var(--ok); font-weight: 700; width: 18px; text-align: center; flex: none; margin-top: 2px; }
.oc-lines { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
.oc-summary .o-total b { font-size: 20px; }
.oc-hist { display: flex; flex-direction: column; }
.oc-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.oc-row:first-child { border-top: 0; }
.oc-row:hover { background: var(--surface-2); }
.oc-text { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.5 var(--f-body); margin: 0; }
.item-row.extra { grid-template-columns: minmax(0, 1fr) 70px minmax(0, 120px) 34px; }
.tag.oc { background: var(--conf-bg); color: var(--conf); }
.oc-Armada { color: var(--pend); background: var(--pend-bg); }
.oc-Enviada { color: var(--conf); background: var(--conf-bg); }
.oc-Recibida { color: var(--ok); background: var(--ok-bg); }
.oc-Anulada { color: var(--bad); background: var(--bad-bg); }
.item-row .it-opc { grid-column: 1 / -1; }
@media (max-width: 760px) { .tab { font-size: 11px; padding: 6px 4px; } }

/* Cuenta corriente, tablas, finanzas */
.st-Entrega-parcial { color: var(--pause); background: var(--pause-bg); }
.order.e-Entrega-parcial { border-left-color: var(--pause); }
.tag.partial { background: var(--pend-bg); color: var(--pend); }
.o-items li.off { text-decoration: line-through; opacity: .55; }
.acct { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.acct > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.acct b { font-family: var(--f-display); font-size: 17px; font-variant-numeric: tabular-nums; }
.neg { color: var(--bad); }
.pos { color: var(--ok); }
.hist { display: flex; flex-direction: column; gap: 6px; }
.tbl-wrap { overflow-x: auto; max-width: 100%; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 6px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 7px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.num, .tbl th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl tr.off td { text-decoration: line-through; opacity: .55; }
.tbl tr.link { cursor: pointer; }
.tbl tr.link:hover td { background: var(--surface-2); }
.tbl.small { font-size: 13px; }
.tbl .field { padding: 5px 8px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.kpi .k-l { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.kpi .k-v { font-family: var(--f-display); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi .k-s { font-size: 12px; color: var(--muted); }
.kpi.accent { background: var(--accent-soft); border-color: transparent; }
.kpi.accent .k-v { color: var(--accent); }
.kpi.good .k-v { color: var(--ok); }
.kpi.bad .k-v { color: var(--bad); }
.kpi.warn .k-v { color: var(--pend); }
.bars { display: flex; gap: 6px; align-items: flex-end; height: 140px; padding-top: 8px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.bar-fill { width: 100%; max-width: 48px; background: var(--accent); border-radius: 6px 6px 2px 2px; min-height: 2px; opacity: .85; }
.bar-l { font-size: 10px; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tag.mv-cobro, .tag.mv-aporte { background: var(--ok-bg); color: var(--ok); }
.tag.mv-gasto, .tag.mv-retiro, .tag.mv-pago_proveedor { background: var(--bad-bg); color: var(--bad); }
@media (max-width: 760px) { .tab { font-size: 10.5px; padding: 6px 2px; } .tab .ico { font-size: 16px; } .acct b { font-size: 15px; } }

/* Cuentas corrientes */
.cc-list { display: flex; flex-direction: column; }
.cc-row { border-top: 1px solid var(--line); padding: 12px 14px; border-left: 4px solid transparent; }
.cc-row:first-child { border-top: 0; }
.cc-row.debe { border-left-color: var(--bad); }
.cc-main { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.cc-name { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.cc-saldo { font-family: var(--f-display); font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cc-act { display: flex; gap: 6px; }
.cc-det { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
@media (max-width: 560px) { .cc-main > div:first-child { flex-basis: 100%; } }

/* Chats */
.chat-wrap { display: grid; grid-template-columns: minmax(240px, 340px) minmax(0, 1fr); gap: 14px; height: calc(100vh - 190px); min-height: 420px; }
.chat-list { overflow-y: auto; display: flex; flex-direction: column; }
.chat-row { text-align: left; border: 0; border-top: 1px solid var(--line); background: transparent; padding: 11px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.chat-row:first-child { border-top: 0; }
.chat-row:hover { background: var(--surface-2); }
.chat-row.on { background: var(--accent-soft); }
.chat-prev { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-pane { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.chat-head { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.chat-back { display: none; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.bub { max-width: min(80%, 520px); padding: 8px 11px; border-radius: 12px; font-size: 14px; display: flex; flex-direction: column; gap: 3px; }
.bub.in { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bub.out { align-self: flex-end; background: var(--accent-soft); border-bottom-right-radius: 4px; }
.bub.out.me { background: var(--accent); color: var(--accent-ink); }
.bub .txt { white-space: pre-wrap; overflow-wrap: anywhere; }
.bub .meta { font-size: 11px; opacity: .7; align-self: flex-end; }
.bub .err { color: var(--bad); }
.bub.me .err { color: inherit; }
.chat-form { display: flex; gap: 8px; padding: 10px 12px; align-items: flex-end; }
.chat-form textarea { min-height: 44px; resize: none; }
@media (max-width: 760px) {
  .chat-wrap { grid-template-columns: 1fr; height: calc(100vh - 230px); }
  .chat-wrap.has-sel .chat-list { display: none; }
  .chat-wrap:not(.has-sel) .chat-pane { display: none; }
  .chat-back { display: inline-flex; }
}

/* Ajustes */
.set-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .set-grid { grid-template-columns: 1fr; } }
.pad { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.help { font-size: 12.5px; color: var(--muted); }
.status { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: none; }
.dot.on { background: var(--ok); }
.dot.off { background: var(--bad); }
.copybox { display: flex; gap: 6px; }
.copybox code { flex: 1; min-width: 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; font-size: 12.5px; overflow-wrap: anywhere; }
.log { max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; }
.log-item { padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.log-item .txt { white-space: pre-wrap; overflow-wrap: anywhere; }
.log-item .err { color: var(--bad); }

/* Modal */
.scrim { position: fixed; inset: 0; background: rgba(10, 20, 10, .45); z-index: 40; }
.modal { position: fixed; z-index: 41; background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column;
  top: 0; right: 0; bottom: 0; width: min(520px, 100%); padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.modal header { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal header h2 { font-size: 20px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.modal .body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.modal .body > * { flex: none; }
.modal footer { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@media (prefers-reduced-motion: no-preference) {
  .modal { animation: slide .18s ease-out; }
  @keyframes slide { from { transform: translateX(28px); opacity: .5; } to { transform: none; opacity: 1; } }
}
.item-row { display: grid; grid-template-columns: minmax(0, 1fr) 80px 120px 34px; gap: 8px; align-items: center; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login .card { width: min(380px, 100%); padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.login h1 { font-size: 26px; color: var(--accent); margin: 0; }
.login-head { display: flex; align-items: center; gap: 14px; }
.login-logo { width: 72px; height: 72px; border-radius: 16px; flex: none; }
.err-msg { color: var(--bad); font-size: 14px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom, 0px)); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 9px; font-size: 14px; z-index: 60; max-width: calc(100% - 32px); }
@media (min-width: 761px) { .toast { bottom: 24px; } }

.cartel-prev { border-radius: 12px; overflow: hidden; background: var(--bg-2, #eee); }
.cartel-prev img { display: block; width: 100%; height: auto; }
