/* Compact phone layout; controls remain large enough for touch and text zoom. */
@media screen and (max-width:700px){
 body{font-size:12px;line-height:1.35}
 main{margin:8px auto;padding-inline:8px;min-width:0}
 h1{font-size:1.15rem;margin:8px 0}
 h2{font-size:.95rem}h3{font-size:.9rem}
 p{margin-block:6px}
 .card{padding:10px;border-radius:10px;margin-bottom:8px}
 .grid,.tile-grid,.dashboard-grid,.dashboard-column{gap:6px}
 .grid{grid-template-columns:minmax(0,1fr)}
 .tile{min-height:76px;padding:10px;border-radius:12px;margin-bottom:4px;box-shadow:0 4px 0 var(--line)}
 .tile h2,.tile-title{font-size:.95rem;margin:3px 0}
 .tile-icon{font-size:1.15rem}
 .tile p{margin-top:4px;font-size:12px}
 .settings-tile{gap:6px}
 .dashboard-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
 .dashboard-grid .tile{min-height:76px;display:flex;flex-direction:column;justify-content:center;gap:3px;padding:8px}
 .dashboard-grid .tile h2{font-size:13px;line-height:1.25;margin:0}
 .dashboard-grid .tile p{display:none}
 .dashboard-grid .tile-icon{font-size:18px;line-height:1}
 .dashboard-column{gap:6px}
 button,.button{min-height:44px;padding:8px 12px;gap:7px}
 input,textarea,select{font-size:16px;padding:8px;min-width:0}
 input:not([type=checkbox]):not([type=radio]):not([type=range]),select{min-height:44px}
 form p,.form-field{margin-block:8px}
 .actions{gap:8px;margin-block:10px}
 .search-controls{gap:12px;margin-top:10px}
 th,td{padding:8px}
 .clickable-list-table{border-spacing:0 6px}
 .pagination,.pagination-pages{gap:10px}
 .page-footer{margin-top:12px}
 .app-header{padding:4px 6px;gap:2px}
 .app-header .header-start{gap:6px;justify-content:space-between}
 .app-header .header-start strong{font-size:11px}
 .app-header .header-start time,.backup-running{font-size:12px;line-height:1.3}
 .app-header .header-clock-slot{margin-inline:0}
 .app-header .welcome-user{font-size:11px;gap:6px;min-width:0;overflow-wrap:anywhere}
 .app-header nav{gap:4px;width:100%;max-width:100%;margin-left:0;justify-self:stretch;justify-content:flex-end;align-items:center}
 .app-header .button,.app-header button{font-size:11px;padding:6px;min-height:44px}
 .mail-notice{padding:4px 8px}
 .number-control{grid-template-columns:minmax(0,1fr) 44px 44px;gap:6px}
 .number-control button{min-width:44px;padding:6px}
 .field-help-row{gap:6px}
}

@media screen and (max-width:800px){.loading-hint{top:50%;bottom:auto;left:8px;right:8px;transform:translateY(-50%);width:auto;max-width:none;padding:10px;font-size:13px}.loading-hint span:not(.loading-spinner){min-width:0;overflow-wrap:anywhere}}

@media screen and (max-width:700px){
 .app-header .welcome-user{justify-self:stretch;width:100%;text-align:left;justify-content:flex-start}
 .app-header .welcome-user>span[role=status]{margin-left:auto}
 .app-header nav{justify-content:flex-start}
 .app-header nav>form{margin-left:auto}
}

@media screen and (max-width:700px){
 .app-header .welcome-user{display:grid;grid-template-columns:minmax(0,1fr);justify-items:center;text-align:center;gap:4px}
 .app-header .welcome-name{width:100%;text-align:center}
 .app-header .welcome-user>span[role=status]{margin-left:0;justify-self:end;margin-bottom:10px}
 .app-header .welcome-user>span[role=status]:has(#mail-notice[hidden]){display:none}
}

@media screen and (max-width:700px){
 .app-header .welcome-user{grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;margin-bottom:10px}
 .app-header .welcome-name{grid-column:2;grid-row:1;width:auto;max-width:calc(100vw - 260px);overflow-wrap:anywhere}
 .app-header .welcome-user>span[role=status]{grid-column:3;grid-row:1;margin:0;justify-self:end}
 .app-header .welcome-user:not(:has(#mail-notice:not([hidden]))) .welcome-name{max-width:none}
}

/* A brief pressed state instead of sticky touch-hover decoration. */
@media screen and (max-width:700px){
 :is(button,.button,.tile):not(.sort-heading){-webkit-tap-highlight-color:transparent;transition:transform 90ms ease-out,box-shadow 90ms ease-out}
 :is(button,.button,.tile):not(:disabled):not([aria-disabled="true"]):not(.sort-heading):active{transform:translateY(2px) scale(.98);box-shadow:inset 0 1px 3px #0002}
}
@media screen and (max-width:700px) and (prefers-reduced-motion:reduce){
 :is(button,.button,.tile):not(.sort-heading){transition:none}
 :is(button,.button,.tile):not(:disabled):not([aria-disabled="true"]):not(.sort-heading):active{transform:none}
}

@media screen and (max-width:700px){
 :is(button,.button,.tile).touch-pressed:not(:disabled):not([aria-disabled="true"]):not(.sort-heading){transform:translateY(3px) scale(.96)!important;box-shadow:inset 0 3px 8px #0008!important;filter:brightness(.80);outline:2px solid color-mix(in srgb,var(--accent) 65%,transparent);outline-offset:-2px}
}
@media screen and (max-width:700px) and (prefers-reduced-motion:reduce){:is(button,.button,.tile).touch-pressed{transform:none!important}}
