* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f3f2ee;
    color: #181818;
}

button,
textarea,
input {
    /*font: inherit;*/
}

button {
    color: inherit;
}

#wangleApp {
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid #deddd8;
    backdrop-filter: blur(12px);
}

.brand {
    border: 0;
    background: transparent;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 3px;
    cursor: pointer;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-button,
.avatar-button {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    font-size: 20px;
}

.topbar-button:hover,
.avatar-button:hover {
    background: #ecebe7;
}

.avatar-button {
    background: #181818;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
}

.door {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 320px;
    background: #fff;
    z-index: 1000;
    transition: transform 0.28s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.16);
}

.door-left {
    left: 0;
    transform: translateX(-105%);
}

.door-left.open {
    transform: translateX(0);
}

.door-right {
    right: 0;
    transform: translateX(105%);
}

.door-right.open {
    transform: translateX(0);
}

.door-header {
    min-height: 64px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #ededed;
}

.close-door {
    border: 0;
    background: transparent;
    font-size: 30px;
    cursor: pointer;
}

.main-navigation {
    padding: 16px;
}

.nav-item {
    width: 100%;
    border: 0;
    background: transparent;
    padding: 14px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 16px;
    cursor: pointer;
    text-align: left;
}

.nav-item:hover,
.nav-item.active {
    background: #efeee9;
}

.nav-item span {
    width: 24px;
    font-size: 20px;
    text-align: center;
}

.door-bottom {
    margin-top: auto;
    padding: 16px;
    border-top: 1px solid #ededed;
}

.right-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid #ededed;
}

.right-tab {
    padding: 14px;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-weight: 700;
}

.right-tab.active {
    border-bottom: 3px solid #181818;
}

.right-panel {
    display: none;
    padding: 16px;
}

.right-panel.active {
    display: block;
}

.activity-item {
    padding: 15px;
    background: #f4f3ef;
    border-radius: 12px;
}

.door-shade {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(0, 0, 0, 0.28);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
}

.door-shade.active {
    opacity: 1;
    visibility: visible;
}

.main-content {
    width: min(100% - 30px, 720px);
    margin: 26px auto 70px;
}

.view {
    display: none;
}

.active-view {
    display: block;
}

.composer-card,
.post-card {
    background: #fff;
    border: 1px solid #e7e6e1;
    box-shadow: 0 3px 18px rgba(0, 0, 0, 0.035);
}

.composer-card {
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 18px;
}

.composer-top {
    display: flex;
    gap: 12px;
}

.small-avatar,
.post-avatar {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #181818;
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
}

#postBody {
    width: 100%;
    min-height: 90px;
    border: 0;
    resize: vertical;
    outline: none;
    padding: 10px;
    background: transparent;
    font-size: 17px;
}

.composer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #ededed;
}

.photo-picker {
    cursor: pointer;
    font-weight: 600;
}

.photo-picker input {
    display: none;
}

