/* ── Reset ── */

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

[hidden] {
    display: none !important;
}

/* ── Tokens ── */

:root {
    --bg: #fafaf9;
    --bg-alt: #e1e1e0;
    --surface: #fff;
    --text: #1c1917;
    --muted: #78716c;
    --border: #e7e5e4;
    --accent: #c0392b;
    --accent-hover: #a93226;
    --accent-text: #fff;
    --overlay: rgba(28, 25, 23, 0.4);
    --radius: 8px;
    --radius-lg: 12px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --mono: "SF Mono", "Fira Code", "Fira Mono", monospace;
    --btn-h: 48px;
}

/* ── Base ── */

html {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100dvh;
}

.view {
    display: contents;
}
.view[hidden] {
    display: none !important;
}

/* ── Buttons ── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--btn-h);
    padding: 0 24px;
    font: 600 1rem/1 var(--font);
    border: 1px solid var(--text);
    border-radius: var(--radius);
    background: var(--bg-alt);
    color: var(--text);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
    transition: background 0.12s;
}

.btn.primary {
    border-width: 3px;
}
.btn.primary:hover {
    background: #d6d3d1;
}

.btn.secondary {
    background: var(--bg-alt);
    color: var(--text);
}
.btn.secondary:hover {
    background: #d6d3d1;
}

.btn:active,
.btn:active:hover {
    background: #000 !important;
    color: #fff;
    border-color: #fff;
}

.btn.small {
    height: calc(var(--btn-h) - 8px);
    padding: 0 14px;
    font-size: 0.8125rem;
}

/* ── Landing ── */

#landing,
#callback-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: 24px;
}

.landing-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
    width: 100%;
    max-width: 300px;
}

.logo {
    font-size: 4rem;
    line-height: 1;
}

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

.spin {
    animation: spin 2s linear infinite;
}

.landing-card h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}
.landing-card h1 span,
.app-title span {
    color: var(--accent);
}

.subtitle {
    color: var(--muted);
    font-size: 1.05rem;
}

.loading-pulse {
    animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

.landing-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin-top: 8px;
}

.landing-actions .btn {
    width: 100%;
}

.divider {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.code-input {
    height: var(--btn-h);
    padding: 0 16px;
    font: 600 1.125rem var(--mono);
    letter-spacing: 0.12em;
    text-align: center;
    text-transform: uppercase;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    outline: none;
    width: 100%;
    transition: border-color 0.12s;
}
.code-input::placeholder {
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: none;
    color: var(--muted);
}
.code-input:focus {
    border-color: var(--accent);
}

/* ── App Header ── */

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex-shrink: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* ── Pending Badge ── */

.pending-badge {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 10px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #b45309;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 999px;
    white-space: nowrap;
    animation: fadeIn 0.12s ease;
}

.pending-badge[hidden] {
    display: none;
}

.app-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    flex-shrink: 0;
}

/* ── Header Center — Ledger Widget ── */

.header-center {
    position: relative;
    flex: 1 1 75%;
    max-width: 75%;
    display: flex;
    align-items: center;
    min-width: 0;
    /* Vertical hairline separators */
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

/* Bottom hairline — connects the two vertical separators.
   Fades in over 50 ms on open; fades out 50 ms after the slide
   finishes (500 ms delay) on close. */
.header-center::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border);
    opacity: 0;
    transition: opacity 25ms ease 250ms; /* closing: fade out after slide */
    pointer-events: none;
}

.header-center.chooser-open::after {
    opacity: 1;
    transition: opacity 25ms ease; /* opening: fade in immediately */
}

.chooser-title {
    display: block;
    flex: 1 1 0%;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 64px;
    padding: 0 12px;
    user-select: none;
    min-width: 0;
}

/* ── Chevron Toggle Button ── */

.btn-chooser-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--btn-h);
    height: var(--btn-h);
    border: none;
    border-left: 1px solid var(--border);
    border-radius: 0;
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.12s;
}

.btn-chooser-toggle:hover {
    background: var(--surface);
}

.chooser-chevron {
    transition: transform 250ms ease-in-out 25ms; /* opening */
}

/* When closing, rotate back with no delay */
.header-center:not(.chooser-open) .chooser-chevron {
    transition: transform 250ms ease-in-out;
}

