/* Agenda Julyan: este arquivo concentra exclusivamente o comportamento mobile */
@media (max-width: 679px) {
    body { padding-top: calc(12px + env(safe-area-inset-top)); }
    .app-grid { position: relative; }
    .top-row {
      position: absolute; top: 0; right: 0; z-index: 12;
      width: auto; justify-content: flex-end; margin-bottom: 0;
    }
    .top-row .eyebrow { display: none; }
    .top-actions { margin-left: auto; gap: 7px; }
    .top-actions .menu-btn { width: 34px; height: 34px; }
    .top-row #brandHomeBtn,.top-row #aiOpenBtn{display:none!important}
    .title-row { margin-top: 0; padding-top: 0; }
    .weekday-kicker {
      min-height: 34px; display: flex; align-items: center;
      margin-bottom: 14px; padding-right: 116px;
    }
    .view-toggle, footer { display: none; }
    .floating-nav {
      display: flex; align-items: center; gap: 4px;
      position: fixed; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); transform: translateX(-50%);
      width: min(360px, calc(100vw - 20px)); box-sizing:border-box;
      background: var(--panel); border: 1px solid var(--line); border-radius: 100px;
      padding: 8px; box-shadow: 0 14px 32px -10px rgba(0,0,0,0.55); z-index: 15;
      transition: transform 0.28s ease, opacity 0.28s ease;
    }
    .floating-nav.hide { transform: translateX(-50%) translateY(140%); opacity: 0; }
    .fnav-btn {
      display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: none;
      color: var(--muted); font-family: var(--font-mono); font-size: 11px; padding: 10px 4px; border-radius: 100px; flex:1; min-width:0;
      cursor: pointer; line-height: 1;
    }
    .fnav-btn svg { width: 22px; height: 22px; }
    .fnav-btn.active { color: var(--accent, #00e0c6); }
    .fnav-add {
      display: flex; align-items: center; justify-content: center; width: 54px; height: 54px; margin-left: 6px;
      background: #00e0c6; color: #0d0e12; border: none; border-radius: 50%; cursor: pointer;
    }
    .fnav-add svg { width: 24px; height: 24px; }
    .fnav-ai{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;width:42px;min-width:42px;align-self:stretch;padding:10px 2px;border:0;border-radius:100px;background:transparent;color:var(--muted);font:400 11px/1 var(--font-mono);cursor:pointer}
    .fnav-ai svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
    body:has(#modalAiAssistant.show) .fnav-ai{color:var(--accent)}
  }

@media (max-width: 679px) {
    .login-shell { min-height: auto; display: block; width: min(100%, 390px); padding: 12px 0; }
    .login-brand { text-align: center; margin-bottom: 28px; }
    .login-icon { width: 64px; height: 64px; margin-bottom: 16px; border-radius: 18px; }
    .login-brand-name { font-size: 40px; }
    .login-brand-sub { margin: 12px auto 0; }
    .login-card { padding: 22px 20px; border-radius: 22px; }
    .overlay { align-items: flex-end; padding-top: max(16px, env(safe-area-inset-top)); }
    .modal { max-height: min(88dvh, 760px); padding-bottom: calc(26px + env(safe-area-inset-bottom)); }
    .fnav-btn { min-width: 0; padding-left: 4px; padding-right: 4px; }
    .item-compact, .period-banner { touch-action: manipulation; }
    .team-modal-head { align-items: flex-start; flex-direction: column; }
    .team-search-row { grid-template-columns: 1fr; }
    .team-search-row .confirm { width: 100%; }
    .team-member-row, .team-overview-row, .team-invite-row { grid-template-columns: 34px minmax(0,1fr); }
    .team-member-row .team-row-actions { grid-column:1 / -1; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
    .team-row-actions, .team-score { grid-column: 2; justify-self: start; }
    .project-team-actions { padding-left: 12px; flex-wrap: wrap; }
  }

@media (max-width: 390px) {
    .login-screen { padding-left: 14px; padding-right: 14px; }
    .fnav-btn { padding-left: 2px; padding-right: 2px; }
  }

@media (max-width: 679px) {
    .tabs-row-wrap { display: block; margin: 0 0 14px; }
    .tabs-row { overflow: hidden; }
    .tabs { padding-bottom: 2px; }
    .tabs .tab { padding: 7px 11px; font-size: 10px; }
    .project-assignment-row { flex-wrap: wrap; }
    .project-assignment-row > .field:first-child { flex: 1 0 100%; }
    .project-assignment-row > .field:not(:first-child) { flex: 1 1 calc(50% - 5px); min-width: 0; }
    .view-toggle { margin-top: 2px; }
    .title-row { position: relative; }
    .late-badge { display: none !important; }
    .fnav-late { position: relative; align-items:center; justify-content:center; min-width:20px; color: var(--late); }
    .fnav-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--late); color: #fff; font: 700 9px/18px var(--font-mono); text-align:center; }
    body.batch-selecting .floating-nav { display: none; }
    body.batch-selecting #screen-dia { padding-bottom: 105px; }
    .tabs-row-wrap { display:none !important; }

    /* Controles de contexto e filtros precisam responder como botões, sem iniciar o gesto de atualizar. */
    .space-switcher,.space-switcher button,.library-kind-filter,.library-kind-filter button,.operation-view-tabs,.operation-view-tabs button{touch-action:manipulation}
    .space-switcher-menu{max-height:min(62dvh,460px);overflow-y:auto;overscroll-behavior:contain}
    .space-switcher-menu button{min-height:48px}
    #spaceSwitcherButton[aria-busy="true"]{opacity:.72;pointer-events:none}

    /* Biblioteca: todos os tipos permanecem visíveis e alinhados, sem corte lateral. */
    #moduleLibrary .library-kind-filter{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;overflow:visible;padding:2px 0 5px}
    #moduleLibrary .library-kind-filter button{width:100%;min-width:0;justify-content:center;padding:0 8px}

    /* Operação: mostra as cinco áreas sem esconder opções fora da tela. */
    .operation-view-tabs{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:7px;overflow:visible;padding:0 0 7px}
    .operation-view-tabs button{width:100%;min-width:0;justify-content:center;padding-left:8px;padding-right:8px}
    .operation-view-tabs button:nth-child(-n+3){grid-column:span 2}
    .operation-view-tabs button:nth-child(n+4){grid-column:span 3}
  }
@media (max-width: 520px) {
  .month-filter-period { grid-template-columns: 1fr; gap: 14px; }
}

/* 4.7.0 — cabeçalho estável e menus reorganizados no mobile */
@media(max-width:679px){
  #moduleNotes .module-screen-head,#moduleFiles .module-screen-head{grid-template-rows:auto 40px!important;gap:10px!important}
  #moduleNotes .module-screen-head h1,#moduleFiles .module-screen-head h1{font-size:40px!important;margin:5px 0 7px!important}
  #moduleNotes .module-screen-head p,#moduleFiles .module-screen-head p{font-size:13px!important}
  #notesSearchInput,#filesSearchInput{margin-top:0!important}
  .unified-trash-modal{width:calc(100vw - 20px)!important;max-height:84dvh;padding:20px 16px!important;border-radius:22px!important}
  .trash-area-nav button{height:36px;font-size:10px}
  #modalTeamManage .team-modal{width:calc(100vw - 20px)!important;padding:20px 16px!important}
  .team-modal-head{grid-template-columns:minmax(0,1fr) auto!important;gap:10px!important}.team-more-menu{align-self:start}.team-more-menu>div{right:0}
  .team-member-row{grid-template-columns:42px minmax(0,1fr) 38px!important;grid-template-areas:"avatar identity actions" "stats stats stats" "access access access"!important;padding:12px!important;gap:9px!important}.team-member-row>.team-avatar{grid-area:avatar}.team-member-identity{grid-area:identity}.team-member-stats{grid-area:stats}.team-member-access{grid-area:access}.team-member-actions{grid-area:actions}.team-member-owner{grid-area:access}
  .team-member-access .team-role-select{width:100%;height:38px}.team-member-actions>div{right:0}
}

/* 4.5.6 — mesmo gerenciador compacto no mobile */
@media(max-width:679px){
  #modalProjetos .category-manager-modal,#modalNoteCategories .category-manager-modal,#modalFileCategories .category-manager-modal{
    width:calc(100vw - 16px)!important;max-height:82dvh!important;padding:16px 13px 14px!important;border-radius:20px!important
  }
  #modalProjetos .modal-head,#modalNoteCategories .modal-head,#modalFileCategories .modal-head{margin:0 40px 12px 0!important}
  #modalProjetos .modal-head h2,#modalNoteCategories .modal-head h2,#modalFileCategories .modal-head h2{font-size:20px!important}
  #modalProjetos .modal-head p,#modalNoteCategories .modal-head p,#modalFileCategories .modal-head p{font-size:10px!important;line-height:1.35!important}
  #modalProjetos .modal-close,#modalNoteCategories .modal-close,#modalFileCategories .modal-close{width:32px!important;height:32px!important}
  .category-manager-nav{margin-bottom:10px!important;padding:3px!important}
  .category-manager-nav button{height:30px!important;font-size:9px!important}
  .category-manager-label{margin-top:10px!important;margin-bottom:5px!important;font-size:7.5px!important}
  .category-manager-label.category-list-label{margin-top:14px!important}
  #modalProjetos .category-create-row,#modalNoteCategories .category-create-row,#modalFileCategories .category-create-row{
    grid-template-columns:27px minmax(0,1fr) auto!important;min-height:43px!important;padding:5px 6px!important
  }
  #modalProjetos .category-create-row input[type=color],#modalNoteCategories .category-create-row input[type=color],#modalFileCategories .category-create-row input[type=color]{width:25px!important;height:25px!important}
  #modalProjetos .category-create-row input[type=text],#modalNoteCategories .category-create-row input[type=text],#modalFileCategories .category-create-row input[type=text]{height:31px!important;font-size:11px!important}
  #modalProjetos .category-create-row>button,#modalNoteCategories .category-create-row>button,#modalFileCategories .category-create-row>button{grid-column:auto!important;height:29px!important;padding:0 8px!important;font-size:9px!important}
  #modalProjetos .category-manage-row,#modalNoteCategories .category-manage-row,#modalFileCategories .category-manage-row{
    grid-template-columns:25px minmax(0,1fr) auto!important;min-height:44px!important;padding:5px 6px!important
  }
  #modalProjetos .category-row-color,#modalNoteCategories .category-row-color,#modalFileCategories .category-row-color{width:23px!important;height:23px!important}
  #modalProjetos .category-row-name,#modalNoteCategories .category-row-name,#modalFileCategories .category-row-name{height:31px!important;font-size:11px!important}
  #modalProjetos .category-row-actions,#modalNoteCategories .category-row-actions,#modalFileCategories .category-row-actions{grid-column:auto!important;padding:0!important}
  #modalProjetos .category-row-icon,#modalNoteCategories .category-row-icon,#modalFileCategories .category-row-icon{width:28px!important;height:28px!important}
  .category-manager-invites{height:26px;margin-top:4px;font-size:8px}
}