.primary-button {
    border: 0;
    background: #181818;
    color: #fff;
    padding: 11px 22px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.feed {
    display: grid;
    gap: 16px;
}

.post-card {
    border-radius: 18px;
    padding: 17px;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-user {
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-align: left;
}

.post-user strong,
.post-user small {
    display: block;
}

.post-user small {
    color: #777;
    margin-top: 2px;
}

.post-menu {
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
}

.post-content {
    padding: 18px 3px;
    font-size: 16px;
    line-height: 1.55;
}

.post-actions {
    border-top: 1px solid #ededed;
    padding-top: 10px;
    display: flex;
    justify-content: space-around;
}

.post-actions button {
    border: 0;
    background: transparent;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 16px;
}

.image-preview {
    margin-top: 15px;
}

.image-preview img {
    width: 100%;
    max-height: 460px;
    object-fit: cover;
    border-radius: 15px;
}

.modal-layer {
    position: fixed;
    inset: 0;
    z-index: 1500;
    background: rgba(0, 0, 0, 0.45);
    display: grid;
    place-items: center;
    padding: 20px;
}

.modal-card {
    position: relative;
    width: min(600px, 100%);
    max-height: 88vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 20px;
    padding: 25px;
}

.modal-card {
    overflow-y: auto;
    scrollbar-width: none;      /* Firefox */
    -ms-overflow-style: none;   /* old Edge / IE */
}

.modal-card::-webkit-scrollbar {
    display: none;              /* Chrome, Safari, Brave */
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    border: 2px solid black;
    /*background: none;*/
    font-size: 28px;
    color:black;
    cursor: pointer;
    /*border-radius: 50%;*/
    z-index:1;
}

.hidden {
    display: none !important;
}

.back-button {
    border: 0;
    background: transparent;
    margin-bottom: 20px;
    cursor: pointer;
    font-size: 15px;
}

@media (max-width: 600px) {
    .door {
        width: min(88vw, 340px);
    }

    .main-content {
        width: calc(100% - 18px);
        margin-top: 12px;
    }

    .composer-card,
    .post-card {
        border-radius: 14px;
    }
}


/* ========================================
   AUTH
======================================== */

.auth-wrap {
    min-height: calc(100vh - 64px);
    display: grid;
    place-items: center;
    padding: 30px 18px;
}

.auth-card {
    width: min(460px, 100%);
    background: #fff;
    border: 1px solid #e7e6e1;
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 12px 40px rgba(0,0,0,.06);
}

.auth-brand {
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 4px;
    margin-bottom: 26px;
}

.auth-card h1 {
    margin: 0 0 8px;
    font-size: 34px;
}

.auth-subtitle {
    margin: 0 0 24px;
    color: #6d6d6d;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    background: #f1f0ec;
    padding: 5px;
    border-radius: 14px;
    margin-bottom: 18px;
}

.auth-tab {
    border: 0;
    background: transparent;
    padding: 11px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
}

.auth-tab.active {
    background: #fff;
}

.auth-form {
    display: none;
    gap: 12px;
}

.auth-form.active {
    display: grid;
}

.auth-form input {
    width: 100%;
    border: 1px solid #d8d7d2;
    border-radius: 12px;
    padding: 13px 14px;
    outline: none;
}

.auth-form input:focus {
    border-color: #181818;
}

.wide-button {
    width: 100%;
    margin-top: 4px;
}

.form-message {
    min-height: 20px;
    padding-top: 8px;
    font-size: 14px;
    color: #666;
}

.danger-text {
    color: #9d2525;
}

.feed-image {
    display: block;
    width: 100%;
    max-height: 620px;
    object-fit: cover;
    border-radius: 14px;
    margin: 4px 0 12px;
}

.feed-loading,
.empty-feed {
    background: #fff;
    border: 1px solid #e7e6e1;
    border-radius: 18px;
    padding: 28px;
    text-align: center;
    color: #666;
}

.empty-feed strong {
    display: block;
    color: #181818;
    margin-bottom: 6px;
}

.profile-hero { text-align:center; padding:12px 6px 24px; }
.profile-large-avatar { width:82px; height:82px; margin:0 auto 14px; border-radius:50%; background:#181818; color:#fff; display:grid; place-items:center; font-size:30px; font-weight:900; }
.profile-hero h2 { margin:0; }
.profile-handle { color:#777; margin-top:4px; }
.profile-post-item { background:#f4f3ef; border-radius:14px; padding:14px; margin-top:10px; }
.profile-post-item img { width:100%; max-height:380px; object-fit:cover; border-radius:12px; margin-top:10px; }


/* ========================================
   WANGLE 0.4 PROFILE / FOLLOW / ALERTS
======================================== */

.profile-avatar-image {
    object-fit: cover;
    display: block;
}

.profile-counts {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 14px;
    color: #666;
    font-size: 14px;
}

.profile-actions {
    margin-top: 18px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.secondary-button {
    border: 1px solid #cfcfc9;
    background: #fff;
    color: #181818;
    padding: 11px 22px;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
}

.profile-editor h2 {
    margin-top: 0;
}

.profile-editor form {
    display: grid;
    gap: 16px;
}

.profile-editor label {
    display: grid;
    gap: 7px;
    font-weight: 700;
}

.profile-editor input[type="text"],
.profile-editor textarea,
.profile-editor input[type="file"] {
    width: 100%;
}

.profile-editor input[type="text"],
.profile-editor textarea {
    border: 1px solid #d8d7d2;
    border-radius: 12px;
    padding: 12px 14px;
    outline: none;
    font-weight: 400;
}

.profile-editor textarea {
    min-height: 120px;
    resize: vertical;
}

.notification-item {
    width: 100%;
    border: 0;
    background: #f4f3ef;
    border-radius: 12px;
    padding: 13px;
    margin-bottom: 8px;
    text-align: left;
    cursor: pointer;
    display: grid;
    gap: 4px;
}

.notification-item.unread {
    box-shadow: inset 4px 0 0 #181818;
}

.notification-item span {
    color: #666;
}


/* ========================================
   WANGLE 0.5 DISCOVER / FOLLOWING FEED
======================================== */

.feed-switcher {
    display: inline-flex;
    gap: 6px;
    padding: 5px;
    margin-bottom: 14px;
    background: #e8e7e2;
    border-radius: 999px;
}

.feed-tab {
    border: 0;
    background: transparent;
    padding: 9px 16px;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
}

.feed-tab.active {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.post-avatar-image {
    object-fit: cover;
}

.profile-count-button {
    border: 0;
    background: transparent;
    padding: 4px;
    color: inherit;
    cursor: pointer;
}

.profile-count-button:hover {
    text-decoration: underline;
}

.explore-heading h1,
.connection-list-view h2 {
    margin-bottom: 6px;
}

.explore-heading p {
    margin-top: 0;
    color: #6f6f6f;
}

.explore-search {
    margin: 18px 0;
}

.explore-search input {
    width: 100%;
    border: 1px solid #d8d7d2;
    background: #fff;
    border-radius: 999px;
    padding: 13px 16px;
    outline: none;
}

.people-list {
    display: grid;
    gap: 10px;
}

.person-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #fff;
    border: 1px solid #e7e6e1;
    border-radius: 16px;
}

.person-identity {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 0;
    background: transparent;
    padding: 0;
    text-align: left;
    cursor: pointer;
}

.person-avatar {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 50%;
    background: #181818;
    color: #fff;
    display: grid;
    place-items: center;
    object-fit: cover;
    font-weight: 800;
}

.person-text {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.person-text strong,
.person-text span,
.person-text small {
    overflow: hidden;
    text-overflow: ellipsis;
}

.person-text span {
    color: #777;
    font-size: 14px;
}

.person-text small {
    margin-top: 4px;
    color: #666;
    white-space: nowrap;
}

.compact-button {
    padding: 9px 14px;
    flex-shrink: 0;
}

.connection-list-view {
    padding-top: 4px;
}

@media (max-width: 520px) {
    .person-row {
        align-items: flex-start;
    }

    .compact-button {
        padding: 8px 11px;
    }

    .person-text small {
        white-space: normal;
    }
}


/* ========================================
   WANGLE 0.6 DIRECT MESSAGES
======================================== */

.conversation-row {
    width: 100%;
    border: 0;
    background: #f4f3ef;
    border-radius: 14px;
    padding: 10px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    cursor: pointer;
}

.conversation-row.unread {
    box-shadow: inset 4px 0 0 #181818;
}

.conversation-avatar {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 50%;
    object-fit: cover;
    background: #181818;
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
}

.conversation-text {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 3px;
}

.conversation-text strong,
.conversation-text span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.conversation-text span {
    color: #6f6f6f;
    font-size: 13px;
}

.conversation-badge {
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #181818;
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 800;
}

.conversation-badge:empty {
    display: none;
}

.message-thread {
    display: grid;
    grid-template-rows: auto 1fr auto;
    height: calc(100vh - 150px);
    min-height: 420px;
}

.message-thread-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ededed;
}

.message-back-button {
    border: 0;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
}

.message-thread-title {
    border: 0;
    background: transparent;
    font-weight: 800;
    cursor: pointer;
}

.message-thread-body {
    overflow-y: auto;
    padding: 14px 2px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message-bubble {
    max-width: 82%;
    padding: 10px 13px;
    border-radius: 16px;
    line-height: 1.4;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.message-bubble.mine {
    align-self: flex-end;
    background: #181818;
    color: #fff;
    border-bottom-right-radius: 5px;
}

.message-bubble.theirs {
    align-self: flex-start;
    background: #ecebe7;
    color: #181818;
    border-bottom-left-radius: 5px;
}

.message-empty {
    margin: auto;
    color: #777;
    text-align: center;
}

.message-compose {
    display: flex;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid #ededed;
}

.message-compose textarea {
    flex: 1;
    resize: none;
    border: 1px solid #d8d7d2;
    border-radius: 14px;
    padding: 10px 12px;
    outline: none;
}

.message-compose button {
    border: 0;
    background: #181818;
    color: #fff;
    border-radius: 999px;
    padding: 0 16px;
    font-weight: 700;
    cursor: pointer;
}


/* ========================================
   WANGLE 0.7 POST CONTROLS / MODERATION
======================================== */

.action-sheet {
    display: grid;
    gap: 10px;
}

.action-sheet h2 {
    margin-top: 0;
}

.action-sheet-button {
    width: 100%;
    border: 1px solid #d9d8d3;
    background: #fff;
    border-radius: 12px;
    padding: 13px 15px;
    text-align: left;
    cursor: pointer;
    font-weight: 700;
}

.danger-button {
    color: #a42121;
}

.post-edit-panel {
    display: grid;
    gap: 14px;
}

.post-edit-panel textarea,
.report-panel textarea,
.report-panel select {
    width: 100%;
    border: 1px solid #d8d7d2;
    border-radius: 12px;
    padding: 12px 14px;
    outline: none;
}

.post-edit-panel textarea {
    min-height: 160px;
    resize: vertical;
}

.report-panel {
    display: grid;
    gap: 14px;
}

.report-panel label {
    display: grid;
    gap: 7px;
    font-weight: 700;
}

.report-panel textarea {
    min-height: 120px;
    resize: vertical;
}

.report-success {
    padding: 24px 4px;
    text-align: center;
}


/* ========================================
   WANGLE 0.8 MEDIA
======================================== */

.preview-grid,
.post-media-grid {
    display: grid;
    gap: 4px;
    overflow: hidden;
    border-radius: 14px;
}

.preview-grid img,
.post-media-item img {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
    display: block;
}

.preview-count-1,
.media-count-1 {
    grid-template-columns: 1fr;
}

.preview-count-1 img,
.media-count-1 .post-media-item {
    max-height: 560px;
}

.preview-count-2,
.media-count-2 {
    grid-template-columns: 1fr 1fr;
}

.preview-count-3,
.media-count-3 {
    grid-template-columns: 1fr 1fr;
}

.preview-count-3 img:first-child,
.media-count-3 .post-media-item:first-child {
    grid-row: span 2;
}

.preview-count-4,
.media-count-4 {
    grid-template-columns: 1fr 1fr;
}

.post-media-grid {
    margin: 4px 0 12px;
}

.post-media-item {
    position: relative;
    min-height: 210px;
    border: 0;
    background: #deddd8;
    padding: 0;
    cursor: pointer;
    overflow: hidden;
}

.media-count-1 .post-media-item {
    min-height: 320px;
}

.media-more-count {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.52);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 34px;
    font-weight: 900;
}

.image-viewer {
    display: grid;
    gap: 14px;
}

.image-viewer-stage {
    position: relative;
    min-height: 320px;
    display: grid;
    place-items: center;
    background: #111;
    border-radius: 16px;
    overflow: hidden;
}

.image-viewer-stage img {
    width: 100%;
    max-height: 72vh;
    object-fit: contain;
    display: block;
}

.image-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.86);
    color: #111;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
}

.image-nav-prev {
    left: 12px;
}

.image-nav-next {
    right: 12px;
}

.image-viewer-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.gallery-heading {
    margin-bottom: 16px;
}

.gallery-heading h1,
.gallery-heading h2 {
    margin-bottom: 4px;
}

.gallery-heading p {
    margin-top: 0;
    color: #777;
}

.photo-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.photo-gallery-item {
    aspect-ratio: 1 / 1;
    border: 0;
    padding: 0;
    background: #deddd8;
    cursor: pointer;
    overflow: hidden;
}

.photo-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.overlay-gallery-shell {
    padding-top: 4px;
}

@media (max-width: 600px) {
    .post-media-item {
        min-height: 150px;
    }

    .media-count-1 .post-media-item {
        min-height: 260px;
    }

    .photo-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .image-viewer-stage {
        min-height: 240px;
    }
}


/* ========================================
   PHOTO PICKER
======================================== */

.selected-photo-grid {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 8px;
    margin-top: 12px;
}

.selected-photo-tile,
.selected-photo-add {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
}

.selected-photo-tile {
    background: #deddd8;
}

.selected-photo-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.selected-photo-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: rgba(0,0,0,.7);
    color: #fff;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.selected-photo-add {
    border: 1px dashed #aaa;
    background: #f5f4f0;
    cursor: pointer;
    font-weight: 800;
}

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


/* ========================================
   WANGLE 1.0 SETTINGS + ADMIN
======================================== */

.settings-page {
    display: grid;
    gap: 16px;
}

.settings-heading h1 {
    margin-bottom: 4px;
}

.settings-heading p {
    margin-top: 0;
    color: #777;
}

.settings-card {
    background: #fff;
    border: 1px solid #e6e5e0;
    border-radius: 18px;
    padding: 18px;
}

.settings-card h2 {
    margin-top: 0;
}

.settings-account-row {
    display: grid;
    gap: 4px;
}

.settings-account-row span {
    color: #707070;
}

.settings-card-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.settings-form {
    display: grid;
    gap: 12px;
}

.settings-form input,
.moderation-note {
    width: 100%;
    border: 1px solid #d8d7d2;
    border-radius: 12px;
    padding: 12px 14px;
    outline: none;
}

.settings-empty {
    padding: 14px 0;
    color: #777;
}

.danger-zone {
    border-color: #e5c7c7;
}

.danger-zone p {
    color: #777;
}

.danger-solid-button {
    background: #9f2323;
}

.admin-settings-card {
    border-color: #cfcfc7;
}

.moderation-tabs {
    display: inline-flex;
    gap: 5px;
    background: #efeee9;
    padding: 5px;
    border-radius: 999px;
    margin: 15px 0;
}

.moderation-tab {
    border: 0;
    background: transparent;
    padding: 8px 13px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
}

.moderation-tab.active {
    background: #fff;
}

.moderation-report-card {
    border: 1px solid #e1e0db;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 10px;
}

.moderation-report-heading {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.moderation-report-heading span {
    color: #777;
    font-size: 13px;
}

.moderation-report-meta {
    margin-top: 5px;
    color: #777;
    font-size: 13px;
}

.moderation-report-card p {
    line-height: 1.5;
}

.moderation-note {
    min-height: 80px;
    resize: vertical;
}

.moderation-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.delete-account-panel {
    display: grid;
    gap: 12px;
}


/* ========================================
   WANGLE 1.1 STORIES
======================================== */

.stories-strip-shell {
    margin-bottom: 14px;
}

.stories-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 4px 12px;
}

.story-bubble {
    width: 76px;
    flex: 0 0 76px;
    display: grid;
    justify-items: center;
    gap: 6px;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.story-bubble small {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 12px;
}

.story-avatar-wrap,
.story-add-bubble > .story-avatar-fallback {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #deddd8;
    border: 3px solid transparent;
}

.story-bubble.has-unviewed .story-avatar-wrap {
    border-color: #111;
}

.story-avatar-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-avatar-fallback {
    font-weight: 900;
    font-size: 22px;
}

.story-add-bubble > .story-avatar-fallback {
    background: #111;
    color: #fff;
    font-size: 28px;
}

.story-form {
    display: grid;
    gap: 14px;
}

.story-form textarea {
    width: 100%;
    min-height: 120px;
    border: 1px solid #d8d7d2;
    border-radius: 12px;
    padding: 12px 14px;
    resize: vertical;
}

.story-photo-picker {
    width: fit-content;
    padding: 10px 14px;
    border: 1px solid #d8d7d2;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
}

.story-create-preview {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    border-radius: 14px;
    background: #111;
}

.story-viewer {
    display: grid;
    gap: 10px;
}

.story-progress-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 4px;
}

.story-progress-bar {
    height: 4px;
    border-radius: 999px;
    background: #d8d8d8;
}

.story-progress-bar.active {
    background: #111;
}

.story-viewer-identity {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    font-weight: 800;
}

.story-viewer-identity img,
.story-viewer-avatar-fallback {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    display: grid;
    place-items: center;
    background: #deddd8;
}

.story-viewer-stage {
    position: relative;
    min-height: 430px;
    border-radius: 18px;
    overflow: hidden;
    background: #111;
    display: grid;
    place-items: center;
}

.story-viewer-stage > img {
    width: 100%;
    height: 100%;
    max-height: 72vh;
    object-fit: contain;
}

.story-overlay-text {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 18px;
    background: rgba(0,0,0,.58);
    color: #fff;
    padding: 12px 14px;
    border-radius: 12px;
}

.story-text-only {
    padding: 30px;
    color: #fff;
    font-size: clamp(24px,5vw,42px);
    line-height: 1.25;
    text-align: center;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.story-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.88);
    font-size: 32px;
    cursor: pointer;
}

.story-nav-prev { left: 10px; }
.story-nav-next { right: 10px; }

.story-viewer-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
}

.story-viewer-footer > span {
    margin-right: auto;
    color: #777;
    font-size: 13px;
}

.story-viewer-person {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

@media (max-width: 600px) {
    .story-viewer-stage {
        min-height: 360px;
    }

    .story-bubble {
        width: 68px;
        flex-basis: 68px;
    }

    .story-avatar-wrap,
    .story-add-bubble > .story-avatar-fallback {
        width: 56px;
        height: 56px;
    }
}


/* ========================================
   WANGLE 1.2 STORY INTERACTIONS
======================================== */

.story-interactions {
    display: grid;
    gap: 10px;
    margin-top: 4px;
}

.story-reaction-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.story-reaction-button {
    width: 44px;
    height: 44px;
    border: 1px solid #deddd8;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    font-size: 22px;
    transition: transform .15s ease;
}

.story-reaction-button.selected {
    transform: scale(1.18);
}

.story-reply-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.story-reply-form input {
    flex: 1 1 220px;
    min-width: 0;
    border: 1px solid #d8d7d2;
    border-radius: 999px;
    padding: 11px 14px;
    outline: none;
}

.story-reply-feedback {
    width: 100%;
    color: #777;
    font-size: 13px;
}

@media (max-width: 600px) {
    .story-reply-form {
        align-items: stretch;
    }

    .story-reply-form .primary-button {
        flex: 0 0 auto;
    }
}


/* ========================================
   WANGLE 1.3 SEARCH + HASHTAGS + MENTIONS
======================================== */

.unified-search {
    display: grid;
    gap: 16px;
}

.unified-search-bar {
    position: sticky;
    top: 74px;
    z-index: 4;
    background: inherit;
    padding-bottom: 4px;
}

.unified-search-bar input {
    width: 100%;
    border: 1px solid #d8d7d2;
    border-radius: 999px;
    padding: 13px 17px;
    outline: none;
    font-size: 15px;
}

.search-section {
    display: grid;
    gap: 9px;
}

.search-section h2 {
    margin: 8px 0 4px;
    font-size: 18px;
}

.search-empty {
    color: #777;
    padding: 8px 0 12px;
}

.search-person-row {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.search-post-card {
    background: #fff;
    border: 1px solid #e5e4df;
    border-radius: 16px;
    padding: 14px;
}

.search-post-head {
    display: flex;
    gap: 10px;
    align-items: center;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    text-align: left;
}

.search-post-body {
    margin-top: 12px;
    line-height: 1.55;
    white-space: pre-wrap;
}

.inline-token {
    display: inline;
    border: 0;
    background: transparent;
    padding: 0;
    color: inherit;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}


/* ========================================
   WANGLE 1.4 SAVED POSTS + REPOSTS
======================================== */

.post-action-button {
    border: 0;
    background: transparent;
    padding: 7px 9px;
    border-radius: 999px;
    cursor: pointer;
    
}

.post-action-button:hover {
    background: #efeee9;
}

#savedPostsView .settings-heading {
    margin-bottom: 14px;
}


/* ========================================
   WANGLE 1.5 PROFILE TABS + PINNED POSTS
======================================== */

.profile-content-section {
    margin-top: 18px;
}

.profile-content-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid #e5e4df;
    margin-bottom: 14px;
}

.profile-content-tab {
    border: 0;
    background: transparent;
    padding: 11px 14px;
    cursor: pointer;
    font-weight: 800;
    border-bottom: 3px solid transparent;
}

.profile-content-tab.active {
    border-bottom-color: #111;
}

.profile-tab-content {
    display: grid;
    gap: 12px;
}

.profile-post-wrap {
    display: grid;
    gap: 5px;
}

.pinned-post-label,
.reposted-by-label {
    padding-left: 8px;
    color: #666;
    font-size: 13px;
    font-weight: 800;
}

/* ========================================
   WANGLE 1.5.4 PHOTOS VIEW POLISH
======================================== */

/*
 * Keep standalone Photos in the same visual lane as the Wangle feed.
 */
#photoGalleryView {
    width: min(100%, 650px);
    margin: 0 auto;
}

/*
 * Give the Photos heading the same card language as the rest of Wangle.
 */
#photoGalleryView .gallery-heading {
    background: #fff;
    border: 1px solid #e5e4df;
    border-radius: 18px;
    padding: 18px 20px;
    margin-bottom: 14px;
}

