/* Mobile and landscape layouts */

.mobile-agenda {
  display: none;
}

@media(max-width:700px), (orientation:landscape) and (max-height:500px) {
  .calendar-toolbar {
    gap: 8px;
    padding: 12px;
  }
  .calendar-toolbar h2 {
    min-width: 0;
    flex: 1;
    font-size: 14px;
  }
  .calendar-panel>.calendar-weekdays,.calendar-panel>.calendar-grid {
    display: none;
  }
  .calendar-panel>.mobile-agenda {
    display: block;
  }
  .mobile-agenda {
    padding: 5px 12px 12px;
  }
  .mobile-agenda-day {
    display: grid;
    grid-template-columns: 78px minmax(0,1fr);
    gap: 9px;
    padding: 12px 0;
    border-bottom: 1px solid #edf0ec;
  }
  .mobile-agenda-day:last-child {
    border-bottom: 0;
  }
  .mobile-agenda-date {
    padding-top: 7px;
    color: #536157;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
    text-transform: capitalize;
  }
  .mobile-agenda-content {
    min-width: 0;
  }
  .mobile-agenda-content .meeting-card {
    margin: 0 0 7px;
    padding: 9px;
    font-size: 10px;
  }
  .mobile-agenda-content .meeting-card:last-child {
    margin-bottom: 0;
  }
  .mobile-agenda-content .meeting-card p {
    font-size: 10px;
    overflow-wrap: anywhere;
  }
  .mobile-agenda-content .calendar-day-label {
    display: inline-block;
    margin: 0 0 6px;
    font-size: 9px;
    padding: 4px 6px;
  }
}

@media(max-width:700px), (orientation:landscape) and (max-height:500px) {
  .shell {
    width: 100%;
    overflow-x: clip;
  }
  .sidebar {
    width: 56px;
    flex-basis: 56px;
    padding: 18px 6px 12px;
  }
  .brand {
    margin: 0 0 28px;
  }
  .brand-logo {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }
  .sidebar nav {
    width: 100%;
    gap: 6px;
  }
  .nav-link {
    width: 44px;
    height: 44px;
    padding: 8px;
    gap: 0;
    justify-content: center;
  }
  .nav-icon {
    width: auto;
    font-size: 18px;
  }
  .side-label {
    display: none;
  }
  .side-bottom {
    justify-content: center;
    padding-top: 12px;
  }
  .side-bottom>span,.side-bottom .local-pill {
    display: none;
  }
  .main {
    width: calc(100% - 56px);
    min-width: 0;
  }
  .topbar {
    height: auto;
    min-height: 56px;
    padding: 8px 12px;
    gap: 8px;
  }
  .crumb {
    display: flex;
    align-items: center;
    min-width: 0;
    font-size: 11px;
  }
  .crumb b {
    max-width: 108px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .crumb span {
    margin: 0 5px;
  }
  .top-right {
    gap: 5px;
    flex-shrink: 0;
  }
  .top-right .button {
    padding: 7px 9px;
  }
  .content {
    width: 100%;
    max-width: none;
    padding: 22px 12px 28px;
  }
  .main footer {
    padding: 13px 12px;
    font-size: 9px;
  }
  .page-head {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
  }
  .page-head h1 {
    font-size: 23px;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }
  .page-head p {
    font-size: 12px;
    line-height: 1.45;
  }
  .page-head>.button {
    align-self: flex-start;
    min-height: 40px;
  }
  .stats {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 20px;
  }
  .stat {
    min-width: 0;
    padding: 11px 13px;
    gap: 10px;
  }
  .stat-icon {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
  }
  .stat-label {
    font-size: 10px;
  }
  .stat-value {
    font-size: 18px;
  }
  .stat-note {
    display: block;
    font-size: 9px;
  }
  .section-head {
    align-items: flex-start;
    gap: 8px;
    margin: 22px 1px 11px;
  }
  .section-head h2 {
    font-size: 14px;
  }
  .section-head span {
    text-align: right;
    font-size: 10px;
  }
  .event-list {
    grid-template-columns: minmax(0,1fr);
    gap: 10px;
  }
  .event-card {
    min-width: 0;
    padding: 14px;
  }
  .event-card h3 {
    overflow-wrap: anywhere;
  }
  .event-meta {
    flex-wrap: wrap;
    gap: 8px 14px;
  }
  .panel-header {
    align-items: flex-start;
    gap: 8px;
    padding: 13px 12px;
    flex-wrap: wrap;
  }
  .panel-header>span {
    text-align: right;
  }
  .table th,.table td {
    padding: 9px 10px;
  }
  .contestant-layout,.backup-grid,.accounts-list {
    grid-template-columns: minmax(0,1fr);
    gap: 11px;
  }
  .contestant-layout>section,.medal-overview,.leaderboard,.results-panel {
    max-width: 100%;
    overflow-x: auto;
  }
  .contestant-layout .table {
    min-width: 430px;
  }
  .medal-overview .table,.leaderboard .table {
    min-width: 560px;
  }
  .results-panel .table {
    min-width: 600px;
  }
  .add-box {
    padding: 15px;
  }
  .event-tabs {
    gap: 2px;
    margin-bottom: 15px;
  }
  .event-tab {
    padding: 10px 11px;
    font-size: 11px;
  }
  .event-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 9px;
  }
  .event-toolbar h2 {
    font-size: 15px;
  }
  .toolbar-actions {
    max-width: 100%;
    flex-wrap: wrap;
  }
  .toolbar-actions .button {
    flex: 1 1 auto;
    min-height: 36px;
  }
  .score-grid {
    grid-template-columns: minmax(0,1fr);
  }
  .track-card {
    min-width: 0;
    padding: 12px;
  }
  .track-head {
    gap: 8px;
    flex-wrap: wrap;
  }
  .form-row {
    grid-template-columns: minmax(0,1fr);
  }
  .score-entry-form {
    grid-template-columns: minmax(0,1fr);
    min-width: 0;
  }
  .score-entry-form .score-actions {
    grid-column: auto;
    flex-wrap: wrap;
  }
  .settings-fields {
    grid-template-columns: minmax(0,1fr);
    padding: 14px 12px;
  }
  .track-setting-row {
    grid-template-columns: 52px minmax(0,1fr);
    gap: 7px;
    padding: 9px 10px;
  }
  .track-setting-row .input {
    min-width: 0;
  }
  .participants-settings {
    min-width: 0;
  }
  .participant-grid {
    grid-template-columns: minmax(0,1fr);
    padding: 10px;
  }
  .participant-option {
    min-width: 0;
  }
  .account-fields {
    grid-template-columns: minmax(0,1fr);
    padding: 13px 12px 7px;
  }
  .account-actions {
    flex-wrap: wrap;
    padding: 0 12px;
    gap: 7px;
  }
  .account-actions>span {
    flex: 1 0 100%;
  }
  .account-actions .button {
    flex: 1 1 auto;
  }
  .backup-body {
    padding: 14px;
  }
  .backup-counts {
    gap: 12px;
    flex-wrap: wrap;
  }
  .modal-backdrop {
    padding: 10px;
  }
  .modal {
    width: 100%;
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
    padding: 18px;
  }
  .modal-actions {
    gap: 7px;
    flex-wrap: wrap;
  }
  .modal-actions .button {
    flex: 1 1 110px;
  }
  .meeting-coach-list {
    grid-template-columns: minmax(0,1fr);
  }
  .login-history-scroll {
    max-width: 100%;
  }
  .login-history-table {
    min-width: 760px;
  }
  .tabs {
    scrollbar-width: thin;
  }
  .results-tools {
    gap: 7px;
  }
  .results-tools select {
    max-width: 100%;
  }
}

