/* R4.6.19 desktop plotting shell and collapsible sidebar. */
.r4619-studio-shell{display:grid;gap:14px;margin:-18px -28px -55px;min-height:calc(100vh - 84px)}
.r4619-studio-heading{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:17px 22px;border:1px solid #c8e0f4;border-radius:18px;background:linear-gradient(120deg,rgba(255,255,255,.98),rgba(235,247,255,.96));box-shadow:0 10px 28px rgba(15,83,145,.08)}
.r4619-studio-heading h1{margin:3px 0 4px;color:#073f83;font-size:25px}.r4619-studio-heading p{margin:0;color:#56738f}.r4619-studio-badges{display:flex;flex-wrap:wrap;gap:7px;justify-content:flex-end}.r4619-studio-badges span{padding:6px 10px;border:1px solid #bcdcf5;border-radius:999px;background:#f7fbff;color:#17629f;font-size:11px;font-weight:800}
.r4619-studio-frame-wrap{min-height:760px;height:calc(100vh - 130px);border:1px solid #bcd8ef;border-radius:20px;overflow:hidden;background:#eaf4ff;box-shadow:0 18px 45px rgba(10,70,132,.12)}
.r4619-studio-frame{width:100%;height:100%;border:0;background:#eaf4ff}
.desktop-sidebar-toggle{display:none}

@media(min-width:1101px){
  body.r4619-plotting-page .r390-topbar{display:none!important}
  body.r4619-plotting-page .page-content{max-width:none!important;padding:16px 22px 24px!important}
  body.r4619-plotting-page .r4619-studio-shell{margin:0;min-height:calc(100vh - 40px)}
  body.r4619-plotting-page .r4619-studio-heading{padding:12px 18px;border-radius:15px}
  body.r4619-plotting-page .r4619-studio-heading h1{font-size:22px}
  body.r4619-plotting-page .r4619-studio-frame-wrap{height:calc(100vh - 122px);min-height:720px}
}

@media(min-width:1101px){
  .desktop-sidebar-toggle{display:grid;place-items:center;position:fixed;left:236px;top:50%;z-index:55;width:27px;height:58px;transform:translateY(-50%);border:1px solid rgba(117,177,229,.7);border-left:0;border-radius:0 12px 12px 0;background:linear-gradient(180deg,#fff,#e7f4ff);color:#0b64b3;box-shadow:5px 6px 18px rgba(6,63,119,.14);font-size:17px;transition:left .2s ease,transform .2s ease}
  .r390-sidebar,.r390-main{transition:transform .2s ease,margin-left .2s ease,width .2s ease}
  body.desktop-sidebar-collapsed .r390-sidebar{transform:translateX(-100%)}
  body.desktop-sidebar-collapsed .r390-main{margin-left:0!important;width:100%!important}
  body.desktop-sidebar-collapsed .desktop-sidebar-toggle{left:0}
  body.desktop-sidebar-collapsed .desktop-sidebar-toggle span{transform:rotate(180deg)}
  body.desktop-sidebar-collapsed .page-content{max-width:1680px}
}

/* R4.6.19 global mobile/Android compact layout audit. Desktop remains unchanged. */
@media (max-width:1000px){
  :root{--r4619-mobile-font:13px;--r4619-control-height:42px;--r4619-radius:12px}
  html{font-size:14px!important;-webkit-text-size-adjust:100%;text-size-adjust:100%}
  body{font-size:var(--r4619-mobile-font)!important;line-height:1.52!important}
  .page-content{padding:10px 10px calc(88px + env(safe-area-inset-bottom,0px))!important;max-width:100%!important;overflow-x:hidden!important}
  .page-heading,.section-head,.card-header,.r390-card-head{gap:8px!important;margin-bottom:10px!important}
  .page-heading h1,.r390-hero h1{font-size:22px!important;line-height:1.24!important}
  .page-heading h2,.card h2,.section-head h2,.r390-form h2{font-size:17px!important;line-height:1.3!important}
  .card h3,.form-section h3,.r390-section-title h3{font-size:15px!important}
  .page-heading p,.card p,.muted,.help-text,.form-help,.hint,.notice,small{font-size:11.5px!important;line-height:1.48!important}
  .card,.panel,.r390-card,.r390-form,.form-card,.section-card,.filter-card,.table-card{padding:12px!important;border-radius:var(--r4619-radius)!important}
  .form-grid,.readings-grid,.r390-form-grid,.field-grid,.filter-grid{gap:9px!important}
  label,.field-label,.form-label,.r390-form label{font-size:13px!important;line-height:1.35!important;font-weight:750!important}
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
  select,textarea,.input,.select,.form-control{
    width:100%;min-height:var(--r4619-control-height)!important;height:auto!important;
    padding:9px 11px!important;border-radius:11px!important;font-size:15px!important;line-height:1.35!important;
    box-sizing:border-box!important
  }
  textarea{min-height:92px!important;resize:vertical!important}
  input[type="checkbox"],input[type="radio"]{width:18px!important;height:18px!important;min-width:18px!important;min-height:18px!important;margin:0 7px 0 0!important;padding:0!important;vertical-align:middle!important;transform:none!important;accent-color:#0874d8}
  .checkbox-row,.radio-row,.option-row,.r390-result-toggle label,.choice-card,.check-label{min-height:38px!important;padding:8px 10px!important;gap:7px!important;font-size:13px!important;align-items:center!important}
  button,.button,.btn,a.button,.filter-actions .button{min-height:38px!important;padding:8px 12px!important;border-radius:10px!important;font-size:13px!important;line-height:1.25!important}
  .button.small,.btn.small,.button.mini,.btn.mini{min-height:32px!important;padding:6px 9px!important;font-size:12px!important}
  .mobile-header-r390{height:58px!important;padding:calc(env(safe-area-inset-top,0px) + 5px) 10px 5px!important;min-height:58px!important}
  .r390-main{padding-top:calc(58px + env(safe-area-inset-top,0px))!important}
  .mobile-header-r390 .brand b{font-size:14px!important;max-width:45vw;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .mobile-header-r390 .brand small{font-size:8px!important}
  .mobile-header-r390 .brand-mark{width:29px!important;height:29px!important;flex:0 0 29px!important}
  .mobile-tools-r390 summary,.mobile-logout-r390{min-height:34px!important;padding:7px 9px!important;font-size:12px!important}
  .r390-bottom-nav{height:68px!important;padding-bottom:env(safe-area-inset-bottom,0px)!important}
  .r390-bottom-nav a{font-size:11px!important;gap:2px!important}
  .r390-bottom-nav .mobile-add{width:52px!important;height:52px!important;min-height:52px!important}
  .table-wrap{border-radius:11px!important}
  table{font-size:12px!important}
  th,td{padding:8px!important;line-height:1.38!important}
  .tag,.badge,.status-pill{font-size:10.5px!important;padding:4px 7px!important;border-radius:999px!important}
  .flash,.alert{padding:9px 11px!important;font-size:12px!important;border-radius:10px!important}

  /* Field patrol and sampling forms. */
  body:is(.system-daily,.system-research) .r390-form,
  body:is(.system-daily,.system-research) form[data-mobile-field-form],
  body:is(.system-daily,.system-research) .field-form{padding:11px!important;gap:11px!important}
  .r390-form .form-section,.field-form .form-section,.inspection-form-section,.sampling-form-section{padding:11px!important;margin:0 0 10px!important;border-radius:13px!important}
  .r390-form .section-number,.form-section .section-number{width:34px!important;height:34px!important;min-width:34px!important;font-size:14px!important}
  .r390-form .section-title,.field-form .section-title{gap:9px!important;margin-bottom:10px!important}
  .r390-form .section-title h2,.field-form .section-title h2{font-size:17px!important}
  .r390-form .section-title p,.field-form .section-title p{font-size:11.5px!important}
  .readings-grid,.quick-check-grid,.instrument-grid,.water-parameter-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  .reading-card,.parameter-card,.quick-check-card{padding:9px!important;border-radius:11px!important;min-width:0!important}
  .reading-card input,.parameter-card input,.quick-check-card input{font-size:15px!important;min-height:38px!important;padding:8px 9px!important}
  .reading-card label,.parameter-card label,.quick-check-card label{font-size:11.5px!important}
  .location-grid,.weather-grid,.patrol-meta-grid,.sampling-meta-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  .photo-grid,.image-preview-grid,.upload-preview-grid,.r455-photo-grid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:7px!important}
  .photo-card,.image-preview-item,.upload-preview-item,.r455-photo-card{min-width:0!important;border-radius:10px!important;padding:5px!important}
  .photo-card img,.image-preview-item img,.upload-preview-item img{width:100%!important;aspect-ratio:1/1!important;height:auto!important;object-fit:cover!important;border-radius:8px!important}
  .photo-actions,.upload-actions,.camera-actions,.image-action-row{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  .photo-actions>*:only-child,.upload-actions>*:only-child{grid-column:1/-1}
  .upload-dropzone,.photo-upload-box,.image-upload-box{min-height:92px!important;padding:11px!important;border-radius:12px!important;font-size:12px!important}
  .ocr-preview,.instrument-preview,.standardized-image-wrap{max-height:310px!important;overflow:auto!important;border-radius:12px!important}
  .ocr-preview img,.instrument-preview img,.standardized-image-wrap img{max-height:280px!important;object-fit:contain!important}
  .form-actions,.sticky-submit-actions,.submit-actions{gap:8px!important;padding:9px!important;border-radius:13px!important}
  .form-actions .button,.sticky-submit-actions .button,.submit-actions .button{min-height:42px!important}

  /* Lists and dialogs. */
  .record-card,.point-card,.task-card,.site-card,.accordion-item{padding:11px!important;border-radius:12px!important}
  .modal,.dialog,.sheet,.drawer-panel{max-width:calc(100vw - 18px)!important;max-height:calc(100dvh - 28px)!important;border-radius:16px!important}
  .modal-body,.dialog-body,.sheet-body{padding:12px!important}
}

@media (max-width:600px){
  .form-grid,.r390-form-grid,.field-grid,.filter-grid{grid-template-columns:1fr!important}
  .readings-grid,.quick-check-grid,.instrument-grid,.water-parameter-grid,.location-grid,.weather-grid,.patrol-meta-grid,.sampling-meta-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .photo-grid,.image-preview-grid,.upload-preview-grid,.r455-photo-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .page-heading h1,.r390-hero h1{font-size:20px!important}
  .r390-hero{padding:16px 14px!important}
}

@media (min-width:601px) and (max-width:1000px){
  .form-grid,.r390-form-grid,.field-grid,.filter-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .readings-grid,.quick-check-grid,.instrument-grid,.water-parameter-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}
  .photo-grid,.image-preview-grid,.upload-preview-grid,.r455-photo-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}
}

@supports (-webkit-touch-callout:none){
  @media(max-width:1000px){
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),select,textarea{font-size:16px!important}
  }
}

/* R4.6.20: remove the redundant light-blue plotting hero and give the iframe the full desktop workspace. */
.r4620-studio-shell{gap:0!important}
.r4620-studio-frame-wrap{height:calc(100vh - 38px)!important;min-height:760px!important;border-radius:16px!important}
@media(min-width:1101px){
  body.r4619-plotting-page .r4620-studio-frame-wrap{height:calc(100vh - 34px)!important;min-height:760px!important}
  body.r4619-plotting-page .r4620-studio-shell{min-height:calc(100vh - 30px)!important}
}
