/* =========================================================
   mypage.css
   STST My Page / Portal Layout
========================================================= */

body.mypage-page {
    margin: 0;
    min-width: 320px;
    background:
        radial-gradient(circle at top right,
            rgba(255, 207, 33, 0.16),
            transparent 34rem),
        repeating-linear-gradient(-45deg,
            #f5f3ee 0,
            #f5f3ee 14px,
            #eeece6 14px,
            #eeece6 28px);
    color: var(--stst-text, #282828);
}

.mypage-page button,
.mypage-page a {
    -webkit-tap-highlight-color: transparent;
}

.mypage-page button {
    font: inherit;
}

.mypage-shell {
    display: grid;
    grid-template-columns: 268px minmax(0, 1fr);
    min-height: 100vh;
}

/* =========================================================
   Sidebar
========================================================= */

.portal-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    border-right: 1px solid var(--stst-border, #e4e0d8);
    background: rgba(255, 253, 248, 0.94);
    backdrop-filter: blur(16px);
    z-index: 20;
}

.sidebar-brand {
    padding: 26px 22px 18px;
}

.sidebar-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: inherit;
    text-decoration: none;
}

.sidebar-brand-mark {
    display: grid;
    width: 39px;
    height: 39px;
    place-items: center;
    border-radius: 12px;
    background: var(--stst-charcoal, #252525);
    color: var(--stst-yellow, #ffcf21);
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.sidebar-brand-text strong {
    color: var(--stst-charcoal, #252525);
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    line-height: 1;
}

.sidebar-brand-text small {
    color: var(--stst-text-soft, #68707a);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.sidebar-user-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    width: calc(100% - 32px);
    margin: 2px 16px 19px;
    padding: 13px;
    border: 1px solid var(--stst-border, #e4e0d8);
    border-radius: 15px;
    background: var(--stst-surface, #fff);
    color: inherit;
    cursor: pointer;
    text-align: left;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.sidebar-user-card:hover {
    border-color: rgba(242, 106, 42, 0.45);
    box-shadow: 0 8px 20px rgba(38, 35, 30, 0.08);
    transform: translateY(-1px);
}

.sidebar-avatar {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 50%;
    background:
        linear-gradient(140deg,
            var(--stst-yellow, #ffcf21),
            #ffb90e);
    color: var(--stst-charcoal, #252525);
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 0.03em;
}

.sidebar-user-meta {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
}

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

.sidebar-user-meta strong {
    color: var(--stst-charcoal, #252525);
    font-size: 0.84rem;
    font-weight: 800;
}

.sidebar-user-meta span {
    color: var(--stst-text-soft, #68707a);
    font-size: 0.7rem;
}

.sidebar-user-card .status-chip {
    grid-column: 1 / -1;
    justify-self: start;
    margin-top: 3px;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

.status-chip[data-tone="neutral"] {
    border-color: #d7dce2;
    background: #f1f3f5;
    color: #58616b;
}

.status-chip[data-tone="warning"] {
    border-color: #f0d274;
    background: #fff5ca;
    color: #8b6100;
}

.status-chip[data-tone="danger"] {
    border-color: #efb3b3;
    background: #fff0f0;
    color: #bb3f3f;
}

.status-chip[data-tone="success"] {
    border-color: #a9dcc2;
    background: #edfbf3;
    color: #207a4c;
}

.sidebar-nav {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    padding: 0 12px 24px;
}

.sidebar-nav-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 0;
}

.sidebar-nav-group+.sidebar-nav-group {
    border-top: 1px solid var(--stst-border, #e4e0d8);
}

.sidebar-nav-label {
    margin: 0 10px 6px;
    color: #989da3;
    font-size: 0.61rem;
    font-weight: 900;
    letter-spacing: 0.11em;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #58616b;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 750;
    text-align: left;
    transition:
        background 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease;
}

.sidebar-nav-item:hover {
    background: #fff7d8;
    color: var(--stst-charcoal, #252525);
}

.sidebar-nav-item.is-active {
    background: var(--stst-charcoal, #252525);
    color: #fff;
    box-shadow: 0 8px 18px rgba(37, 37, 37, 0.14);
}

.nav-symbol {
    display: inline-grid;
    width: 20px;
    place-items: center;
    color: currentColor;
    font-size: 1rem;
    line-height: 1;
}

.nav-badge {
    display: inline-grid;
    min-width: 21px;
    height: 21px;
    margin-left: auto;
    padding: 0 5px;
    place-items: center;
    border-radius: 999px;
    background: var(--stst-orange, #f26a2a);
    color: #fff;
    font-size: 0.66rem;
    font-weight: 900;
}

.sidebar-nav-item.is-active .nav-badge {
    background: var(--stst-yellow, #ffcf21);
    color: var(--stst-charcoal, #252525);
}

.nav-external {
    margin-left: auto;
    font-size: 0.83rem;
}

.nav-status-text {
    margin-left: auto;
    color: currentColor;
    font-size: 0.66rem;
    font-weight: 800;
    opacity: 0.76;
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid var(--stst-border, #e4e0d8);
}

.sidebar-footer-link,
.sidebar-logout-button {
    min-height: 38px;
    padding: 9px 10px;
    border-radius: 9px;
    color: #68707a;
    font-size: 0.77rem;
    font-weight: 750;
    text-align: left;
    text-decoration: none;
}

.sidebar-footer-link {
    display: block;
    transition:
        background 0.18s ease,
        color 0.18s ease;
}

.sidebar-footer-link:hover {
    background: #f1eee7;
    color: var(--stst-charcoal, #252525);
}

.sidebar-logout-button {
    border: 0;
    background: transparent;
    cursor: pointer;
    transition:
        background 0.18s ease,
        color 0.18s ease;
}

.sidebar-logout-button:hover {
    background: #fff0f0;
    color: #bd4141;
}

/* =========================================================
   Main / Topbar
========================================================= */

.portal-main {
    min-width: 0;
    padding: 0 34px 50px;
}

.portal-topbar {
    display: flex;
    min-height: 108px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--stst-border, #e4e0d8);
}

.topbar-title-wrap {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.topbar-eyebrow,
.section-kicker {
    margin: 0;
    color: var(--stst-orange, #f26a2a);
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.1em;
}

.portal-topbar h1 {
    margin: 0;
    color: var(--stst-charcoal, #252525);
    font-size: clamp(1.55rem, 2vw, 2rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1.15;
}

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

.mobile-nav-button {
    display: none;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--stst-border, #e4e0d8);
    border-radius: 10px;
    background: var(--stst-surface, #fff);
    color: var(--stst-charcoal, #252525);
    cursor: pointer;
    font-size: 1.15rem;
    line-height: 1;
}

/* =========================================================
   Tabs / Common Cards
========================================================= */

.tab-panel {
    display: none;
    padding-top: 28px;
    animation: portalTabAppear 0.2s ease;
}

.tab-panel.is-active {
    display: block;
}

@keyframes portalTabAppear {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-card,
.home-hero-card,
.overview-card {
    border: 1px solid var(--stst-border, #e4e0d8);
    border-radius: 18px;
    background: var(--stst-surface, #fff);
    box-shadow: 0 10px 28px rgba(51, 43, 31, 0.045);
}

.content-card {
    padding: clamp(20px, 3vw, 30px);
}

.content-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.content-card-head h2,
.content-card-head h3 {
    margin: 5px 0 0;
    color: var(--stst-charcoal, #252525);
    font-size: clamp(1.25rem, 1.9vw, 1.55rem);
    font-weight: 900;
    letter-spacing: -0.03em;
}

.content-card-head p:not(.section-kicker) {
    max-width: 720px;
    margin: 9px 0 0;
    color: var(--stst-text-soft, #68707a);
    font-size: 0.88rem;
    line-height: 1.8;
}

.primary-button,
.secondary-button,
.primary-link-button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 850;
    text-decoration: none;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.primary-button,
.primary-link-button {
    border: 1px solid var(--stst-charcoal, #252525);
    background: var(--stst-charcoal, #252525);
    color: #fff;
}

.primary-button:hover:not(:disabled),
.primary-link-button:hover {
    background: #3b3b3b;
    box-shadow: 0 8px 20px rgba(37, 37, 37, 0.16);
    transform: translateY(-1px);
}

.secondary-button {
    border: 1px solid var(--stst-border, #e4e0d8);
    background: #fff;
    color: var(--stst-charcoal, #252525);
}

.secondary-button:hover:not(:disabled) {
    border-color: var(--stst-orange, #f26a2a);
    background: #fff8f2;
    color: #b8501f;
}

.primary-button:disabled,
.secondary-button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.text-action-button {
    width: fit-content;
    padding: 0;
    border: 0;
    background: transparent;
    color: #c45625;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 850;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* =========================================================
   Home
========================================================= */

.home-hero-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(210px, 280px);
    gap: 28px;
    overflow: hidden;
    padding: clamp(22px, 4vw, 38px);
    background:
        linear-gradient(125deg,
            #fffdf6,
            #fff8dd);
}

.home-hero-card h2 {
    margin: 8px 0 0;
    color: var(--stst-charcoal, #252525);
    font-size: clamp(1.38rem, 2.3vw, 2rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1.35;
}

.home-hero-card>div>p:not(.section-kicker) {
    max-width: 650px;
    margin: 12px 0 0;
    color: #66645d;
    font-size: 0.9rem;
    line-height: 1.85;
}

.home-status-summary {
    display: flex;
    align-self: stretch;
    flex-direction: column;
    justify-content: center;
    padding: 20px;
    border: 1px solid rgba(206, 178, 80, 0.32);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.72);
}

.summary-label {
    color: #85817a;
    font-size: 0.7rem;
    font-weight: 850;
    letter-spacing: 0.04em;
}

.home-status-summary strong {
    margin-top: 7px;
    color: var(--stst-charcoal, #252525);
    font-size: 1.24rem;
    font-weight: 900;
}

.home-status-summary span:last-child {
    margin-top: 7px;
    color: #726e65;
    font-size: 0.76rem;
    line-height: 1.7;
}

.home-overview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
    margin-top: 18px;
}

.overview-card {
    display: flex;
    min-height: 176px;
    flex-direction: column;
    padding: 19px;
}

.overview-card--listing {
    border-color: #ebcf75;
    background: linear-gradient(150deg, #fffdf7, #fff8de);
}

.overview-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #73716a;
    font-size: 0.76rem;
    font-weight: 800;
}

.overview-icon {
    display: inline-grid;
    width: 25px;
    height: 25px;
    place-items: center;
    border-radius: 8px;
    background: #f2f0ea;
    color: var(--stst-charcoal, #252525);
    font-size: 0.82rem;
}

.overview-card--listing .overview-icon {
    background: var(--stst-yellow, #ffcf21);
}

.overview-card>strong {
    margin-top: 16px;
    color: var(--stst-charcoal, #252525);
    font-size: 1.15rem;
    font-weight: 900;
}

.overview-card>p {
    flex: 1;
    margin: 7px 0 14px;
    color: var(--stst-text-soft, #68707a);
    font-size: 0.77rem;
    line-height: 1.7;
}

.feed-card {
    margin-top: 18px;
}

.feed-filter-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--stst-border, #e4e0d8);
    border-radius: 11px;
    background: #f8f7f3;
}

.feed-filter-button {
    min-height: 30px;
    padding: 5px 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #73777e;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 800;
}

.feed-filter-button:hover {
    color: var(--stst-charcoal, #252525);
}

.feed-filter-button.is-active {
    background: #fff;
    color: var(--stst-charcoal, #252525);
    box-shadow: 0 2px 7px rgba(40, 40, 40, 0.1);
}

.feed-list {
    display: flex;
    flex-direction: column;
}

.feed-item {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 13px;
    padding: 18px 0;
    border-bottom: 1px solid var(--stst-border, #e4e0d8);
}

.feed-item:first-child {
    padding-top: 0;
}

.feed-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.feed-item-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 50%;
    background: #f4f1e8;
    color: var(--stst-charcoal, #252525);
    font-size: 0.78rem;
    font-weight: 900;
}

.feed-item-content {
    min-width: 0;
}

.feed-item-content h3 {
    margin: 1px 0 0;
    color: var(--stst-charcoal, #252525);
    font-size: 0.89rem;
    font-weight: 850;
    line-height: 1.55;
}

.feed-item-content p {
    margin: 5px 0 0;
    color: var(--stst-text-soft, #68707a);
    font-size: 0.79rem;
    line-height: 1.72;
}

.feed-item-meta {
    margin-top: 7px;
    color: #9aa0a7;
    font-size: 0.68rem;
    font-weight: 700;
}

.feed-item-action {
    margin-top: 10px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #bd4e20;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 850;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.feed-empty-state,
.connection-empty-state {
    padding: 42px 18px;
    border: 1px dashed #d8d5ce;
    border-radius: 13px;
    background: #fdfcf9;
    text-align: center;
}

.feed-empty-state strong,
.connection-empty-state strong {
    display: block;
    color: var(--stst-charcoal, #252525);
    font-size: 0.89rem;
    font-weight: 850;
}

.feed-empty-state p,
.connection-empty-state p {
    max-width: 520px;
    margin: 8px auto 0;
    color: var(--stst-text-soft, #68707a);
    font-size: 0.78rem;
    line-height: 1.75;
}

/* =========================================================
   Connections
========================================================= */

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

.connection-summary-card {
    display: flex;
    min-height: 130px;
    flex-direction: column;
    justify-content: center;
    padding: 20px;
    border: 1px solid var(--stst-border, #e4e0d8);
    border-radius: 14px;
    background: #fcfbf8;
}

.connection-summary-card span {
    color: #7c8188;
    font-size: 0.76rem;
    font-weight: 800;
}

.connection-summary-card strong {
    margin-top: 4px;
    color: var(--stst-charcoal, #252525);
    font-size: 2rem;
    font-weight: 900;
}

.connection-summary-card small {
    margin-top: 4px;
    color: var(--stst-text-soft, #68707a);
    font-size: 0.73rem;
    line-height: 1.6;
}

.subtab-row {
    display: flex;
    gap: 4px;
    margin-top: 25px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--stst-border, #e4e0d8);
}

.subtab-button {
    min-height: 35px;
    padding: 7px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #747980;
    cursor: pointer;
    font-size: 0.77rem;
    font-weight: 850;
}

.subtab-button.is-active {
    background: var(--stst-charcoal, #252525);
    color: #fff;
}

.connection-list {
    margin-top: 18px;
}

/* =========================================================
   Account
========================================================= */

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

.account-data-card,
.private-data-card {
    padding: 20px;
    border: 1px solid var(--stst-border, #e4e0d8);
    border-radius: 14px;
    background: #fff;
}

.account-data-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.account-data-card-head h3 {
    margin: 0;
    color: var(--stst-charcoal, #252525);
    font-size: 0.93rem;
    font-weight: 900;
}

.account-data-card-head a {
    color: #bb5122;
    font-size: 0.72rem;
    font-weight: 850;
    text-decoration: none;
}

.account-data-card-head a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.account-data-card-head p {
    margin: 6px 0 0;
    color: var(--stst-text-soft, #68707a);
    font-size: 0.75rem;
    line-height: 1.72;
}

.data-list {
    display: grid;
    gap: 0;
    margin: 16px 0 0;
}

.data-list>div {
    display: grid;
    grid-template-columns: minmax(100px, 0.72fr) minmax(0, 1.4fr);
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid #eeece6;
}

.data-list>div:last-child {
    border-bottom: 0;
}

.data-list dt {
    color: #83878d;
    font-size: 0.73rem;
    font-weight: 800;
}

.data-list dd {
    min-width: 0;
    margin: 0;
    color: var(--stst-charcoal, #252525);
    font-size: 0.78rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.private-data-card {
    margin-top: 16px;
    border-color: #dbe0e4;
    background: #fafbfc;
}

.private-badge {
    display: inline-flex;
    margin-left: 5px;
    padding: 2px 6px;
    border-radius: 5px;
    background: #e8edf1;
    color: #66717b;
    font-size: 0.62rem;
    font-weight: 850;
    letter-spacing: 0.04em;
    vertical-align: 2px;
}

.data-list--three-col {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 22px;
}

.data-list--three-col>div {
    display: block;
}

.data-list--three-col dt {
    margin-bottom: 5px;
}

.data-list--three-col .data-list-wide {
    grid-column: 1 / -1;
}

/* =========================================================
   External Settings / Billing
========================================================= */

.external-settings-card {
    max-width: 860px;
    padding: clamp(28px, 5vw, 54px);
    text-align: center;
}

.external-card-icon {
    display: grid;
    width: 54px;
    height: 54px;
    margin: 0 auto 16px;
    place-items: center;
    border-radius: 16px;
    background: var(--stst-charcoal, #252525);
    color: var(--stst-yellow, #ffcf21);
    font-size: 1.2rem;
}

.external-settings-card h2 {
    margin: 7px 0 0;
    color: var(--stst-charcoal, #252525);
    font-size: clamp(1.35rem, 2vw, 1.7rem);
    font-weight: 900;
    letter-spacing: -0.03em;
}

.external-settings-card>p:not(.section-kicker) {
    max-width: 600px;
    margin: 12px auto 0;
    color: var(--stst-text-soft, #68707a);
    font-size: 0.87rem;
    line-height: 1.85;
}

.external-settings-card .primary-link-button {
    margin-top: 24px;
}

.billing-summary-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    max-width: 560px;
    margin: 24px auto 0;
}

.billing-summary-row>div {
    display: flex;
    min-height: 88px;
    flex-direction: column;
    justify-content: center;
    padding: 14px;
    border: 1px solid var(--stst-border, #e4e0d8);
    border-radius: 12px;
    background: #fcfbf8;
    text-align: left;
}

.billing-summary-row span {
    color: #81858a;
    font-size: 0.72rem;
    font-weight: 800;
}

.billing-summary-row strong {
    margin-top: 6px;
    color: var(--stst-charcoal, #252525);
    font-size: 0.9rem;
    font-weight: 900;
}

/* =========================================================
   Affiliations
========================================================= */

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

.affiliation-card {
    display: flex;
    min-height: 208px;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    border: 1px solid var(--stst-border, #e4e0d8);
    border-radius: 14px;
    background: #fcfbf8;
}

.affiliation-card-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.affiliation-icon {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 10px;
    background: #f2efe7;
    color: var(--stst-charcoal, #252525);
    font-size: 1rem;
}

.affiliation-card h3 {
    margin: 1px 0 0;
    color: var(--stst-charcoal, #252525);
    font-size: 0.95rem;
    font-weight: 900;
}

.affiliation-card p {
    margin: 6px 0 0;
    color: var(--stst-text-soft, #68707a);
    font-size: 0.77rem;
    line-height: 1.7;
}

.affiliation-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.affiliation-actions .secondary-button {
    min-height: 37px;
    padding: 8px 11px;
    font-size: 0.74rem;
}

.pending-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 18px;
    padding: 16px 18px;
    border: 1px dashed #d5d5d0;
    border-radius: 12px;
    background: #faf9f6;
}

.pending-box strong {
    color: var(--stst-charcoal, #252525);
    font-size: 0.8rem;
    font-weight: 900;
}

.pending-box span {
    color: var(--stst-text-soft, #68707a);
    font-size: 0.75rem;
    text-align: right;
}

/* =========================================================
   Listing
========================================================= */

.listing-status-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 0.8fr);
    gap: 26px;
    padding: clamp(20px, 3vw, 28px);
    border: 1px solid #e5cf81;
    border-radius: 15px;
    background:
        linear-gradient(130deg,
            #fffdf6,
            #fff7da);
}

.listing-status-card h3 {
    margin: 7px 0 0;
    color: var(--stst-charcoal, #252525);
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    font-weight: 900;
    letter-spacing: -0.03em;
}

.listing-status-card p {
    margin: 8px 0 0;
    color: #6e6b62;
    font-size: 0.82rem;
    line-height: 1.75;
}

.listing-mini-data {
    display: grid;
    align-content: center;
    gap: 8px;
    margin: 0;
}

.listing-mini-data>div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(185, 153, 48, 0.2);
}

.listing-mini-data>div:last-child {
    border-bottom: 0;
}

.listing-mini-data dt {
    color: #7b776d;
    font-size: 0.74rem;
    font-weight: 800;
}

.listing-mini-data dd {
    margin: 0;
    color: var(--stst-charcoal, #252525);
    font-size: 0.78rem;
    font-weight: 850;
    text-align: right;
}

.listing-action-hint {
    margin: 15px 0 0;
    color: var(--stst-text-soft, #68707a);
    font-size: 0.8rem;
    line-height: 1.75;
}

.listing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 18px;
}

.listing-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 13px;
    margin-top: 26px;
}

.listing-stat-card {
    display: flex;
    min-height: 132px;
    flex-direction: column;
    justify-content: center;
    padding: 18px;
    border: 1px solid var(--stst-border, #e4e0d8);
    border-radius: 13px;
    background: #fcfbf8;
}

.listing-stat-card span {
    color: #7b8087;
    font-size: 0.74rem;
    font-weight: 800;
}

.listing-stat-card strong {
    margin-top: 5px;
    color: var(--stst-charcoal, #252525);
    font-size: 1.7rem;
    font-weight: 900;
}

.listing-stat-card small {
    margin-top: 5px;
    color: var(--stst-text-soft, #68707a);
    font-size: 0.7rem;
    line-height: 1.6;
}

/* =========================================================
   Toast
========================================================= */

.portal-toast {
    position: fixed;
    z-index: 70;
    right: 22px;
    bottom: 22px;
    max-width: min(390px, calc(100vw - 36px));
    padding: 13px 16px;
    border: 1px solid rgba(37, 37, 37, 0.1);
    border-radius: 11px;
    background: rgba(37, 37, 37, 0.95);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.65;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

.portal-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================================
   Responsive
========================================================= */

@media (max-width: 1100px) {
    .mypage-shell {
        grid-template-columns: 238px minmax(0, 1fr);
    }

    .portal-main {
        padding-right: 24px;
        padding-left: 24px;
    }

    .sidebar-brand {
        padding-right: 17px;
        padding-left: 17px;
    }

    .sidebar-user-card {
        width: calc(100% - 24px);
        margin-right: 12px;
        margin-left: 12px;
    }

    .sidebar-nav {
        padding-right: 8px;
        padding-left: 8px;
    }
}

@media (max-width: 900px) {
    .mypage-shell {
        display: block;
    }

    .portal-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: min(290px, calc(100vw - 54px));
        min-height: 100dvh;
        box-shadow: 16px 0 35px rgba(38, 34, 28, 0.13);
        transform: translateX(-104%);
        transition: transform 0.22s ease;
    }

    .portal-sidebar.is-open {
        transform: translateX(0);
    }

    .portal-main {
        padding: 0 18px 42px;
    }

    .portal-topbar {
        min-height: 84px;
    }

    .mobile-nav-button {
        display: inline-grid;
        place-items: center;
    }

    .home-hero-card,
    .listing-status-card {
        grid-template-columns: 1fr;
    }

    .home-status-summary {
        min-height: 0;
    }
}

@media (max-width: 720px) {
    .portal-main {
        padding-right: 14px;
        padding-left: 14px;
    }

    .tab-panel {
        padding-top: 17px;
    }

    .portal-topbar {
        min-height: 76px;
    }

    .portal-topbar h1 {
        font-size: 1.4rem;
    }

    .topbar-status {
        display: none;
    }

    .topbar-actions .status-chip {
        display: none;
    }

    .content-card {
        padding: 18px;
        border-radius: 14px;
    }

    .content-card-head {
        flex-direction: column;
        margin-bottom: 18px;
    }

    .home-hero-card {
        gap: 18px;
        padding: 22px 19px;
        border-radius: 14px;
    }

    .home-overview-grid,
    .account-section-grid,
    .affiliation-grid,
    .listing-stats-grid {
        grid-template-columns: 1fr;
    }

    .connection-summary-grid,
    .billing-summary-row {
        grid-template-columns: 1fr;
    }

    .feed-filter-tabs {
        width: 100%;
    }

    .feed-filter-button {
        flex: 1;
        padding-right: 7px;
        padding-left: 7px;
    }

    .data-list--three-col {
        grid-template-columns: 1fr;
    }

    .data-list--three-col .data-list-wide {
        grid-column: auto;
    }

    .data-list>div,
    .data-list--three-col>div {
        grid-template-columns: minmax(86px, 0.8fr) minmax(0, 1.35fr);
    }

    .data-list--three-col>div {
        display: grid;
    }

    .data-list--three-col dt {
        margin-bottom: 0;
    }

    .pending-box {
        align-items: flex-start;
        flex-direction: column;
    }

    .pending-box span {
        text-align: left;
    }

    .listing-mini-data {
        border-top: 1px solid rgba(185, 153, 48, 0.2);
        padding-top: 8px;
    }

    .listing-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .listing-actions .primary-button,
    .listing-actions .secondary-button {
        width: 100%;
    }

    .external-settings-card {
        padding: 30px 18px;
    }

    .portal-toast {
        right: 14px;
        bottom: 14px;
    }
}

@media (max-width: 430px) {
    .topbar-eyebrow {
        font-size: 0.57rem;
    }

    .portal-topbar h1 {
        font-size: 1.28rem;
    }

    .home-hero-card h2 {
        font-size: 1.24rem;
    }

    .home-status-summary {
        padding: 16px;
    }

    .feed-item {
        grid-template-columns: 36px minmax(0, 1fr);
        gap: 10px;
    }

    .feed-item-icon {
        width: 36px;
        height: 36px;
        font-size: 0.7rem;
    }

    .data-list>div,
    .data-list--three-col>div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .listing-status-card {
        padding: 18px;
    }
}

/* =========================================================
   Fan Club
========================================================= */

.fanclub-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.fanclub-panel-heading h2 {
    margin: 5px 0 0;
    color: var(--stst-charcoal, #252525);
    font-size: clamp(1.35rem, 2vw, 1.75rem);
    font-weight: 900;
    letter-spacing: -0.04em;
}

.fanclub-panel-heading p:not(.section-kicker) {
    max-width: 720px;
    margin: 9px 0 0;
    color: var(--stst-text-soft, #68707a);
    font-size: .84rem;
    line-height: 1.8;
}

.fanclub-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 16px;
    align-items: start;
}

.fanclub-owner-card,
.fanclub-joined-card {
    min-height: 100%;
}

.fanclub-owner-area {
    display: grid;
    gap: 16px;
}

.fanclub-owner-status {
    display: inline-flex;
    width: fit-content;
    min-height: 26px;
    align-items: center;
    padding: 4px 9px;
    border: 1px solid #d5d9dd;
    border-radius: 999px;
    background: #f1f3f5;
    color: #59626b;
    font-size: .72rem;
    font-weight: 850;
}

.fanclub-owner-status.is-published {
    border-color: #a9dcc2;
    background: #edfbf3;
    color: #207a4c;
}

.fanclub-owner-status.is-draft {
    border-color: #efcf80;
    background: #fff8de;
    color: #85610d;
}

.fanclub-owner-copy h3 {
    margin: 0;
    color: var(--stst-charcoal, #252525);
    font-size: 1.12rem;
    font-weight: 900;
    line-height: 1.45;
}

.fanclub-owner-copy p {
    margin: 7px 0 0;
    color: var(--stst-text-soft, #68707a);
    font-size: .78rem;
    line-height: 1.75;
}

.fanclub-owner-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}

.fanclub-owner-stat {
    display: grid;
    min-height: 76px;
    align-content: center;
    gap: 4px;
    padding: 12px;
    border: 1px solid #e8e4dc;
    border-radius: 11px;
    background: #fcfbf8;
}

.fanclub-owner-stat span {
    color: #81868d;
    font-size: .69rem;
    font-weight: 800;
}

.fanclub-owner-stat strong {
    color: var(--stst-charcoal, #252525);
    font-size: 1.18rem;
    font-weight: 900;
}

.fanclub-owner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.fanclub-primary-button,
.fanclub-secondary-button,
.joined-fanclub-open {
    display: inline-flex;
    min-height: 39px;
    align-items: center;
    justify-content: center;
    padding: 8px 13px;
    border-radius: 10px;
    cursor: pointer;
    font-size: .77rem;
    font-weight: 850;
    text-decoration: none;
}

.fanclub-primary-button {
    border: 1px solid var(--stst-charcoal, #252525);
    background: var(--stst-charcoal, #252525);
    color: #fff;
}

.fanclub-primary-button:hover {
    background: #3b3b3b;
}

.fanclub-secondary-button,
.joined-fanclub-open {
    border: 1px solid var(--stst-border, #e4e0d8);
    background: #fff;
    color: var(--stst-charcoal, #252525);
}

.fanclub-secondary-button:hover,
.joined-fanclub-open:hover {
    border-color: #db936d;
    background: #fff7f1;
    color: #b84f22;
}

.fanclub-count-badge {
    display: inline-grid;
    min-width: 34px;
    height: 28px;
    place-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--stst-charcoal, #252525);
    color: #fff;
    font-size: .75rem;
    font-weight: 900;
}

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

.joined-fanclub-row {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    min-height: 88px;
    overflow: hidden;
    padding: 10px;
    border: 1px solid var(--stst-border, #e4e0d8);
    border-radius: 13px;
    background: #fff;
}

.joined-fanclub-image {
    width: 68px;
    height: 68px;
    overflow: hidden;
    border-radius: 10px;
    background:
        linear-gradient(135deg,
            #f0ebe4,
            #dad6ce);
}

.joined-fanclub-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.joined-fanclub-image span {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    color: #676b71;
    font-size: .68rem;
    font-weight: 900;
}

.joined-fanclub-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.joined-fanclub-copy strong,
.joined-fanclub-copy p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.joined-fanclub-copy strong {
    color: var(--stst-charcoal, #252525);
    font-size: .87rem;
    font-weight: 900;
}

.joined-fanclub-copy p {
    margin: 0;
    color: var(--stst-text-soft, #68707a);
    font-size: .73rem;
}

.joined-fanclub-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 3px;
}

.joined-fanclub-plan,
.joined-fanclub-date,
.joined-fanclub-unavailable {
    display: inline-flex;
    min-height: 21px;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: .64rem;
    font-weight: 850;
}

.joined-fanclub-plan {
    background: #f0f2f4;
    color: #56616b;
}

.joined-fanclub-plan[data-tier="1"],
.joined-fanclub-plan[data-tier="2"],
.joined-fanclub-plan[data-tier="3"] {
    background: #fff0cb;
    color: #895e00;
}

.joined-fanclub-date {
    background: #f8f7f3;
    color: #7d838a;
}

.joined-fanclub-unavailable {
    background: #fff0f0;
    color: #ad4a4a;
}

.fanclub-empty-state {
    padding: 30px 16px;
    border: 1px dashed #d8d5ce;
    border-radius: 13px;
    background: #fdfcf9;
    text-align: center;
}

.fanclub-empty-state strong {
    display: block;
    color: var(--stst-charcoal, #252525);
    font-size: .88rem;
    font-weight: 850;
}

.fanclub-empty-state p {
    max-width: 500px;
    margin: 8px auto 0;
    color: var(--stst-text-soft, #68707a);
    font-size: .77rem;
    line-height: 1.75;
}

@media (max-width: 980px) {
    .fanclub-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .fanclub-owner-stats {
        grid-template-columns: 1fr 1fr;
    }

    .fanclub-owner-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .fanclub-primary-button,
    .fanclub-secondary-button {
        width: 100%;
    }

    .joined-fanclub-row {
        grid-template-columns: 58px minmax(0, 1fr);
    }

    .joined-fanclub-image {
        width: 58px;
        height: 58px;
    }

    .joined-fanclub-open,
    .joined-fanclub-unavailable {
        grid-column: 1 / -1;
        justify-self: start;
    }
}

/* =========================================================
   Social / Connections
========================================================= */
.connection-summary-grid--four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.connection-summary-grid--four .connection-summary-card {
    min-height: 112px;
    padding: 16px;
}

.social-subtab-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 25px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--stst-border, #e4e0d8);
}

.social-subtab-button {
    min-height: 36px;
    padding: 7px 13px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #747980;
    cursor: pointer;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 850;
}

.social-subtab-button.is-active {
    background: var(--stst-charcoal, #252525);
    color: #fff;
}

.connection-view-intro {
    min-height: 1.4em;
    margin-top: 16px;
    color: var(--stst-text-soft, #68707a);
    font-size: 0.8rem;
}

.connection-list {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.social-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--stst-border, #e4e0d8);
    border-radius: 13px;
    background: #fff;
}

.social-list-avatar {
    display: grid;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    overflow: hidden;
    place-items: center;
    border-radius: 12px;
    background: #f0ede5;
    color: #565a60;
    font-size: 0.8rem;
    font-weight: 900;
}

.social-list-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.social-list-copy {
    min-width: 0;
    flex: 1;
}

.social-list-copy strong,
.social-list-copy span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.social-list-copy strong {
    color: var(--stst-charcoal, #252525);
    font-size: 0.88rem;
    font-weight: 850;
}

.social-list-copy span {
    margin-top: 2px;
    color: var(--stst-text-soft, #68707a);
    font-size: 0.73rem;
}

.social-list-meta {
    flex: 0 0 auto;
    color: #8a8e94;
    font-size: 0.7rem;
}

.social-list-link {
    flex: 0 0 auto;
    padding: 7px 10px;
    border: 1px solid var(--stst-border, #e4e0d8);
    border-radius: 8px;
    background: #fff;
    color: #40454b;
    text-decoration: none;
    font-size: 0.74rem;
    font-weight: 800;
}

.social-list-link:hover {
    background: #f7f3e9;
}

.connect-info-panel {
    margin-top: 16px;
    padding: 18px;
    border: 1px solid #ddd5c8;
    border-radius: 15px;
    background: linear-gradient(145deg, #fffaf0, #fff);
}

.connect-info-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.connect-info-panel-head h3 {
    margin: 3px 0 0;
    color: var(--stst-charcoal, #252525);
    font-size: 1rem;
}

.connect-info-panel-head p:not(.section-kicker) {
    margin: 7px 0 0;
    color: var(--stst-text-soft, #68707a);
    font-size: 0.78rem;
    line-height: 1.65;
}

.connect-slot-status {
    margin-top: 14px;
    padding: 12px 13px;
    border-radius: 10px;
    background: rgba(255, 207, 33, 0.14);
}

.connect-slot-status strong {
    color: #503a00;
    font-size: 0.82rem;
}

.connect-slot-status p {
    margin: 5px 0 0;
    color: #60594a;
    font-size: 0.73rem;
    line-height: 1.65;
}

.connect-info-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.connect-info-preview-item {
    padding: 11px;
    border: 1px solid #e6e1d7;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.88);
}

.connect-info-preview-item strong,
.connect-info-preview-item span,
.connect-info-preview-item small {
    display: block;
}

.connect-info-preview-item strong {
    color: #32363b;
    font-size: 0.8rem;
}

.connect-info-preview-item span {
    margin-top: 3px;
    color: #61666d;
    font-size: 0.73rem;
    overflow-wrap: anywhere;
}

.connect-info-preview-item small {
    margin-top: 5px;
    color: #8a8e94;
    font-size: 0.68rem;
    line-height: 1.55;
}

/* =========================================================
   Connect profile modal
========================================================= */
.portal-modal[hidden] {
    display: none;
}

.portal-modal {
    position: fixed;
    z-index: 140;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 18px;
}

.portal-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(23, 25, 29, 0.56);
}

.portal-modal-card {
    position: relative;
    z-index: 1;
    display: flex;
    width: min(760px, 100%);
    max-height: min(820px, calc(100dvh - 36px));
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 18px;
    background: #fffdf8;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.portal-modal-card--confirm {
    width: min(510px, 100%);
}

.portal-modal-head,
.portal-modal-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 17px 20px;
}

.portal-modal-head {
    border-bottom: 1px solid var(--stst-border, #e4e0d8);
}

.portal-modal-head h2 {
    margin: 2px 0 0;
    color: var(--stst-charcoal, #252525);
    font-size: 1.05rem;
}

.portal-modal-foot {
    justify-content: flex-end;
    border-top: 1px solid var(--stst-border, #e4e0d8);
}

.icon-close-button {
    display: grid;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--stst-border, #e4e0d8);
    border-radius: 9px;
    background: #fff;
    color: #4f545a;
    cursor: pointer;
    font-size: 1.25rem;
}

.connect-profile-modal-body,
.portal-modal-confirm-body {
    overflow-y: auto;
    padding: 20px;
}

.connect-profile-modal-summary {
    padding: 13px;
    border-radius: 12px;
    background: #f7f4ed;
}

.connect-profile-modal-summary strong {
    color: #42391f;
    font-size: 0.84rem;
}

.connect-profile-modal-summary p {
    margin: 5px 0 0;
    color: #686d74;
    font-size: 0.75rem;
    line-height: 1.65;
}

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

.connect-field-editor-list {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.connect-field-editor-card {
    padding: 14px;
    border: 1px solid var(--stst-border, #e4e0d8);
    border-radius: 13px;
    background: #fff;
}

.connect-field-editor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.connect-field-editor-head strong {
    color: #42464c;
    font-size: 0.82rem;
}

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

.connect-field-editor-grid label {
    display: grid;
    gap: 5px;
    color: #656a72;
    font-size: 0.72rem;
    font-weight: 760;
}

.connect-field-editor-grid label.is-wide {
    grid-column: 1 / -1;
}

.connect-field-editor-grid input,
.connect-field-editor-grid textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #dcd8cf;
    border-radius: 8px;
    background: #fffefb;
    color: #2d3136;
    font: inherit;
    font-size: 0.82rem;
}

.connect-field-editor-grid input {
    min-height: 36px;
    padding: 7px 9px;
}

.connect-field-editor-grid textarea {
    min-height: 72px;
    padding: 8px 9px;
    resize: vertical;
}

.connect-field-delete-button {
    padding: 6px 9px;
    border: 1px solid #e8c4bd;
    border-radius: 7px;
    background: #fff9f7;
    color: #b54432;
    cursor: pointer;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 800;
}

.portal-modal-confirm-body p {
    margin: 0;
    color: #4f555c;
    line-height: 1.75;
}

.portal-modal-confirm-body .modal-warning-text {
    margin-top: 12px;
    padding: 11px;
    border-radius: 10px;
    background: #fff5e7;
    color: #724e19;
    font-size: 0.8rem;
}

@media (max-width: 920px) {
    .connection-summary-grid--four {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .connection-summary-grid--four {
        grid-template-columns: 1fr 1fr;
    }

    .connect-info-panel-head {
        flex-direction: column;
    }

    .connect-info-panel-head .secondary-button {
        width: 100%;
    }

    .portal-modal {
        padding: 10px;
    }

    .portal-modal-head,
    .portal-modal-foot {
        padding: 14px;
    }

    .connect-profile-modal-body,
    .portal-modal-confirm-body {
        padding: 14px;
    }

    .connect-field-editor-grid {
        grid-template-columns: 1fr;
    }

    .connect-field-editor-grid label.is-wide {
        grid-column: auto;
    }
}

/* =========================================================
   STST Connect requests
========================================================= */
.connect-request-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.connect-request-card {
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--stst-border, #e4e0d8);
    border-radius: 14px;
    background: #fcfbf8;
}

.connect-request-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(37, 37, 37, 0.08);
}

.connect-request-card-head .section-kicker {
    margin: 0;
}

.connect-request-card-head h3 {
    margin: 4px 0 0;
    color: var(--stst-charcoal, #252525);
    font-size: 0.95rem;
    font-weight: 900;
}

.connect-request-card-head>strong {
    flex: 0 0 auto;
    padding: 5px 8px;
    border-radius: 999px;
    background: #f2efe7;
    color: #5e625f;
    font-size: 0.68rem;
    font-weight: 900;
}

.connect-request-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.connect-request-list .social-list-item {
    min-height: 0;
    padding: 10px;
    border-radius: 11px;
    background: #fff;
    box-shadow: none;
}

.social-list-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.social-list-action-button {
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid var(--stst-border, #e4e0d8);
    border-radius: 8px;
    background: #fff;
    color: var(--stst-charcoal, #252525);
    cursor: pointer;
    font: inherit;
    font-size: 0.71rem;
    font-weight: 850;
}

.social-list-action-button:hover {
    background: #f4f1e9;
}

.social-list-action-button--primary {
    border-color: var(--stst-charcoal, #252525);
    background: var(--stst-charcoal, #252525);
    color: #fff;
}

.social-list-action-button--primary:hover {
    background: #3b3b3b;
}

.social-list-action-button--danger {
    color: #a33939;
}

.social-list-action-button:disabled {
    cursor: wait;
    opacity: 0.62;
}

@media (max-width: 720px) {
    .connect-request-panel {
        grid-template-columns: 1fr;
    }

    .social-list-item {
        align-items: flex-start;
    }

    .social-list-actions {
        width: 100%;
        margin-top: 4px;
        justify-content: flex-start;
    }
}

/* お知らせ */
.notification-page-head {
    align-items: center;
}

.notification-list .feed-item {
    position: relative;
}

.notification-list .feed-item.is-unread {
    border-color: rgba(240, 188, 8, 0.58);
    background: linear-gradient(95deg, rgba(255, 242, 177, 0.52), rgba(255, 255, 255, 0.96));
}

.notification-list .feed-item.is-unread::after {
    content: "未読";
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 3px 7px;
    border-radius: 999px;
    background: #2f3136;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
}

@media (max-width: 620px) {
    .notification-page-head {
        align-items: flex-start;
    }
}

/* ===== Event pages ===== */
.event-dashboard-head {
    align-items: flex-start;
}

.event-dashboard-note {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    align-items: center;
    margin: 0 0 18px;
    padding: 12px 14px;
    border: 1px solid #ead9c6;
    border-radius: 10px;
    color: #71502b;
    background: #fff8ed;
    font-size: .84rem;
}

.event-dashboard-note strong {
    color: #9d551d;
}

.event-dashboard-list {
    display: grid;
    gap: 11px;
}

.event-dashboard-event {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr) auto;
    gap: 13px;
    align-items: center;
    padding: 12px;
    border: 1px solid #e7dfe9;
    border-radius: 11px;
    background: #fcfbfd;
}

.event-dashboard-thumb {
    width: 82px;
    aspect-ratio: 9/11;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #84738d;
    background: #eee8f0;
    font-size: .74rem;
    text-align: center;
}

.event-dashboard-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.event-dashboard-copy {
    min-width: 0;
}

.event-dashboard-copy strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-dashboard-copy p {
    margin: 4px 0 0;
    color: #7a6d82;
    font-size: .8rem;
}

.event-dashboard-copy small {
    color: #9a879f;
    font-size: .74rem;
}

.event-dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.event-dashboard-actions a {
    text-decoration: none;
}

.event-create-modal-card {
    width: min(680px, calc(100vw - 30px));
}

.event-create-modal-body {
    padding: 18px 22px;
}

.event-create-owner-field {
    display: grid;
    gap: 6px;
    margin-bottom: 18px;
    font-size: .83rem;
    font-weight: 800;
}

.event-create-owner-field select {
    width: 100%;
    border: 1px solid #ded2e4;
    border-radius: 8px;
    padding: 10px;
    background: #fff;
}

.event-create-entitlement-lead {
    margin: 0 0 10px;
    color: #55435d;
    font-weight: 800;
}

.event-create-entitlement-list {
    display: grid;
    gap: 9px;
}

.event-create-entitlement-option {
    width: 100%;
    display: grid;
    gap: 4px;
    padding: 13px;
    border: 1px solid #dfd3e5;
    border-radius: 10px;
    color: #44334d;
    background: #fff;
    text-align: left;
    cursor: pointer;
}

.event-create-entitlement-option:hover:not(:disabled) {
    background: #fcf8fd;
    border-color: #9964a5;
}

.event-create-entitlement-option.is-selected {
    border-color: #d46228;
    box-shadow: 0 0 0 3px rgba(212, 98, 40, .12);
}

.event-create-entitlement-option:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.event-create-entitlement-option strong {
    font-size: .92rem;
}

.event-create-entitlement-option span {
    color: #796b82;
    font-size: .8rem;
}

.event-create-entitlement-option small {
    color: #96602c;
    font-weight: 800;
}

.event-create-empty {
    padding: 24px;
    border: 1px dashed #d6c6dc;
    border-radius: 10px;
    color: #74657b;
    text-align: center;
}

.event-create-message {
    min-height: 1.4em;
    margin: 14px 0 0;
    color: #8b3d42;
    font-size: .83rem;
}

@media (max-width: 720px) {
    .event-dashboard-head {
        flex-direction: column;
    }

    .event-dashboard-head .primary-button {
        width: 100%;
    }

    .event-dashboard-event {
        grid-template-columns: 60px minmax(0, 1fr);
    }

    .event-dashboard-thumb {
        width: 60px;
    }

    .event-dashboard-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

.event-dashboard-actions .danger-button {
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid #e5b8be;
    border-radius: 8px;
    color: #a22f3a;
    background: #fff7f7;
    font-weight: 700;
}

.event-dashboard-actions .danger-button:hover {
    background: #ffecee;
}


/* Event page guideline modal */
.event-dashboard-header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.event-guidelines-modal-card {
    width: min(760px, calc(100vw - 30px));
}

.event-guidelines-modal-body {
    max-height: min(66vh, 620px);
    overflow: auto;
    padding: 18px 22px 22px;
}

.event-guidelines-lead {
    margin: 0 0 18px;
    color: #5f5266;
    line-height: 1.7;
}

.event-guidelines-section {
    margin: 18px 0;
    padding: 15px 16px;
    border: 1px solid #e7dfe9;
    border-radius: 10px;
    background: #fcfbfd;
}

.event-guidelines-section h3 {
    margin: 0 0 10px;
    color: #483352;
    font-size: .95rem;
}

.event-guidelines-section ul {
    display: grid;
    gap: 8px;
    margin: 0;
    padding-left: 1.25em;
    color: #5d4e65;
    line-height: 1.6;
    font-size: .86rem;
}

.event-guidelines-section:first-of-type {
    border-color: #efc3c7;
    background: #fff8f8;
}

.event-guidelines-section:first-of-type h3 {
    color: #9b313d;
}

.event-guidelines-note {
    margin: 16px 0 0;
    color: #756178;
    font-size: .82rem;
    line-height: 1.6;
}

@media (max-width: 720px) {
    .event-dashboard-header-actions {
        width: 100%;
        justify-content: stretch;
    }

    .event-dashboard-header-actions>button {
        flex: 1 1 160px;
    }

    .event-guidelines-modal-body {
        max-height: 62vh;
        padding: 16px;
    }
}


/* Event entitlement summary and per-event entitlement states */
.event-entitlement-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 16px;
}

.event-entitlement-summary-card {
    display: grid;
    gap: 4px;
    min-height: 104px;
    padding: 15px 16px;
    border: 1px solid #e6dfea;
    border-radius: 12px;
    background: #fcfbfd;
}

.event-entitlement-summary-card>span {
    color: #6e5e76;
    font-size: .78rem;
    font-weight: 800;
}

.event-entitlement-summary-card>strong {
    color: #3f3048;
    font-size: 1.2rem;
    line-height: 1.2;
}

.event-entitlement-summary-card>small {
    color: #81728a;
    font-size: .75rem;
    line-height: 1.45;
}

.event-entitlement-summary-card--plus {
    border-color: #cab7ed;
    background: #faf7ff;
}

.event-entitlement-summary-card--plus>strong {
    color: #69459b;
}

.event-entitlement-summary-card--additional {
    border-color: #edcf9f;
    background: #fffaf2;
}

.event-entitlement-summary-card--additional>strong {
    color: #a75d20;
}

.event-dashboard-event {
    position: relative;
}

.event-dashboard-event.is-using-plus-entitlement {
    border-color: #b896e6;
    background: linear-gradient(100deg, #fbf8ff, #fff);
    box-shadow: inset 4px 0 0 #8d61c7;
}

.event-dashboard-event.is-using-additional-entitlement {
    border-color: #e8ba7a;
    background: linear-gradient(100deg, #fffaf3, #fff);
    box-shadow: inset 4px 0 0 #d38a37;
}

.event-dashboard-event.is-selected-entitlement {
    border-color: #c9b9d0;
    background: #fdfbfe;
    box-shadow: inset 4px 0 0 #a493ad;
}

.event-dashboard-event.is-entitlement-unassigned {
    border-color: #e5c1c5;
    background: #fffafa;
    box-shadow: inset 4px 0 0 #c25865;
}

.event-dashboard-entitlement-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    margin-top: 7px;
    padding: 4px 8px;
    border-radius: 999px;
    color: #624c6b;
    background: #f2edf5;
    font-size: .72rem;
    font-weight: 800;
    line-height: 1.35;
}

.event-dashboard-entitlement-badge.is-plus {
    color: #68429b;
    background: #eee5ff;
}

.event-dashboard-entitlement-badge.is-additional {
    color: #9a5b20;
    background: #fff0da;
}

.event-dashboard-entitlement-badge.is-lock {
    color: #9d3e45;
    background: #fdebed;
}

.event-entitlement-info-modal-card {
    width: min(620px, calc(100vw - 30px));
}

.event-entitlement-info-modal-body {
    display: grid;
    gap: 14px;
    max-height: min(64vh, 520px);
    overflow: auto;
    padding: 18px 22px 22px;
}

.event-entitlement-info-title {
    margin: 0;
    color: #46314f;
    font-size: 1.03rem;
}

.event-entitlement-info-lead {
    margin: 0;
    color: #6e5e76;
    line-height: 1.65;
}

.event-entitlement-info-list {
    display: grid;
    gap: 0;
    margin: 0;
    border: 1px solid #e5dce8;
    border-radius: 10px;
    overflow: hidden;
}

.event-entitlement-info-list>div {
    display: grid;
    grid-template-columns: minmax(100px, .75fr) minmax(0, 1.65fr);
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid #eee7f0;
}

.event-entitlement-info-list>div:last-child {
    border-bottom: 0;
}

.event-entitlement-info-list dt {
    color: #7f6f87;
    font-size: .78rem;
    font-weight: 800;
}

.event-entitlement-info-list dd {
    min-width: 0;
    margin: 0;
    color: #4c3b55;
    overflow-wrap: anywhere;
    font-size: .82rem;
    line-height: 1.5;
}

.event-entitlement-info-note {
    margin: 0;
    padding: 12px 13px;
    border-radius: 9px;
    color: #62506a;
    background: #f7f2f8;
    font-size: .82rem;
    line-height: 1.65;
}

.event-entitlement-info-note.is-warning {
    color: #93434c;
    background: #fff0f1;
}

@media (max-width: 720px) {
    .event-entitlement-summary {
        grid-template-columns: 1fr;
    }

    .event-entitlement-info-modal-body {
        padding: 16px;
    }

    .event-entitlement-info-list>div {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .event-entitlement-info-modal-card .portal-modal-foot {
        flex-wrap: wrap;
    }

    .event-entitlement-info-modal-card .portal-modal-foot>* {
        flex: 1 1 180px;
        text-align: center;
    }
}

/* 下書きは利用権をまだ選択していない通常状態として表示する。 */
.event-dashboard-event.is-entitlement-unselected {
    border-color: #d7d0da;
    background: #fcfbfd;
    box-shadow: inset 4px 0 0 #8e8296;
}

.event-dashboard-entitlement-badge.is-neutral {
    color: #61596a;
    background: #eeeaf0;
}


/* =========================================================
   MyPage Phase 2 Integrated UI Fix
   - official logo sidebar
   - independent sidebar/main scroll
   - compact feed/notification cards with right action box
========================================================= */

html,
body.mypage-page {
    height: 100%;
}

body.mypage-page {
    overflow: hidden;
}

.mypage-shell {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
}

.portal-sidebar {
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.portal-main {
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.portal-sidebar::-webkit-scrollbar,
.portal-main::-webkit-scrollbar {
    width: 10px;
}

.portal-sidebar::-webkit-scrollbar-thumb,
.portal-main::-webkit-scrollbar-thumb {
    border: 3px solid transparent;
    border-radius: 999px;
    background: rgba(70, 62, 48, 0.24);
    background-clip: padding-box;
}

.portal-sidebar::-webkit-scrollbar-track,
.portal-main::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-brand--logo {
    padding: 18px 18px 10px;
}

.sidebar-brand-logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
}

.sidebar-brand-logo-img {
    display: block;
    width: min(100%, 188px);
    height: auto;
    object-fit: contain;
}

.sidebar-user-card {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    gap: 8px 12px;
    min-height: 0;
    padding: 12px;
}

.sidebar-user-card .sidebar-avatar {
    grid-row: 1 / span 2;
    align-self: start;
    width: 46px;
    height: 46px;
}

.sidebar-user-meta--stacked {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.sidebar-user-meta--stacked strong,
.sidebar-id-line,
#sidebarPublicId,
#sidebarStstId {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-id-line {
    display: block;
    color: var(--stst-text-soft, #68707a);
    font-size: 0.69rem;
    line-height: 1.35;
    opacity: 0.82;
}

.sidebar-user-card .status-chip {
    grid-column: 2;
    justify-self: start;
    margin-top: 0;
}

.nav-status-text--new {
    letter-spacing: 0.04em;
}

.primary-button,
.secondary-button,
.text-action-button,
.sidebar-nav-item,
.feed-filter-button {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: keep-all;
    line-height: 1.35;
}

.home-control-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.home-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.home-action-row>div:first-child {
    min-width: 0;
}

.home-action-row h2 {
    margin: 0;
}

.home-action-row p:last-child {
    margin-bottom: 0;
}

.home-action-buttons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 10px;
}

.feed-filter-tabs--wide {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.feed-filter-tabs--wide .feed-filter-button {
    white-space: nowrap;
}

.feed-card--compact {
    padding-top: 18px;
}

.feed-card--compact .feed-list,
.notification-page-card .notification-list {
    gap: 0;
}

.feed-item {
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 13px 16px;
}

.feed-item.feed-item--has-action {
    grid-template-columns: 42px minmax(0, 1fr) minmax(132px, auto);
}

.feed-item-content {
    min-width: 0;
}

.feed-item-content h3,
.feed-item-content p,
.feed-item-meta {
    overflow-wrap: anywhere;
}

.feed-item-action-box {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    min-width: 0;
    padding-left: 16px;
    border-left: 1px solid var(--stst-border, #e4e0d8);
}

.feed-item-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 38px;
    max-width: 180px;
    margin-top: 0;
    padding: 8px 13px;
    border: 1px solid var(--stst-border, #e4e0d8);
    border-radius: 999px;
    background: #fff;
    color: #bd4e20;
    line-height: 1.35;
    text-align: center;
    text-decoration: none;
    white-space: normal;
    box-shadow: 0 3px 0 rgba(218, 209, 188, 0.72);
}

.feed-item-action:hover {
    border-color: rgba(242, 106, 42, 0.45);
    background: #fff8f2;
    color: #a74318;
}

.advanced-settings-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.advanced-settings-item {
    padding: 16px;
    border: 1px solid var(--stst-border, #e4e0d8);
    border-radius: 18px;
    background: #fffdf8;
}

.advanced-settings-item strong {
    display: block;
    margin-bottom: 6px;
}

.advanced-settings-item p {
    margin: 0;
    line-height: 1.7;
}

@media (max-width: 980px) {
    body.mypage-page {
        overflow: auto;
    }

    .mypage-shell {
        height: auto;
        min-height: 100dvh;
        overflow: visible;
    }

    .portal-sidebar,
    .portal-main {
        height: auto;
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 780px) {
    .home-action-row {
        align-items: stretch;
        flex-direction: column;
    }

    .home-action-buttons {
        justify-content: stretch;
    }

    .home-action-buttons>* {
        flex: 1 1 160px;
    }

    .feed-filter-tabs--wide {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }

    .feed-item.feed-item--has-action {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .feed-item-action-box {
        grid-column: 2;
        justify-content: stretch;
        padding-top: 10px;
        padding-left: 0;
        border-top: 1px solid var(--stst-border, #e4e0d8);
        border-left: 0;
    }

    .feed-item-action {
        width: 100%;
        max-width: none;
    }

    .advanced-settings-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   MyPage Phase 3A / Sidebar identity + Advanced settings
========================================================= */

.sidebar-brand--logo {
    padding: 18px 18px 14px;
}

.sidebar-brand-logo-img {
    width: min(100%, 205px);
}

.sidebar-user-card {
    display: grid !important;
    grid-template-columns: 64px minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    align-items: center !important;
    gap: 4px 14px !important;
    min-height: 118px !important;
    width: calc(100% - 32px) !important;
    margin: 2px 16px 22px !important;
    padding: 16px !important;
    overflow: visible !important;
    border-radius: 22px !important;
}

.sidebar-user-card .sidebar-avatar {
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
    align-self: center !important;
    width: 64px !important;
    height: 64px !important;
    font-size: 1.05rem !important;
    line-height: 1 !important;
}

.sidebar-user-meta--stacked {
    grid-column: 2 !important;
    grid-row: 1 !important;
    align-self: end !important;
    gap: 4px !important;
}

.sidebar-user-meta--stacked strong {
    font-size: 0.9rem !important;
    line-height: 1.25 !important;
}

.sidebar-id-line {
    font-size: 0.72rem !important;
    line-height: 1.35 !important;
}

.sidebar-user-card .status-chip {
    grid-column: 2 !important;
    grid-row: 2 !important;
    align-self: start !important;
    justify-self: start !important;
    max-width: 100% !important;
    margin-top: 8px !important;
}

.sidebar-nav-item.is-limited {
    opacity: 0.72;
}

.advanced-settings-card--v2 .content-card-head {
    margin-bottom: 18px;
}

.advanced-settings-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 16px;
}

.advanced-settings-panel {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--stst-border, #e4e0d8);
    border-radius: 20px;
    background: #fffdf8;
    box-shadow: 0 8px 22px rgba(51, 43, 31, 0.04);
}

.advanced-settings-panel--display,
.advanced-settings-panel--safety {
    grid-column: 1 / -1;
}

.settings-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.settings-panel-head h3 {
    margin: 4px 0 0;
    font-size: 1.06rem;
}

.settings-panel-head p:not(.section-kicker) {
    margin: 6px 0 0;
    color: var(--stst-text-soft, #68707a);
    font-size: 0.82rem;
    line-height: 1.75;
}

.settings-status-chip {
    display: inline-flex;
    min-height: 25px;
    align-items: center;
    flex: 0 0 auto;
    padding: 4px 9px;
    border: 1px solid #e0d8c7;
    border-radius: 999px;
    background: #fff7df;
    color: #906221;
    font-size: 0.68rem;
    font-weight: 900;
    line-height: 1.2;
    white-space: nowrap;
}

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

.settings-summary-row>div {
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid #ebe3d4;
    border-radius: 15px;
    background: #fff;
}

.settings-summary-row span,
.setting-select-grid span {
    display: block;
    color: var(--stst-text-soft, #68707a);
    font-size: 0.72rem;
    font-weight: 850;
}

.settings-summary-row strong {
    display: block;
    margin-top: 4px;
    overflow: hidden;
    color: var(--stst-charcoal, #252525);
    font-size: 0.95rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.setting-radio-card,
.setting-toggle-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    padding: 13px;
    border: 1px solid #ebe3d4;
    border-radius: 15px;
    background: #fff;
}

.setting-radio-card input,
.setting-toggle-row input {
    flex: 0 0 auto;
    margin-top: 4px;
}

.setting-radio-card span,
.setting-toggle-row span {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.setting-radio-card strong,
.setting-toggle-row strong {
    font-size: 0.86rem;
    line-height: 1.4;
}

.setting-radio-card small,
.setting-toggle-row small {
    color: var(--stst-text-soft, #68707a);
    font-size: 0.74rem;
    line-height: 1.55;
}

.setting-inline-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

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

.setting-toggle-row {
    align-items: center;
    justify-content: space-between;
}

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

.setting-select-grid label {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.setting-note-box,
.safety-policy-box {
    padding: 14px;
    border: 1px solid #eadbb9;
    border-radius: 16px;
    background: #fff7df;
}

.setting-note-box strong,
.safety-policy-box strong {
    display: block;
    margin-bottom: 5px;
    color: var(--stst-charcoal, #252525);
}

.setting-note-box p,
.safety-policy-box p {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.75;
}

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

@media (max-width: 1100px) {
    .sidebar-user-card {
        grid-template-columns: 58px minmax(0, 1fr) !important;
        min-height: 110px !important;
        padding: 14px !important;
    }

    .sidebar-user-card .sidebar-avatar {
        width: 58px !important;
        height: 58px !important;
    }

    .sidebar-user-meta--stacked strong {
        font-size: 0.84rem !important;
    }

    .sidebar-id-line {
        font-size: 0.68rem !important;
    }
}

@media (max-width: 980px) {
    .advanced-settings-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 780px) {
    .sidebar-user-card {
        min-height: 108px !important;
    }

    .display-name-option-list,
    .settings-summary-row,
    .setting-inline-form,
    .setting-select-grid,
    .safety-action-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   MyPage Phase 3B / Sidebar compact identity + centered menu
========================================================= */
.sidebar-user-card {
    grid-template-columns: 42px minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    gap: 5px 11px !important;
    min-height: 108px !important;
    padding: 14px !important;
    border-radius: 18px !important;
}

.sidebar-user-card .sidebar-avatar {
    width: 42px !important;
    height: 42px !important;
    align-self: center !important;
    font-size: 0.8rem !important;
    line-height: 1 !important;
}

.sidebar-user-meta--stacked {
    align-self: end !important;
    gap: 2px !important;
}

.sidebar-user-meta--stacked strong {
    font-size: 0.84rem !important;
    line-height: 1.25 !important;
}

.sidebar-id-line {
    font-size: 0.7rem !important;
    line-height: 1.35 !important;
}

.sidebar-user-card .status-chip {
    grid-column: 2 !important;
    grid-row: 2 !important;
    align-self: start !important;
    margin-top: 4px !important;
    font-size: 0.68rem !important;
}

.sidebar-nav-item {
    position: relative;
    justify-content: center !important;
    gap: 0 !important;
    padding-right: 42px !important;
    padding-left: 42px !important;
    text-align: center !important;
}

.sidebar-nav-item .nav-symbol,
.sidebar-nav-item .nav-external,
.sidebar-nav-item .nav-status-text {
    display: none !important;
}

.sidebar-nav-item>span:not(.nav-symbol):not(.nav-badge):not(.nav-external):not(.nav-status-text) {
    display: inline-flex;
    min-width: 0;
    justify-content: center;
    text-align: center;
}

.sidebar-nav-item .nav-badge {
    position: absolute;
    right: 12px;
    margin-left: 0;
}

.setting-radio-card.is-active {
    border-color: rgba(242, 106, 42, 0.56);
    background: #fff8f2;
    box-shadow: 0 8px 20px rgba(242, 106, 42, 0.08);
}

.setting-radio-card.is-disabled {
    opacity: 0.52;
}

@media (max-width: 1100px) {
    .sidebar-user-card {
        grid-template-columns: 42px minmax(0, 1fr) !important;
        min-height: 104px !important;
        padding: 13px !important;
    }

    .sidebar-user-card .sidebar-avatar {
        width: 42px !important;
        height: 42px !important;
        font-size: 0.8rem !important;
    }

    .sidebar-user-meta--stacked strong {
        font-size: 0.82rem !important;
    }

    .sidebar-id-line {
        font-size: 0.68rem !important;
    }
}

/* =========================================================
   MyPage Phase 3D / Notification settings + display name polish
========================================================= */
.setting-inline-form--custom-name {
    align-items: end;
}

.setting-inline-label {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.setting-inline-label>span {
    color: var(--stst-text-soft, #68707a);
    font-size: 0.72rem;
    font-weight: 850;
}

.settings-inline-note {
    min-height: 1.4em;
    margin: 0;
    color: var(--stst-text-soft, #68707a);
    font-size: 0.76rem;
    line-height: 1.7;
}

.setting-toggle-row--locked {
    background: #f9f7f1;
}

.setting-toggle-row--locked input {
    opacity: 0.75;
}

.setting-select-grid--single {
    grid-template-columns: minmax(0, 1fr);
}

.settings-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
}

.settings-action-row .secondary-button {
    flex: 0 0 auto;
}

.advanced-settings-panel--notifications .setting-toggle-list {
    grid-template-columns: 1fr;
}

@media (max-width: 780px) {
    .settings-action-row {
        align-items: stretch;
        flex-direction: column;
    }

    .settings-action-row .secondary-button {
        width: 100%;
    }
}

/* =========================================================
   MyPage Phase 3F / Safety settings
========================================================= */
.danger-button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border: 1px solid #efb3b3;
    border-radius: 10px;
    background: #fff0f0;
    color: #bb3f3f;
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 850;
    text-decoration: none;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.danger-button:hover:not(:disabled) {
    border-color: #df4e4e;
    background: #ffe5e5;
    color: #9f2f2f;
    box-shadow: 0 8px 20px rgba(223, 78, 78, 0.12);
    transform: translateY(-1px);
}

.danger-button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.safety-target-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.safety-target-form label {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.safety-target-form label>span {
    color: var(--stst-text-soft, #68707a);
    font-size: 0.72rem;
    font-weight: 850;
}

.safety-target-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

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

.safety-list-panel {
    display: flex;
    min-height: 220px;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 16px;
    border: 1px solid var(--stst-border, #e4e0d8);
    border-radius: 16px;
    background: #fffdf8;
    box-shadow: none;
}

.safety-list-head {
    display: grid;
    gap: 4px;
}

.safety-list-head strong {
    font-size: 0.92rem;
    font-weight: 900;
}

.safety-list-head small {
    color: var(--stst-text-soft, #68707a);
    font-size: 0.74rem;
    line-height: 1.6;
}

.safety-user-list {
    display: grid;
    gap: 8px;
}

.safety-empty-state {
    display: grid;
    min-height: 86px;
    place-items: center;
    border: 1px dashed var(--stst-border, #e4e0d8);
    border-radius: 13px;
    color: var(--stst-text-soft, #68707a);
    font-size: 0.78rem;
    text-align: center;
}

.safety-user-item {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    margin: 0;
    padding: 10px;
    border: 1px solid var(--stst-border, #e4e0d8);
    border-radius: 13px;
    background: #fff;
    box-shadow: none;
}

.safety-user-avatar {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    background: linear-gradient(140deg, var(--stst-yellow, #ffcf21), #ffb90e);
    color: var(--stst-charcoal, #252525);
    font-size: 0.74rem;
    font-weight: 900;
}

.safety-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.safety-user-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

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

.safety-user-copy strong {
    font-size: 0.84rem;
    font-weight: 900;
}

.safety-user-copy span {
    color: var(--stst-text-soft, #68707a);
    font-size: 0.7rem;
}

.safety-remove-button {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 0.74rem;
    white-space: nowrap;
}

@media (max-width: 920px) {

    .safety-target-form,
    .safety-list-grid {
        grid-template-columns: 1fr;
    }

    .safety-target-actions {
        justify-content: stretch;
    }

    .safety-target-actions>* {
        flex: 1 1 160px;
    }
}

@media (max-width: 560px) {
    .safety-user-item {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .safety-user-item .safety-remove-button {
        grid-column: 1 / -1;
        width: 100%;
    }
}

/* =========================================================
   Activity update cards in home feed
   近況だけは通知カードと分離し、ポスト型カードで表示
========================================================= */

.activity-post-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px 0;
    border-bottom: 1px solid var(--stst-border, #e4e0d8);
}

.activity-post-card:first-child {
    padding-top: 0;
}

.activity-post-card:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.activity-post-header {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.activity-post-avatar {
    display: grid;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(140deg, var(--stst-yellow, #ffcf21), #ffb90e);
    color: var(--stst-charcoal, #252525);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.03em;
}

.activity-post-header-text {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
}

.activity-post-header-text strong,
.activity-post-header-text span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-post-header-text strong {
    color: var(--stst-charcoal, #252525);
    font-size: 0.86rem;
    font-weight: 900;
}

.activity-post-header-text span {
    color: var(--stst-text-soft, #68707a);
    font-size: 0.7rem;
    font-weight: 700;
}

.activity-post-profile-link {
    flex: 0 0 auto;
    padding: 6px 10px;
    border: 1px solid var(--stst-border, #e4e0d8);
    border-radius: 999px;
    background: #fff;
    color: #bd4e20;
    font-size: 0.72rem;
    font-weight: 850;
    text-decoration: none;
    white-space: nowrap;
}

.activity-post-profile-link:hover {
    border-color: rgba(242, 106, 42, 0.45);
    background: #fff8f2;
    color: #a74318;
}

.activity-post-title {
    margin: 0;
    color: var(--stst-charcoal, #252525);
    font-size: clamp(0.98rem, 1.5vw, 1.12rem);
    font-weight: 900;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.activity-post-body {
    margin: -3px 0 0;
    color: var(--stst-text, #282828);
    font-size: 0.88rem;
    line-height: 1.82;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.activity-post-image-grid {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--stst-border, #e4e0d8);
    border-radius: 16px;
    background: #f3f1eb;
}

.activity-post-image-grid--1 {
    grid-template-columns: 1fr;
}

.activity-post-image-grid--2,
.activity-post-image-grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.activity-post-image-grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.activity-post-image-grid--3 .activity-post-image-button:first-child {
    grid-row: span 2;
}

.activity-post-image-button {
    display: block;
    width: 100%;
    min-height: 0;
    aspect-ratio: 1 / 1;
    padding: 0;
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.72);
    border-bottom: 1px solid rgba(255, 255, 255, 0.72);
    background: #ede9df;
    cursor: zoom-in;
    overflow: hidden;
}

.activity-post-image-grid--1 .activity-post-image-button {
    aspect-ratio: 16 / 9;
}

.activity-post-image-button:nth-child(2n) {
    border-right: 0;
}

.activity-post-image-grid--1 .activity-post-image-button,
.activity-post-image-grid--2 .activity-post-image-button:nth-child(n + 1),
.activity-post-image-grid--4 .activity-post-image-button:nth-child(n + 3) {
    border-bottom: 0;
}

.activity-post-image-button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.18s ease;
}

.activity-post-image-button:hover img {
    transform: scale(1.035);
}

.activity-post-reactions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 2px;
}

.activity-post-reaction-button {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 10px;
    border: 1px solid var(--stst-border, #e4e0d8);
    border-radius: 999px;
    background: #fff;
    color: var(--stst-charcoal, #252525);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 850;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease;
}

.activity-post-reaction-button small {
    color: inherit;
    font-size: 0.68rem;
    font-weight: 850;
}

.activity-post-reaction-button:hover {
    border-color: rgba(242, 106, 42, 0.42);
    background: #fff8f2;
    color: #a74318;
    transform: translateY(-1px);
}

@media (max-width: 620px) {
    .activity-post-card {
        gap: 10px;
    }

    .activity-post-header {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .activity-post-profile-link {
        margin-left: 48px;
    }

    .activity-post-reaction-button {
        flex: 1 1 calc(50% - 8px);
    }
}

/* =========================================================
   Activity post compact images / modal previews
========================================================= */

.activity-post-image-grid {
    grid-auto-rows: clamp(82px, 12vw, 148px);
}

.activity-post-image-grid--1 {
    grid-auto-rows: clamp(128px, 18vw, 220px);
}

.activity-post-image-grid--2 {
    grid-auto-rows: clamp(96px, 13vw, 156px);
}

.activity-post-image-grid--3,
.activity-post-image-grid--4 {
    grid-auto-rows: clamp(82px, 11vw, 140px);
}

.activity-post-image-button,
.activity-post-image-grid--1 .activity-post-image-button {
    height: 100%;
    aspect-ratio: auto;
}

.activity-post-profile-link {
    border: 1px solid var(--stst-border, #e4e0d8);
    cursor: pointer;
}

body.is-activity-modal-open {
    overflow: hidden;
}

.activity-image-viewer,
.activity-profile-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: grid;
    place-items: center;
    padding: 22px;
}

.activity-image-viewer[hidden],
.activity-profile-modal[hidden] {
    display: none;
}

.activity-image-viewer__backdrop,
.activity-profile-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(26, 23, 20, 0.72);
    backdrop-filter: blur(8px);
}

.activity-image-viewer__dialog,
.activity-profile-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 960px);
    max-height: min(88dvh, 860px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    background: #fffdf8;
    box-shadow: 0 26px 72px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.activity-image-viewer__dialog {
    display: grid;
    min-height: 320px;
    place-items: center;
    background: #171514;
}

.activity-image-viewer__close,
.activity-profile-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--stst-charcoal, #252525);
    cursor: pointer;
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1;
}

.activity-image-viewer__figure {
    display: grid;
    width: 100%;
    max-height: 88dvh;
    margin: 0;
    place-items: center;
    padding: 54px 64px 46px;
}

.activity-image-viewer__image {
    max-width: 100%;
    max-height: calc(88dvh - 124px);
    border-radius: 14px;
    object-fit: contain;
}

.activity-image-viewer__caption {
    min-height: 24px;
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.82rem;
    font-weight: 800;
    text-align: center;
}

.activity-image-viewer__nav {
    position: absolute;
    top: 50%;
    z-index: 3;
    display: grid;
    width: 44px;
    height: 56px;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--stst-charcoal, #252525);
    cursor: pointer;
    font-size: 2rem;
    font-weight: 900;
    transform: translateY(-50%);
}

.activity-image-viewer__nav--prev {
    left: 14px;
}

.activity-image-viewer__nav--next {
    right: 14px;
}

.activity-profile-modal__dialog {
    width: min(100%, 620px);
    overflow: visible;
}

.activity-profile-preview {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: clamp(22px, 4vw, 32px);
}

.activity-profile-preview__top {
    display: grid;
    grid-template-columns: minmax(150px, 42%) minmax(0, 1fr);
    gap: 18px;
    align-items: center;
}

.activity-profile-preview__thumb {
    display: grid;
    min-height: 132px;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--stst-border, #e4e0d8);
    border-radius: 18px;
    background: linear-gradient(140deg, #fff4c7, #ffe18a);
    color: var(--stst-charcoal, #252525);
    font-size: 1rem;
    font-weight: 900;
    aspect-ratio: 16 / 9;
}

.activity-profile-preview__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.activity-profile-preview__identity {
    min-width: 0;
}

.activity-profile-preview__identity h2 {
    margin: 0;
    color: var(--stst-charcoal, #252525);
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.activity-profile-preview__identity p {
    margin: 8px 0 0;
    color: var(--stst-text-soft, #68707a);
    font-size: 0.82rem;
    font-weight: 800;
}

.activity-profile-preview__catch {
    min-height: 46px;
    margin: 0;
    padding: 14px 16px;
    border: 1px solid var(--stst-border, #e4e0d8);
    border-radius: 16px;
    background: #fffaf0;
    color: var(--stst-text, #282828);
    font-size: 0.9rem;
    font-weight: 750;
    line-height: 1.75;
    overflow-wrap: anywhere;
}

.activity-profile-preview__actions {
    position: relative;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
}

.activity-profile-preview__action,
.activity-profile-preview__more,
.activity-profile-preview__visit {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 900;
    text-decoration: none;
}

.activity-profile-preview__action {
    flex: 1 1 118px;
    border: 1px solid var(--stst-border, #e4e0d8);
    background: #fff;
    color: var(--stst-charcoal, #252525);
    padding: 8px 12px;
}

.activity-profile-preview__action--primary,
.activity-profile-preview__action.is-active {
    border-color: var(--stst-charcoal, #252525);
    background: var(--stst-charcoal, #252525);
    color: #fff;
}

.activity-profile-preview__action:disabled {
    cursor: default;
    opacity: 0.72;
}

.activity-profile-preview__more-wrap {
    position: relative;
    flex: 0 0 auto;
}

.activity-profile-preview__more {
    width: 42px;
    border: 1px solid var(--stst-border, #e4e0d8);
    background: #fff;
    color: var(--stst-charcoal, #252525);
    font-size: 1.2rem;
    line-height: 1;
}

.activity-profile-preview__menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    z-index: 5;
    display: grid;
    min-width: 160px;
    overflow: hidden;
    border: 1px solid var(--stst-border, #e4e0d8);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 14px 36px rgba(38, 34, 28, 0.14);
}

.activity-profile-preview__menu[hidden] {
    display: none;
}

.activity-profile-preview__menu button {
    min-height: 40px;
    border: 0;
    background: #fff;
    color: var(--stst-charcoal, #252525);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 850;
    text-align: left;
    padding: 9px 12px;
}

.activity-profile-preview__menu button:hover {
    background: #fff4e9;
    color: #a74318;
}

.activity-profile-preview__visit {
    width: 100%;
    border: 1px solid var(--stst-charcoal, #252525);
    background: var(--stst-charcoal, #252525);
    color: #fff;
    padding: 10px 16px;
}

@media (max-width: 620px) {

    .activity-post-image-grid,
    .activity-post-image-grid--1,
    .activity-post-image-grid--2,
    .activity-post-image-grid--3,
    .activity-post-image-grid--4 {
        grid-auto-rows: clamp(76px, 24vw, 126px);
    }

    .activity-image-viewer,
    .activity-profile-modal {
        padding: 12px;
    }

    .activity-image-viewer__figure {
        padding: 52px 16px 42px;
    }

    .activity-image-viewer__nav {
        width: 38px;
        height: 48px;
    }

    .activity-profile-preview__top {
        grid-template-columns: 1fr;
    }

    .activity-profile-preview__thumb {
        min-height: 150px;
    }

    .activity-profile-preview__action {
        flex-basis: calc(50% - 9px);
    }

    .activity-profile-preview__more-wrap {
        flex: 1 1 calc(50% - 9px);
    }

    .activity-profile-preview__more {
        width: 100%;
    }
}


/* =========================================================
   Activity post image area 16:9 frame adjustment
========================================================= */

.activity-post-image-grid {
    width: min(100%, 560px);
    aspect-ratio: 16 / 9;
    grid-auto-rows: auto;
    justify-self: start;
    align-self: flex-start;
}

.activity-post-image-grid--1,
.activity-post-image-grid--2 {
    grid-template-rows: minmax(0, 1fr);
}

.activity-post-image-grid--3,
.activity-post-image-grid--4 {
    grid-template-rows: repeat(2, minmax(0, 1fr));
}

.activity-post-image-grid--1 .activity-post-image-button,
.activity-post-image-grid--2 .activity-post-image-button,
.activity-post-image-grid--3 .activity-post-image-button,
.activity-post-image-grid--4 .activity-post-image-button {
    width: 100%;
    height: 100%;
    min-height: 0;
    aspect-ratio: auto;
}

@media (max-width: 620px) {
    .activity-post-image-grid {
        width: 100%;
        max-width: none;
    }
}

/* =========================================================
   Phase 3K activity feed / composer refinements
========================================================= */
.activity-post-image-grid {
    width: min(100%, 520px);
    max-width: 520px;
    aspect-ratio: 16 / 9;
}

.activity-post-reactions {
    gap: 7px;
}

.activity-post-reaction-button {
    position: relative;
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    gap: 0;
    font-size: 1.04rem;
    line-height: 1;
    overflow: visible;
}

.activity-post-reaction-button small {
    display: none;
}

.activity-post-reaction-button::after {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    z-index: 5;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(37, 37, 37, 0.94);
    color: #fff;
    content: attr(data-tooltip);
    font-size: 0.68rem;
    font-weight: 850;
    line-height: 1.2;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 4px);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.activity-post-reaction-button::before {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 3px);
    z-index: 5;
    width: 8px;
    height: 8px;
    background: rgba(37, 37, 37, 0.94);
    content: "";
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) rotate(45deg);
    transition: opacity 0.16s ease;
}

.activity-post-reaction-button:hover::after,
.activity-post-reaction-button:focus-visible::after,
.activity-post-reaction-button:hover::before,
.activity-post-reaction-button:focus-visible::before {
    opacity: 1;
}

.activity-post-reaction-button:hover::after,
.activity-post-reaction-button:focus-visible::after {
    transform: translate(-50%, 0);
}

.activity-image-viewer__nav {
    transition: background-color 0.18s ease, color 0.18s ease;
}

.activity-image-viewer__nav:hover {
    background: var(--stst-yellow, #ffcf21);
    color: var(--stst-charcoal, #252525);
    transform: translateY(-50%);
}

.activity-profile-preview__top {
    grid-template-columns: 104px minmax(0, 1fr);
    align-items: center;
}

.activity-profile-preview__thumb {
    width: 104px;
    min-height: 0;
    aspect-ratio: 1 / 1;
    border-radius: 22px;
}

.activity-profile-preview__thumb img {
    object-fit: cover;
}

.activity-profile-preview__identity {
    position: relative;
    z-index: 1;
}

.activity-composer-modal {
    position: fixed;
    inset: 0;
    z-index: 3050;
    display: grid;
    place-items: center;
    padding: 22px;
}

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

.activity-composer-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(26, 23, 20, 0.72);
    backdrop-filter: blur(8px);
}

.activity-composer-modal__dialog {
    position: relative;
    z-index: 1;
    display: flex;
    width: min(720px, 100%);
    max-height: min(860px, calc(100dvh - 36px));
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 22px;
    background: #fffdf8;
    box-shadow: 0 26px 72px rgba(0, 0, 0, 0.35);
}

.activity-composer-modal__head,
.activity-composer-modal__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 17px 20px;
}

.activity-composer-modal__head {
    border-bottom: 1px solid var(--stst-border, #e4e0d8);
}

.activity-composer-modal__head h2 {
    margin: 2px 0 0;
    color: var(--stst-charcoal, #252525);
    font-size: 1.1rem;
    font-weight: 900;
}

.activity-composer-modal__body {
    overflow-y: auto;
    padding: 20px;
}

.activity-composer-modal__foot {
    justify-content: flex-end;
    border-top: 1px solid var(--stst-border, #e4e0d8);
}

.activity-composer-close-button {
    display: grid;
    width: 36px;
    height: 36px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--stst-border, #e4e0d8);
    border-radius: 999px;
    background: #fff;
    color: var(--stst-charcoal, #252525);
    cursor: pointer;
    font-size: 1.25rem;
    font-weight: 900;
}

.activity-updates-manage-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--stst-border, #e4e0d8);
}

.activity-updates-manage-card:first-child {
    padding-top: 0;
}

.activity-updates-manage-card:last-child {
    border-bottom: 0;
}

.activity-updates-manage-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--stst-text-soft, #68707a);
    font-size: 0.72rem;
    font-weight: 800;
}

.activity-updates-manage-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 2px;
}

.activity-updates-empty {
    padding: 18px;
    border: 1px dashed var(--stst-border, #e4e0d8);
    border-radius: 16px;
    background: #fffaf0;
}

.activity-updates-empty strong {
    display: block;
    color: var(--stst-charcoal, #252525);
    font-size: 0.9rem;
}

.activity-updates-empty p {
    margin: 6px 0 0;
    color: var(--stst-text-soft, #68707a);
    font-size: 0.8rem;
}

@media (max-width: 620px) {
    .activity-profile-preview__top {
        grid-template-columns: 88px minmax(0, 1fr);
    }

    .activity-profile-preview__thumb {
        width: 88px;
        min-height: 0;
    }

    .activity-composer-modal {
        padding: 10px;
    }

    .activity-composer-modal__head,
    .activity-composer-modal__body,
    .activity-composer-modal__foot {
        padding: 14px;
    }
}

/* =========================================================
   Phase 3L activity reactions / manage search refinements
========================================================= */
.activity-updates-search-toolbar {
    display: grid;
    grid-template-columns: minmax(180px, 1.5fr) repeat(3, minmax(130px, 1fr)) auto auto;
    align-items: end;
    gap: 12px;
}

.activity-updates-search-toolbar label {
    min-width: 0;
    gap: 6px;
}

.activity-updates-search-toolbar label span {
    color: var(--stst-text-soft, #68707a);
    font-size: 0.72rem;
    font-weight: 850;
}

.activity-updates-search-toolbar .status-chip {
    justify-self: end;
    align-self: center;
}

.activity-post-reactions {
    align-items: center;
}

.activity-post-reaction-button {
    width: auto;
    min-width: 36px;
    padding: 0 10px;
    column-gap: 4px;
    border-color: var(--stst-border, #e4e0d8);
    background: #fff;
}

.activity-post-reaction-button.is-active {
    border-color: rgba(242, 106, 42, 0.45);
    background: #fff4e9;
    color: #a74318;
    box-shadow: 0 4px 12px rgba(242, 106, 42, 0.12);
}

.activity-post-reaction-count {
    color: currentColor;
    font-size: 0.74rem;
    font-weight: 900;
    line-height: 1;
}

.activity-post-reaction-summary {
    flex-basis: 100%;
    margin: 2px 0 0;
    color: var(--stst-text-soft, #68707a);
    font-size: 0.74rem;
    font-weight: 800;
}

.activity-post-reaction-area--manage {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.activity-post-reaction-area--manage .activity-post-reactions {
    margin-top: 0;
}

@media (max-width: 1040px) {
    .activity-updates-search-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .activity-updates-search-toolbar .status-chip {
        justify-self: start;
    }
}

@media (max-width: 620px) {
    .activity-updates-search-toolbar {
        grid-template-columns: 1fr;
    }

    .activity-post-reaction-button {
        min-width: 34px;
        height: 34px;
        min-height: 34px;
        padding: 0 8px;
    }
}

/* =========================================================
   Phase 3M activity reactions / home reaction tabs / search cleanup
========================================================= */
.activity-post-reaction-count {
    display: inline-block !important;
    min-width: 0.7em;
    color: currentColor;
    font-size: 0.74rem;
    font-weight: 900;
    line-height: 1;
}

.activity-post-reaction-button {
    width: auto;
    min-width: 36px;
    padding-inline: 10px;
}

.activity-updates-search-toolbar {
    display: grid !important;
    grid-template-columns: minmax(220px, 1.4fr) minmax(140px, 0.8fr) minmax(140px, 0.8fr) minmax(140px, 0.8fr) minmax(148px, auto);
    align-items: end;
    gap: 12px;
}

.activity-updates-search-toolbar label,
.activity-updates-search-toolbar .activity-updates-search-field {
    min-width: 0;
}

.activity-updates-search-toolbar input,
.activity-updates-search-toolbar select,
.activity-updates-search-toolbar button {
    min-height: 42px;
}

.activity-updates-search-toolbar #activityUpdateSearchReset {
    width: 100%;
    min-width: 148px;
    white-space: nowrap;
}

.activity-updates-search-toolbar #activityUpdateQuota {
    grid-column: 1 / -1;
    justify-self: start;
    width: fit-content;
    max-width: 100%;
}

.feed-item[data-feed-category="receivedReactions"] .feed-item-body {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

@media (max-width: 1100px) {
    .activity-updates-search-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .activity-updates-search-toolbar #activityUpdateSearchReset {
        min-width: 0;
    }
}

@media (max-width: 620px) {
    .activity-updates-search-toolbar {
        grid-template-columns: 1fr !important;
    }

    .activity-updates-search-toolbar #activityUpdateQuota {
        width: 100%;
    }
}

/* =========================================================
   Phase 3N activity reaction tab / manage search final fix
========================================================= */
.activity-updates-search-toolbar {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
}

.activity-updates-search-grid {
    display: grid !important;
    grid-template-columns: minmax(220px, 1.6fr) repeat(3, minmax(140px, 1fr));
    align-items: end;
    gap: 12px;
    width: 100%;
    min-width: 0;
}

.activity-updates-search-grid label {
    min-width: 0;
    display: grid;
    gap: 6px;
}

.activity-updates-search-grid label span {
    color: var(--stst-text-soft, #68707a);
    font-size: 0.72rem;
    font-weight: 850;
}

.activity-updates-search-grid input,
.activity-updates-search-grid select {
    width: 100%;
    min-width: 0;
    min-height: 42px;
}

.activity-updates-search-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-width: 0;
}

.activity-updates-search-actions #activityUpdateSearchReset {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    white-space: nowrap;
}

.activity-updates-search-actions #activityUpdateQuota {
    flex: 0 1 auto;
    width: fit-content;
    max-width: 100%;
    justify-self: auto;
}

.activity-post-reaction-button {
    gap: 4px;
}

.activity-post-reaction-count {
    display: inline-block !important;
}

@media (max-width: 980px) {
    .activity-updates-search-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 620px) {
    .activity-updates-search-grid {
        grid-template-columns: 1fr !important;
    }

    .activity-updates-search-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .activity-updates-search-actions #activityUpdateSearchReset,
    .activity-updates-search-actions #activityUpdateQuota {
        width: 100%;
    }
}