/* ============================================================
   Tokens
   ============================================================ */

/*
   Theme: follows the device setting unless the viewer picks one with the header toggle,
   which sets data-theme on <html> (see theme.js). Each colour is light-dark(light, dark).
*/
:root {
    color-scheme: light dark;
}

:root[data-theme="light"] {
    color-scheme: light;
}

:root[data-theme="dark"] {
    color-scheme: dark;
}

:root {
    --bg: light-dark(#f3f0f8, #12071c);
    --card: light-dark(#ffffff, #1e1029);
    --card-2: light-dark(#f7f4fb, #271735);
    --ink: light-dark(#1d1033, #f1ecfa);
    --muted: light-dark(#6e6585, #a597bb);
    --line: light-dark(#e7e2f0, #33224a);
    --brand: light-dark(#37003c, #2a0730);
    --brand-ink: #ffffff;
    --accent: #00c86a;
    --violet: #9b4dff;   /* tint for unselected chips */
    --hi: light-dark(#00a650, #2fd37a);
    --lo: light-dark(#d6244b, #ff5c7c);
    --gold: #e0b100;
    --silver: #a7adb7;
    --bronze: #c27c3e;
    --me: color-mix(in srgb, var(--accent) 14%, transparent);
    --shadow-color: light-dark(rgba(29, 16, 51, .06), transparent);
    --shadow: 0 1px 2px var(--shadow-color), 0 4px 14px var(--shadow-color);
    --radius: 16px;
    --tabbar-h: 64px;
    --topbar-h: 64px;   /* updated from JS to the real header height */
}


/* ============================================================
   Base
   ============================================================ */

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
}

button {
    font: inherit;
    color: inherit;
}

.muted {
    color: var(--muted);
}

.up {
    color: var(--hi);
}

.down {
    color: var(--lo);
}

.num {
    font-variant-numeric: tabular-nums;
}


/* ============================================================
   Top bar
   ============================================================ */

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--brand);
    color: var(--brand-ink);
    padding-top: env(safe-area-inset-top);
}

.topbar-inner {
    max-width: 640px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.brand {
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .18);
}

.topbar-title {
    flex: 1;
    min-width: 0;
}

h1 {
    margin: 0;
    font-size: 18px;
    letter-spacing: -.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* "Your team" avatar in the header (team initials); opens the team picker. */
.me-chip {
    flex: none;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    background: var(--accent);
    color: #062b18;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .02em;
    cursor: pointer;
}

.me-chip svg {
    display: none;
}

.me-chip.unset {
    border: 2px dashed rgba(255, 255, 255, .5);
    background: rgba(255, 255, 255, .12);
    color: inherit;
}

.me-chip.unset svg {
    display: block;
}

.me-chip.unset span {
    display: none;
}

/* The team's own FPL club crest, when they've made one, replaces the initials. */
.me-chip img {
    display: none;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: contain;
    background: #ffffff;
}

.me-chip.has-crest {
    overflow: hidden;
    padding: 0;
    border-color: #ffffff;
    background: #ffffff;
}

.me-chip.has-crest img {
    display: block;
}

.me-chip.has-crest span {
    display: none;
}

.sub {
    font-size: 11.5px;
    opacity: .75;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

/* Fixed-width digits so the ticking countdown doesn't jiggle. */
.sub .deadline,
.deadline-full {
    font-variant-numeric: tabular-nums;
}

.deadline-full {
    margin: 10px 0 4px;
    font-size: 17px;
    font-weight: 700;
}

/* Under 24 hours to the deadline: make it stand out. */
.sub .deadline.soon {
    color: var(--gold);
    font-weight: 700;
}

.icon-btn {
    flex: none;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: inherit;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.theme-btn .icon-sun,
.theme-btn[data-mode="dark"] .icon-moon {
    display: none;
}

.theme-btn[data-mode="dark"] .icon-sun {
    display: block;
}

/* Notification bell: shows the filled bell when on, the slashed bell when off. */
.notify-btn .icon-bell-off {
    display: none;
}

.notify-btn:not(.notify-on) .icon-bell {
    display: none;
}

.notify-btn:not(.notify-on) .icon-bell-off {
    display: block;
}

.notify-btn.notify-on .icon-bell {
    color: var(--accent);
}

.icon-btn.spin svg {
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* ============================================================
   Bottom tab bar
   ============================================================ */

.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    display: flex;
    justify-content: center;
    background: var(--card);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
}

.tabbar button {
    flex: 1;
    max-width: 128px;
    height: var(--tabbar-h);
    border: 0;
    background: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
}

.tabbar button svg {
    width: 24px;
    height: 24px;
}

.tabbar button.on {
    color: var(--ink);
}

.tabbar button.on svg {
    color: var(--accent);
}


/* ============================================================
   Layout
   ============================================================ */

main {
    max-width: 640px;
    margin: 0 auto;
    padding: 14px 16px 0;
}

.stack > * + * {
    margin-top: 12px;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-pad {
    padding: 14px 16px;
}

.card-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    padding: 14px 16px 6px;
    font-size: 15px;
    font-weight: 650;
}

.card-title small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    padding: 0 2px;
    font-size: 15px;
    font-weight: 650;
}

.section-title small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
}

/* Summary cards that stay visible under the header while the list scrolls. */
.pinned {
    position: sticky;
    top: var(--topbar-h);
    z-index: 5;
    margin-left: -16px;
    margin-right: -16px;
    padding: 8px 16px;
    background: var(--bg);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.loading,
.empty {
    padding: 28px 0;
    color: var(--muted);
    text-align: center;
}

.err {
    padding: 16px;
    background: var(--card);
    border: 1px solid var(--lo);
    border-radius: var(--radius);
}


/* ============================================================
   Stat tiles
   ============================================================ */

.tile {
    position: relative;
    padding: 12px 14px;
}

.tile .label {
    padding-right: 18px;
    font-size: 12px;
    color: var(--muted);
}

.tile .value {
    margin: 2px 0;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.15;
}

.tile .holder,
.tile .holder-sub {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tile .holder {
    font-size: 13px;
    font-weight: 600;
}

.tile .holder-sub {
    font-size: 12px;
    color: var(--muted);
}

.tile.tappable {
    cursor: pointer;
}

.tile.tappable:active {
    transform: scale(.98);
}

.info-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    color: var(--muted);
}


/* ============================================================
   Hero card (winner / leader)
   ============================================================ */

.hero {
    padding: 16px;
    border: 0;
    background: linear-gradient(135deg, var(--brand), #6a0f74);
    color: #fff;
}

.hero .eyebrow {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
    opacity: .8;
}

.hero .name {
    margin: 4px 0 2px;
    font-size: 20px;
    font-weight: 700;
}

.hero .meta {
    font-size: 13px;
    opacity: .85;
}

.hero .big {
    font-size: 34px;
    font-weight: 800;
    line-height: 1;
}

.hero-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
}

.hero-text {
    min-width: 0;
}

.hero-you {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, .2);
    font-size: 13px;
    font-weight: 600;
}

.hero .name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* ============================================================
   Chips and segmented control
   ============================================================ */

.chips {
    display: flex;
    gap: 8px;
    margin: 0 -16px;
    padding: 2px 16px;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
}

.chips::-webkit-scrollbar {
    display: none;
}

.chip {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: color-mix(in srgb, var(--violet) 14%, var(--card));
    border: 1px solid color-mix(in srgb, var(--violet) 35%, var(--line));
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    scroll-snap-align: start;
}

.chip.on {
    background: var(--accent);
    border-color: var(--accent);
    color: #062b18;
    box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 35%, transparent);
}

.chip .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
}

.chip.on .dot {
    background: #062b18;
}

/* Secondary filter row (e.g. positions under All · Differentials · Mine). */
.chip.small {
    padding: 5px 11px;
    font-size: 13px;
}

/* Monthly: current month and Honours pinned on the left, earlier months scroll beside them. */
.month-picker {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: -16px;
}

.month-pinned {
    flex: none;
    display: flex;
    gap: 8px;
}

.chips.month-past {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 2px 16px 2px 8px;
    border-left: 1px solid var(--line);
}

.segmented {
    display: flex;
    padding: 3px;
    background: var(--card-2);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.segmented button {
    flex: 1;
    padding: 8px 6px;
    border: 0;
    border-radius: 9px;
    background: none;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.segmented button.on {
    background: var(--card);
    color: var(--ink);
    box-shadow: var(--shadow);
}


/* ============================================================
   Gameweek stepper
   ============================================================ */

.stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px;
}

.stepper button {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: var(--card-2);
    font-size: 20px;
    cursor: pointer;
}

.stepper button:disabled {
    opacity: .3;
    cursor: default;
}

.stepper .label {
    text-align: center;
}

.stepper .label b {
    display: block;
    font-size: 17px;
}

/* Live gameweek progress under the stepper. */
.gw-progress {
    padding: 0 12px 12px;
}

.gw-progress-bar {
    height: 8px;
    border-radius: 4px;
    background: var(--card-2);
    overflow: hidden;
}

.gw-progress-bar i {
    display: block;
    height: 100%;
    border-radius: 4px;
    background: var(--accent);
    transition: width .4s;
}

.gw-progress-text {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
}

.gw-progress-text b {
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.live-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 5px;
    border-radius: 50%;
    background: var(--lo);
    vertical-align: 1px;
    animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
    50% {
        opacity: .3;
    }
}

.stepper .label span {
    font-size: 12px;
    color: var(--muted);
}


/* ============================================================
   Ranked list
   ============================================================ */

.list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.list > li {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    padding: 11px 16px;
    border-top: 1px solid var(--line);
}

.list > li:first-child {
    border-top: 0;
}

.list > li.me {
    background: var(--me);
}

.list > li.tap {
    cursor: pointer;
}

.pos {
    flex: none;
    width: 28px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
}

.pos small {
    display: block;
    margin-top: 2px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
}

.medal {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: #1d1033;
    font-size: 13px;
    font-weight: 800;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18);
}

.medal.gold {
    background: var(--gold);
}

.medal.silver {
    background: var(--silver);
}

.medal.bronze {
    background: var(--bronze);
}

.who {
    flex: 1;
    min-width: 0;
}

.who b {
    display: block;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.who > span {
    display: block;
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Lifts the part of a subtitle that names the thing being ranked, e.g. the chip on a chip row. */
.who > span strong {
    color: var(--ink);
    font-weight: 600;
}

.stat {
    flex: none;
    min-width: 44px;
    text-align: right;
}

.stat b {
    display: block;
    font-size: 16px;
    font-variant-numeric: tabular-nums;
}

.stat span {
    display: block;
    font-size: 11px;
    color: var(--muted);
}

.stat.dim b {
    font-size: 15px;
    font-weight: 500;
    color: var(--muted);
}

.tag {
    display: inline-block;
    margin-right: 4px;
    padding: 1px 7px;
    border-radius: 6px;
    background: var(--card-2);
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    vertical-align: 1px;
}

/* Captain's armband: a little gold band with C (silver with VC for the vice-captain). */
.armband {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 16px;
    margin-right: 5px;
    padding: 0 4px;
    border-radius: 3px;
    background: var(--gold);
    color: #1d1033;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .03em;
    vertical-align: 1px;
    box-shadow: inset 3px 0 0 rgba(0, 0, 0, .18), inset -3px 0 0 rgba(0, 0, 0, .18);
}

.armband.vice {
    background: var(--silver);
}

.tag.chip-tag {
    background: color-mix(in srgb, var(--accent) 22%, transparent);
    color: var(--ink);
}

.tag.hit {
    background: color-mix(in srgb, var(--lo) 18%, transparent);
    color: var(--lo);
}


/* "Get the app" hint on the Table page. */
.install-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 10px 12px;
}

.install-banner img {
    flex: none;
    border-radius: 10px;
}

.install-text {
    flex: 1;
    min-width: 0;
    font-size: 13px;
}

.install-text b {
    display: block;
    font-size: 14px;
}

.install-how {
    color: var(--muted);
}

.install-how b {
    display: inline;
    font-size: 13px;
    color: var(--ink);
}

.inline-icon {
    vertical-align: -3px;
}

.install-btn {
    margin-top: 4px;
    padding: 6px 14px;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: #062b18;
    font-weight: 700;
    cursor: pointer;
}

.install-close {
    flex: none;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: var(--card-2);
    color: var(--muted);
    cursor: pointer;
}

/* iPhone "Add to Home Screen" guide. */
.install-sheet-head {
    display: flex;
    align-items: center;
    gap: 14px;
}

.install-sheet-head img {
    flex: none;
    border-radius: 13px;
}

.install-sheet-head .sheet-info {
    margin: 2px 0 0;
}

.install-steps {
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.install-steps li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
    font-size: 15px;
}

.install-steps li:first-child {
    border-top: 0;
}

.step-no {
    flex: none;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent);
    color: #062b18;
    font-size: 13px;
    font-weight: 800;
}

.install-tip {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--card-2);
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.install-tip b {
    color: var(--ink);
}

.install-tip > b:first-child {
    display: block;
    margin-bottom: 2px;
}

.install-tip .install-copy {
    border-color: var(--accent);
    color: var(--ink);
}

/* The viewer's own standing, pinned on the Table. */
.you-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-left: 4px solid var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, var(--card));
}

.you-card .who > span {
    white-space: normal;
}


/* ============================================================
   Analysis
   ============================================================ */

.link-btn {
    flex: none;
    padding: 4px 0;
    border: 0;
    background: none;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.detail-list {
    margin-top: 4px;
}

.detail-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 7px 0;
    border-top: 1px solid var(--line);
    font-size: 13px;
}

.detail-row:first-child {
    border-top: 0;
}

.detail-gw {
    flex: none;
    width: 38px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.detail-text {
    flex: 1;
    min-width: 0;
}

.detail-text small {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.detail-row b {
    flex: none;
    font-variant-numeric: tabular-nums;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding: 6px 0 2px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
}

.detail-header:first-child {
    margin-top: 0;
}

.detail-header + .detail-row {
    border-top: 0;
}

.detail-empty {
    padding: 8px 0;
    font-size: 13px;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-cloud .tag {
    margin: 0;
    font-size: 12px;
}


/* Cup tab placeholder. */
.cup-soon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 32px 24px;
    text-align: center;
}

.cup-soon svg {
    margin-bottom: 6px;
    color: var(--gold);
}


/* ============================================================
   Win / draw / loss bar
   ============================================================ */

.bar {
    display: flex;
    height: 6px;
    margin-top: 6px;
    border-radius: 3px;
    background: var(--card-2);
    overflow: hidden;
}

.bar i {
    display: block;
    height: 100%;
}

.bar .w {
    background: var(--hi);
}

.bar .d {
    background: var(--muted);
    opacity: .4;
}

.bar .l {
    background: var(--lo);
}


/* ============================================================
   Expandable detail rows
   ============================================================ */

.list > li.expand {
    display: block;
    min-height: 0;
    padding: 0 16px 14px 56px;
    border-top: 0;
}

.list > li.expand.flush {
    padding-left: 16px;
}

.chev {
    flex: none;
    color: var(--muted);
    transition: transform .15s;
}

li.open .chev {
    transform: rotate(90deg);
}

.section-label {
    margin: 10px 0 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
}

.players {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 6px;
}

.player {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 8px;
    background: var(--card-2);
    font-size: 13px;
}

.player b {
    font-variant-numeric: tabular-nums;
}

.player.bench {
    opacity: .6;
}

.player .nm {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gw-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 6px;
}

.gw-cell {
    padding: 6px;
    border-radius: 8px;
    background: var(--card-2);
    font-size: 12px;
    text-align: center;
}

.gw-cell b {
    display: block;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

.gw-cell.w {
    background: color-mix(in srgb, var(--hi) 20%, transparent);
}

.gw-cell.l {
    background: color-mix(in srgb, var(--lo) 16%, transparent);
}


/* ============================================================
   Form controls
   ============================================================ */

.select {
    width: 100%;
    padding: 12px 40px 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background-color: var(--card);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23888' stroke-width='2'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    appearance: none;
}


/* ============================================================
   Chart
   ============================================================ */

.chart {
    padding: 4px 8px 8px;
}

.chart svg {
    display: block;
    width: 100%;
    height: auto;
    color: var(--muted);
}


/* ============================================================
   Bottom sheet (explainers)
   ============================================================ */

.sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(10, 4, 16, 0);
    transition: background .2s;
}

.sheet-backdrop.open {
    background: rgba(10, 4, 16, .55);
}

.sheet {
    width: 100%;
    max-width: 640px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
    background: var(--card);
    transform: translateY(100%);
    transition: transform .25s ease-out;
}

.sheet-backdrop.open .sheet {
    transform: none;
}

.sheet-handle {
    width: 40px;
    height: 4px;
    margin: 0 auto 12px;
    border-radius: 2px;
    background: var(--line);
}

.sheet-title {
    font-size: 18px;
    font-weight: 700;
}

.sheet-info {
    margin: 6px 0 4px;
    color: var(--muted);
    font-size: 14px;
}

.sheet-list > li {
    padding-left: 0;
    padding-right: 0;
}

.sheet-list .tick {
    flex: none;
    color: var(--accent);
    font-size: 18px;
    font-weight: 700;
}

.sheet-primary {
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    border: 0;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.sheet-primary:disabled {
    opacity: 0.5;
    cursor: default;
}

.sheet-secondary {
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--lo);
    border-radius: 12px;
    background: none;
    color: var(--lo);
    font-weight: 600;
    cursor: pointer;
}

.sheet-close {
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    border: 0;
    border-radius: 12px;
    background: var(--card-2);
    font-weight: 600;
    cursor: pointer;
}


/* ============================================================
   Larger screens
   ============================================================ */

@media (min-width: 700px) {
    main {
        padding-top: 20px;
    }
}
