/* Camada móvel: conteúdo contido, navegação de cinco itens e formulários compactos. */
@media(max-width:680px), (max-width:950px) and (hover:none) and (pointer:coarse){
  html { -webkit-text-size-adjust:100%; scroll-padding-bottom:90px; }
  body { font-size:13px; line-height:1.45; }
  .app { display:block; }
  aside { display:none; }
  .app,main,#workspace,.panel,.hero,.card,.class-card,.category-card,.settings-group,.settings-group-content,.report-metric { min-width:0; max-width:100%; }
  main { padding:18px 12px calc(86px + env(safe-area-inset-bottom)); overflow:visible; }
  main > header { align-items:flex-start; gap:10px; margin-bottom:18px; }
  header > div:first-child { min-width:0; flex:1; }
  h1 { font-size:24px; line-height:1.2; letter-spacing:-.7px; }
  .sub { font-size:12px; line-height:1.5; overflow-wrap:anywhere; }
  header .sub { font-size:12px; margin-top:5px; }
  header .actions { flex-shrink:0; }
  .theme { flex-shrink:0; width:34px; height:34px; }
  .date { display:none; }
  .hero { padding:16px; border-radius:12px; margin-bottom:14px; }
  .hero h2 { font-size:18px; line-height:1.3; letter-spacing:-.3px; margin-bottom:6px; }
  .hero p { font-size:12px; line-height:1.5; white-space:normal; }
  .cards { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:14px 0; }
  .card { padding:12px; border-radius:10px; }
  .card small { font-size:11px; line-height:1.4; }
  .card b { font-size:21px; letter-spacing:-.5px; line-height:1.25; overflow-wrap:anywhere; margin:6px 0 4px; }
  .card .up { display:block; font-size:10px; line-height:1.45; font-weight:500; overflow-wrap:anywhere; }
  .grid { grid-template-columns:minmax(0,1fr); gap:12px; }
  .panel { padding:14px; border-radius:12px; }
  .panel h2,.module-head h2,.compact-replacements .module-head h2 { font-size:18px; line-height:1.25; margin-top:0; overflow-wrap:anywhere; }
  .panel h3 { font-size:14px; line-height:1.4; overflow-wrap:anywhere; }
  .module-head { gap:10px; flex-wrap:wrap; align-items:center; margin-bottom:14px; }
  .module-head > div { flex:1 1 140px; min-width:0; }
  .module-head > button { flex-shrink:0; max-width:100%; }
  .module-head small { display:block; font-size:11px; line-height:1.45; }
  .panel-head { gap:8px; margin-bottom:12px; align-items:flex-start; }
  .panel-head h3 { flex:1; min-width:0; }
  .panel-head .link { flex-shrink:0; min-height:28px; padding:2px 4px; font-size:11px; }
  .amount { font-size:21px; overflow-wrap:anywhere; }
  .empty { padding:20px 8px; font-size:12px; }
  .row { min-width:0; gap:8px; padding:10px 0; flex-wrap:wrap; }
  .row > div,.row > b,.row > span { min-width:0; flex:1 1 130px; overflow-wrap:anywhere; }
  .row small { font-size:11px; }
  .row button { flex-shrink:0; }
  .report-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; overflow:visible; }
  .report-metric { min-width:0; padding:10px; border-radius:8px; }
  .report-metric h3 { font-size:14px; margin:5px 0; }
  .report-metric small { font-size:11px; line-height:1.4; display:block; overflow-wrap:anywhere; }
  .report-grid:has(.bar-row) { grid-template-columns:minmax(0,1fr); }
  .bar-row { grid-template-columns:48px minmax(24px,1fr) auto; gap:8px; font-size:11px; }
  .bar-row b { font-size:11px; }
  .table-wrap { min-width:0; width:100%; max-width:100%; overflow:auto; -webkit-overflow-scrolling:touch; overscroll-behavior-x:contain; }
  .table-wrap:focus-visible { outline:2px solid var(--orange); outline-offset:2px; }
  .mobile-scroll-hint { display:block; font-size:10px; color:var(--muted); margin:9px 0 5px; }
  .mobile-scroll-hint[hidden] { display:none; }
  .students-table { font-size:12px; min-width:560px; }
  .students-table th { padding:8px; font-size:10px; letter-spacing:.2px; }
  .students-table td { padding:6px 8px; line-height:1.4; }
  .students-table.student-summary { border-collapse:separate; border-spacing:0; }
  .students-table.student-summary td,.students-table.student-summary th { padding:6px 8px; }
  .students-table.student-summary td:nth-child(2),.students-table.student-summary th:nth-child(2) { min-width:190px; width:190px; max-width:220px; white-space:normal; }
  .students-table.student-summary td:first-child,.students-table.student-summary th:first-child,
  .students-table:has(.payment-check) td:first-child,.students-table:has(.payment-check) th:first-child {
    position:sticky; left:0; z-index:2; background:var(--card); min-width:120px; width:120px; max-width:120px; white-space:normal; overflow-wrap:anywhere; box-shadow:1px 0 var(--line);
  }
  .students-table:has(.payment-check) td { padding:6px 8px; }
  .students-table:has(.payment-check) .payment-check { width:20px; height:20px; }
  .students-table td .secondary { min-height:30px; padding:4px 8px; }
  .student-class-days { min-width:170px; max-width:204px; }
  .class-cards { grid-template-columns:minmax(0,1fr); gap:8px; }
  .class-card { padding:12px; border-radius:10px; }
  .class-card h3 { font-size:14px; margin:5px 0 7px; }
  .class-card p { overflow-wrap:anywhere; }
  .wait-count { gap:8px; margin-top:8px; flex-wrap:wrap; }
  .wait-count > span { min-width:0; overflow-wrap:anywhere; }
  .category-grid { grid-template-columns:minmax(0,1fr); gap:10px; }
  .category-card { padding:12px; border-radius:10px; }
  .category-card li { overflow-wrap:anywhere; }
  .tournament-info { gap:8px; margin-bottom:14px; }
  .tournament-info div { padding:10px; }
  .tournament-info b { font-size:13px; overflow-wrap:anywhere; }
  .calendar-nav { gap:8px; }
  .calendar-nav h2 { font-size:15px; text-align:center; margin:0; }
  .month-calendar { min-width:0; width:100%; }
  .month-calendar th { font-size:10px; padding:6px 0; }
  .month-calendar td { height:60px; padding:4px 2px; }
  .day-number { font-size:11px; }
  .event-chip { font-size:9px; padding:3px 2px; border-radius:3px; }
  .calendar-has-event { cursor:pointer; background:color-mix(in srgb,var(--orange) 8%,var(--card)); }
  .calendar-has-event:focus-visible { outline:2px solid var(--orange); outline-offset:-2px; }
  .mobile-month-events { display:block; margin-top:16px; }
  .mobile-month-event { width:100%; display:grid; grid-template-columns:32px minmax(0,1fr); gap:3px 8px; padding:10px 0; border:0; border-bottom:1px solid var(--line); background:transparent; text-align:left; color:var(--ink); cursor:pointer; }
  .mobile-month-event > span { grid-row:1 / 3; font-size:16px; align-self:center; color:var(--orange); }
  .mobile-month-event strong { font-size:12px; overflow-wrap:anywhere; }
  .mobile-month-event small { font-size:11px; color:var(--muted); overflow-wrap:anywhere; }
  .mobile-event-details article { border-top:1px solid var(--line); padding:12px 0; }
  .mobile-event-details h3 { font-size:15px; margin:0 0 6px; }
  .mobile-event-details p { font-size:13px; margin:5px 0; overflow-wrap:anywhere; }
  .bulk { gap:8px; margin-bottom:12px; }
  .bulk label { flex:1 1 120px; min-width:0; flex-direction:column; align-items:stretch; font-size:11px; }
  .bulk label input,.bulk label select { width:100%; min-width:0; }
  .bulk > button { max-width:100%; }
  .agenda-actions { gap:8px; width:100%; }
  .module-head:has(.agenda-actions) > div { flex:0 1 auto; width:100%; }
  .agenda-actions .primary { height:auto; min-height:34px; }
  .agenda-grid { min-width:850px; }
  .agenda-grid .hour-cell { position:sticky; left:0; z-index:2; background:var(--card); }
  .agenda-grid th:first-child { min-width:64px; width:64px; position:sticky; left:0; z-index:2; background:var(--card); }
  .lesson-actions { flex-wrap:wrap; }
  .lesson-actions button { min-height:28px; min-width:28px; }
  .lesson b { font-size:12px; overflow-wrap:anywhere; }
  .lesson label { white-space:normal; }
  .lesson input[type="checkbox"] { flex-shrink:0; }
  .free-agenda-button { padding:12px 4px; }
  .compact-replacements > .list,.replacement-student-card, .replacement-student-card details { min-width:0; max-width:100%; }
  .compact-replacements summary { grid-template-columns:8px minmax(0,1fr) auto; padding:6px !important; gap:2px 6px; }
  .compact-replacements summary > b { white-space:normal; overflow-wrap:anywhere; line-height:1.35; font-size:12px; }
  .compact-replacements summary > span:nth-of-type(1) { font-size:10px; line-height:1.4; overflow-wrap:anywhere; }
  .compact-replacements summary > span:last-child { align-items:center; }
  .compact-replacements .secondary { min-width:30px; height:auto; min-height:32px; padding:5px 6px; }
  .compact-replacements .students-table { min-width:0; table-layout:fixed; width:100%; }
  .compact-replacements .students-table td,.compact-replacements .students-table th { white-space:normal; overflow-wrap:anywhere; font-size:10px; padding:5px 4px; }
  .compact-replacements .table-wrap:has(th:nth-child(5)) .students-table { min-width:480px; }
  .settings-group-content { min-width:0; }
  .settings-group-content .module-head { margin-bottom:10px; }
  .settings-group-content > label,.settings-group-content section > label { min-width:0; }
  .settings-group-content #alertDay { width:80px !important; }
  .settings-group-content .row { align-items:flex-start; }
  .settings-group > summary { font-size:13px; }
  .notice { font-size:12px; padding:10px 12px; overflow-wrap:anywhere; }
  dialog { max-width:calc(100vw - 20px) !important; width:calc(100vw - 20px); max-height:calc(100dvh - 24px); margin:auto; border-radius:12px; overflow:auto; overscroll-behavior:contain; }
  dialog .form { padding:16px; min-width:0; }
  dialog h2 { font-size:19px; line-height:1.3; overflow-wrap:anywhere; margin-bottom:14px; }
  dialog h3 { font-size:15px; line-height:1.4; overflow-wrap:anywhere; }
  dialog p,dialog b,dialog small { overflow-wrap:anywhere; }
  label { font-size:12px; min-width:0; }
  dialog label { overflow-wrap:anywhere; }
  input,select,textarea { min-width:0; max-width:100%; font-size:16px; font-weight:400; padding:8px 9px; border-radius:7px; min-height:38px; }
  input[type="checkbox"],input[type="radio"] { flex:0 0 auto; min-height:0; width:18px; height:18px; padding:0; }
  input[type="color"] { padding:3px; }
  input[type="file"] { font-size:12px; min-height:36px; }
  input::file-selector-button { border:1px solid var(--line); background:var(--action-bg); color:var(--ink); border-radius:5px; padding:5px 8px; font-size:11px; margin-right:6px; }
  .form-actions { gap:8px; flex-wrap:wrap; margin-top:16px; }
  .form-actions button { max-width:100%; }
  .form label[style*="display:flex"] { align-items:flex-start !important; }
  .form label[style*="display:flex"] input[type="checkbox"] { margin-top:1px; }
  .arena-rate-band label { flex-basis:100px !important; }
  .mobile-nav { position:fixed; bottom:0; left:0; right:0; display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:2px; padding:6px 8px calc(6px + env(safe-area-inset-bottom)); border-top:1px solid var(--line); box-shadow:0 -4px 12px #00000008; z-index:10; }
  .mobile-nav > .nav:not(.mobile-core) { display:none; }
  .mobile-nav .mobile-core,.mobile-more { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; padding:7px 3px; min-height:48px; min-width:0; border:0; border-radius:8px; background:transparent; color:var(--muted); font:inherit; font-size:0; cursor:pointer; }
  .mobile-nav .mobile-core { gap:4px; }
  .mobile-nav .mobile-tab-label,.mobile-more span { font-size:10px; line-height:1.2; font-weight:500; }
  .mobile-nav .mobile-core i,.mobile-more svg { height:18px; width:18px; }
  .mobile-more svg { fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; }
  .mobile-more.active { background:var(--nav2); color:var(--orange); }
  .mobile-menu-dialog { width:calc(100vw - 20px); }
  .mobile-menu-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:16px; }
  .mobile-menu-head h2 { margin:0; font-size:19px; }
  .mobile-menu-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .mobile-menu-grid .nav { min-width:0; white-space:normal; font-size:12px; gap:8px; padding:12px 8px; border:1px solid var(--line); border-radius:8px; color:var(--ink); }
  .mobile-menu-grid .nav.active { background:var(--action-hover); color:var(--orange); }
  .mobile-menu-grid .nav i { flex-shrink:0; }
  .mobile-menu-account { margin-top:16px; border-top:1px solid var(--line); padding-top:12px; display:flex; flex-wrap:wrap; gap:8px; }
  .login-panel { width:calc(100% - 24px); margin:32px auto !important; padding:20px !important; border-radius:12px !important; }
  .login-panel h1 { font-size:24px !important; }
  .login-panel p { font-size:12px; }
  .login-panel .primary { width:100%; }
}
@media(min-width:681px) and (hover:hover), (min-width:951px){ .mobile-more,.mobile-month-events,.mobile-scroll-hint,.mobile-tab-label { display:none; } }
@media(prefers-reduced-motion:reduce){ html { scroll-behavior:auto; } *,*::before,*::after { transition:none !important; } }