.header-center.chooser-open .chooser-chevron {
    transform: rotate(180deg);
}

/* Red dot — no-PIN warning */
.hamburger-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #dc2626;
    border: 2px solid var(--bg);
    pointer-events: none;
}

.hamburger-dot[hidden] {
    display: none;
}

/* ── Chooser Drawer ── */

/* Clip wrapper — sits below header-center, hides the drawer when
   it is translated upward.  Uses explicit width calc to avoid the
   sub-pixel rounding mismatch between left+right in Firefox/Chrome. */
.chooser-drawer-clip {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    overflow: hidden;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    z-index: 20;
    pointer-events: none;
}

.header-center.chooser-open .chooser-drawer-clip {
    pointer-events: auto;
}

/* The actual drawer panel — slides via transform. */
.chooser-drawer {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: 6px;
    /* Closed: slid up behind the header */
    transform: translateY(-100%);
    /* Closing transition: slide up 500 ms, no delay */
    transition:
        transform 250ms ease-in-out,
        box-shadow 0ms ease 0ms;
}

.header-center.chooser-open .chooser-drawer {
    /* Open: slid into natural position */
    transform: translateY(0);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    /* Opening: slide down 500 ms after the 50 ms border fade;
       shadow snaps on only after the slide finishes (50 + 500). */
    transition:
        transform 250ms ease-in-out 25ms,
        box-shadow 0ms ease 275ms;
}

/* Action buttons row at top of drawer */
.chooser-actions {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
}

.chooser-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: none;
    color: var(--muted);
    font: 600 0.8125rem var(--font);
    cursor: pointer;
    transition:
        color 0.1s,
        border-color 0.1s;
}

.chooser-action-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.chooser-pin-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #dc2626;
    flex-shrink: 0;
}

.chooser-pin-dot[hidden] {
    display: none;
}

.chooser-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chooser-empty {
    text-align: center;
    padding: 16px;
    color: var(--muted);
    font-size: 0.875rem;
}

/* List item: row button + leave button side by side */
.chooser-li {
    display: flex;
    align-items: center;
    gap: 0;
}

.chooser-leave-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--muted);
    transition:
        color 0.15s,
        background 0.15s;
    padding: 0;
}

.chooser-leave-btn svg {
    width: 14px;
    height: 14px;
}

.chooser-leave-btn:hover {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.08);
}

/* Each ledger row: name on left, members on right */
.chooser-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.1s;
    border: none;
    background: none;
    flex: 1;
    min-width: 0;
    text-align: left;
    font: inherit;
    color: var(--text);
}

.chooser-row:hover {
    background: var(--bg);
}

.chooser-row.active {
    background: var(--bg);
}

/* Left half: dot + name */
.chooser-row-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 1 45%;
    min-width: 0;
}

.chooser-row-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid var(--border);
    flex-shrink: 0;
}

.chooser-row.active .chooser-row-dot {
    background: var(--accent);
    border-color: var(--accent);
}

.chooser-row-name {
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.chooser-row.active .chooser-row-name {
    font-weight: 700;
}

/* Right half: member names */
.chooser-row-members {
    flex: 1 1 55%;
    min-width: 0;
    font-size: 0.75rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
}

/* ── Page / Ledger ── */

.page {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 16px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.section-header h2 {
    font-size: 2.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
}

.section-actions {
    display: flex;
    gap: 8px;
}

/* ── Ledger Table ── */

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: none;
    border-radius: var(--radius-lg);
    background: transparent;
}

.ledger-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.ledger-table th,
.ledger-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: none;
}

.ledger-table tbody td {
    background: var(--surface);
}

.ledger-table tbody tr:nth-child(even) td {
    background: var(--bg-alt);
}

.ledger-table tbody tr:first-child td:first-child {
    border-top-left-radius: var(--radius-lg);
}

.ledger-table tbody tr:first-child td:last-child {
    border-top-right-radius: var(--radius-lg);
}

.ledger-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: var(--radius-lg);
}

.ledger-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: var(--radius-lg);
}

.ledger-table thead th {
    background: transparent;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    vertical-align: bottom;
}

.col-item {
    min-width: 140px;
}
.col-date {
    width: 100px;
    white-space: nowrap;
}

