/* More readable type and app-like touch targets across desktop and mobile. */
body { font-size: 16px; }
.brand strong { font-size: 16px; }
.brand small { font-size: 10px; }
.identity-badge { font-size: 13px; }
.text-button { min-height: 42px; padding: 8px 10px; font-size: 13px; }
.eyebrow { font-size: 11px; }
.welcome-copy { font-size: 15px; line-height: 1.5; }
.connection-card strong { font-size: 14px; }
.connection-card small { font-size: 12px; }
.roster-heading { padding: 22px 20px 18px; }
.roster-summary { font-size: 12px; }
.live-label { font-size: 11px; }
.user-row { min-height: 58px; padding: 11px 12px; }
.user-row-copy strong { font-size: 14px; }
.user-row-copy small { font-size: 12px; }
.roster-footnote { font-size: 11px; }
.user-sid { font-size: 12px; }
.policy-version { font-size: 11px; }
.identity-meta span { font-size: 11px; }
.identity-meta strong { font-size: 12px; }
.unrestricted-pill { font-size: 11px; }
.rule-heading strong { font-size: 14px; }
.rule-heading small { font-size: 12px; }
.scope-pause { width: 44px; height: 44px; }
.rule-help { font-size: 12px; line-height: 1.5; }
.rule-help code { font-size: 12px; }
.save-hint { font-size: 12px; }
.primary-button,.secondary-button { min-height: 44px; padding: 0 16px; font-size: 13px; }
.empty-state strong { font-size: 14px; }
.empty-state small { font-size: 12px; }
footer { font-size: 11px; }
.dialog-copy { font-size: 14px; }
.connection-dialog:not(.schedule-dialog) label { font-size: 13px; }
.connection-dialog:not(.schedule-dialog) input { min-height: 46px; font-size: 16px; }
.transport-warning { font-size: 12px; line-height: 1.5; }
.icon-button { min-width: 42px; min-height: 42px; }
.icon-button.small { width: 40px; height: 40px; }
.pc-time-label-copy strong,.app-editor-copy strong,.app-editor-detail-title .app-editor-copy strong { font-size: 14px; }
.pc-time-label-copy small,.app-editor-copy small,.app-editor-heading-note,.app-editor-footnote { font-size: 12px; line-height: 1.45; }
.pc-time-number-field,.pc-time-day-name,.app-editor-zone,.app-editor-grace { font-size: 12px; }
.pc-time-input,.app-editor-input { min-height: 42px; font-size: 16px; }
.pc-time-add-window,.pc-time-remove-window,.app-editor-schedule,.app-editor-back,.app-editor-add,.app-editor-remove { min-height: 40px; font-size: 12px; }
.app-editor-status { font-size: 11px; }
.app-editor-pause { width: 44px; height: 44px; }
.app-editor-empty { font-size: 12px; }
.app-editor-schedule-heading strong { font-size: 14px; }
.app-editor-schedule-heading small,.app-editor-breadcrumb,.app-editor-error { font-size: 12px; }
.app-editor-day-label { font-size: 12px; }
.pc-time-note { font-size: 12px; }
.daily-allowance-metrics { font-size: 11px; }
.daily-allowance-metric { padding: 0; }
.daily-allowance-summary > small { max-width: 100%; font-size: 11px; }