@media(max-width:380px) {
  .content {
    padding-right: 9px;
    padding-left: 9px;
  }
  .topbar {
    padding-right: 9px;
    padding-left: 9px;
  }
  .page-head h1 {
    font-size: 21px;
  }
  .event-meta {
    font-size: 9px;
  }
  .stat-note {
    display: none;
  }
  .panel-header h2 {
    font-size: 13px;
  }
  .modal {
    padding: 15px;
  }
}

.mobile-result-list {
  display: none;
}

.results-desktop-table {
  max-width: 100%;
  overflow-x: auto;
}

.mobile-result-sort {
  display: none;
  align-items: center;
  gap: 6px;
}

.mobile-result-sort select {
  max-width: 100%;
}

@media(max-width:700px), (orientation:landscape) and (max-height:500px) {
  .results-panel {
    overflow-x: hidden;
  }
  .results-header {
    align-items: flex-start;
  }
  .results-tools {
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .mobile-result-sort {
    display: flex;
  }
  .mobile-result-sort select {
    min-width: 0;
  }
  .results-desktop-table {
    display: none;
  }
  .mobile-result-list {
    display: grid;
    gap: 9px;
    padding: 10px;
  }
  .mobile-result-card {
    min-width: 0;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }
  .mobile-result-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
  }
  .mobile-result-head>b {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 12px;
  }
  .mobile-result-metrics {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 8px 10px;
    margin-bottom: 10px;
  }
  .mobile-result-metrics>div {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .mobile-result-metrics span {
    color: var(--muted);
    font-size: 9px;
  }
  .mobile-result-metrics b {
    font-size: 11px;
  }
  .mobile-result-total {
    padding-top: 6px;
    border-top: 1px solid var(--line);
  }
  .mobile-result-card .score-row-actions {
    justify-content: flex-start;
  }
  .mobile-result-card .button {
    min-height: 34px;
  }
  .results-tools>span {
    font-size: 9px;
  }
}

.classification-mobile-list {
  display: none;
}

.classification-desktop-table {
  max-width: 100%;
  overflow-x: auto;
}

@media(max-width:700px), (orientation:landscape) and (max-height:500px) {
  .leaderboard .panel-header {
    align-items: flex-start;
  }
  .leaderboard-header {
    flex-direction: column;
  }
  .leaderboard-header .button {
    align-self: flex-start;
    min-height: 36px;
  }
  .classification-desktop-table {
    display: none;
  }
  .classification-mobile-list {
    display: grid;
    gap: 7px;
    padding: 9px;
  }
  .classification-card {
    display: grid;
    grid-template-columns: 34px minmax(0,1fr) 82px;
    align-items: center;
    gap: 7px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }
  .classification-card:first-child {
    background: #fffdf4;
  }
  .classification-rank {
    font: 700 13px Manrope,sans-serif;
    color: #78847c;
  }
  .classification-rank.first {
    color: #b38122;
  }
  .classification-rank.second {
    color: #82909b;
  }
  .classification-rank.third {
    color: #a56f4d;
  }
  .classification-rank .medal {
    display: block;
    margin: 3px 0 0;
    font-size: 13px;
  }
  .classification-person {
    min-width: 0;
    display: grid;
    gap: 4px;
  }
  .classification-person b {
    font-size: 11px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }
  .classification-person span,.classification-total span {
    font-size: 9px;
    color: #89948c;
  }
  .classification-total {
    min-width: 0;
    display: grid;
    gap: 4px;
    text-align: right;
  }
  .classification-total b {
    font-size: 10px;
    white-space: nowrap;
  }
  .leaderboard-header>div span {
    line-height: 1.4;
  }
}

@media(max-width:380px) {
  .classification-card {
    grid-template-columns: 30px minmax(0,1fr) 74px;
    gap: 5px;
    padding: 8px;
  }
  .classification-total b {
    font-size: 9px;
  }
}

.contestant-mobile-list {
  display: none;
}

@media(max-width:700px), (orientation:landscape) and (max-height:500px) {
  .contestant-desktop-table {
    display: none;
  }
  .contestant-mobile-list {
    display: grid;
    padding: 0 12px 8px;
  }
  .contestant-mobile-row {
    display: grid;
    grid-template-columns: 28px minmax(0,1fr);
    gap: 8px;
    padding: 12px 1px;
    border-bottom: 1px solid #edf0ec;
  }
  .contestant-mobile-row:last-child {
    border-bottom: 0;
  }
  .contestant-mobile-number {
    padding-top: 2px;
    color: #77847a;
    font: 700 12px Manrope,sans-serif;
  }
  .contestant-mobile-main {
    display: grid;
    gap: 9px;
    min-width: 0;
  }
  .contestant-mobile-main>b {
    font-size: 12px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }
  .contestant-mobile-main .row-actions {
    justify-content: flex-start;
    gap: 7px;
  }
  .contestant-mobile-main .button {
    min-height: 36px;
    padding: 8px 12px;
  }
  .viewer-mode .contestant-mobile-main .row-actions {
    display: none;
  }
}

.login-history-mobile-list {
  display: none;
}

@media(max-width:700px), (orientation:landscape) and (max-height:500px) {
  .login-history-desktop-table {
    display: none;
  }
  .login-history-mobile-list {
    display: grid;
    gap: 8px;
    padding: 10px;
  }
  .login-history-card {
    min-width: 0;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }
  .login-history-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
  }
  .login-history-card-top time {
    color: #66736a;
    font-size: 10px;
  }
  .login-history-account {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 12px;
  }
  .login-history-card dl {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 8px;
    margin: 9px 0 0;
  }
  .login-history-card dl>div {
    min-width: 0;
  }
  .login-history-card dt {
    margin-bottom: 3px;
    color: #89948c;
    font-size: 9px;
  }
  .login-history-card dd {
    margin: 0;
    color: #536157;
    font-size: 10px;
    overflow-wrap: anywhere;
  }
}

