/* mobile.css — lớp tối ưu hiển thị di động, nạp SAU office.css và avatar-studio.css.
   Chỉ tinh chỉnh (không đổi bố cục gốc): chữ tối thiểu, vùng chạm, checkbox, thanh điều hướng đáy, cuộn mượt. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{overscroll-behavior-y:none}
.wrap,.subtabs,.cvw{-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}
.subtabs{scrollbar-width:none}
.subtabs::-webkit-scrollbar{display:none}
.subtabs button{flex:none}

@media (max-width:700px){
  /* Chữ không nhỏ hơn 11px để đọc được trên điện thoại */
  .office-status-label,.roster-status-filters button,.seg button,button.mic{font-size:11px!important}
  .btn.sm{font-size:12px!important;min-height:36px!important}

  /* Thanh điều hướng đáy: nhãn 10.5px, không tràn ô, chừa vùng chạm ≥48px */
  nav{gap:1px!important;padding-inline:2px!important}
  nav button{min-width:0;min-height:48px;padding-inline:0}
  nav .lt{font-size:10px!important;font-weight:600!important;letter-spacing:-.045em;white-space:nowrap;overflow:visible}

  /* Checkbox/radio: không bị kéo cao 44px; cả dòng nhãn là vùng chạm */
  input[type=checkbox],input[type=radio]{min-height:0;width:22px;height:22px;flex:none;margin:0}
  label:has(>input[type=checkbox]),label:has(>input[type=radio]){display:flex;align-items:center;gap:10px;min-height:44px}

  /* Vùng chạm tối thiểu cho tiêu đề thu gọn và nút nhỏ */
  :root body details>summary{min-height:40px!important;display:flex!important;align-items:center}
  button,.btn,select{touch-action:manipulation}

  /* Hộp thoại/khung trượt không vượt chiều cao thật của màn hình (thanh địa chỉ co giãn) */
  .sheet>div{max-height:calc(100dvh - 16px)}
}
@media (max-width:700px) and (orientation:portrait){
  /* Thanh "Hoạt động gần đây" thu gọn: giữ gọn nhưng đủ cao để chạm (34px) */
  .ofc .o-act>details:not([open])>summary{min-height:34px!important}
}
@media (max-width:380px){
  .ofc .o-seg>.seg button{font-size:11px!important}
  .v10-editor .v10-tabs button{font-size:10.5px!important}
}
@media (max-width:360px){
  header{gap:6px}
  main{padding-inline:calc(8px + var(--sar,0px)) calc(8px + var(--sar,0px))}
}
@media (pointer:coarse){
  a,button,[role=button]{-webkit-touch-callout:none}
  .office canvas{-webkit-user-select:none;user-select:none}
}

/* ===== Nút Nói (mic): cùng kiểu với Tệp / Ảnh / Liên kết ===== */
.mic:not(.dm-voice-button){display:flex;align-items:center;justify-content:center;gap:6px;width:fit-content;border-radius:12px;font-weight:700;line-height:1.2;white-space:nowrap;min-height:40px!important;padding:8px 14px}
.attbar .mic:not(.dm-voice-button),.attbar>.row>.mic{display:inline-flex!important;width:auto;margin:0!important;border-radius:12px!important;font-weight:700!important;min-height:40px!important}
.mic .ui-line-icon{flex:none;width:16px;height:16px}
.mic.rec{animation:micpulse 1.2s ease-in-out infinite}
@keyframes micpulse{0%,100%{box-shadow:0 0 0 0 rgba(239,68,68,.45)}50%{box-shadow:0 0 0 6px rgba(239,68,68,0)}}
@media (prefers-reduced-motion:reduce){.mic.rec{animation:none}}

/* ===== Gợi ý vuốt ngang: lớp phủ do scrollhint.js chèn, hiện ở mép còn nội dung bị cắt ===== */
.sh-edge{position:absolute;z-index:3;pointer-events:none;width:26px;opacity:0;transition:opacity .15s;border-radius:0 12px 12px 0;
  background:linear-gradient(to left,rgba(15,23,42,.30),rgba(15,23,42,0))}
