/* Keep long participant names within the profile card. */
.profile-grid>.panel,.profile-card>div{min-width:0}
.profile-card>div{flex:1}
.profile-card .avatar{flex:0 0 66px}
.profile-card h2,.profile-card p{overflow-wrap:anywhere}

/* Let the tournament picker share space with the heading at tablet widths. */
.manager-heading{align-items:flex-start;flex-wrap:wrap}
.manager-heading>div:first-child{flex:1 1 260px}
.manager-heading>.action-row{min-width:0;max-width:100%;flex:1 1 360px;justify-content:flex-end}
/* Safari must not propagate native option widths into the page scroller. */
.manager-heading [data-manager-select]{min-width:0;max-width:100%;width:0;flex:1 1 180px;text-overflow:ellipsis;contain:layout}
.manager-top>*,.manager-stats>*,.manager-tools>.action-row{min-width:0}

/* The desktop level table retains its columns; narrow forms use labelled cards. */
.level-value,.level-break{min-width:0}
.level-value{display:block}
.level-break{display:flex;align-items:center;justify-content:center}
.level-value>span,.level-break>span{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}

@media(max-width:900px){
  .btn.small{min-width:44px}
  .seating-panel .seat{min-height:44px;font-size:11px}
  .seating-panel .seat .seat-number{width:16px;height:18px;font-size:10px;flex:none}
  .story-topline .icon-btn{width:44px;min-width:44px;height:44px}
  .story-bottom button{min-height:44px;min-width:44px}
  .content .mode-switch button,.filters .filter{min-height:44px;font-size:12px}
  .content .mode-switch button{padding:10px 13px}
  .filters .filter{padding:10px 15px}
  .profile-card p,.profile-invite p,.form-help,.field small,.club-service-notice small{font-size:12px;line-height:1.7}
  .tournament-meta{font-size:11px;line-height:1.8}
  .registration-note{font-size:12px}
}