#photoGalleryView .gallery-heading h1 {
    margin: 0 0 3px;
    font-size: 26px;
    line-height: 1.1;
}

#photoGalleryView .gallery-heading p {
    margin: 0;
    color: #777;
    font-size: 14px;
}

/*
 * More intentional photo gallery spacing and shape.
 */
#photoGalleryView .photo-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
}

#photoGalleryView .photo-gallery-item {
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 0;
    border-radius: 14px;
    padding: 0;
    overflow: hidden;
    background: #deddd8;
    cursor: pointer;
}

#photoGalleryView .photo-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .18s ease;
}

#photoGalleryView .photo-gallery-item:hover img {
    transform: scale(1.025);
}

/*
 * Keep the dynamic content itself centered instead of allowing the Photos
 * page to hug the far-left side on wider layouts.
 */
#dynamicContent:has(#photoGalleryView) {
    width: 100%;
}

/*
 * Profile-overlay galleries get the same rounded treatment without
 * forcing the standalone page dimensions.
 */
.overlay-gallery-shell .photo-gallery-grid {
    gap: 7px;
}

.overlay-gallery-shell .photo-gallery-item {
    border-radius: 12px;
}

@media (max-width: 700px) {
    #photoGalleryView {
        width: 100%;
    }

    #photoGalleryView .gallery-heading {
        border-radius: 16px;
        padding: 16px;
    }

    #photoGalleryView .photo-gallery-grid {
        gap: 4px;
    }

    #photoGalleryView .photo-gallery-item {
        border-radius: 9px;
    }
}