/* 4.8.1 — régua canônica mobile (sempre por último) */
:root{--ds-control-h:44px;--ds-icon-control:40px;--ds-modal-radius:22px}
.title-row.main-block,#moduleNotes,#moduleFiles{box-sizing:border-box}
.title-row.main-block,#moduleNotes .module-screen-head,#moduleFiles .module-screen-head{margin-top:0!important;padding-top:0!important}
#moduleNotes,#moduleFiles{padding-top:0!important;padding-left:0!important;padding-right:0!important}
.title-row.main-block{align-items:flex-start!important;margin-bottom:0!important}
.title-row .title-main,#moduleNotes .module-screen-head>div:first-child,#moduleFiles .module-screen-head>div:first-child{min-height:0!important;overflow:visible!important}
.title-row .weekday-kicker,#moduleNotes .weekday-kicker,#moduleFiles .weekday-kicker{margin:0 0 12px!important}
.title-row .title-main h1,#moduleNotes .module-screen-head h1,#moduleFiles .module-screen-head h1{margin:0 0 10px!important;font-size:44px!important;line-height:.98!important;white-space:normal!important}
#moduleNotes .module-screen-head,#moduleFiles .module-screen-head{display:block!important;grid-template-rows:auto!important;min-height:0!important;margin:0 0 18px!important}
#moduleNotes .module-screen-head p,#moduleFiles .module-screen-head p{margin:0!important;min-height:0!important;max-height:none!important;overflow:visible!important;-webkit-line-clamp:unset!important}
#notesSearchInput,#filesSearchInput{height:44px!important;margin:0 0 20px!important;padding:0 14px!important;border-radius:12px!important}
#notesList,#filesList{gap:12px!important}
.modal{padding:20px 16px!important;border-radius:22px!important}
.modal>.modal-close{top:16px!important;right:16px!important;width:40px!important;height:40px!important}
.modal>.modal-head,#modalProjetos .modal-head,#modalNoteCategories .modal-head,#modalFileCategories .modal-head{margin:0 48px 20px 0!important}
.modal>.modal-head h2,#modalProjetos .modal-head h2,#modalNoteCategories .modal-head h2,#modalFileCategories .modal-head h2{font-size:28px!important;line-height:1.05!important}
.modal>.modal-head p,#modalProjetos .modal-head p,#modalNoteCategories .modal-head p,#modalFileCategories .modal-head p{font-size:13px!important;line-height:1.45!important}
.modal-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
.modal-actions>button{width:100%!important;min-height:44px!important}
#modalTeamManage .team-search-row{grid-template-columns:1fr!important}
#modalTeamManage #teamUserSearchBtn,#modalTeamManage #teamInviteFoundUser{width:100%!important;min-height:44px!important;background:#00e0c6!important;color:#03110f!important;-webkit-text-fill-color:#03110f!important}
.category-member-row>.danger-action{min-height:44px!important}
:where(.modal-close,.date-arrow,.note-card-tools button,.file-card-actions button,.category-row-icon,.project-delete,.project-reorder button,.icon-control){touch-action:manipulation}