.sh-edge.l{border-radius:12px 0 0 12px;background:linear-gradient(to right,rgba(15,23,42,.30),rgba(15,23,42,0))}
.sh-edge.on{opacity:1}
.sh-edge::after{content:'›';position:absolute;right:5px;top:50%;transform:translateY(-50%);font:700 20px/1 system-ui,sans-serif;color:var(--mu,#64748b)}
.sh-edge.l::after{content:'‹';right:auto;left:5px}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .sh-edge{background:linear-gradient(to left,rgba(0,0,0,.55),rgba(0,0,0,0))}
  :root:not([data-theme="light"]) .sh-edge.l{background:linear-gradient(to right,rgba(0,0,0,.55),rgba(0,0,0,0))}}
:root[data-theme="dark"] .sh-edge{background:linear-gradient(to left,rgba(0,0,0,.55),rgba(0,0,0,0))}
:root[data-theme="dark"] .sh-edge.l{background:linear-gradient(to right,rgba(0,0,0,.55),rgba(0,0,0,0))}
@media (prefers-reduced-motion:reduce){.sh-edge{transition:none}}

/* ===== Xoay ngang điện thoại (cao ≤ 540px): vùng chạm đủ lớn ===== */
@media (orientation:landscape) and (max-height:540px){
  input[type=checkbox],input[type=radio]{min-height:0!important;width:22px;height:22px;flex:none;margin:0}
  label:has(>input[type=checkbox]),label:has(>input[type=radio]){display:flex;align-items:center;gap:10px;min-height:44px}
  .ofc .o-act>details>summary,details>summary{min-height:36px!important;display:flex!important;align-items:center;padding-block:6px!important}
  .btn.sm{min-height:36px}
  .mic:not(.dm-voice-button){min-height:40px!important}
}

/* ===== Công tắc Chị y công trong Cài đặt sếp ===== */
.cln-toggle{display:flex!important;align-items:center;gap:10px;flex:1 1 100%;min-height:48px;padding:8px 12px;border:1px solid var(--bd,#d8e0ea);border-radius:12px;background:var(--card,#fff);color:var(--tx,#1e293b);font-weight:600}
.cln-toggle input{accent-color:#0f766e;width:22px;height:22px;flex:none}

/* ===== Báo cáo tuần (weekly.js) ===== */
.wr-week{display:flex;align-items:center;gap:8px;margin:6px 0 10px}
.wr-week>div{flex:1;text-align:center;line-height:1.25}
.wr-week .btn{min-width:40px}
.wr-seg{margin-bottom:6px}
.wr-id{display:flex;align-items:center;justify-content:space-between;gap:10px}
.wr-badge{display:inline-flex;align-items:center;padding:4px 10px;border-radius:999px;font-size:12px;font-weight:700;white-space:nowrap}
.wr-badge.ok{background:#dcfce7;color:#166534}.wr-badge.draft{background:#fef3c7;color:#92400e}.wr-badge.none{background:#eef2f6;color:#64748b}
.wr-warn{border-color:#f59e0b!important;background:#fffbeb!important;color:#92400e;font-size:13px}
.wr-sec{margin:14px 0}
.wr-sh{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px;color:#1f4e78}
.wr-row{background:var(--card,#fff);border:1px solid var(--bd,#d8e0ea);border-left:4px solid #1f4e78;border-radius:12px;padding:10px 12px;margin:0 0 10px;display:flex;flex-direction:column;gap:8px}
.wr-h{display:flex;align-items:center;gap:8px}
.wr-h b{color:#1f4e78}
.wr-x{margin-left:auto;min-width:40px;min-height:40px;border:0;border-radius:10px;background:#fee2e2;color:#b91c1c;font-weight:800}
.wr-f{display:flex;flex-direction:column;gap:3px;min-width:0}
.wr-f>span{font-size:12px;font-weight:700;color:#475569}
.wr-f input,.wr-f select,.wr-f textarea{width:100%;font-size:16px;box-sizing:border-box}
.wr-f textarea{min-height:56px;resize:vertical}
.wr-2{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.wr-st,.wr-prio{font-size:11px;font-weight:700;padding:3px 9px;border-radius:999px;background:#eef2f6;color:#475569}
.wr-st[data-s="Hoàn thành"]{background:#c6efce;color:#006100}.wr-st[data-s="Đang thực hiện"]{background:#ddebf7;color:#1f4e78}.wr-st[data-s="Chờ phối hợp"]{background:#fff2cc;color:#7f6000}
.wr-st[data-s="Chờ chỉ đạo"]{background:#fce4d6;color:#833c0b}.wr-st[data-s="Có nguy cơ chậm"]{background:#ffe699;color:#7f4f00}.wr-st[data-s="Quá hạn"]{background:#ffc7ce;color:#9c0006}
.wr-prio[data-p="1"]{background:#ffc7ce;color:#9c0006}.wr-prio[data-p="2"]{background:#ffeb9c;color:#7f6000}.wr-prio[data-p="3"]{background:#ddebf7;color:#1f4e78}.wr-prio[data-p="4"]{background:#ededed;color:#404040}
.wr-add{display:flex;flex-wrap:wrap;gap:8px}
.wr-add .btn{min-height:40px}
.wr-bar{position:static;display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;padding:12px;margin:14px 0 calc(18px + env(safe-area-inset-bottom,0px));background:var(--card,#fff);border:1px solid var(--bd,#d8e0ea);border-radius:14px;box-shadow:0 3px 14px rgba(25,57,76,.10);z-index:auto;scroll-margin-bottom:24px}
.wr-bar .btn{min-height:42px}
.wr-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-bottom:10px}
.wr-kpis .card{padding:10px 6px;text-align:center;display:flex;flex-direction:column;gap:2px}.wr-kpis b{font-size:20px;color:#1f4e78}
.wr-exp{display:flex;flex-direction:column;gap:8px}
.wr-chk{display:flex;align-items:center;gap:10px;min-height:40px;font-size:14px}.wr-chk input{width:22px;height:22px;accent-color:#1f4e78;flex:none}
.wr-list .wr-st-row{display:grid;grid-template-columns:1fr auto;gap:4px 10px;align-items:center;padding:10px 0;border-top:1px solid var(--bd,#e5eaf0)}
.wr-list .wr-st-row .wr-cnt{grid-column:1}.wr-list .wr-st-row .wr-badge{grid-column:2;grid-row:1}.wr-list .wr-st-row .btn{grid-column:2;grid-row:2;justify-self:end}
@media (min-width:700px){.wr-row{display:grid;grid-template-columns:repeat(2,1fr);gap:8px 12px}.wr-row>.wr-h,.wr-row>.wr-f.full,.wr-row>.wr-2{grid-column:1/-1}}

.wr-bar{gap:6px 10px}.wr-bar .wr-tally{flex:1 1 100%;order:3;font-size:12px}
.wr-bar #wk-saved{flex:1 1 auto}

.wr-lh{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;margin-bottom:4px}
.wr-list .wr-st-row .wr-act{grid-column:2;grid-row:2;display:flex;gap:6px;justify-content:flex-end}
.wr-list .wr-st-row .wr-act .btn{grid-column:auto;grid-row:auto}
.wr-list .wr-st-row .wr-rem{grid-column:1/-1;font-size:12px}

/* Weekly report: keep Save/Submit actions below all three sections; never overlay the next-week plan. */
.wr-bar{isolation:auto;min-width:0}
.wr-bar>.btn{flex:0 1 auto}
@media(max-width:520px){.wr-bar{align-items:stretch}.wr-bar #wk-saved{flex:1 1 100%}.wr-bar>.btn{flex:1 1 calc(50% - 8px);white-space:normal}.wr-bar .wr-tally{order:0;flex:1 1 100%}.wr-sec{scroll-margin-top:12px}.wr-add{align-items:stretch}.wr-add .btn{flex:1 1 100%;white-space:normal}}