/* ========================================
   WANGLE 1.6 WORKPLACE CORE
======================================== */

.profile-work-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 10px;
    padding: 0 18px 10px;
    align-items: center;
}

.profile-work-meta span {
    color: #666;
    font-size: 14px;
}

.work-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.work-status::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.directory-page {
    width: min(100%, 760px);
    margin: 0 auto;
}

.directory-heading {
    margin-bottom: 14px;
}

.directory-heading h1 {
    margin-bottom: 4px;
}

.directory-heading p {
    margin-top: 0;
    color: #777;
}

.directory-controls {
    display: grid;
    grid-template-columns: 1fr minmax(170px, 220px);
    gap: 10px;
    margin-bottom: 16px;
}

.directory-controls input,
.directory-controls select,
.settings-form select,
.work-dialog textarea {
    width: 100%;
    border: 1px solid #d8d7d2;
    border-radius: 12px;
    padding: 12px 14px;
    background: #fff;
}

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

.employee-card {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #e5e4df;
    background: #fff;
    border-radius: 16px;
    padding: 13px;
    text-align: left;
    cursor: pointer;
}

.employee-card-avatar {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    border-radius: 50%;
    overflow: hidden;
    background: #111;
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 900;
}

.employee-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.employee-card-body {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.employee-card-body span,
.employee-card-body small {
    color: #666;
}

.workplace-home-extras {
    display: grid;
    gap: 12px;
    margin: 10px 0 14px;
}

.announcement-stack {
    display: grid;
    gap: 8px;
}

.company-announcement {
    background: #fff;
    border: 1px solid #e5e4df;
    border-radius: 16px;
    padding: 14px 16px;
}

.company-announcement small {
    display: block;
    color: #777;
    margin-bottom: 4px;
}

.company-announcement strong {
    display: block;
    margin-bottom: 4px;
}

.company-announcement p {
    margin: 0;
    line-height: 1.45;
}

.announcement-important {
    border-width: 2px;
}

.announcement-urgent {
    border-width: 2px;
}

.recognition-section {
    background: #fff;
    border: 1px solid #e5e4df;
    border-radius: 16px;
    padding: 14px 16px;
}

.recognition-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.recognition-heading h2 {
    margin: 0;
    font-size: 18px;
}

.recognition-card {
    padding: 10px 0;
    border-top: 1px solid #efeee9;
}

.recognition-card p,
.recognition-empty {
    margin: 4px 0 0;
    color: #666;
}

.work-dialog textarea {
    min-height: 120px;
    resize: vertical;
}

@media (max-width: 650px) {
    .directory-controls {
        grid-template-columns: 1fr;
    }

    .directory-grid {
        grid-template-columns: 1fr;
    }
}


/* ========================================
   WANGLE 1.6.1 ERROR HANDLING
======================================== */

.api-error-card {
    background: #fff;
    border: 1px solid #e5caca;
    border-radius: 16px;
    padding: 14px 16px;
    line-height: 1.45;
}

.api-error-card strong {
    display: block;
    margin-bottom: 4px;
}


/* ========================================
   WANGLE 1.6.2 WORKPLACE MOBILE POLISH
======================================== */

.announcement-topline,
.recognition-card-topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.tiny-admin-button {
    flex: 0 0 auto;
    border: 1px solid #d7d6d1;
    background: #fff;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 11px;
    line-height: 1;
    font-weight: 800;
    cursor: pointer;
}

.workplace-header-button {
    padding: 7px 11px;
    font-size: 12px;
    min-height: auto;
}

.recognition-heading {
    align-items: center;
}

.recognition-card-topline strong {
    min-width: 0;
}

@media (max-width: 600px) {
    .recognition-section {
        padding: 14px;
    }

    .recognition-heading {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 8px;
        align-items: center;
    }

    .recognition-heading h2 {
        grid-column: 1;
        grid-row: 1;
    }

    .recognition-heading .workplace-header-button:first-of-type {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
    }

    .recognition-heading .workplace-header-button + .workplace-header-button {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-self: start;
    }

    .recognition-card-topline,
    .announcement-topline {
        gap: 8px;
    }

    .tiny-admin-button {
        padding: 4px 8px;
        font-size: 10px;
    }

    .recognition-card p {
        line-height: 1.45;
    }
}

/* ========================================
   CURRENT WANGLE UI CONSOLIDATION
   Avatars / Profile Modal / Workplace Mobile
======================================== */

/* ---------- AVATARS ---------- */

.avatar-button,
.small-avatar,
.post-avatar,
.person-avatar,
.profile-large-avatar,
.employee-card-avatar,
.story-avatar-wrap,
.conversation-avatar {
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar-button {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    max-width: 42px;
    max-height: 42px;
    flex: 0 0 42px;
    padding: 0;
}

.small-avatar,
.post-avatar {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    max-width: 42px;
    max-height: 42px;
    flex: 0 0 42px;
}

.profile-large-avatar {
    width: 92px;
    height: 92px;
    min-width: 92px;
    min-height: 92px;
    max-width: 92px;
    max-height: 92px;
    margin: 0 auto 12px;
    padding: 0;
    flex: 0 0 92px;
}

.profile-large-avatar.profile-avatar-image {
    width: 92px !important;
    height: 92px !important;
    min-width: 92px !important;
    min-height: 92px !important;
    max-width: 92px !important;
    max-height: 92px !important;
    aspect-ratio: 1 / 1 !important;
    display: block !important;
    margin: 0 auto 12px !important;
    object-fit: cover !important;
    object-position: center !important;
    border-radius: 50% !important;
}

.avatar-button img,
.small-avatar img,
.post-avatar img,
.person-avatar img,
.employee-card-avatar img,
.story-avatar-wrap img,
.conversation-avatar img,
.current-user-avatar-image,
.composer-avatar-image,
.post-avatar-image {
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    border-radius: 50%;
    image-rendering: auto;
}

img.post-avatar.post-avatar-image {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    max-width: 42px;
    max-height: 42px;
    flex: 0 0 42px;
}

/* ---------- PROFILE ---------- */

.profile-status-line {
    margin-top: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #ff0000;
    font-size: 13px;
}

.profile-status-line::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.profile-bio {
    line-height: 1.45;
}

.profile-tab-content {
    opacity: 1;
    transform: translateY(0);
    transition:
        opacity 0.16s ease,
        transform 0.16s ease;
}

.profile-tab-content.is-switching {
    opacity: 0;
    transform: translateY(4px);
}

.profile-tab-content.is-ready {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- WORKPLACE HEADER CONTROLS ---------- */

.announcement-topline,
.recognition-card-topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.tiny-admin-button {
    flex: 0 0 auto;
    border: 1px solid #d7d6d1;
    background: #fff;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 11px;
    line-height: 1;
    font-weight: 800;
    cursor: pointer;
}

.workplace-header-button {
    min-height: auto;
    padding: 7px 11px;
    font-size: 12px;
    white-space: nowrap;
}

.recognition-heading {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.recognition-heading h2 {
    margin: 0;
    font-size: 18px;
    white-space: nowrap;
}

.recognition-card-topline strong {
    min-width: 0;
}

/* ---------- MOBILE ---------- */

@media (max-width: 600px) {

    .main-content {
        width: calc(100% - 18px);
        margin-top: 12px;
    }

    /* One mobile modal scroll owner: the overlay. */
    #modalLayer,
    .modal-layer {
        position: fixed;
        inset: 0;
        display: block;
        box-sizing: border-box;
        padding: 8px;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    #modalLayer::-webkit-scrollbar,
    .modal-layer::-webkit-scrollbar {
        width: 0;
        height: 0;
        display: none;
    }

    #modalLayer .modal-card,
    .modal-layer .modal-card {
        position: relative;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        height: auto;
        max-height: none;
        margin: 0 auto 10px;
        padding: 16px 12px 18px;
        overflow: visible;
        border-radius: 18px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    #modalLayer .modal-card::-webkit-scrollbar,
    .modal-layer .modal-card::-webkit-scrollbar {
        width: 0;
        height: 0;
        display: none;
    }

    #modalContent {
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding: 6px 8px 18px;
        overflow-x: hidden;
    }

    #modalContent *,
    #modalContent *::before,
    #modalContent *::after {
        box-sizing: border-box;
    }

    #modalContent .profile-hero,
    #modalContent .profile-content-section,
    #modalContent .profile-tab-content,
    #modalContent .profile-post-wrap,
    #modalContent .post-card,
    #modalContent article,
    #modalContent .post-media-grid,
    #modalContent .post-media-item,
    #modalContent .feed {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    #modalContent img,
    #modalContent video {
        max-width: 100%;
    }

    .modal-close {
        top: 10px;
        right: 10px;
        z-index: 20;
    }

    /* Actual profile-viewer avatar class used by Wangle. */
    .profile-large-avatar,
    .profile-large-avatar.profile-avatar-image {
        width: 88px !important;
        height: 88px !important;
        min-width: 88px !important;
        min-height: 88px !important;
        max-width: 88px !important;
        max-height: 88px !important;
        flex: 0 0 88px !important;
        aspect-ratio: 1 / 1 !important;
        margin: 0 auto 10px !important;
        border-radius: 50% !important;
        object-fit: cover !important;
        object-position: center !important;
    }

    .profile-hero {
        padding: 4px 4px 18px;
        text-align: center;
    }

    .profile-hero h2 {
        margin: 8px 0 0;
        font-size: 24px;
        line-height: 1.05;
    }

    .profile-handle {
        margin-top: 2px;
        font-size: 14px;
    }

    .profile-status-line {
        margin-top: 4px;
        margin-bottom: 2px;
        font-size: 12px;
    }

    .profile-counts {
        justify-content: center;
        gap: 18px;
        margin-top: 12px;
    }

    .profile-bio {
        margin: 10px 0 12px;
        padding: 10px 12px;
        border-radius: 12px;
        background: #f7f6f2;
        text-align: left;
    }

    .profile-work-meta {
        justify-content: center;
        gap: 5px 8px;
        margin-top: 4px;
        padding: 0 8px 8px;
        text-align: center;
    }

    .profile-work-meta strong {
        width: 100%;
        font-size: 14px;
    }

    .profile-work-meta span {
        font-size: 12px;
    }

    .profile-actions {
        display: flex;
        justify-content: center;
        gap: 8px;
        flex-wrap: wrap;
        margin-top: 8px;
    }

    .profile-actions .primary-button,
    .profile-actions .secondary-button {
        min-height: 36px;
        padding: 8px 13px;
        font-size: 13px;
    }

    .profile-content-section {
        margin-top: 14px;
    }

    .profile-content-tabs {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0;
        width: 100%;
        margin-bottom: 10px;
        overflow: hidden;
    }

    .profile-content-tab {
        min-width: 0;
        padding: 10px 4px;
        text-align: center;
        font-size: 13px;
    }

    .profile-tab-content {
        gap: 10px;
    }

    .profile-post-wrap {
        gap: 4px;
    }

    .pinned-post-label,
    .reposted-by-label {
        padding-left: 4px;
        font-size: 11px;
    }

    /* Keep all workplace header controls on one row. */
    .recognition-section {
        padding: 12px 14px;
    }

    .recognition-heading {
        grid-template-columns: auto 1fr auto auto;
        gap: 6px;
    }

    .recognition-heading h2 {
        grid-column: 1;
        grid-row: 1;
        font-size: 16px;
    }

    .recognition-heading::before {
        content: '';
        grid-column: 2;
        grid-row: 1;
    }

    .recognition-heading .workplace-header-button {
        min-height: 28px;
        padding: 5px 8px;
        font-size: 10px;
        line-height: 1;
    }

    .recognition-heading .workplace-header-button:first-of-type {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
    }

    .recognition-heading .workplace-header-button + .workplace-header-button {
        grid-column: 4;
        grid-row: 1;
        justify-self: end;
    }

    .recognition-card-topline,
    .announcement-topline {
        gap: 8px;
    }

    .tiny-admin-button {
        padding: 4px 8px;
        font-size: 10px;
    }

    .recognition-empty {
        margin-top: 8px;
        font-size: 13px;
    }
}


/* ========================================
   WANGLE 1.6.7 PROFILE WORK META CENTERING
======================================== */

.profile-work-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    gap: 6px 10px;
    text-align: center;
}

.profile-work-meta strong,
.profile-work-meta span {
    text-align: center;
}


/* ========================================
   WANGLE 2.0 WORKPLACE SWITCHER
======================================== */
.workplace-switcher {
    margin: 8px 12px 14px;
    padding: 12px;
    border: 1px solid #e7e7e7;
    border-radius: 14px;
    background: #fafafa;
}

.workplace-switcher label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #666;
}

.workplace-switcher select {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid #d8d8d8;
    border-radius: 10px;
    background: #fff;
    font: inherit;
}

.workplace-new-button {
    width: 100%;
    margin-top: 8px;
    min-height: 36px;
    font-size: 13px;
}


/* ========================================
   WANGLE 2.1 PLATFORM ADMIN
======================================== */
.platform-admin-view {
    padding: 18px;
}

.platform-org-card,
.platform-member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid #ececec;
}

