/* Review build: these rules affect screens 620px wide or narrower only. */
@media screen and (max-width:620px){
 html,body{min-width:0;max-width:100%;overflow-x:clip}
 body[data-view]{background:#edf4f7;background-attachment:scroll}
 #workspace-nav.sidebar{position:sticky;top:0;z-index:25;width:100%;padding:10px 14px;grid-template-columns:minmax(0,1fr) auto;gap:8px;border-radius:0;box-shadow:0 3px 16px #12394d25;max-height:78dvh;overflow-y:auto}
 #workspace-nav .brand{margin:0;gap:9px}
 #workspace-nav .brand-logo{width:34px;height:34px;box-shadow:none;border-radius:10px}
 #workspace-nav .brand b{font-size:14px;line-height:1.45}
 #workspace-nav .mobile-menu-toggle{font-size:13px;padding:9px 12px;min-height:44px;background:#246371;border-color:#4a8e98;border-radius:10px}
 #workspace-nav .navlabel{display:none}
 #workspace-nav:not(.mobile-menu-open) #nav{display:none}
 #workspace-nav.mobile-menu-open #nav{display:flex;flex-direction:column;gap:12px;margin-top:6px}
 #workspace-nav #nav .nav-group{grid-template-columns:minmax(0,1fr);width:100%}
 #workspace-nav #nav .nav-button{min-height:50px;padding:10px;font-size:13px;border-radius:10px}
 #workspace-nav.mobile-menu-open .profile-footer{display:block;grid-column:1/-1;margin-top:0;padding-top:8px}
 #workspace-nav:not(.mobile-menu-open) .profile-footer{display:none}
 #workspace-main[data-view]{width:100%;max-width:100%;margin:0;padding:18px 14px 28px;min-height:calc(100dvh - 70px);border:0;border-radius:0;background:#edf4f7;box-shadow:none;backdrop-filter:none}
 #workspace-main>.top{display:block;margin-bottom:18px}
 #workspace-main .top>div:first-child{margin-bottom:12px}
 #workspace-main #title{scroll-margin-top:90px}
 #workspace-main .top h1{font-size:25px;line-height:1.45;margin:4px 0}
 #workspace-main .top .eyebrow{font-size:12px;color:#557589}
 #workspace-main .top p{font-size:13px;line-height:1.7;color:#587083}
 #workspace-main .page-actions{width:100%;display:flex;gap:8px;flex-wrap:wrap}
 #workspace-main .page-actions>.letter-notification-wrap,#workspace-main .page-actions>.deletion-notification-wrap{flex:0 0 46px}
 #workspace-main .letter-notification-wrap summary{width:46px;height:46px;min-height:46px;min-width:46px;padding:8px;border-radius:11px}
 #workspace-main .deletion-notification-wrap summary{width:46px;height:46px;min-height:46px;min-width:46px;padding:8px;border-radius:11px}
 #workspace-main .page-actions .quick-sign-out{flex:0 0 auto;min-height:46px;padding:10px 12px;font-size:12px}
 #workspace-main .page-actions #add{flex:1 1 110px;min-width:108px;min-height:46px;padding:10px 12px;font-size:13px;border-radius:11px}
 #workspace-main .page-actions .page-options{flex:0 0 auto}
 #workspace-main .page-options summary{min-width:46px;min-height:46px;padding:10px;font-size:12px!important;gap:5px;border-radius:11px}
 #workspace-main .page-options .options-dots{display:none}
 #workspace-main .letter-notification-menu{position:fixed;inset-inline:12px;top:142px;bottom:auto;width:auto;max-width:none;max-height:65dvh;overflow:auto;box-sizing:border-box}
 /* This section lives inside the shared bell popover; keep it in the popover flow. */
 #workspace-main .deletion-notification-menu{position:static;z-index:auto;width:auto;max-width:none;max-height:none;overflow:visible;box-sizing:border-box}
 .panel{border-radius:15px;min-width:0}
 .panel-heading{padding:16px 14px;gap:10px;align-items:start}
 .panel-heading h2{font-size:18px;line-height:1.5}
 .filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;padding:0 12px 14px}
 .filters #search{grid-column:1/-1;width:100%}
 .filters input,.filters select{width:100%;min-width:0;min-height:46px;font-size:16px;padding:10px;border-radius:10px}
 .filters #reset{min-height:44px;grid-column:1/-1;justify-self:start}
 .letters-card-grid{grid-template-columns:1fr!important;gap:12px}
 .letter-register-card{height:auto;padding:15px;border-radius:14px;box-shadow:0 3px 12px #173b5010}
 .letter-register-card h3{font-size:18px;line-height:1.65;min-height:0;margin:10px 0}
 .letter-register-card dl{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
 .letter-register-card dt{font-size:11px;line-height:1.6}
 .letter-register-card dd{font-size:13px;line-height:1.65}
 .letter-register-card>footer{margin-top:12px;gap:10px;flex-wrap:wrap}
 .letter-register-card>footer .button{min-height:44px;font-size:13px;border-radius:10px}
 .letter-card-actions{flex:1 1 auto}
 .letter-card-actions .letter-open-record{flex:1;min-width:120px}
 .letter-card-files .button,.letter-final-download{width:44px;height:44px;min-height:44px}
 .letters-summary{gap:7px;flex-wrap:wrap}
 .letters-summary .letter-summary{min-width:0;flex:1;padding:12px 8px}
 .dashboard-stats,.stats,.completion-summary,.guard-stats{gap:9px}
 .dashboard-stats .stat,.stats .stat{min-height:108px;padding:13px 10px;border-radius:13px}
 .dashboard-stats .stat strong,.stats .stat strong{font-size:29px}
 .dashboard-stats .stat small,.stats .stat small{font-size:12px;line-height:1.6}
 #account-settings-panel{padding:14px!important;border-radius:14px}
 .settings-group>summary{padding:16px 13px;font-size:16px;line-height:1.65;min-height:54px}
 .settings-group-body{padding:14px}
 .settings-group .actions{display:grid;grid-template-columns:1fr;width:100%}
 .settings-group .actions .button{width:100%;min-height:46px}
 .settings-group input,.settings-group select,.settings-group textarea{font-size:16px!important;max-width:100%;min-width:0}
 dialog:not(.encouragement-screen){width:calc(100vw - 16px);max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);border-radius:15px}
 .dialog-head{padding:14px;gap:10px}
 .dialog-head h2{font-size:19px;line-height:1.5}
 .dialog-foot{padding:12px;gap:8px;flex-wrap:wrap;padding-bottom:max(12px,env(safe-area-inset-bottom))}
 .dialog-foot .button{min-height:46px;font-size:14px;padding:10px 13px}
 .form-grid{grid-template-columns:1fr;padding:14px;gap:15px}
 .field{min-width:0;font-size:13px;line-height:1.65}
 .field input,.field select,.field textarea{font-size:16px!important;min-height:46px;max-width:100%;min-width:0;border-radius:10px}
 .field textarea{min-height:110px}
 .field input[type=checkbox],.field input[type=radio]{min-height:0;width:20px;height:20px}
 html #letter-composer.unified-letter-page[open],html.letter-desktop-phone #letter-composer.unified-letter-page[open]{inset:0;margin:0;width:100%;max-width:100%;height:100dvh;max-height:100dvh;border:0;border-radius:0;overflow:hidden;display:flex}
 #letter-composer>.dialog-head{padding:12px 14px;align-items:center}
 #letter-composer>.dialog-head h2{font-size:19px}
 #letter-composer>.dialog-head .eyebrow{font-size:11px}
 html #letter-composer>.unified-letter-scroll{scrollbar-gutter:auto;scroll-padding-top:12px}
 #letter-composer .unified-letter-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:12px}
 #letter-composer .unified-letter-steps button{padding:10px 4px;font-size:12px;min-height:44px;white-space:normal;line-height:1.5}
 #letter-composer .composer-scroll{padding:0 12px 16px}
 #letter-composer .composer-intro{display:block;margin-bottom:12px}
 #letter-composer .composer-intro h3{font-size:17px;line-height:1.6}
 #letter-composer .composer-intro p{font-size:12px;line-height:1.7}
 #letter-composer .composer-layout{display:flex;flex-direction:column;gap:16px;min-width:0;max-width:100%}
 #letter-composer .composer-fields,#letter-composer .composer-preview-panel{width:100%;max-width:100%;min-width:0;box-sizing:border-box}
 #letter-composer .composer-fields{padding:16px;border-radius:14px}
 #letter-composer .composer-template-fields{display:grid;grid-template-columns:1fr;gap:15px}
 #letter-composer .composer-preview-panel{padding:0;min-width:0}
 #letter-composer .composer-preview-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px}
 #letter-composer .composer-preview-head h3{font-size:15px}
 #letter-composer .composer-preview-head span{font-size:10px}
 #letter-composer #composer-preview{position:relative;width:100%;min-width:0;overflow:hidden!important;padding:0;margin:0;border-radius:9px;box-shadow:0 4px 18px #17374a15;height:var(--mobile-paper-height,520px)!important;min-height:0}
 #letter-composer #composer-preview:not(:has(.generated-letter-paper)){height:auto!important;min-height:150px;box-shadow:none}
 #letter-composer #composer-preview .generated-letter-paper{position:absolute;top:0;right:0;margin:0!important;width:210mm!important;min-width:210mm!important;max-width:none!important;transform:scale(var(--mobile-paper-scale,.44));transform-origin:top right;box-shadow:none}
 #letter-composer #composer-preview:has(.event-letter-preview-pages){height:auto!important;max-height:none;overflow:visible!important;box-shadow:none}
 #letter-composer .event-letter-preview-pages{width:100%;gap:12px}
 #letter-composer .event-letter-page-slot{position:relative;width:100%;height:var(--mobile-paper-height,520px);overflow:hidden;border-radius:9px;box-shadow:0 4px 18px #17374a15}
 #letter-composer .event-letter-page-slot .generated-letter-paper{position:absolute!important;top:0!important;right:0!important;left:auto!important;margin:0!important;width:210mm!important;min-width:210mm!important;max-width:none!important;transform:scale(var(--mobile-paper-scale,.44))!important;transform-origin:top right!important;box-shadow:none!important}
 #letter-composer .letter-whitespace-settings{margin:0 0 15px;border-radius:12px;padding:7px}
 #letter-composer .letter-whitespace-settings>summary{font-size:16px!important;padding:13px 10px;min-height:48px;line-height:1.7}
 #letter-composer .letter-full-text-editor{max-height:340px;font-size:16px;line-height:1.8}
 #letter-composer .embedded-letter-details{padding:0 12px 18px}
 #letter-composer .embedded-letter-details .letter-form-section{padding:15px;border-radius:14px}
 #letter-composer .embedded-letter-details .letter-section-fields{grid-template-columns:1fr;gap:15px}
 #letter-composer>.dialog-foot{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:10px 12px max(10px,env(safe-area-inset-bottom));border-top:1px solid #d3e0e8}
 #letter-composer>.dialog-foot .button{min-height:46px;width:100%;font-size:13px;padding:10px 7px;margin:0}
 .session-idle-warning{flex-wrap:wrap;padding:12px;font-size:13px}.session-idle-warning button{width:100%}
 .letter-ready-popup{padding:26px 20px;overflow-y:auto}
 .letter-ready-popup h2{font-size:23px}
 .table-wrap{max-width:100%;min-width:0;overscroll-behavior-x:contain}
}
