/* Public printing + worksheet columns, observation-zoom-and-name-expand 2026-11-03.
   Stored Supabase field names and row IDs are deliberately unchanged. */
#streetPagesLive .street-page table { width:100%!important; table-layout:fixed!important; }
#streetPagesLive .street-page table th:nth-child(1),
#streetPagesLive .street-page table td:nth-child(1){width:18%!important}
#streetPagesLive .street-page table th:nth-child(2),
#streetPagesLive .street-page table td:nth-child(2){width:24%!important}
#streetPagesLive .street-page table th:nth-child(3),
#streetPagesLive .street-page table td:nth-child(3){width:40%!important}
#streetPagesLive .street-page table th:nth-child(4),
#streetPagesLive .street-page table td:nth-child(4){width:18%!important}
#streetPagesLive .street-page table th:nth-child(3){font-size:11px!important;line-height:1.1!important}
#streetPagesLive .street-page table th:nth-child(4){font-size:11px!important;line-height:1.1!important;overflow-wrap:normal!important;word-break:normal!important}
#streetPagesLive .street-page table th:nth-child(4)::before,
#streetPagesLive .street-page table th:nth-child(4)::after{content:none!important;display:none!important}
/* Names remain a single input line, even where observations expand the row. */
#streetPagesLive .street-page td:nth-child(4) input[data-field="resident_name"],
#streetPagesLive tr.row-has-wrapped-text > td:nth-child(4) > input[data-field="resident_name"]{
 font-size:12px!important;font-weight:550!important;line-height:1.1!important;
 height:42px!important;min-height:42px!important;max-height:42px!important;
 padding:5px 2px!important;white-space:nowrap!important;
 text-overflow:ellipsis!important;overflow:hidden!important;
 display:block!important;opacity:1!important;position:relative!important;
 cursor:pointer!important;
}
/* Restore the original full-size Observaciones editing target. iOS Safari
   zooms editable/readonly inputs below 16px when tapped. Keep >=16px. */
#streetPagesLive .street-page td:nth-child(3) input[data-field="observations"]{
 font-size:16px!important;
 -webkit-text-size-adjust:100%!important;
}
/* iOS no-zoom names: the real input stays as the data source and is never
   a touch target; a compact, accessible button displays its current value.
   Safari auto-zooms when a <= 15px input receives focus, even if readonly. */
#streetPagesLive .street-page td input[data-field="resident_name"],
#streetPagesLive .street-page td:nth-child(4) input[data-field="resident_name"],
#streetPagesLive tr.row-has-wrapped-text > td:nth-child(4) > input[data-field="resident_name"]{
 position:absolute!important;width:1px!important;height:1px!important;
 min-width:0!important;min-height:0!important;max-height:1px!important;
 overflow:hidden!important;opacity:0!important;pointer-events:none!important;
 font-size:16px!important; /* backup Safari safeguard if programmatically focused */
 left:0!important;top:0!important;padding:0!important;border:0!important;
 clip-path:inset(50%)!important;white-space:nowrap!important;
}
#streetPagesLive .street-page td:nth-child(4) .nk-name-display{
 display:block!important;box-sizing:border-box!important;width:100%!important;
 height:42px!important;min-height:42px!important;max-height:42px!important;
 padding:3px 5px!important;margin:0!important;overflow:hidden!important;
 white-space:nowrap!important;text-overflow:ellipsis!important;text-align:left!important;
 border:1px solid #cddbd4!important;border-radius:7px!important;
 background:#fff!important;color:#142b22!important;
 font:550 12px/35px -apple-system,BlinkMacSystemFont,system-ui,sans-serif!important;
 outline:0!important;touch-action:manipulation!important;-webkit-tap-highlight-color:transparent;
}
/* The narrow Names cell grows only while the person taps/edits it.
   No overlay, separate editor, or auto-zooming native text input. */
#streetPagesLive .street-page td:nth-child(4) .nk-name-display.name-keyboard-selected{
 outline:3px solid #28836c!important;outline-offset:0!important;
 background:#f0fff8!important;
 height:auto!important;min-height:42px!important;max-height:none!important;
 white-space:normal!important;overflow:visible!important;text-overflow:clip!important;
 overflow-wrap:anywhere!important;word-break:normal!important;
 line-height:1.3!important;padding:9px 5px!important;
}
#streetPagesLive .nk-name-display:focus-visible{
 outline:3px solid #4c94e6!important;outline-offset:0!important;
}
/* Prevent the custom alphabet keyboard from inheriting clipped table dimensions.
   When the mobile viewport is unusually short, it scrolls internally rather
   than hiding keys beyond the screen. */
#nameKeyboard.name-keyboard{
 position:fixed!important;inset:auto 0 0 0!important;z-index:2147483001!important;
 box-sizing:border-box!important;width:100%!important;max-width:100vw!important;min-width:0!important;
 max-height:min(425px,80dvh)!important;overflow-y:auto!important;overflow-x:hidden!important;
 -webkit-overflow-scrolling:touch;transform:none!important;contain:none!important;
}
#nameKeyboard .nk-inner,#nameKeyboard .nk-row,#nameKeyboard .nk-bottom,
#nameKeyboard .nk-actions{width:100%;max-width:630px;min-width:0;box-sizing:border-box}
#nameKeyboard .nk-row button{min-width:0;flex-shrink:1}
#nameKeyboard button:disabled{opacity:.4;cursor:not-allowed}
@media(max-width:420px){#nameKeyboard .nk-row button{font-size:clamp(14px,4.7vw,22px)}}
@media(max-height:500px){#nameKeyboard.name-keyboard{max-height:67dvh!important}
}
/* An obvious print entry in the public, ordinary territory toolbar. */
#territoryToolbar{grid-template-areas:"map directions" "qr add" "print print" "sync sync"!important;
 grid-template-rows:64px 64px 52px auto!important}
#territoryToolbar #streetPrintLaunch{
 grid-area:print!important;display:flex!important;align-items:center!important;justify-content:center!important;
 width:100%!important;min-width:0!important;max-width:100%!important;
 height:52px!important;min-height:52px!important;max-height:52px!important;
 margin:0!important;padding:9px 12px!important;
 background:#ffffff!important;color:#245b48!important;border:1.5px solid #8fb6a6!important;
 border-radius:10px!important;font:800 15px/1.2 system-ui!important;cursor:pointer!important;
}
@media print{#nameKeyboard,#streetPrintLaunch{display:none!important}}


/* 2026-11-03 — when Observaciones expands with Ver más/Ver menos,
   stretch the Símb. and Nombres cells to the same row height so the
   whole row stays aligned. */
#streetPagesLive tr.row-has-wrapped-text > td:nth-child(4){
 vertical-align:stretch!important;
}
#streetPagesLive tr.row-has-wrapped-text > td:nth-child(4) .nk-name-display{
 height:var(--text-row-height,68px)!important;
 min-height:var(--text-row-height,68px)!important;
 max-height:none!important;
 display:flex!important;
 align-items:center!important;
}
#streetPagesLive tr.row-has-wrapped-text > td:nth-child(4) .nk-name-display.name-keyboard-selected{
 align-items:flex-start!important;
}