.col-amount {
    width: 100px;
    text-align: right !important;
}

th.col-amount {
    font-size: 1.75rem !important;
    font-weight: 800 !important;
    color: var(--text) !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    text-align: center !important;
}

td.col-amount {
    font-family: var(--mono);
    font-weight: 600;
}

/* Member columns — vertical text reading bottom-up */

.col-member {
    width: 40px;
    min-width: 40px;
    text-align: center !important;
    padding: 8px 4px !important;
}

th.col-member {
    height: 120px;
    vertical-align: bottom;
}

.member-name {
    display: inline-block;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text);
    text-transform: none;
    max-height: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0 auto;
}

.col-member-you .member-name {
    font-weight: 900;
}

/* ── Settlement arrow (pure CSS: line via ::before, dot/arrow via ::after) ── */

td.settle-line-start,
td.settle-line-end,
td.settle-line-mid {
    position: relative;
}

td.settle-line-start::before,
td.settle-line-end::before,
td.settle-line-mid::before {
    content: "";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 1.5px;
    background: var(--text);
    pointer-events: none;
}

td.settle-line-start::before {
    left: 50%;
    right: 0;
}

td.settle-line-end::before {
    left: 0;
    right: 50%;
}

td.settle-line-mid::before {
    left: 0;
    right: 0;
}

/* Dot: centered circle on the from cell */

td.settle-dot::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text);
    z-index: 1;
}

/* Arrowhead: CSS triangle on the to cell */

td.settle-arrow::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    z-index: 1;
}

td.settle-arrow-right::after {
    left: 7px;
    border-left: 7px solid var(--text);
    transform: translateY(-50%);
}

td.settle-arrow-left::after {
    right: 7px;
    border-right: 7px solid var(--text);
    transform: translateY(-50%);
}

/* ── Settlement row states ── */

tr.settlement-row td:first-child {
    position: relative;
}

tr.settlement-rejected .col-item,
tr.settlement-rejected .col-amount {
    text-decoration: line-through;
    text-decoration-color: var(--muted);
}

tr.settlement-rescinded {
    display: none;
}

/* Settlement status dot (under arrowhead on the to cell) */

.settle-status {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    z-index: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settle-status::after {
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
}

.settle-status-pending {
    background: #eab308;
}

.settle-status-pending::after {
    content: "?";
}

.settle-status-accepted {
    background: #16a34a;
}

.settle-status-accepted::after {
    content: "✓";
}

.settle-status-rejected {
    background: #dc2626;
}

.settle-status-rejected::after {
    content: "✕";
}

/* Inline ack prompt shown to the recipient */

.settlement-ack-prompt {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 0.8125rem;
    color: var(--text);
}

.settlement-ack-prompt .ack-label {
    font-weight: 500;
}

.btn-ack {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    padding: 0 12px;
    font: 600 0.75rem var(--font);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    user-select: none;
    transition: background 0.12s;
}

.btn-ack-yes {
    background: #dcfce7;
    color: #15803d;
}
.btn-ack-yes:hover {
    background: #bbf7d0;
}

.btn-ack-no {
    background: #fee2e2;
    color: #991b1b;
}
.btn-ack-no:hover {
    background: #fecaca;
}

/* Rescind button shown to the initiator on rejected settlements */

.btn-rescind {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    padding: 0 12px;
    margin-left: 6px;
    font: 600 0.75rem var(--font);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    transition:
        color 0.12s,
        border-color 0.12s;
}

.btn-rescind:hover {
    color: #991b1b;
    border-color: #fca5a5;
}

/* ── Member cell icons ── */

td.col-member {
    text-align: center;
    vertical-align: middle;
}

td.col-member svg {
    display: inline-block;
    vertical-align: middle;
}

.icon-paid,
.icon-paid-and-split,
.icon-owed {
    opacity: 0.9;
}

/* ── Split-with fieldset (Add Item modal) ── */

.split-field {
    border: none;
    padding: 0;
    margin: 0;
}

.split-field legend {
    padding: 0;
}

.split-members {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.split-member-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition:
        border-color 0.12s,
        background 0.12s;
}

.split-member-label:hover {
    border-color: var(--accent);
}

.split-member-label:has(input:checked) {
    border-color: var(--accent);
    background: #fff7ed;
}

.split-member-label input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ── Empty State ── */

/* ── Settle-Up Meatball Chart ── */

.settle-chart-wrap {
    display: flex;
    justify-content: center;
    padding: 0 0 8px;
}

.settle-chart-wrap:empty {
    display: none;
}

.modal-header-settle .modal-close {
    margin-left: auto;
}

.settle-banner {
    font-size: 1.125rem;
    font-weight: 700;
    color: #16a34a;
    text-align: center;
    flex: 1;
}

.settle-banner[hidden] {
    display: none;
}

.settle-chart-wrap svg.meatball-chart {
    display: block;
    width: 100%;
    max-width: 480px;
    height: auto;
}

/* ── Balance Chart ── */

.balance-chart-wrap {
    display: block;
    padding: 16px 0 24px;
    width: 100%;
}

.balance-chart-wrap[hidden] {
    display: none;
}

.balance-chart-wrap svg.balance-chart {
    display: block;
    width: 100%;
    height: auto;
}

/* ── Empty State ── */

.empty-state {
    text-align: center;
    padding: 48px 16px;
    color: var(--muted);
}

.empty-state .btn.primary {
    vertical-align: middle;
}

.empty-icon {
    margin-bottom: 8px;
}

.empty-icon img {
    opacity: 0.45;
}

/* ── Modals ── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 16px;
    animation: fadeIn 0.12s ease;
}

.modal-overlay[hidden] {
    display: none;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.15s ease;
}

.modal.modal-settle {
    max-width: 960px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 1.125rem;
    font-weight: 700;
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--muted);
    font-size: 1.5rem;
    line-height: 1;
}
.modal-close:hover {
    background: var(--border);
    color: var(--text);
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 4px;
}

/* ── Form Fields ── */

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--muted);
}

