:root {
    --sj-ink: #1c2733;
    --sj-muted: #5b6b7a;
    --sj-border: #d8e0e6;
    --sj-bg: #f6f8f9;
    --sj-surface: #ffffff;
    --sj-accent: #2f6f4f;
    --sj-accent-ink: #ffffff;
    --sj-warn: #a15c00;
    --sj-danger: #a4291f;
    --sj-danger-bg: #fbeceb;
}

body {
    background: var(--sj-bg);
    color: var(--sj-ink);
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
}

h1, h2, h3 {
    color: var(--sj-ink);
}

.app-topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    background: var(--sj-surface);
    border-bottom: 1px solid var(--sj-border);
    padding: 0.6rem 1rem;
}

.app-topbar__brand {
    font-weight: 700;
    color: var(--sj-accent);
    text-decoration: none;
    font-size: 1.1rem;
}

.app-topbar__nav {
    display: flex;
    gap: 1rem;
}

.app-topbar__nav a {
    color: var(--sj-muted);
    text-decoration: none;
}

.app-topbar__nav a.active {
    color: var(--sj-accent);
    font-weight: 600;
}

.app-topbar__session {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.app-topbar__signin {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.app-topbar__whoami {
    color: var(--sj-muted);
    font-size: 0.9rem;
}

.app-topbar__error {
    color: var(--sj-danger);
    font-size: 0.9rem;
}

.app-content {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.25rem 1rem 3rem;
}

.sj-card {
    background: var(--sj-surface);
    border: 1px solid var(--sj-border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.sj-event-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sj-event-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.sj-event-card__when {
    color: var(--sj-muted);
    font-size: 0.9rem;
}

.sj-event-card__title {
    font-weight: 600;
    font-size: 1.05rem;
}

.sj-event-card__title a {
    color: var(--sj-ink);
    text-decoration: none;
}

.sj-event-card__title a:hover {
    text-decoration: underline;
}

.sj-rsvp-buttons {
    display: flex;
    gap: 0.4rem;
}

.sj-rsvp-buttons button {
    border: 1px solid var(--sj-border);
    background: var(--sj-surface);
    border-radius: 6px;
    padding: 0.3rem 0.7rem;
    cursor: pointer;
    font-size: 0.85rem;
}

.sj-rsvp-buttons button.active-yes {
    background: var(--sj-accent);
    color: var(--sj-accent-ink);
    border-color: var(--sj-accent);
}

.sj-rsvp-buttons button.active-no {
    background: var(--sj-danger-bg);
    color: var(--sj-danger);
    border-color: var(--sj-danger);
}

.sj-rsvp-buttons button.active-maybe {
    background: #fff3d6;
    color: var(--sj-warn);
    border-color: #e8c47a;
}

.sj-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #e6ecef;
    color: var(--sj-muted);
}

.sj-badge--yes { background: #e3f2e8; color: var(--sj-accent); }
.sj-badge--no { background: var(--sj-danger-bg); color: var(--sj-danger); }
.sj-badge--maybe { background: #fff3d6; color: var(--sj-warn); }
.sj-badge--cancelled { background: #eee; color: #888; text-decoration: line-through; }

table.sj-table {
    width: 100%;
    border-collapse: collapse;
}

table.sj-table th, table.sj-table td {
    text-align: left;
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid var(--sj-border);
    font-size: 0.9rem;
}

table.sj-table th {
    color: var(--sj-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.sj-form-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.85rem;
    max-width: 420px;
}

.sj-form-row label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--sj-muted);
}

.sj-form-row input, .sj-form-row select, .sj-form-row textarea {
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--sj-border);
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
}

.sj-form-row--inline {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    max-width: none;
}

.sj-form-row--wide {
    max-width: 560px;
}

.sj-btn {
    display: inline-block;
    background: var(--sj-accent);
    color: var(--sj-accent-ink);
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
}

.sj-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.sj-btn--secondary {
    background: var(--sj-surface);
    color: var(--sj-ink);
    border: 1px solid var(--sj-border);
}

.sj-btn--danger {
    background: var(--sj-danger-bg);
    color: var(--sj-danger);
    border: 1px solid #eccac7;
}

.sj-btn--small {
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
}

.sj-error {
    color: var(--sj-danger);
    background: var(--sj-danger-bg);
    border: 1px solid #eccac7;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.sj-muted {
    color: var(--sj-muted);
    font-size: 0.9rem;
}

.sj-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.sj-location-picker {
    position: relative;
    max-width: 560px;
}

.sj-location-picker > input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.6rem 0.75rem;
    font-size: 1.1rem;
}

.sj-location-picker__suggestions {
    position: absolute;
    z-index: 20;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--sj-surface);
    border: 1px solid var(--sj-border);
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 220px;
    overflow-y: auto;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.sj-location-picker__suggestions button {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    border-bottom: 1px solid var(--sj-border);
    padding: 0.5rem 0.6rem;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--sj-ink);
    cursor: pointer;
}

.sj-location-picker__suggestions button:last-child {
    border-bottom: none;
}

.sj-location-picker__suggestions button:hover {
    background: var(--sj-bg);
}

.sj-map {
    height: 220px;
    border-radius: 8px;
    border: 1px solid var(--sj-border);
    margin-top: 0.5rem;
}

/* Approved minutes, rendered from markdown (MinutesMarkdown.ToSafeHtml). */
.sj-minutes-rendered { line-height: 1.5; overflow-wrap: anywhere; }
.sj-minutes-rendered h1 { font-size: 1.4rem; margin: 1rem 0 0.4rem; }
.sj-minutes-rendered h2 { font-size: 1.2rem; margin: 1rem 0 0.4rem; }
.sj-minutes-rendered h3,
.sj-minutes-rendered h4 { font-size: 1.05rem; margin: 0.8rem 0 0.3rem; }
.sj-minutes-rendered p { margin: 0.4rem 0; }
.sj-minutes-rendered ul,
.sj-minutes-rendered ol { margin: 0.4rem 0; padding-left: 1.5rem; }
.sj-minutes-rendered blockquote { margin: 0.5rem 0; padding-left: 0.75rem; border-left: 3px solid #c9ced6; color: #4d5560; }
.sj-minutes-rendered code { background: #f1f3f5; padding: 0.05rem 0.25rem; border-radius: 3px; }
.sj-minutes-rendered table { border-collapse: collapse; margin: 0.5rem 0; }
.sj-minutes-rendered th,
.sj-minutes-rendered td { border: 1px solid #c9ced6; padding: 0.25rem 0.5rem; text-align: left; }

/* The live editor is for note-taking, not page layout: keep its headings in proportion. */
.sj-minutes-editor .milkdown .ProseMirror h1 { font-weight: 700; font-size: 1.4rem; line-height: 1.3; margin: 0.8rem 0 0.3rem; }
.sj-minutes-editor .milkdown .ProseMirror h2 { font-weight: 700; font-size: 1.2rem; line-height: 1.3; margin: 0.8rem 0 0.3rem; }
.sj-minutes-editor .milkdown .ProseMirror h3 { font-weight: 700; font-size: 1.05rem; line-height: 1.3; margin: 0.6rem 0 0.3rem; }

/* Tabs (meeting workspace: Agenda | Action items). */
.sj-tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid #c9ced6; margin-bottom: 0.75rem; }
.sj-tab {
    appearance: none; background: none; border: none; border-bottom: 3px solid transparent;
    padding: 0.5rem 0.9rem; margin-bottom: -1px; font: inherit; font-weight: 600; color: #4d5560; cursor: pointer;
}
.sj-tab:hover { color: #1c1c1c; }
.sj-tab--active { color: #1c1c1c; border-bottom-color: var(--sj-accent); }
.sj-tab .sj-badge { margin-left: 0.35rem; }

/* ----- My Files ----- */
.sj-files-upload { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: center; }
.sj-files-upload label.sj-check { display: flex; gap: 0.4rem; align-items: center; font-size: 0.9rem; }
.sj-file-name { font-weight: 600; overflow-wrap: anywhere; }
.sj-file-meta { color: var(--sj-muted); font-size: 0.8rem; }
.sj-file-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: flex-end; }
.sj-share-chip {
    display: inline-flex; align-items: center; gap: 0.3rem; margin: 0 0.3rem 0.3rem 0;
    padding: 0.15rem 0.2rem 0.15rem 0.6rem; border-radius: 999px;
    background: #e6ecef; color: var(--sj-ink); font-size: 0.8rem;
}
.sj-share-chip--static { padding-right: 0.6rem; }
.sj-share-chip button {
    border: none; background: transparent; color: var(--sj-muted); cursor: pointer;
    font-size: 0.95rem; line-height: 1; padding: 0.1rem 0.35rem; border-radius: 999px;
}
.sj-share-chip button:hover { background: #d3dce1; color: var(--sj-danger); }
.sj-share-panel { background: var(--sj-bg); border: 1px solid var(--sj-border); border-radius: 6px; padding: 0.75rem 1rem; }
.sj-share-panel select { min-width: 16rem; max-width: 100%; }
.sj-notice {
    background: #fff8e6; border: 1px solid #f0dca8; color: #6b4a00;
    border-radius: 6px; padding: 0.5rem 0.75rem; font-size: 0.85rem; margin: 0.5rem 0;
}
.sj-notice ul { margin: 0; padding-left: 1.1rem; }

/* ----- Wait indicator: the hiking scout (WaitIndicator.razor, HikingScoutSprite.cs) ----- */
.sj-wait { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--sj-muted); font-size: 0.9rem; }
.sj-wait__scout { overflow: hidden; flex: none; image-rendering: pixelated; }
/* Four frames, 16 art-pixels each, laid side by side: step the strip one frame at a time. */
.sj-wait__frames { animation: sj-wait-walk 0.72s steps(4) infinite; }
/* The trail slides back under the scout's feet, one art-pixel per step of the same clock. */
.sj-wait__trail { animation: sj-wait-trail 0.72s steps(8) infinite; }
@keyframes sj-wait-walk { to { transform: translateX(-64px); } }
@keyframes sj-wait-trail { to { transform: translateX(-8px); } }
@media (prefers-reduced-motion: reduce) {
    .sj-wait__frames, .sj-wait__trail { animation: none; }
}
.sj-busy {
    position: fixed; right: 1rem; bottom: 1rem; z-index: 1000;
    background: var(--sj-surface); border: 1px solid var(--sj-border); border-radius: 10px;
    padding: 0.5rem 0.9rem 0.4rem 0.7rem; box-shadow: 0 4px 14px rgba(28, 39, 51, 0.15);
    pointer-events: none;
}