.platform-org-actions,
.platform-member-actions,
.platform-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.platform-org-meta,
.muted {
    color: #777;
    font-size: 13px;
}

.platform-stat-grid {
    display: grid;
    grid-template-columns: repeat(5,minmax(0,1fr));
    gap: 10px;
    margin: 18px 0;
}

.platform-stat-grid > div {
    padding: 14px;
    border: 1px solid #e8e8e8;
    border-radius: 14px;
    text-align: center;
}

.platform-stat-grid strong,
.platform-stat-grid span {
    display: block;
}

.platform-stat-grid strong {
    font-size: 22px;
}

.platform-admin-section {
    margin-top: 20px;
}

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

    .platform-org-card,
    .platform-member-row {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* ========================================
   WANGLE 2.1.1 ADMIN ACTION POLISH
======================================== */
.platform-org-actions button,
.platform-admin-actions button,
.platform-member-actions button {
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 10px;
    background: #fff;
    color: #171717;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.platform-org-actions button:hover,
.platform-admin-actions button:hover,
.platform-member-actions button:hover {
    background: #f3f3f3;
}

.platform-org-actions .danger-button,
.platform-admin-actions .danger-button {
    color: #b42318;
    border-color: #f0c5c0;
}


/* =========================================================
   WANGLE 2.1.2 — PLATFORM ADMIN CARD LAYOUT
   Applies to both organization list and Inspect view.
========================================================= */

.platform-admin-view {
    width: min(100%, 820px);
    margin: 0 auto;
    padding: 24px 16px 48px;
    box-sizing: border-box;
}

.platform-admin-view .view-heading {
    background: #fff;
    border: 1px solid #e9e6e1;
    border-radius: 20px;
    padding: 20px;
    margin: 0 0 16px;
    box-sizing: border-box;
}

.platform-admin-view .view-heading h2 {
    margin: 0 0 6px;
}

.platform-admin-view .view-heading p {
    margin: 0;
    color: #666;
}

/* Organization list cards */
.platform-org-card {
    background: #fff;
    border: 1px solid #e9e6e1;
    border-radius: 20px;
    padding: 18px;
    margin: 0 0 14px;
    box-sizing: border-box;
    box-shadow: 0 1px 0 rgba(0,0,0,.02);
}

.platform-org-card h3 {
    margin: 0 0 8px;
}

.platform-org-meta,
.platform-org-card .muted {
    color: #777;
}

/* Inspect page statistic panel */
.platform-stat-grid {
    background: #fff;
    border: 1px solid #e9e6e1;
    border-radius: 20px;
    padding: 16px;
    margin: 0 0 16px;
    box-sizing: border-box;

    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.platform-stat-grid > div {
    background: #faf9f6;
    border: 1px solid #ece8e1;
    border-radius: 14px;
    padding: 14px 10px;
    text-align: center;
    box-sizing: border-box;
}

.platform-stat-grid strong,
.platform-stat-grid span {
    display: block;
}

.platform-stat-grid strong {
    font-size: 22px;
    line-height: 1.1;
}

.platform-stat-grid span {
    margin-top: 4px;
    color: #666;
    font-size: 12px;
}

/* Inspect page members card */
.platform-admin-section {
    background: #fff;
    border: 1px solid #e9e6e1;
    border-radius: 20px;
    padding: 18px;
    margin: 0 0 16px;
    box-sizing: border-box;
}

.platform-admin-section h3 {
    margin: 0 0 10px;
}

.platform-member-row {
    background: transparent;
    padding: 14px 0;
    border-bottom: 1px solid #efede8;
}

.platform-member-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

/* Inspect page actions card */
.platform-admin-actions {
    background: #fff;
    border: 1px solid #e9e6e1;
    border-radius: 20px;
    padding: 14px;
    margin: 0;
    box-sizing: border-box;
}

/* Top inspect Back control should look intentional */
#platformBackButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 7px 12px;
    margin: 0 0 14px;
    border: 1px solid #d8d4cc;
    border-radius: 999px;
    background: #fff;
    color: #111;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

#platformBackButton:hover {
    background: #f6f4ef;
}

@media (max-width: 700px) {
    .platform-admin-view {
        padding: 14px 10px 32px;
    }

    .platform-admin-view .view-heading,
    .platform-org-card,
    .platform-admin-section,
    .platform-admin-actions,
    .platform-stat-grid {
        border-radius: 16px;
    }

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

    .platform-org-card,
    .platform-member-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .platform-org-actions,
    .platform-member-actions,
    .platform-admin-actions {
        width: 100%;
    }
}


/* =========================================================
   WANGLE 2.2 CONTROLLED ACCOUNT / INVITE / PHOTO POLISH
========================================================= */

.account-type-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.account-type-choice {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px;
    border: 1px solid #dedbd5;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
}

.account-type-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.account-type-check {
    width: 24px;
    height: 24px;
    border: 1px solid #bbb7af;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: transparent;
    flex: 0 0 24px;
}

.account-type-choice input:checked + .account-type-check {
    background: #171717;
    border-color: #171717;
    color: #fff;
}

.account-type-choice strong,
.account-type-choice small {
    display: block;
}

.account-type-choice small,
.auth-note {
    color: #777;
    font-size: 12px;
}

.invite-account-readonly {
    background: #f5f3ee;
    border: 1px solid #e2ded7;
    border-radius: 14px;
    padding: 12px 14px;
}

.invite-account-readonly small,
.invite-account-readonly strong,
.invite-account-readonly span {
    display: block;
}

.invite-account-readonly strong {
    margin: 3px 0;
}

#photoGalleryView {
    background: #fff;
    border: 1px solid #e7e4de;
    border-radius: 20px;
    padding: 18px;
    box-sizing: border-box;
}

#photoGalleryView .photo-gallery-grid {
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 8px;
}