.field-input {
    height: var(--btn-h);
    padding: 0 14px;
    font: 1rem var(--font);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    outline: none;
    transition: border-color 0.12s;
}
.field-input:focus {
    border-color: var(--accent);
}
.field-input.mono {
    font-family: var(--mono);
    font-weight: 600;
}

.field-hint {
    font-size: 0.8125rem;
    color: var(--muted);
}

select.field-input {
    appearance: none;
    -webkit-appearance: none;
    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='%2378716c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

/* ── Invite Code Display ── */

.code-display {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg);
    border-radius: var(--radius);
    overflow: hidden;
}

.code-display span {
    font: 800 0.75rem var(--mono);
    letter-spacing: 0.05em;
    color: var(--accent);
    user-select: all;
    word-break: break-all;
    overflow-wrap: anywhere;
}

.hint {
    font-size: 0.8125rem;
    color: var(--muted);
    text-align: center;
}

/* ── Animations ── */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Already joined? section ── */

.rejoin-heading {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 8px 0 0;
}

/* ── Re-join User List ── */

.rejoin-user-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 200px;
    overflow-y: auto;
}

.rejoin-user-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font: 0.9375rem var(--font);
    cursor: pointer;
    transition:
        border-color 0.12s,
        background 0.12s;
    text-align: left;
}

.rejoin-user-btn:hover {
    border-color: var(--muted);
    background: var(--bg);
}

.rejoin-user-btn.selected {
    border-color: var(--accent);
    background: var(--bg);
}

.rejoin-user-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--muted);
    flex-shrink: 0;
}

.rejoin-user-btn.selected .rejoin-user-dot {
    background: var(--accent);
}

.rejoin-user-name {
    font-weight: 600;
}

/* ── Responsive ── */

@media (max-width: 37.5rem) {
    .col-date {
        display: none;
    }

    .app-header {
        padding: 0 10px;
        height: 52px;
    }

    .app-title {
        font-size: 0.95rem;
    }

    .header-left {
        gap: 6px;
        margin-right: 8px;
    }

    .header-right {
        gap: 6px;
        margin-left: 8px;
    }

    .header-right .btn,
    .empty-state .btn.primary {
        height: 36px;
        padding: 0 12px;
        font-size: 0.82rem;
    }

    .pending-badge {
        height: 22px;
        padding: 0 7px;
        font-size: 0.68rem;
    }
}
