@font-face {
    font-family: Inter;
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/inter-400.woff2") format("woff2");
}
@font-face {
    font-family: Inter;
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/inter-500.woff2") format("woff2");
}
@font-face {
    font-family: Inter;
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/inter-600.woff2") format("woff2");
}
@font-face {
    font-family: "IBM Plex Sans Arabic";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/plex-arabic-400.woff2") format("woff2");
}
@font-face {
    font-family: "IBM Plex Sans Arabic";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/plex-arabic-500.woff2") format("woff2");
}
@font-face {
    font-family: "IBM Plex Sans Arabic";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/plex-arabic-600.woff2") format("woff2");
}

:root {
    --honeydew: #FBFFFA;
    --cream: #FFF5E8;
    --forest: #204406;
    --sage: #97B97E;
    --ink: #204406;
    --muted: color-mix(in srgb, #204406 68%, #FBFFFA);
    --line: color-mix(in srgb, #204406 16%, #FBFFFA);
    --danger: #6E2C23;
    --shadow: 0 10px 30px color-mix(in srgb, #204406 8%, transparent);
    --font: Inter, "IBM Plex Sans Arabic", sans-serif;
    --sidebar: 17.5rem;
    --radius: 18px;
}

html[lang="ar"] {
    --font: "IBM Plex Sans Arabic", Inter, sans-serif;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
html, body { max-width: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--honeydew);
    color: var(--ink);
    font-family: var(--font);
    font-weight: 400;
    line-height: 1.5;
    overflow-x: clip;
}
img, svg, video { max-width: 100%; height: auto; }
h1, h2, h3 { font-weight: 600; letter-spacing: 0; line-height: 1.25; }
h1 { font-size: 1.6rem; margin: 0; }
h2 { font-size: 1.25rem; margin: 0 0 0.75rem; }
h3 { font-size: 1.05rem; margin: 0 0 0.5rem; }
a { color: var(--forest); }
p { margin: 0 0 0.75rem; }
.skip {
    position: absolute;
    inset-inline-start: 1rem;
    top: -4rem;
    background: var(--forest);
    color: var(--honeydew);
    padding: 0.5rem 0.8rem;
    border-radius: 999px;
    z-index: 5;
}
.skip:focus { top: 0.5rem; }

.shell { display: flex; align-items: stretch; min-height: 100vh; }
.sidebar {
    width: var(--sidebar);
    flex: 0 0 var(--sidebar);
    align-self: stretch;
    background: var(--forest);
    color: var(--honeydew);
    padding: 1.25rem 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.brand {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    text-decoration: none;
    color: var(--forest);
}
.brand strong { display: block; font-size: 1.2rem; }
.brand small { display: block; color: var(--muted); font-size: 0.82rem; }
.sidebar .brand { color: var(--honeydew); }
.sidebar .brand small { color: color-mix(in srgb, var(--honeydew) 72%, transparent); }
.brand-mark {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 0.8rem;
    background: var(--sage);
    position: relative;
    flex: none;
}
.brand-mark::after {
    content: "";
    position: absolute;
    inset: 0.45rem 0.7rem 0.35rem;
    background: var(--honeydew);
    border-radius: 1rem 1rem 1rem 0.2rem;
}
.nav { display: flex; flex-direction: column; gap: 0.25rem; }
.nav a, .subnav a {
    text-decoration: none;
    color: var(--forest);
    padding: 0.55rem 0.75rem;
    border-radius: 999px;
    font-weight: 500;
}
.sidebar .nav a, .sidebar .account-link { color: var(--honeydew); }
.nav a.is-active, .subnav a.is-active {
    background: var(--sage);
    color: var(--forest);
}
.sidebar .nav a:hover { background: color-mix(in srgb, var(--honeydew) 14%, transparent); }
.subnav a { background: var(--cream); border: 1px solid var(--line); }
.subnav a:hover { background: color-mix(in srgb, var(--sage) 45%, var(--cream)); }
.subnav a.is-active { background: var(--forest); color: var(--honeydew); border-color: var(--forest); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 0.75rem; }
.who { font-weight: 600; margin: 0.85rem 0 0; padding: 0.35rem 0.75rem 0; color: var(--honeydew); font-size: 1.02rem; }
.who-role { margin: 0; padding: 0 0.75rem 0.35rem; color: color-mix(in srgb, var(--honeydew) 72%, transparent); font-size: 0.82rem; font-weight: 500; }
.account-link { text-decoration: none; font-weight: 600; padding: 0.35rem 0.75rem; border-radius: 999px; }
.account-link:hover { background: color-mix(in srgb, var(--honeydew) 14%, transparent); }
.workspace { flex: 1; min-width: 0; }
.topbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem 0.75rem;
    position: sticky;
    top: 0;
    z-index: 6;
    background: color-mix(in srgb, var(--honeydew) 92%, transparent);
    backdrop-filter: blur(8px);
}
.topbar h1 { flex: 1; min-width: 0; }
.btn.menu-toggle { display: none; }
.sidebar-backdrop { display: none; }
.content { padding: 0.5rem 1.5rem 2.5rem; }
.page-head, .filter-actions, .actions, .inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: end;
    justify-content: space-between;
}
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
    gap: 0.8rem;
    margin: 1rem 0;
}
.card, .panel, .summary, .guest-card, .alert, .filters, .table-wrap, .order-form {
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card { padding: 1rem 1.1rem; }
.card h2, .panel h2 { font-size: 0.92rem; color: var(--muted); font-weight: 600; }
.card p { font-size: 1.45rem; margin: 0.35rem 0 0; font-weight: 600; }
.card-hero {
    grid-column: 1 / -1;
    background: var(--forest);
    color: var(--honeydew);
    border-color: var(--forest);
    padding: 1.25rem 1.4rem;
}
.card-hero h2 { color: color-mix(in srgb, var(--honeydew) 72%, transparent); }
.card-hero p { color: var(--honeydew); font-size: clamp(2rem, 5vw, 3.1rem); }
.order-title { display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem; }
.period-pair {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.75rem;
    align-items: stretch;
    margin: 1rem 0;
}
.period-card {
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.9rem 1rem;
}
.period-card h3 { margin-bottom: 0.25rem; }
.period-card p { margin: 0; font-weight: 600; }
.period-card.is-current { background: var(--forest); color: var(--honeydew); border-color: var(--forest); }
.period-card.is-current h3 { color: color-mix(in srgb, var(--honeydew) 75%, transparent); }
.period-vs { align-self: center; margin: 0; font-weight: 600; color: var(--muted); }
.rank-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 0.85rem 1rem;
    align-items: stretch;
    margin: 0.5rem 0 1rem;
    padding: 1rem;
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.rank-period {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin: 0;
    padding: 0.85rem;
    background: var(--honeydew);
    border: 1px solid var(--line);
    border-radius: 16px;
}
.rank-label { grid-column: 1 / -1; margin: 0; font-weight: 600; }
.rank-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: end;
}
.rank-actions > label { flex: 1 1 16rem; min-width: 0; }
.rank-filters .filter-actions { justify-content: flex-start; flex: 1 1 auto; }
.rank-filters .btn { white-space: nowrap; }
.podium {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
    align-items: end;
    margin: 1rem 0 1.25rem;
}
.podium-1 { grid-template-columns: minmax(0, 24rem); }
.podium-2 { grid-template-columns: 1fr 1.15fr; }
.podium-card {
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
}
.podium-card h3 { margin-bottom: 0.15rem; }
.podium-card .place { margin: 0 0 0.35rem; font-size: 1.35rem; font-weight: 600; }
.podium-figure { font-size: clamp(1.4rem, 3vw, 2rem); margin: 0.55rem 0 0.15rem; }
.podium-caption { margin: 0; color: var(--muted); font-size: 0.85rem; }
.podium-card.place-1 { order: 2; background: var(--forest); color: var(--honeydew); border-color: var(--forest); padding: 1.25rem 1.1rem 1.15rem; }
.podium-card.place-2 { order: 1; }
.podium-card.place-3 { order: 3; }
.podium-1 .place-1 { order: 0; }
.place-1 h3, .place-1 .coupon-preview, .place-1 .podium-figure { color: var(--honeydew); }
.place-1 .podium-caption { color: color-mix(in srgb, var(--honeydew) 75%, transparent); }
th.is-metric, td.is-metric { background: color-mix(in srgb, var(--sage) 36%, var(--cream)); box-shadow: inset 0 -2px 0 var(--forest); }
tbody tr:hover td.is-metric { background: color-mix(in srgb, var(--sage) 48%, var(--cream)); }
.growth { font-weight: 600; }
.growth-up, .growth-new, .growth-down {
    display: inline-flex;
    align-items: center;
    min-height: 1.5rem;
    padding: 0.05rem 0.55rem;
    border-radius: 999px;
}
.growth-up { background: var(--sage); color: var(--forest); }
.growth-new { background: var(--forest); color: var(--honeydew); }
.growth-down { background: color-mix(in srgb, var(--danger) 14%, var(--cream)); color: var(--danger); }
.growth-flat, .growth-none { color: var(--muted); }
.tie-note {
    display: inline-flex;
    margin-inline-start: 0.3rem;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--sage) 45%, var(--cream));
    color: var(--forest);
    font-size: 0.72rem;
    font-weight: 600;
    vertical-align: middle;
}
.place-1 .tie-note { background: var(--sage); color: var(--forest); }
.panel { padding: 1rem; margin: 1rem 0; }
.panel .table-wrap { border: 0; box-shadow: none; background: transparent; border-radius: 0; }
.guest-card .brand-mark { background: var(--forest); }
.guest-card .brand-mark::after { background: var(--sage); }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 1rem; }
.policy, .help { color: var(--muted); }
.metric-banner {
    background: var(--sage);
    color: var(--forest);
    display: inline-block;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    font-weight: 600;
}
.btn {
    appearance: none;
    border: 0;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 2.75rem;
    padding: 0.65rem 1.25rem;
    border-radius: 999px;
    font: inherit;
    font-weight: 600;
}
.btn-sage { background: var(--sage); color: var(--forest); }
.btn-forest { background: var(--forest); color: var(--honeydew); padding-inline: 1.4rem; }
.btn-ghost { background: transparent; color: var(--forest); border: 1.5px solid color-mix(in srgb, var(--forest) 35%, transparent); }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] {
    background: color-mix(in srgb, var(--sage) 35%, var(--cream));
    color: var(--forest);
    cursor: not-allowed;
}
.btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid var(--forest);
    outline-offset: 2px;
}
label { display: flex; flex-direction: column; gap: 0.4rem; font-weight: 600; font-size: 0.92rem; color: var(--forest); }
input, select, textarea {
    font: inherit;
    font-size: 1rem;
    font-weight: 500;
    color: var(--forest);
    background: var(--honeydew);
    border: 1.5px solid color-mix(in srgb, var(--forest) 25%, var(--sage));
    border-radius: 14px;
    padding: 0.65rem 0.85rem;
    min-height: 3.15rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
input[type="date"], select { height: 3.15rem; }
select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    line-height: 1.3;
    padding-inline: 0.9rem 2.7rem;
    background-color: var(--honeydew);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23204406' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 7.5 10 12.5 15 7.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 1rem 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
html[dir="rtl"] select { background-position: left 0.85rem center; }
select:hover, input:hover, textarea:hover {
    border-color: color-mix(in srgb, var(--forest) 48%, var(--sage));
}
option { color: var(--forest); background: var(--honeydew); }
textarea { min-height: 6rem; }
input[readonly] { background: color-mix(in srgb, var(--cream) 70%, var(--honeydew)); }
.stack { display: flex; flex-direction: column; gap: 0.9rem; }
.narrow { max-width: 36rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 0.9rem; }
.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 12.5rem), 1fr));
    gap: 0.75rem;
    align-items: end;
    margin: 0.5rem 0 1rem;
    padding: 1rem;
}
.filters label { min-width: 0; }
.filters .filter-actions { grid-column: 1 / -1; }
.check { flex-direction: row; align-items: center; gap: 0.55rem; font-size: 1rem; font-weight: 500; }
.check input { min-height: auto; width: 1.1rem; height: 1.1rem; }
fieldset { border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; gap: 0.45rem; }
.table-wrap { overflow: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
table { width: 100%; border-collapse: collapse; min-width: 40rem; }
th, td { text-align: start; padding: 0.8rem 0.85rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th {
    position: sticky;
    top: 0;
    z-index: 1;
    font-size: 0.78rem;
    font-weight: 600;
    color: color-mix(in srgb, var(--forest) 78%, transparent);
    background: color-mix(in srgb, var(--sage) 24%, var(--cream));
    white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--sage) 14%, var(--cream)); }
