:root {
    color-scheme: light;
    --ink: #333333;
    --muted: #68717a;
    --line: #d9e0e8;
    --surface: #ffffff;
    --soft: #f4f6f8;
    --primary: #004781;
    --primary-dark: #00284b;
    --accent: #db5940;
    --accent-dark: #c3251d;
    --link: #7b9ddd;
    --footer: #343c3e;
    --danger: #c3251d;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Source Sans Pro", "Open Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--soft);
}

a {
    color: inherit;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 10px 16px;
    color: white;
    background: var(--primary-dark);
    border-bottom: 4px solid var(--accent);
}

.brand {
    font-weight: 800;
    text-decoration: none;
    letter-spacing: 0.01em;
}

.app-menu {
    position: relative;
}

.app-menu summary {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 8px;
    color: white;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    font-size: 30px;
    line-height: 1;
    list-style: none;
}

.app-menu summary::-webkit-details-marker {
    display: none;
}

.app-menu[open] summary {
    background: var(--accent);
}

.nav {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    display: grid;
    min-width: min(86vw, 340px);
    overflow: hidden;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(0, 40, 75, 0.2);
    font-size: 18px;
}

.nav a,
.tabs a {
    color: var(--primary-dark);
    text-decoration: none;
}

.nav a {
    display: block;
    min-height: 52px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    font-weight: 750;
}

.nav a:last-child {
    border-bottom: 0;
}

.nav a:hover,
.tabs .active {
    color: var(--accent);
}

.nav a:hover {
    background: #f4f6f8;
}

.shell {
    width: min(920px, 100%);
    margin: 0 auto;
    padding: 20px 16px 56px;
}

.auth {
    display: grid;
    min-height: calc(100vh - 98px);
    place-items: center;
    padding: 20px;
}

.hero {
    padding: 18px 0 10px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    font-size: 30px;
    line-height: 1.1;
    color: var(--primary-dark);
}

h2 {
    font-size: 18px;
    color: var(--primary-dark);
}

.panel,
.row,
.booking,
.action {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.panel {
    padding: 16px;
}

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

.actions {
    display: grid;
    gap: 12px;
}

.action {
    display: block;
    padding: 18px;
    font-weight: 750;
    text-decoration: none;
    border-left: 5px solid var(--primary);
}

.action:hover {
    border-left-color: var(--accent);
    color: var(--primary-dark);
}

.list {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.day-list {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.day-panel h2 {
    margin-bottom: 10px;
}

.row,
.booking {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
}

.row span,
.booking span,
.hero p,
.empty {
    display: block;
    color: var(--muted);
}

.booking {
    align-items: flex-start;
    flex-wrap: wrap;
}

.compact-list {
    margin-top: 0;
}

.booking-line {
    display: grid;
    gap: 2px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.booking-line:last-child {
    border-bottom: 0;
}

.booking-line span {
    color: var(--muted);
}

.qr {
    display: block;
    width: 132px;
    max-width: 100%;
    margin-inline: auto;
    aspect-ratio: 1;
    object-fit: contain;
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 6px;
}

.qr.large {
    width: min(320px, 100%);
}

.qr.thumb {
    width: 56px;
}

.qr-link {
    display: block;
    text-decoration: none;
}

.gate-view {
    display: grid;
    min-height: calc(100vh - 140px);
    place-items: center;
    padding: 18px;
}

.gate-panel {
    display: grid;
    gap: 18px;
    width: min(560px, 100%);
    text-align: center;
}

.gate-panel h1 {
    margin-bottom: 4px;
    font-size: 42px;
}

.gate-panel p {
    color: var(--muted);
    font-size: 20px;
}

.gate-qr {
    width: min(86vw, 460px);
    border-width: 2px;
    padding: 12px;
}

form {
    margin: 0;
}

label {
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
    font-weight: 650;
}

input,
select,
button {
    width: 100%;
    min-height: 44px;
    border-radius: 8px;
    font: inherit;
}

input,
select {
    border: 1px solid var(--line);
    padding: 10px 12px;
    background: white;
}

button {
    border: 0;
    padding: 10px 14px;
    color: white;
    background: var(--accent);
    font-weight: 750;
    cursor: pointer;
}

button:hover {
    background: var(--accent-dark);
}

button.secondary {
    color: var(--ink);
    background: #e9eef5;
    border: 1px solid var(--line);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: 8px;
    padding: 10px 14px;
    color: white;
    background: var(--accent);
    font-weight: 750;
    text-decoration: none;
}

.button.secondary {
    color: var(--ink);
    background: #e9eef5;
    border: 1px solid var(--line);
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.button-row > * {
    flex: 1 1 130px;
}

.button-row.compact {
    justify-content: flex-end;
}

.button-row.compact > * {
    flex: 0 1 auto;
}

.disclosure {
    margin-bottom: 16px;
}

.disclosure summary {
    color: var(--primary-dark);
    cursor: pointer;
    font-size: 18px;
    font-weight: 750;
}

.disclosure form {
    margin-top: 16px;
}

.checkline {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkline input {
    width: auto;
    min-height: auto;
}

.date-picker {
    display: grid;
    gap: 10px;
    align-items: end;
}

.tabs {
    display: flex;
    gap: 18px;
    margin: 0 0 16px;
    border-bottom: 1px solid var(--line);
}

.tabs a {
    padding-bottom: 10px;
    font-weight: 750;
    color: var(--primary-dark);
}

.flash {
    width: min(920px, calc(100% - 32px));
    margin: 12px auto 0;
    padding: 12px 14px;
    border-radius: 8px;
    background: #eaf1fb;
    color: var(--primary-dark);
    border-left: 5px solid var(--link);
}

.flash.error,
.error {
    color: var(--danger);
    background: #ffebe9;
}

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

.secret-key {
    margin: 0 0 14px;
    padding: 12px;
    color: var(--primary-dark);
    background: #eaf1fb;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 18px;
    font-weight: 750;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.footer {
    padding: 22px 16px;
    color: #cccccc;
    background: var(--footer);
    text-align: center;
}

@media (min-width: 680px) {
    .grid,
    .actions,
    .date-picker {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .date-picker button {
        width: auto;
    }
}
