/* v1.2 desktop calculator: fixed viewport, only history scrolls. */
@media(max-width:899px){.calc-scroll-content .top-header{flex-direction:row;flex-wrap:wrap}.calc-scroll-content .profit-dark-card{grid-template-columns:1fr 1fr!important}.main-calculator.show-results .calc-workspace>.results-grid{grid-template-columns:1fr 1fr!important}.show-results .result-box{padding:10px}.show-results .box-header .tag{display:none}.show-results .calc-line{display:block;padding:3px 0;font-size:14px;margin:0}.show-results .calc-line>span:first-child{max-width:none}.show-results .calc-line .val{display:block;font-size:18px;line-height:25px}.show-results .calc-line.total-line .val{font-size:21px;line-height:28px}}
.top-header{grid-row:1}.compact-tabs{grid-row:2}.calc-workspace{grid-row:3}.profit-dark-card{grid-row:4}.calc-action-bar{grid-row:5}
html,body{height:100%;min-height:0;overflow:hidden}
.app-container,.main-calculator{height:100dvh;min-height:0;overflow:hidden}
.main-calculator{position:relative;container-type:inline-size}
.calc-scroll-content{width:100%;height:100%;max-width:1240px;min-height:0;flex:none;display:grid;grid-template-rows:auto auto minmax(0,1fr) auto auto;gap:10px;padding:16px 20px;margin:0 auto;overflow:hidden}
.top-header{margin:0;gap:10px;min-width:0}.title-area{flex:1 1 280px}.title-area h1{font-size:24px;line-height:30px}.title-area .subtitle{font-size:14px;line-height:20px}.title-area .tip{display:none}.header-actions{flex:0 0 auto;gap:7px}.header-actions .btn{min-width:104px;font-size:15px;min-height:36px}
.account-line{display:flex;align-items:center;gap:10px;min-height:24px;font-size:14px}.account-line .google-user-pill{margin:0}.account-line .status-banner{padding:0;margin:0;background:transparent!important;min-height:0;font-size:14px;max-width:280px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.account-line #userName{font-size:14px!important}
.auth-pending #authArea,.auth-pending #btnLogout,.auth-pending #userProfilePill{display:none!important}.account-pending{display:none;align-items:center;justify-content:center;width:112px;height:36px;font-size:15px;color:#556987}.auth-pending .account-pending{display:inline-flex}
.calc-workspace{display:grid;grid-template-columns:minmax(330px,.95fr) minmax(410px,1.15fr);gap:14px;min-height:0;align-items:start;overflow:visible}.calc-workspace>.card{padding:14px;margin:0;min-width:0}.calc-workspace .form-row{gap:10px;margin-bottom:12px}.calc-workspace .form-group.col-1,.calc-workspace .form-group.col-2{min-width:0}.calc-workspace .form-group label{font-size:15px;line-height:24px;min-height:24px;margin-bottom:4px}.calc-workspace .form-control{height:38px;min-height:38px;padding:6px 9px;font-size:18px;line-height:24px}.calc-workspace select.form-control{font-size:15px}.calc-workspace .row-prices-qty{flex-wrap:nowrap}.calc-workspace .row-prices-qty .col-buy,.calc-workspace .row-prices-qty .col-sell,.calc-workspace .row-prices-qty .col-qty{min-width:0;flex:1}
.calc-workspace .quantity-control input{padding-right:9px}.calc-workspace .col-qty label{max-width:100%;padding-right:50px;white-space:nowrap}.calc-workspace .quantity-control .unit-toggle-btn{top:-28px;right:0;height:24px;font-size:13px;line-height:20px;padding:2px 4px;background:#EDF3FF}.form-row-sub{gap:8px;font-size:14px;margin:0}.form-row-sub .btn{font-size:14px;padding:5px 8px;min-height:32px}.fee-tip-row{font-size:13px;margin-top:10px;padding-top:8px;line-height:20px}
.results-grid{margin:0;gap:12px;grid-template-columns:1fr 1fr;align-items:start;min-width:0}.result-box{padding:12px;min-width:0}.box-header{display:flex;flex-direction:row;align-items:center;flex-wrap:wrap;gap:4px;margin-bottom:6px}.box-header .title{font-size:21px}.box-header .tag{font-size:13px}.calc-line{font-size:15px;line-height:22px;padding:4px 0;gap:6px;min-width:0}.calc-line>span:first-child{max-width:90px}.calc-line .val{font-size:19px;line-height:26px;white-space:normal;overflow-wrap:anywhere;text-align:right}.calc-line.total-line{padding:9px;margin-top:8px;font-size:14px}.calc-line.total-line .val{font-size:24px;line-height:32px;margin-top:3px}
.profit-dark-card{margin:0;padding:12px 16px;min-width:0;gap:16px}.dark-stat .label{font-size:14px}.dark-stat .value{font-size:25px;line-height:32px;overflow-wrap:anywhere}.calc-action-bar{position:static;margin:0;padding:8px 0 0;background:#F3F6FB;border-top:1px solid #D4DEEB;flex-direction:row;gap:8px;min-height:0}.calc-action-bar .btn{font-size:15px;min-height:36px}
.compact-tabs{display:none}.records-drawer{height:100dvh;overflow:hidden}.drawer-scroll-body{min-height:0;overflow-y:auto;overscroll-behavior:contain}.drawer-header,.drawer-toolbar,.drawer-footer{flex-shrink:0}.record-dates{max-width:440px}.record-dates label{display:block}.record-dates input{display:block;width:100%;margin-top:6px}
@media(min-width:900px) and (max-height:700px){.calc-scroll-content{padding:10px 14px;gap:8px}.top-header .title-area h1{font-size:22px;line-height:28px}.calc-workspace .form-row{margin-bottom:9px}.calc-workspace>.card{padding:12px}.profit-dark-card{padding:9px 14px}.calc-line{padding:3px 0}.dark-stat .value{font-size:24px;line-height:30px}}
@media(min-width:900px) and (max-width:1419px){.records-drawer:not(.collapsed){position:fixed;inset:0;width:100%;max-width:none;z-index:1000}.app-container:has(.records-drawer:not(.collapsed)) .main-calculator{visibility:hidden}.drawer-divider{display:none}}
@container(max-width:850px){.title-area{flex-basis:100%}.header-actions{justify-content:flex-start}.calc-workspace{grid-template-columns:minmax(310px,.9fr) minmax(380px,1.1fr)}}
@media(max-width:899px){html,body{height:100%;overflow:hidden!important}.app-container{height:100dvh;min-height:0}.main-calculator{height:100dvh;overflow:hidden!important}.calc-scroll-content{height:100%;display:grid;grid-template-rows:auto auto minmax(0,1fr) auto auto;gap:8px;padding:12px!important}.top-header{gap:8px}.title-area{flex-basis:100%}.title-area h1{font-size:21px}.header-actions{justify-content:flex-start;width:100%;flex-wrap:nowrap}.header-actions .btn{min-width:0;font-size:14px!important;padding:7px 9px!important}.account-line{gap:6px;flex-wrap:wrap}.account-line .status-banner{max-width:100%}.compact-tabs{display:flex;gap:8px}.compact-tabs .btn{font-size:15px;padding:5px 12px;min-height:32px}.compact-tabs [aria-pressed=true]{background:#EDF3FF;color:#2456D7;border-color:#BCCFF7}.calc-workspace{display:block;min-height:0}.calc-workspace>.card{padding:12px!important}.calc-workspace>.results-grid{display:none}.show-results .calc-workspace>.card{display:none}.show-results .calc-workspace>.results-grid{display:grid;grid-template-columns:1fr 1fr}.calc-workspace .form-row{margin-bottom:10px;gap:10px}.calc-workspace .row-stock-info .col-code{width:auto!important;flex:1!important}.calc-workspace .row-stock-info .col-name{width:auto!important;flex:1.6!important}.calc-workspace .row-product-mode .col-1,.calc-workspace .row-prices-qty .col-1{width:auto!important;flex:1!important;margin:0!important;min-width:0!important}.calc-workspace .form-control{height:38px!important;min-height:38px!important;font-size:17px!important}.calc-workspace select.form-control{font-size:14px!important}.calc-workspace label{font-size:14px!important}.calc-workspace .col-qty label{padding-right:44px}.calc-workspace .quantity-control .unit-toggle-btn{font-size:12px;padding:2px 3px}.fee-tip-row{font-size:12px}.profit-dark-card{padding:10px 12px;grid-template-columns:1fr 1fr}.dark-stat .label{font-size:13px}.dark-stat .value{font-size:22px;line-height:30px}.calc-action-bar{padding-top:8px!important}.calc-action-bar .btn{font-size:14px!important;padding:7px 10px!important}.records-drawer:not(.collapsed){position:fixed;inset:0;width:100%!important;max-width:none;height:100dvh!important}.app-container:has(.records-drawer:not(.collapsed)) .main-calculator{visibility:hidden}}
