/* The Lobby: plain, mobile-first CSS. Big tap targets, 16px inputs (stops iPhone auto-zoom). */
:root {
    --free: #2e9e5b;
    --held: #e0a800;
    --taken: #d64545;
    --ink: #1f2933;
    --muted: #61707d;
    --line: #d9e0e6;
    --bg: #f5f7f9;
    --brand: #2f5fd0;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
}

.wrap { max-width: 640px; margin: 0 auto; padding: 16px; }

header.top { background: #fff; border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; padding-bottom: 12px; }
header.top a { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.15rem; }

h1 { font-size: 1.5rem; margin: 8px 0 4px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 16px 0; }

label { display: block; font-weight: 600; margin: 12px 0 4px; }
input[type=text], input[type=date], textarea {
    width: 100%;
    min-height: 48px;
    padding: 10px 12px;
    font: inherit;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
textarea { min-height: 140px; font-family: ui-monospace, Consolas, monospace; font-size: 15px; }
input.code { text-transform: uppercase; letter-spacing: .15em; }

button, .btn {
    display: inline-block;
    min-height: 48px;
    padding: 10px 20px;
    margin-top: 16px;
    font: inherit;
    font-weight: 700;
    color: #fff;
    background: var(--brand);
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
}
button.block, .btn.block { width: 100%; text-align: center; }

.errors { background: #fdecec; border: 1px solid #f3b6b6; color: #8a1f1f; padding: 10px 12px; border-radius: 8px; margin: 12px 0; }
.errors p { margin: 0; }
.field-error { color: #8a1f1f; font-size: .875rem; margin: 4px 0 0; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: #e8eefc; color: var(--brand); }

.sharebox { word-break: break-all; background: var(--bg); border: 1px dashed var(--line); border-radius: 8px; padding: 10px 12px; font-family: ui-monospace, Consolas, monospace; font-size: .9rem; }

/* ---- Lobby ---- */
/* A floating toast: it must NOT push the page down when it appears or disappears, or buttons would jump away from a finger mid-tap. */
.notice { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 608px; margin: 0 auto; z-index: 10; padding: 12px 14px; border-radius: 8px; font-weight: 600; box-shadow: 0 4px 16px rgba(0,0,0,.18); }
.notice[hidden] { display: none; }
.notice.ok { background: #e6f5ec; border: 1px solid #a9dcbc; color: #1d6b3d; }
.notice.error { background: #fdecec; border: 1px solid #f3b6b6; color: #8a1f1f; }

.me-banner { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 12px 0 4px; font-weight: 600; }
.me-banner.holding { border-color: var(--held); background: #fff8e0; }
.me-banner.has-bed { border-color: var(--free); background: #e6f5ec; }
.me-banner.ended { border-color: var(--taken); background: #fdecec; }
.summary { margin: 0 0 8px; }

.room { margin: 20px 0; }
.room h2 { font-size: 1.05rem; margin: 0 0 8px; }
.beds { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 480px) { .beds { grid-template-columns: 1fr 1fr; } }

/* Colour AND words (Free / Held / Taken) so colour-blind people are not left guessing. */
.bed { background: #fff; border: 1px solid var(--line); border-left: 8px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.bed.free { border-left-color: var(--free); }
.bed.held { border-left-color: var(--held); background: #fffbea; }
.bed.taken { border-left-color: var(--taken); background: #fdf1f1; }
.bed.mine { outline: 3px solid var(--brand); }
.bed-label { font-weight: 700; }
.bed-status { color: var(--muted); font-size: .95rem; }
.bed-actions { display: flex; gap: 8px; }
.bed-actions button { flex: 1; margin-top: 10px; }
button.secondary, .btn.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }

/* ---- Home page: make "join" and "create" look like two different things ---- */
.card[hidden] { display: none; }
.join-card { background: #f3f7ff; border-left: 4px solid var(--brand); }
.create-card { border-top: 4px solid var(--brand); }
.divider { display: flex; align-items: center; gap: 12px; margin: 24px 0 0; color: var(--muted); font-size: .875rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.trip-list { list-style: none; margin: 0; padding: 0; }
.trip-list li { padding: 10px 0; border-top: 1px solid var(--line); }
.trip-list li:first-child { border-top: 0; }
.trip-list a { font-weight: 700; }

/* ---- Members and audit pages ---- */
.flash { padding: 12px 14px; border-radius: 8px; margin: 12px 0; font-weight: 600; }
.flash.ok { background: #e6f6ec; color: #14532d; border: 1px solid #b7e4c7; }
.flash.error { background: #fdecec; color: #8a1f1f; border: 1px solid #f3b6b6; }
.member.removed { opacity: .6; }
.member-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.member-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
form.inline { display: flex; gap: 8px; align-items: center; margin: 0; }
.member-actions button, .member-actions select { margin-top: 8px; }
select { min-height: 48px; padding: 8px 12px; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
button.danger { background: #b42318; }
.badge.gone { background: #fdecec; color: #8a1f1f; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.audit-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.audit-row p { margin: 4px 0 0; }
.mono { font-family: ui-monospace, Consolas, monospace; }

/* ---- Invite link ---- */
input.sharebox { font-family: ui-monospace, Consolas, monospace; font-size: .9rem; }
.invite-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.invite-actions button, .invite-actions .btn { margin-top: 10px; }
button:disabled { opacity: .55; cursor: wait; }
.countdown { font-variant-numeric: tabular-nums; }

/* ---- Vault ---- */
.file-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.file-row p { margin: 4px 0 0; }
.file-row a { word-break: break-word; }
input[type="file"] { display: block; width: 100%; margin: 8px 0 12px; font: inherit; }
