/* EUS Meet — clean paper UI */

:root {
    --bg: #f2ebe0;
    --paper: #fbf7f0;
    --ink: #1c1915;
    --ink2: #4a453e;
    --muted: #7a7268;
    --line: #d6cec2;
    --line2: #e7e0d5;
    --red: #c43b24;
    --red-deep: #9e2f1c;
    --green: #1f7a45;
    --green-fill: #d8efe2;
    --yellow: #9a7b1a;
    --yellow-fill: #f3e8c0;
    --blue: #255ea8;
    --blue-fill: #d7e6f7;
    --busy-a: #e8e1d6;
    --busy-b: #ddd5c8;
    --font-display: "Fraunces", Georgia, "Times New Roman", serif;
    --font-body: "Source Sans 3", "Source Sans Pro", "Segoe UI", sans-serif;
    --safe: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }

body.meet-body {
    min-height: 100%;
    min-height: 100dvh;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.45;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

a { color: var(--red); }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }

.meet-logo {
    width: 52px;
    height: auto;
    flex-shrink: 0;
    object-fit: contain;
    display: block;
}

.meet-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
}
.meet-brand .meet-wordmark {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.55rem;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--red);
}
.meet-brand-sm { gap: 8px; }
.meet-brand-sm .meet-logo { width: 30px; }
.meet-brand-sm .meet-wordmark { font-size: 1.05rem; }

.meet-topbar-brand {
    display: inline-flex;
    flex-shrink: 0;
    text-decoration: none;
    color: inherit;
}

.meet-wordmark {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
    text-decoration: none;
}

.meet-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.95rem;
}
.meet-btn-primary {
    width: 100%;
    background: var(--red);
    color: #fff;
}
.meet-btn-primary:hover { background: var(--red-deep); }
.meet-btn-quiet {
    background: var(--paper);
    border-color: var(--line);
    color: var(--ink2);
}
.meet-btn-quiet:hover { border-color: var(--ink); color: var(--ink); }
.meet-btn-sm {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 0.85rem;
}

.meet-field { margin-bottom: 14px; }
.meet-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink2);
    margin-bottom: 6px;
}
.meet-input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fff;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
.meet-input:focus { border-color: var(--ink); }
textarea.meet-input {
    min-height: 84px;
    resize: vertical;
    line-height: 1.45;
}
select.meet-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237a7268' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
}
.meet-hint {
    margin-top: 6px;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.4;
}
.meet-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 420px) {
    .meet-row { grid-template-columns: 1fr; }
}
.meet-tz { font-size: 0.82rem; color: var(--muted); }
.meet-error {
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid #e4b4aa;
    background: #faf1ee;
    color: var(--red-deep);
    font-size: 0.9rem;
    border-radius: 4px;
}

/* Create */
.meet-create {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 36px 18px max(40px, calc(24px + var(--safe)));
}
.meet-create-hero { margin-bottom: 28px; }
.meet-create-hero .meet-brand { margin-bottom: 18px; }
.meet-create-hero h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.6rem, 6vw, 2rem);
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 0 0 8px;
}
.meet-create-hero p {
    color: var(--ink2);
    font-size: 1rem;
    max-width: 28em;
}
@media (max-width: 420px) {
    .meet-brand .meet-logo { width: 44px; }
    .meet-brand .meet-wordmark { font-size: 1.4rem; }
}
.meet-form {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 20px 18px;
}
.meet-section {
    margin: 18px 0 8px;
    padding-top: 14px;
    border-top: 1px solid var(--line2);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--muted);
}
.meet-credit {
    text-align: center;
    margin-top: 22px;
    font-size: 0.78rem;
    color: var(--muted);
}
.meet-credit a {
    color: var(--muted);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.meet-credit a:hover { color: var(--ink2); }

/* Name gate */
#meet-app { min-height: 100dvh; }
#meet-name {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}
#meet-name.gone { display: none; }
.meet-name-card {
    width: 100%;
    max-width: 360px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 22px 18px;
}
.meet-name-card .meet-brand { margin-bottom: 14px; }
.meet-name-card h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
    margin: 10px 0 6px;
}
.meet-name-card > p {
    color: var(--ink2);
    font-size: 0.95rem;
    margin-bottom: 18px;
}

