/* Use the incumbent console shell, tabs, toolbar, table and pager. */
#view-worktool-data .worktool-data-table th:first-child{width:80px}
#view-worktool-data .worktool-data-table th:nth-child(2){width:25%}
#view-worktool-data .worktool-data-table th:nth-child(6){width:160px}
#view-worktool-data .worktool-data-table th:last-child{width:100px}
body:has(#view-worktool-data.active) #refresh-button{display:none}
.worktool-data-detail{padding:24px;overflow:auto;min-height:0;overflow-wrap:anywhere}
.worktool-data-detail .field-grid{display:grid}
.worktool-data-detail .field-grid p{margin:6px 0 0;font-size:13px;line-height:1.7}
.worktool-data-detail h3{font-size:14px;margin:24px 0 12px}
.worktool-data-detail h4{font-size:12px;margin:10px 0}
.worktool-data-detail .source-text{min-height:80px;margin-top:0;font-size:13px;overflow-wrap:anywhere}
.worktool-field-table{width:100%;border-collapse:collapse;font-size:13px;table-layout:fixed}
.worktool-field-table th,.worktool-field-table td{text-align:left;vertical-align:top;border-bottom:1px solid var(--line);padding:10px 8px;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere}
.worktool-field-table th{width:95px;font-weight:500;color:var(--muted)}
.worktool-data-image{display:block;max-width:100%;max-height:440px;object-fit:contain}
@media(max-width:760px){.worktool-data-detail{padding:18px}.worktool-field-table th{width:70px}.worktool-field-table th,.worktool-field-table td{padding:8px 4px}}

/* Login shell for the data module. */
.login-layout{display:flex;align-items:center;justify-content:center}
.login-panel{max-width:430px}
#session-error:empty{display:none}
.auto-order-status{display:inline-flex;padding:3px 8px;background:var(--green-soft);color:var(--green);font-size:12px;line-height:1.5}
.auto-order-status.needs-input{background:var(--amber-soft);color:var(--amber)}
/* Keep all four lists on the existing intake console's table rhythm. */
.app-shell{--muted:#6e675f}
.module-heading{display:flex;align-items:center;justify-content:flex-end;gap:20px;margin:0 0 18px}
.module-heading .link-button{flex:0 0 auto}
.route-editor{margin-bottom:24px;padding:18px 20px;border:1px solid var(--line);background:#fff}
.route-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:16px}
.route-heading h2{font-size:14px;font-weight:500;margin:0}
.route-state{flex:0 0 auto;color:var(--green);font-size:12px}
.route-pickers{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
.route-picker{margin:0;min-width:0;padding:0;border:0}
.route-picker legend{display:flex;align-items:center;justify-content:space-between;width:100%;padding:0;margin-bottom:8px;font-size:12px;font-weight:500}
.route-picker legend span{font-weight:400;color:var(--muted)}
.route-picker>input{min-height:32px;height:32px;border-radius:0;font-size:12px}
.route-choices{height:136px;overflow-y:auto;overscroll-behavior:contain;border:1px solid var(--line);border-top:0;background:#fff}
.route-choice{display:flex;align-items:flex-start;gap:8px;min-height:34px;padding:7px 10px;color:var(--ink);font-weight:400;font-size:12px;line-height:1.6;cursor:pointer}
.route-choice:hover{background:#faf8f5}
.route-choice:has(input:checked){background:#fff7ec}
.route-choice input{width:14px;height:14px;min-height:14px;margin:2px 0 0;flex:0 0 14px;accent-color:var(--green);padding:0}
.route-choice>span{min-width:0;overflow-wrap:anywhere}
.route-choice small{display:block;color:var(--muted);font-size:11px}
.route-empty{padding:12px 10px;margin:0;color:var(--muted);font-size:12px;line-height:1.7}
.route-save-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:16px}
.route-message{min-width:0;color:var(--muted);font-size:12px;overflow-wrap:anywhere}
.route-message.error{color:var(--red)}
.data-list-host .worktool-data-table{min-width:920px}
.data-list-host .worktool-data-table th:first-child{width:72px}
.data-list-host .worktool-data-table th:nth-child(2){width:28%}
.data-list-host .worktool-data-table th:nth-child(6){width:155px}
.data-list-host .worktool-data-table th:last-child{width:90px}
.data-list-host .worktool-data-table td{vertical-align:top}
.data-list-host .worktool-data-table td:nth-child(2),.data-list-host .worktool-data-table td:nth-child(3){white-space:normal;overflow-wrap:anywhere;max-width:350px}
.data-list-host .worktool-data-table td small{display:block;margin-top:4px;color:var(--muted);font-size:11px;white-space:normal;overflow-wrap:anywhere}
.data-list-host .worktool-data-table .order-intake-issue{max-width:220px;color:var(--red)}
.data-list-host .capture-search{width:min(380px,100%)}
.data-list-host .capture-list-footer{font-variant-numeric:tabular-nums}
.data-list-host .capture-pagination select{width:auto}
.data-list-host .capture-tabs button,.data-list-host .console-tabs button{color:var(--muted)}
::selection{background:#ffe1b5;color:#452c14}
input,textarea{caret-color:var(--green)}
.route-choices{scrollbar-width:thin;scrollbar-color:#c3b6a6 #faf8f5}
@media(max-width:1000px){.module-heading{align-items:flex-start}.route-heading{flex-wrap:wrap}.data-list-host .capture-toolbar{flex-wrap:wrap;gap:12px}.data-list-host .capture-toolbar-filters{flex:1;justify-content:flex-end}}
@media(max-width:760px){.module-heading{flex-direction:column;gap:10px}.route-editor{padding:16px}.route-pickers{grid-template-columns:1fr;gap:16px}.route-choices{height:120px}.route-save-bar .route-message{width:100%;margin-top:2px}.data-list-host .capture-toolbar-filters{width:100%;justify-content:stretch}.data-list-host .capture-search{flex:1;width:auto;min-width:0}.data-list-host .capture-list-footer{align-items:flex-start;gap:12px;flex-wrap:wrap}.data-list-host .capture-pagination{margin-left:auto}.route-heading{gap:6px}}

.route-choice-blocked{color:var(--muted);background:#f7f6f3;cursor:not-allowed}
.route-choice-blocked:hover{background:#f7f6f3}
.route-choice-conflict small{color:var(--red)}

.data-list-host .capture-toolbar{justify-content:flex-end}

/* Layout: one page header, compact source setup, then the message workspace. */
:root{--panel-header-height:100px;--panel-space:24px}
.console-top{padding:8px 24px;height:56px}
.console-context{color:#e1d8cc;font-size:13px;white-space:nowrap}
.app-shell{padding-top:var(--panel-header-height);grid-template-columns:184px minmax(0,1fr)}
.app-shell .sidebar{width:184px;top:var(--panel-header-height);height:calc(100dvh - var(--panel-header-height));overflow-y:auto;padding:24px 12px}
.app-shell .sidebar .brand-block{padding-bottom:16px}
.app-shell .sidebar .nav-item{min-height:44px;font-size:13px}
.app-shell>main{padding:var(--panel-space);min-width:0}
.app-shell .topbar{min-height:64px;margin:calc(-1 * var(--panel-space)) calc(-1 * var(--panel-space)) var(--panel-space);padding:12px var(--panel-space);gap:16px;justify-content:space-between}
.app-shell .topbar h1{margin:0;font-size:22px;line-height:1.4;font-weight:600}
.page-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}
.page-actions .button,.route-save-bar .button{min-height:36px;font-size:13px;padding:8px 16px}
.route-editor{padding:16px 20px;margin-bottom:24px}
.route-heading{align-items:center;margin-bottom:12px}
.route-heading h2{font-size:14px;font-weight:600}
.route-heading>div{min-width:0}
.route-state{font-size:12px}
.route-pickers{gap:24px}
.route-picker legend{margin-bottom:8px;font-size:13px}
.route-picker>input{height:36px;min-height:36px;font-size:13px}
.route-choices{height:108px}
.route-choice{min-height:36px;padding:8px 12px;font-size:13px;line-height:1.5}
.route-choice small{line-height:1.5}
.route-save-bar{margin-top:16px;gap:8px}
.data-list-host .capture-toolbar{gap:16px;justify-content:space-between;margin:0 0 12px;align-items:center;flex-wrap:wrap}
.app-shell .data-list-host .console-tabs{margin:0;border:0;gap:20px;flex:0 0 auto;max-width:100%}
.app-shell .data-list-host .console-tabs button{font-size:13px;min-height:40px}
.data-list-host .capture-toolbar-filters{flex:0 1 420px;gap:8px;margin-left:auto}
.data-list-host .capture-search{width:auto;flex:1;min-width:0;height:36px}
.data-list-host .capture-search input{font-size:13px;height:34px;min-height:34px}
.data-list-host .capture-refresh{width:36px;height:36px;min-height:36px;padding:8px;flex:0 0 36px}
.data-list-host .console-form-error:empty{display:none}
.data-list-host .table-wrap{overscroll-behavior-x:contain}
.app-shell .capture-workspace .worktool-data-table{min-width:900px;table-layout:fixed}
.app-shell .capture-workspace .worktool-data-table th,.app-shell .capture-workspace .worktool-data-table td{padding:12px;font-size:13px;line-height:1.6}
.app-shell .capture-workspace .worktool-data-table th{font-size:12px;background:#f5f3ef;white-space:nowrap;color:#625a50}
.app-shell .capture-workspace .worktool-data-table th:nth-child(1){width:64px}
.app-shell .capture-workspace .worktool-data-table th:nth-child(2){width:auto}
.app-shell .capture-workspace .worktool-data-table th:nth-child(3){width:160px}
.app-shell .capture-workspace .worktool-data-table th:nth-child(4){width:116px}
.app-shell .capture-workspace .worktool-data-table th:nth-child(5){width:108px}
.app-shell .capture-workspace .worktool-data-table th:nth-child(6){width:156px}
.app-shell .capture-workspace .worktool-data-table th:nth-child(7){width:88px}
.data-list-host .order-intake-summary{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;line-height:1.65}
.data-list-host .worktool-data-table td .order-intake-issue{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.data-list-host .worktool-data-table td:nth-child(6){font-variant-numeric:tabular-nums;font-size:12px;white-space:nowrap}
.app-shell .capture-workspace .worktool-data-table .row-actions button{min-height:32px;white-space:nowrap;font-size:13px}
.data-list-host .capture-list-footer{padding:12px 16px;background:#fff;gap:16px}
.data-list-host .capture-pagination{gap:8px;align-items:center}
.data-list-host .capture-pagination .button,.data-list-host .capture-pagination select{min-height:36px}
.app-shell :is(button,a,input,select,.table-wrap):focus-visible{outline:2px solid #956019;outline-offset:3px}
@media(max-width:1100px){
 .data-list-host .capture-toolbar-filters{flex-basis:340px}
 .app-shell .capture-workspace .worktool-data-table th:last-child,.app-shell .capture-workspace .worktool-data-table td:last-child{position:sticky;right:0;background:#fff;border-left:1px solid var(--line)}
 .app-shell .capture-workspace .worktool-data-table th:last-child{background:#f5f3ef}
}
@media(max-width:760px){
 :root{--panel-space:16px}
 .app-shell{display:block}
 .app-shell .sidebar{position:sticky;top:var(--panel-header-height);width:100%;height:auto;max-height:none;padding:4px 12px;overflow-x:auto;background:#fff;border-right:0;border-bottom:1px solid var(--line);z-index:20}
 .app-shell .sidebar .brand-block{display:none}
 .app-shell .sidebar nav{display:flex;gap:4px;height:auto;overflow-x:auto}
 .app-shell .sidebar .nav-item{min-width:0;width:auto;flex:1 0 auto;min-height:44px;padding:0 12px;font-size:13px;white-space:nowrap}
 .app-shell .topbar{min-height:72px;gap:12px;flex-wrap:wrap}
 .app-shell .topbar h1{font-size:20px}
 .page-actions .button{min-height:40px;padding:8px 12px;font-size:12px}
 .route-editor{padding:16px;margin-bottom:20px}
 .route-pickers{grid-template-columns:1fr;gap:16px}
 .route-choices{height:132px}
 .route-choice{min-height:44px}
 .route-picker>input,.route-save-bar .button{height:44px;min-height:44px}
 .data-list-host .capture-toolbar{gap:8px}
 .app-shell .data-list-host .console-tabs{width:100%;justify-content:space-between;gap:12px}
 .app-shell .data-list-host .console-tabs button{min-height:44px}
 .data-list-host .capture-toolbar-filters{width:100%;flex:1 1 100%;margin:0}
 .data-list-host .capture-search,.data-list-host .capture-refresh{height:44px;min-height:44px}
 .data-list-host .capture-refresh{width:44px;flex-basis:44px}
 .data-list-host .capture-search input{height:42px;min-height:42px}
 .data-list-host .capture-list-footer{padding:12px;gap:12px;flex-wrap:wrap}
 .data-list-host .capture-pagination{margin-left:auto}
 .data-list-host .capture-pagination .button,.data-list-host .capture-pagination select{min-height:44px}
 .app-shell .capture-workspace .worktool-data-table .row-actions button{min-height:44px}
 .worktool-data-detail{padding:16px}
 .worktool-data-detail .field-grid{grid-template-columns:1fr}
}
@media(max-width:480px){
 .console-top{padding:8px 16px;gap:12px}
 .console-context{display:none}
 .app-shell .sidebar{padding:4px 8px}
 .app-shell .sidebar .nav-item{padding:0 8px;gap:6px}
 .app-shell .sidebar .nav-item svg{width:16px;height:16px}
}

.route-editor>summary{list-style:none;cursor:pointer;min-height:28px;margin-bottom:0}
.route-editor>summary::-webkit-details-marker{display:none}
.route-editor[open]>summary{margin-bottom:12px}
.route-editor>summary .route-state{margin-left:auto}
.route-editor>summary::after{content:"";width:8px;height:8px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg);margin:0 4px 4px;flex:0 0 auto}
.route-editor[open]>summary::after{transform:rotate(225deg);margin-top:4px;margin-bottom:0}
.route-editor>summary:focus-visible{outline:2px solid #956019;outline-offset:4px}
@media(max-width:760px){.route-editor>summary{min-height:44px}}

/* Use the workbench's shared horizontal module navigation below the brand bar. */
.console-modules{overflow-x:auto}
.console-module{flex-shrink:0;white-space:nowrap}
.console-module:focus-visible{outline:2px solid #956019;outline-offset:-4px}
@media(max-width:760px){
 .console-modules{padding:0 8px}
 .console-module{min-width:0;flex:1 0 auto;padding:0 14px}
}