/* 4.6.0 — layout mobile consolidado */
@media(max-width:679px){
  #moduleNotes,#moduleFiles{--module-head-space:0;padding-top:4px!important}
  #moduleNotes .module-screen-head,#moduleFiles .module-screen-head{display:grid!important;grid-template-rows:auto 42px;min-height:0!important;align-content:start!important;gap:8px!important}
  #moduleNotes .module-screen-head h1,#moduleFiles .module-screen-head h1{font-size:40px!important;line-height:.98!important;margin:5px 0 7px!important}
  #moduleNotes .module-screen-head p,#moduleFiles .module-screen-head p{min-height:0!important;font-size:13px!important;line-height:1.35!important}
  #moduleNotes .module-head-actions,#moduleFiles .module-head-actions{display:flex!important;align-items:center!important;justify-content:flex-start!important;margin:0!important;gap:7px!important}
  #moduleNotes .module-head-actions button,#moduleFiles .module-head-actions button{height:40px!important;padding:0 11px!important;font-size:11px!important}
  #notesSearchInput,#filesSearchInput{height:40px!important;font-size:12px!important}
  #noteCategoryTabs,#fileCategoryTabs{min-height:58px!important;padding:10px 0!important}
  #modalProjetos .category-manager-modal,#modalNoteCategories .category-manager-modal,#modalFileCategories .category-manager-modal{width:calc(100vw - 20px)!important;max-height:84dvh!important;padding:20px 16px 17px!important;border-radius:22px!important}
  #modalProjetos .modal-head,#modalNoteCategories .modal-head,#modalFileCategories .modal-head{margin:0 42px 15px 0!important}
  #modalProjetos .modal-head h2,#modalNoteCategories .modal-head h2,#modalFileCategories .modal-head h2{font-size:24px!important}
  #modalProjetos .modal-head p,#modalNoteCategories .modal-head p,#modalFileCategories .modal-head p{font-size:11px!important}
  .category-manager-nav{margin-bottom:14px!important;padding:4px!important}.category-manager-nav button{height:36px!important;font-size:11px!important}
  .category-manager-label{margin:14px 2px 7px!important;font-size:8.5px!important}.category-manager-label.category-list-label{margin-top:18px!important}
  #modalProjetos .category-create-row,#modalNoteCategories .category-create-row,#modalFileCategories .category-create-row{grid-template-columns:32px minmax(0,1fr) auto!important;min-height:50px!important;padding:7px 8px!important}
  #modalProjetos .category-create-row input[type=color],#modalNoteCategories .category-create-row input[type=color],#modalFileCategories .category-create-row input[type=color]{width:30px!important;height:30px!important}
  #modalProjetos .category-create-row input[type=text],#modalNoteCategories .category-create-row input[type=text],#modalFileCategories .category-create-row input[type=text]{height:35px!important;font-size:12px!important}
  #modalProjetos .category-create-row>button,#modalNoteCategories .category-create-row>button,#modalFileCategories .category-create-row>button{grid-column:auto!important;height:33px!important;padding:0 10px!important;font-size:10px!important}
  #modalProjetos .category-manage-row,#modalNoteCategories .category-manage-row,#modalFileCategories .category-manage-row{grid-template-columns:30px minmax(0,1fr) auto!important;min-height:52px!important;padding:7px 8px!important}
  #modalProjetos .category-row-color,#modalNoteCategories .category-row-color,#modalFileCategories .category-row-color{width:28px!important;height:28px!important}
  #modalProjetos .category-row-name,#modalNoteCategories .category-row-name,#modalFileCategories .category-row-name{height:35px!important;font-size:12px!important}
  #modalProjetos .category-row-actions,#modalNoteCategories .category-row-actions,#modalFileCategories .category-row-actions{grid-column:auto!important;padding:0!important;flex-wrap:nowrap!important}
  #modalProjetos .category-row-icon,#modalNoteCategories .category-row-icon,#modalFileCategories .category-row-icon{width:31px!important;height:31px!important}

  #modalTeamManage .team-modal{width:calc(100vw - 16px);max-width:none;padding:20px 14px 17px;max-height:88dvh;border-radius:22px!important}
  .team-modal-head{display:grid;grid-template-columns:1fr;margin:0 42px 12px 0;gap:12px}.team-modal-title h2{font-size:26px}
  #modalTeamManage>.team-modal>.team-help{font-size:11px;margin-bottom:14px}
  .team-invite-box{padding:11px}.team-search-row{grid-template-columns:minmax(0,1fr) 76px}.team-search-row .confirm{padding:0 8px;font-size:11px}
  .team-member-row{grid-template-columns:40px minmax(0,1fr);grid-template-areas:"avatar identity" "stats stats" "access access" "actions actions";gap:9px;padding:11px}
  .team-member-row>.team-avatar{grid-area:avatar;width:40px;height:40px}.team-member-identity{grid-area:identity}.team-member-stats{grid-area:stats}.team-member-access{grid-area:access;grid-template-columns:1fr 1fr}.team-member-actions{grid-area:actions;display:grid;grid-template-columns:1fr 1fr;justify-content:stretch}.team-member-actions button{width:100%;min-width:0}.team-member-actions .team-transfer-owner{grid-column:1/-1}.team-member-owner{grid-area:access;justify-self:start}.team-person-name{white-space:normal}.team-project-actions{display:grid;grid-template-columns:1fr 1fr}.team-project-actions button{width:100%;padding:0 8px}.team-project-actions .danger-action{grid-column:1/-1}
}

