/* Approved mobile proposal: compact navy/teal workspace; wider screens retain their existing modes. */
.phone-section-tabs,.phone-related-links{display:none}
@media(max-width:599px){
  html{--phone-accent:#247764;--phone-navy:#163b53;--phone-surface:var(--ui-surface,#fff);--phone-ink:var(--ui-text,#172d3b);--phone-line:var(--ui-line,#d8e1e5)}
  html:is([data-theme=dark],[data-theme=meeting]){--phone-accent:var(--ui-accent-alt,#65cfb3);--phone-navy:var(--ui-surface-strong,#152c3d)}
  #app>header{display:flex!important;flex-direction:row!important;background:var(--phone-navy)!important;border:0!important;box-shadow:none!important;min-height:54px!important;padding:calc(7px + env(safe-area-inset-top)) 12px 7px!important;gap:8px!important}
  #app>header .mobile-page-heading strong{font-size:17px!important;letter-spacing:-.4px;color:#fff!important}.mobile-page-heading small{display:none!important}
  #app>header .mobile-page-heading{flex:1;min-width:0}#app>header #mobileMenuButton{display:flex!important;align-items:center;justify-content:center;border:0!important;background:transparent!important;color:white!important;min-width:32px;min-height:40px;padding:0!important;font-size:22px}
  #mobileHeaderLogout{display:none!important}#mobilePeriodButton{border:0!important;background:transparent!important;color:white!important}#mobileRequestButton{border:0!important;background:transparent!important}
  #panel{padding:10px 12px calc(85px + env(safe-area-inset-bottom))!important}#panel>.panel{padding:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;min-width:0;background:transparent!important}
  #mobileBottomNav{display:flex!important;gap:6px!important;padding:6px 10px calc(6px + env(safe-area-inset-bottom))!important;background:var(--phone-surface)!important;border-top:1px solid var(--phone-line)!important;box-shadow:none!important}
  #mobileBottomNav button{flex:1;min-width:0;min-height:48px!important;gap:3px!important;border-radius:6px!important;color:var(--phone-ink)!important;background:transparent!important;box-shadow:none!important}
  #mobileBottomNav button.active{background:#247764!important;color:#fff!important}#mobileBottomNav button.active img{filter:brightness(0) invert(1)!important}#mobileBottomNav b{font-size:11px!important}#mobileBottomNav img{width:20px!important;height:20px!important}
  #mobileBottomNav button[hidden],#mobileBottomNav[hidden]{display:none!important}
  #tabs{background:var(--phone-surface)!important}#tabs .mobile-nav-head{background:var(--phone-navy)!important;color:white!important}
  #megaMobileGroups .mega-mobile-group{border:1px solid var(--phone-line);border-radius:6px;margin:8px 0;overflow:hidden}#megaMobileGroups summary{background:var(--ui-surface-soft,#f5f7f8);font-size:14px;font-weight:750;padding:14px}#megaMobileGroups .mega-link{min-height:48px;border-bottom:1px solid var(--phone-line)}#megaMobileGroups .mega-link.is-current{background:color-mix(in srgb,var(--phone-surface) 90%,#247764);color:var(--phone-accent)}
  #panel :is(input,select,textarea){font-size:16px}#panel button{min-height:40px}#panel :is(.filterbar,.toolbar){gap:7px}#panel h2{font-size:20px}
  .phone-section-tabs{display:flex;gap:0;overflow:auto;max-width:100%;margin:0 0 12px;border:1px solid var(--phone-line);border-radius:6px;background:var(--phone-surface);scrollbar-width:thin}
  .phone-section-tabs button{flex:1;white-space:nowrap;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;padding:9px 12px!important;min-height:42px!important;font-size:12px!important;color:var(--phone-ink)!important}
  .phone-section-tabs button[aria-current=page]{background:#247764!important;color:white!important;font-weight:750}
  .phone-related-links{display:grid;border:1px solid var(--phone-line);border-radius:6px;overflow:hidden;margin:16px 0;background:var(--phone-surface)}
  .phone-related-links button{display:flex;gap:10px;align-items:center;justify-content:space-between;width:100%;border:0;border-bottom:1px solid var(--phone-line);border-radius:0;box-shadow:none;padding:12px;background:transparent;color:var(--phone-ink);text-align:left;font-size:14px;font-weight:650;min-height:46px}.phone-related-links button:last-child{border-bottom:0}.phone-related-links img{width:18px;height:18px}.phone-related-links button span{flex:1}
  .phone-related-links .phone-upload-link{background:#247764;color:white}
  /* Performance: two concise totals followed by real existing comparison tables. */
  .sales-briefing .sb-heading{padding:0 0 10px!important;margin:0}.sales-briefing .sb-controls{width:100%}.sales-briefing .sb-heading p{display:none}
  .sales-briefing .sb-kpis{grid-template-columns:1fr 1fr!important;gap:8px;margin:0 0 12px}.sales-briefing .sb-kpis article{padding:12px!important;border-radius:6px!important;box-shadow:none!important}.sales-briefing .sb-kpis article::before{display:none}.sales-briefing .sb-kpi-top{margin-bottom:6px;gap:4px}.sales-briefing .sb-kpi-icon{width:22px;height:22px;background:transparent}.sales-briefing .sb-kpi-icon img{width:18px;height:18px}.sales-briefing .sb-kpi-label{font-size:12px!important;white-space:normal}.sales-briefing .sb-kpi-value{font-size:clamp(18px,5.5vw,23px)!important;margin:0 0 8px}.sales-briefing .sb-kpi-period{font-size:10px!important;padding-top:6px}.sales-briefing .sb-kpi-comparison{font-size:10px!important;gap:4px;margin-bottom:6px}.sales-briefing .sb-kpi-comparison .sb-ratio{font-size:11px!important}
  .sales-briefing .sb-section{padding:12px!important;border-radius:6px!important;margin-bottom:12px}.sales-briefing .sb-section h3{font-size:16px!important}.sales-briefing .sb-table :is(th,td){padding:9px 5px!important;font-size:12px!important}.sales-briefing .sb-section-icon{width:24px;height:24px}
  /* Sales retains its expanded edit controls and shows dense rows by default. */
  #panel .sales-data-table:not(.phone-table-view) tbody{gap:0!important;background:var(--phone-surface)}
  #panel .sales-data-table:not(.phone-table-view) tr.mobile-collapsible:not(.mobile-expanded){border:0!important;border-bottom:1px solid var(--phone-line)!important;border-radius:0!important;padding:11px 10px!important;margin:0!important;box-shadow:none!important;gap:4px 8px!important}
  #panel .sales-data-table:not(.phone-table-view) tr.mobile-collapsible:not(.mobile-expanded)>td[data-label=일자]{grid-row:1!important;font-size:11px!important}#panel .sales-data-table:not(.phone-table-view) tr.mobile-collapsible:not(.mobile-expanded)>td[data-label=거래처]{grid-row:2!important;font-size:15px!important}#panel .sales-data-table:not(.phone-table-view) tr.mobile-collapsible:not(.mobile-expanded)>td[data-label=품목]{grid-row:3!important;font-size:12px!important}#panel .sales-data-table:not(.phone-table-view) tr.mobile-collapsible:not(.mobile-expanded)>td[data-label=공급가액]{grid-row:1/3!important;font-size:17px!important}#panel .sales-data-table:not(.phone-table-view) .mobile-row-toggle{min-height:32px!important;padding:0!important}
  .phone-sales-tools{border:0!important;padding:0!important;background:transparent!important}.phone-sales-search{gap:7px}.phone-sales-search input{border-radius:6px!important}.phone-view-switch{margin:8px 0}.mobile-sales-review{border-radius:5px!important;background:var(--ui-surface-soft,#edf2f5)!important}
  /* Reuse real settlement/support/market controls, with the same visual rhythm. */
  html[data-workspace=costs] #panel .mobile-data-table tr,html[data-workspace=deductions] #panel .mobile-data-table tr,html[data-workspace=expenses] #panel .mobile-data-table tr{border-radius:4px!important;box-shadow:none!important;margin:0 0 6px!important;padding:10px!important}
  html[data-workspace=costs] #panel .tall tr.mobile-collapsible:not(.mobile-expanded){display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:5px 10px!important;border:0!important;border-bottom:1px solid var(--phone-line)!important;border-radius:0!important}
  html[data-workspace=costs] #panel .tall tr.mobile-collapsible:not(.mobile-expanded)>td{height:auto!important;display:none!important;padding:0!important;border:0!important}
  html[data-workspace=costs] #panel .tall tr.mobile-collapsible:not(.mobile-expanded)>td:is([data-label=품목],[data-label=상태],[data-label=생산원가],.mobile-row-controls){display:block!important}
  html[data-workspace=costs] #panel .tall tr.mobile-collapsible:not(.mobile-expanded)>td::before{display:none!important}
  html[data-workspace=costs] #panel .tall tr:not(.mobile-expanded)>td[data-label=품목]{grid-column:1;grid-row:1;font-size:15px;font-weight:700}
  html[data-workspace=costs] #panel .tall tr:not(.mobile-expanded)>td[data-label=상태]{grid-column:1;grid-row:2;font-size:11px}
  html[data-workspace=costs] #panel .tall tr:not(.mobile-expanded)>td[data-label=생산원가]{grid-column:2;grid-row:1;font-weight:750;text-align:right}
  html[data-workspace=costs] #panel .tall tr:not(.mobile-expanded)>td[data-label=생산원가] .mobile-cell-value{display:none}
  html[data-workspace=costs] #panel .tall tr:not(.mobile-expanded)>td.mobile-row-controls{grid-column:2;grid-row:2}
  .mobile-expanded .phone-cost-value{display:none}.phone-schedule-editor>summary{background:#247764!important;color:white!important;text-align:center}.support-calendar-heading h2{font-size:15px!important}.support-calendar-heading p{font-size:11px!important}.mobile-agenda-list{border-radius:6px!important;box-shadow:none!important}
  #panel .support-nav,#panel .support-home-head{display:none}.support-header{margin-bottom:10px}.support-calendar,.support-agenda,.knowledge-list,.request-list{border-radius:6px!important;box-shadow:none!important}
  .mi .mi-head{padding:0 0 8px!important}.mi .mi-brand{display:none}.mi .mi-actions{display:flex;gap:6px}.mi .mi-actions button{font-size:11px!important;padding:6px 9px!important}.mi .mi-tabs{display:flex;flex-wrap:nowrap;overflow:auto;gap:0;border:1px solid var(--phone-line);border-radius:6px}.mi .mi-tabs button{font-size:12px!important;padding:9px!important;border-radius:0!important;min-height:42px!important;white-space:nowrap}.mi .mi-tabs button.active{background:#247764!important;color:white!important}.mi .mi-card{padding:12px!important;border-radius:6px!important;box-shadow:none!important}.mi .mi-card strong{font-size:22px!important}.mi .mi-update{font-size:11px!important;margin:8px 0!important}
  /* Receivables: the same table becomes a readable list, without duplicated editors. */
  .ar-page{display:flex;flex-direction:column;padding:0 0 20px!important;--ar-text:var(--phone-ink);--ar-line:var(--phone-line);gap:0}
  .ar-heading{order:0;margin:0 0 8px!important;align-items:center}.ar-heading>div:first-child{display:none}.ar-asof{display:flex;gap:6px;align-items:center;font-size:11px!important;text-align:left}.ar-asof strong{font-size:11px!important;margin:0!important}
  .ar-workspace-tabs{display:flex;order:0;margin:0 0 10px;border:1px solid var(--ar-line);border-radius:6px;overflow:hidden}.ar-workspace-tabs button{flex:1;border:0;border-radius:0;padding:7px;font-size:12px;min-height:36px!important}
  .ar-mobile-kpis{display:grid;order:1;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:12px}.ar-mobile-kpis>div,.ar-mobile-kpis>button{background:var(--ar-bg);border:1px solid var(--ar-line);border-radius:6px;padding:11px 10px;text-align:left;min-width:0}.ar-mobile-kpis span{display:block;font-size:12px;font-weight:600;color:var(--ar-text)}.ar-mobile-kpis strong{display:block;font-size:clamp(17px,5vw,23px);letter-spacing:-.7px;margin-top:7px;overflow-wrap:anywhere;line-height:1.2;font-variant-numeric:tabular-nums}.ar-mobile-kpis small{font-size:11px;margin-left:3px}
  .ar-cards{display:none!important}.ar-filter{order:2;grid-template-columns:minmax(0,1fr) auto auto!important;border:0!important;background:transparent!important;padding:0!important;gap:6px!important;margin-bottom:6px}.ar-filter .ar-search-field{grid-column:1!important;font-size:0!important;gap:0!important}.ar-filter .ar-search-field input{height:42px;font-size:14px!important}.ar-filter button{height:42px;padding:7px 9px;font-size:12px}.ar-filter label{grid-column:auto!important}
  .ar-primary-filters{order:3;display:flex;flex-wrap:nowrap;gap:5px;overflow:auto;margin:3px 0 8px;padding-bottom:2px}.ar-primary-filters button{flex:1;white-space:nowrap;font-size:11px;padding:6px 9px;min-height:36px!important;border-radius:18px}
  .ar-sort-tools{order:4;display:grid;grid-template-columns:1fr 1fr auto;gap:6px;margin:0 0 6px}.ar-sort-tools label{min-width:0;font-size:0;gap:0}.ar-sort-tools select{font-size:12px!important;padding:7px;min-height:40px}.ar-sort-tools #arSortDirection{font-size:11px;padding:6px;white-space:nowrap}.ar-sort-tools label:has(#arPlanFilter){grid-column:1/-1}.ar-sort-tools .ar-owner-field{grid-column:1;grid-row:1}.ar-sort-tools label:has(#arSort){grid-column:2;grid-row:1}.ar-sort-tools #arSortDirection{grid-column:3;grid-row:1}
  .ar-extra-filters{order:5;margin:0 0 6px!important}.ar-extra-filters>summary{font-size:11px;padding:7px 0!important}.ar-extra-filters .ar-source-field{margin-bottom:8px}.ar-extra-filters .ar-chips{flex-wrap:wrap;overflow:visible}.ar-extra-filters .ar-chips button{font-size:11px;min-height:36px!important}
  .ar-result{order:6;flex-direction:row;gap:6px;font-size:10px;margin:3px 0 7px}.ar-result span{text-align:right;overflow-wrap:anywhere}
  .ar-list{order:7;border:0;border-top:1px solid var(--ar-line);border-radius:0;container-type:inline-size;overflow:visible}.ar-list>.ar-scroll{overflow:visible}.ar-page #arTable,.ar-page #arTable>tbody{display:block;white-space:normal;width:100%}.ar-page #arTable>thead{display:none}
  .ar-page #arTable .ar-customer-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 8px;padding:12px 0;border-bottom:1px solid var(--ar-line);background:var(--ar-bg)}
  .ar-page #arTable .ar-customer-row>th,.ar-page #arTable .ar-customer-row>td{height:auto!important;padding:0;border:0;min-width:0;max-width:none;font-size:12px}
  .ar-page #arTable .ar-customer-row>th{grid-column:1;grid-row:1;text-align:left;min-width:0!important}.ar-page #arTable .ar-customer-row>th>small{font-size:10px;line-height:1.5}.ar-page #arTable .ar-customer-row>th>button{font-size:16px;line-height:1.4;min-height:30px!important;padding:2px 0;white-space:normal;overflow-wrap:anywhere}
  .ar-page #arTable .ar-expand-hint{display:none}.ar-page #arTable .ar-balance{grid-column:2;grid-row:1;font-size:17px;font-weight:750;white-space:nowrap;padding-top:16px}.ar-mobile-only{display:inline}
  .ar-page #arTable .ar-bucket{grid-column:1/-1;text-align:left;display:flex;gap:8px;align-items:center;line-height:1.5}.ar-bucket::before{content:attr(data-label);font-size:10px;border-radius:4px;background:var(--ar-tint);padding:2px 6px;color:var(--ar-muted)}.ar-bucket.ar-aged::before{background:color-mix(in srgb,var(--ar-bg) 83%,#eb8585);color:#a63838}.ar-page #arTable .ar-zero-bucket{display:none}
  .ar-page #arTable .ar-status-cell{grid-column:1/-1;display:flex;gap:5px}.ar-status-cell .ar-badge{margin:0}.ar-page #arTable .ar-plan-cell{grid-column:1/-1;min-width:0;max-width:100%;padding-top:2px}.ar-plan-flags{margin:0}.ar-plan-summary{font-size:12px;line-height:1.6}.ar-plan-summary>span{display:inline;font-size:11px}.ar-plan-summary p{margin-top:3px}.ar-plan-summary p b{font-size:10px}.ar-page .ar-missing{max-width:none}
  .ar-page #arTable>.ar-detail-row,.ar-page #arTable>tbody>.ar-detail-row{display:block}.ar-page #arTable .ar-detail-row>td{display:block;height:auto!important;padding:0}.ar-detail-row .ar-detail{position:static;width:100%;max-width:100%;margin:0;padding:12px!important;border-top:2px solid #247764;background:var(--ar-tint);display:flex;flex-direction:column;gap:8px}
  .ar-detail-title{order:0}.ar-detail-title h3{font-size:16px}.ar-detail-title b{font-size:17px}.ar-detail-grid{order:1;display:flex;flex-direction:column;margin:0;gap:10px}.ar-detail-grid h4{margin:8px 0 12px;font-size:16px}.ar-detail-grid label{font-size:12px;gap:5px;margin-bottom:10px}.ar-detail-grid input,.ar-detail-grid select,.ar-detail-grid textarea{font-size:16px!important;padding:8px;background:var(--ar-bg)}.ar-form-grid{grid-template-columns:1fr}.ar-detail-totals{order:5;margin:0}.ar-detail .ar-source{order:6}.ar-detail>.ar-exclusion{order:7}.ar-detail>p{order:4;margin:4px 0;font-size:11px}.ar-plan-actions button{font-size:13px;min-height:44px}.ar-inline-review .ar-review-actions button{min-height:42px}.ar-inline-review label{font-size:11px}.ar-inline-review textarea{font-size:14px!important}
  .ar-page #arTable .ar-employee-cell{grid-column:1/-1;grid-row:2;display:flex;gap:8px;align-items:baseline;color:var(--ar-muted);font-size:11px;min-width:0;max-width:100%}.ar-page #arTable .ar-employee-cell::before{content:attr(data-label);flex:none;font-size:10px;font-weight:650}.ar-page #arTable .ar-customer-row>th>button{font-size:15px;min-height:24px!important}.ar-page #arTable .ar-balance{padding-top:2px}.ar-page #arTable .ar-customer-row{padding:9px 0;gap:3px 8px}
  .ar-customer-row:not(.ar-settled) .ar-status-cell .ar-none,.ar-status-cell .ar-pending{display:none}.ar-customer-row:not(.ar-settled) .ar-status-cell:not(:has(.ar-partial,.ar-recorded,.ar-confirmed,.ar-revision)){display:none!important}.ar-plan-cell>.ar-guidance{display:none}.ar-plan-flags{display:flex;flex-wrap:wrap;gap:5px;align-items:center}.ar-plan-flags .ar-badge{margin:0}
  .ar-extra-filters>label{padding:8px}.ar-extra-filters .ar-chips{padding:8px}.ar-extra-filters>summary{padding:5px 0!important}.ar-detail-grid .ar-plan-editor label{display:grid;grid-template-columns:100px minmax(0,1fr);align-items:center;gap:8px;margin-bottom:8px}.ar-plan-editor .ar-field-required{left:90px;top:10px}.ar-plan-editor .ar-form-grid{gap:0}
  .ar-pagination{order:8}.ar-page>.ar-guidance{order:9;margin:5px 0;font-size:10px}.ar-page>.ar-warning{order:2;font-size:11px}.ar-staff{order:10}.ar-admin-area{order:12}
  .ar-page :is(input,select){min-height:40px!important}.ar-inline-review textarea{min-height:64px!important}.ar-plan-editor textarea{min-height:68px!important}.ar-page #arReview textarea{min-height:90px!important}
  .ar-page[data-manage=false] .ar-admin-area{display:none}.ar-page[data-manage=true]>:not(.ar-heading):not(.ar-workspace-tabs):not(.ar-admin-area){display:none!important}.ar-page[data-manage=true] .ar-admin-area{display:block;order:1}.ar-admin-area .ar-manage,.ar-admin-area .ar-updates{border-radius:6px}.ar-admin-area .ar-manage>summary{background:#247764;color:#fff}.ar-admin-links{display:grid}.ar-admin-links button{background:var(--ar-bg);padding:14px;font-weight:650}.ar-admin-links span{font-weight:400;font-size:11px}
}
@media(prefers-reduced-motion:reduce){.ar-page *,.phone-section-tabs *{scroll-behavior:auto!important;transition:none!important}}
html:is([data-theme=dark],[data-theme=meeting]) .ar-submitted{color:#82dec4}
html:is([data-theme=dark],[data-theme=meeting]) :is(.ar-required,.ar-missing,.ar-needs_update,.ar-field-required){color:#ffbd93}
