#pocketPanel[open]{position:fixed;inset:0;margin:0;border:0;border-radius:0;padding:0;width:100%;height:100%;max-width:none;max-height:none;background:#000;color:#aaa;display:grid;align-items:end;justify-items:center;box-shadow:none;touch-action:none;overscroll-behavior:none;user-select:none;-webkit-user-select:none}
#pocketPanel::backdrop{background:#000}
#pocketExit{margin:0 0 max(2rem,env(safe-area-inset-bottom));padding:.85rem 1.2rem;background:#080808;color:#aaa;border:1px solid #555;touch-action:none}
#pocketExit.holding{outline:2px solid #bbb}
html:has(#pocketPanel[open]){overflow:hidden}
#pocketOpen[hidden]{display:none}

#listenHero{display:none}
#write.tableListening>:not(#listenPanel){display:none}
#write.tableListening #listenPanel{display:grid;grid-template-columns:minmax(0,1fr);justify-items:center;align-content:center;gap:1rem;padding:clamp(1rem,4vw,3rem);min-height:min(62vh,36rem);box-sizing:border-box;scroll-margin-top:1rem;text-align:center}
.tableListening #listenPanel>summary,.tableListening .listenIntro,.tableListening .listenOptions{display:none}
.tableListening #listenHero{display:grid;justify-items:center;gap:.5rem}
.tableListening #listenHero h1,.tableListening #listenHero p,.tableListening #listenStatus{margin:0}
.tableListening .micMark{display:grid;place-items:center;width:4.75rem;height:4.75rem;border-radius:50%;background:#55428a;color:#fff}
.tableListening #listenHero h1{font-size:clamp(1.7rem,5vw,2.6rem)}
.tableListening #listenStatus{grid-row:2;font-size:clamp(1.1rem,3vw,1.45rem);line-height:1.4}
.tableListening #listenToggle,.tableListening #pocketOpen{min-height:3rem;width:min(100%,19rem);border-radius:.8rem;font-weight:650}
.tableListening #listenToggle{background:#55428a;color:#fff;border-color:#55428a;font-size:1.12rem}
.tableListening #pocketOpen[hidden],.tableListening #voiceDrafts:empty{display:none}

#voiceHead{display:inline-flex;align-items:center;justify-content:center;gap:.4rem;min-height:44px;padding:.4rem .7rem;white-space:nowrap}
#voiceHead.listening{background:#55428a;color:#fff;border-color:#55428a}
#voiceStart{max-width:min(24rem,90vw)}
.dialogVoiceStop[hidden]{display:none}
@media(max-width:660px){header>span{display:none}header{flex-wrap:wrap}#dailyOpen{margin-left:auto}}
@media(max-width:400px){#voiceHead:not(.listening) span{display:none}#voiceHead{min-width:44px}}

.pocketEdge{position:absolute;inset:1px;border:1px solid #ad9acb;pointer-events:none;opacity:0;animation:edgePulse 420ms ease-in-out}
.pocketEdge.saved{border-color:#a8c8b4;animation-duration:350ms;animation-iteration-count:2}
@keyframes edgePulse{0%,100%{opacity:0}45%,60%{opacity:.36}}
@media(prefers-reduced-motion:reduce){.pocketEdge,.pocketEdge.saved{animation:edgeStill 650ms linear}@keyframes edgeStill{from,to{opacity:.3}}}
main > nav {background:var(--paper, Canvas);z-index:8}
main > nav [data-view="domains"] {display:none}
main > nav.inDomains [data-view="yard"] {color:var(--violet);font-weight:700}
.cabIndex:not([hidden]) {display:grid;gap:.55rem}
.cabIndex button {text-align:start;min-height:48px;display:flex;justify-content:space-between}
.cabIndex button::after {content:'›'}
@media(max-width:760px){
 main > nav {position:fixed;inset:auto 0 0;margin:0;padding:3px 6px max(3px,env(safe-area-inset-bottom));border:0;border-top:1px solid var(--line);background:Canvas;color:CanvasText}
 main > nav button {min-height:48px;color:inherit} main #captureDock {bottom:calc(65px + env(safe-area-inset-bottom))}
 body {padding-bottom:calc(65px + env(safe-area-inset-bottom))}
}
@media(min-width:761px){
 body main {display:grid;grid-template-columns:9rem minmax(0,1fr);gap:0 1rem;max-width:58rem;align-items:start} main > section,main > #status {grid-column:2;min-width:0}
 main > nav {grid-column:1;grid-row:1 / span 2;position:sticky;top:.5rem;width:auto;flex-direction:column;border:0}
 main > nav button {text-align:start}
}
main > nav svg{vertical-align:middle} @media(max-width:760px){main > nav button svg{display:block;margin:auto}main > nav{background:var(--ground);color:var(--ink)}}
@media(min-width:761px){.cabReturn{position:sticky;top:.5rem;z-index:2;background:var(--ground);color:var(--ink)}}

/* Acciones globales, de confirmación y de consulta */
.globalActions {display:flex;align-items:center;gap:.5rem}
.globalActions #dailyOpen,.cabReturn,#quickBack,#voiceCancel,#quickAdvanced {
  background:transparent;color:var(--violet);border:1px solid transparent;font-weight:600
}
header .globalActions #dailyOpen {color:inherit}
.globalActions button,main button,dialog button {min-height:44px}
.globalActions #voiceHead {background:var(--paper);color:var(--ink);border:1px solid var(--rim)}
.globalActions #voiceHead.listening,.primary,#voiceBegin {background:var(--action);color:var(--paper);font-weight:700}
#captureDock #areaPreview,#rows .routeLink {background:transparent;color:var(--violet);border-color:transparent}
.cabIndex button {border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent;color:var(--ink);padding:.85rem .5rem}
.cabIndex button::after {color:var(--violet)}
main > nav button[aria-current=page] {background:var(--shell-wash);color:var(--shell-ink);font-weight:700}
@media(max-width:760px){
  body {padding-bottom:calc(var(--nav-height,124px) + 12px)}
  main > nav {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0}
  main > nav .globalActions {grid-column:1/-1;justify-content:space-between;border-bottom:1px solid var(--line);padding:2px 6px}
  main > nav .globalActions #dailyOpen {margin:0}
  main > nav #voiceHead span {display:inline}
  main #captureDock {position:sticky;bottom:var(--nav-height,124px);background:var(--paper);z-index:2}
  #captureDock > div {display:flex;flex-direction:row;justify-content:flex-end}
  html[data-hand=left] #captureDock > div {flex-direction:row-reverse}
  html[data-hand=left] .globalActions {flex-direction:row-reverse}
  #voiceStart {margin:auto auto 0;width:100%;max-width:100%;max-height:90dvh;overflow:auto;padding-bottom:max(1rem,env(safe-area-inset-bottom))}
  html {scroll-padding-bottom:calc(var(--nav-height,124px) + 1rem)}
}
main button.captureClock {background:transparent;border:0;padding:0;min-height:0;width:auto;color:var(--muted);font:inherit;cursor:pointer}
#trashList .permanentDelete { color: #a51d2d; } html[data-theme="dark"] #trashList .permanentDelete { color: #ff9ca4; }