#meet-grid { display: none; }
#meet-grid.on { display: block; }

.meet-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}
.meet-topbar-title {
    flex: 1;
    min-width: 0;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.meet-status {
    font-size: 0.78rem;
    color: var(--muted);
    white-space: nowrap;
}
.meet-status.live { color: var(--green); }
.meet-status.saving { color: var(--yellow); }
.meet-status.offline { color: var(--red); }

.meet-banner {
    margin: 0;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
    font-size: 0.9rem;
}
.meet-banner.locked { background: #f8e9e5; }
.meet-banner.booked { background: #e8f4ec; }
.meet-banner.room { color: var(--ink2); }
.meet-banner + .meet-banner { border-top: 0; }

.meet-org-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line2);
    background: var(--paper);
}
.meet-org-bar[hidden] { display: none !important; }

.meet-wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 14px 16px max(88px, calc(64px + var(--safe)));
}

.meet-layout {
    display: grid;
    gap: 20px;
}
@media (min-width: 960px) {
    .meet-layout {
        grid-template-columns: minmax(0, 1fr) 260px;
        align-items: start;
        gap: 28px;
    }
}

.meet-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 0 0 10px;
    font-size: 0.8rem;
    color: var(--ink2);
}
.meet-legend i {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 5px;
    vertical-align: -1px;
    border: 1px solid var(--line);
}
.leg-free { background: var(--green-fill); border-color: var(--green) !important; }
.leg-maybe { background: var(--yellow-fill); border-color: var(--yellow) !important; }
.leg-both { background: var(--blue-fill); border-color: var(--blue) !important; }
.leg-others { background: rgba(196, 59, 36, 0.22); border-color: rgba(196, 59, 36, 0.4) !important; }
.leg-busy {
    background: repeating-linear-gradient(-45deg, var(--busy-a), var(--busy-a) 3px, var(--busy-b) 3px, var(--busy-b) 6px);
}