#photoGalleryView .photo-gallery-item {
    background: #f2f1ed;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
}

#photoGalleryView .photo-gallery-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.invite-management-card {
    background: #fff;
    border: 1px solid #e7e4de;
    border-radius: 20px;
    padding: 18px;
}

.invite-management-form {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto auto;
    gap: 10px;
    align-items: center;
}

.invite-management-form input,
.invite-management-form select {
    min-height: 42px;
    border: 1px solid #d8d4cc;
    border-radius: 12px;
    padding: 9px 12px;
    font: inherit;
    background: #fff;
}

.invite-history {
    margin-top: 18px;
}

.invite-history-row,
.platform-request-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 0;
    border-bottom: 1px solid #efede8;
}

.platform-request-card:last-child,
.invite-history-row:last-child {
    border-bottom: none;
}

.platform-top-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.platform-top-actions button {
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid #d8d4cc;
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
}

@media (max-width: 700px) {
    .account-type-picker {
        grid-template-columns: 1fr;
    }

    #photoGalleryView {
        padding: 12px;
    }

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

    .invite-management-form {
        grid-template-columns: 1fr;
    }

    .platform-request-card {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* =========================================================
   WANGLE 2.2.1 — ACCOUNT GALLERY / SUPPORT VIEW / ANNOUNCEMENT
========================================================= */

.announcement-edit-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}

.platform-support-label {
    display: inline-block;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #777;
}

.platform-support-row {
    padding: 12px 0;
    border-bottom: 1px solid #efede8;
}

.platform-support-row:last-child {
    border-bottom: none;
}

.platform-support-row strong {
    display: block;
    margin-bottom: 4px;
}

.platform-support-photo-grid {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 8px;
}

.platform-support-photo-grid img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    background: #f2f1ed;
}

@media (max-width: 700px) {
    .announcement-edit-actions {
        grid-template-columns: 1fr;
    }

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


/* =========================================================
   WANGLE 2.2.3 — USERNAME EDIT + IMAGE FIT
========================================================= */

.username-input-wrap {
    display: flex;
    align-items: center;
    width: 100%;
    border: 1px solid #d8d7d2;
    /*border-radius: 12px;*/
    background: #fff;
    overflow: hidden;
}

.username-input-wrap span {
    padding-left: 14px;
    color: #777;
    font-weight: 700;
}

.profile-editor .username-input-wrap input[type="text"] {
    flex: 1;
    min-width: 0;
    border: 0;
    border-radius: 0;
    padding-left: 4px;
    outline: none;
}

.field-help {
    color: #777;
    font-weight: 400;
}

/*
 * Feed / grid media:
 * Fill every media frame completely without stretching the image.
 * object-fit: cover preserves aspect ratio and crops only overflow.
 */
.post-media-grid,
.preview-grid {
    background: transparent;
}

.post-media-item,
.preview-grid > * {
    background: transparent;
}

.post-media-item img,
.preview-grid img,
.photo-gallery-item img,
.selected-photo-tile img,
.profile-post-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Keep single feed photos full-width with a controlled visual frame. */
.media-count-1 .post-media-item {
    width: 100%;
    min-height: 360px;
    max-height: 640px;
    aspect-ratio: 4 / 3;
}

.media-count-1 .post-media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Multi-photo layouts stay edge-to-edge with no background gaps. */
.media-count-2 .post-media-item,
.media-count-3 .post-media-item,
.media-count-4 .post-media-item {
    aspect-ratio: 1 / 1;
}

/*
 * Photo gallery thumbnails are intentionally cropped to uniform squares.
 */
.photo-gallery-item {
    aspect-ratio: 1 / 1;
    background: transparent;
}

.photo-gallery-item img {
    object-fit: cover;
}

/*
 * Full image viewer:
 * Show the entire source image. Letterboxing is acceptable here because
 * this is the detail view rather than the feed/grid presentation.
 */
.image-viewer-stage {
    background: #111;
}

.image-viewer-stage img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 82vh;
    object-fit: contain;
    object-position: center;
    margin: 0 auto;
}

