:root {
    --paper: #f2ecd8;
    --paper-soft: #fff8ed;
    --paper-cream: #fcf5e6;
    --ink: #4e3e2e;
    --muted: #8a6d4d;
    --accent: #b76e2e;
    --accent-soft: #e8d1ad;
    --line: #ead7b0;
    --green: #2a7f2a;
    --green-soft: #e6f3e6;
    --warning: #9f6a1d;
    --danger: #973f31;
    --danger-soft: #f9e1d6;
    --success-soft: #e6f3df;
    --shadow: 0 12px 30px rgba(78, 62, 46, 0.08);
    --radius-xl: 36px;
    --radius-lg: 28px;
    --radius-md: 20px;
    --radius-sm: 14px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--paper);
    background-image:
        radial-gradient(circle at 15% 30%, rgba(215, 185, 125, 0.14) 2%, transparent 2.5%),
        linear-gradient(180deg, rgba(255, 249, 232, 0.3), rgba(242, 236, 216, 0.8));
    background-size: 30px 30px, 100% 100%;
    color: var(--ink);
    font-family: 'Quicksand', sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.paper-shell {
    min-height: 100vh;
    padding: 24px 0 50px;
}

.container {
    max-width: 1280px;
}

.classic-header {
    background: rgba(255, 248, 237, 0.94);
    border-radius: 50px;
    padding: 18px 24px;
    margin-bottom: 30px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.03), inset 0 1px 0 #fffde7;
    border: 1px solid #e2d3b5;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
}

.title h1,
.page-heading,
.section-heading,
.postcard-profile h2,
.postcard-profile h3,
.postcard-profile h4,
.auth-card h2,
.chat-header h2,
.settings-card h2 {
    font-family: 'Playfair Display', serif;
}

.title h1 {
    margin: 0;
    font-size: 1.9rem;
    font-weight: 600;
    color: var(--accent);
}

.title p {
    margin: 4px 0 0;
    font-size: 0.92rem;
    color: #9b7a4a;
}

.member-counter {
    background: #e7dcc4;
    padding: 8px 16px;
    border-radius: 40px;
    font-weight: 700;
    font-size: 0.92rem;
    color: #5b421c;
}

.nav-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.vintage-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #f2e5d2;
    border: 1px solid rgba(182, 141, 85, 0.18);
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 600;
    color: #5c3f1f;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    font-family: 'Quicksand', sans-serif;
}

.vintage-btn:hover,
.vintage-btn:focus-visible {
    background: #e3d2b5;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(150, 108, 43, 0.12);
    outline: none;
}

.vintage-btn.is-current {
    background: #d8c2a1;
}

.small-btn {
    padding: 8px 14px;
    font-size: 0.92rem;
}

.notice-card,
.empty-state,
.auth-card,
.settings-card,
.page-card,
.chat-panel,
.chat-sidebar,
.postcard-profile {
    background: rgba(255, 251, 240, 0.95);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.notice-card {
    border-radius: 24px;
    padding: 16px 20px;
    margin-bottom: 22px;
    color: #66441f;
}

.notice-success {
    background: var(--success-soft);
}

.notice-warning {
    background: #f8ecd1;
}

.notice-danger {
    background: var(--danger-soft);
}

.page-intro {
    margin-bottom: 24px;
}

.page-heading {
    margin: 0 0 8px;
    font-size: clamp(2rem, 2.8vw, 3rem);
    color: #7b4f1e;
}

.page-subtitle {
    margin: 0;
    font-size: 1.02rem;
    color: var(--muted);
}

.upload-strip {
    background: #fcf3e2;
    border-radius: 36px;
    padding: 16px 18px;
    margin-bottom: 26px;
    border: 1px solid #ecd4a7;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    display: flex;
    gap: 16px;
    align-items: center;
}

.upload-strip-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #fff7e7;
    color: #b97f47;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.upload-form,
.inline-form {
    display: flex;
    gap: 12px;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
}

.upload-form input[type='text'],
.comment-form input,
.chat-compose input,
.auth-form input,
.auth-form textarea,
.settings-form input,
.settings-form textarea,
.timeline-form textarea {
    background: #fffdf7;
    border: 1px solid #ead8b2;
    border-radius: 22px;
    padding: 12px 16px;
    color: var(--ink);
    font-family: 'Quicksand', sans-serif;
    width: 100%;
}

.upload-form input[type='text'] {
    flex: 1 1 320px;
}

.polaroid-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 26px;
}

