/* Polissage transversal — lisibilité terrain, gestes tactiles et accès mobile. */

.route-status{
  position:fixed;
  width:1px;
  height:1px;
  overflow:hidden;
  clip:rect(0 0 0 0);
  clip-path:inset(50%);
  margin:-1px;
  padding:0;
  border:0;
  white-space:nowrap;
}

.mobile-dock:empty{display:none}

:where(button,a,input,select,textarea,summary,[role="button"],[tabindex]):focus-visible{
  outline:3px solid var(--gold);
  outline-offset:3px;
}

:where(button,.button,.nav-item,.station-pill,summary,[role="button"],input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),select,textarea){min-height:44px}
:where(.menu-button,.sidebar-close,.dialog-head button,.native-dialog-head button){min-width:44px}

[inert]{pointer-events:none;user-select:none}
dialog{max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overscroll-behavior:contain}
dialog[open]{animation:oresto-dialog-in .16s ease-out}
dialog::backdrop{background:rgba(5,41,27,.66);backdrop-filter:blur(3px)}

@keyframes oresto-dialog-in{
  from{transform:translateY(8px);opacity:0}
  to{transform:translateY(0);opacity:1}
}

/* Les renseignements qui guident un geste en cuisine restent lisibles à distance. */
.service-ticket-head span,
.service-ticket-head small,
.service-status,
.service-ticket-context b,
.service-ticket-context span,
.service-line-heading em,
.service-ticket-line>em,
.service-line-notes span,
.service-line-notes small,
.service-components li,
.service-components li span,
.service-ticket-note,
.service-ticket-actions>span,
.service-ticket-actions>b,
.service-wait small,
.service-priority small,
.service-stations .station-pill,
.service-data-warning,
.service-history>summary,
.service-history>summary b,
.service-manual-line label>span,
.service-manual-line input,
.service-manual-line select,
.service-aggregate-group>header b,
.service-aggregate-group>header span,
.service-aggregate-row>div>small,
.service-aggregate-row>div>em,
.service-aggregate-row .service-aggregate-modifiers span,
.service-prep-task>header small,
.service-prep-task>p,
.service-linked-recipe span,
.service-linked-recipe summary,
.service-linked-recipe ul,
.service-linked-recipe ol,
.service-item-summary>span,
.service-item-summary b,
.service-ticket-identity h3 small,
.service-component-list .service-component-heading span,
.service-component-heading>em,
.team-work-card>header>div>span,
.team-priority,
.incident-severity,
.team-work-card dt,
.team-work-card dd,
.team-work-card>p,
.team-work-comment,
.team-proof-link,
.team-work-card>footer small,
.team-history summary,
.team-history>p,
.team-history li span,
.team-history li b,
.team-history li p,
.team-history li a{
  font-size:12px;
  line-height:1.4;
}

.team-priority,.incident-severity{font-size:12px!important}

.service-line-heading strong,
.service-ticket-line>strong,
.service-components li b,
.service-component-list .service-component-heading b,
.service-aggregate-row>span,
.service-aggregate-row>div>b,
.service-prep-task>header b,
.service-linked-recipe b{
  font-size:16px;
  line-height:1.3;
}

.service-item-action,
.service-ticket-actions .button,
.service-prep-task>footer .button,
.team-status-actions button{
  min-height:52px;
  font-size:12px;
  touch-action:manipulation;
}

.service-status{min-height:32px;padding:6px 9px}
.service-wait{min-width:82px;padding:7px 9px}
.service-wait b{font-size:13px!important}
.review-banner{font-size:12px;line-height:1.4}
.review-banner b{font-size:10px}

