/* Shared details; mobile rules are loaded after the main application styles. */
.brand-mark{display:contents}
.brand img,.partners img{background:transparent;border:0;outline:0;box-shadow:none;border-radius:0}
.mobile-theme-toggle,.action-label-mobile{display:none}
.field .field-heading>small,.field>small{font-size:.74rem;font-weight:400;line-height:1.35;color:var(--muted)}
.add-appointment-action>span{color:inherit}
.nav .nav-count.notice-count,.userstrip .nav-count.notice-count{background:#b63244;color:#fff;box-shadow:0 0 0 2px color-mix(in srgb,var(--surface) 88%,#b63244)}
:root[data-theme=dark] .nav .nav-count.notice-count,:root[data-theme=dark] .userstrip .nav-count.notice-count{background:#e16a76;color:#29171a;box-shadow:0 0 0 2px color-mix(in srgb,var(--surface) 88%,#e16a76)}
.row-icon{width:15px;height:15px;flex:0 0 15px;color:var(--muted)}
.history-patient strong,.history-procedure{overflow-wrap:anywhere}
.history-patient .row-icon{grid-row:1/3}
.history-patient:has(.row-icon){display:grid;grid-template-columns:15px minmax(0,1fr);gap:3px 7px}
.history-patient:has(.row-icon) small{grid-column:2}
.history-procedure{display:flex;align-items:center;gap:7px;min-width:0}
.nav-home-shortcut{display:inline-flex!important;align-items:center;gap:5px}

@media screen and (max-width:700px){
  html{width:100%;-webkit-text-size-adjust:100%;text-size-adjust:100%}
  body{margin:0;min-width:0}
  .shell,.workspace,.layout,.main{width:100%;min-width:0;max-width:100%}

  /* The three institutional marks share one compact, fixed-height row. */
  .top{display:block;height:auto;min-height:0;margin:0;padding:7px 12px;background:var(--surface)}
  .top-inner{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;min-height:62px;width:100%}
  .brand{display:grid;grid-column:auto;grid-template-columns:clamp(62px,19vw,86px) minmax(0,1fr);align-items:center;gap:8px;width:auto;min-width:0}
  .brand .brand-mark{display:block;position:relative;width:100%;height:60px;overflow:hidden}
  .brand .brand-mark img{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:145.5%;height:auto;max-width:none;min-width:0;object-fit:contain;padding:0;margin:0;border:0;border-radius:0}
  .brand-copy{min-width:0}
  .brand-title{font-size:clamp(12px,3.7vw,16px);line-height:1.15;letter-spacing:-.025em;white-space:nowrap;color:var(--text)}
  .top .sub{display:none}
  .partners{display:flex!important;grid-column:auto;align-items:center;justify-content:flex-end;gap:6px;width:auto;min-height:0;margin:0;padding:0;border:0;background:none;box-shadow:none}
  .partners::before{display:none}
  .partners img,.partners .heliopolis-logo{width:clamp(36px,11.2vw,48px);max-width:none;height:52px;padding:0;margin:0;object-fit:contain}
  .partners .gov-logo{width:clamp(50px,16.5vw,70px);max-width:none;height:48px;transform:scale(1.25)}

  /* Theme shares the identity row after sign-in; it has no separate row. */
  .signed-in .theme-bar{display:none}
  .theme-bar{padding:4px 12px 0;min-height:0}
  .theme-bar .theme-toggle{min-height:34px;padding:6px 10px;font-size:12px;line-height:1.2}
  .workspace{padding:10px 12px 24px}
  .nav{display:flex;flex-wrap:nowrap;align-items:center;gap:3px;padding:4px;margin:0 0 9px;border-radius:12px;max-width:100%;overflow-x:auto;scrollbar-width:none;overscroll-behavior-x:contain}
  .nav::-webkit-scrollbar{display:none}
  .nav button{min-height:38px;flex:none;width:auto;margin:0;padding:8px 11px;line-height:1.2;font-size:13px;white-space:nowrap;border-radius:9px}
  .nav #logout{margin-left:auto}
  .userstrip{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:8px;min-height:40px;margin:0 0 13px;padding:0}
  .user-identity{display:flex;align-items:center;gap:8px;min-width:0;flex:1}
  .user-identity>span{min-width:0}
  .user-identity strong{display:block;font-size:14px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .user-identity small{display:block;max-width:100%;margin-top:2px;font-size:12px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .workspace-home{width:32px;height:34px;min-width:32px;margin:0;border-radius:9px;font-size:20px}
  .mobile-theme-toggle{display:flex;align-items:center;justify-content:center;flex:0 0 38px;width:38px;height:38px;padding:8px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--text)}
  .mobile-theme-toggle svg{width:20px;height:20px}
  .notice-shortcut{min-height:38px;padding:8px;flex:none}
  .notice-shortcut>span:not(.nav-count){display:none}

  /* Working surface: title, count badges and action, then the patient queue. */
  .operations-head,.doctor-head{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;margin:0 0 13px;padding:0;border:0;border-radius:0;background:none;box-shadow:none;color:var(--text);overflow:visible}
  .operations-head::after{display:none}
  .operations-head>.new-case-action{display:none}
  .operations-copy,.operations-totals{position:static;min-width:0}
  .operations-copy .operations-eyebrow,.doctor-head .operations-eyebrow{display:none}
  .operations-head h1,.doctor-head h1{margin:0;font-size:20px;line-height:1.2;letter-spacing:-.025em;color:var(--text)}
  .operations-head p,.doctor-head p{margin:4px 0 0;font-size:12px;line-height:1.4;color:var(--muted)}
  .operations-totals{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;align-items:stretch;gap:6px;width:100%;min-width:0}
  .operations-totals>div{display:flex;align-items:center;justify-content:center;gap:5px;min-width:0;padding:8px 6px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--text)}
  .operations-totals strong{flex:none;font-size:19px;line-height:1;font-variant-numeric:tabular-nums}
  .operations-totals>div>span{font-size:12px;line-height:1.15;white-space:nowrap;color:var(--muted)}
  .operations-totals .attention-total{background:#fff4dc;border-color:#efdab1;color:#8b5b14}
  .operations-totals .attention-total span{color:inherit}
  .operations-totals>.add-appointment-action{display:inline-flex;align-items:center;justify-content:center;gap:4px;align-self:stretch;width:auto;min-width:0;min-height:40px;padding:8px 10px;border:1px solid var(--accent);border-radius:9px;background:var(--accent);color:var(--accentInk);white-space:nowrap;box-shadow:none}
  .operations-totals>.add-appointment-action span{font-size:13px;line-height:1.2;color:inherit}
  .add-appointment-action .action-label-full{display:none}
  .add-appointment-action .action-label-mobile{display:inline}
  .nursing-head .operations-totals{display:flex;width:auto}
  :root[data-theme=dark] .operations-totals .attention-total{background:#4a3b24;border-color:#6e5730;color:#f3d7a2}

  .ri-workspace,.management-workspace,.doctor-content,.split{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;min-width:0}
  .ri-workspace>.review-board{order:0}
  .ri-workspace>.agenda-board{order:1}
  .review-board,.agenda-board,.history-board,.doctor-aside{min-width:0;max-width:100%;border-radius:12px}
  .review-head{padding:11px 12px;gap:8px;align-items:center}
  .review-head>div>span{display:none}
  .review-head h2{margin:0;font-size:16px;line-height:1.2}
  .queue-count{display:grid;place-items:center;width:28px;height:28px;min-width:28px;border-radius:8px;font-size:14px;line-height:1}
  .review-list{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;padding:8px;max-height:none}
  .review-case{min-width:0;padding:10px;gap:5px;border-radius:9px}
  .review-patient{font-size:15px;line-height:1.3;overflow-wrap:anywhere}
  .review-patient small{display:inline-block;white-space:nowrap}
  .review-procedure{font-size:14px;line-height:1.3}
  .review-requester,.review-foot{font-size:12px;line-height:1.4}
  .review-empty{padding:15px 10px;font-size:13px;line-height:1.5}
  .agenda-head,.history-title{padding:12px;gap:8px}
  .agenda-head h2,.history-title h2{font-size:16px;line-height:1.25}
  .history-title>.secondary{flex:none;min-height:36px;padding:8px 10px;font-size:12px;white-space:nowrap}
  .agenda-days{grid-template-columns:minmax(0,1fr);gap:10px}
  .board-toolbar{padding:12px;gap:10px}
  .board-toolbar h2{font-size:20px}
  .agenda-period{grid-template-columns:64px minmax(0,1fr)}
  .period-rail{padding:12px 7px}
  .capacity-track{width:44px}
  .period-cases{padding:7px}
  .procedure-row{grid-template-columns:38px minmax(0,1fr) 12px;gap:5px 7px;padding:9px 8px}
  .procedure-clock{padding-right:6px}
  .history-row{grid-template-columns:minmax(0,1fr) auto;gap:6px 8px;padding:11px 10px}
  .history-patient,.history-procedure,.history-date{min-width:0}
  .history-patient{grid-column:1;grid-row:1}
  .history-status{grid-column:2;grid-row:1;justify-self:end}
  .history-procedure{grid-column:1/-1;grid-row:2;font-size:14px}
  .history-date{grid-column:1/-1;grid-row:3;font-size:12px}
  .history-open{display:none}
  .doctor-head{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:10px;text-align:left}
  .doctor-head h1{font-size:19px}
  .doctor-head p{display:none}
  .doctor-head .new-case-action{min-height:40px;padding:9px 10px;font-size:12px;white-space:nowrap;background:var(--accent);color:var(--accentInk);border-color:var(--accent)}
  .doctor-stats{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-bottom:12px}
  .doctor-stat{min-width:0;min-height:0;padding:11px 10px;gap:6px}
  .doctor-stat span{font-size:12px;line-height:1.25}
  .doctor-stat strong{font-size:23px;line-height:1}
  .doctor-stat small{display:none}
  .card{padding:14px}
  .heading{margin-bottom:12px}
  .heading h1{font-size:20px;line-height:1.25}

  body:not(.signed-in) .workspace{padding:0 12px 20px}
  .login{width:100%;max-width:480px;margin:auto;padding:8px 0 0;gap:10px}
  .login .auth-intro{min-height:0;padding:12px 14px;margin:0 0 10px;border-radius:12px}
  .auth-intro h2{margin:0;font-size:16px;line-height:1.25}
  .auth-intro p{margin:4px 0 0;font-size:12px;line-height:1.4}
  .login .auth-card{padding:18px 16px;border-radius:13px}
  .login .auth-head{gap:10px;margin-bottom:14px}
  .login .auth-icon{width:38px;height:38px;flex:0 0 38px;font-size:24px}
  .login .auth-card .auth-head h1{font-size:22px;line-height:1.2;margin:0}
  .login .actions button{min-height:44px;padding:10px 12px;font-size:14px;white-space:nowrap}
  .login .auth-head p{font-size:12px;line-height:1.4;margin:4px 0 0}
  .login .grid{gap:12px}
  .field{min-width:0;font-size:14px}
  .field input,.field select,.field textarea{max-width:100%;min-width:0;font-size:16px;line-height:1.3}
  .field input,.field select{min-height:44px}
  dialog{max-width:calc(100vw - 20px);max-height:calc(100dvh - 24px);padding:16px;overflow-y:auto;overscroll-behavior:contain}
  .decision-dialog,.request-dialog,.case-dialog,.assignment-dialog{width:calc(100% - 20px);max-width:620px;padding:16px}
  .dialog-head h2{font-size:19px}
  .actions,.decision-actions{flex-wrap:wrap;gap:8px}
  .footer{padding:14px 16px;font-size:12px;line-height:1.45}
}
@media screen and (max-width:359px){
  .top{padding:6px 10px}.top-inner{gap:6px}.brand{gap:5px}.partners{gap:4px}
  .workspace{padding-left:10px;padding-right:10px}
  .operations-totals{gap:4px}.operations-totals>div{gap:4px;padding:8px 4px}
  .operations-totals>div>span{font-size:11px}
  .operations-totals>.add-appointment-action{padding:8px}.operations-totals>.add-appointment-action span{font-size:12px}
  .user-identity small{font-size:11px}.user-identity strong{font-size:13px}
  .doctor-head h1{font-size:17px}.doctor-head .new-case-action{font-size:11px;padding:8px}
}
@media print{.brand img,.partners img,.logos img{background:transparent!important;border:0!important;box-shadow:none!important;outline:0!important}}

/* Avisos compactos: ações discretas, com alvo confortável ao toque. */
.notice-item{gap:6px;padding:10px 12px}
.notice-item .actions{display:flex;flex-direction:row;align-items:center;flex-wrap:wrap;gap:6px;margin-top:2px}
.notice-item .actions button{width:auto;flex:0 1 auto;min-width:0;min-height:36px;padding:7px 10px;font-size:12.5px;line-height:1.2;white-space:nowrap}
.notice-procedure{font-size:14px;line-height:1.35}
.notice-laterality{font-size:12.5px;line-height:1.3}
.case-schedule-laterality{font-size:12px}
