html, body {
    font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: #f5f5f6;
}

.community-browser { display: grid; grid-template-columns: minmax(12rem, 18rem) 1fr; gap: 1rem; }
.community-join-panel { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; padding: 1rem; border: 1px solid #e6e4ed; border-radius: 14px; background: #fdfcff; }
.community-join-panel h2, .community-join-panel p { margin: 0; }
.community-join-panel p { margin-top: .25rem; color: #7c7b89; font-size: .85rem; }
.community-join-controls { display: flex; gap: .5rem; }
.community-join-controls .community-create-input { width: min(20rem, 45vw); }
.community-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; }
.community-card { display: flex; align-items: center; gap: .8rem; padding: 1.2rem; border: 1px solid #e6e4ed; border-radius: 14px; color: #454552; background: #fdfcff; text-align: left; cursor: pointer; box-shadow: 0 .5rem 1.25rem rgba(57, 51, 79, .04); }
.community-card:hover { border-color: #cfd5ff; background: #f7f8ff; transform: translateY(-1px); }
.community-card-icon { display: grid; width: 2.5rem; height: 2.5rem; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #4d63e5; background: #eaedff; font-size: 1.2rem; font-weight: 700; }
.community-card-content { display: grid; gap: .2rem; flex: 1; }
.community-card-content strong { font-size: 1rem; }
.community-card-content span, .community-card-content small { color: #7c7b89; font-size: .8rem; }
.community-card-arrow { color: #4d63e5; font-size: 1.2rem; }
.data-model-template-list { display: grid; gap: .75rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid #e6e4ed; }
.data-model-template-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.data-model-template-heading h2, .data-model-template-heading p { margin: 0; }
.data-model-template-heading p { margin-top: .3rem; color: #7c7b89; font-size: .9rem; }
.data-model-close { border: 0; color: #7c7b89; background: transparent; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.data-model-template-card { display: flex; align-items: center; gap: .9rem; width: 100%; padding: 1rem; border: 1px solid #e6e4ed; border-radius: 14px; color: #454552; background: #fdfcff; text-align: left; cursor: pointer; box-shadow: 0 .5rem 1.25rem rgba(57, 51, 79, .04); }
.data-model-template-card:hover { border-color: #cfd5ff; background: #f7f8ff; transform: translateY(-1px); }
.data-model-template-icon { display: grid; width: 2.75rem; height: 2.75rem; flex: 0 0 auto; place-items: center; border-radius: 12px; color: #4d63e5; background: #eaedff; font-size: 1.35rem; }
.data-model-template-content { display: grid; flex: 1; gap: .2rem; }
.data-model-template-content strong { font-size: 1rem; }
.data-model-template-content span { color: #5e5d6a; font-size: .88rem; }
.data-model-template-content small { color: #93919e; font-size: .75rem; }
.data-model-template-arrow { color: #4d63e5; font-size: 1.25rem; }
.data-object-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.data-object-card { display: flex; align-items: center; gap: .9rem; width: 100%; min-height: 6rem; padding: 1rem; border: 1px solid #e6e4ed; border-radius: 14px; color: #454552; background: #fdfcff; text-align: left; cursor: pointer; box-shadow: 0 .5rem 1.25rem rgba(57, 51, 79, .04); }
.data-object-card:hover { border-color: #cfd5ff; background: #f7f8ff; transform: translateY(-1px); }
.data-object-card-icon { display: grid; width: 2.75rem; height: 2.75rem; flex: 0 0 auto; place-items: center; border-radius: 12px; color: #4d63e5; background: #eaedff; font-size: 1.35rem; }
.data-object-card-content { display: grid; flex: 1; gap: .2rem; min-width: 0; }
.data-object-card-content strong { font-size: 1rem; }
.data-object-card-content span { color: #5e5d6a; font-size: .85rem; }
.data-object-card-content small { overflow: hidden; color: #93919e; font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.data-object-card-arrow { color: #4d63e5; font-size: 1.25rem; }
.community-feed-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; margin: 1rem 0 1.75rem; padding: 1.75rem 2rem; border: 1px solid #e1e0eb; border-radius: 20px; background: linear-gradient(135deg, #f4f5ff, #fdfcff 60%); box-shadow: 0 .75rem 2rem rgba(57, 51, 79, .06); }
.community-feed-header h1, .community-feed-header p { margin: 0; }
.community-feed-header h1 { color: #454552; font-size: clamp(1.8rem, 4vw, 2.6rem); }
.community-feed-header > div > p:last-child { margin-top: .45rem; color: #7c7b89; }
.community-feed-header dl { display: flex; gap: 1.5rem; margin: 0; }
.community-feed-header dt { color: #7c7b89; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.community-feed-header dd { margin: .25rem 0 0; color: #454552; font-weight: 700; white-space: nowrap; }
.community-list, .community-detail { padding: 1rem; border: 1px solid #e6e4ed; border-radius: 14px; background: #fdfcff; }
.community-list { display: grid; align-content: start; gap: .45rem; }
.community-list-item { padding: .8rem; border: 1px solid transparent; border-radius: 10px; background: transparent; color: #454552; text-align: left; cursor: pointer; }
.community-list-item:hover, .community-list-item.selected { border-color: #cfd5ff; background: #f0f2ff; }
.community-list-item strong, .community-list-item span { display: block; }
.community-list-item span, .community-detail-heading p, .shared-memory-card p { color: #7c7b89; font-size: .85rem; }
.community-detail-heading { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.community-detail-heading h2, .community-detail-heading p { margin: 0; }
.community-kicker { color: #4d63e5 !important; font-size: .75rem !important; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.community-id { max-width: 12rem; overflow-wrap: anywhere; color: #7c7b89; font: .7rem ui-monospace, monospace; }
.shared-memory-list { display: grid; gap: .6rem; }
.shared-memory-card { padding: .9rem; border: 1px solid #e6e4ed; border-radius: 10px; }
.shared-memory-card h4, .shared-memory-card p { margin: 0; }
.shared-memory-card span { color: #7c7b89; font-size: .8rem; }
.memory-heading-meta { display: flex; align-items: center; gap: .6rem; }
.memory-sharing-label { color: #4d63e5; font-size: .78rem; font-weight: 700; }
.memory-share-button { padding: .25rem .55rem; border: 1px solid #d9d7e2; border-radius: 6px; color: #555563; background: #fff; cursor: pointer; }
.memory-share-panel { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; margin: 0 0 1rem; padding: .8rem; border: 1px solid #dfe2ff; border-radius: 9px; background: #f7f8ff; }
.memory-share-panel strong { width: 100%; color: #454552; }
@media (max-width: 700px) { .community-browser { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .community-join-panel { align-items: stretch; flex-direction: column; } .community-join-controls .community-create-input { width: 100%; } }
@media (max-width: 700px) { .community-feed-header { flex-direction: column; padding: 1.35rem; } .community-feed-header dl { flex-wrap: wrap; gap: 1rem; } }

.community-create-card {
    width: min(42rem, 100%);
    margin: 1rem auto;
    padding: 2rem;
    border: 1px solid #e6e4ed;
    border-radius: 18px;
    background: #fdfcff;
    box-shadow: 0 0.75rem 2rem rgba(57, 51, 79, 0.07);
}

.community-create-intro,
.community-created-heading {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.community-create-intro h2,
.community-created-heading h2 {
    margin: 0;
    color: #454552;
}

.community-create-intro p,
.community-created-heading p {
    margin: 0.35rem 0 0;
    color: #7c7b89;
    line-height: 1.5;
}

.community-create-icon {
    display: grid;
    width: 2.75rem;
    height: 2.75rem;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    color: #4d63e5;
    background: #eaedff;
    font-size: 1.35rem;
    font-weight: 700;
}

.community-create-icon.success {
    color: #2a7b51;
    background: #e1f3e8;
}

.community-create-label {
    display: block;
    margin-bottom: 0.45rem;
    color: #555563;
    font-size: 0.88rem;
    font-weight: 700;
}

.community-create-input {
    box-sizing: border-box;
    width: 100%;
    padding: 0.75rem 0.85rem;
    border: 1px solid #d9d7e2;
    border-radius: 9px;
    color: #3f3d49;
    background: #fff;
    font: inherit;
}

.community-create-input:focus {
    outline: 2px solid rgba(77, 99, 229, 0.28);
    border-color: #4d63e5;
}

.community-create-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 1.5rem;
}

.community-created-details {
    display: grid;
    gap: 0.8rem;
    margin: 0;
}

.community-created-details > div {
    padding: 0.8rem;
    border-radius: 10px;
    background: #f4f3f8;
}

.community-created-details dt {
    color: #7c7b89;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.community-created-details dd {
    overflow-wrap: anywhere;
    margin: 0.3rem 0 0;
    color: #484552;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.8rem;
}

@media (max-width: 640px) {
    .community-create-card { padding: 1.4rem; }
    .community-create-actions { align-items: stretch; flex-direction: column-reverse; }
}

.status-summary {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.5rem;
}

.status-summary strong,
.status-summary span {
    display: block;
}

.status-summary span:not(.status-indicator) {
    color: var(--muted-text, #766f66);
    font-size: .9rem;
}

.status-indicator {
    width: .75rem;
    height: .75rem;
    flex: 0 0 .75rem;
    border-radius: 50%;
    background: #bd493d;
}

.status-indicator.connected {
    background: #3d8b62;
    box-shadow: 0 0 0 .25rem rgba(61, 139, 98, .14);
}

.status-details {
    display: grid;
    gap: .85rem;
    margin: 0 0 1.75rem;
}

.status-details div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border-color, #ded8cf);
}

.status-details dt {
    color: var(--muted-text, #766f66);
}

.status-details dd {
    margin: 0;
    font-weight: 600;
    text-align: right;
    overflow-wrap: anywhere;
}

.status-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.status-actions form {
    margin: 0;
}

.secondary-action {
    background: transparent;
    color: var(--body-text, #403a34);
    border: 1px solid var(--border-color, #ded8cf);
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
    background: var(--page-background, #f5f1eb);
}

.auth-card {
    width: min(100%, 34rem);
    padding: 2.5rem;
    border: 1px solid var(--border-color, #ded8cf);
    border-radius: 1.25rem;
    background: var(--surface, #fffdf9);
    box-shadow: 0 1.5rem 4rem rgba(61, 51, 39, .12);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 2rem;
}

.auth-mark {
    display: grid;
    width: 2.75rem;
    height: 2.75rem;
    place-items: center;
    border-radius: .75rem;
    background: #304b43;
    color: #fff;
    font-size: 1.35rem;
    font-weight: 700;
}

.auth-title {
    font-size: 1.15rem;
    font-weight: 700;
}

.auth-subtitle {
    color: var(--muted-text, #766f66);
    font-size: .85rem;
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem;
        border: 0;
        box-shadow: none;
    }
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e51460;
}

.validation-message {
    color: #e51460;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.upload-dropzone {
    position: relative;
    border: 2px dashed #c6c6c6;
    border-radius: 14px;
    padding: 2.25rem 1rem;
    background: #fafafa;
    min-height: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: border-color 160ms ease, background 160ms ease;
}

.upload-dropzone:hover,
.upload-dropzone:focus-within {
    border-color: #6c63ff;
    background: #f7f6ff;
}

.upload-input {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    cursor: pointer;
    opacity: 0;
}

.upload-dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    color: #656573;
    pointer-events: none;
}

.upload-dropzone-content strong {
    color: #292936;
    font-size: 1.05rem;
}

.upload-icon {
    display: grid;
    width: 2.7rem;
    height: 2.7rem;
    margin-bottom: 0.25rem;
    place-items: center;
    border-radius: 50%;
    background: #e9e7ff;
    color: #5b52dc;
    font-size: 1.6rem;
    font-weight: 700;
}

.upload-heading,
.upload-progress-label,
.upload-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.upload-limit {
    flex-shrink: 0;
    color: #656573;
    font-size: 0.8rem;
}

.upload-complete-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.batch-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
}

.batch-photo-item {
    min-width: 0;
    color: #454552;
    font-size: 0.8rem;
}

.batch-photo-item img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 10px;
    object-fit: cover;
    background: #eeeeF2;
}

.batch-photo-item span {
    display: block;
    overflow: hidden;
    margin-top: 0.4rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.batch-metadata-form {
    display: grid;
    gap: 0.45rem;
    max-width: 38rem;
}

.batch-metadata-form h3,
.batch-metadata-form p {
    margin: 0;
}

.batch-metadata-form h3 {
    margin-bottom: 0.15rem;
}

.batch-metadata-form p {
    margin-bottom: 0.65rem;
    color: #656573;
}

.batch-date-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.55rem;
}

.batch-date-label .field-label {
    margin: 0;
}

.info-icon {
    color: #5b52dc;
    cursor: help;
    font-size: 0.95rem;
}

.upload-summary {
    margin-top: 1rem;
    padding: 0.7rem 0.85rem;
    border-radius: 8px;
    background: #f5f5f8;
    color: #575761;
    font-size: 0.9rem;
}

.upload-progress {
    margin-top: 1rem;
}

.upload-progress-label {
    margin-bottom: 0.35rem;
    color: #575761;
    font-size: 0.9rem;
}

.progress-track {
    height: 0.55rem;
    overflow: hidden;
    border-radius: 999px;
    background: #e8e8ee;
}

.progress-value {
    height: 100%;
    border-radius: inherit;
    background: #6c63ff;
    transition: width 120ms ease;
}

.upload-progress small {
    display: block;
    margin-top: 0.4rem;
    color: #656573;
}

.advanced-upload-options {
    margin-top: 1.25rem;
    border-top: 1px solid #ececf1;
    padding-top: 1rem;
}

.advanced-upload-options summary {
    cursor: pointer;
    color: #575761;
    font-weight: 600;
}

.advanced-upload-content {
    margin-top: 1rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.card-panel {
    background: #ffffff;
    border: 1px solid #ececf1;
    border-radius: 14px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.card-panel h3,
.card-panel h4 {
    margin-top: 0;
    margin-bottom: 0.35rem;
}

.card-panel p {
    margin-top: 0;
    color: #656573;
}

.field-label {
    display: block;
    margin: 0.65rem 0 0.25rem;
    color: #575761;
    font-size: 0.84rem;
    font-weight: 600;
}

.field-input,
.markdown-input,
.date-input {
    width: 100%;
    border: 1px solid #e2e2ea;
    border-radius: 8px;
    padding: 0.62rem 0.72rem;
    background: #ffffff;
    margin-bottom: 0.4rem;
}

.markdown-input {
    min-height: 220px;
    resize: vertical;
}

.journal-entry-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
}

.journal-entry-date-picker {
    flex: 1 1 220px;
}

.journal-editor {
    margin-top: 1rem;
}

.editor-mode-selector {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.editor-mode-button {
    border: 1px solid #d9d9e2;
    border-radius: 7px;
    padding: 0.4rem 0.7rem;
    background: #ffffff;
    color: #575761;
    cursor: pointer;
    font: inherit;
}

.editor-mode-button.selected {
    border-color: #4f5b97;
    background: #eef0ff;
    color: #364174;
    font-weight: 600;
}

.markdown-composer-shell {
    border: 1px solid #d9d9e2;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}

.markdown-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #e8e9f1;
    background: #f7f8fc;
}

.markdown-toolbar-button {
    border: 1px solid #d9d9e2;
    border-radius: 6px;
    background: #ffffff;
    color: #55586b;
    cursor: pointer;
    font: inherit;
    padding: 0.3rem 0.55rem;
}

.markdown-toolbar-button:hover {
    border-color: #4f5b97;
    color: #364174;
}

.markdown-composer {
    min-height: 360px;
}

.markdown-composer .milkdown {
    min-height: 360px;
    padding: 1rem 1.25rem;
}

.markdown-composer .ProseMirror {
    min-height: 300px;
    outline: none;
}

.divider {
    height: 1px;
    background: #ececf1;
    margin: 1rem 0;
}

.inline-action {
    margin-top: 0.75rem;
}

.alert {
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    margin: 0.6rem 0 0.9rem;
}

.alert.info { background: #f2f6ff; color: #2f4ca4; }
.alert.success { background: #ebf8ee; color: #2d7b4a; }
.alert.warning { background: #fff7e8; color: #9c640d; }
.alert.error { background: #fff1f1; color: #b33d3d; }

.editor-shell {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.editor-pane {
    border: 1px solid #ececf1;
    border-radius: 12px;
    padding: 0.85rem;
    background: #fcfcfd;
}

.preview-pane {
    min-height: 260px;
}

.form-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 1rem;
}

.resource-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.6rem;
}

.resource-table th,
.resource-table td {
    text-align: left;
    padding: 0.7rem 0.35rem;
    border-bottom: 1px solid #ececf1;
    font-size: 0.9rem;
}

.compact-actions {
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.compact-footer {
    margin-top: 0.7rem;
    padding-top: 0.6rem;
    border-top: 1px solid #ececf1;
}

.file-grid {
    align-items: start;
}

.file-list-panel {
    min-width: 0;
}

.login-panel {
    max-width: 520px;
}

.clear-link {
    cursor: pointer;
    background: transparent;
    border: 0;
    color: #4f5b97;
    padding: 0;
}

.page-caption {
    color: #8c8c98;
    font-size: 0.8rem;
}

@media (max-width: 900px) {
    .card-grid,
    .editor-shell {
        grid-template-columns: 1fr;
    }
}

.home-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.home-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) 280px;
    gap: 1rem;
    align-items: stretch;
    padding: 1.25rem;
    border: 1px solid #ececf1;
    border-radius: 18px;
    background: linear-gradient(135deg, #ffffff 0%, #f7f8ff 100%);
}

.home-hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.home-pill {
    display: inline-flex;
    align-self: flex-start;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #4458c7;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.7rem;
}

.hero-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 1rem;
}

.home-hero-metric {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
    padding: 1rem;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #ececf1;
}

.metric-label {
    color: #8a8a96;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.home-hero-metric strong {
    font-size: 1.35rem;
    color: #25252d;
}

.home-hero-metric small {
    color: #8a8a96;
}

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

@media (max-width: 900px) {
    .home-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.home-card {
    display: flex;
    flex-direction: column;
    aspect-ratio: 1;
    min-height: 0;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.home-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #4d63e5 0%, rgba(77,99,229,0.2) 100%);
}

.home-card.accent-journals::after {
    content: "";
    position: absolute;
    inset: auto -20px -20px auto;
    width: 90px;
    height: 90px;
    border-radius: 999px;
    background: rgba(77, 99, 229, 0.08);
}

.home-card.accent-files::after {
    content: "";
    position: absolute;
    inset: auto -20px -20px auto;
    width: 90px;
    height: 90px;
    border-radius: 999px;
    background: rgba(255, 190, 47, 0.12);
}

.home-card.accent-photos::after {
    content: "";
    position: absolute;
    inset: auto -20px -20px auto;
    width: 90px;
    height: 90px;
    border-radius: 999px;
    background: rgba(60, 168, 107, 0.12);
}

.home-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #f6f7fb;
    font-size: 1rem;
    margin-bottom: 0.7rem;
}

.home-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 0.55rem 0.8rem;
    border: 1px solid #e3e5ef;
    border-radius: 999px;
    background: #ffffff;
    color: #4a4f63;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
}

.home-link-primary {
    background: #4d63e5;
    border-color: #4d63e5;
    color: #ffffff;
}

.resource-page {
    min-height: 100vh;
    padding: 0.9rem 1.2rem;
}

.resource-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.05rem 0 0.72rem 0;
    border-bottom: 1px solid #eeeeF2;
}

.resource-title {
    font-weight: 800;
    letter-spacing: -0.03em;
}

.resource-subtitle {
    color: #9a9aa6;
}

.resource-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.resource-actions .mud-button-root {
    min-width: 84px;
}

.view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.15rem;
    border: 1px solid #ececf1;
    border-radius: 10px;
    background: #f7f7fb;
}

.view-toggle ::deep .mud-icon-button {
    width: 32px;
    height: 32px;
}

.journal-workspace {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    min-height: calc(100vh - 130px);
}

.journal-list-pane {
    padding: 1rem 0.75rem 1rem 0;
    border-right: 1px solid #eeeeF2;
}

.list-toolbar {
    display: flex;
    justify-content: flex-end;
    color: #4a63df;
    margin-bottom: 0.7rem;
}

.journal-list-card {
    width: 100%;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.75rem;
    border: 0;
    border-left: 3px solid transparent;
    border-radius: 12px;
    background: transparent;
    text-align: left;
    color: inherit;
}

.journal-list-card:hover,
.journal-list-card.selected {
    border-left-color: #4564e8;
    background: #f4f6ff;
}

.journal-date-block {
    text-align: center;
    color: #2e2e36;
}

.journal-date-block strong {
    display: block;
    font-size: 1.05rem;
    line-height: 1;
}

.journal-date-block span {
    color: #9a9aa6;
    font-size: 0.62rem;
    font-weight: 700;
}

.journal-list-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 750;
    font-size: 0.9rem;
}

.journal-list-meta {
    color: #8f8f9a;
    font-size: 0.78rem;
    margin-top: 0.18rem;
}

.mood-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #f0b33f;
}

.journal-preview-pane {
    padding: 1.25rem 2rem;
}

.journal-preview-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.journal-preview-title {
    margin-top: 2rem;
    font-weight: 850;
    letter-spacing: -0.05em;
}

.write-preview-toggle {
    display: flex;
    gap: 0.15rem;
    align-self: flex-start;
    padding: 0.22rem;
    border-radius: 9px;
    background: #f1f1f5;
    color: #85858f;
    font-size: 0.78rem;
    font-weight: 700;
}

.write-preview-toggle span {
    padding: 0.35rem 0.75rem;
    border-radius: 7px;
}

.write-preview-toggle .active {
    background: #ffffff;
    color: #4564e8;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.mood-row {
    display: flex;
    gap: 0.55rem;
    margin-bottom: 1rem;
}

.mood-row span {
    padding: 0.45rem 0.75rem;
    border: 1px solid #ededf2;
    border-radius: 9px;
    color: #666674;
    font-size: 0.8rem;
    font-weight: 700;
}

.journal-preview-content {
    color: #4b4b55;
    font-size: 1.02rem;
    line-height: 1.75;
}

.journal-preview-content h1,
.journal-preview-content h2,
.journal-preview-content h3 {
    color: #22222a;
    letter-spacing: -0.03em;
}

.photo-filter-panel {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid #ececf1;
    border-radius: 12px;
    background: #fafafe;
}

.filter-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    margin-bottom: 0.7rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid #ececf1;
    border-radius: 12px;
    background: #fafafe;
}

.filter-search-field {
    flex: 1 1 18rem;
    min-width: 12rem;
}

.filter-date-field {
    flex: 0 1 11rem;
}

.filter-toolbar .field-label {
    margin-top: 0;
}

.filter-search-field fluent-text-field,
.filter-date-field fluent-date-picker {
    display: block;
    width: 100%;
}

.filter-clear {
    flex: 0 0 auto;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.5rem;
}

.photo-date-group + .photo-date-group {
    margin-top: 1.75rem;
}

.photo-date-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.65rem;
}

.photo-date-heading h2 {
    margin: 0;
    color: #454552;
    font-size: 1.15rem;
    font-weight: 700;
}

.photo-date-heading span {
    color: #9999a5;
    font-size: 0.82rem;
}

.photo-show-all-link {
    display: block;
    margin: 0.7rem 0 0;
    padding: 0;
    border: 0;
    color: #4d63e5;
    background: transparent;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
}

.photo-load-more {
    display: flex;
    justify-content: center;
    margin: 1.75rem 0 0.5rem;
}

.photo-tile {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 10px;
    background: #e8eef5;
}

.photo-tile:nth-child(6n + 2) { background: #efe5d6; }
.photo-tile:nth-child(6n + 3) { background: #e2ece4; }
.photo-tile:nth-child(6n + 4) { background: #e9e2ef; }
.photo-tile:nth-child(6n + 5) { background: #f0e2df; }
.photo-tile:nth-child(6n + 6) { background: #e2ebef; }

.photo-tile-media {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0.95;
}

.photo-tile-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: rgba(80, 80, 90, 0.28);
    pointer-events: none;
}

.photo-metadata-missing {
    position: absolute;
    z-index: 1;
    top: 0.45rem;
    right: 0.45rem;
    display: grid;
    width: 1.55rem;
    height: 1.55rem;
    place-items: center;
    border-radius: 50%;
    color: #5d6270;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 2px 8px rgba(32, 35, 50, 0.16);
    font-size: 0.85rem;
    pointer-events: none;
}

.photo-tile-select {
    position: absolute;
    inset: 0;
    display: block;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.photo-metadata-panel {
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px solid #eeeeF2;
}

.photo-metadata-panel > strong {
    display: block;
    margin-bottom: 0.45rem;
    color: #555563;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.photo-metadata-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem 1rem;
    margin: 0;
}

.photo-metadata-grid dt {
    color: #9999a5;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.photo-metadata-grid dd {
    margin: 0.08rem 0 0;
    color: #4b4b55;
    font-size: 0.82rem;
}

.photo-metadata-empty {
    color: #9999a5;
    font-size: 0.8rem;
}

.photo-tile:hover,
.photo-tile:focus-within,
.photo-tile.selected {
    box-shadow: inset 0 0 0 2px #4d63e5;
}

.details-card,
.resource-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid #eeeeF2;
    border-radius: 12px;
    background: #fbfbfc;
}

.details-card span {
    display: block;
    color: #8b8b97;
    font-size: 0.8rem;
}

.details-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

@media (max-width: 1440px) {
    .photo-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 1200px) {
    .photo-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1000px) {
    .photo-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.empty-panel {
    padding: 1rem;
    border: 1px dashed #d8d8df;
    border-radius: 12px;
    color: #8a8a96;
    background: #fafafa;
}

.empty-panel.large {
    display: grid;
    min-height: 260px;
    place-items: center;
}

[data-theme="dark"] {
    color-scheme: dark;
    color: #ececf2;
    background: #181920;
}

[data-theme="dark"] .resource-page,
[data-theme="dark"] .resource-header,
[data-theme="dark"] .photo-date-heading h2,
[data-theme="dark"] .batch-metadata-form h3,
[data-theme="dark"] .card-panel,
[data-theme="dark"] .editor-pane,
[data-theme="dark"] .markdown-composer-shell,
[data-theme="dark"] .details-card,
[data-theme="dark"] .resource-footer {
    color: #ececf2;
}

[data-theme="dark"] .card-panel,
[data-theme="dark"] .editor-pane,
[data-theme="dark"] .markdown-composer-shell,
[data-theme="dark"] .details-card,
[data-theme="dark"] .resource-footer {
    border-color: #32343f;
    background: #202128;
}

[data-theme="dark"] .resource-header,
[data-theme="dark"] .advanced-upload-options,
[data-theme="dark"] .filter-toolbar {
    border-color: #32343f;
    background: #202128;
}

[data-theme="dark"] .resource-subtitle,
[data-theme="dark"] .card-panel p,
[data-theme="dark"] .field-label,
[data-theme="dark"] .batch-metadata-form p,
[data-theme="dark"] .photo-date-heading span,
[data-theme="dark"] .details-card span,
[data-theme="dark"] .empty-panel {
    color: #a6a7b5;
}

[data-theme="dark"] .field-input,
[data-theme="dark"] .markdown-input,
[data-theme="dark"] .date-input,
[data-theme="dark"] .vault-search {
    border-color: #3a3c48;
    background: #292b35;
    color: #f1f1f5;
}

[data-theme="dark"] .filter-toolbar,
[data-theme="dark"] .empty-panel {
    background: #242630;
}

[data-theme="dark"] .empty-panel {
    border-color: #4a4c59;
}

[data-theme="dark"] .editor-mode-button {
    border-color: #3a3c48;
    background: #292b35;
    color: #c5c6d0;
}

[data-theme="dark"] .editor-mode-button.selected {
    border-color: #7182e8;
    background: #2d376b;
    color: #d5dcff;
}

[data-theme="dark"] .alert.info { background: #253158; color: #c5d0ff; }
[data-theme="dark"] .alert.success { background: #1d3a2b; color: #b5e8c8; }
[data-theme="dark"] .alert.warning { background: #493717; color: #f3d18d; }
[data-theme="dark"] .alert.error { background: #4a2528; color: #ffc2c5; }

[data-theme="dark"] fluent-button {
    --neutral-fill-rest: #292b35;
    --neutral-fill-hover: #343743;
    --neutral-fill-active: #3d4050;
    --neutral-foreground-rest: #ececf2;
    --neutral-stroke-rest: #4a4c59;
}

@media (max-width: 900px) {
    .journal-workspace {
        grid-template-columns: 1fr;
    }

    .journal-list-pane {
        border-right: 0;
        border-bottom: 1px solid #eeeeF2;
    }

    .resource-header,
    .filter-toolbar,
    .details-card,
    .resource-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .filter-toolbar {
        align-items: stretch;
    }

    .filter-search-field,
    .filter-date-field {
        min-width: 0;
        width: 100%;
    }

    .filter-clear {
        align-self: flex-start;
        margin-bottom: 0;
    }

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

}

@media (prefers-reduced-motion: reduce) {
}

.memory-date-group + .memory-date-group {
    margin-top: 2rem;
}

.memory-date-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.7rem;
}

.memory-date-heading h2,
.memory-date-heading p {
    margin: 0;
}

.memory-date-heading h2 {
    color: #454552;
    font-size: 1.2rem;
}

.memory-date-heading p,
.memory-date-heading > span {
    color: #898995;
    font-size: 0.84rem;
}

.memory-association-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.5rem;
}

.memory-association-tile {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 10px;
    background: #e8eef5;
}

.memory-association-media {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.memory-association-tile.journal {
    background: linear-gradient(145deg, #f7f1e7, #e8ddcb);
}

.memory-journal-tile-content {
    display: flex;
    height: 100%;
    flex-direction: column;
    justify-content: center;
    gap: 0.45rem;
    padding: 1rem;
    border: 1px solid rgba(102, 78, 46, 0.14);
    color: #544735;
}

.memory-journal-tile-kicker,
.memory-journal-tile-blurb {
    color: #806f58;
    font-size: 0.72rem;
}

.memory-journal-tile-kicker {
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.memory-journal-tile-content strong {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    font-family: Georgia, serif;
    font-size: 1rem;
}

.memory-association-select {
    position: absolute;
    inset: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.memory-association-tile:hover,
.memory-association-tile:focus-within {
    box-shadow: inset 0 0 0 2px #4d63e5;
}

.memory-journal-viewer-backdrop {
    position: fixed;
    z-index: 20;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: rgba(27, 28, 39, 0.7);
}

.memory-journal-viewer {
    position: relative;
    width: min(46rem, 100%);
    max-height: min(44rem, 100%);
    overflow: auto;
    padding: 2.5rem;
    border-radius: 16px;
    background: #fffdf8;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.25);
}

.memory-journal-viewer-close {
    position: absolute;
    top: 0.75rem;
    right: 0.85rem;
    border: 0;
    color: #655b50;
    background: transparent;
    cursor: pointer;
    font-size: 1.6rem;
}

.memory-journal-viewer-kicker,
.memory-journal-viewer-date {
    color: #8a7963;
    font-size: 0.82rem;
}

.memory-journal-viewer-kicker {
    margin: 0 0 0.4rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.memory-journal-viewer h2 { margin: 0; color: #44392d; }
.memory-journal-viewer-date { margin: 0.4rem 0 1.5rem; }
.memory-journal-viewer-content { color: #3f3933; line-height: 1.65; }

@media (max-width: 1440px) { .memory-association-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 1200px) { .memory-association-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .memory-association-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
    .memory-association-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .memory-date-heading { align-items: flex-start; flex-direction: column; gap: 0.3rem; }
    .memory-journal-viewer { padding: 2rem 1.25rem; }
}
