/* Keep every panel inside the WebView; long content grows vertically. */
html, body { width:100%; max-width:100%; }
#app { width:100%; min-width:0; overflow-wrap:anywhere; }
.screen, .screen__body, .tabpane, .subpane, .card, .modal__sheet { min-width:0; max-width:100%; }
.screen__body > *, .tabpane > *, .card > *, .row > *, .list__item > *,
.profile > *, .hm-heading > *, .hm-group-caption > *, .hm-entry > * { min-width:0; }
.row, .card__head, .section-title, .subject-stat,
#hm-panel .hm-heading, .hm-group-caption { flex-wrap:wrap; }
.row > .input, .row > select, .row > textarea { flex:1 1 160px; width:100%; }
input, select, textarea, button { max-width:100%; }
input:not([type=checkbox]):not([type=radio]), select, textarea { min-width:0; }
.btn, .seg__btn, #hm-panel button { white-space:normal; overflow-wrap:anywhere; }
.topbar__name, .profile__fio, .now__subject, .gb-item__mark, .badge, .chip,
.card__label, .modal__title, .list__title, .list__sub, .list__date { overflow-wrap:anywhere; }
.subject-stat > :last-child { flex-shrink:1; }
.dashboard-grid .dash-card { grid-template-columns:auto minmax(0,1fr); }
.dashboard-grid .dash-card > * { min-width:0; max-width:100%; }
.gb-item { grid-template-columns:minmax(0,1fr) auto; }
.gb-item__mark { min-width:0; max-width:9ch; }
.hm-entry { grid-template-columns:44px minmax(0,1fr); }
.daypicker { display:grid; grid-template-columns:repeat(auto-fit,minmax(60px,1fr)); overflow:visible; margin-inline:0; }
.daypicker .day { min-width:0; width:100%; padding-inline:4px; }
.seg, .seg--scroll { flex-wrap:wrap; overflow:visible; }
.seg .seg__btn, .seg--scroll .seg__btn { flex:1 1 90px; min-width:0; white-space:normal; }
img, video, canvas, iframe { max-width:100%; }
.card img, .modal__sheet img { height:auto; }
pre { white-space:pre-wrap; overflow-wrap:anywhere; }
table { width:100%; max-width:100%; table-layout:fixed; }
th, td { overflow-wrap:anywhere; }
@media(max-width:360px) {
  .field__row { flex-wrap:wrap; }
  .field__row .input { flex:1 1 100%; }
  #hm-panel .hm-heading button { flex-shrink:1; }
  .pf-filters { grid-template-columns:minmax(0,1fr); }
  .pf-filters label:nth-child(2) { grid-column:auto; }
}
/* Give names and metadata their own lines instead of squeezing or truncating. */
.list__title, .list__sub, .list__meta { white-space:normal; overflow:visible; text-overflow:clip; }
@media(max-width:480px) {
  .att__recent .visit { flex-direction:column; align-items:flex-start; gap:4px; }
  .att__recent .visit > * { min-width:0; max-width:100%; overflow-wrap:anywhere; }
}