td a { font-weight: 600; text-decoration: none; }
td a:hover { text-decoration: underline; }
.badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.55rem;
    padding: 0.05rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    background: color-mix(in srgb, var(--sage) 35%, var(--cream));
    white-space: nowrap;
}
.badge-completed { background: var(--sage); color: var(--forest); }
.badge-pending { background: var(--honeydew); color: var(--forest); border: 1px solid var(--line); }
.badge-cancelled { background: color-mix(in srgb, var(--danger) 12%, var(--cream)); color: var(--danger); }
.num, .ref { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; text-align: end; }
th.num { text-align: end; }
.ref { text-align: start; white-space: nowrap; }
.alert { padding: 0.8rem 1rem; margin-bottom: 1rem; }
.alert-error { color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--cream)); }
.alert-success { color: var(--forest); border: 1px solid var(--sage); }
.empty { color: var(--muted); }
.pager { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-top: 1rem; }
.detail { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 0.8rem; }
.detail div, .summary dl div { background: var(--honeydew); border-radius: 14px; padding: 0.75rem; }
.detail dt, .summary dt { color: var(--muted); font-size: 0.85rem; }
.detail dd, .summary dd { margin: 0.2rem 0 0; font-weight: 600; }
.summary { padding: 1rem; background: var(--honeydew); }
.order-form { max-width: 46rem; padding: 1.15rem; gap: 1rem; }
.coupon-preview, .coupon-code { font-weight: 600; }
.combo { display: flex; flex-direction: column; gap: 0.4rem; }
.combo-field { position: relative; }
.combo-field input[type="search"] {
    background: var(--honeydew);
    border-radius: 16px;
    padding-inline-end: 2.4rem;
    font-size: 1rem;
}
.combo-list {
    position: absolute;
    z-index: 8;
    inset-inline: 0;
    top: calc(100% + 0.35rem);
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0.35rem;
    list-style: none;
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    max-height: min(16rem, 42dvh);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}
.combo-option, .combo-empty {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.5rem;
    min-height: 2.75rem;
    padding: 0.7rem 0.75rem;
    border-radius: 12px;
}
.combo-option { cursor: pointer; }
.combo-option.is-active, .combo-option:hover { background: color-mix(in srgb, var(--sage) 42%, var(--cream)); }
.combo-option[aria-selected="true"] { box-shadow: inset 0 0 0 2px var(--forest); }
.combo-name { flex: 1 1 8rem; min-width: 0; overflow-wrap: anywhere; }
.combo-name mark { background: var(--sage); color: var(--forest); border-radius: 0.3rem; padding: 0 0.2rem; }
.combo-coupon, .combo-note {
    flex: none;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
}
.combo-coupon { background: var(--forest); color: var(--honeydew); }
.combo-note { background: var(--honeydew); color: var(--muted); }
.combo-empty { color: var(--muted); }
.choice-set { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.choice-set legend { font-weight: 600; padding: 0; }
.choice-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.55rem; }
.choice {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 3.1rem;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--honeydew);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
}
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span { pointer-events: none; }
.choice:focus-within { outline: 2px solid var(--sage); outline-offset: 2px; }
.choice-pending:has(input:checked) { background: var(--honeydew); box-shadow: inset 0 0 0 2px var(--forest); }
.choice-completed:has(input:checked) { background: var(--sage); color: var(--forest); border-color: var(--forest); }
.choice-cancelled:has(input:checked) { background: color-mix(in srgb, var(--danger) 14%, var(--cream)); color: var(--danger); border-color: var(--danger); }
.coupon-code { font-size: clamp(1.35rem, 4vw, 1.8rem); margin: 0; overflow-wrap: anywhere; }
.subnav { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.8rem; }
.lang-switch {
    display: inline-flex;
    flex: none;
    gap: 0.15rem;
    align-items: center;
    margin-inline-start: auto;
    padding: 0.2rem;
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: 999px;
}
.lang-switch button {
    border: 0;
    background: transparent;
    color: var(--forest);
    border-radius: 999px;
    min-height: 2.25rem;
    padding: 0.35rem 0.8rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.lang-switch button.is-active { background: var(--forest); color: var(--honeydew); }
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.guest-body {
    display: grid;
    place-items: center;
    padding: 1.5rem;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
}
.guest-card { width: min(28rem, 100%); padding: 1.5rem; }
.guest-head {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.guest-head .lang-switch { margin-inline-start: 0; }
.guest-card h1 { margin-bottom: 1rem; }
.center { justify-content: center; margin-top: 1rem; }
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.bars li { display: grid; grid-template-columns: minmax(6rem, 9rem) 1fr auto; gap: 0.6rem; align-items: center; }
.bar-track { background: var(--honeydew); border-radius: 999px; height: 0.7rem; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--sage); border-radius: inherit; }
.changes { white-space: pre-wrap; font-family: ui-monospace, monospace; font-size: 0.78rem; margin: 0; max-width: min(28rem, 100%); overflow-wrap: anywhere; }
.secondary { background: var(--honeydew); border-radius: 14px; padding: 0.8rem 1rem; }
.field-error:empty { display: none; }
.field-error { color: var(--danger); margin: 0; }

@media (max-width: 1100px) {
    :root { --sidebar: 15.5rem; }
    .topbar, .content { padding-inline: 1.1rem; }
    .card p { font-size: 1.3rem; }
}

@media (max-width: 900px) {
    .btn.menu-toggle { display: inline-flex; position: relative; z-index: 7; }
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 4;
        background: color-mix(in srgb, var(--forest) 28%, transparent);
    }
    .sidebar-backdrop.is-open { display: block; }
    .sidebar {
        position: fixed;
        inset-inline-start: 0;
        top: 4.6rem;
        bottom: 0;
        z-index: 5;
        width: min(19rem, calc(100vw - 3.25rem));
        flex-basis: auto;
        transform: translateX(-105%);
        transition: transform 160ms ease;
        overflow: auto;
        box-shadow: var(--shadow);
    }
    html[dir="rtl"] .sidebar { transform: translateX(105%); }
    .sidebar.is-open { transform: none; }
    body.menu-open { overflow: hidden; }
    .bars li { grid-template-columns: 1fr; }
    .podium, .podium-1, .podium-2 { grid-template-columns: 1fr; }
    .podium-card.place-1, .podium-card.place-2, .podium-card.place-3 { order: 0; }
    .period-pair, .rank-filters, .rank-period { grid-template-columns: 1fr; }
    .period-vs { justify-self: center; }
    .page-head { align-items: stretch; }
}

