/* Browser adaptations for the shared mobile workflows. */
html { height: auto !important; overflow: visible !important; }
body.cw-member { height: auto !important; min-height: 100vh; overflow: visible !important; }
body.cw-member .cw-workspace { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; align-items: start; margin-top: 20px; min-height: 65vh; }
body.cw-member .cw-member-main { min-width: 0; background: #fff; border: 1px solid #cbd3bf; padding: 0 20px 20px; }
body.cw-member .cw-workspace-bar { border-bottom: 1px solid #d5dec8; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 8px 0; color: #465b3e; font: 1rem/1.5 Arial, sans-serif; }
body.cw-member .cw-workspace-bar > span { font-weight: bold; }
body.cw-member .cw-workspace-bar > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
body.cw-member .cw-workspace-bar a, body.cw-member #cw-sign-out { display: inline-flex; align-items: center; min-height: 44px; color: #405c35; text-decoration: underline; font: 1rem/1.5 Arial, sans-serif; }
body.cw-member #cw-sign-out { background: transparent; border: 0; padding: 0 4px; cursor: pointer; }
body.cw-member [hidden] { display: none !important; }
body.cw-member .cw-sidebar-nav a[aria-current=page] { background: #e4edd3; font-weight: bold; border-left: 3px solid #78964f; padding-left: 10px; }
body.cw-member #app { min-height: 420px; min-width: 0; font: 1.125rem/1.6 Arial, Helvetica, sans-serif; overflow-wrap: anywhere; }
body.cw-member #app .wrapper { max-width: none !important; background: #fff; min-height: 0 !important; margin: 0; }
body.cw-member #app .top-area { position: static !important; padding: 22px 2px 14px !important; margin: 0 !important; background: #fff !important; background-image: none !important; border-radius: 0 !important; border-bottom: 2px solid #6b894c; min-height: 0 !important; height: auto !important; }
body.cw-member #app .top-area > img { display: none; }
body.cw-member #app .top-area td, body.cw-member #app .top-area span { font-family: Arial, Helvetica, sans-serif; color: #345532; }
body.cw-member #app .top-area table { width: 100%; table-layout: fixed; }
body.cw-member #app .top-area td:first-child, body.cw-member #app .top-area td:last-child { width: 48px; }
body.cw-member #app .top-area a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
body.cw-member #app .reg-main { margin: 0 !important; padding: 24px 0 !important; border-radius: 0 !important; max-width: 620px; background: #fff; }
body.cw-member #app .reg-main h2 { font: bold 2rem/1.2 Georgia, serif; color: #315333; text-align: left; margin-bottom: 15px; }
body.cw-member #app .reg-main > p { text-align: left; font: 1.125rem/1.6 Arial, sans-serif; color: #4f5d43; margin-bottom: 18px; }
body.cw-member #app .reg-main p br { display: none; }
body.cw-member #app .reg-main .form-group { margin: 0; padding: 0; border-radius: 0; }
body.cw-member #app .reg-main div { border-radius: 0; }
body.cw-member #app .form-control, body.cw-member #app .form-select { border: 1px solid #879875 !important; border-radius: 2px !important; font-family: Arial, Helvetica, sans-serif; padding: 10px 12px !important; background: #fff !important; color: #354832 !important; box-shadow: none !important; margin-bottom: 12px; }
body.cw-member #app .reg-main label.visually-hidden { position: static !important; width: auto !important; height: auto !important; clip: auto !important; white-space: normal !important; display: block; font-size: 1rem; font-weight: bold; margin: 10px 0 6px !important; }
body.cw-member #app .frm-sub { position: static !important; bottom: auto !important; width: auto !important; padding: 8px 0 !important; margin: 0 !important; text-align: left !important; background: none !important; box-shadow: none !important; }
body.cw-member #app .frm-sub button { width: auto !important; padding: 10px 28px !important; min-height: 48px; border-radius: 2px !important; background: #315b36 !important; color: #fff; font: bold 1.125rem/1.5 Arial, sans-serif; margin: 0 !important; }
body.cw-member #app .frm-sub h4 { display: none; }
body.cw-member #app .frm-sub a { display: flex; align-items: center; width: fit-content; min-height: 44px; margin: 12px 0 0; font: 1rem/1.5 Arial, sans-serif; color: #36582c; }
body.cw-member #app .guest-entry { text-align: left; margin: 12px 0 !important; padding: 8px 0; border-top: 1px solid #d2dcc6; }
body.cw-member #app .guest-entry h4 { display: none; }
body.cw-member #app .guest-entry a { display: inline-flex; align-items: center; min-height: 44px; font: 1rem/1.5 Arial, sans-serif; }
body.cw-member #app .footer-area, body.cw-member #app .bottom-nav { display: none !important; }
body.cw-member #app .tp-tbl { padding: 14px 0 !important; }
body.cw-member #app .time-date-area { margin: 0 !important; padding: 18px 0 !important; border-radius: 0 !important; background: #fff; }
body.cw-member #app .text-box { padding: 16px !important; border: 1px solid #d1dcc3; border-radius: 2px !important; margin-bottom: 15px !important; box-shadow: none !important; }
body.cw-member #app .text-box h3 { font: 700 1.5rem/1.25 Georgia, serif; color: #315734; }
body.cw-member #app :is(button, input, select, textarea), body.cw-member .modal :is(button, input, select, textarea) { font-family: Arial, Helvetica, sans-serif; font-size: 1.125rem !important; max-width: 100%; }
body.cw-member #app :is(button, input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea), body.cw-member .modal :is(button, input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea) { min-height: 48px; }
body.cw-member #app :is(input:not([type=checkbox]):not([type=radio]), select, textarea), body.cw-member .modal :is(input:not([type=checkbox]):not([type=radio]), select, textarea) { min-width: 0; box-sizing: border-box; }
/* WebKit draws a native menulist at its own height and ignores min-height, so
   the 48px target is enforced by dropping the native chrome and drawing the
   chevron here. The popup itself stays native. */
body.cw-member #app select, body.cw-member .modal select { -webkit-appearance: none; appearance: none; padding-right: 2.25rem !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10' viewBox='0 0 16 10'%3E%3Cpath d='M1 1l7 7 7-7' fill='none' stroke='%23395333' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .75rem center; background-size: 1rem .625rem; }
/* The loose-plan date window (wave 20) lays two date inputs side by side; at
   phone widths their intrinsic width, enlarged by the 18px web font, must not
   push the row past the viewport. */
body.cw-member #app #editForm [style*="flex: 1"] { min-width: 0; }
body.cw-member #app #editForm input[type="date"] { min-width: 0; width: 100%; }
body.cw-member #app :is(button, [role=button]), body.cw-member .modal button { white-space: normal; overflow-wrap: anywhere; }
body.cw-member #app :is(a, button, input, select, textarea, [tabindex]):focus-visible, body.cw-member .modal :is(a, button, input, select, textarea, [tabindex]):focus-visible { outline: 3px solid #956117; outline-offset: 3px; }
body.cw-member #app table { max-width: 100%; }
body.cw-member #app [class$="-container"] { max-width: 100%; min-width: 0; }
body.cw-member #initial-loader { height: 400px !important; background: #fff !important; }
body.cw-member #app .reg-main .top-area { display: none; }
body.cw-member #app [class*="card"] { border-radius: 3px; }
body.cw-member .cw-footer a { color: #486641; }
body.cw-member #app .cw-tournaments, body.cw-member #app .cw-booking { font-family: Arial, Helvetica, sans-serif; }
body.cw-member .cw-booking .cw-button-secondary { color: #315334 !important; }

/* Legacy screens inject small pixel sizes, including inline styles. This
   floor inherits the parent size without multiplying at each nesting level.
   Semantic headings and icon glyphs retain their separate typography. */
body.cw-member #app .wrapper :where(div, p, span, a, label, small, button, input, select, textarea, th, td, li, dt, dd, legend),
body.cw-member .modal :where(div, p, span, a, label, small, button, input, select, textarea, th, td, li, dt, dd, legend) { font-size: max(1rem, 1em) !important; line-height: 1.5; }
body.cw-member #app .wrapper :is(.stat-value, .tournament-name, .tournament-title) { font-size: 1.5rem !important; line-height: 1.25; }
body.cw-member #app .wrapper .ace-field { font-size: 1.625rem !important; }
body.cw-member #app .wrapper .format-icon { font-size: 1.75rem !important; }
body.cw-member #app .wrapper :is(h4, h5, h6) { font-size: max(1.125rem, 1em); }
body.cw-member #app :is(.wizard-btn.primary, .ace-submit, .gs-tab[aria-selected="true"], .status-btn.primary) { background: #315b36; border-color: #315b36; color: #fff; }
body.cw-member #app :is(.create-org-link, .player-count-btn.selected, .host-icon, .org-check, .host-check, .stat-value) { color: #345b2b; }
body.cw-member #app .wrapper :is(h1, h2, h3, h4, h5, h6) { overflow-wrap: anywhere; }
body.cw-member #app .wrapper :is(.form-group, .host-info, .org-name, .action-info, .wizard-round-card, .optional-section, .form-check) { min-width: 0; }
body.cw-member #app :is(.host-icon, .org-logo, .action-icon, .host-check, .org-check, .action-arrow) { flex-shrink: 0; }
body.cw-member #app .create-tournament-wrapper { overflow: visible; }
body.cw-member #app .create-tournament-wrapper .content-area { box-shadow: none; }
body.cw-member #app .datetime-row > .form-group { min-width: 0; }
body.cw-member #app .format-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.cw-member #app .quick-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body.cw-member #app :is(.wizard-nav, .lifecycle-actions, .lifecycle-toggles, .lifecycle-reason-buttons, .status-actions) { flex-wrap: wrap; }
body.cw-member #app :is(.wizard-btn, .lifecycle-toggle, .status-btn) { min-width: 0; }
body.cw-member #app :is(.course-dropdown, .organizations-list) { max-height: min(22rem, 60vh); overscroll-behavior-y: contain; }
body.cw-member #app :is(.course-option, .optional-toggle, .checkbox-item) { min-height: 48px; }
body.cw-member #app .toggle-switch { flex-shrink: 0; }
body.cw-member #app .toast { max-width: calc(100vw - 32px); overflow-wrap: anywhere; }
body.cw-member #app .gs-table th { white-space: nowrap; letter-spacing: 0; }
body.cw-member #app .gs-table :is(th, td) { padding: 10px 4px; }

/* Tournament editors mount on body, outside the router's #app. */
body.cw-member .modal { font: 1.125rem/1.5 Arial, Helvetica, sans-serif; padding: 12px !important; overflow-x: hidden; overflow-y: auto; }
body.cw-member .modal-dialog { width: 100%; max-width: 720px; margin: 0 auto; }
body.cw-member .modal-dialog-centered { min-height: calc(100% - 24px); }
body.cw-member .modal-dialog-scrollable { height: calc(100% - 24px); }
body.cw-member .modal-content { min-width: 0; border-radius: 3px; overflow-wrap: anywhere; }
body.cw-member .modal-header { align-items: flex-start; gap: 12px; }
body.cw-member .modal-title { font: bold 1.5rem/1.3 Georgia, serif !important; }
body.cw-member .modal .btn-close { box-sizing: border-box; min-width: 48px; flex-shrink: 0; margin: -8px -8px -8px auto; }
body.cw-member .modal :is(.form-text, .form-check-label, .form-label, .text-muted, .small) { font-size: 1rem !important; color: #4f5848; }
body.cw-member .modal .form-check { min-height: 44px; }
body.cw-member .modal .form-check-label { display: block; padding: 6px 0; }
body.cw-member .modal input:is([type=checkbox], [type=radio]) { width: 22px; height: 22px; margin-top: 8px; }
body.cw-member .modal .modal-footer { gap: 8px; }
body.cw-member .modal .modal-footer > * { margin: 0; }
body.cw-member .cw-table-scroll-hint { margin: 0; padding: 10px 12px; background: #f3f1e4; color: #4c563e; border-bottom: 1px solid #ccd1be; font: 1rem/1.5 Arial, Helvetica, sans-serif; }

/* --- Web-frame placement fixes (visual regression, September 2026) ------
   The mobile screens position a few things against the phone's tall green
   header, its bottom bar or its viewport. In the web frame the header is a
   slim bar and there is no bottom bar, so those elements landed on top of
   other content. */
/* The tournament card pulls up over the phone header by design; here it was
   covering the title and back button. */
body.cw-member #app :is(.tournament-content, .tournaments-content) { margin-top: 12px !important; }
/* Floating create/invite buttons sit in the header row's empty right slot
   instead of over the list. */
body.cw-member #app .wrapper { position: relative; }
body.cw-member #app :is(.create-fab, .create-league-fab, .invite-btn) { position: absolute !important; top: 14px !important; right: 6px !important; bottom: auto !important; left: auto !important; width: 44px !important; height: 44px !important; font-size: 20px !important; z-index: 5; }
/* The provider page anchors its back arrow to the phone's status bar; keep
   it inside the provider hero here. */
body.cw-member #app .profile-wrapper { position: relative; }
body.cw-member #app .profile-wrapper .back-btn { top: 12px; left: 12px; }
/* The swipe deck sizes itself to the phone viewport, which left the Pass and
   Like controls floating over the photo in a short browser window. */
body.cw-member #app .swipe-container { height: max(640px, calc(100vh - 380px)) !important; min-height: 0 !important; }
/* Column headings and status pills stay on one line at the web font size. */
body.cw-member #app :is(.tr-score, .lb-thru, .lb-score, .lb-pos, .status-badge, .league-status, .role-badge) { white-space: nowrap; }
body.cw-member #app .lb-thru { margin-right: 12px; }
@media (max-width: 480px) {
  body.cw-member #app .info-card .info-grid { grid-template-columns: minmax(0, 1fr); }
  body.cw-member #app .tab-nav { overflow-x: auto; }
  body.cw-member #app .tab-nav .tab-btn { white-space: nowrap; overflow-wrap: normal; flex: 0 0 auto; }
}

@media (min-width: 1101px) {
  body.cw-member[data-member-route=dashboard] #app .time-date-area { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  body.cw-member[data-member-route=dashboard] #app .time-date-area .text-box:first-of-type { grid-column: 1 / -1; }
  body.cw-member[data-member-route=dashboard] #app .time-date-area .text-box { margin-bottom: 0 !important; }
}
@media (max-width: 1100px) {
  body.cw-member .cw-workspace { display: block; }
  body.cw-member .cw-workspace > .cw-left { display: none; }
  body.cw-member .cw-member-main { padding: 0 16px 20px; }
  body.cw-member #app .reg-main { max-width: none; }
}
@media (max-width: 700px) {
  body.cw-member .cw-workspace { margin-top: 13px; }
  body.cw-member .cw-member-main { padding: 0 12px 16px; }
  body.cw-member #app .reg-main { padding: 20px 0 !important; }
  body.cw-member .cw-workspace-bar > div { gap: 8px 16px; }
  body.cw-member #app .reg-main h2 { font-size: 1.75rem; }
  body.cw-member #app .datetime-row { flex-direction: column; gap: 0; }
  body.cw-member #app :is(.wizard-round-card, .optional-section, .tournament-info-header) { padding: 12px; }
  body.cw-member #app .action-item { padding: 12px; gap: 10px; }
  body.cw-member .modal .row > [class*="col-"] { width: 100%; }
  body.cw-member .modal :is(.modal-header, .modal-body, .modal-footer) { padding: 12px; }
}
@media (max-width: 420px) {
  body.cw-member .cw-member-main { padding: 0 10px 16px; }
  body.cw-member #app .format-grid { grid-template-columns: minmax(0, 1fr); }
  body.cw-member #app .quick-stats { gap: 6px; }
  body.cw-member #app .stat-card { padding: 10px 4px; }
  body.cw-member #app :is(.wizard-nav, .lifecycle-toggles, .lifecycle-reason-buttons, .status-actions) { flex-direction: column; }
  body.cw-member #app .host-option { gap: 10px; padding: 12px; }
  body.cw-member #app :is(.ace-wrap, .gs-wrap) { padding-left: 0; padding-right: 0; }
  body.cw-member #app .frm-sub button { width: 100% !important; }
  body.cw-member .modal .modal-footer { flex-direction: column; align-items: stretch; }
}
@media print {
  body.cw-member .cw-member-main { border: 0; padding: 0; }
  body.cw-member .cw-workspace-bar { display: none; }
  body.cw-member #app { min-height: 0 !important; }
}