/* 4.5.5 — gerenciador central de categorias no mobile */
@media(max-width:679px){
  .category-manager-nav{gap:4px;margin-bottom:15px;padding:4px}
  .category-manager-nav button{height:36px;padding:0 6px;font-size:10px}
  #modalProjetos .category-manager-modal{width:calc(100vw - 20px);max-height:84vh;padding:21px 16px 18px;border-radius:22px}
  #modalProjetos .modal-head{margin-right:46px;margin-bottom:17px}
  #modalProjetos .modal-head h2{font-size:23px}
}

/* 4.5.2 — categorias compactas e consistentes no mobile */
@media(max-width:700px){
  .category-create-row,.note-category-create{grid-template-columns:34px minmax(0,1fr) auto!important;padding:7px!important}
  .category-create-row>button,.note-category-create>button{grid-column:auto!important;padding:0 10px!important}
  .category-option.filtro-row{min-height:50px!important;padding:7px 9px!important}
  body[data-module="files"] .file-card{min-height:64px!important;padding:8px 9px!important}
}

/* Sistema visual unificado de categorias — mobile v4.5.2 */
@media(max-width:679px){.category-manager-modal{width:min(calc(100vw - 24px),680px);max-height:82vh;overflow:auto}.category-invite-row{grid-template-columns:36px minmax(0,1fr) auto 16px;gap:9px;padding:9px 10px}.category-action-icon{width:36px;height:36px}.category-action-copy small{white-space:normal;line-height:1.35}.category-create-row{grid-template-columns:42px minmax(0,1fr)}.category-create-row>button{grid-column:1/-1}.category-chip{min-height:36px;padding:7px 12px}}
/* Módulos 4.1 */
.module-nav{display:none}.module-screen{padding-top:52px;padding-bottom:110px}.module-screen-head{display:block;margin-bottom:18px}.module-screen-head h1{font-size:48px}.module-screen-head p{font-size:14px}.module-head-actions{display:grid;grid-template-columns:auto auto 1fr;margin-top:16px}.module-head-actions button{padding:0 10px}.module-head-actions .primary{margin-left:0}.notes-list{grid-template-columns:1fr}.note-card{padding:17px;border-radius:18px}.note-editor-meta{grid-template-columns:1fr}.note-category-create{grid-template-columns:42px 1fr}.note-category-create button{grid-column:1/-1;height:44px}.floating-nav .fnav-btn{min-width:64px}.floating-nav .fnav-btn span{font-size:10px}
.module-primary-action{display:none!important}
.files-list{grid-template-columns:1fr}.file-card{grid-template-columns:42px minmax(0,1fr) auto;padding:15px;min-height:96px}.file-card-icon{width:42px;height:42px}

