/* Screen presentation only. Login artwork, canonical shield and official PDFs
   deliberately remain independent of the desktop workspace layout. */
@media screen {
 .reference-scope-controls { display:flex;gap:8px;min-width:0;flex:1; }
 .reference-scope-controls .fresh-scope-choice { max-width:240px; }
 .reference-scope-controls .fresh-scope-choice small { display:block;font-size:17px;line-height:1;color:#49708c; }
 .reference-scope-controls .fresh-scope-choice strong { display:block;font-size:21px;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
 .reference-account-pager { display:flex;justify-content:center;align-items:center;gap:8px;padding-top:8px;flex-wrap:wrap; }
 .reference-account-pager small { color:#49708c;font-size:18px; }
 .reference-tree-branch { margin-left:12px;border-left:1px dashed #b9deeb;padding-left:10px; }
 .reference-tree-branch details { margin-left:8px;padding-left:8px; }
 .reference-tree-branch summary { color:#176185;font-size:20px;overflow-wrap:anywhere; }
 .fresh-account-bottom { display:grid;grid-template-columns:1.1fr 1fr 1.1fr;gap:10px;border:0;background:transparent;box-shadow:none; }
 .fresh-account-bottom > div { min-width:0;padding:8px 12px;border:1px solid #bce4ed;border-radius:9px;background:#fff; }
 .fresh-account-bottom h2 { font-size:25px;line-height:1.1;margin:0 0 5px;color:#095478; }
 .reference-account-note p { margin:0 0 5px;font-size:20px;max-height:48px;overflow:auto; }
 .reference-account-check { background:linear-gradient(100deg,#fff,#fff3f3) !important; }
 .reference-account-check small { display:block;font-size:18px; }
 .reference-account-actions { display:flex;gap:8px;align-items:center;flex-wrap:wrap; }
 .reference-account-actions > .button { flex:1;min-height:55px;font-size:28px; }
 .reference-account-actions details { width:100%;font-size:18px; }
 .reference-boundaries { margin:0; }
 .reference-boundaries > div { display:grid;grid-template-columns:95px 1fr;gap:8px;border-bottom:1px solid #d6e8ef;padding:5px; }
 .reference-boundaries dd { margin:0;overflow-wrap:anywhere; }
 .reference-party-columns { display:grid;grid-template-columns:1fr 1fr;gap:8px; }
 .reference-party-columns > section { min-width:0;overflow-wrap:anywhere;padding:7px;border:1px solid #d3eaf0;border-radius:6px;background:#fff; }
 .reference-chart-head { display:flex;justify-content:space-between;gap:8px;align-items:center; }
 .reference-chart-head label { display:flex;gap:6px;align-items:center;font-size:19px;flex-wrap:wrap; }
 .reference-chart-head select { width:88px;min-height:30px;padding:0 5px;border:1px solid #bdddea;border-radius:5px;color:#154c70; }
 .reference-progress-total { font-size:17px;line-height:1.05;min-width:0;border:1px solid #d1eaf0;padding:4px 8px;border-radius:7px;background:#f7fdff;text-align:right; }
 .reference-progress-total strong,.reference-progress-total small { display:block; }
 .reference-progress-total strong { font-size:27px;color:#067b91;font-variant-numeric:tabular-nums; }
 [data-monthly-chart] { display:block;width:100%;height:150px;overflow:visible; }
 [data-monthly-chart] text { font-family:"TH Sarabun",serif;font-size:23px;fill:#245e7b; }
 .reference-payment-statuses { display:flex;gap:5px;flex-wrap:wrap;margin-bottom:7px; }
 .reference-payment-statuses button { padding:3px 7px;border:1px solid #bfe5ef;border-radius:6px;color:#075477;background:#eaf8ff;font-size:19px;line-height:1.2; }
 .reference-payment-statuses button strong { display:inline-grid;place-items:center;min-width:22px;border-radius:20px;background:white;margin-left:3px; }
 .reference-payment-statuses button[aria-pressed=true] { color:white;background:linear-gradient(100deg,#008fef,#128dff); }
 .reference-payment-statuses button[aria-pressed=true] strong { color:#087de0; }
 .reference-payment-statuses button[data-payment-status=PAID] { border-color:#b4e6c0; }
 .reference-payment-selection { color:#486a7b;font-size:17px;margin:5px 0; }
 .reference-download-buttons { display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px; }
 .reference-download-buttons .button { min-width:0;white-space:normal;font-size:23px;min-height:45px;padding:4px; }
 .reference-document-warning { border:1px solid #f5d785;border-radius:6px;background:#fff5d8;padding:4px 7px; }
 .reference-document-warning summary { font-size:18px;font-weight:700;color:#8b5b0b;cursor:pointer; }
 .fresh-pdf-pages { display:grid;grid-template-columns:minmax(0,1fr) 62px;gap:7px;min-width:0; }
 .fresh-pdf-thumbnails { display:flex;flex-direction:column;gap:6px;max-height:265px;overflow:auto; }
 .fresh-pdf-thumbnail { background:#fff;border:2px solid #cedee7;border-radius:5px;padding:2px;display:grid;gap:2px;color:#164e73;font-size:16px; }
 .fresh-pdf-thumbnail[aria-current=page] { border-color:#0b8fff; }
 .fresh-pdf-thumbnail canvas { max-width:100%;height:auto; }
 .fresh-pdf-thumbnail span { line-height:1; }
}
@media screen and (min-width:1280px) {
 /* Navigation/ribbon/sidebar/status bar stay exactly as they were. */
 :is(.fresh-dashboard,.fresh-accounts,.page-shell:has(>.fresh-payment-workspace)) { gap:10px; }
 :is(.fresh-dashboard,.fresh-accounts,.page-shell:has(>.fresh-payment-workspace)) .page-heading { min-height:90px;padding:9px 8px;border:0;box-shadow:none;background:transparent;gap:10px; }
 :is(.fresh-dashboard,.fresh-accounts,.page-shell:has(>.fresh-payment-workspace)) .page-heading h1 { font-size:44px;line-height:1.05; }
 :is(.fresh-dashboard,.fresh-accounts,.page-shell:has(>.fresh-payment-workspace)) .page-heading p { font-size:21px;line-height:1.15;margin-top:4px; }
 :is(.fresh-dashboard,.fresh-accounts,.page-shell:has(>.fresh-payment-workspace)) .page-heading h1 .theme-icon { width:45px;height:45px;margin-right:10px; }
 :is(.fresh-dashboard,.fresh-accounts,.page-shell:has(>.fresh-payment-workspace)) .page-heading::after { display:none; }
 :is(.fresh-dashboard,.fresh-accounts,.page-shell:has(>.fresh-payment-workspace)) .heading-actions { display:flex;gap:8px;align-items:center;min-width:0; }
 .fresh-accounts .heading-actions { max-width:51%;width:51%; }
 .fresh-dashboard .heading-actions { width:51%;max-width:51%; }
 .fresh-dashboard .fresh-dashboard-actions { gap:6px; }
 .fresh-dashboard .fresh-dashboard-actions .button { min-height:24px;padding:2px 8px;font-size:18px;line-height:1.1; }
 .fresh-scope-strip { gap:8px; }
 .fresh-scope-choice { padding:3px 20px 3px 7px; }
 .fresh-scope-choice strong { font-size:20px;line-height:1.15; }
 .fresh-dashboard .metrics { gap:12px; }
 .fresh-dashboard .metric-card { height:118px;min-height:118px;padding:12px;gap:10px; }
 .fresh-dashboard .metric-card span { font-size:26px; }
 .fresh-dashboard .metric-card strong { font-size:clamp(29px,2.5vw,42px);line-height:1.1;margin-top:5px; }
 .fresh-dashboard-main { min-height:clamp(230px,27dvh,260px);height:auto; }
 .fresh-dashboard-bottom { min-height:clamp(205px,24dvh,230px);height:auto; }
 .fresh-dashboard :is(.fresh-dashboard-main,.fresh-dashboard-bottom) .panel-header { min-height:44px;padding:5px 10px;gap:8px; }
 .fresh-dashboard :is(.fresh-dashboard-main,.fresh-dashboard-bottom) .panel-header h2 { font-size:29px;line-height:1.1; }
 .fresh-dashboard :is(.fresh-dashboard-main,.fresh-dashboard-bottom) .panel-header .button { min-height:30px;font-size:19px;padding:2px 8px; }
 .fresh-dashboard :is(.fresh-dashboard-main,.fresh-dashboard-bottom) .panel-body { min-height:0;overflow:visible;padding:7px 10px; }
 .fresh-dashboard-main .fresh-map-art { height:235px;min-height:0; }
 .fresh-dashboard .fresh-chart-legend { margin:0;font-size:17px;line-height:1.1; }
 .fresh-dashboard .fresh-chart-note { font-size:16px;line-height:1.05;margin:2px 0 0; }
 .fresh-progress-panel .panel-body { overflow:visible !important; }
 .fresh-progress-panel .panel-body { position:relative; }
 .reference-chart-head { min-height:40px; }
 .reference-chart-head label { max-width:65%; }
 .reference-progress-total { position:absolute;right:10px;top:7px; }
 [data-monthly-chart] { height:155px; }
 .reference-dashboard-feeds > summary { padding:7px 12px;cursor:pointer;font-weight:700; }
 .reference-dashboard-feeds .dashboard-feeds { padding:10px;margin:0; }
 .fresh-dashboard-bottom .table-wrap { max-height:none;overflow:visible; }
 .fresh-dashboard-bottom .data-table { min-width:0;width:100%; }
 .fresh-dashboard-bottom .data-table :is(th,td) { padding:3px 6px;font-size:19px;line-height:1.15; }
 .fresh-dashboard-bottom .row-actions .button { min-height:25px;padding:1px 6px;font-size:17px;line-height:1.1; }
 .fresh-dashboard-bottom .empty-state { min-height:100px;height:100%; }
 .fresh-dashboard-bottom .status-chip { font-size:18px;padding:2px 6px; }
 .fresh-account-workspace { grid-template-columns:minmax(180px,.68fr) minmax(330px,1.14fr) minmax(400px,1.55fr);height:calc(100dvh - 431px);min-height:400px; }
 .fresh-account-workspace > .panel { display:grid;grid-template-rows:44px minmax(0,1fr);height:100%; }
 .fresh-account-workspace .panel-header { min-height:44px;padding:5px 10px; }
 .fresh-account-workspace .panel-header h2 { font-size:28px;line-height:1.1; }
 .fresh-account-workspace .panel-body { min-height:0;overflow:auto;padding:9px; }
 .fresh-account-tree .panel-body { padding-bottom:60px; }
 .fresh-tree-scope { font-size:17px;line-height:1.1;padding:4px 7px; }
 .fresh-account-list .toolbar { display:grid;grid-template-columns:1fr 1fr;gap:5px;margin:0 0 7px; }
 .fresh-account-list .toolbar .search-box { grid-column:1 / -1;min-width:0; }
 .fresh-account-list .toolbar :is(input,select) { min-width:0;min-height:34px;height:34px;padding:0 7px; }
 .fresh-account-list .data-table { min-width:0;width:100%; }
 .fresh-account-list .data-table :is(th,td) { padding:4px 5px;font-size:19px;line-height:1.15; }
 .fresh-account-list .row-actions { flex-direction:row;gap:3px; }
 .fresh-account-list .row-actions .button { font-size:17px;min-height:24px;padding:1px 4px; }
 .fresh-account-list .data-table td:first-child { min-width:90px; }
 .fresh-account-list .table-wrap { max-height:none; }
 .fresh-account-list .fresh-chart-note { font-size:16px; }
 .fresh-account-bottom { min-height:105px; }
 .fresh-parcel-summary { grid-template-columns:1fr 1.08fr;gap:8px; }
 .fresh-parcel-summary > img { height:205px; }
 .fresh-parcel-summary dl > div { font-size:18px;line-height:1.15;padding:3px 5px; }
 .fresh-inspector-tabs button { font-size:18px;min-width:0;padding:5px 6px; }
 .fresh-inspector-tab-body { min-height:120px;max-height:180px;padding:7px 9px;font-size:20px; }
 .fresh-inspector-tab-body p { margin:3px 0 6px; }
 .fresh-payment-workspace { grid-template-columns:minmax(340px,1.06fr) minmax(360px,1.14fr) minmax(335px,1fr);align-items:stretch;height:calc(100dvh - 315px);min-height:550px; }
 .fresh-payment-workspace > * { min-height:0;height:100%; }
 .fresh-payment-list > .panel,.fresh-payment-docs { display:grid;grid-template-rows:44px minmax(0,1fr);height:100%;overflow:hidden; }
 .fresh-payment-workspace .panel-header { min-height:44px;padding:5px 9px; }
 .fresh-payment-workspace .panel-header h2 { font-size:28px;line-height:1.1; }
 .fresh-payment-list > .panel > .panel-body,.fresh-payment-docs > .panel-body { overflow:auto;min-height:0;padding:8px; }
 .fresh-payment-list #paymentListFilterForm { display:flex;gap:4px;margin:4px 0; }
 .fresh-payment-list #paymentListFilterForm .search-box { flex-basis:100%;padding:0 5px; }
 .fresh-payment-list #paymentListFilterForm .search-box span { display:none; }
 .fresh-payment-list #paymentListFilterForm input { height:34px;min-height:34px;padding:0 5px; }
 .fresh-payment-list #paymentListFilterForm .button { padding:1px 7px;min-height:27px; }
 .fresh-payment-list .panel-body > p { font-size:17px;line-height:1.1;margin:5px 0; }
 .fresh-payment-list nav[aria-label$="ด้านบน"] { display:none; }
 .fresh-payment-list .data-table { min-width:0;width:100%; }
 .fresh-payment-list .data-table :is(td,th) { padding:4px;font-size:19px;line-height:1.15; }
 .fresh-payment-list .data-table th:first-child { width:30px; }
 .fresh-payment-list .data-table td:nth-child(4) { text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap; }
 .fresh-payment-choice { font-size:17px;min-height:22px;padding:0 5px;display:inline-block; }
 .fresh-payment-list .data-table .row-actions { flex-wrap:wrap;gap:3px; }
 .fresh-payment-list .row-actions .button { font-size:16px;min-height:23px;padding:1px 3px; }
 .fresh-payment-list .table-wrap { max-height:none; }
 .fresh-payment-middle { display:grid;grid-template-rows:minmax(255px,1.36fr) minmax(145px,.78fr) minmax(170px,1fr);gap:8px; }
 .fresh-payment-middle > .panel { display:grid;grid-template-rows:44px minmax(0,1fr);min-height:0;overflow:hidden; }
 .fresh-payment-middle .panel-body { overflow:auto;padding:6px 8px;min-height:0; }
 .fresh-payment-facts > div { font-size:19px;line-height:1.1;padding:3px 5px; }
 .fresh-payment-amount { margin:6px 0 0;font-size:20px; }
 .fresh-payment-amount strong { font-size:35px; }
 .fresh-payment-amount small { display:inline;margin-right:8px;font-size:19px; }
 .fresh-payment-parcel img { height:100%;max-height:120px; }
 .fresh-method-label { font-size:23px;padding:2px 7px;margin:0 0 4px; }
 .fresh-method-card .button { min-height:32px;font-size:21px;padding:2px 8px; }
 .fresh-method-card .fresh-chart-note { font-size:16px;line-height:1.1; }
 .fresh-payment-docs .panel-body { display:grid;grid-template-rows:minmax(175px,.85fr) minmax(200px,1fr) 46px;gap:8px;overflow:hidden; }
 .fresh-payment-docs [data-document-download-selector] { padding:6px;min-height:0;overflow:auto; }
 .fresh-payment-docs [data-document-download-selector] > p { font-size:17px;line-height:1.15;margin:4px 0; }
 .fresh-payment-docs #documentBundleForm .grid.two { grid-template-columns:minmax(90px,.8fr) minmax(0,1.4fr);gap:5px; }
 .fresh-payment-docs #documentBundleForm fieldset { padding:4px 6px;min-width:0; }
 .fresh-payment-docs #documentBundleForm legend { font-size:20px; }
 .fresh-payment-docs .document-download-choices { max-height:120px; }
 .fresh-payment-docs .document-download-choice { font-size:19px;line-height:1.1;padding:2px; }
 .fresh-payment-docs #documentBundleForm .toolbar { gap:3px; }
 .fresh-payment-docs #documentBundleForm .toolbar .button { font-size:17px;padding:1px 5px;min-height:23px; }
 .fresh-payment-docs .panel-footer { padding:3px 0; }
 .reference-review-download { font-size:20px !important;min-height:29px !important; }
 .fresh-inline-preview { padding:6px;margin:0;min-height:0;overflow:auto; }
 .reference-download-buttons { margin-top:0; }
 .fresh-inline-preview > .fresh-chart-note { font-size:16px;line-height:1.1; }
 #freshPdfFrame { min-height:175px; }
 .fresh-pdf-canvas-scroll { max-height:265px; }
 .fresh-pdf-file-list { max-height:84px; }
 .fresh-pdf-file-list > div { font-size:17px;padding:2px; }
 .fresh-pdf-file-list small { font-size:15px; }
 .fresh-pdf-file-list .button { min-height:24px;font-size:17px;padding:1px 5px; }
}
@media screen and (min-width:1280px) and (max-height:850px) {
 .fresh-dashboard .metric-card { height:100px;min-height:100px; }
 .fresh-dashboard-main { min-height:210px;height:auto; }
 .fresh-dashboard-bottom { min-height:190px;height:auto; }
 .fresh-account-workspace { min-height:340px; }
 .fresh-payment-workspace { min-height:450px; }
}
@media screen and (max-width:1279px) {
 .fresh-account-bottom { grid-template-columns:1fr 1fr; }
 .reference-account-actions { grid-column:1 / -1; }
 .heading-actions { flex-wrap:wrap; }
 .reference-scope-controls { flex-wrap:wrap; }
 .fresh-payment-workspace .panel-body { overflow-wrap:anywhere; }
}
@media screen and (max-width:860px) {
 .fresh-account-bottom { grid-template-columns:1fr; }
 .fresh-account-inspector { min-width:0; }
 .reference-chart-head { flex-wrap:wrap; }
 .reference-scope-controls { flex-basis:100%; }
 .fresh-account-workspace .data-table,.fresh-payment-workspace .data-table { min-width:420px; }
 .fresh-inspector-tabs { max-width:100%; }
}

/* Fiscal dashboard: only the content panels change; navigation chrome stays intact. */
:is(.fresh-dashboard,.detail-dashboard) .dashboard-status-metrics { gap:10px; }
.page-shell.fresh-dashboard { margin-top:-12px;gap:6px; }
:is(.fresh-dashboard,.detail-dashboard) .dashboard-status-card { width:100%;min-width:0;display:grid;grid-template-columns:58px minmax(0,1fr) 20px;align-items:center;gap:12px;text-align:left;cursor:pointer; }
:is(.fresh-dashboard,.detail-dashboard) .dashboard-status-card > div { grid-column:2;grid-row:1; }
:is(.fresh-dashboard,.detail-dashboard) .dashboard-status-card .metric-icon { grid-column:1;grid-row:1; }
:is(.fresh-dashboard,.detail-dashboard) .dashboard-status-card > div > span { display:block;font-size:24px;line-height:1.05; }
:is(.fresh-dashboard,.detail-dashboard) .dashboard-status-card strong { display:block;margin-top:4px;font-size:clamp(27px,2.1vw,38px);line-height:1;white-space:nowrap; }
:is(.fresh-dashboard,.detail-dashboard) .dashboard-status-card small { display:block;font-size:19px;line-height:1.05;color:inherit; }
:is(.fresh-dashboard,.detail-dashboard) .dashboard-status-arrow { grid-column:3;grid-row:1;font-size:34px;line-height:1;color:inherit;opacity:.9; }
:is(.fresh-dashboard,.detail-dashboard) .dashboard-status-card:focus-visible { outline:3px solid #075b7b;outline-offset:2px; }
:is(.fresh-dashboard,.detail-dashboard) .dashboard-status-card:hover { filter:brightness(1.06);transform:translateY(-1px); }
.fresh-dashboard-main { grid-template-columns:minmax(0,3fr) minmax(0,2fr); }
.fresh-dashboard-main > .panel { grid-template-rows:auto minmax(0,1fr); }
.fresh-dashboard .reference-status-panel .panel-header > small { color:#597c8b;font-size:17px;align-self:center; }
.reference-fiscal-head { min-height:50px;display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:12px; }
.reference-fiscal-head > div:first-child strong { display:block;color:#0b5b85;font-size:22px;line-height:1; }
.reference-fiscal-head > div:first-child small { display:block;color:#53748b;font-size:16px;line-height:1.1; }
.reference-fiscal-head label { white-space:nowrap;color:#426c82;font-size:17px; }
.reference-fiscal-head select { width:auto;min-height:34px;padding:2px 8px;font-size:21px;font-weight:700; }
.reference-fiscal-total { display:grid;justify-items:end;border:1px solid #cbe8f3;border-radius:8px;background:#f4fbfd;padding:2px 8px; }
.reference-fiscal-total small { font-size:16px;line-height:1;color:#426c82; }
.reference-fiscal-total strong { font-size:24px;line-height:1.1;color:#067b9a; }
.fresh-dashboard [data-monthly-chart] { display:block;width:100%;height:150px;overflow:visible; }
.fresh-dashboard [data-monthly-chart] text { font-size:20px; }
.fresh-dashboard .fresh-chart-legend { display:flex;justify-content:center;gap:20px;margin:0;line-height:1.1; }
.fresh-dashboard .fresh-chart-legend i.reference-legend-bar { width:17px;height:9px;border-radius:2px;background:#20bd73; }
.fresh-dashboard .fresh-chart-legend i.reference-legend-line { width:17px;height:4px;border-radius:2px;background:#0b92f3;vertical-align:middle; }
.fresh-dashboard .fresh-chart-note { margin-top:3px; }
.reference-status-panel .panel-body { display:flex;flex-direction:column;justify-content:center; }
.reference-status-layout { display:grid;grid-template-columns:minmax(175px,.95fr) minmax(0,1.15fr);align-items:center;gap:12px; }
.reference-status-donut { position:relative;width:min(100%,220px);aspect-ratio:1;margin:auto;border-radius:50%;display:grid;place-items:center;background:var(--donut); }
.reference-status-donut > div { position:relative;z-index:1;width:57%;aspect-ratio:1;border-radius:50%;display:flex;flex-direction:column;align-items:center;justify-content:center;background:#fff;color:#09547c;box-shadow:0 1px 7px #165a7022; }
.reference-donut-percent { position:absolute;z-index:2;transform:translate(-50%,-50%);color:#fff;font-size:18px;font-weight:700;text-shadow:0 1px 2px #07537880; }
.reference-status-donut strong { font-size:48px;line-height:1; }
.reference-status-donut span { font-size:22px;line-height:1.1; }
.reference-status-list { display:grid;gap:6px; }
.reference-status-row { min-height:58px;display:grid;grid-template-columns:19px minmax(0,1fr) auto;align-items:center;gap:9px;padding:6px 10px;border:1px solid #d2eaf3;border-radius:9px;background:#f7fcfd;color:#07527c;font-size:20px;font-weight:700; }
.reference-status-dot { width:18px;height:18px;border-radius:50%;background:#20bd73; }
.reference-status-row.ready .reference-status-dot { background:#ff951c; }
.reference-status-row.preparing .reference-status-dot { background:#1fb1d8; }
.reference-status-row strong { display:grid;justify-items:end;font-size:29px;line-height:.9; }
.reference-status-row strong small { font-size:16px;font-weight:400;line-height:1.1; }
.reference-status-note { margin:7px 0 0;color:#4f7488;font-size:16px;line-height:1.15; }
.reference-donut-unavailable { padding:40px 12px;text-align:center;color:#54748a; }
.dashboard-panel-caption { margin:0 0 3px;color:#54748a;font-size:17px;line-height:1; }
.fresh-dashboard-bottom .empty-state { height:auto; }
@media screen and (min-width:1280px) {
 .fresh-dashboard .page-heading { min-height:78px; }
 .fresh-dashboard .fresh-dashboard-tools { gap:4px; }
 .fresh-dashboard .fresh-scope-choice { height:42px;padding-top:1px;padding-bottom:1px; }
 .fresh-dashboard .fresh-dashboard-actions .button { min-height:22px;padding-top:0;padding-bottom:0; }
 :is(.fresh-dashboard,.detail-dashboard) .dashboard-status-card { height:102px;min-height:102px;padding:10px; }
 .fresh-dashboard-main { min-height:294px; }
 .fresh-dashboard-bottom { min-height:220px; }
 .fresh-dashboard .fresh-recent-activity .panel-body > small { display:block;margin-top:4px; }
 .fresh-dashboard-bottom .data-table :is(th,td) { padding:0 5px;font-size:17px;line-height:1; }
 .fresh-dashboard-bottom .row-actions .button { min-height:17px;padding:0 4px;font-size:15px;line-height:1; }
}
@media screen and (max-width:1279px) {
 .fresh-dashboard-main { grid-template-columns:minmax(0,1fr); }
 .reference-fiscal-head { grid-template-columns:minmax(0,1fr) auto; }
 .reference-fiscal-total { grid-column:2; }
}

/* Assigned-project overview. These rules are confined to dashboard content. */
.portfolio-tools { display:grid;grid-template-columns:minmax(230px,1fr) auto;align-items:end;gap:12px; }
.portfolio-tools label { display:grid;color:#397189;font-size:18px;line-height:1.1; }
.portfolio-tools select { width:100%;min-height:40px;padding:2px 10px;border:1px solid #bde1ee;background:white;border-radius:7px; }
.portfolio-tools > div { display:flex;gap:6px; }
.portfolio-dashboard .page-heading .heading-copy { min-width:0; }
.page-shell.portfolio-dashboard .page-heading h1 { font-size:clamp(29px,2.3vw,40px); }
.page-shell.portfolio-dashboard .page-heading p { font-size:19px;line-height:1.1;margin:2px 0; }
.portfolio-dashboard .fresh-dashboard-bottom { grid-template-columns:minmax(0,1.75fr) minmax(0,1fr); }
.portfolio-dashboard .fresh-progress-panel .panel-body { display:flex;flex-direction:column;justify-content:space-between; }
.portfolio-dashboard [data-monthly-chart] { height:auto;min-height:110px;max-height:220px;flex:1;overflow:visible; }
.portfolio-dashboard .fresh-chart-note { margin:2px 0 0;font-size:15px;line-height:1; }
.portfolio-dashboard [data-monthly-chart] text { font-size:23px; }
.portfolio-dashboard [data-monthly-chart] text[text-anchor="middle"] { transform:translateY(-7px); }
.portfolio-dashboard .reference-fiscal-head { min-height:42px;gap:8px; }
.portfolio-dashboard .reference-fiscal-head > div:first-child strong { font-size:21px; }
.portfolio-dashboard .reference-fiscal-head > div:first-child small { font-size:16px; }
.portfolio-dashboard .reference-fiscal-total strong { font-size:23px; }
.portfolio-dashboard .reference-status-note { font-size:16px;line-height:1.05; }
.portfolio-projects .panel-header h2 small { font-size:19px;font-weight:400; }
.portfolio-projects .panel-body { display:grid;align-content:start;gap:5px; }
.portfolio-project-row { display:grid;grid-template-columns:minmax(150px,1.4fr) repeat(3,minmax(95px,1fr)) minmax(90px,.9fr) auto;align-items:center;gap:8px;padding:3px 7px;border:1px solid #d6eaf2;border-radius:8px;background:linear-gradient(115deg,#fff,#f6fcff);min-width:0; }
.portfolio-project-row > div { min-width:0;line-height:1.05; }
.portfolio-project-row small { display:block;color:#52758a;font-size:14px;line-height:1; }
.portfolio-project-row strong { display:block;font-size:18px;line-height:1; }
.portfolio-project-name { display:flex;align-items:center;gap:7px; }
.portfolio-project-name img { width:47px;height:47px;object-fit:cover;border-radius:7px;flex:none; }
.portfolio-project-name > div { min-width:0; }
.portfolio-project-name strong { display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;color:#0c527b; }
.portfolio-project-row .portfolio-paid strong { color:#069d60; }
.portfolio-project-row .portfolio-ready strong { color:#d46e12; }
.portfolio-project-row .portfolio-preparing strong { color:#008eab; }
.portfolio-progress > div { display:flex;align-items:center;gap:5px;margin-top:5px; }
.portfolio-progress span { display:block;flex:1;height:7px;border-radius:8px;background:linear-gradient(90deg,#1dbc77 var(--progress),#deedf3 var(--progress)); }
.portfolio-progress strong { font-size:17px;color:#2e6681; }
.portfolio-row-actions { display:grid;gap:2px; }
.portfolio-row-actions .button { min-height:22px;font-size:16px;line-height:1;padding:2px 5px; }
.portfolio-pagination { display:flex;justify-content:flex-end;align-items:center;gap:9px;font-size:17px;line-height:1.1; }
.portfolio-pagination .button { min-height:24px;font-size:17px;padding:1px 8px; }
.portfolio-dashboard .reference-dashboard-feeds { margin:0;min-height:24px; }
.portfolio-dashboard .reference-dashboard-feeds summary { font-size:17px;padding:1px 10px;line-height:1.2; }
/* An expanded feed belongs in page flow, not a 24px hidden scroll container. */
.portfolio-dashboard > .reference-dashboard-feeds[open] { min-height:min-content; }
@media screen and (min-width:1280px) {
 .page-shell.portfolio-dashboard { margin-top:0;height:100%;min-height:650px;grid-template-rows:auto 100px minmax(250px,1fr) minmax(218px,1fr) auto;gap:7px; }
 .page-shell.portfolio-dashboard .page-heading { min-height:67px;padding:0 8px; }
 .portfolio-dashboard .heading-actions { flex:1;max-width:630px; }
 :is(.portfolio-dashboard,.detail-dashboard) .dashboard-status-card { height:100%;min-height:0;gap:8px;grid-template-columns:50px minmax(0,1fr) 15px; }
 :is(.portfolio-dashboard,.detail-dashboard) .dashboard-status-card > div > span { font-size:22px; }
 :is(.portfolio-dashboard,.detail-dashboard) .dashboard-status-card strong { font-size:clamp(23px,1.8vw,34px); }
 :is(.portfolio-dashboard,.detail-dashboard) .dashboard-status-card .metric-icon { width:50px;height:58px; }
 :is(.portfolio-dashboard,.detail-dashboard) .dashboard-status-card small { font-size:18px; }
 .portfolio-dashboard .fresh-dashboard-main,.portfolio-dashboard .fresh-dashboard-bottom { min-height:0;height:auto; }
 .portfolio-dashboard :is(.fresh-dashboard-main,.fresh-dashboard-bottom) .panel-header { min-height:37px;padding:3px 9px; }
 .portfolio-dashboard :is(.fresh-dashboard-main,.fresh-dashboard-bottom) .panel-header h2 { font-size:27px; }
 .portfolio-dashboard .reference-status-donut { width:min(100%,180px); }
 .portfolio-dashboard .reference-status-row { min-height:51px;font-size:20px;padding:4px 8px;line-height:1.05; }
 .portfolio-dashboard .fresh-recent-activity .data-table :is(th,td) { font-size:17px;line-height:1.1;padding:3px 5px; }
 .portfolio-dashboard .fresh-recent-activity .panel-body > small { font-size:15px;line-height:1; }
}
@media screen and (min-width:1280px) and (max-height:820px) {
 .page-shell.portfolio-dashboard { min-height:535px;grid-template-rows:auto 78px minmax(190px,1fr) minmax(183px,.8fr) auto;gap:5px; }
 .page-shell.portfolio-dashboard .page-heading { min-height:62px;padding-top:0;padding-bottom:0; }
 :is(.portfolio-dashboard,.detail-dashboard) .dashboard-status-card { padding:7px;grid-template-columns:39px minmax(0,1fr) 12px; }
 :is(.portfolio-dashboard,.detail-dashboard) .dashboard-status-card .metric-icon { width:39px;height:46px; }
 :is(.portfolio-dashboard,.detail-dashboard) .dashboard-status-card > div > span { font-size:20px; }
 :is(.portfolio-dashboard,.detail-dashboard) .dashboard-status-card strong { font-size:23px; }
 :is(.portfolio-dashboard,.detail-dashboard) .dashboard-status-card small { font-size:16px; }
 .portfolio-project-row { padding:1px 5px;gap:5px; }
 .portfolio-dashboard .fresh-dashboard-bottom .panel-body { padding-top:5px;padding-bottom:5px; }
 .portfolio-dashboard .fresh-dashboard-main .panel-body { padding-top:6px;padding-bottom:6px; }
 .portfolio-project-name img { width:34px;height:38px; }
 .portfolio-project-row strong { font-size:17px; }
 .portfolio-project-row small { font-size:14px; }
 .portfolio-dashboard .reference-status-donut { width:min(100%,128px); }
 .portfolio-dashboard .reference-status-row { min-height:39px;font-size:18px;padding:3px 8px; }
 .portfolio-dashboard .reference-status-row strong { font-size:24px;line-height:1; }
 .portfolio-dashboard .reference-status-row strong small { display:none; }
 .portfolio-dashboard .reference-status-note { margin-top:4px;font-size:14px;line-height:1; }
 .portfolio-dashboard .reference-status-donut strong { font-size:40px; }
 .portfolio-dashboard .reference-fiscal-head > div:first-child small { display:none; }
 .portfolio-dashboard .reference-fiscal-head { min-height:36px; }
 .portfolio-dashboard [data-monthly-chart] { min-height:70px; }
 .portfolio-dashboard .reference-status-layout { grid-template-columns:minmax(145px,.85fr) minmax(0,1.15fr);gap:8px; }
 .portfolio-dashboard .fresh-recent-activity .data-table :is(th,td) { font-size:16px;padding:1px 4px; }
}
@media screen and (max-width:1599px) and (min-width:1280px) {
 .portfolio-project-row { grid-template-columns:minmax(120px,1.3fr) repeat(3,minmax(84px,1fr)) auto; }
 .portfolio-progress { display:none; }
 .portfolio-project-name img { width:32px;height:38px; }
 .portfolio-tools { gap:5px;grid-template-columns:minmax(210px,1fr) auto; }
 .portfolio-tools > div { flex-direction:row;gap:5px; }
}
@media screen and (max-width:1279px) {
 .portfolio-tools { grid-template-columns:1fr; }
 .portfolio-dashboard .fresh-dashboard-bottom { grid-template-columns:1fr; }
 .portfolio-project-row { grid-template-columns:minmax(150px,1.3fr) repeat(3,minmax(95px,1fr)) auto; }
 .portfolio-progress { display:none; }
 .portfolio-dashboard [data-monthly-chart] { max-height:280px; }
}
@media screen and (max-width:700px) {
 .portfolio-project-row { grid-template-columns:repeat(2,minmax(0,1fr));padding:9px;gap:10px; }
 .portfolio-project-name { grid-column:1/-1; }
 .portfolio-row-actions { grid-column:1/-1;display:flex; }
 :is(.portfolio-dashboard,.detail-dashboard) .dashboard-status-card strong { white-space:normal; }
 .portfolio-dashboard .reference-status-layout { grid-template-columns:minmax(0,1fr); }
 .portfolio-dashboard .reference-status-donut { width:190px; }
 .portfolio-dashboard .reference-fiscal-head { grid-template-columns:1fr; }
 .portfolio-dashboard .reference-fiscal-total { grid-column:auto;justify-items:start; }
 .portfolio-dashboard [data-monthly-chart] { min-height:0; }
}
/* Keep the closed dashboard's exact fit; only reading feeds expands the page. */
.page-shell.portfolio-dashboard:has(> .reference-dashboard-feeds[open]) { height:auto; }

/* Reflow payment rows into labelled cards inside the narrow desktop panel. */
@media screen and (min-width:1280px) and (max-width:1919px) {
 .fresh-payment-list .data-table:has(tbody > tr[data-payment-id]) { display:block; }
 .fresh-payment-list .data-table:has(tbody > tr[data-payment-id]) thead { position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%); }
 .fresh-payment-list .data-table:has(tbody > tr[data-payment-id]) tbody { display:grid;gap:8px;padding:4px; }
 .fresh-payment-list tr[data-payment-id] { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding:8px;border:1px solid #cbe9ee;border-radius:8px;background:#fff; }
 .fresh-payment-list tr[data-payment-id] > td { display:block;min-width:0;border:0;white-space:normal;text-align:left;overflow-wrap:anywhere; }
 .fresh-payment-list tr[data-payment-id] > td:is(:first-child,:nth-child(4),:last-child) { grid-column:1/-1; }
 .fresh-payment-list tr[data-payment-id] > td:nth-child(2)::before { content:'ผู้รับเงิน / ประเภท';display:block;font-weight:700; }
 .fresh-payment-list tr[data-payment-id] > td:nth-child(3)::before { content:'จำนวนเงิน (บาท)';display:block;font-weight:700; }
 .fresh-payment-list tr[data-payment-id] > td:nth-child(4)::before { content:'สถานะ: ';font-weight:700; }
 .fresh-payment-list tr[data-payment-id] > td:last-child { display:flex;flex-wrap:wrap;align-items:center;gap:4px; }
 .fresh-payment-list tr[data-payment-id] :is(.button,.status-chip) { max-width:100%;white-space:normal;overflow-wrap:anywhere;box-sizing:border-box; }
}

/* Let all payment panes fit the available small-desktop content width. */
@media screen and (min-width:1280px) and (max-width:1365px) {
 .fresh-payment-workspace { grid-template-columns:minmax(0,1.06fr) minmax(0,1.14fr) minmax(0,1fr); }
 .fresh-payment-workspace > * { min-width:0; }
}

/* Let payment-list headings grow around the existing title and refresh action. */
@media screen and (min-width:1280px) {
 .fresh-payment-list > .panel { grid-template-rows:auto minmax(0,1fr); }
 .fresh-payment-list > .panel > .panel-header { flex-wrap:wrap; }
 .fresh-payment-list > .panel > .panel-header h2 { flex:1 1 170px;min-width:0;overflow-wrap:anywhere; }
 .fresh-payment-list > .panel > .panel-header > .button { max-width:100%; }
}

/* Keep the selectable ledger readable without hiding its status or actions. */
@media screen and (min-width:1280px) and (max-width:1919px) {
 .fresh-payment-list .data-table:has([data-payment-select]) { display:block; }
 .fresh-payment-list .data-table:has([data-payment-select]) thead { position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%); }
 .fresh-payment-list .data-table:has([data-payment-select]) tbody { display:grid;gap:8px;padding:4px; }
 .fresh-payment-list tr:has([data-payment-select]) { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding:8px;border:1px solid #cbe9ee;border-radius:8px;background:#fff; }
 .fresh-payment-list tr:has([data-payment-select]) > td { display:block;min-width:0;border:0;white-space:normal;text-align:left;overflow-wrap:anywhere; }
 .fresh-payment-list tr:has([data-payment-select]) > td:is(:first-child,:nth-child(2),:nth-child(3),:last-child) { grid-column:1/-1; }
 .fresh-payment-list tr:has([data-payment-select]) > td:nth-child(2)::before { content:'ผู้รับเงิน';display:block;font-weight:700; }
 .fresh-payment-list tr:has([data-payment-select]) > td:nth-child(3)::before { content:'แปลง';display:block;font-weight:700; }
 .fresh-payment-list tr:has([data-payment-select]) > td:nth-child(4)::before { content:'ยอดสุทธิ (บาท)';display:block;font-weight:700; }
 .fresh-payment-list tr:has([data-payment-select]) > td:nth-child(5)::before { content:'สถานะ';display:block;font-weight:700; }
 .fresh-payment-list tr:has([data-payment-select]) > td:last-child { display:flex;flex-wrap:wrap;align-items:center;gap:4px; }
 .fresh-payment-list tr:has([data-payment-select]) :is(.button,.status-chip,.fresh-payment-choice) { max-width:100%;white-space:normal;overflow-wrap:anywhere;box-sizing:border-box; }
}

/* Keep long account/parcel identifiers inside the existing payment panes. */
@media screen and (min-width:1280px) {
 .fresh-payment-parcel .panel-body > div { min-width:0;overflow-wrap:anywhere; }
}
@media screen and (min-width:1920px) {
 .fresh-payment-list .data-table:has(tbody > tr[data-payment-id]) { table-layout:fixed; }
 .fresh-payment-list .data-table:has(tbody > tr[data-payment-id]) :is(th,td) { white-space:normal;overflow-wrap:anywhere; }
 .fresh-payment-list .data-table:has(tbody > tr[data-payment-id]) th:nth-child(1) { width:31%; }
 .fresh-payment-list .data-table:has(tbody > tr[data-payment-id]) th:nth-child(2) { width:17%; }
 .fresh-payment-list .data-table:has(tbody > tr[data-payment-id]) th:nth-child(3) { width:18%; }
 .fresh-payment-list .data-table:has(tbody > tr[data-payment-id]) th:nth-child(4) { width:15%; }
 .fresh-payment-list .data-table:has(tbody > tr[data-payment-id]) th:nth-child(5) { width:19%; }
 .fresh-payment-list .data-table:has(tbody > tr[data-payment-id]) :is(.button,.status-chip,.fresh-payment-choice) { max-width:100%;white-space:normal;overflow-wrap:anywhere;box-sizing:border-box; }
}