/* Team banners fill their frame; team avatars remain cropped circles. */


/* Avatars always fill the circle cleanly. */
.profile-large-avatar.profile-avatar-image,
.avatar-button img,
.small-avatar img,
.post-avatar img,
.person-avatar img,
.employee-card-avatar img,
.story-avatar-wrap img,
.conversation-avatar img {
    object-fit: cover;
    object-position: center;
}

/* Mobile keeps the same no-gap behavior. */
@media (max-width: 600px) {
    .media-count-1 .post-media-item {
        min-height: 300px;
        max-height: 520px;
        aspect-ratio: 4 / 3;
    }

    .image-viewer-stage img {
        max-height: 78vh;
    }
}


/* =========================================================
   WANGLE 2.2.4 — WHAT IS WANGLE
========================================================= */

.what-is-wangle-wrap {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}

.what-is-wangle-link {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 4px 8px;
    color: #555;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.what-is-wangle-link:hover {
    color: #111;
    text-decoration: underline;
}

.about-wangle-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 20px;
}

.about-wangle-modal.hidden {
    display: none;
}

.about-wangle-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.38);
    backdrop-filter: blur(2px);
}

.about-wangle-card {
    position: relative;
    z-index: 1;
    width: min(100%, 620px);
    max-height: min(82vh, 760px);
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e8e4dd;
    border-radius: 22px;
    padding: 28px 28px 26px;
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
    box-sizing: border-box;
}

.about-wangle-card h2 {
    margin: 0 40px 16px 0;
    font-size: 24px;
    line-height: 1.2;
    color: #111;
}

.about-wangle-card p {
    margin: 0 0 15px;
    color: #444;
    font-size: 15px;
    line-height: 1.65;
}

.about-wangle-card p:last-child {
    margin-bottom: 0;
}

.about-wangle-card .about-wangle-lead {
    color: #111;
    font-size: 17px;
    font-weight: 700;
}

.about-wangle-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #f3f1ed;
    color: #222;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.about-wangle-close:hover {
    background: #e9e6df;
}

.about-wangle-open {
    overflow: hidden;
}

@media (max-width: 600px) {
    .about-wangle-modal {
        padding: 12px;
        align-items: end;
    }

    .about-wangle-card {
        width: 100%;
        max-height: 88vh;
        border-radius: 20px 20px 14px 14px;
        padding: 24px 20px 22px;
    }

    .about-wangle-card h2 {
        font-size: 22px;
    }
}


/* =========================================================
   WANGLE 2.3 — EVENTS
========================================================= */

.events-home,
.event-page {
    width: min(100%, 820px);
    margin: 0 auto;
}

.events-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
    padding: 18px;
    background: #fff;
    border: 1px solid #e8e4dd;
    border-radius: 20px;
}

.events-heading h1 {
    margin: 0 0 4px;
}

.events-heading p {
    margin: 0;
    color: #777;
}

.events-tabs {
    display: flex;
    gap: 8px;
    padding: 5px;
    margin-bottom: 14px;
    background: #eeece7;
    border-radius: 14px;
}

.events-tab {
    flex: 1;
    min-height: 38px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.events-tab.active {
    background: #fff;
}

.events-list {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 14px;
}

.event-card {
    overflow: hidden;
    background: #fff;
    border: 1px solid #e8e4dd;
    border-radius: 18px;
}

.event-card-media {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    border: 0;
    padding: 0;
    background: #171717;
    cursor: pointer;
    overflow: hidden;
}

.event-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.event-card-fallback,
.event-detail-fallback {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    background: #171717;
    color: #fff;
    font-weight: 900;
    letter-spacing: .18em;
}

.event-card-body {
    padding: 15px;
    cursor: pointer;
}

.event-card-date {
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #777;
}

.event-card h3 {
    margin: 0 0 8px;
    font-size: 19px;
}

.event-card-meta {
    min-height: 20px;
    color: #666;
    font-size: 13px;
}

.event-card-bottom {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #efede8;
    font-size: 13px;
}

.event-editor-panel {
    width: min(100%, 650px);
}

.event-editor-form {
    display: grid;
    gap: 12px;
}

.event-editor-form label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

.event-editor-form input,
.event-editor-form textarea,
.event-editor-form select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d8d4cc;
    border-radius: 12px;
    padding: 11px 12px;
    background: #fff;
    font: inherit;
}

.event-editor-form textarea {
    min-height: 120px;
    resize: vertical;
}

.event-form-two,
.event-form-three {
    display: grid;
    gap: 10px;
}

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

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

.event-rsvp-toggle {
    display: flex !important;
    grid-template-columns: none;
    align-items: center;
    gap: 9px !important;
    padding: 11px 12px;
    background: #f5f3ee;
    border-radius: 12px;
}

.event-rsvp-toggle input {
    width: auto;
    margin: 0;
}

.event-back-button {
    margin-bottom: 12px;
}

.event-detail-card {
    overflow: hidden;
    background: #fff;
    border: 1px solid #e8e4dd;
    border-radius: 20px;
}

.event-detail-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #171717;
    overflow: hidden;
}

.event-detail-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
}

.event-detail-body {
    padding: 20px;
}

.event-detail-date {
    margin-bottom: 7px;
    color: #666;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.event-detail-body h1 {
    margin: 0 0 18px;
}

.event-detail-facts {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 10px;
}

.event-detail-facts > div {
    padding: 12px;
    background: #f7f5f1;
    border-radius: 12px;
}

.event-detail-facts strong,
.event-detail-facts span {
    display: block;
}

.event-detail-facts strong {
    margin-bottom: 4px;
    font-size: 12px;
    color: #666;
}