.polaroid {
    background: #fffdf5;
    padding: 14px 14px 18px;
    border-radius: 16px;
    box-shadow: 6px 8px 14px rgba(0, 0, 0, 0.05), -2px -2px 6px rgba(255, 250, 210, 0.6);
    transition: transform 0.2s ease;
    border: 1px solid #f0e2c5;
}

.polaroid:hover {
    transform: rotate(0.4deg) translateY(-2px);
}

.polaroid-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    background: #e1cfaa;
}

.polaroid-caption {
    font-style: italic;
    margin: 12px 0 8px;
    color: #7a5a38;
    min-height: 42px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.avatar-default {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e9cf96;
}

.user-meta {
    min-width: 0;
}

.user-meta strong {
    font-size: 0.98rem;
}

.photo-subline,
.gallery-card-time,
.comment-meta span,
.timeline-stamp,
.friend-meta,
.small-note,
.form-note {
    font-size: 0.82rem;
    color: var(--muted);
}

.tick-29 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-left: 6px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2ea8ff, #1570ef);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: 'Quicksand', sans-serif;
    box-shadow: 0 3px 8px rgba(21, 112, 239, 0.28);
    border: 2px solid rgba(255, 255, 255, 0.92);
    line-height: 1;
}

.status-flame,
.status-ash {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.9rem;
}

.status-chip {
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(197, 174, 138, 0.4);
}

.like-comment-bar {
    margin-top: 12px;
    border-top: 1px dashed #eedbb2;
    padding-top: 10px;
    display: flex;
    gap: 15px;
}

.icon-action {
    background: none;
    border: none;
    cursor: pointer;
    color: #9a6a2b;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0;
}

.icon-action.liked {
    color: #d9690e;
}

.icon-stat {
    color: #9a6a2b;
    font-size: 0.9rem;
    font-weight: 700;
}

.like-comment-bar.is-readonly {
    align-items: center;
}

.readonly-note {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 16px;
    background: #fff8ec;
    border: 1px dashed #ebd8b1;
    color: #8a6d4d;
    font-size: 0.88rem;
}

.comment-stack {
    margin-top: 12px;
    display: grid;
    gap: 10px;
}

.comment-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: #fff8ec;
    border-radius: 18px;
    padding: 10px 12px;
    border: 1px dashed #ebd8b1;
}

.comment-avatar {
    width: 30px;
    height: 30px;
    object-fit: cover;
    border-radius: 50%;
}

.comment-item p {
    margin: 4px 0 0;
    font-size: 0.92rem;
}

.comment-form {
    margin-top: 12px;
    display: flex;
    gap: 10px;
}

.comment-form input {
    flex: 1;
}

.gallery-wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 22px;
}

.member-roster-section {
    margin-bottom: 32px;
}

.guest-entry-card {
    margin-bottom: 28px;
    padding: 18px 20px;
    border-radius: 28px;
    background: rgba(255, 251, 240, 0.96);
    border: 1px solid #ead7b0;
    box-shadow: 0 10px 20px rgba(120, 90, 45, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.guest-entry-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.member-wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}

.member-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: 24px;
    background: rgba(255, 251, 240, 0.96);
    border: 1px solid #ead7b0;
    box-shadow: 0 10px 20px rgba(120, 90, 45, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.member-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 24px rgba(120, 90, 45, 0.1);
    border-color: #d8b77d;
}

.member-card-avatar {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ecd2a0;
    flex-shrink: 0;
}

.member-card-body {
    min-width: 0;
}

.member-card-title {
    font-weight: 700;
    color: #6c4a20;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.member-card-username,
.member-card-joined {
    font-size: 0.84rem;
    color: #8a6d4d;
}

.member-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 8px 0 6px;
    font-size: 0.84rem;
}

.member-self-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: #f2e5d2;
    color: #7a5320;
    font-size: 0.72rem;
    font-weight: 700;
}

.gallery-card {
    overflow: hidden;
    border-radius: 22px;
    background: #fff7ea;
    box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #ebd8b1;
}

.gallery-card img {
    width: 100%;
    height: 230px;
    object-fit: cover;
}

.gallery-card-body {
    padding: 14px;
}

.gallery-card-title {
    font-weight: 700;
    margin-bottom: 8px;
}

.gallery-card-body p {
    margin: 0 0 10px;
    color: #71583d;
}

.postcard-profile {
    max-width: 980px;
    margin: 0 auto;
    padding: 22px;
    border-radius: 36px;
}

.cover-area {
    min-height: 290px;
    border-radius: 26px;
    background-size: cover;
    background-position: center;
    background-color: #e7d8b8;
    position: relative;
    overflow: hidden;
}