/* v4.5 — módulos compactos e alinhados ao topo da Agenda */
@media(max-width:679px){
  .module-screen{padding-top:8px!important;padding-bottom:104px}
  .module-screen-head{margin-bottom:10px}
  .module-screen-head h1{font-size:clamp(40px,11vw,52px);line-height:.98;margin:7px 0 8px}
  .module-screen-head p{font-size:14px;line-height:1.35}
  .module-head-actions{margin-top:12px;gap:7px;grid-template-columns:auto auto}
  .module-head-actions button{height:40px;padding:0 11px;border-radius:13px}
  .note-category-tabs{padding:12px 0 14px}
  .notes-list,.files-list{gap:10px}
  .note-card{padding:14px;min-height:0;border-radius:17px}
  .note-card h2,.note-card h3{font-size:17px}
  .note-card>p,.note-card-content{font-size:13px;line-height:1.42;margin-top:8px}
  .note-checklist{gap:6px;margin-top:10px}
  .file-card{grid-template-columns:40px minmax(0,1fr) auto;padding:12px;gap:11px;min-height:76px;border-radius:17px}
  .file-card-icon{width:40px;height:40px;border-radius:12px}
  .file-card-body h2{font-size:16px;margin:3px 0}
  .file-card-actions button{width:32px;height:32px}
  body[data-module="files"] .module-screen{padding-top:2px!important}
  body[data-module="files"] .module-screen-head{margin-bottom:8px}
  body[data-module="files"] .module-screen-head h1{font-size:clamp(38px,10vw,46px);margin:5px 0 7px}
  body[data-module="files"] .module-head-actions{margin-top:10px}
  body[data-module="files"] .note-category-tabs{padding:10px 0 12px}
  body[data-module="files"] .files-list{gap:8px}
  body[data-module="files"] .file-card{grid-template-columns:36px minmax(0,1fr) auto;gap:9px;min-height:66px;padding:9px 10px;border-radius:15px}
  body[data-module="files"] .file-card-icon{width:36px;height:36px;border-radius:10px}
  body[data-module="files"] .file-card-body h2{font-size:15px;margin:2px 0}
  body[data-module="files"] .file-card-body small{font-size:9px}
  body[data-module="files"] .file-card-body p{font-size:10px}
  body[data-module="files"] .file-card-actions{gap:1px}
  body[data-module="files"] .file-card-actions button{width:29px;height:29px}
}
body[data-module="agenda"] .view-toggle{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;margin:12px 0 16px;padding:5px;background:var(--panel);border:1px solid var(--line);border-radius:16px}
body[data-module="agenda"] .view-toggle>.sidebar-section-title{display:none!important}
body[data-module="agenda"] .view-toggle button{display:flex;align-items:center;justify-content:center;gap:5px;min-width:0;padding:9px 3px;border:0;border-radius:11px;background:transparent;color:var(--muted);font:600 10px var(--font-mono)}
body[data-module="agenda"] .view-toggle button svg{display:block;width:17px;height:17px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
body[data-module="agenda"] .view-toggle button.active{background:var(--accent-soft);color:var(--accent)}
/* Compact category management on phones */
@media (max-width: 700px){
  .category-manage-row.note-category-manage-row{grid-template-columns:30px minmax(0,1fr)!important;padding:10px!important}
  .category-manage-row.note-category-manage-row .category-row-actions{grid-column:1/-1;justify-content:flex-end;padding-top:2px}
  .category-row-action{flex:1;max-width:112px}
  .category-chip,.note-category-tabs .category-chip,.files-category-tabs .category-chip{min-height:36px!important;padding:0 13px!important;font-size:11px!important}
}

/* 4.5.3 — controles compactos e gesto para atualizar */
@media(max-width:679px){
  #modalNoteCategories .category-manager-modal,
  #modalFileCategories .category-manager-modal{width:min(calc(100vw - 24px),620px);max-height:82vh;overflow:auto}
  #modalNoteCategories .category-create-row,
  #modalFileCategories .category-create-row{grid-template-columns:34px minmax(0,1fr) auto!important;padding:7px!important}
  #modalNoteCategories .category-create-row>button,
  #modalFileCategories .category-create-row>button{grid-column:auto!important;padding:0 10px!important}
  #modalNoteCategories .category-manage-row,
  #modalFileCategories .category-manage-row{grid-template-columns:30px minmax(0,1fr)!important}
  #modalNoteCategories .category-row-actions,
  #modalFileCategories .category-row-actions{grid-column:2;justify-content:flex-end}
  .file-card-actions button,.note-card-tools button{width:34px!important;height:34px!important}
  .pull-refresh-indicator{position:fixed;z-index:2147482000;left:50%;top:max(12px,env(safe-area-inset-top));width:42px;height:42px;display:grid;place-items:center;border:1px solid var(--line);border-radius:50%;background:var(--panel);color:var(--accent);box-shadow:0 12px 32px rgba(0,0,0,.34);opacity:0;transform:translate(-50%,-58px) rotate(0);transition:opacity .16s ease,transform .16s ease;pointer-events:none}
  .pull-refresh-indicator svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
  .pull-refresh-indicator.visible{opacity:1}
  .pull-refresh-indicator.ready{color:var(--text)}
}

/* 4.5.4 — categorias compactas e idênticas em Notas/Arquivos */
@media(max-width:679px){
  #modalNoteCategories .category-manager-modal,
  #modalFileCategories .category-manager-modal{
    width:calc(100vw - 20px)!important;max-height:84vh!important;padding:21px 16px 18px!important;border-radius:22px!important
  }
  #modalNoteCategories .modal-head,
  #modalFileCategories .modal-head{margin-right:46px!important;margin-bottom:17px!important}
  #modalNoteCategories .modal-head h2,
  #modalFileCategories .modal-head h2{font-size:23px!important}
  #modalNoteCategories .category-create-row,
  #modalFileCategories .category-create-row{grid-template-columns:30px minmax(0,1fr) auto!important;padding:6px 7px!important}
  #modalNoteCategories .category-create-row input[type=color],
  #modalFileCategories .category-create-row input[type=color]{width:28px!important;height:28px!important}
  #modalNoteCategories .category-create-row>button,
  #modalFileCategories .category-create-row>button{height:32px!important;padding:0 9px!important;font-size:10px!important}
  #modalNoteCategories .category-manage-row,
  #modalFileCategories .category-manage-row{grid-template-columns:28px minmax(0,1fr) auto!important;min-height:52px!important;padding:7px 8px!important}
  #modalNoteCategories .category-row-color,
  #modalFileCategories .category-row-color{width:26px!important;height:26px!important}
  #modalNoteCategories .owned-category-row .category-row-actions,
  #modalFileCategories .owned-category-row .category-row-actions{grid-column:auto!important;opacity:1!important}
  #modalNoteCategories .category-row-icon,
  #modalFileCategories .category-row-icon{width:30px!important;height:30px!important}
  #modalNoteCategories .category-row-actions,
  #modalFileCategories .category-row-actions{grid-column:auto!important;flex-wrap:nowrap!important;padding-top:0!important}
  #modalNoteCategories .shared-category-row,
  #modalFileCategories .shared-category-row{grid-template-columns:9px minmax(0,1fr) auto!important}
  #modalNoteCategories .shared-category-row .category-row-action,
  #modalFileCategories .shared-category-row .category-row-action{max-width:none!important;padding:0 9px!important}
}