@media (max-width: 720px) {
    h1 { font-size: 1.35rem; }
    .topbar {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
    }
    .topbar h1 { grid-column: 1 / -1; grid-row: 2; }
    .lang-switch { grid-column: 2; grid-row: 1; justify-self: end; }
    .topbar, .content { padding-inline: max(0.85rem, env(safe-area-inset-left)); }
    .content { padding-bottom: max(2rem, env(safe-area-inset-bottom)); }
    .filters { grid-template-columns: 1fr; }
    .cards { grid-template-columns: 1fr 1fr; }
    .page-head .btn, .filter-actions .btn, .actions .btn { flex: 1 1 12rem; }
    .table-wrap {
        overflow: visible;
        background: transparent;
        border: 0;
        box-shadow: none;
        border-radius: 0;
    }
    .table-wrap table { min-width: 0; display: block; }
    .table-wrap thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }
    .table-wrap tbody { display: grid; gap: 0.75rem; }
    .table-wrap tr {
        display: block;
        background: var(--cream);
        border: 1px solid var(--line);
        border-radius: 16px;
        padding: 0.25rem 0.9rem;
        box-shadow: var(--shadow);
    }
    .table-wrap td {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 0.85rem;
        border: 0;
        border-bottom: 1px solid var(--line);
        padding: 0.65rem 0;
        text-align: end;
        background: transparent;
    }
    .table-wrap td:last-child { border-bottom: 0; }
    .table-wrap td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--muted);
        text-align: start;
        flex: 1 1 42%;
    }
    .table-wrap td[data-label=""]::before { content: none; }
    .table-wrap td[data-label=""] { justify-content: flex-end; }
    .table-wrap tr:has(td[colspan]) td { display: block; text-align: start; }
    .table-wrap tr:has(td[colspan]) td::before { content: none; }
    .table-wrap tbody tr:hover td { background: transparent; }
    .guest-body { place-items: start center; padding: 0.75rem; }
    .guest-card { padding: 1.1rem; }
    .guest-head { align-items: flex-start; }
}

@media print {
    .sidebar, .sidebar-backdrop, .topbar, .skip, .no-print, .menu-toggle { display: none !important; }
    .shell, .workspace { display: block; min-height: 0; }
    body, .content { background: white; padding: 0; }
    .card, .panel, .table-wrap, .podium-card, .period-card { box-shadow: none; }
    .table-wrap { overflow: visible; }
    table { min-width: 0; }
    .podium, .period-pair, .podium-card { break-inside: avoid; }
}

@media (max-width: 420px) {
    .cards { grid-template-columns: 1fr; }
    .choice-row { grid-template-columns: 1fr; }
    .combo-list { max-height: min(12.5rem, 36dvh); }
    .topbar { align-items: flex-start; }
    .lang-switch button { padding-inline: 0.65rem; }
}
