/* Responsive production interface. The local demonstration keeps its own layout. */
:root{color-scheme:light;text-size-adjust:100%;-webkit-text-size-adjust:100%}
button,input,select,textarea{min-height:44px}
button{touch-action:manipulation}
button:disabled{cursor:wait;opacity:.65}
:focus-visible{outline:3px solid #b48a35;outline-offset:3px}
.app-shell{min-height:100vh;min-height:100dvh}
.app-shell aside{height:100vh;height:100dvh;z-index:40;overflow-y:auto;padding-bottom:max(20px,env(safe-area-inset-bottom))}
.app-shell aside .brand{flex-shrink:0}
.app-shell nav{min-height:0;flex-shrink:0}
.app-shell aside .navlabel,.app-shell aside .asidefoot{flex-shrink:0}
.app-shell main,.app-shell .content,.app-shell #page,.app-shell .card{min-width:0}
.app-shell header{height:auto;min-height:83px;gap:16px;padding-top:12px;padding-bottom:12px}
.header-title{display:flex;align-items:center;gap:12px;min-width:0}
.profile{flex-wrap:wrap;justify-content:flex-end}
.profile-info{min-width:0;overflow-wrap:anywhere}
.profile-info strong{display:block}
.menu-toggle,.menu-close,.nav-backdrop{display:none}
.app-shell .card{margin-top:16px}
.app-shell .card h2{margin-bottom:18px;line-height:1.5}
.app-shell #feedback:empty{display:none}
.cell-value{min-width:0;overflow-wrap:anywhere}
.cell-value pre{white-space:pre-wrap;overflow-wrap:anywhere;max-width:100%;font-size:12px}
.cell-value summary{cursor:pointer;min-height:44px;display:flex;align-items:center;text-decoration:underline}
.responsive-table{max-width:100%}
.app-shell .fields>*{min-width:0}
.app-shell .fields input,.app-shell .fields select,.app-shell .fields textarea{min-width:0}
.app-shell dialog{max-height:calc(100vh - 40px);max-height:calc(100dvh - 40px);overflow-y:auto;overscroll-behavior:contain}
.app-shell dialog .actions{position:sticky;bottom:-28px;background:#fff;padding:16px 0;margin-top:12px;border-top:1px solid #e1e7ed}
.loginform,.loginhero{min-width:0}
.loginform input{font-size:16px}
.crest{width:58px;height:68px;object-fit:contain;flex-shrink:0}
.loginhero .crest{width:86px;height:100px}
.auth-links{display:flex;flex-wrap:wrap;gap:12px;margin-top:22px}
.text-button{background:transparent;color:#133d60;text-decoration:underline;padding:12px 8px}
.filterbar{display:grid;grid-template-columns:2fr 1fr 1fr;gap:14px;margin-bottom:20px}
.wing-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.wing-card{background:#f5f8fc;border:1px solid #dce4ed;border-radius:10px;padding:16px;min-width:0}
.wing-card h3{font-size:14px;color:#133d60;margin:0}
.wing-card button{width:100%;padding:10px}
.app-shell nav .ala-link{padding-left:28px;font-size:13px;border-left:2px solid #bd994e;margin-left:14px}
.wing-members{list-style:none;margin:12px 0;padding:0}
.wing-members li{padding:10px 0;border-top:1px solid #dce4ed;font-size:12px;line-height:1.5;overflow-wrap:anywhere}
.wing-members small,.wing-members span,.wing-members em{display:block;margin-top:4px}
.wing-members small{color:#536d85;font-size:10px}
.wing-members em{color:#946b19}
.review-note{font-size:12px;color:#946b19;background:#fff8e8;padding:8px;border-radius:6px}
.schedule-calendar{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:18px}
.agenda-day{border:1px solid #dce4ed;border-radius:10px;padding:14px;min-width:0;overflow-wrap:anywhere}
.agenda-day h3{font-size:14px;margin:0 0 12px;color:#133d60;text-transform:capitalize}
.agenda-day p{font-size:12px;border-top:1px solid #edf1f5;padding-top:10px}
.reference-entry{background:#fcf8ed;padding:10px;border-radius:6px}
@media(max-width:1000px){.wing-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:1100px){
 .app-shell header{padding-right:24px;padding-left:24px}
 .app-shell .profile-info{max-width:180px}
}
@media(max-width:800px){
 .app-shell aside{position:fixed;inset:0 auto 0 0;width:min(310px,88vw);padding:24px 18px;transform:translateX(-105%);visibility:hidden;transition:transform .18s ease,visibility .18s ease}
 .app-shell main{margin-left:0}
 .app-shell header{position:sticky;top:0;z-index:20;min-height:76px;padding:12px 16px;box-shadow:0 2px 12px #102b4508}
 .header-title>span{display:none}
 .menu-toggle{display:flex;align-items:center;gap:8px;white-space:nowrap}
 .menu-toggle span{font-size:21px}
 .menu-close{display:flex;justify-content:space-between;align-items:center;margin:16px 0 4px;background:#25405a;text-align:left}
 .menu-close span{font-size:26px;line-height:1}
 .nav-open{overflow:hidden}
 .nav-open .app-shell aside{transform:translateX(0);visibility:visible}
 .nav-open .nav-backdrop:not([hidden]){display:block;position:fixed;inset:0;z-index:30;border:0;border-radius:0;background:#102b4580;backdrop-filter:blur(2px);padding:0}
 .app-shell aside .navlabel{display:block;margin:18px 12px 10px}
 .app-shell nav{display:block;overflow:visible;margin-top:0}
 .app-shell nav a{font-size:15px;white-space:normal;padding:13px 14px;min-height:48px}
 .app-shell aside .asidefoot{display:block;margin-top:20px}
 .app-shell .profile{gap:8px;flex:1;min-width:0}
 .app-shell .profile-info{flex-basis:100%;max-width:none;text-align:right}
 .app-shell .profile-info small{display:none}
 .app-shell .profile-info strong{font-size:12px;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .app-shell .profile button{padding:9px 12px}
 .app-shell .content{padding:24px 20px calc(24px + env(safe-area-inset-bottom))}
 .app-shell .heading{flex-wrap:wrap;gap:8px;align-items:flex-start;margin-bottom:20px}
 .app-shell h1{font-size:26px;line-height:1.25;overflow-wrap:anywhere}
 .app-shell .stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
 .app-shell .stat{padding:18px;min-width:0}
 .app-shell .stat small{line-height:1.4;display:block}
 .app-shell .fields{grid-template-columns:minmax(0,1fr)}
 .filterbar{grid-template-columns:minmax(0,1fr)}
 .schedule-calendar{grid-template-columns:minmax(0,1fr)}
 .auth-links{flex-direction:column}
 .auth-links button{width:100%}
 .app-shell .fields .wide{grid-column:auto}
 .app-shell input,.app-shell select,.app-shell textarea{font-size:16px}
 .app-shell dialog{width:calc(100% - 24px);max-width:560px;padding:20px;margin:auto;max-height:calc(100dvh - 24px)}
 .app-shell dialog .actions{bottom:-20px;padding-bottom:max(16px,env(safe-area-inset-bottom))}
 .app-shell .actions{display:flex;gap:10px;flex-wrap:wrap}
 .app-shell .actions button{flex:1;min-width:110px}
 .login{display:block}
 .loginhero{padding:28px 24px}
 .loginhero h1{font-size:30px;line-height:1.2}
 .loginform{padding:28px 24px max(28px,env(safe-area-inset-bottom))}
 .loginform h1{font-size:26px}
}
@media(max-width:640px){
 .app-shell .content{padding-left:14px;padding-right:14px}
 .app-shell .card{padding:18px 14px;border-radius:12px}
 .app-shell #page>button{width:100%;margin-bottom:10px}
 .responsive-table{overflow:visible}
 .responsive-table table,.responsive-table tbody{display:block;width:100%}
 .responsive-table thead{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 .responsive-table tbody tr{display:block;border:1px solid #dce4ed;border-radius:10px;margin:0 0 12px;overflow:hidden;background:#fff}
 .responsive-table td{display:grid;grid-template-columns:minmax(85px,34%) minmax(0,1fr);gap:12px;align-items:start;padding:12px;border-bottom:1px solid #edf1f5;line-height:1.5}
 .responsive-table td::before{content:attr(data-label);color:#526a80;font-size:11px;font-weight:700;letter-spacing:.2px;overflow-wrap:anywhere}
 .responsive-table td:last-child{border-bottom:0}
 .responsive-table .cell-actions{display:block;background:#f8fafc}
 .responsive-table .cell-actions::before,.responsive-table .empty::before{display:none}
 .responsive-table .cell-actions button{width:100%}
 .responsive-table .cell-actions:has(.cell-value:empty){display:none}
 .responsive-table td.empty{display:block;padding:24px 16px}
 .responsive-table .empty-row{border-style:dashed;background:#f8fafc}
 .app-shell .badge{white-space:normal;font-size:10px}
 .app-shell .stat strong{font-size:28px;margin:12px 0 0}
 .login{min-height:100dvh}
 .loginhero .brand{padding-bottom:16px}
 .loginhero h1{margin:20px 0 10px;font-size:27px}
 .loginhero p{margin:0}
 .loginform{padding:26px 22px}
}
@media(prefers-reduced-motion:reduce){.app-shell aside{transition:none}}