/* 4.6.0 — ajuste final responsivo dos três gerenciadores */
@media(max-width:679px){
  #modalProjetos .category-manager-modal,#modalNoteCategories .category-manager-modal,#modalFileCategories .category-manager-modal{width:calc(100vw - 20px)!important;max-height:84dvh!important;padding:20px 16px 17px!important;border-radius:22px!important}
  #modalProjetos .modal-head,#modalNoteCategories .modal-head,#modalFileCategories .modal-head{margin:0 42px 15px 0!important}
  #modalProjetos .modal-head h2,#modalNoteCategories .modal-head h2,#modalFileCategories .modal-head h2{font-size:24px!important}
  #modalProjetos .modal-head p,#modalNoteCategories .modal-head p,#modalFileCategories .modal-head p{font-size:11px!important;line-height:1.4!important}
  #modalProjetos .modal-close,#modalNoteCategories .modal-close,#modalFileCategories .modal-close{width:32px!important;height:32px!important}
  .category-manager-nav{margin-bottom:14px!important;padding:4px!important}.category-manager-nav button{height:36px!important;font-size:11px!important}
  .category-manager-label{margin:14px 2px 7px!important;font-size:8.5px!important}.category-manager-label.category-list-label{margin-top:18px!important}
  #modalProjetos .category-create-row,#modalNoteCategories .category-create-row,#modalFileCategories .category-create-row{grid-template-columns:32px minmax(0,1fr) auto!important;min-height:50px!important;padding:7px 8px!important}
  #modalProjetos .category-create-row input[type=color],#modalNoteCategories .category-create-row input[type=color],#modalFileCategories .category-create-row input[type=color]{width:30px!important;height:30px!important}
  #modalProjetos .category-create-row input[type=text],#modalNoteCategories .category-create-row input[type=text],#modalFileCategories .category-create-row input[type=text]{height:35px!important;font-size:12px!important}
  #modalProjetos .category-create-row>button,#modalNoteCategories .category-create-row>button,#modalFileCategories .category-create-row>button{grid-column:auto!important;height:33px!important;padding:0 10px!important;font-size:10px!important}
  #modalProjetos .category-manage-row,#modalNoteCategories .category-manage-row,#modalFileCategories .category-manage-row{grid-template-columns:30px minmax(0,1fr) auto!important;min-height:52px!important;padding:7px 8px!important}
  #modalProjetos .category-row-color,#modalNoteCategories .category-row-color,#modalFileCategories .category-row-color{width:28px!important;height:28px!important}
  #modalProjetos .category-row-name,#modalNoteCategories .category-row-name,#modalFileCategories .category-row-name{height:35px!important;font-size:12px!important}
  #modalProjetos .category-row-actions,#modalNoteCategories .category-row-actions,#modalFileCategories .category-row-actions{grid-column:auto!important;padding:0!important;flex-wrap:nowrap!important}
  #modalProjetos .category-row-icon,#modalNoteCategories .category-row-icon,#modalFileCategories .category-row-icon{width:31px!important;height:31px!important}
}