.meet-desk { display: none; }
@media (min-width: 720px) {
    .meet-desk { display: block; }
    .meet-mob { display: none !important; }
}
.meet-gc {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 4px;
    overflow: hidden;
}
.meet-gs {
    display: flex;
    overflow: auto;
    max-height: min(64vh, 680px);
    -webkit-overflow-scrolling: touch;
}
.meet-gt {
    flex-shrink: 0;
    width: 48px;
    position: sticky;
    left: 0;
    z-index: 5;
    background: var(--paper);
    border-right: 1px solid var(--line2);
    padding-top: 40px;
}
.meet-gtl {
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 6px;
    font-size: 0.68rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.meet-gd { flex: 1; min-width: 58px; }
.meet-gdh {
    height: 40px;
    position: sticky;
    top: 0;
    z-index: 4;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.meet-gdh .dn {
    font-weight: 700;
    font-size: 0.82rem;
}
.meet-gdh .dd {
    font-size: 0.68rem;
    color: var(--muted);
}
.meet-slot {
    height: 26px;
    border-right: 1px solid var(--line2);
    border-bottom: 1px solid var(--line2);
    cursor: crosshair;
    position: relative;
    user-select: none;
    touch-action: none;
}
.meet-slot.free { background: var(--green-fill) !important; }
.meet-slot.maybe { background: var(--yellow-fill) !important; }
.meet-slot.both { background: var(--blue-fill) !important; }
.meet-slot.busy {
    background: repeating-linear-gradient(-45deg, var(--busy-a), var(--busy-a) 3px, var(--busy-b) 3px, var(--busy-b) 6px) !important;
    cursor: not-allowed;
}
.meet-slot.booked-win { box-shadow: inset 0 0 0 2px var(--green); }
.meet-slot.hl-person { box-shadow: inset 0 0 0 2px var(--red); }
.meet-gfoot {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    border-top: 1px solid var(--line2);
    font-size: 0.8rem;
    color: var(--muted);
    background: var(--bg);
}

.meet-mob { display: flex; flex-direction: column; gap: 8px; }
.meet-day {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 4px;
    overflow: hidden;
}
.meet-day-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    cursor: pointer;
    min-height: 48px;
}
.meet-day-name { font-weight: 700; font-size: 1rem; }
.meet-day-meta { font-size: 0.8rem; color: var(--muted); }
.meet-day-body { display: none; padding: 0 12px 12px; }
.meet-day.expanded .meet-day-body { display: block; }
.meet-day-hdr .chev {
    color: var(--muted);
    transition: transform 0.15s ease;
}
.meet-day.expanded .chev { transform: rotate(90deg); }
.meet-chips {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 6px;
}
.meet-chip {
    min-height: 48px;
    border-radius: 4px;
    border: 1px solid var(--line);
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}
.meet-chip.free { background: var(--green-fill); border-color: var(--green); }
.meet-chip.maybe { background: var(--yellow-fill); border-color: var(--yellow); }
.meet-chip.both { background: var(--blue-fill); border-color: var(--blue); }
.meet-chip.busy {
    opacity: 0.5;
    pointer-events: none;
    background: repeating-linear-gradient(-45deg, var(--busy-a), var(--busy-a) 3px, var(--busy-b) 3px, var(--busy-b) 6px);
}
.meet-chip .sub {
    font-size: 0.68rem;
    color: var(--muted);
    font-weight: 500;
}

.meet-rail { display: none; }
@media (min-width: 960px) {
    .meet-rail {
        display: block;
        position: sticky;
        top: 64px;
    }
}
.meet-panel {
    padding: 0 0 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--line);
}
.meet-panel:last-child {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0;
}
.meet-panel h3 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 10px;
}
.meet-rank {
    padding: 10px 0;
    border-top: 1px solid var(--line2);
}
.meet-rank:first-of-type { border-top: 0; padding-top: 0; }
.meet-rank-t {
    font-weight: 700;
    font-size: 0.92rem;
}
.meet-rank-c {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 2px;
}
.meet-rank-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}
.meet-rank-actions a,
.meet-rank-actions button {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--red);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.meet-person {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 8px 0;
    border-top: 1px solid var(--line2);
    text-align: left;
    font-size: 0.92rem;
}
.meet-person:first-of-type { border-top: 0; }
.meet-person.active { color: var(--red); font-weight: 700; }
.meet-person-meta { font-size: 0.78rem; color: var(--muted); font-weight: 500; white-space: nowrap; }

.meet-tabbar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 80;
    gap: 8px;
    padding: 10px 12px max(12px, var(--safe));
    background: var(--bg);
    border-top: 1px solid var(--line);
}
@media (max-width: 959px) {
    .meet-tabbar { display: flex; }
}
.meet-tab {
    flex: 1;
    min-height: 42px;
    border-radius: 4px;
    border: 1px solid var(--line);
    background: var(--paper);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ink2);
}
.meet-tab.primary {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}

.meet-sheet-bg {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(28, 25, 21, 0.28);
}
.meet-sheet-bg.on { display: block; }
.meet-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 310;
    max-height: 78dvh;
    overflow-y: auto;
    background: var(--paper);
    border-top: 1px solid var(--line);
    padding: 16px 16px max(20px, var(--safe));
    transform: translateY(110%);
    transition: transform 0.22s ease;
}
.meet-sheet.on { transform: translateY(0); }
.meet-sheet h3 {
    font-family: var(--font-display);
    font-weight: 700;
    margin-bottom: 12px;
}

.meet-dialog {
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0;
    max-width: 420px;
    width: calc(100% - 24px);
    background: var(--paper);
}
.meet-dialog::backdrop { background: rgba(28, 25, 21, 0.28); }
.meet-dialog-body { padding: 18px; }
.meet-dialog-body h3 {
    font-family: var(--font-display);
    font-weight: 700;
    margin-bottom: 14px;
}
.meet-dialog-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.meet-dialog-actions .meet-btn { flex: 1; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}