@media(max-width:600px){
  .level-editor{overflow:visible}
  .level-editor-inner{min-width:0}
  .level-labels{display:none}
  .level-row[data-level-row]{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:16px;margin-bottom:12px;border:1px solid var(--line);border-radius:10px;background:#ffffff02}
  .level-row [data-level-number]{grid-column:1;grid-row:1;align-self:center;font-size:13px;line-height:1.6;color:var(--gold-light)}
  .level-row:not(.is-break) [data-level-number]::before{content:'Уровень '}
  .level-row [data-action="level-remove"]{grid-column:2;grid-row:1;justify-self:end;min-width:44px;min-height:44px}
  .level-value{display:grid;gap:7px}
  .level-value>span,.level-break>span{position:static;width:auto;height:auto;overflow:visible;clip:auto;white-space:normal;font-size:11px;line-height:1.5}
  .level-row .level-value>input{min-height:46px;font-size:16px;padding:11px 10px}
  .level-break{grid-column:1/-1;justify-content:flex-start;gap:10px;min-height:44px}
  .level-break>input[type="checkbox"]{width:20px;height:20px;margin:0;flex:none}
  .level-row.is-break [data-level-number]{font-size:13px}
}

@media(max-width:420px){
  .profile-card{flex-direction:column;align-items:flex-start;gap:14px}
  .profile-card>div{flex:auto;width:100%}
}

/* Release 2: identity and consent forms remain comfortable on narrow screens. */
.auth-identity-fields{display:grid;gap:18px}
.signup-consents{display:grid;gap:15px}
.consent-check{display:flex;align-items:flex-start;gap:11px;font-size:12px;line-height:1.75;color:var(--muted)}
.consent-check input{width:20px;height:20px;flex:none;margin:3px 0 0;accent-color:var(--gold)}
.consent-check span{min-width:0;overflow-wrap:anywhere}
.consent-check a,.privacy-panel a{color:var(--gold-light);text-decoration:underline;text-underline-offset:3px}
.participant-search{max-width:520px;margin:0 0 18px}
.participant-search input{min-height:46px}
.participant-search small:empty{display:none}
.rebuy-status{display:flex;align-items:center;flex-wrap:wrap;gap:7px 12px;margin:10px 0;color:var(--gold-light);font-size:12px;line-height:1.7}
.rebuy-status strong{font-variant-numeric:tabular-nums;font-size:18px;white-space:nowrap}
.rebuy-status small{font-size:12px;color:var(--muted)}
.rebuy-status.final{color:var(--danger)}
.rebuy-status.final span{overflow-wrap:anywhere}
.manager-player-panel .rebuy-status{max-width:220px;min-width:140px}
.manager-player-panel [data-participant-row][hidden]{display:none}
.content:has(.manager-heading) .manager-tools .btn,.content:has(.manager-heading) .purchase-row .btn{font-size:12px;min-height:40px;padding:10px 12px}
.content:has(.manager-heading) .stat-top,.content:has(.manager-heading) .stat-sub,.content:has(.manager-heading) .purchase-detail,.content:has(.manager-heading) .manager-clock .small{font-size:12px;line-height:1.7}
.content:has(.manager-heading) .purchase-head{font-size:14px}
.content:has(.manager-heading) .manager-player-panel .data-table td{font-size:13px}
.content:has(.manager-heading) .manager-player-panel .data-table th{font-size:11px}
.content:has(.manager-heading) .manager-player-panel .data-table .btn{font-size:12px;min-height:40px}
.content:has(.manager-heading) .seating-panel .seat{font-size:11px;min-height:38px}
.rating-editor-section{min-width:0;margin:16px 0 0;padding:0;border:0}
.rating-editor-section[hidden]{display:none}
.rating-formula{padding:18px;border:1px solid var(--line);border-radius:12px;background:rgba(201,174,114,.04)}
.rating-formula>p{font-size:13px;line-height:1.8;color:var(--muted);margin:0 0 12px}
.rating-formula>p strong{color:var(--gold-light)}
.rating-formula .rating-formula-note{padding:10px 12px;border-left:2px solid var(--gold);color:var(--text)}
.rating-formula>.field{margin:18px 0 14px}
.rating-example-summary{display:flex;flex-wrap:wrap;justify-content:space-between;gap:10px;font-size:12px;margin-bottom:12px;color:var(--muted)}
.rating-example-summary strong{display:block;color:var(--gold-light);font-size:22px;margin-top:4px}
.rating-example-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.rating-example-grid>div{padding:12px 8px;background:rgba(0,0,0,.18);border-radius:8px;min-width:0}
.rating-example-grid span{display:block;font-size:11px;color:var(--muted)}
.rating-example-grid strong{display:block;margin-top:5px;font-size:17px;color:var(--gold-light);overflow-wrap:anywhere}
@media(max-width:430px){.rating-formula{padding:12px}.rating-example-grid strong{font-size:15px}.rating-example-grid span{font-size:11px}}
@media(max-width:900px){
  .content:has(.manager-heading) .manager-tools .btn,.content:has(.manager-heading) .purchase-row .btn,.content:has(.manager-heading) .manager-player-panel .data-table .btn,.content:has(.manager-heading) .seating-panel .seat{min-height:44px}
  .consent-check{font-size:13px;min-height:44px}
}

.manager-stats .rating-base-stat .stat-sub{display:block;font-size:12px;line-height:1.6}

/* A visible, session-scoped override indicator follows the administrator. */
.superadmin-mode>.topbar{position:relative}
.superadmin-banner{position:sticky;top:0;z-index:19;display:flex;align-items:center;justify-content:space-between;gap:16px;min-width:0;padding:12px 28px;background:#44351b;color:#fff0cf;border-block:1px solid #c9a15880;box-shadow:0 4px 16px #0003}
.superadmin-banner>div{min-width:0}
.superadmin-banner strong{display:block;font-size:14px;line-height:1.45}
.superadmin-banner span{display:block;font-size:12px;line-height:1.5;color:#e2ceb0}
.superadmin-banner .btn{flex-shrink:0;min-height:44px;border-color:#e7cfa270;color:#fff0cf;background:#ffffff08}
.superadmin-panel{margin-bottom:22px;border-color:#c9a1584d}
.superadmin-panel>p{max-width:82ch;font-size:14px;line-height:1.75;color:var(--muted)}
.superadmin-panel>.form-help{margin-top:12px;font-size:12px}
.superadmin-panel .panel-heading{flex-wrap:wrap}
.superadmin-panel .form-actions>.btn{max-width:100%;white-space:normal;text-align:center}
@media(max-width:900px){
  .superadmin-banner{padding:10px max(14px,env(safe-area-inset-right,0px)) 10px max(14px,env(safe-area-inset-left,0px));gap:10px}
  .superadmin-banner strong{font-size:12px}
  .superadmin-banner span{font-size:11px}
  .superadmin-banner .btn.small{font-size:11px;padding:8px 10px}
  .superadmin-panel>p{font-size:13px}
}