/* 4.7.0 final — vence regras legadas sem duplicar componentes */
@media(max-width:679px){
  #moduleNotes .module-screen-head,#moduleFiles .module-screen-head{grid-template-rows:auto 40px!important;min-height:0!important;gap:10px!important}
  .module-legacy-tabs{display:none!important}
  #modalTeamManage .team-modal{width:calc(100vw - 20px)!important;padding:20px 16px!important}
  .team-modal-head{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;margin:0 42px 12px 0!important;gap:10px!important}
  .team-member-row{display:grid!important;grid-template-columns:42px minmax(0,1fr) 38px!important;grid-template-areas:"avatar identity actions" "stats stats stats" "access access access"!important;padding:12px!important;gap:9px!important}
  .team-member-actions{grid-area:actions!important;display:block!important;justify-self:end}.team-member-actions>div{right:0}
.team-member-access{grid-area:access!important;display:block!important}.team-member-access .team-role-select{width:100%!important}
}

/* 4.7.1 — mesma régua mobile para Notas e Arquivos */
@media(max-width:679px){
  #moduleNotes,#moduleFiles{width:100%!important;padding:4px 16px 110px!important;box-sizing:border-box}
  #moduleNotes .module-screen-head,#moduleFiles .module-screen-head{grid-template-rows:92px 40px!important;min-height:0!important;gap:10px!important;margin:0 0 10px!important}
  #moduleNotes .module-screen-head>div:first-child,#moduleFiles .module-screen-head>div:first-child{min-height:92px!important;overflow:hidden}
  #moduleNotes .module-screen-head h1,#moduleFiles .module-screen-head h1{font-size:40px!important;line-height:.98!important;margin:5px 0 7px!important;white-space:nowrap}
  #moduleNotes .module-screen-head p,#moduleFiles .module-screen-head p{display:-webkit-box;min-height:35px!important;max-height:35px;overflow:hidden;font-size:13px!important;line-height:1.35!important;-webkit-line-clamp:2;-webkit-box-orient:vertical}
  #notesSearchInput,#filesSearchInput{width:100%!important;height:42px!important;margin:0 0 14px!important}
  #notesList,#filesList{width:100%;margin:0!important;gap:10px!important}
}


/* 4.7.2 — remove ação oculta e separa busca dos cards */
@media(max-width:679px){
  #moduleNotes .module-screen-head,#moduleFiles .module-screen-head{display:grid!important;grid-template-rows:92px!important;min-height:92px!important;gap:0!important;margin:0 0 14px!important}
  #moduleNotes .module-head-actions,#moduleFiles .module-head-actions{display:none!important}
  #notesSearchInput,#filesSearchInput{margin:0 0 18px!important}
  #notesList,#filesList{padding-top:0!important;gap:12px!important}
}

/* 4.7.3 — altura natural impede subtítulo sob a busca */
@media(max-width:679px){
  #moduleNotes .module-screen-head,#moduleFiles .module-screen-head{grid-template-rows:auto!important;min-height:0!important;margin-bottom:14px!important}
  #moduleNotes .module-screen-head>div:first-child,#moduleFiles .module-screen-head>div:first-child{min-height:0!important;overflow:visible!important}
  #moduleNotes .module-screen-head p,#moduleFiles .module-screen-head p{min-height:0!important;max-height:none!important;overflow:visible!important;-webkit-line-clamp:unset!important}
}

/* 4.8.0 — controles e modais móveis sem compressão */
@media(max-width:679px){
  :root{--control-h:44px;--tap-min:44px}
  .modal-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
  .modal-actions>button{width:100%!important;min-height:44px!important;margin:0!important}
  .file-viewer-modal,.file-direct-editor,.app-confirm-modal{width:calc(100vw - 20px)!important;max-height:88dvh!important;padding:20px 16px!important;border-radius:22px!important}
  .file-viewer-meta{grid-template-columns:1fr!important}.file-viewer-preview{min-height:96px;padding:14px}.file-secret-preview{flex-wrap:wrap}.file-secret-preview>span{flex-basis:calc(100% - 108px)}
  .file-upload-control{min-height:56px;padding:10px 12px}
  #modalTeamManage .team-search-row{grid-template-columns:minmax(0,1fr)!important;gap:8px!important}
  #modalTeamManage #teamUserSearchBtn{width:100%!important;min-height:44px!important}
  #modalTeamManage .team-search-result{grid-template-columns:40px minmax(0,1fr)!important;gap:10px!important}
  #modalTeamManage .team-search-result #teamInviteFoundUser{grid-column:1/-1;width:100%!important;min-height:44px!important}
  .category-member-row{grid-template-columns:42px minmax(0,1fr)!important;grid-template-areas:"avatar identity" "stats stats" "access access" "actions actions"!important}
  .category-member-row>.danger-action{grid-area:actions;width:100%;min-height:42px}
}

