:root {
      --club-color: #155e3b;
      --club-dark: #102b20;
      --club-soft: #d8f3dc;
      --green: var(--club-color);
      --green-2: #1f8a5b;
      --line: #d9e3dc;
      --muted: #63736a;
      --panel: #ffffff;
      --soft: #eef6f2;
      --warn: #b45309;
      --danger: #b91c1c;
      --blue: #1d4ed8;
      --text: #15231b;
      --shadow-sm: 0 1px 2px rgba(16,43,32,.05);
      --shadow-md: 0 10px 28px rgba(16,43,32,.08);
      --shadow-lg: 0 24px 70px rgba(0,0,0,.28);
      color-scheme: light;
    }

    * { box-sizing: border-box; }

    [hidden] {
      display: none !important;
    }

    html {
      min-height: 100%;
      background: var(--club-dark);
    }

    body {
      margin: 0;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      background: #f6f8f6;
      color: var(--text);
      min-height: 100%;
      -webkit-font-smoothing: antialiased;
      text-size-adjust: 100%;
    }

    ::selection {
      background: color-mix(in srgb, var(--green) 24%, transparent);
    }

    button, input, select, textarea {
      font: inherit;
    }

    button {
      border: 0;
      border-radius: 8px;
      cursor: pointer;
      min-height: 44px;
      touch-action: manipulation;
      transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease, color .16s ease, border-color .16s ease, filter .16s ease;
    }

    button:hover:not(:disabled) {
      transform: translateY(-1px);
    }

    button:active:not(:disabled) {
      transform: translateY(0);
    }

    button:disabled {
      cursor: not-allowed;
      opacity: .6;
    }

    button:focus-visible,
    input:focus-visible,
    select:focus-visible,
    textarea:focus-visible,
    [contenteditable="true"]:focus-visible {
      outline: 3px solid color-mix(in srgb, var(--green) 34%, transparent);
      outline-offset: 2px;
    }

    .app-shell {
      min-height: 100vh;
      display: grid;
      grid-template-columns: 280px 1fr;
    }

    .login-screen {
      position: fixed;
      inset: 0;
      z-index: 100;
      display: none;
      align-items: center;
      justify-content: flex-end;
      padding: clamp(14px, 3vw, 28px) max(24px, 8vw);
      overflow: auto;
      background:
        linear-gradient(rgba(2,18,14,.18), rgba(2,18,14,.18)),
        url("../assets/kadrivo-login-banner.jpg") left max(24px, 8vw) center / min(620px, 46vw) auto no-repeat,
        radial-gradient(circle at 50% 50%, transparent 0 58px, rgba(255,255,255,.28) 59px 61px, transparent 62px),
        linear-gradient(90deg, transparent calc(50% - 1px), rgba(255,255,255,.22) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
        linear-gradient(rgba(255,255,255,.18) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.10) 1px, transparent 1px),
        linear-gradient(135deg, #0b3d28 0%, #155e3b 52%, #0a281b 100%);
      background-size: 100% 100%, min(620px, 46vw) auto, 100% 100%, 100% 100%, 100% 76px, 76px 100%, 100% 100%;
    }

    body.needs-login .login-screen {
      display: flex;
    }

    body.needs-login .app-shell {
      display: none;
    }

    .login-promo-link {
      position: fixed;
      left: max(24px, 8vw);
      top: 50%;
      width: min(620px, 46vw);
      aspect-ratio: 1;
      transform: translateY(-50%);
      z-index: 101;
      border-radius: 18px;
    }

    .login-panel {
      position: relative;
      z-index: 102;
      width: min(520px, calc(100vw - 32px));
      max-height: calc(100svh - 28px);
      overflow: auto;
      background: rgba(255,255,255,.96);
      border-radius: 8px;
      padding: 22px;
      box-shadow: var(--shadow-lg);
      display: grid;
      gap: 14px;
      backdrop-filter: blur(8px);
      border: 1px solid rgba(255,255,255,.72);
      animation: loginCardIn .22s ease-out;
    }

    @keyframes loginCardIn {
      from { opacity: 0; transform: translateY(10px) scale(.99); }
      to { opacity: 1; transform: translateY(0) scale(1); }
    }

    .login-panel .field,
    .login-panel input,
    .login-panel select,
    .login-panel textarea,
    .login-panel button {
      min-width: 0;
      width: 100%;
    }

    .login-panel > .btn-secondary {
      width: 100%;
    }

    .login-panel h1 {
      margin: 0;
      font-size: 1.45rem;
    }

    .login-panel p {
      margin: 0;
      color: var(--muted);
      line-height: 1.4;
    }

    .public-login-hint {
      padding: 12px 13px;
      border: 1px solid color-mix(in srgb, var(--green) 18%, var(--line));
      border-radius: 8px;
      background: linear-gradient(135deg, #f3f8f5 0%, #ffffff 100%);
    }

    .login-install {
      margin-top: 4px;
      padding: 12px;
      background: #f3f8f5;
      border: 1px solid var(--line);
      border-radius: 8px;
      overflow: hidden;
      align-items: stretch;
    }

    .club-share {
      display: grid;
      grid-template-columns: 74px minmax(0, 1fr);
      gap: 10px;
      align-items: center;
      margin-top: 10px;
    }

    .club-share img {
      width: 74px;
      height: 74px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
      padding: 5px;
    }

    .club-share span {
      display: block;
      color: var(--muted);
      font-size: .78rem;
      font-weight: 800;
      margin-bottom: 3px;
    }

    .club-share a {
      display: block;
      max-width: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      color: var(--green);
      font-size: .82rem;
      font-weight: 800;
      margin-bottom: 8px;
    }

    .login-install > div:first-child {
      min-width: 0;
    }

    .login-install .row-actions {
      align-items: stretch;
      min-width: min(160px, 100%);
    }

    .sidebar {
      background: var(--club-dark);
      color: #fff;
      padding: 22px;
      display: flex;
      flex-direction: column;
      gap: 22px;
    }

    .license-badge {
      margin-bottom: -12px;
      color: rgba(255,255,255,.72);
      font-size: .7rem;
      font-weight: 800;
      letter-spacing: .01em;
      line-height: 1.25;
    }

    .license-badge.warning {
      color: #fde68a;
    }

    .license-badge.expired {
      color: #fecaca;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .brand-mark {
      width: 44px;
      height: 44px;
      border-radius: 8px;
      display: grid;
      place-items: center;
      background: var(--club-soft);
      color: var(--club-dark);
      font-weight: 900;
      overflow: hidden;
      flex: 0 0 auto;
    }

    .brand-mark img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      padding: 3px;
    }

    .brand-mark.app-logo img {
      object-fit: cover;
      padding: 0;
    }

    .brand h1 {
      font-size: 1.1rem;
      line-height: 1.15;
      margin: 0;
    }

    .app-version {
      color: #b6cec2;
      font-size: .62rem;
      font-weight: 800;
      vertical-align: middle;
      white-space: nowrap;
    }

    .brand span {
      color: #b6cec2;
      font-size: .88rem;
    }

    .profile-card {
      border: 1px solid rgba(255,255,255,.14);
      border-radius: 8px;
      padding: 14px;
      background: rgba(255,255,255,.06);
    }

    .profile-card label {
      display: block;
      margin-bottom: 6px;
      color: #d5e8df;
      font-size: .84rem;
    }

    .profile-card input, .profile-card select {
      width: 100%;
      border: 1px solid rgba(255,255,255,.2);
      background: #0a2017;
      color: #fff;
      border-radius: 6px;
      padding: 10px;
      margin-bottom: 10px;
    }

    .tenant-card {
      border: 1px solid rgba(255,255,255,.14);
      border-radius: 8px;
      padding: 14px;
      background: rgba(255,255,255,.06);
    }

    .tenant-card label {
      display: block;
      margin-bottom: 6px;
      color: #d5e8df;
      font-size: .84rem;
    }

    .tenant-card select, .tenant-card input {
      width: 100%;
      border: 1px solid rgba(255,255,255,.2);
      background: #0a2017;
      color: #fff;
      border-radius: 6px;
      padding: 10px;
      margin-bottom: 10px;
    }

    .tenant-actions {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 8px;
    }

    .tenant-actions button {
      min-height: 40px;
      padding: 0 12px;
      background: var(--club-soft);
      color: var(--club-dark);
      font-weight: 800;
    }

    .logout-btn {
      width: 100%;
      min-height: 36px;
      border: 1px solid rgba(255,255,255,.2);
      background: transparent;
      color: #d5e8df;
      font-weight: 800;
    }

    .logout-btn:hover:not(:disabled) {
      background: rgba(255,255,255,.08);
      border-color: rgba(255,255,255,.38);
      color: #fff;
    }

    .nav {
      display: grid;
      gap: 8px;
    }

    .nav button {
      display: flex;
      align-items: center;
      gap: 10px;
      color: #d5e8df;
      background: transparent;
      text-align: left;
      padding: 10px 11px;
      border-radius: 8px;
      position: relative;
      border: 1px solid transparent;
    }

    .nav button:hover:not(.active):not(:disabled) {
      background: rgba(255,255,255,.09);
      border-color: rgba(255,255,255,.12);
      color: #fff;
    }

    .nav button[hidden] {
      display: none !important;
    }

    .nav button.active {
      background: linear-gradient(135deg, var(--club-soft), #ffffff);
      color: var(--club-dark);
      font-weight: 800;
      box-shadow: 0 8px 20px rgba(0,0,0,.12);
    }

    .nav-label {
      min-width: 0;
    }

    .nav-icon {
      width: 25px;
      height: 25px;
      border-radius: 7px;
      display: inline-grid;
      place-items: center;
      flex: 0 0 auto;
      background: rgba(255,255,255,.08);
      color: currentColor;
      font-size: .86rem;
      line-height: 1;
    }

    .nav button.active .nav-icon {
      background: rgba(21,94,59,.12);
    }

    .nav-badge {
      min-width: 18px;
      height: 18px;
      border-radius: 999px;
      background: var(--danger);
      box-shadow: 0 0 0 2px rgba(255,255,255,.9);
      margin-left: auto;
      flex: 0 0 auto;
      display: inline-grid;
      place-items: center;
      padding: 0 5px;
      color: #fff;
      font-size: .68rem;
      font-weight: 900;
      line-height: 1;
    }

    .nav-badge[hidden] {
      display: none;
    }

    .install-panel {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
      padding: 14px;
      margin-bottom: 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      box-shadow: var(--shadow);
    }

    .install-panel[hidden] {
      display: none;
    }

    .install-panel h3 {
      margin: 0 0 4px;
    }

    .install-panel p {
      margin: 0;
      color: var(--muted);
    }

    .sync-status {
      margin-top: auto;
      font-size: .86rem;
      color: #cfe4d9;
      line-height: 1.45;
    }

    main {
      padding: 22px;
      overflow: auto;
    }

    .topbar {
      display: flex;
      justify-content: space-between;
      gap: 16px;
      align-items: flex-start;
      margin-bottom: 18px;
    }

    .topbar h2 {
      margin: 0 0 4px;
      font-size: clamp(1.55rem, 4vw, 2.25rem);
      letter-spacing: 0;
    }

    .topbar p {
      margin: 0;
      color: var(--muted);
    }

    .actions {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-end;
      gap: 8px;
    }

    .btn-primary {
      background: var(--green);
      color: #fff;
      padding: 0 14px;
      font-weight: 800;
    }

    .btn-secondary {
      background: #e5ece7;
      color: var(--text);
      padding: 0 14px;
      font-weight: 700;
    }

    .btn-danger {
      background: #fee2e2;
      color: var(--danger);
      padding: 0 12px;
      font-weight: 800;
    }

    .btn-primary:hover:not(:disabled) {
      filter: brightness(.96);
      box-shadow: 0 10px 22px rgba(21,94,59,.22);
    }

    .btn-secondary:hover:not(:disabled),
    .mini:hover:not(:disabled) {
      background: #dbe7df;
      box-shadow: 0 8px 18px rgba(16,43,32,.12);
    }

    .btn-danger:hover:not(:disabled),
    .mini.no:hover:not(:disabled) {
      background: #fecaca;
      box-shadow: 0 8px 18px rgba(185,28,28,.14);
    }

    .grid {
      display: grid;
      gap: 14px;
    }

    .grid.two {
      grid-template-columns: minmax(320px, .85fr) minmax(360px, 1.15fr);
      align-items: start;
    }

    .stats {
      grid-template-columns: repeat(4, minmax(160px, 1fr));
      margin-bottom: 16px;
    }

    .stat, .panel, .item {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 8px;
      box-shadow: var(--shadow-sm);
    }

    .stat {
      padding: 16px;
      background:
        linear-gradient(135deg, rgba(21,94,59,.06), transparent 52%),
        #fff;
    }

    .stat strong {
      display: block;
      font-size: 2rem;
      line-height: 1;
      color: var(--green);
    }

    .stat span {
      color: var(--muted);
      font-size: .9rem;
    }

    .panel {
      padding: 16px;
      transition: box-shadow .18s ease, border-color .18s ease;
    }

    .panel:hover {
      border-color: color-mix(in srgb, var(--green) 12%, var(--line));
      box-shadow: 0 8px 24px rgba(16,43,32,.06);
    }

    .panel h3 {
      margin: 0 0 12px;
      font-size: 1rem;
    }

    .form-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }

    .field {
      display: grid;
      gap: 6px;
      min-width: 0;
    }

    .field[hidden] {
      display: none !important;
    }

    .rich-toolbar {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }

    .rich-field {
      min-height: 120px;
      padding: 10px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
      color: var(--text);
      line-height: 1.35;
      overflow-wrap: anywhere;
    }

    .rich-field:focus {
      outline: 2px solid rgba(22,101,52,.18);
      border-color: rgba(22,101,52,.45);
    }

    .rich-field:empty::before {
      content: "Bemerkungen zur Einheit...";
      color: var(--muted);
    }

    .check-row {
      display: flex;
      align-items: center;
      gap: 9px;
      color: var(--text);
      font-size: .9rem;
      font-weight: 700;
    }

    .check-row input {
      width: auto;
      min-width: 18px;
      height: 18px;
    }

    .inline-checks {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
    }

    .module-toggle-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
    }

    .module-toggle {
      min-height: 46px;
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #f8fbf9;
      font-weight: 800;
      color: var(--text);
      cursor: pointer;
      transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
    }

    .module-toggle:hover {
      background: var(--soft);
      border-color: color-mix(in srgb, var(--green) 22%, var(--line));
      box-shadow: 0 8px 18px rgba(16,43,32,.08);
      transform: translateY(-1px);
    }

    .module-toggle input {
      width: 22px;
      min-width: 22px;
      height: 22px;
      accent-color: var(--green);
    }

    .safety-note {
      margin: 0 0 12px;
      padding: 12px 13px;
      border: 1px solid #fde68a;
      border-radius: 8px;
      background: #fffbeb;
      color: #713f12;
      line-height: 1.38;
      font-size: .9rem;
    }

    .safety-note strong {
      display: block;
      margin-bottom: 4px;
      color: #92400e;
    }

    .pro-card {
      display: grid;
      gap: 14px;
    }

    .subscription-choice {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
    }

    .subscription-choice label {
      display: flex;
      align-items: center;
      gap: 9px;
      min-height: 48px;
      padding: 10px 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--soft);
      font-weight: 850;
      cursor: pointer;
      transition: border-color .16s ease, background .16s ease, transform .16s ease;
    }

    .subscription-choice label:hover {
      border-color: var(--club);
      background: var(--club-soft);
      transform: translateY(-1px);
    }

    .subscription-choice input {
      width: 20px;
      height: 20px;
      accent-color: var(--club);
    }

    .paypal-live-mode {
      padding: 12px;
      border: 1px solid #fecaca;
      border-radius: 8px;
      background: #fff7f7;
    }

    .paypal-live-confirm {
      padding: 10px;
      border: 1px solid #fecaca;
      border-radius: 8px;
      background: #fff;
    }

    .sport-card-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }

    .sport-card {
      min-height: 86px;
      display: grid;
      place-items: center;
      gap: 5px;
      padding: 10px 8px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
      color: var(--text);
      text-align: center;
      cursor: pointer;
      transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
    }

    .sport-card:hover {
      border-color: color-mix(in srgb, var(--green) 28%, var(--line));
      box-shadow: 0 8px 18px rgba(16,43,32,.08);
      transform: translateY(-1px);
    }

    .sport-card input {
      position: absolute;
      opacity: 0;
      pointer-events: none;
    }

    .sport-card span {
      font-size: 1.55rem;
      line-height: 1;
    }

    .sport-card strong {
      font-size: .82rem;
      line-height: 1.1;
    }

    .sport-card:has(input:checked) {
      border-color: color-mix(in srgb, var(--green) 46%, var(--line));
      background: linear-gradient(135deg, var(--soft), #fff);
      box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 16%, transparent);
    }

    .staff-panel {
      margin-top: 14px;
    }

    .staff-inline {
      margin-top: 18px;
    }

    .self-profile-panel {
      align-self: start;
    }

    .self-profile-photo {
      grid-column: 1 / -1;
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 10px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #f8fbf9;
    }

    .self-vacation-box {
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 10px;
      background: #f8fbf9;
    }

    .field.full { grid-column: 1 / -1; }

    label {
      font-size: .82rem;
      color: var(--muted);
      font-weight: 750;
    }

    input, select, textarea {
      width: 100%;
      border: 1px solid var(--line);
      border-radius: 6px;
      padding: 10px 11px;
      background: #fff;
      color: var(--text);
      min-width: 0;
      font-size: 16px;
      transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
    }

    input:hover, select:hover, textarea:hover {
      border-color: color-mix(in srgb, var(--green) 20%, var(--line));
      background: #fbfdfc;
    }

    input:focus, select:focus, textarea:focus {
      border-color: color-mix(in srgb, var(--green) 42%, var(--line));
      box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 10%, transparent);
    }

    textarea {
      resize: vertical;
      min-height: 82px;
    }

    .list {
      display: grid;
      gap: 10px;
    }

    .player-filter {
      display: grid;
      gap: 6px;
      margin-bottom: 12px;
    }

    .item {
      padding: 13px;
      display: grid;
      gap: 10px;
    }

    .item-head {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: flex-start;
    }

    .item-head.temporary-transfer {
      opacity: .58;
      filter: grayscale(.85);
    }

    .transfer-note {
      background: #f1f3f2;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 8px 10px;
    }

    .item-head[data-toggle-event-details] {
      cursor: pointer;
    }

    .player-summary {
      display: flex;
      gap: 12px;
      align-items: flex-start;
    }

    .player-photo {
      width: 54px;
      height: 54px;
      border-radius: 8px;
      background: var(--club-soft);
      color: var(--green);
      display: grid;
      place-items: center;
      font-weight: 900;
      overflow: hidden;
      flex: 0 0 auto;
    }

    .player-photo img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .item-title {
      margin: 0;
      font-weight: 850;
      font-size: 1rem;
    }

    .player-title-row {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 7px;
      min-width: 0;
    }

    .status-badges {
      display: inline-flex;
      flex-wrap: wrap;
      gap: 4px;
    }

    .status-badge {
      width: 24px;
      height: 24px;
      border-radius: 999px;
      display: inline-grid;
      place-items: center;
      font-size: .76rem;
      font-weight: 900;
      line-height: 1;
      border: 1px solid transparent;
    }

    .status-badge.injured { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
    .status-badge.vacation { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
    .status-badge.unavailable { background: #fef3c7; color: #92400e; border-color: #fde68a; }
    .status-badge.youth { background: #ede9fe; color: #5b21b6; border-color: #ddd6fe; }

    .status-line {
      margin: -2px 0 0;
    }

    .availability-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px;
    }

    .availability-card {
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 10px;
      display: grid;
      gap: 8px;
      background: #f8fbf9;
    }

    .availability-card .check-row {
      font-size: .86rem;
    }

    .availability-card .period {
      display: grid;
      gap: 6px;
    }

    .form-details {
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 10px;
      background: #f8fbf9;
    }

    .form-details summary {
      cursor: pointer;
      font-weight: 850;
      color: var(--green);
      min-height: 32px;
      display: flex;
      align-items: center;
    }

    .form-details .form-grid {
      margin-top: 10px;
    }

    .meta {
      display: flex;
      flex-wrap: wrap;
      gap: 7px;
      color: var(--muted);
      font-size: .85rem;
    }

    .chip {
      display: inline-flex;
      align-items: center;
      min-height: 26px;
      border-radius: 999px;
      padding: 3px 9px;
      background: var(--soft);
      color: var(--green);
      font-weight: 750;
      font-size: .8rem;
    }

    .chip.warn { background: #fef3c7; color: var(--warn); }
    .chip.blue { background: #dbeafe; color: var(--blue); }
    .chip.red { background: #fee2e2; color: var(--danger); }

    .chip-list {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      min-height: 36px;
      align-items: center;
    }

    .chip-remove {
      min-height: 22px;
      width: 22px;
      margin-left: 6px;
      border-radius: 999px;
      background: rgba(0,0,0,.08);
      color: inherit;
      font-size: .9rem;
      font-weight: 900;
      line-height: 1;
    }

    .chip-remove:hover {
      background: rgba(185,28,28,.16);
      color: var(--danger);
    }

    .table-wrap {
      width: 100%;
      overflow: auto;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
    }

    .data-table {
      width: 100%;
      border-collapse: collapse;
      min-width: 760px;
    }

    .data-table th,
    .data-table td {
      padding: 10px 12px;
      border-bottom: 1px solid var(--line);
      text-align: left;
      vertical-align: top;
    }

    .data-table th {
      background: var(--soft);
      color: var(--muted);
      font-size: .82rem;
      text-transform: uppercase;
      letter-spacing: .04em;
    }

    .scouting-card {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 14px;
      align-items: start;
      border-left: 0;
    }

    .scouting-card.selected {
      border-color: color-mix(in srgb, var(--green) 45%, var(--line));
      background: linear-gradient(90deg, rgba(21,94,59,.08), #fff 34%);
      box-shadow: inset 0 0 0 2px rgba(21,94,59,.12);
    }

    .scouting-card-main {
      min-width: 0;
      display: grid;
      gap: 8px;
    }

    .scouting-card-main strong {
      font-size: 1.05rem;
      line-height: 1.2;
    }

    .scouting-card-main p {
      margin: 0;
      color: var(--muted);
      line-height: 1.35;
    }

    .scouting-card-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }

    .scouting-card-actions {
      justify-content: flex-end;
      min-width: min(100%, 320px);
    }

    .scouting-score-grid {
      display: grid;
      gap: 12px;
    }

    .scouting-category {
      background: #fff;
    }

    .scouting-score-table {
      display: grid;
      gap: 8px;
    }

    .scouting-score-row {
      display: grid;
      grid-template-columns: minmax(220px, 1fr) 90px minmax(180px, 1fr);
      gap: 8px;
      align-items: center;
    }

    .scouting-score-row label {
      font-size: .9rem;
      color: var(--text);
    }

    .paid-check {
      width: 26px;
      height: 26px;
      border-radius: 999px;
      display: inline-grid;
      place-items: center;
      background: #dcfce7;
      color: #166534;
      font-weight: 950;
    }

    .calendar-head {
      display: grid;
      grid-template-columns: 34px 1fr 34px;
      align-items: center;
      gap: 8px;
      margin-bottom: 8px;
    }

    .calendar-head h3 {
      margin: 0;
      text-align: center;
      font-size: .98rem;
    }

    .calendar-mode {
      display: flex;
      justify-content: center;
      gap: 6px;
      margin: 0 0 8px;
    }

    .calendar-mode .mini.active {
      background: var(--green);
      color: #fff;
      border-color: var(--green);
    }

    .icon-btn {
      width: 34px;
      height: 34px;
      padding: 0;
      display: inline-grid;
      place-items: center;
      border-radius: 8px;
      font-size: 1.05rem;
      font-weight: 900;
      background: var(--soft);
      color: var(--green);
    }

    .calendar-grid {
      display: grid;
      grid-template-columns: repeat(7, minmax(0, 1fr));
      border: 1px solid var(--line);
      border-radius: 8px;
      overflow: hidden;
      background: #fff;
    }

    .calendar-weekday,
    .calendar-day {
      min-width: 0;
      border-right: 1px solid var(--line);
      border-bottom: 1px solid var(--line);
    }

    .calendar-weekday:nth-child(7n),
    .calendar-day:nth-child(7n) {
      border-right: 0;
    }

    .calendar-weekday {
      padding: 6px 4px;
      background: #eef4f0;
      color: var(--muted);
      font-size: .72rem;
      font-weight: 850;
      text-align: center;
    }

    .calendar-day {
      min-height: 92px;
      padding: 6px;
      display: grid;
      align-content: start;
      gap: 5px;
      background: #fff;
    }

    .calendar-day.outside {
      background: #f5f7f5;
      color: #9aa7a0;
    }

    .calendar-day.sunday,
    .calendar-day.holiday {
      background: #fff7ed;
    }

    .calendar-date {
      display: flex;
      justify-content: space-between;
      gap: 6px;
      font-weight: 850;
      font-size: .86rem;
    }

    .holiday-name {
      color: var(--warn);
      font-size: .72rem;
      font-weight: 800;
      line-height: 1.15;
    }

    .calendar-event {
      border-radius: 6px;
      padding: 4px 5px;
      color: #fff;
      background: var(--green);
      font-size: .68rem;
      font-weight: 800;
      line-height: 1.15;
      overflow-wrap: anywhere;
      cursor: grab;
    }

    .calendar-event:active {
      cursor: grabbing;
    }

    .calendar-event.game { background: #1d4ed8; }
    .calendar-event.other { background: #64748b; }
    .calendar-event.birthday { background: #7c3aed; }
    .calendar-event.notice { background: #b45309; }

    .attendance-panel {
      display: grid;
      gap: 10px;
      margin-top: 10px;
      padding: 10px;
      border-radius: 8px;
      background: #f8fbf9;
      border: 1px solid var(--line);
    }

    .transport-panel {
      display: grid;
      gap: 8px;
      margin-top: 10px;
      padding: 10px;
      border-radius: 8px;
      background: #f8fbf9;
      border: 1px solid var(--line);
    }

    .transport-panel strong {
      font-size: .9rem;
    }

    .attendee-list {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 6px;
    }

    .attendee {
      display: inline-flex;
      align-items: center;
      min-height: 24px;
      border-radius: 999px;
      padding: 3px 8px;
      font-size: .78rem;
      font-weight: 750;
    }

    .attendee.yes {
      background: #dcfce7;
      color: #166534;
    }

    .attendee.no {
      background: #fee2e2;
      color: #991b1b;
    }

    .attendee.absent {
      background: #ffedd5;
      color: #9a3412;
    }

    .attendee.removed {
      background: #e5e7eb;
      color: #4b5563;
      text-decoration: line-through;
    }

    .attendee.transport-self,
    .legend-dot.transport-self {
      background: #e0f2fe;
      color: #075985;
    }

    .attendee.transport-offer,
    .legend-dot.transport-offer {
      background: #dcfce7;
      color: #166534;
    }

    .attendee.transport-passenger,
    .legend-dot.transport-passenger {
      background: #fef3c7;
      color: #92400e;
    }

    .transport-legend {
      display: flex;
      flex-wrap: wrap;
      gap: 8px 14px;
      margin-top: 8px;
      color: var(--muted);
      font-size: .78rem;
      font-weight: 700;
    }

    .transport-legend span {
      display: inline-flex;
      align-items: center;
      gap: 5px;
    }

    .legend-dot {
      width: 10px;
      height: 10px;
      border-radius: 999px;
      display: inline-block;
    }

    .attendee-x {
      min-width: 18px;
      height: 18px;
      min-height: 18px;
      margin-left: 5px;
      padding: 0 5px;
      border-radius: 999px;
      display: inline-grid;
      place-items: center;
      background: rgba(153,27,27,.14);
      color: #991b1b;
      font-size: .72rem;
      font-weight: 950;
      line-height: 1;
    }

    .attendee-x.undo {
      background: rgba(22,101,52,.14);
      color: #166534;
    }

    .attendee-x.remove {
      background: rgba(75,85,99,.16);
      color: #374151;
    }

    .table-wrap {
      overflow-x: auto;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
    }

    .fame-table {
      width: 100%;
      min-width: 680px;
      border-collapse: collapse;
      font-size: .9rem;
    }

    .fame-table th,
    .fame-table td {
      padding: 10px 12px;
      border-bottom: 1px solid var(--line);
      text-align: left;
      white-space: nowrap;
    }

    .fame-table th {
      background: #eef4f0;
      color: var(--muted);
      font-size: .76rem;
      text-transform: uppercase;
      letter-spacing: .02em;
    }

    .fame-table td:not(:nth-child(2)),
    .fame-table th:not(:nth-child(2)) {
      text-align: right;
    }

    .fame-table tr:last-child td {
      border-bottom: 0;
    }

    .fame-table tr.selected td {
      background: var(--club-soft);
    }

    .link-button {
      padding: 0;
      min-height: 0;
      border: 0;
      background: transparent;
      color: var(--green);
      font: inherit;
      font-weight: 850;
      text-align: left;
    }

    .score-badge {
      min-width: 48px;
      min-height: 38px;
      padding: 6px 10px;
      border-radius: 8px;
      display: inline-grid;
      place-items: center;
      background: var(--club-soft);
      color: var(--club-dark);
      font-weight: 950;
      font-size: 1.05rem;
      border: 1px solid rgba(21,94,59,.16);
    }

    .proof-image {
      width: min(100%, 360px);
      max-height: 260px;
      object-fit: cover;
      border-radius: 8px;
      border: 1px solid var(--line);
      background: #f5f7f5;
    }

    .cash-summary {
      grid-template-columns: repeat(3, minmax(120px, 1fr));
      margin-bottom: 14px;
    }

    .cash-form-note {
      align-self: end;
    }

    .row-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 7px;
    }

    .transfer-box {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #f8fbf9;
      padding: 10px;
    }

    .transfer-box summary {
      cursor: pointer;
      font-weight: 850;
    }

    .event-form-head {
      display: grid;
      gap: 14px;
    }

    .event-kind-actions {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 12px;
    }

    .event-kind-button {
      min-height: 58px;
      width: 100%;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #edf2ef;
      color: var(--text);
      font-size: 1rem;
      font-weight: 850;
      display: grid;
      place-items: center;
      box-shadow: inset 0 -1px 0 rgba(15, 23, 42, .04);
    }

    .event-kind-button:hover {
      background: var(--club-soft);
      color: var(--club);
    }

    .mini {
      min-height: 32px;
      padding: 0 10px;
      border-radius: 7px;
      background: #edf2ef;
      color: var(--text);
      font-weight: 750;
      font-size: .86rem;
      border: 1px solid transparent;
      box-shadow: 0 1px 0 rgba(15, 35, 27, .04), inset 0 -1px 0 rgba(15, 35, 27, .05);
      transition: background .14s ease, color .14s ease, border-color .14s ease, box-shadow .14s ease, transform .08s ease;
    }

    .mini:hover {
      background: #e1ebe6;
      border-color: #c5d8ce;
      box-shadow: 0 3px 10px rgba(15, 35, 27, .10), inset 0 -1px 0 rgba(15, 35, 27, .08);
      transform: translateY(-1px);
    }

    .mini:active {
      background: #d5e3dc;
      border-color: #aebfb6;
      box-shadow: inset 0 2px 6px rgba(15, 35, 27, .16);
      transform: translateY(1px) scale(.985);
    }

    .mini:focus-visible {
      outline: none;
      border-color: var(--club-color);
      box-shadow: 0 0 0 3px color-mix(in srgb, var(--club-color) 22%, transparent);
    }

    .mini.active {
      background: var(--primary);
      color: #fff;
    }

    .mini.yes { background: #dcfce7; color: #166534; }
    .mini.yes:hover {
      background: #bbf7d0;
      border-color: #86efac;
      color: #14532d;
    }
    .mini.yes:active {
      background: #a7f3c2;
      border-color: #4ade80;
    }
    .mini.no { background: #fee2e2; color: #991b1b; }
    .mini.maybe { background: #fef3c7; color: #92400e; }
    .mini:disabled {
      opacity: .58;
      cursor: default;
    }

    .progress {
      height: 9px;
      background: #e5ece7;
      border-radius: 999px;
      overflow: hidden;
    }

    .progress span {
      display: block;
      height: 100%;
      background: var(--green-2);
    }

    .performance-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
      gap: 8px;
    }

    .performance-item {
      background: #f7faf8;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 8px;
    }

    .performance-item strong {
      display: block;
      font-size: .78rem;
      color: var(--muted);
      margin-bottom: 2px;
    }

    .message-feed {
      min-height: 420px;
      max-height: 62vh;
      overflow: auto;
      padding: 12px;
      background: #edf4f0;
      border: 1px solid var(--line);
      border-radius: 8px;
      display: flex;
      flex-direction: column;
      gap: 9px;
    }

    .message-feed.group-mannschaft {
      background: #edf7ef;
      border-color: #cfe9d5;
    }

    .message-feed.group-trainer {
      background: #eef5ff;
      border-color: #c9dbf6;
    }

    .message-feed.group-kasse {
      background: #fff7e6;
      border-color: #f4d99b;
    }

    .message-feed.group-betreuer {
      background: #f4efff;
      border-color: #d8c8f4;
    }

    .message-feed.group-mannschaftsrat {
      background: #eef7f8;
      border-color: #bfdee2;
    }

    .bubble {
      max-width: min(720px, 92%);
      background: #fff;
      border: 1px solid #dfe9e3;
      border-radius: 8px;
      padding: 10px 12px;
      align-self: flex-start;
    }

    .bubble.mine {
      background: var(--club-soft);
      align-self: flex-end;
    }

    .bubble.group-mannschaft { border-left: 4px solid #16a34a; }
    .bubble.group-trainer { border-left: 4px solid #2563eb; }
    .bubble.group-kasse { border-left: 4px solid #d97706; }
    .bubble.group-betreuer { border-left: 4px solid #7c3aed; }
    .bubble.group-mannschaftsrat { border-left: 4px solid #0891b2; }

    .bubble strong {
      display: block;
      margin-bottom: 3px;
      font-size: .86rem;
    }

    .bubble p {
      margin: 0;
      white-space: pre-wrap;
    }

    .emoji-row {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: -2px;
    }

    .emoji-row button {
      width: 38px;
      height: 34px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
      cursor: pointer;
      font-size: 1.1rem;
      line-height: 1;
      display: grid;
      place-items: center;
    }

    .emoji-row button:hover {
      background: var(--club-soft);
    }

    .paypal-box {
      margin-top: 8px;
      padding: 8px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
    }

    .paypal-box[hidden] {
      display: none;
    }

    .paypal-status {
      margin-top: 6px;
      font-size: .8rem;
      color: var(--muted);
    }

    .empty {
      border: 1px dashed var(--line);
      border-radius: 8px;
      padding: 22px;
      text-align: center;
      color: var(--muted);
      background: #fff;
    }

    .view { display: none; }
    .view.active { display: block; }

    .config {
      border-left: 4px solid var(--blue);
      background: #eff6ff;
    }

    .modal-backdrop {
      position: fixed;
      inset: 0;
      z-index: 220;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 18px;
      background: rgba(0,0,0,.52);
    }

    .modal-backdrop.open {
      display: flex;
    }

    body.modal-open {
      overflow: hidden;
    }

    .modal-panel {
      width: min(920px, 100%);
      max-height: min(88vh, 880px);
      overflow: auto;
      background: #fff;
      border-radius: 8px;
      box-shadow: 0 24px 70px rgba(0,0,0,.32);
      padding: 18px;
    }

    .compact-modal {
      width: min(680px, 100%);
    }

    .signup-benefit {
      margin: -4px 0 16px;
      padding: 12px 14px;
      border: 1px solid #bbf7d0;
      border-radius: 8px;
      background: #f0fdf4;
      color: #166534;
      font-weight: 800;
      line-height: 1.4;
    }

    .modal-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      margin-bottom: 14px;
    }

    .modal-head h3 {
      margin: 0;
    }

    .modal-head-actions {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-end;
      gap: 8px;
    }

    .player-nav-btn {
      min-width: 48px;
      padding-inline: 12px;
    }

    .modal-head-actions .mini:hover,
    .player-nav-btn:hover {
      border-color: color-mix(in srgb, var(--green) 22%, var(--line));
      box-shadow: 0 8px 18px rgba(16,43,32,.12);
    }

    .player-tabs {
      grid-column: 1 / -1;
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
      padding: 0 0 10px;
      margin: 2px 0 10px;
      border: 0;
      border-bottom: 1px solid var(--line);
      border-radius: 0;
      background: transparent;
    }

    .player-tabs .mini {
      position: relative;
      min-height: 42px;
      padding: 0 18px;
      border-radius: 8px;
      background: transparent;
      color: var(--muted);
      font-size: .95rem;
      font-weight: 850;
    }

    .player-tabs .mini:hover {
      background: var(--soft);
      color: var(--text);
    }

    .player-tabs .mini.active {
      background: #fff;
      color: var(--green);
      box-shadow: inset 0 0 0 1px var(--line);
    }

    .player-tabs .mini.active::after {
      content: "";
      position: absolute;
      left: 14px;
      right: 14px;
      bottom: -11px;
      height: 3px;
      border-radius: 999px;
      background: var(--green);
    }

    .player-tab-panel {
      grid-column: 1 / -1;
      display: none;
    }

    .player-tab-panel.active {
      display: grid;
    }

    .tactic-shell {
      display: grid;
      grid-template-columns: minmax(280px, 360px) 1fr;
      gap: 16px;
      align-items: start;
    }

    .tactic-sidebar {
      position: sticky;
      top: 16px;
    }

    .tactic-workspace {
      min-width: 0;
    }

    .tactic-3d-panel {
      display: grid;
      gap: 10px;
      margin: 0 0 16px;
      padding: 10px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #f7faf8;
    }

    .tactic-3d-frame {
      width: 100%;
      min-height: 720px;
      border: 0;
      border-radius: 8px;
      background: #12122a;
      box-shadow: inset 0 0 0 1px rgba(16,33,25,.12);
    }

    .tactic-modal-backdrop {
      z-index: 260;
      padding: 12px;
      background: rgba(8, 24, 18, .72);
      backdrop-filter: blur(8px);
    }

    .tactic-modal-panel {
      width: min(1760px, 100%);
      height: min(94vh, 1040px);
      max-height: none;
      display: grid;
      grid-template-rows: auto minmax(0, 1fr);
      gap: 10px;
      overflow: hidden;
      padding: 12px;
      background: #f6f8f6;
    }

    .tactic-modal-head {
      margin-bottom: 0;
      padding: 2px 2px 4px;
    }

    .tactic-modal-head .meta {
      margin: 3px 0 0;
    }

    .tactic-3d-frame-large {
      min-height: 0;
      height: 100%;
      border: 1px solid rgba(16,33,25,.14);
    }

    .tactic-commandbar {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin: 0 0 12px;
      padding: 8px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #f7faf8;
    }

    .tactic-commandbar .mini {
      min-height: 38px;
      background: #fff;
      box-shadow: 0 1px 3px rgba(16,33,25,.08);
    }

    .tactic-options {
      display: grid;
      gap: 10px;
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #f8fbf9;
    }

    .tactic-options[hidden] {
      display: none !important;
    }

    .tactic-options h4 {
      margin: 0;
      color: var(--dark);
      font-size: 1.1rem;
    }

    .tactic-choice-row {
      display: grid;
      gap: 7px;
    }

    .tactic-choice,
    .tactic-card {
      border: 1px solid transparent;
      border-radius: 8px;
      background: #eef3f0;
      color: var(--dark);
      font: inherit;
      font-weight: 800;
      text-align: left;
      cursor: pointer;
      transition: .15s ease;
    }

    .tactic-choice {
      padding: 10px 12px;
    }

    .tactic-choice:hover,
    .tactic-card:hover,
    .tactic-choice.active,
    .tactic-card.active {
      border-color: #c9d8cf;
      background: #dcebd8;
      color: var(--green);
    }

    .tactic-option-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }

    .tactic-card-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
    }

    .tactic-card {
      display: grid;
      place-items: center;
      min-height: 58px;
      padding: 10px;
      text-align: center;
      background: #f2f5f3;
    }

    .tactic-board-wrap {
      width: 100%;
      overflow: auto;
      border-radius: 8px;
      background: #08751e;
      border: 1px solid #c9d8cf;
    }

    .tactic-board {
      display: block;
      width: 100%;
      min-width: 760px;
      aspect-ratio: 130 / 74;
      touch-action: none;
      user-select: none;
    }

    .field-margin {
      fill: #08751e;
    }

    .field-bg {
      fill: #129429;
    }

    .field-stripe-a {
      fill: #008414;
    }

    .field-stripe-b {
      fill: #1fa435;
    }

    .field-line {
      fill: none;
      stroke: rgba(255,255,255,.95);
      stroke-width: .76;
      vector-effect: non-scaling-stroke;
    }

    .field-dot {
      fill: rgba(255,255,255,.95);
    }

    .tactic-hit {
      pointer-events: stroke;
      stroke: transparent;
      stroke-linecap: round;
      stroke-linejoin: round;
      fill: none;
    }

    .tactic-hit-fill {
      pointer-events: all;
      fill: transparent;
      stroke: transparent;
    }

    .tactic-el {
      cursor: grab;
    }

    .tactic-line {
      stroke: #fff;
      stroke-width: .8;
      stroke-linecap: round;
      vector-effect: non-scaling-stroke;
    }

    .tactic-line.selected {
      stroke: #facc15;
      stroke-width: 1.6;
    }

    .tactic-shape {
      vector-effect: non-scaling-stroke;
    }

    .tactic-shape.selected,
    .tactic-accessory.selected {
      stroke: #facc15;
      stroke-width: 1.25;
      vector-effect: non-scaling-stroke;
    }

    .tactic-player-icon circle {
      stroke: #fff;
      stroke-width: .45;
      vector-effect: non-scaling-stroke;
    }

    .tactic-player-icon text {
      fill: #fff;
      font-size: 2.1px;
      font-weight: 950;
      text-anchor: middle;
      dominant-baseline: central;
      paint-order: stroke;
      stroke: rgba(0,0,0,.55);
      stroke-width: .35;
      vector-effect: non-scaling-stroke;
    }

    .tactic-player circle {
      stroke: #fff;
      stroke-width: .45;
      vector-effect: non-scaling-stroke;
    }

    .tactic-player.sub circle {
      opacity: .88;
    }

    .tactic-player text,
    .tactic-text {
      fill: #fff;
      font-size: 2.3px;
      font-weight: 800;
      text-anchor: middle;
      paint-order: stroke;
      stroke: rgba(0,0,0,.55);
      stroke-width: .35;
      vector-effect: non-scaling-stroke;
    }

    .tactic-player.selected circle,
    .tactic-cone.selected,
    .tactic-pole.selected {
      stroke: #facc15;
      stroke-width: 1.35;
      vector-effect: non-scaling-stroke;
    }

    .tactic-text.selected {
      fill: #facc15;
    }

    .tactic-cone {
      fill: #f97316;
      stroke: #fff;
      stroke-width: .25;
      vector-effect: non-scaling-stroke;
    }

    .tactic-pole {
      fill: #facc15;
      stroke: #7c2d12;
      stroke-width: .18;
      vector-effect: non-scaling-stroke;
    }

    .selected-item {
      border-color: var(--green);
      background: var(--soft);
    }

    @media (max-width: 980px) {
      .app-shell {
        display: block;
      }

      .sidebar {
        position: sticky;
        top: 0;
        z-index: 5;
        padding: 14px;
      }

      .nav {
        display: flex;
        overflow-x: auto;
        padding-bottom: 3px;
      }

      .nav button {
        white-space: nowrap;
      }

      .tactic-shell {
        grid-template-columns: 1fr;
      }

      .tactic-sidebar {
        position: static;
      }

      .profile-card, .sync-status {
        display: none;
      }

      main {
        padding: 14px;
      }

      .grid.two, .stats, .form-grid, .availability-grid {
        grid-template-columns: 1fr;
      }
    }

    @media (max-width: 1100px) {
      body {
        background: #f6f8f6;
      }

      .login-screen {
        align-items: flex-end;
        justify-content: center;
        padding: 18px 14px calc(18px + env(safe-area-inset-bottom));
        background-position: center center, center 10%, center center, center center, center center, center center, center center;
        background-size: 100% 100%, min(480px, 88vw) auto, 100% 100%, 100% 100%, 100% 64px, 64px 100%, 100% 100%;
      }

      .login-promo-link {
        left: 50%;
        top: 10%;
        width: min(480px, 88vw);
        transform: translateX(-50%);
      }

      .app-shell {
        min-height: 100svh;
      }

      .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: calc(72px + env(safe-area-inset-top));
        padding: calc(12px + env(safe-area-inset-top)) 14px 10px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        box-shadow: 0 4px 18px rgba(16,43,32,.16);
      }

      .brand-mark {
        width: 38px;
        height: 38px;
        font-size: .82rem;
      }

      .brand h1 {
        font-size: 1rem;
      }

      .brand span {
        font-size: .78rem;
      }

      .profile-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px;
        width: min(56vw, 250px);
        padding: 0;
        border: 0;
        background: transparent;
      }

      .profile-card label,
      .profile-card select {
        display: none;
      }

      .profile-card input {
        height: 40px;
        margin: 0;
        border-color: rgba(255,255,255,.2);
        border-radius: 8px;
        background: rgba(255,255,255,.1);
        color: #fff;
      }

      .logout-btn {
        width: auto;
        min-height: 40px;
        padding: 0 8px;
        font-size: .72rem;
      }

      .tenant-card {
        display: none;
      }

      .nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 20;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
        gap: 0;
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
        background: rgba(255,255,255,.96);
        border-top: 1px solid var(--line);
        box-shadow: 0 -8px 24px rgba(16,43,32,.12);
        overflow: visible;
      }

      .nav button {
        justify-content: center;
        display: grid;
        grid-template-rows: 22px auto;
        min-height: 58px;
        padding: 6px 3px;
        color: var(--muted);
        border-radius: 8px;
        font-size: .72rem;
        font-weight: 800;
        text-align: center;
        white-space: normal;
        line-height: 1.08;
      }

      .nav-icon {
        width: 24px;
        height: 22px;
        margin: 0 auto;
        background: transparent;
        font-size: .95rem;
      }

      .nav-label {
        display: block;
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: normal;
      }

      .nav-badge {
        position: absolute;
        top: 7px;
        right: 11px;
        margin-left: 0;
      }

      .nav button.active {
        background: var(--soft);
        color: var(--green);
      }

      main {
        padding: calc(88px + env(safe-area-inset-top)) 12px calc(94px + env(safe-area-inset-bottom));
      }

      .topbar {
        display: grid;
        gap: 12px;
        margin-bottom: 12px;
      }

      .topbar h2 {
        font-size: 1.45rem;
      }

      .topbar p {
        font-size: .9rem;
        line-height: 1.35;
      }

      .actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        justify-content: stretch;
      }

      .actions button {
        width: 100%;
      }

      .panel {
        padding: 12px;
      }

      .install-panel {
        display: grid;
      }

      .login-install {
        grid-template-columns: 1fr;
      }

      .club-share {
        grid-template-columns: 66px minmax(0, 1fr);
      }

      .club-share img {
        width: 66px;
        height: 66px;
      }

      .calendar-day {
        min-height: 74px;
        padding: 5px;
      }

      .stat {
        padding: 12px;
      }

      .stat strong {
        font-size: 1.55rem;
      }

      .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
      }

      .item {
        padding: 12px;
      }

      .item-head {
        display: grid;
        gap: 8px;
      }

      .row-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .availability-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .mini {
        min-height: 42px;
      }

      .message-feed {
        min-height: 48svh;
        max-height: 54svh;
      }

      .bubble {
        max-width: 96%;
      }
    }

    @media (max-width: 560px) {
      .login-screen {
        align-items: flex-start;
        justify-content: center;
        overflow-y: auto;
        padding: calc(150px + env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom));
        background-position: center center, center 14px, center center, center center, center center, center center, center center;
        background-size: 100% 100%, min(220px, 58vw) auto, 100% 100%, 100% 100%, 100% 64px, 64px 100%, 100% 100%;
      }

      .login-promo-link {
        top: 14px;
        width: min(220px, 58vw);
        transform: translateX(-50%);
        pointer-events: none;
      }

      .login-panel {
        width: 100%;
        padding: 16px;
        gap: 10px;
      }

      .login-panel .brand-mark {
        width: 38px;
        height: 38px;
      }

      .login-panel h1 {
        font-size: 1.25rem;
      }

      .sidebar .brand h1,
      .sidebar .brand span {
        display: none;
      }

      .profile-card {
        width: calc(100vw - 84px);
      }

      .topbar {
        display: grid;
      }

      .actions {
        justify-content: stretch;
      }

      .actions button, .row-actions button {
        flex: 1 1 auto;
      }

      .event-kind-actions {
        grid-template-columns: 1fr;
      }

      .item-head {
        display: grid;
      }

      .availability-grid {
        grid-template-columns: 1fr;
      }

      .module-toggle-grid {
        grid-template-columns: 1fr;
      }

      .sport-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .scouting-card {
        grid-template-columns: 1fr;
      }

      .scouting-card-actions {
        justify-content: stretch;
        min-width: 0;
      }

      .scouting-score-row {
        grid-template-columns: 1fr;
      }
    }