.medal-summary-mobile {
  display: none;
}

.medal-summary-desktop {
  max-width: 100%;
  overflow-x: auto;
}

@media(max-width:700px), (orientation:landscape) and (max-height:500px) {
  .medal-summary-desktop {
    display: none;
  }
  .medal-summary-mobile {
    display: grid;
    gap: 7px;
    padding: 9px;
  }
  .medal-summary-card {
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }
  .medal-summary-card:first-child {
    background: #fffdf4;
  }
  .medal-summary-head {
    display: grid;
    grid-template-columns: 42px minmax(0,1fr);
    align-items: center;
    gap: 7px;
    margin-bottom: 10px;
  }
  .medal-summary-head>b {
    font-size: 11px;
    line-height: 1.3;
    overflow-wrap: anywhere;
  }
  .medal-summary-rank {
    color: #718076;
    font: 700 12px Manrope,sans-serif;
  }
  .medal-summary-rank.first {
    color: #b38122;
  }
  .medal-summary-rank.second {
    color: #82909b;
  }
  .medal-summary-rank.third {
    color: #a56f4d;
  }
  .medal-summary-counts {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 5px;
    text-align: center;
    padding-top: 8px;
    border-top: 1px solid #edf0ec;
  }
  .medal-summary-counts>div {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
  }
  .medal-summary-counts span {
    color: #849087;
    font-size: 9px;
  }
  .medal-summary-counts b {
    font-size: 10px;
  }
  .medal-summary-counts .medal-summary-total {
    flex-direction: column;
    gap: 1px;
    border-left: 1px solid #edf0ec;
  }
  .medal-summary-total span {
    font-size: 8px;
  }
}