/* 4.8.1 final — prevalece sobre todas as regras móveis legadas */
#moduleNotes,#moduleFiles{padding-top:0!important;padding-left:0!important;padding-right:0!important}
.title-row.main-block,#moduleNotes .module-screen-head,#moduleFiles .module-screen-head{margin-top:0!important;padding-top:0!important}
.title-row .weekday-kicker,#moduleNotes .weekday-kicker,#moduleFiles .weekday-kicker{margin:0 0 12px!important}
.title-row .title-main h1,#moduleNotes .module-screen-head h1,#moduleFiles .module-screen-head h1{margin:0 0 10px!important;font-size:44px!important;line-height:.98!important;white-space:normal!important}
#moduleNotes .module-screen-head,#moduleFiles .module-screen-head{display:block!important;grid-template-rows:auto!important;min-height:0!important;margin:0 0 18px!important}
#moduleNotes .module-screen-head>div:first-child,#moduleFiles .module-screen-head>div:first-child{min-height:0!important;overflow:visible!important}
#moduleNotes .module-screen-head p,#moduleFiles .module-screen-head p{margin:0!important;min-height:0!important;max-height:none!important;overflow:visible!important;-webkit-line-clamp:unset!important}
#notesSearchInput,#filesSearchInput{height:44px!important;margin:0 0 20px!important;padding:0 14px!important;border-radius:12px!important}
.modal{padding:20px 16px!important;border-radius:22px!important}
.modal>.modal-close,#modalProjetos .modal-close,#modalNoteCategories .modal-close,#modalFileCategories .modal-close{top:16px!important;right:16px!important;width:40px!important;height:40px!important}
.modal>.modal-head,#modalProjetos .modal-head,#modalNoteCategories .modal-head,#modalFileCategories .modal-head{margin:0 48px 20px 0!important}
.modal>.modal-head h2,#modalProjetos .modal-head h2,#modalNoteCategories .modal-head h2,#modalFileCategories .modal-head h2{font-size:28px!important;line-height:1.05!important}
.modal>.modal-head p,#modalProjetos .modal-head p,#modalNoteCategories .modal-head p,#modalFileCategories .modal-head p{font-size:13px!important;line-height:1.45!important}
#modalTeamManage #teamUserSearchBtn,#modalTeamManage #teamInviteFoundUser,#fileViewerPrimary{background:#00e0c6!important;border-color:#00e0c6!important;color:#03110f!important;-webkit-text-fill-color:#03110f!important}

/* 5.0.3 — mesma largura útil e mesmos controles em todas as áreas */
#moduleNotes,#moduleFiles{width:100%!important;padding:0!important}
.title-row.main-block,#moduleNotes,#moduleFiles,#screen-dia,#screen-semana,#screen-mes,#screen-atrasados{width:100%!important}
.note-editor-modal,.file-direct-editor,.file-viewer-modal{width:calc(100vw - 20px)!important;max-width:none!important}
.note-editor-meta{grid-template-columns:1fr!important;gap:12px!important}
.note-pin-option{width:100%;height:44px!important;padding:0 2px}
.file-type-picker{grid-template-columns:repeat(2,minmax(0,1fr))!important}
.file-type-picker button{min-width:0!important;height:44px!important;padding:0 8px!important}
.team-modal-head{grid-template-columns:minmax(0,1fr) auto!important;margin:0 48px 12px 0!important}
.team-modal-title h2{font-size:28px!important}

/* 5.0.3 — rodapé e controles proporcionais no mobile */
body{min-height:100dvh;display:flex;flex-direction:column;box-sizing:border-box;padding-bottom:0}
.app-grid{width:100%;flex:1}
.version-footer{display:flex;align-items:center;justify-content:center;gap:7px;flex:none;margin-top:auto;padding-bottom:calc(92px + env(safe-area-inset-bottom))}
.version-brand-mark{position:relative;display:inline-block;width:17px;height:17px}.version-brand-mark img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}.version-brand-mark .eco-logo-light{display:none}:root[data-theme="light"] .version-brand-mark .eco-logo-dark{display:none}:root[data-theme="light"] .version-brand-mark .eco-logo-light{display:block}
.file-card{height:74px!important;min-height:74px!important;max-height:74px!important}
.modal>.modal-close,#modalProjetos .modal-close,#modalNoteCategories .modal-close,#modalFileCategories .modal-close{width:40px!important;height:40px!important}
.modal>.modal-close svg{width:17px!important;height:17px!important}
.unified-invite-list .team-invite-row{grid-template-columns:minmax(0,1fr)!important}.unified-invite-list .team-row-actions{width:100%;display:grid;grid-template-columns:1fr 1fr}.unified-invite-list .team-row-actions button{width:100%}
