/* Shared light mobile-first design system for every application screen. */
:root,
html[data-theme="light"] {
  color-scheme: light;
  --bg: #e7edf5 !important;
  --surface: #edf2f8 !important;
  --surface2: #f4f7fb !important;
  --surface3: #dce5f0 !important;
  --s1: #edf2f8 !important;
  --s2: #f4f7fb !important;
  --s3: #dce5f0 !important;
  --panel: #edf2f8 !important;
  --line: #cbd7e6 !important;
  --border: #cbd7e6 !important;
  --border2: #b9c9dc !important;
  --text: #14243c !important;
  --muted: #536783 !important;
  --muted2: #536783 !important;
  --accent: #0047ab !important;
  --accent2: #0047ab !important;
  --green: #176b47 !important;
  --warn: #815613 !important;
  --gold: #785b00 !important;
  --danger: #9b2f3b !important;
  --accent-dim: #d8e5f6 !important;
  --accent-glow: #a9c3e8 !important;
  --blue: #0047ab !important;
  --blue-dim: #d8e5f6 !important;
  --cyan: #0047ab !important;
  --sans: Inter, Onest, system-ui, -apple-system, "Segoe UI", sans-serif !important;
  --radius-card: 18px;
  --shadow-card: 0 8px 26px rgba(20, 37, 62, .055);
  --ui-light-bg: #e7edf5 !important;
  --ui-light-panel: #edf2f8 !important;
  --ui-light-raised: #f4f7fb !important;
  --ui-light-text: #14243c !important;
  --ui-light-accent: #0047ab !important;
  --ui-light-accent-dim: #d8e5f6 !important;
  --ui-light-accent-glow: #a9c3e8 !important;
}

