/* Approved Figma uiBxXj2rEpw30mkHxS4goy, app frames 27:82–27:593.
   Layout only: existing API, permissions, tabs and confirmation logic remain authoritative. */
:root{--conversation-width:260px;--surface:#fff;--tint:#E9EFF7;--teal:#216447;--tealbg:#EAF5EE;--amber:#815900;--amberbg:#FFF5DE;--red:#A22D3E}
body .topbar{padding:11px 24px;gap:14px;border-bottom:1px solid var(--line);box-sizing:border-box;background:var(--surface)}
body .topbar .mark{display:flex;padding:0;min-width:0;flex-shrink:0}
body .topbar .mark .maskeel-logo,.maskeel-logo{display:block;width:194px;height:50px;max-height:none;object-fit:contain}
#header-company{display:flex;align-items:center;gap:8px;max-width:240px;font-size:13px;color:var(--muted)}
#header-company span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#header-company img{width:28px;height:28px;object-fit:contain}
body .trialchip{background:var(--tint);color:var(--navy);border:0}
body .surface-body{padding:32px clamp(20px,4vw,56px) 48px}
body .main .panel{border-radius:10px;padding:24px;border:1px solid var(--line);box-shadow:none;background:var(--surface);margin-bottom:24px}
body .main .panel h2{font-size:24px;line-height:1.5;flex-wrap:wrap;gap:10px}
body .main .panel h4{font-size:18px;margin:0 0 16px}
body .main .panel p{line-height:1.7}
body .main .btn,body .helper .btn{border-radius:6px;padding:9px 16px;line-height:1.4}
body .main .btn.sm,body .helper .btn.sm{padding:7px 10px}
body .main .fin{border-radius:6px;min-height:42px}
body .work-bar{padding:12px 20px;gap:8px;min-height:62px}
body .work-tab{border:1px solid var(--line);border-radius:5px;margin-right:6px}
body .work-tab.active{box-shadow:none;border-color:var(--navy)}
body .work-tab button{padding:9px 12px}
body .helper-scroll{padding:32px max(24px,calc((100% - 760px)/2))}
body .helper .cin{border-radius:10px;padding:16px;border:1px solid var(--line);gap:12px}
body .cin .snd{height:42px;width:auto;min-width:68px;padding:10px 16px;border-radius:6px;font:inherit;font-size:14px;color:#fff;background:var(--navy)}
body .cin .att{border:0;background:transparent;color:var(--navy);font:inherit;font-size:24px;cursor:pointer;min-width:36px;min-height:42px}
body .helper .bub{border-radius:10px;padding:14px 18px}
body .helper .bub.me{background:var(--tint)}
body .helper .bub.ag{border:1px solid var(--line);background:var(--surface)}
body .helper .rc{border-radius:10px;box-shadow:none;background:var(--surface)}
#chat-sidebar{background:var(--surface);padding-top:16px}
#s-so table{width:100%}
#s-so th{background:var(--bg);font-weight:500;color:var(--muted)}
#s-so td{padding-top:16px;padding-bottom:16px}
#s-so .rowlink:hover{background:var(--tint)}
#s-so h2>.btn{font-size:14px;font-weight:500}
#s-so .rowlink td:last-child{min-width:180px}
#detail-body .kv{padding:12px 0;gap:16px}
#detail-body .acts{display:flex;gap:8px;flex-wrap:wrap}
.gl-review-grid{display:grid;grid-template-columns:minmax(240px,0.75fr) minmax(0,1.25fr);gap:24px;margin-top:24px;align-items:start}
.gl-review-grid>*,.gl-review-grid .fin{min-width:0;max-width:100%;box-sizing:border-box}
.gl-review-source .panel{background:var(--bg)!important;overflow-wrap:anywhere}
.gl-review-editor{padding:24px;border:1px solid var(--line);border-radius:10px}
#gl-review-body .gl-review-editor>.panel{padding:0;border:0;margin-top:24px}
#gl-review-body .gl-review-editor .panel .panel{background:var(--bg)}
#glrv-msg:empty{display:none}
#glrv-preview{margin-top:24px;border-color:var(--navy)}
#glrv-preview details{padding:12px 0;border-bottom:1px solid var(--line)}
#glrv-preview summary{cursor:pointer;line-height:1.7}
#modal-sheet.sales-confirm{max-width:760px!important;padding:28px;border-radius:12px}
.sales-confirm .sheet-h{font-size:22px;margin-bottom:24px}
.sales-confirm-notice{background:var(--amberbg);color:var(--amber);padding:16px;border-radius:8px;line-height:1.7}
.sales-confirm-details{border:1px solid var(--line);border-radius:10px;margin-top:24px;padding:20px;overflow-wrap:anywhere}
.sales-confirm-details h3{font-size:16px;margin:0 0 16px}
.sales-confirm-details p{margin:0;padding:10px 0;border-bottom:1px solid var(--line);white-space:pre-wrap;line-height:1.6}
.sales-confirm-details p:last-child{border-bottom:0}
.sales-confirm .btn{min-height:44px;margin:4px 4px 0 0}
button:focus-visible,summary:focus-visible{outline:2px solid var(--navy);outline-offset:3px}
@media(max-width:1100px){#header-company{max-width:150px}.gl-review-grid{grid-template-columns:1fr}.gl-review-editor{padding:18px}}
@media(max-width:760px){
 body .topbar{padding:10px 16px;gap:8px}
 body .topbar .mark .maskeel-logo{width:155px;height:40px}
 #header-company,.topbar .trialchip{display:none!important}
 body .surface-body{padding:24px 16px 36px;overflow-x:clip}
 body .main .panel{padding:18px;margin-bottom:18px}
 body .main .panel h2{font-size:22px}
 body .work-bar{padding:10px 16px;min-height:56px}
 body .helper-scroll{padding:24px 16px}
 body .helper .bub{max-width:100%;padding:12px 14px}
 body .helper .cin{padding:12px;gap:6px;flex-wrap:wrap}
 body .helper #cmdin{flex-basis:calc(100% - 48px)}
 body .cin .snd{margin-left:auto}
 .gl-review-grid{display:block;margin-top:20px}
 .gl-review-editor{padding:16px}
 #modal-sheet.sales-confirm{padding:20px;margin:16px 12px 36px}
 .sales-confirm .sheet-h{font-size:20px}
 .sales-confirm-details{padding:14px;margin-top:16px}
 /* One DOM for table and cards: selection, actions, sorting and column preferences stay intact. */
 #s-so table,#s-so tbody{display:block;min-width:0}
 #s-so thead{display:block;margin-bottom:12px}
 #s-so thead tr{display:flex;flex-wrap:wrap;gap:6px}
 #s-so thead th{display:block;border:1px solid var(--line);border-radius:5px;padding:6px;font-size:12px}
 #s-so thead th:empty{display:none}
 #s-so tr.rowlink{display:block;border:1px solid var(--line);border-radius:10px;margin-bottom:14px;padding:12px;background:var(--surface)}
 #s-so tr.rowlink td{display:flex;align-items:baseline;justify-content:space-between;gap:12px;border:0;padding:6px 0;white-space:normal;overflow-wrap:anywhere;text-align:right}
 #s-so tr.rowlink td::before{content:attr(data-label);color:var(--muted);font-size:12px;flex-shrink:0;text-align:left}
 #s-so tr.rowlink td:last-child{display:block;text-align:left;min-width:0;padding-top:12px;border-top:1px solid var(--line);margin-top:8px}
 #s-so tr.rowlink td:last-child::before{display:block;margin-bottom:8px}
 #s-so td .btn{margin:3px 2px}
 #s-so tr.rowlink td[data-label="伝票"]{font-weight:700;color:var(--navy)}
 #detail-body .row2{grid-template-columns:1fr}
}
@media(max-width:360px){body .topbar{gap:3px;padding:8px}.topbar .mark{margin-right:auto}body .topbar .mark .maskeel-logo{width:140px}}
/* Override the legacy fixed header height and company-logo size cap. */
body .topbar{height:auto;min-height:74px}
body .topbar .mark .maskeel-logo{max-width:none;border-radius:0}
@media(max-width:760px){body .topbar{min-height:62px}}
/* Keep the complete rule schema, grouped into readable pairs on desktop. */
@media(min-width:1101px){
 #gl-review-body .gl-review-editor>.panel{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 16px}
 #gl-review-body .gl-review-editor>.panel>h4,#gl-review-body .gl-review-editor>.panel>.small,#gl-review-body .gl-review-editor>.panel>.panel,#gl-review-body .gl-review-editor>.panel>button{grid-column:1/-1}
 #gl-review-body .gl-review-editor>.panel>.panel{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 16px}
 #gl-review-body .gl-review-editor>.panel>.panel>b,#gl-review-body .gl-review-editor>.panel>.panel>button,#gl-review-body .gl-review-editor>.panel>.panel>p:has(input[type=checkbox]){grid-column:1/-1}
 #gl-review-body .gl-review-editor>.panel p{margin:0}
}

#authov .sheet-h{flex-wrap:wrap}
#detail-body>.panel{overflow-x:auto}
#detail-body .kv b{overflow-wrap:anywhere;min-width:0}
/* Ledger/detail columns scroll locally instead of turning Japanese labels vertical. */
#detail-body table{min-width:560px}
#detail-body table th,#detail-body table td{white-space:nowrap}
/* Approval review: row numbers support referring to a specific line in conversation. */
.sales-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px 20px;margin:0 0 16px}
.sales-summary:empty{display:none}
.sales-summary>div{min-width:0}
.sales-summary .wide{grid-column:1/-1}
.sales-summary dt{font-size:12px;color:var(--muted);margin-bottom:4px}
.sales-summary dd{margin:0;font-size:15px;font-weight:600;overflow-wrap:anywhere;white-space:pre-wrap}
.sales-lines{overflow-x:auto;margin:16px 0;border:1px solid var(--line);border-radius:6px}
.sales-lines table{width:100%;min-width:500px;border-collapse:collapse;font-size:14px}
.sales-lines caption{text-align:left;font-weight:700;padding:10px 12px}
.sales-lines th,.sales-lines td{padding:10px 12px;border-bottom:1px solid var(--line);white-space:nowrap;text-align:left}
.sales-lines thead{background:var(--tint)}
.sales-lines .num{text-align:right;font-variant-numeric:tabular-nums}
.sales-lines tfoot th,.sales-lines tfoot td{border-bottom:0;font-weight:700}
.sales-lines:focus-visible{outline:2px solid var(--navy);outline-offset:2px}
@media(max-width:600px){.sales-summary{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.sales-confirm-details{padding:12px}.sales-lines th,.sales-lines td{padding:10px 8px}}
@media(min-width:601px){.sales-summary .start{grid-column:1}}