.cover-area.is-default::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.4), transparent 30%),
        linear-gradient(135deg, rgba(211, 181, 127, 0.92), rgba(231, 214, 173, 0.82));
}

.avatar-large {
    width: 118px;
    height: 118px;
    border-radius: 50%;
    margin-top: -60px;
    border: 5px solid #fffbf0;
    object-fit: cover;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.14);
}

.profile-cover-shell {
    display: flex;
    align-items: flex-end;
    padding: 24px;
}

.profile-cover-shell::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(69, 47, 16, 0.04), rgba(69, 47, 16, 0.28));
    pointer-events: none;
}

.cover-fallback-copy {
    position: absolute;
    top: 28px;
    left: 28px;
    z-index: 1;
    max-width: 460px;
    color: #fff9ef;
    text-shadow: 0 4px 14px rgba(83, 56, 21, 0.22);
}

.cover-fallback-copy h3 {
    margin: 12px 0 8px;
    font-size: clamp(1.9rem, 3vw, 2.7rem);
    line-height: 1.1;
}

.cover-fallback-copy p {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.65;
}

.cover-fallback-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 248, 237, 0.2);
    border: 1px solid rgba(255, 248, 237, 0.35);
    color: #fffef8;
    font-weight: 700;
    backdrop-filter: blur(6px);
}

.profile-hero-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    gap: 18px;
    padding: 18px;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(255, 252, 243, 0.82), rgba(255, 248, 233, 0.94));
    border: 1px solid rgba(255, 244, 223, 0.72);
    box-shadow: 0 18px 30px rgba(74, 50, 20, 0.1);
    backdrop-filter: blur(8px);
}

.profile-hero-avatar {
    margin-top: 0;
    border-color: rgba(255, 251, 240, 0.98);
    flex-shrink: 0;
}

.profile-hero-content {
    flex: 1;
}

.profile-headline {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.profile-name-block h2 {
    margin: 0 0 8px;
    font-size: clamp(2rem, 3vw, 2.8rem);
}

.profile-name-block p {
    margin: 0;
    color: var(--muted);
}

.profile-bio {
    margin: 0;
    font-size: 1rem;
    line-height: 1.7;
}

.profile-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.section-divider {
    border: 0;
    border-top: 2px dotted #ead6af;
    margin: 24px 0;
}

.friend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 14px;
}

.friend-card {
    text-align: center;
    background: #fff7ea;
    border-radius: 20px;
    padding: 14px 10px;
    border: 1px solid #ebd8b1;
}

.friend-card:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease;
}

.friend-card img {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 10px;
    border: 2px solid #e9cf96;
}

.friend-card-name {
    font-size: 0.9rem;
    font-weight: 700;
}

.timeline-form {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.timeline-form textarea {
    min-height: 120px;
    resize: vertical;
}

.timeline-board {
    display: grid;
    gap: 16px;
}

.timeline-card {
    position: relative;
    border-radius: 24px;
    padding: 18px 20px;
    background: linear-gradient(180deg, rgba(255, 253, 244, 0.96), rgba(255, 247, 232, 0.96));
    border: 1px solid #ead5aa;
    box-shadow: 0 10px 20px rgba(120, 90, 45, 0.06);
}

.timeline-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}

.timeline-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.timeline-author img {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e9cf96;
}

.timeline-author-name {
    font-weight: 700;
    color: #6c4a20;
}

.timeline-stamp span {
    margin-left: 8px;
    color: #9c7a4f;
}

.timeline-content {
    line-height: 1.8;
}

.timeline-photo {
    margin-top: 14px;
    width: 100%;
    max-height: 380px;
    object-fit: cover;
    border-radius: 20px;
}

.auth-shell,
.settings-shell {
    max-width: 780px;
    margin: 0 auto;
}

.auth-card,
.settings-card {
    border-radius: 34px;
    padding: 26px 28px;
}

.auth-card h2,
.settings-card h2 {
    margin: 0 0 10px;
    color: #7b4f1e;
}

.auth-card p,
.settings-card p {
    color: var(--muted);
}

.auth-form,
.settings-form {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.field-group {
    display: grid;
    gap: 8px;
}

.field-group label {
    font-weight: 700;
    color: #6a512e;
}

.file-picker {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    padding: 10px 16px;
    border-radius: 26px;
    border: 1px solid #ead8b2;
    background: #fffaf1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
    cursor: pointer;
    flex: 1 1 260px;
    overflow: hidden;
}

.file-picker input[type='file'] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-picker-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding: 10px 16px;
    border-radius: 999px;
    background: #f2e5d2;
    border: 1px solid rgba(182, 141, 85, 0.18);
    color: #5c3f1f;
    font-weight: 700;
}