html { background: #e7edf5; scroll-behavior: smooth; }
body {
  background-color: #e7edf5 !important;
  background-image: none !important;
  color: #172234 !important;
  font-family: Inter, Onest, system-ui, -apple-system, "Segoe UI", sans-serif !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before { content: none !important; display: none !important; background: none !important; }
::selection { color: #fff; background: #0047ab; }
:focus-visible { outline: 3px solid #8db2ea !important; outline-offset: 2px; }

h1, h2, h3, h4 { color: #172234; letter-spacing: -.025em; }
p, label, li, td, th { line-height: 1.5; }
a { color: #0047ab; }

/* Opaque, consistent controls. Primary and destructive actions are restated below. */
button,
input[type="button"], input[type="submit"], input[type="reset"],
[role="button"] {
  min-height: 42px;
  border: 1px solid #b9c9dc !important;
  border-radius: 12px !important;
  background: #edf2f8 !important;
  color: #14243c !important;
  box-shadow: 0 1px 2px rgba(20, 37, 62, .045);
  font-family: inherit;
  font-weight: 650;
  opacity: 1;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease;
}
button:hover,
input[type="button"]:hover, input[type="submit"]:hover, input[type="reset"]:hover,
[role="button"]:hover { background: #dce5f0 !important; border-color: #8ba7cc !important; }
.dock-item { background: #edf2f8 !important; border: 1px solid #cbd7e6 !important; }
.user-block .profile-trigger { background: transparent !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
.dock-item { padding: 3px 2px; }
button:active, [role="button"]:active { transform: translateY(1px); }
button:disabled, input:disabled, select:disabled, textarea:disabled,
[aria-disabled="true"] { cursor: not-allowed !important; opacity: 1 !important; }
button[aria-busy="true"], button.loading, button.is-loading { cursor: progress !important; box-shadow: 0 0 0 3px #e8f0fc !important; }

.btn-primary, .modal-btn-primary, .submit-btn, .practice-submit, .qr-btn,
.chat-modal-send, .ui-settings-save, .curator-analytics-load,
.curator-att-load-btn, .curator-att-excel-btn, .export-btn,
.btn-success, .tab.active, .tab[aria-selected="true"],
.confirm-btn:not(.confirm-cancel), .action-btn.primary, .action-btn-primary {
  color: #ffffff !important;
  background: #0047ab !important;
  border-color: #0047ab !important;
  box-shadow: 0 4px 12px rgba(0, 71, 171, .16);
}
.btn-primary:hover, .modal-btn-primary:hover, .submit-btn:hover, .practice-submit:hover,
.qr-btn:hover, .chat-modal-send:hover, .ui-settings-save:hover,
.curator-analytics-load:hover, .curator-att-load-btn:hover, .curator-att-excel-btn:hover,
.export-btn:hover, .btn-success:hover, .tab.active:hover {
  color: #ffffff !important; background: #003b91 !important; border-color: #003b91 !important;
}
.btn-danger, .danger-btn, .action-btn-logout, .manual-btn,
.btn[class*="danger"], .confirm-btn.danger {
  color: #a12635 !important; background: #fff1f1 !important; border-color: #efc7cb !important;
}
.btn-danger:hover, .danger-btn:hover, .action-btn-logout:hover,
.manual-btn:hover, .btn[class*="danger"]:hover, .confirm-btn.danger:hover {
  color: #8e1d2b !important; background: #ffe4e6 !important; border-color: #e6aeb5 !important;
}
.tab:not(.active), .nav-btn:not(.active), .week-nav-btn,
.week-toggle-btn, .back-btn, .list-btn, .refresh-btn, .quick-btn,
.modal-btn-secondary, .confirm-cancel, .chat-modal-close, .chat-clear-btn,
.profile-close-btn, .ui-settings-close, .ui-settings-reset {
  color: #14243c !important; background: #edf2f8 !important; border-color: #b9c9dc !important;
}
.day-tab.active, .group-sched-day-tab.active, .day-chip.active,
.pstate.active, .force-btn.active-state, .nav-btn.active,
.week-nav-btn.active, .nav-item.active {
  color: #ffffff !important; background: #0047ab !important; border-color: #0047ab !important;
  box-shadow: 0 3px 10px rgba(0, 71, 171, .16);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
select, textarea {
  color: #172234 !important;
  background-color: #f4f7fb !important;
  border-color: #b9c9dc !important;
  border-radius: 11px;
}
input[type="date"] {
  display: block !important;
  width: 100% !important;
  inline-size: 100% !important;
  min-width: 0 !important;
  min-inline-size: 0 !important;
  max-width: 100% !important;
  max-inline-size: 100% !important;
  box-sizing: border-box !important;
}
:where(.filter-group, .filter-date-group, .curator-att-date-row, .practice-form .row2, .practice-form .row2 > div) {
  min-width: 0;
  max-width: 100%;
}
input::placeholder, textarea::placeholder { color: #536783 !important; opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: #0047ab !important; box-shadow: 0 0 0 3px #e4edfa !important; }
input[type="checkbox"], input[type="radio"] { accent-color: #0047ab; }

/* Common surfaces across student, teacher, admin, practice and statistics pages. */
.user-block, .form-block, .stat-card, .lesson-card, .practice-card,
.record-card, .pair-card, .att-item, .group-sched-card, .today-header,
.status-bar, .action-btn, .scan-zone, .metrics-card, .metric-card,
.metric, .stat-box, .stats-card, .stats-panel, .table-wrap,
.table-container, .board, .monthly, .live-panel, .schedule-card,
.schedule-panel, .form-card, .info-card, .settings-card,
.curator-analytics-card, .curator-att-card, .journal-card,
.panel, .card, .empty-card {
  color: #26364d;
  border-color: #e0e6ef !important;
  border-radius: var(--radius-card) !important;
  box-shadow: var(--shadow-card);
}
.filters, .table-wrap, .table-container, .table-scroll,
.table-header, .stats-subgrid, .theme-row, .admin-badge, .status-badge {
  border-color: #e0e6ef !important;
}
.filters, .stats-subgrid, .theme-row, .table-wrap, .table-container { background: #edf2f8 !important; }
.user-block, .form-block, .stat-card, .lesson-card, .practice-card,
.record-card, .pair-card, .att-item, .group-sched-card, .today-header,
.status-bar, .action-btn, .scan-zone, .metrics-card, .metric-card,
.metric, .stat-box, .stats-card, .stats-panel, .board, .monthly,
.live-panel, .schedule-card, .schedule-panel, .form-card, .info-card,
.settings-card, .curator-analytics-card, .curator-att-card, .journal-card,
.panel, .card, .empty-card, .filters, .stats-subgrid, .theme-row,
.table-wrap, .table-container { background-image: none !important; }
.table-header, .board-head { background: #dce5f0 !important; }
.header-logo-icon { color: #ffffff !important; background: #0047ab !important; border: 1px solid #0047ab !important; }
.admin-badge, .badge { color: #ffffff !important; background: #0047ab !important; border-color: #0047ab !important; }
.filter-label, .metric-label, .table-count { color: #536783 !important; font-size: 12px !important; }
.form-label, .header-sub, .theme-row-desc, .status-badge { font-size: 12px !important; }
.meta-tag, .group-sched-meta-tag, [class^="tag-"], [class*=" tag-"] { font-size: 11px !important; }
.user-block, .form-block, .stat-card, .lesson-card, .practice-card,
.record-card, .pair-card, .att-item, .group-sched-card, .today-header,
.status-bar, .action-btn, .scan-zone, .metrics-card, .metric-card,
.metric, .stat-box, .stats-card, .stats-panel, .board, .monthly,
.live-panel, .schedule-card, .schedule-panel, .form-card, .info-card,
.settings-card, .curator-analytics-card, .curator-att-card, .journal-card,
.panel, .card, .empty-card {
  background-color: #edf2f8 !important;
}
.header, .app-header, .topbar, .admin-header, .page-header,
.header-top, .header-inner {
  color: #172234;
  background: #edf2f8 !important;
  border-color: #cbd7e6 !important;
  box-shadow: 0 2px 12px rgba(20, 37, 62, .04);
}
html[data-theme="light"] .header, html[data-theme="light"] .header-top { background: #edf2f8 !important; }
.header-sub, .eyebrow, .section-label { color: #0047ab !important; }
.logo-icon, .user-av { color: #ffffff !important; background: #0047ab !important; border-color: #0047ab !important; box-shadow: 0 8px 22px rgba(0, 71, 171, .16) !important; }
.header-icon, .dock-qr .dock-icon, .metric-icon { color: #ffffff !important; background: #0047ab !important; border-color: #0047ab !important; }
.nav-btn.active { color: #ffffff !important; background: #0047ab !important; border-color: #0047ab !important; box-shadow: 0 4px 12px rgba(0, 71, 171, .16); }
.award, .medal { color: #14243c !important; background: #edf2f8 !important; border-color: #cbd7e6 !important; }
.tab:not(.active) { color: #14243c !important; background: #edf2f8 !important; border-color: #b9c9dc !important; }
.board-head, .row { border-color: #cbd7e6 !important; }
.panel-title, .title { color: #14243c !important; }
.group, .month-label, .award-heading, .live, .switch-note, .period, .meta { color: #536783 !important; }
.day-tab.active, .group-sched-day-tab.active, .day-chip.active,
.pstate.active, .force-btn.active-state, .week-nav-btn.active { font-weight: 750; }
.progress-bar, progress::-webkit-progress-value, input[type="range"] { accent-color: #0047ab; }
.profile-summary-name, .user-name, .header-name, .metric-value, .stat-value { color: #172234; }
#profile-modal .profile-showcase {
  color: #ffffff !important;
  background: #0047ab !important;
  border-color: #2d64ac !important;
}
#profile-modal .profile-summary { background: transparent !important; border: 0 !important; box-shadow: none !important; }
#profile-modal .profile-summary-name,
#profile-modal .profile-summary-group,
#profile-modal .avatar-upload-hint,
#profile-modal .profile-metric-value,
#profile-modal .profile-metric-label { color: #ffffff !important; text-shadow: none !important; }
#profile-modal .profile-metric { color: #ffffff !important; background: #003b91 !important; border-color: #5c86bd !important; }
#profile-modal .avatar-upload-btn { color: #ffffff !important; background: #003b91 !important; border-color: #79a6e4 !important; }
.dock-label { color: #53647b !important; font-size: 11px !important; }
.time-chip { position: relative; top: -6px; display: grid; place-items: center; min-height: 32px; text-align: center; }
.empty-state, .empty, .chat-empty, .no-data { color: #536783 !important; }

.modal, .modal-sheet, .schedule-modal-sheet, .side-menu, .chat-modal,
.ui-settings-panel, .profile-modal, .modal-content {
  color: #172234 !important;
  background: #edf2f8 !important;
  border-color: #cbd7e6 !important;
  box-shadow: 0 22px 70px rgba(17, 33, 57, .2) !important;
}
.group-sched-header, .curator-att-header, .notif-header {
  color: #14243c !important;
  background: #edf2f8 !important;
  border-bottom: 1px solid #cbd7e6 !important;
  backdrop-filter: none !important;
}
.group-sched-title, .curator-att-title, .notif-title { color: #14243c !important; }
.modal-overlay, .modal-backdrop, .chat-modal-overlay,
.schedule-modal-overlay, .ui-settings-overlay {
  background: rgba(20, 31, 48, .48) !important;
  backdrop-filter: blur(4px);
}
.toast, .notification, .alert { color: #14243c !important; background: #edf2f8 !important; border-color: #b9c9dc !important; box-shadow: var(--shadow-card); }
.ui-setting-row { background: #edf2f8 !important; border-color: #cbd7e6 !important; }
.ui-theme-colors { display: none !important; }

/* Tutor chat: compact framed card with cobalt header and a clear input row. */
.chat-modal {
  width: min(92vw, 440px) !important;
  height: min(72dvh, 560px) !important;
  min-height: 320px;
  border: 1px solid #cbd7e6 !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  box-shadow: 0 12px 34px rgba(20, 37, 62, .18) !important;
}
.chat-modal-header {
  flex: 0 0 auto;
  min-height: 54px;
  padding: 12px 16px !important;
  color: #ffffff !important;
  background: #0047ab !important;
  border: 0 !important;
}
.chat-modal-title { color: #ffffff !important; }
.chat-modal-messages { flex: 1 1 auto; min-height: 0; background: #ffffff !important; }
.chat-modal-input-area {
  flex: 0 0 auto;
  align-items: center;
  background: #ffffff !important;
  border-top: 1px solid #dce5f0 !important;
}
.chat-modal-input {
  min-width: 0;
  color: #172234 !important;
  background: #ffffff !important;
  border: 1px solid #cbd7e6 !important;
  border-radius: 8px !important;
}
.chat-modal-send {
  display: grid !important;
  place-items: center !important;
  width: 0 !important;
  min-width: 0 !important;
  flex: 0 0 0 !important;
  padding: 0 !important;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  color: #ffffff !important;
  background: #0047ab !important;
  border: 0 !important;
  border-radius: 8px !important;
  transition: width .18s ease, flex-basis .18s ease, opacity .18s ease;
}
.chat-modal-send svg { width: 21px; height: 21px; display: block; fill: currentColor; }
.chat-modal-input-area:has(.chat-modal-input:not(:placeholder-shown)) .chat-modal-send {
  width: 48px !important;
  min-width: 48px !important;
  flex-basis: 48px !important;
  padding: 0 !important;
  opacity: 1;
  pointer-events: auto;
  border: 1px solid #0047ab !important;
}
.chat-modal-close, .chat-clear-btn {
  color: #0047ab !important;
  background: #edf2f8 !important;
  border: 1px solid #cbd7e6 !important;
}
.chat-bubble-curator {
  color: #172234 !important;
  background: #edf2f8 !important;
  border: 1px solid #cbd7e6 !important;
}
.chat-bubble-student {
  color: #ffffff !important;
  background: #0047ab !important;
  border: 1px solid #0047ab !important;
}
.chat-bubble-student .chat-bubble-name,
.chat-bubble-student .chat-bubble-text,
.chat-bubble-student .chat-bubble-time { color: #ffffff !important; }
@media (max-width: 520px) {
  .chat-modal { width: calc(100vw - 28px) !important; height: min(74dvh, 560px) !important; min-height: 300px; border-radius: 12px !important; }
  .chat-modal-messages { padding: 12px !important; }
  .chat-modal-input-area { padding: 10px !important; gap: 8px !important; }
}

table { color: #26364d; border-color: #e0e6ef; }
th { color: #334b6b; background: #dce5f0; font-weight: 750; }
td, th { border-color: #e5eaf1 !important; }
tbody tr:nth-child(even) { background: #f4f7fb; }
tbody tr:hover { background: #d8e5f6 !important; }
.status-present, .status-success, .status-ok { color: #176b47 !important; background: #e8f6ef !important; border-color: #bfe5cf !important; }
.status-late, .status-warning { color: #815613 !important; background: #fff6df !important; border-color: #eed9a0 !important; }
.status-absent, .status-danger, .status-error { color: #9b2f3b !important; background: #fff0f1 !important; border-color: #edc5ca !important; }

.quick-dock, .bottom-nav, .bottom-dock {
  color: #14243c !important; background: #edf2f8 !important;
  border-color: #b9c9dc !important; box-shadow: 0 8px 30px rgba(20, 37, 62, .14) !important;
}
.quick-dock .dock-item { background: transparent !important; border: 0 !important; box-shadow: none !important; }
.dock-icon, .nav-icon { color: #ffffff !important; background: #0047ab !important; border-color: #0047ab !important; }
.quick-dock .dock-qr .dock-icon { color: #ffffff !important; background: #0047ab !important; border: 2px solid #8db2ea !important; box-shadow: 0 0 0 3px #d8e5f6, 0 5px 16px rgba(0, 71, 171, .28) !important; transform: translateY(-2px); animation: qrDockPulse 2s ease-in-out infinite; }
.quick-dock .dock-qr:active .dock-icon { animation: none; transform: translateY(-2px) scale(.96); }
.quick-dock .dock-qr .dock-label { color: #0047ab !important; font-weight: 750 !important; }
@keyframes qrDockPulse {
  0%, 100% { transform: translateY(-2px) scale(1); box-shadow: 0 0 0 3px #d8e5f6, 0 5px 16px rgba(0, 71, 171, .24); }
  50% { transform: translateY(-2px) scale(1.07); box-shadow: 0 0 0 5px #d8e5f6, 0 7px 20px rgba(0, 71, 171, .38); }
}
.dock-item.active .dock-icon, .nav-item.active, .bottom-nav .active .nav-icon {
  color: #ffffff !important; background: #0047ab !important; border-color: #0047ab !important;
}

/* Eliminate graph-paper textures even if a legacy preference or pseudo-element remains. */
html.ui-grid body::before, html.ui-no-texture body::before { display: none !important; background: none !important; }
[class*="grid-background"], [class*="graph-paper"] { background-image: none !important; }
body::before, body::after { background-image: none !important; }
html.telegram-required body { margin: 0 !important; min-height: 100dvh !important; display: grid !important; place-items: center !important; padding: 24px !important; background: #e7edf5 !important; color: #14243c !important; text-align: center !important; }
html.telegram-required body > :not(.telegram-required-message) { display: none !important; }
.telegram-required-message { display: block; max-width: 540px; padding: 28px; border: 1px solid #cbd7e6; border-radius: 20px; background: #edf2f8; box-shadow: var(--shadow-card); }
.telegram-required-message h1 { margin: 0 0 10px; color: #0047ab !important; font-size: clamp(24px, 5vw, 34px); }
.telegram-required-message p { margin: 0; color: #536783 !important; }

@media (max-width: 700px) {
  body { min-height: 100dvh; }
  .main, main, .wrap, .container, .page-content { max-width: 100%; }
  .main { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .wrap { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  button, input[type="button"], input[type="submit"], input[type="reset"], select { min-height: 44px; }
  button, select, input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), textarea { font-size: max(14px, 1em); }
  textarea, input:not([type="checkbox"]):not([type="radio"]):not([type="color"]) { min-height: 44px; }
  .header { padding-left: 16px !important; padding-right: 16px !important; }
  .metrics-grid, .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  .metrics-grid > :last-child:nth-child(odd), .stats-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .tabs { gap: 8px; }
  .tabs .tab { min-width: 0; padding: 11px 9px; font-size: 15px; }
  table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .modal, .modal-sheet, .schedule-modal-sheet, .chat-modal, .ui-settings-panel {
    max-height: calc(100dvh - 24px - env(safe-area-inset-top));
    overflow-y: auto;
  }
}

@media (max-width: 380px) {
  .main { padding-left: 12px; padding-right: 12px; }
  .metrics-grid, .stats-grid { gap: 8px !important; }
  .metrics-grid > *, .stats-grid > * { min-width: 0; }
  .tabs .tab { font-size: 14px; padding: 10px 7px; }
}

@media (max-width: 700px) {
  *, *::before, *::after { box-sizing: border-box; }
  html, body { width: 100%; max-width: 100%; }
  body { min-height: 100dvh; overflow-x: clip; }
  img, video, canvas, svg { max-width: 100%; }
  input, select, textarea { min-width: 0; max-width: 100%; }
  .metrics-grid > *, .stats-grid > *, .profile-metrics > *, .curator-att-summary > * { min-width: 0; }
  .curator-att-summary { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .table-scroll, .table-wrap, .table-container, .curator-analytics-table-wrap, .curator-att-table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .modal, .modal-sheet, .schedule-modal-sheet, .chat-modal, .profile-modal, .ui-settings-panel { max-width: calc(100vw - 24px); }
}

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

/* Teacher practice details: center the sheet and keep every action readable. */
.modal-overlay { justify-content: center; }
#p-modal-overlay {
  justify-content: center;
  padding-left: 12px;
  padding-right: 12px;
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  padding-right: max(12px, env(safe-area-inset-right, 0px));
}
#p-modal {
  width: 100%;
  max-width: 560px;
  width: min(100%, 560px);
  max-height: min(88vh, 760px);
  max-height: min(88dvh, 760px);
  margin-left: auto;
  margin-right: auto;
  border-radius: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
#p-modal .modal-header { text-align: center; }
#p-modal .modal-title { overflow-wrap: anywhere; }
#p-modal .modal-sub {
  display: block;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: normal;
}
#p-modal .modal-body { min-width: 0; }
#p-modal .pmodal-actions .action-btn {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 76px;
  gap: 10px;
  padding: 14px;
  color: #17263d !important;
  background: #edf2f8 !important;
  border: 1px solid #cbd7e6 !important;
  text-align: left;
  box-shadow: none !important;
}
#p-modal .pmodal-actions .action-btn.qr-btn {
  color: #17263d !important;
  background: #e8f0fb !important;
  border-color: #a9c2e4 !important;
}
#p-modal .pmodal-actions .action-btn.list-btn {
  color: #17263d !important;
  background: #edf2f8 !important;
  border-color: #cbd7e6 !important;
}
#p-modal .pmodal-actions .action-btn.export-btn {
  color: #17263d !important;
  background: #fff8e8 !important;
  border-color: #e6d29f !important;
}
#p-modal .pmodal-actions .action-btn.danger-btn {
  color: #8e2633 !important;
  background: #fff1f1 !important;
  border-color: #efc7cb !important;
}
#p-modal .action-icon { flex: 0 0 44px; color: #0047ab !important; }
#p-modal .action-title {
  display: block;
  color: #17263d !important;
  font-size: 15px;
  line-height: 1.35;
  text-align: center;
  overflow-wrap: anywhere;
}
#p-modal .danger-btn .action-title { color: #a12635 !important; }
#p-modal .action-desc {
  display: block;
  margin-top: 4px;
  color: #536783 !important;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  overflow-wrap: anywhere;
}
#p-modal .action-text { flex: 1 1 auto; min-width: 0; text-align: center; }
#p-modal .action-arrow {
  display: grid;
  flex: 0 0 24px;
  width: 24px;
  min-height: 24px;
  place-items: center;
  margin-left: 0;
  color: #315c96 !important;
}
#p-modal .pmodal-actions .action-btn:focus-visible {
  outline: 3px solid rgba(0, 71, 171, .35);
  outline-offset: 2px;
}
#p-modal .pmodal-actions .action-btn:disabled { opacity: .62 !important; }

@media (max-width: 700px) {
  #p-modal-overlay {
    align-items: flex-end;
    padding-top: max(12px, env(safe-area-inset-top, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  #p-modal {
    width: 100%;
    max-width: 100%;
    max-height: calc(100vh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    border-radius: 24px;
  }
  #p-modal .modal-header { padding-left: 16px; padding-right: 16px; }
  #p-modal .modal-body { padding: 14px 16px 20px; padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
}

@media (min-width: 701px) {
  #p-modal-overlay { align-items: center; padding: 24px; }
  #p-modal {
    max-height: min(88vh, 760px);
    max-height: min(88dvh, 760px);
  }
}

