/* V34.2.154: role-gated bottle opening debt reconciliation */
#bottle-opening-open{font-size:12px;padding:8px 12px;min-height:42px}
.bottle-opening-dialog{border:0;border-radius:17px;padding:0;max-width:min(680px,96vw);width:100%;max-height:90dvh;color:#173651;box-shadow:0 20px 60px #0a345b44}
.bottle-opening-dialog::backdrop{background:#102f4c99}
.bottle-opening-head{padding:18px 20px 14px;border-bottom:1px solid #dce9f5;display:flex;justify-content:space-between;gap:12px;align-items:start;background:#f7fbff}
.bottle-opening-head small{font-weight:750;color:#0974d5;font-size:11px;letter-spacing:.06em}
.bottle-opening-head h2{margin:3px 0 4px;font-size:21px;line-height:1.2}
.bottle-opening-head p{margin:0;color:#638197;font-size:12px}
#bottle-opening-close{border:0;background:#e9f2fa;color:#456985;border-radius:12px;padding:5px 14px;font-size:26px}
.bottle-opening-scroll{overflow-y:auto;max-height:calc(90dvh - 100px);padding:14px 18px 25px}
.bottle-opening-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin-bottom:15px}
.bottle-opening-tabs button{min-width:0;padding:9px 4px;font-size:11px;font-weight:750;border:1px solid #d3e1ef;border-radius:10px;background:#fff;color:#496983;line-height:1.25}
.bottle-opening-tabs button.active{background:#0879e8;color:white;border-color:#0879e8}
.bottle-opening-panel{display:grid;gap:11px}
.bottle-opening-panel[hidden]{display:none!important}
.bottle-opening-panel label,#bottle-opening-editor>label{display:grid;gap:5px;font-size:13px;font-weight:700;color:#284e6d}
.bottle-opening-panel input,.bottle-opening-panel select,#bottle-opening-editor textarea{box-sizing:border-box;width:100%;padding:10px 12px;border:1px solid #c9deef;border-radius:10px;font:inherit;font-size:16px;background:white;color:#153d61}
.bottle-opening-current,.bottle-opening-note{padding:11px 12px;background:#eef6ff;border-radius:10px;color:#406780;font-size:12px;margin:0}
#bottle-opening-editor{display:grid;gap:12px;margin-top:15px;padding-top:12px;border-top:1px solid #e5edf4}
#bottle-opening-editor[hidden]{display:none!important}
.bottle-opening-preview-actions{display:flex;justify-content:flex-start}
#bottle-opening-preview-list{max-height:210px;overflow-y:auto;font-size:12px}
.bottle-opening-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;padding:8px;border-bottom:1px solid #e4edf6}
.bottle-opening-row small{display:block;color:#66859a;line-height:1.5}
.bottle-opening-row strong{font-variant-numeric:tabular-nums}
.bottle-opening-check{display:flex!important;align-items:flex-start;gap:9px!important;font-size:12px!important}
.bottle-opening-check input{width:19px;height:19px;flex:none;margin:0}
#bottle-opening-apply{min-height:44px}
#bottle-opening-status{min-height:18px;color:#346785;font-size:13px;line-height:1.4;margin:9px 0}
#bottle-opening-status.error{color:#bb3c3c}
#bottle-opening-pending-list .bottle-opening-row{grid-template-columns:minmax(0,1fr) auto}
#bottle-opening-pending-list .btn{font-size:12px;padding:7px}
@media(max-width:580px){.bottle-opening-dialog{margin:0;inset:auto 0 0;max-width:100%;width:100%;max-height:94dvh;border-radius:17px 17px 0 0}.bottle-opening-scroll{max-height:calc(94dvh - 108px)}.bottle-opening-tabs button{font-size:10px}.bottle-opening-head h2{font-size:18px}}

#bottle-debts .bottle-debt-receive-row-v342153{flex-wrap:wrap}
@media(max-width:640px){#bottle-debts .bottle-debt-receive-row-v342153>span{display:none}#bottle-debts .bottle-debt-receive-row-v342153>button{flex:1 1 45%;min-width:0!important;font-size:12px!important}}

/* V34.2.155: uncertain historical opening balances */
.bottle-opening-panel [hidden],#bottle-opening-target-row[hidden],#bottle-opening-unknown-hint[hidden]{display:none!important}
.bottle-opening-tabs{grid-template-columns:repeat(5,minmax(0,1fr))}
#bottle-opening-summary{margin-bottom:12px;font-weight:700}
#bottle-opening-unknown-list{max-height:300px;overflow-y:auto}
#bottle-opening-unknown-list .btn{font-size:12px;padding:8px}
@media(max-width:430px){.bottle-opening-tabs button{font-size:9px;padding:8px 2px}}

/* V34.2.158 — full-screen enterprise reconciliation workspace; one scroll container */
#bottle-opening-dialog{box-sizing:border-box!important;width:min(980px,calc(100vw - 32px))!important;max-width:none!important;height:min(900px,calc(100dvh - 24px))!important;max-height:calc(100dvh - 24px)!important;margin:auto!important;border:0!important;border-radius:20px!important;padding:0!important;overflow:hidden!important;background:#fff!important;color:#173651;box-shadow:0 24px 65px #092b4a38!important}
#bottle-opening-dialog:not([open]){display:none!important}
#bottle-opening-dialog[open]{display:flex!important;flex-direction:column!important;min-height:0!important}
#bottle-opening-dialog .bottle-opening-head{flex:0 0 auto;align-items:center;gap:12px;padding:16px 20px;border-bottom:1px solid #dce8f3;background:#fff}
#bottle-opening-dialog .bottle-opening-head>div{flex:1 1 auto;min-width:0}
#bottle-opening-dialog .bottle-opening-head h2{font-size:22px;line-height:1.2;margin:4px 0}
#bottle-opening-dialog .bottle-opening-head p{font-size:12px;line-height:1.45;max-width:660px}
#bottle-opening-dialog #bottle-opening-close{width:44px;min-width:44px;height:44px;display:grid;place-items:center;padding:0;border:1px solid #d8e6f1;border-radius:12px;font-size:29px;font-weight:400;line-height:1;background:#eef5fc;color:#42637d;touch-action:manipulation}
#bottle-opening-dialog #bottle-opening-close:focus-visible,#bottle-opening-dialog .bottle-opening-tabs button:focus-visible{outline:3px solid #4aa8ff;outline-offset:2px}
#bottle-opening-dialog .bottle-opening-nav{flex:0 0 auto;min-width:0;padding:10px 16px 8px;border-bottom:1px solid #e0eaf4;background:#fff}
#bottle-opening-dialog .bottle-opening-tabs{display:flex;gap:8px;margin:0;min-width:0;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x proximity;scrollbar-width:none;-webkit-overflow-scrolling:touch}
#bottle-opening-dialog .bottle-opening-tabs::-webkit-scrollbar{display:none}
#bottle-opening-dialog .bottle-opening-tabs button{flex:1 0 auto;min-height:43px;min-width:112px;padding:8px 12px;font-size:13px;line-height:1.25;white-space:normal;scroll-snap-align:start;border-radius:11px;background:#fff;border:1px solid #cfe0ee;color:#345a79;touch-action:manipulation}
#bottle-opening-dialog .bottle-opening-tabs button.active{background:#0879e8;border-color:#0879e8;color:#fff;box-shadow:0 2px 6px #0879e829}
#bottle-opening-dialog .bottle-opening-scroll{flex:1 1 auto;min-height:0;max-height:none!important;overflow-y:auto;overflow-x:hidden;padding:14px 20px max(20px,env(safe-area-inset-bottom));overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
#bottle-opening-dialog .bottle-opening-current{font-size:13px;line-height:1.5}
#bottle-opening-dialog #bottle-opening-summary{margin:0 0 14px;padding:12px 14px}
#bottle-opening-dialog .bottle-opening-panel{min-width:0;gap:12px}
#bottle-opening-dialog .bottle-opening-row{align-items:center;padding:14px 4px;grid-template-columns:minmax(0,1fr) auto;gap:12px}
#bottle-opening-dialog .bottle-opening-row>div{min-width:0}
#bottle-opening-dialog .bottle-opening-row strong{font-size:14px;overflow-wrap:anywhere}
#bottle-opening-dialog .bottle-opening-row small{font-size:12px;line-height:1.5;overflow-wrap:anywhere}
#bottle-opening-dialog .bottle-opening-row .btn{min-height:42px;min-width:84px;padding:8px 12px;white-space:nowrap;border-radius:10px;color:#076dcf;border:1px solid #bedcf8}
#bottle-opening-dialog #bottle-opening-unknown-list,#bottle-opening-dialog #bottle-opening-pending-list,#bottle-opening-dialog #bottle-opening-history-list{max-height:none!important;overflow:visible!important;min-width:0}
#bottle-opening-dialog .bottle-opening-search-label{display:grid;gap:8px;font-weight:700;font-size:13px;color:#294c67}
#bottle-opening-dialog #bottle-opening-search{min-height:46px;box-sizing:border-box;width:100%;font-size:16px}
#bottle-opening-dialog .bottle-opening-count{margin:0;color:#54748b;font-size:12px}
#bottle-opening-dialog .bottle-opening-empty{min-height:180px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;text-align:center;padding:22px;color:#55758d;background:#f7fbff;border:1px dashed #d9e8f3;border-radius:14px}
#bottle-opening-dialog .bottle-opening-empty strong{font-size:16px;color:#193f60}
#bottle-opening-dialog .bottle-opening-empty span{font-size:13px;line-height:1.5;max-width:350px}
#bottle-opening-dialog #bottle-opening-editor{margin-top:16px}
#bottle-opening-dialog #bottle-opening-preview-list{max-height:none;overflow:visible}
#bottle-opening-dialog #bottle-opening-apply{min-height:48px}
@media(max-width:760px){
  #bottle-opening-dialog{position:fixed!important;inset:0!important;margin:0!important;box-sizing:border-box!important;width:100vw!important;max-width:100vw!important;height:100vh!important;height:100dvh!important;min-height:0!important;max-height:none!important;border-radius:0!important;transform:none!important}
  #bottle-opening-dialog .bottle-opening-head{padding:calc(12px + env(safe-area-inset-top,0px)) 16px 12px}
  #bottle-opening-dialog .bottle-opening-head h2{font-size:20px}
  #bottle-opening-dialog .bottle-opening-head p{font-size:12px}
  #bottle-opening-dialog .bottle-opening-nav{padding:9px 12px;border-bottom:1px solid #dce9f5}
  #bottle-opening-dialog .bottle-opening-tabs button{flex:0 0 auto;min-width:110px;min-height:44px;font-size:12px}
  #bottle-opening-dialog .bottle-opening-scroll{padding:14px 16px calc(24px + env(safe-area-inset-bottom,0px))}
  #bottle-opening-dialog .bottle-opening-row{padding:13px 0;gap:8px}
  #bottle-opening-dialog .bottle-opening-row .btn{min-width:78px;padding:9px 10px}
}
@media(max-width:380px){
  #bottle-opening-dialog .bottle-opening-head{padding-left:12px;padding-right:12px}
  #bottle-opening-dialog .bottle-opening-head h2{font-size:18px}
  #bottle-opening-dialog .bottle-opening-scroll{padding-left:12px;padding-right:12px}
  #bottle-opening-dialog .bottle-opening-tabs button{min-width:105px}
}