/* État honnête et lisible des connexions et des sources de données. */
.integration-overview{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-bottom:18px}
.integration-status-card{display:grid;align-content:start;gap:14px;min-height:240px;padding:20px;border:1px solid var(--line);border-top:5px solid var(--gold);border-radius:18px;background:var(--paper);box-shadow:var(--shadow-sm)}
.integration-status-card>header{display:grid;grid-template-columns:48px minmax(0,1fr) auto;gap:12px;align-items:center}
.integration-status-card>header>span{display:grid;width:48px;height:48px;place-items:center;border-radius:14px;background:var(--green-100);color:var(--green-800);font:700 22px 'Cormorant Garamond',serif}
.integration-status-card small,.integration-status-card h3{display:block;margin:0}
.integration-status-card small{color:var(--muted);font-size:11px;font-weight:800;letter-spacing:.06em;text-transform:uppercase}
.integration-status-card h3{margin-top:2px;color:var(--green-800);font:700 24px/1.05 'Cormorant Garamond',serif}
.integration-status-card em{padding:6px 9px;border-radius:999px;background:var(--gold-100);color:#735c18;font-size:11px;font-style:normal;font-weight:900;white-space:nowrap}
.integration-status-card>p{margin:0;color:var(--ink);font-size:14px;line-height:1.55}
.integration-status-card>ul{display:grid;gap:7px;margin:0;padding-left:20px;color:var(--muted);font-size:12px;line-height:1.45}
.integration-status-card>.button{width:max-content;margin-top:auto}
.integration-status-ready{border-top-color:#2d8b60}.integration-status-ready em{background:#e4f2e8;color:var(--green-800)}
.integration-status-warning{border-top-color:var(--orange)}.integration-status-warning em{background:#fff0d8;color:#8c4d12}
.integration-status-test,.integration-status-reference{border-top-color:#8a8375}
.integration-status-setup{border-top-color:var(--orange)}
.integration-status-manual{border-top-color:#5d8f79}
.integration-matrix{overflow:hidden}
.integration-matrix-table{overflow-x:auto}
.integration-matrix-table>[role="row"]{display:grid;grid-template-columns:minmax(210px,1.1fr) minmax(220px,1fr) minmax(240px,1.2fr);min-width:720px;border-top:1px solid var(--line)}
.integration-matrix-table>[role="row"]>*{padding:13px 16px;color:var(--ink);font-size:13px;line-height:1.4}
.integration-matrix-table>[role="row"]>*+*{border-left:1px solid var(--line)}
.integration-matrix-table b{color:var(--green-800)}
.integration-matrix-head{background:var(--green-800)}
.integration-matrix-head>*{color:white!important;font-size:11px!important;font-weight:900;letter-spacing:.05em;text-transform:uppercase}

@media(max-width:1180px){
  :root{--sidebar:264px}
  main{padding-inline:22px}
  .service-ticket-grid{gap:16px}
  .service-ticket{box-shadow:0 7px 24px rgba(8,56,37,.1)}
}

@media(max-width:820px){
  body:has(.mobile-dock:not(:empty)){padding-bottom:calc(76px + env(safe-area-inset-bottom))}

  .topbar{
    padding-top:max(10px,env(safe-area-inset-top));
    padding-right:max(15px,env(safe-area-inset-right));
    padding-left:max(15px,env(safe-area-inset-left));
  }

  .v2-auth-gate{
    padding-top:max(16px,env(safe-area-inset-top));
    padding-right:max(16px,env(safe-area-inset-right));
    padding-bottom:max(16px,env(safe-area-inset-bottom));
    padding-left:max(16px,env(safe-area-inset-left));
  }

  .sidebar{
    height:100dvh;
    padding-top:max(16px,env(safe-area-inset-top));
    padding-right:max(16px,env(safe-area-inset-right));
    padding-bottom:max(14px,env(safe-area-inset-bottom));
    padding-left:max(16px,env(safe-area-inset-left));
    visibility:hidden;
    pointer-events:none;
  }

  .sidebar.open{
    visibility:visible;
    pointer-events:auto;
  }

  main{
    padding-right:max(15px,env(safe-area-inset-right));
    padding-bottom:32px;
    padding-left:max(15px,env(safe-area-inset-left));
  }

  .mobile-dock:not(:empty){
    position:fixed;
    z-index:60;
    right:0;
    bottom:0;
    left:0;
    display:grid;
    grid-auto-columns:minmax(0,1fr);
    grid-auto-flow:column;
    gap:4px;
    padding:8px max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));
    border-top:1px solid var(--line);
    background:rgba(255,253,248,.96);
    box-shadow:0 -8px 24px rgba(8,56,37,.12);
    backdrop-filter:blur(16px);
  }

  .mobile-dock :is(button,a){
    display:grid;
    grid-template-rows:22px auto;
    min-width:0;
    min-height:52px;
    place-items:center;
    padding:6px;
    border:0;
    border-radius:12px;
    background:transparent;
    color:var(--green-800);
    font-size:12px;
    font-weight:800;
    text-align:center;
    text-decoration:none;
    touch-action:manipulation;
  }

  .mobile-dock :is(button,a)>span{font-size:18px;line-height:1}
  .mobile-dock :is(button,a)>small{overflow:hidden;max-width:100%;font-size:10px;line-height:1.1;text-overflow:ellipsis;white-space:nowrap}

  .mobile-dock :is(button,a)[aria-current="page"]{
    background:var(--green-800);
    color:white;
  }

  .assistant-shell,.service-assistant{grid-template-columns:1fr}
  .assistant-side{
    display:block;
    padding:16px;
    border-top:1px solid var(--line);
    border-left:0;
  }
  .assistant-side p,.prompt-list button{font-size:12px;line-height:1.45}
  .prompt-list{
    display:flex;
    gap:9px;
    overflow-x:auto;
    padding-bottom:4px;
    scroll-snap-type:x proximity;
  }
  .prompt-list button{
    min-height:48px;
    flex:0 0 min(260px,82vw);
    scroll-snap-align:start;
  }

  .native-dialog,
  .station-dialog,
  .account-dialog{
    width:calc(100% - 16px);
    max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px);
  }

  .native-dialog form,
  .station-dialog form{
    padding-bottom:max(16px,env(safe-area-inset-bottom));
  }

  .integration-overview{grid-template-columns:1fr}
  .integration-status-card{min-height:0;padding:17px}
  .integration-status-card>header{grid-template-columns:44px minmax(0,1fr)}
  .integration-status-card>header>span{width:44px;height:44px}
  .integration-status-card>header>em{grid-column:2;width:max-content}
}

@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto!important}
  *,*::before,*::after{
    scroll-behavior:auto!important;
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
    transition-duration:.01ms!important;
  }
}
