/* Touch layouts share the same data, permissions and actions as desktop. */
.production-filters {display:grid;grid-template-columns:1fr 1fr;gap:16px;padding:0 22px 22px}
.production-periods {grid-column:1/-1;display:flex;gap:8px;flex-wrap:wrap}
.production-work-cards {display:none}
.production-work-card {padding:20px;border:1px solid var(--line);border-radius:12px;background:white;min-width:0}
.production-work-card.is-late {border-left:4px solid #d46a47}
.work-card-top {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;font-size:14px}
.production-work-card h3 {font-size:18px;margin:16px 0 5px;overflow-wrap:anywhere}
.work-card-order {font-size:14px;color:#58708c;overflow-wrap:anywhere}
.production-work-card dl {display:grid;gap:12px;margin:18px 0}
.production-work-card dt {font-size:13px;color:#647894;margin-bottom:3px}
.production-work-card dd {font-size:15px;margin:0;overflow-wrap:anywhere}
.production-work-card .button {width:100%;min-height:48px}
.mobile-finance-summary {margin-bottom:22px}
.mobile-finance-summary>summary {padding:15px 0;cursor:pointer;font-weight:600;display:flex;justify-content:space-between;gap:12px}
.mobile-finance-summary>summary::after {content:'⌄'}
.mobile-finance-summary[open]>summary::after {content:'⌃'}
.mobile-finance-summary .order-settlement {margin-top:8px}
.mobile-finance-summary>summary span {font-weight:400;color:#536b86;font-size:14px}
.connection-strip {position:sticky;top:0;z-index:20;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:7px 24px;min-height:36px;background:#f5f8fc;border-bottom:1px solid var(--line);font-size:13px;color:#536b86}
.connection-strip.is-offline {background:#fff4df;color:#845011}
.connection-strip.has-draft {background:#edf4ff;color:#255a99}
.connection-strip .link-button {font-size:13px;min-height:32px;flex:none}
.connection-strip [hidden] {display:none}
.metric-value,.settlement-value strong,.finance-summary strong,.analytics-total>strong {overflow-wrap:normal;word-break:normal}
.chat-back {display:none}
.chat-connection {display:block;clear:both;padding-top:5px;font-size:12px;color:#536b86}
.chat-connection.is-offline {color:#845011}
#photo-review-dialog[open],#device-drafts-dialog[open] {display:flex;flex-direction:column;overflow:hidden}
#photo-review-dialog>.drawer-header,#photo-review-dialog>.drawer-footer,#device-drafts-dialog>.drawer-header {flex-shrink:0}
#photo-preview-canvas {display:block;width:100%;max-height:50dvh;object-fit:contain;background:#e6edf5;border-radius:10px;margin:16px 0}
#photo-preview-canvas[hidden] {display:none}
.photo-review-controls {display:flex;flex-wrap:wrap;gap:10px;margin-bottom:18px}
.photo-review-controls[hidden] {display:none}
.photo-review-controls details {flex:1 1 100%;padding:12px;border:1px solid var(--line);border-radius:8px}
.photo-review-controls summary {cursor:pointer;font-size:15px;min-height:32px}
.photo-review-controls label {display:flex;align-items:center;gap:14px;font-size:14px;justify-content:space-between}
.photo-review-controls input {width:70%;height:44px;accent-color:#3478f6}
.device-draft-row {padding:18px 0;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap}
.device-draft-row strong {font-size:16px;overflow-wrap:anywhere}
.device-draft-row p {font-size:13px;color:#617893;margin:7px 0}
.device-conflict-field {border-bottom:1px solid var(--line);padding:18px 0}
.device-conflict-field pre,.device-draft-text {white-space:pre-wrap;overflow-wrap:anywhere;font:14px/1.6 inherit;padding:12px;background:#f3f6fb}
.device-conflict-field p {font-size:13px;color:#617893;margin:10px 0}
.analytics-point-slider {display:flex;align-items:center;gap:16px;font-size:14px;margin-top:12px;color:#536b86}
.analytics-point-slider input {flex:1;min-width:0;height:44px;accent-color:#3478f6}
.analytics-point.selected .analytics-point-dot {stroke:#162e53;stroke-width:3;r:6px}
.analytics-quick-periods {display:flex;flex-wrap:wrap;gap:8px;margin-bottom:16px}
.analytics-metric-label {min-width:180px;font-size:14px;color:#536b86}
.analytics-metric-label>span {display:block;margin-bottom:5px}
.analytics-metric-label select {width:100%;min-height:44px}
@media(min-width:901px) and (max-width:1200px) {
  .sidebar {display:flex;transform:translateX(-105%);width:300px;z-index:45;visibility:hidden;box-shadow:12px 0 44px #15243b30}
  .sidebar.open {transform:translateX(0);visibility:visible}
  .sidebar-close {display:inline-flex;position:absolute;right:10px;top:10px;color:#cad8ec}
  .sidebar-scrim {display:block;position:fixed;inset:0;z-index:40;background:#10203880;width:100%;height:100%}
  .main-shell {margin-left:0}
  .mobile-toggle {display:inline-flex}
  body.nav-open {overflow:hidden}
  #toast {left:50%}
}
@media(max-width:1100px) {
  .production-work-table {display:none}
  .production-work-cards {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;padding:0 20px 20px}
}
@media(max-width:640px) {
  :root {scroll-padding-top:100px}
  .button,.icon-button,.link-button,.metric-chart-button,.profile-small {min-height:44px}
  .icon-button,.profile-small,.metric-chart-button {min-width:44px}
  .control,.field .control,.stage-fields .field .control,.entry-card .control,.stage-card-top input {min-height:48px;font-size:16px}
  .status-filter {min-height:44px}
  .assignee-chip {display:inline-flex;align-items:center;min-height:44px;font-size:14px;padding:8px 12px}
  .assignee-chip input {width:18px;height:18px;margin-right:8px}
  input[type=date] {min-width:0;max-width:100%;appearance:none;-webkit-appearance:none;display:block}
  .connection-strip {padding:4px 14px;font-size:12px;gap:7px;flex-wrap:wrap}
  .connection-strip .link-button {min-height:36px;font-size:12px}
  #install-app-button {margin-left:auto;max-width:90px;text-align:right}
  .connection-strip:has(#device-drafts-button:not([hidden])) #connection-text {flex-basis:100%}
  .heading {margin-bottom:16px}
  .heading .eyebrow {display:none}
  .metrics {grid-template-columns:1fr;gap:10px}
  .metric,.metric.accent {min-height:0;padding:17px 20px}
  .metric-top {min-height:32px;margin-bottom:8px}
  .metric-value {font-size:clamp(1.2rem,5.5vw,1.8rem);white-space:nowrap;letter-spacing:-.4px}
  .metric-caption {margin-top:7px;font-size:13px}
  .production-work-cards {grid-template-columns:1fr;padding:0 14px 14px}
  body[data-view=production] .heading>div>p {display:none}
  body[data-view=production] .heading {align-items:center;gap:10px}
  body[data-view=production] .heading h1 {font-size:24px}
  body[data-view=production] .heading .button {font-size:12px;min-height:44px}
  body[data-view=production] .paused-work-banner:not(.has-pauses) {display:none}
  .production-filters {padding:0 14px 18px;gap:12px;grid-template-columns:1fr}
  .production-periods {gap:7px}
  .production-periods .status-filter {min-height:44px;flex:1 1 calc(50% - 8px);justify-content:center}
  .drawer-tabs {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;padding:0 9px}
  .drawer-tab {font-size:12px;white-space:normal;min-height:52px;padding:10px 3px;text-align:center}
  .drawer-header {padding:16px 18px}
  .drawer-footer {padding-bottom:max(12px,env(safe-area-inset-bottom));flex-wrap:wrap;gap:6px}
  .drawer-footer small {display:block;font-size:12px;width:100%}
  .drawer-footer .button {min-height:46px}
  .entry-card,.entry-card.expense {grid-template-columns:minmax(0,1fr) 44px;gap:14px 8px;padding:16px}
  .entry-card>label {grid-column:1/-1}
  .entry-card>label:first-child {grid-column:1}
  .entry-card .entry-delete {grid-column:2;grid-row:1;width:44px;align-self:end}
  .entry-card .control {width:100%;min-height:48px}
  .finance-section-actions {width:100%;flex-wrap:wrap;gap:8px}
  .finance-section-actions .button {flex:1;justify-content:center;min-height:46px}
  .finance-summary,.customer-settlement-summary,.analytics-summary {grid-template-columns:1fr}
  .finance-summary .net-profit {grid-column:auto;flex-wrap:wrap;gap:8px}
  .mobile-finance-summary>summary {align-items:center;padding:16px;background:#f3f7fd;border:1px solid var(--line);border-radius:10px}
  .mobile-finance-summary>summary span {font-size:12px}
  .analytics-filters .control {font-size:16px}
  .analytics-chart {min-width:0!important;width:100%}
  .analytics-chart-scroll {overflow:visible}
  .analytics-metric-label {width:100%}
  .analytics-grid text,.analytics-axis {font-size:16px}
  .chat-layout {height:auto;min-height:0}
  .chat-layout>aside {max-height:none;overflow:visible;width:100%}
  .chat-layout:not(.is-thread)>.chat-thread {display:none}
  .chat-layout.is-thread>.chat-thread {display:flex;position:fixed;left:0;right:0;top:var(--viewport-top,0px);height:var(--viewport-height,100dvh);max-height:none;min-height:0;z-index:35;overscroll-behavior:contain;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}
  body.mobile-chat-open {overflow:hidden}
  .chat-back {display:inline-flex;float:left;margin-right:12px;min-height:44px}
  .chat-in-order .chat-back {display:none}
  .chat-thread-header {padding:12px 14px;flex:none}
  .chat-thread-header h2 {font-size:17px;margin-bottom:4px}
  .chat-thread-header>span {font-size:12px}
  .chat-messages {min-height:60px;overscroll-behavior:contain}
  .chat-compose {padding:10px 12px;max-height:55vh;overflow:auto}
  .chat-compose textarea {min-height:48px;height:68px;max-height:120px;resize:none}
  .chat-compose-actions {gap:8px;margin-top:8px}
  .chat-compose-actions .button {min-height:44px;padding:8px 10px}
  .chat-selected-file .icon-button {width:36px;min-width:36px;min-height:36px}
  #editor:has(.chat-in-order) .drawer-body {display:flex;flex-direction:column;min-height:0}
  #editor:has(.chat-in-order) .chat-privacy,#editor:has(.chat-in-order) .chat-hint {display:none}
  #editor .chat-in-order {flex:1;min-height:200px;height:auto;max-height:none}
  .app-footer {padding-bottom:max(18px,env(safe-area-inset-bottom))}
}