button,a,input { -webkit-tap-highlight-color: transparent; }
button:focus-visible,a:focus-visible,input:focus-visible { outline: 2px solid #87baff; outline-offset: 3px; }
.install-button { min-height: 42px; border: 1px solid rgba(135,186,255,.3); border-radius: 10px; padding: 0 12px; color: #d8eaff; background: rgba(32,53,75,.58); font-size: 12px; font-weight: 650; cursor: pointer; }
.install-button:hover { border-color: rgba(172,210,255,.65); background: rgba(45,73,104,.76); }
.install-button[hidden] { display: none; }

@media (max-width: 940px) {
  .app-shell { width: min(100% - 32px, 760px); }
  .workspace { min-height: 0; }
  .roster-panel { min-height: 0; max-height: none; }
  .user-list { min-height: 0; max-height: 260px; }
  .editor-panel { min-height: 0; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .app-shell { width: calc(100% - 24px); }
  .topbar { min-height: 68px; height: auto; gap: 8px; padding: 10px 0; }
  .topbar-right { gap: 4px; }
  .brand { gap: 8px; }
  .brand-mark { width: 30px; height: 30px; }
  .brand strong { font-size: 13px; }
  .brand small { display: none; }
  .identity-badge { display: none; }
  .install-button { min-height: 40px; padding: 0 9px; font-size: 11px; }
  .topbar-right .text-button { min-height: 40px; padding: 0 7px; font-size: 12px; }
  .welcome-row { align-items: stretch; flex-direction: column; gap: 16px; padding: 27px 0 19px; }
  h1 { font-size: clamp(28px, 8vw, 34px); }
  .welcome-copy { font-size: 14px; }
  .welcome-actions .secondary-button { width: 100%; }
  .connection-card { width: 100%; min-width: 0; }
  .connection-card small { max-width: 175px; }
  .workspace { gap: 12px; }
  .roster-heading { padding: 17px 15px 13px; }
  .roster-summary { margin: 0 15px; }
  .user-list { max-height: 220px; }
  .roster-footnote { padding: 12px 14px; }
  .editor-panel { padding: 20px 14px; }
  .daily-allowance-summary { gap: 4px; }
  .daily-allowance-metrics { font-size: 11px; }
  .daily-allowance-summary > small { text-align: left; }
  .user-header { gap: 10px; align-items: flex-start; }
  .user-avatar { width: 40px; height: 40px; }
  .user-title-wrap { flex: 1 1 calc(100% - 62px); }
  .user-title-wrap h2 { font-size: 19px; overflow-wrap: anywhere; }
  .user-sid { font-size: 11px; }
  .policy-version { margin-left: 50px; }
  .identity-meta { grid-template-columns: 1fr 1fr; gap: 12px 9px; margin: 17px 0 21px; padding: 12px 0; }
  .identity-meta strong { white-space: normal; overflow-wrap: anywhere; }
  .policy-intro { align-items: flex-start; flex-direction: column; gap: 9px; }
  .rule-card { padding: 13px 11px; }
  .editor-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
  .save-hint { grid-column: 1 / -1; width: auto; margin: 0 0 3px; }
  .editor-actions #reloadPolicy { grid-column: 1 / -1; }
  .editor-actions .primary-button { grid-column: 1 / -1; }
  .editor-actions button { width: 100%; }
  .pc-time-fields { grid-template-columns: 1fr 1fr; padding-left: 0; }
  .pc-time-number-field:last-child { grid-column: 1 / -1; }
  .pc-time-day-row,.app-editor-day { grid-template-columns: 1fr; gap: 5px; }
  .pc-time-clock,.app-editor-clock { width: 140px; min-width: 140px; flex: 0 0 140px; }
  .pc-time-window-row,.app-editor-window { flex-wrap: wrap; gap: 5px; }
  .pc-time-remove-window,.app-editor-remove { padding: 4px; }
  .app-editor-heading { align-items: flex-start; flex-direction: column; }
  .app-editor-row { flex-wrap: wrap; gap: 8px; padding: 10px; }
  .app-editor-copy { flex-basis: calc(100% - 52px); }
  .app-editor-status { margin-left: 42px; }
  .app-editor-schedule { margin-left: auto; }
  .app-editor-detail-title .app-editor-copy { flex-basis: auto; }
  .app-editor-zone,.app-editor-grace { align-items: flex-start; flex-wrap: wrap; }
  .app-editor-zone > span,.app-editor-grace > span { flex-basis: 100%; }
  .app-editor-zone .app-editor-input { width: 100%; }
  .connection-dialog { padding: 20px; }
  .dialog-actions .primary-button { width: 100%; }
  .rule-heading .schedule-open { min-height: 40px; padding: 0 11px; font-size: 12px; }
  .schedule-dialog { position: fixed; inset: 0; width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0; padding: 0; grid-template-rows: auto auto minmax(0, 1fr) auto; }
  .schedule-dialog-header { padding: calc(14px + env(safe-area-inset-top)) 16px 0; }
  .schedule-dialog > .dialog-copy { margin: 7px 16px 12px; }
  .schedule-dialog-content { padding: 0 16px 18px; }
  .schedule-dialog-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
  .schedule-dialog-footer .save-hint { grid-column: 1 / -1; }
  .schedule-dialog-footer .secondary-button,.schedule-dialog-footer .primary-button { width: 100%; }
  .app-inventory-tools { grid-template-columns: 1fr 1fr; top: 42px; }
  .app-inventory-search { grid-column: 1 / -1; }
  .app-inventory-search input,.app-inventory-select select { min-height: 42px; font-size: 16px; }
  .app-inventory-pager { align-items: flex-start; flex-direction: column; }
  .app-inventory-page-controls { width: 100%; justify-content: space-between; }
  .app-inventory-page-controls button { min-height: 40px; }
  footer { gap: 7px; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