.file-picker-name {
    min-width: 0;
    color: #8a6d4d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-picker:hover .file-picker-button {
    background: #e3d2b5;
}

.file-picker-wide {
    width: 100%;
}

.chat-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 24px;
    min-height: 72vh;
}

.chat-sidebar,
.chat-panel {
    border-radius: 32px;
    padding: 18px;
}

.chat-sidebar {
    display: grid;
    gap: 14px;
    align-content: start;
}

.friend-list {
    display: grid;
    gap: 10px;
}

.friend-tile {
    width: 100%;
    border: 1px solid #ead8b4;
    background: #fff9ee;
    border-radius: 22px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.friend-tile:hover,
.friend-tile.active {
    transform: translateY(-1px);
    background: #fff2da;
    border-color: #d9b77d;
}

.friend-tile img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e9cf96;
}

.friend-tile-body {
    min-width: 0;
}

.friend-name {
    font-weight: 700;
    margin-bottom: 4px;
}

.chat-panel {
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 16px;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    border-bottom: 1px dashed #ead6af;
    padding-bottom: 14px;
}

.chat-header h2 {
    margin: 0;
    font-size: 1.75rem;
    color: #7b4f1e;
}

.chat-stream {
    min-height: 360px;
    max-height: 62vh;
    overflow-y: auto;
    display: grid;
    gap: 12px;
    padding-right: 6px;
}

.chat-bubble-row {
    display: flex;
}

.chat-bubble-row.mine {
    justify-content: flex-end;
}

.chat-bubble-row.theirs {
    justify-content: flex-start;
}

.chat-bubble {
    max-width: 76%;
    padding: 12px 14px;
    border-radius: 22px;
    background: #fff3df;
    border: 1px solid #ecd4a7;
}

.chat-bubble-row.mine .chat-bubble {
    background: #eedfc2;
}

.chat-bubble p {
    margin: 0 0 4px;
    line-height: 1.6;
}

.chat-bubble span {
    font-size: 0.75rem;
    color: var(--muted);
}

.chat-compose {
    display: flex;
    gap: 12px;
    align-items: center;
}

.chat-compose input {
    flex: 1;
}

.empty-state {
    border-radius: 28px;
    padding: 28px;
    text-align: center;
    color: #7a5a38;
}

.floating-toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1040;
    max-width: 320px;
    padding: 14px 16px;
    border-radius: 18px;
    box-shadow: 0 18px 32px rgba(51, 34, 12, 0.18);
    color: #fff;
    background: rgba(78, 62, 46, 0.92);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.floating-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.floating-toast.error {
    background: rgba(151, 63, 49, 0.94);
}

.floating-toast.success {
    background: rgba(75, 120, 44, 0.94);
}

.disabled {
    opacity: 0.55;
    pointer-events: none;
}

.site-footer {
    margin-top: 34px;
    padding: 18px 22px 6px;
    text-align: center;
}

.site-footer p {
    display: inline-block;
    margin: 0;
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(255, 248, 237, 0.82);
    border: 1px solid #e2d3b5;
    color: #8a6d4d;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.03);
}

@media (max-width: 991.98px) {
    .chat-layout {
        grid-template-columns: 1fr;
    }

    .chat-sidebar {
        order: 2;
    }

    .chat-panel {
        order: 1;
    }
}

@media (max-width: 767.98px) {
    .paper-shell {
        padding-top: 18px;
    }

    .classic-header {
        border-radius: 32px;
        padding: 18px;
        text-align: center;
        justify-content: center;
    }

    .nav-buttons {
        justify-content: center;
    }

    .upload-strip {
        flex-direction: column;
        align-items: stretch;
    }

    .profile-headline {
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-cover-shell {
        min-height: 360px;
        padding: 16px;
    }

    .cover-fallback-copy {
        top: 18px;
        left: 18px;
        right: 18px;
    }

    .profile-hero-panel {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
    }

    .comment-form,
    .chat-compose {
        flex-direction: column;
        align-items: stretch;
    }

    .file-picker {
        width: 100%;
    }

    .timeline-meta,
    .timeline-author {
        align-items: flex-start;
    }

    .chat-bubble {
        max-width: 92%;
    }

    .member-card {
        align-items: flex-start;
    }

    .guest-entry-card {
        align-items: flex-start;
    }
}