.event-detail-description {
    margin-top: 18px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.event-rsvp-label {
    margin-top: 20px;
    margin-bottom: 8px;
    font-weight: 800;
}

.event-rsvp-buttons,
.event-manage-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.event-rsvp-button.active {
    background: #171717;
    color: #fff;
    border-color: #171717;
}

.event-no-rsvp {
    margin-top: 18px;
    padding: 12px;
    background: #f5f3ee;
    border-radius: 12px;
}

.event-attendees-section {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #eeeae4;
}

.event-attendees-section h2 {
    margin: 0 0 12px;
    font-size: 18px;
}

.event-attendees-section h3 {
    margin: 14px 0 5px;
    font-size: 13px;
    color: #777;
}

.event-attendee-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: 0;
    border-bottom: 1px solid #f0ede8;
    padding: 10px 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.event-attendee-avatar {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    background: #ece9e3;
    font-weight: 800;
}

.event-attendee-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.event-attendee-row strong,
.event-attendee-row span {
    display: block;
}

.event-attendee-row span {
    margin-top: 2px;
    color: #777;
    font-size: 12px;
}

.event-manage-actions {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #eeeae4;
}

@media (max-width: 700px) {
    .events-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .events-list {
        grid-template-columns: 1fr;
    }

    .event-form-two,
    .event-form-three,
    .event-detail-facts {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   WANGLE 2.3.2 — ACCOUNT SETTINGS + ORGANIZATION HANDLE
========================================================= */

.platform-org-editor {
    width: min(100%, 560px);
}

.organization-handle-input {
    display: flex;
    align-items: center;
    width: 100%;
    overflow: hidden;
    border: 1px solid #d8d4cc;
    border-radius: 12px;
    background: #fff;
    box-sizing: border-box;
}

.organization-handle-input span {
    padding-left: 13px;
    color: #777;
    font-weight: 800;
}

.organization-handle-input input {
    flex: 1;
    min-width: 0;
    border: 0 !important;
    border-radius: 0 !important;
    padding-left: 4px !important;
    outline: none;
}

.settings-profile-avatar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border: 1px solid #ece8e2;
    border-radius: 14px;
    background: #faf9f6;
}

.settings-profile-avatar > img,
.settings-profile-avatar-fallback {
    width: 68px;
    height: 68px;
    flex: 0 0 68px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
}

.settings-profile-avatar-fallback {
    display: grid;
    place-items: center;
    background: #171717;
    color: #fff;
    font-size: 24px;
    font-weight: 800;
}

.settings-profile-avatar label {
    flex: 1;
}

.settings-form textarea {
    width: 100%;
    min-height: 110px;
    box-sizing: border-box;
    border: 1px solid #d8d4cc;
    border-radius: 12px;
    padding: 11px 12px;
    background: #fff;
    font: inherit;
    resize: vertical;
}

@media (max-width: 600px) {
    .settings-profile-avatar {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* =========================================================
   WANGLE 2.3.3 — SIDEBAR ICONS + SECOND ADMIN SPACING
========================================================= */

.side-drawer .nav-item,
.drawer-nav .nav-item,
.drawer-footer .nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    display: inline-grid;
    place-items: center;
}

.nav-icon svg {
    width: 20px;
    height: 20px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.side-drawer .nav-item:hover .nav-icon,
.drawer-nav .nav-item:hover .nav-icon,
.drawer-footer .nav-item:hover .nav-icon {
    transform: translateY(-1px);
}

.nav-icon {
    transition: transform .16s ease;
}

/* Secondary protected admin fields */
#secondAdminFields,
.secondary-admin-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

/* Fallback if the fields are not wrapped together */
input[name="second_admin_email"] {
    margin-top: 12px;
}

/* =========================================================
   WANGLE MESSAGE DELETE CONTROLS
========================================================= */

.message-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

.message-item.mine {
    align-items: flex-end;
}

.message-item.theirs {
    align-items: flex-start;
}

.message-item-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 3px;
}

.message-delete-button {
    appearance: none;
    border: none;
    background: transparent;
    color: #8d2730;
    padding: 2px 4px;
    font-size: 0.72rem;
    cursor: pointer;
    opacity: 0.72;
}

.message-delete-button:hover {
    opacity: 1;
    text-decoration: underline;
}

.message-delete-button:disabled {
    opacity: 0.4;
    cursor: default;
}


/* =========================================================
   WANGLE ALERT VIEW LABEL
========================================================= */

.notification-context {
    display: block;
    margin-top: 5px;
    font-size: 0.78rem;
    font-weight: 700;
    opacity: 0.72;
}

.activity-button {
    position: relative;
}

.activity-icon {
    display: inline-block;
}

.activity-dot {
    position: absolute;
    top: 4px;
    right: 4px;

    width: 9px;
    height: 9px;

    background: #d90429;
    border: 2px solid #fff;
    border-radius: 50%;
}

.activity-dot.hidden {
    display: none;
}
/* ========================================
   WANGLE 2.7 SHARED AGENDA
   These selectors are intentionally isolated
   to .agenda-* so existing Wangle styles,
   including comments and buttons, remain untouched.
======================================== */

.agenda-page {
    position: relative;
    left: 50%;
    width: min(1120px, calc(100vw - 36px));
    transform: translateX(-50%);
}

.agenda-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

.agenda-heading h1 {
    margin: 2px 0 4px;
    font-size: 30px;
    line-height: 1.05;
}

.agenda-heading p {
    margin: 0;
    color: #6d6d6d;
}

.agenda-eyebrow {
    color: #643071;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1.5px;
}

.agenda-month-switcher {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    border: 1px solid #d8d7d2;
    border-radius: 13px;
    overflow: hidden;
    background: #fff;
}

.agenda-month-switcher button {
    width: 42px;
    height: 42px;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 24px;
}

.agenda-month-switcher strong {
    min-width: 145px;
    padding: 0 8px;
    text-align: center;
    font-size: 13px;
}

.agenda-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 14px;
    align-items: start;
}

.agenda-list {
    display: grid;
    gap: 10px;
}

.agenda-loading,
.agenda-empty,
.agenda-error {
    padding: 24px;
    border: 1px solid #e3e2dd;
    border-radius: 16px;
    background: #fff;
}

.agenda-empty {
    display: grid;
    gap: 4px;
    color: #777;
}

.agenda-empty strong {
    color: #181818;
}

.agenda-error {
    color: #9d2525;
}

.agenda-item {
    display: grid;
    grid-template-columns: 84px minmax(0,1fr);
    min-height: 145px;
    overflow: hidden;
    border: 1px solid #e3e2dd;
    border-radius: 16px;
    background: #fff;
}

.agenda-date-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 14px 8px;
    background: #f2ba24;
    color: #181818;
}

.agenda-date-block span,
.agenda-date-block small {
    font-size: 10px;
    font-weight: 900;
}

.agenda-date-block strong {
    font-size: 28px;
    line-height: 1;
}

.agenda-priority-high .agenda-date-block {
    background: #ffbd1f;
}

.agenda-status-completed .agenda-date-block {
    background: #c98f27;
}

.agenda-item-body {
    min-width: 0;
    padding: 14px 16px;
}

.agenda-item-type {
    margin-bottom: 3px;
    color: #6a3177;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .6px;
    text-transform: uppercase;
}

.agenda-item h3 {
    margin: 0 0 5px;
    font-size: 17px;
    line-height: 1.25;
}

.agenda-item-completed h3 {
    text-decoration: line-through;
}

.agenda-item-notes {
    margin-bottom: 9px;
    color: #555;
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.agenda-meta-row,
.agenda-chip-row,
.agenda-card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.agenda-meta-row {
    margin-bottom: 7px;
}

.agenda-meta-row span {
    padding: 4px 7px;
    border-radius: 6px;
    background: #f1f0ec;
    color: #555;
    font-size: 11px;
    font-weight: 700;
}

.agenda-chip-row {
    margin-bottom: 7px;
}

.agenda-chip {
    padding: 4px 7px;
    border-radius: 6px;
    background: #efeee9;
    color: #555;
    font-size: 10px;
    font-weight: 800;
}

.agenda-chip-high {
    background: #fde0df;
    color: #a12b2b;
}

.agenda-chip-low {
    background: #e8f1e8;
    color: #3c6b3c;
}

.agenda-contributor {
    margin-bottom: 8px;
    color: #777;
    font-size: 11px;
}

.agenda-card-actions {
    padding-top: 2px;
}

.agenda-action {
    border: 1px solid #d6d4cf;
    border-radius: 7px;
    background: #fff;
    padding: 5px 8px;
    color: #333;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.agenda-delete {
    color: #9d2525;
}

.agenda-editor {
    overflow: hidden;
    border: 1px solid #e3e2dd;
    border-radius: 16px;
    background: #fff;
}

.agenda-editor-head {
    padding: 13px 14px;
    background: #341048;
    color: #fff;
}

.agenda-editor-head span {
    display: block;
    margin-bottom: 3px;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .8px;
}

.agenda-editor-head h2 {
    margin: 0;
    font-size: 16px;
}

.agenda-form {
    display: grid;
    gap: 10px;
    padding: 14px;
}

.agenda-form label {
    display: grid;
    gap: 5px;
}

.agenda-form label > span {
    font-size: 11px;
    font-weight: 800;
    color: #4b4b4b;
}

.agenda-form input,
.agenda-form select,
.agenda-form textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid #d5d3ce;
    border-radius: 8px;
    background: #fff;
    padding: 9px 10px;
    color: #181818;
    font: inherit;
    font-size: 13px;
    outline: none;
}

.agenda-form textarea {
    min-height: 100px;
    resize: vertical;
}

.agenda-field-pair {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(0,1fr);
    gap: 8px;
}

.agenda-form-actions {
    display: grid;
    gap: 7px;
}

.agenda-submit {
    min-height: 38px;
    border: 0;
    border-radius: 8px;
    background: #64256f;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.agenda-submit:disabled {
    opacity: .6;
    cursor: default;
}

.agenda-cancel {
    min-height: 34px;
    border: 1px solid #d6d4cf;
    border-radius: 8px;
    background: #fff;
    color: #555;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

@media (max-width: 820px) {
    .agenda-page {
        width: 100%;
        left: auto;
        transform: none;
    }

    .agenda-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .agenda-month-switcher {
        align-self: stretch;
        justify-content: space-between;
    }

    .agenda-month-switcher strong {
        flex: 1;
    }

    .agenda-layout {
        grid-template-columns: 1fr;
    }

    .agenda-editor {
        order: -1;
    }
}

@media (max-width: 520px) {
    .agenda-item {
        grid-template-columns: 66px minmax(0,1fr);
        min-height: 132px;
    }

    .agenda-date-block strong {
        font-size: 24px;
    }

    .agenda-item-body {
        padding: 12px;
    }

    .agenda-field-pair {
        grid-template-columns: 1fr;
    }
}
