:root {
    --bg: #f2f5f9;
    --card: #ffffff;
    --text: #22303d;
    --accent: #4f8fe8;
    --border: #d1dde9;
    --accent-dark: #2766bd;
    --ink-soft: #40566c;
    --shadow: 0 22px 70px rgba(36, 76, 120, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", "Hiragino Kaku Gothic Pro", Meiryo, sans-serif;
    background: linear-gradient(180deg, #eef5fb 0%, #f8fafc 100%);
    color: var(--text);
    overflow-x: hidden;
}

.app-container {
    width: min(100%, 1480px);
    max-width: none;
    margin: 0 auto;
    padding: 28px 16px;
}

header {
    text-align: center;
    margin-bottom: 28px;
}

h1 {
    margin: 0 0 10px;
    font-size: clamp(2rem, 4vw, 3rem);
}

p {
    margin: 0;
    color: #546b82;
}

main {
    display: block;
}

.landing-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

.landing-hero {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.landing-copy {
    flex: 1 1 360px;
    min-width: 320px;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 14px;
    color: var(--accent);
    font-weight: 700;
    letter-spacing: .2em;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.landing-preview-cards {
    display: grid;
    grid-template-columns: repeat( auto-fit, minmax(220px, 1fr) );
    gap: 16px;
    width: 100%;
}

.preview-card {
    padding: 18px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 12px 35px rgba(98, 127, 179, 0.08);
}

.preview-frame {
    position: relative;
    overflow: hidden;
    min-height: 220px;
    border-radius: 18px;
    background: #f6f9ff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-frame-simple {
    min-height: 180px;
}

.preview-layer {
    max-width: 80%;
    max-height: 80%;
}

.preview-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(79, 143, 232, 0.12);
    color: var(--accent);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
}

.feature-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.feature-item {
    padding: 18px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
}

.feature-item h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.05rem;
}

.feature-item p {
    color: #55667d;
}

.viewer {
    padding: 24px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 560px;
}

.character-card {
    position: relative;
    width: min(420px, 100%);
    aspect-ratio: 1 / 1;
    background: #f8fbff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 18px 45px rgba(63, 94, 174, 0.08);
}

.character-card .layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    z-index: 1;
}

#background-layer {
    z-index: 0;
}

#body-layer {
    z-index: 2;
}

#eyes-layer {
    z-index: 3;
}

#nose-layer {
    z-index: 4;
}

#mouth-layer {
    z-index: 5;
}

#shoes-layer {
    z-index: 6;
}

#bottoms-layer {
    z-index: 7;
}

#tops-layer {
    z-index: 8;
}

#onepiece-layer {
    z-index: 9;
}

#accessory1-layer {
    z-index: 10;
}

#accessory2-layer {
    z-index: 11;
}

#hair-layer {
    z-index: 12;
}

.character-img {
    width: 100%;
    max-height: 560px;
    object-fit: contain;
    border-radius: 18px;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.group-tab {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.group-tab:hover,
.group-tab.active {
    border-color: var(--accent);
    background: rgba(79, 143, 232, 0.08);
    color: #1b355f;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.filter-group select {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
}

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

.item-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px;
    cursor: pointer;
    transition: transform .2s ease, border-color .2s ease;
}

.item-card.locked {
    opacity: 0.72;
    cursor: default;
}

.item-card .item-detail {
    margin-left: auto;
    color: #5c6c88;
    font-size: 0.9rem;
}

.purchase-button {
    margin-left: 12px;
    padding: 8px 12px;
    border: none;
    border-radius: 12px;
    background: #f0ad4e;
    color: #fff;
    cursor: pointer;
    font-weight: 700;
}

.purchase-button:hover {
    background: #e69539;
}

.item-card:hover,
.item-card:focus-visible {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.item-card img {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.item-card span {
    font-size: 0.95rem;
    color: #2f4151;
}

@media (max-width: 960px) {
    main {
        grid-template-columns: 1fr;
    }
}

.top-nav {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 0.95rem;
    flex-wrap: wrap;
    align-items: center;
}

.text-link,
.nav-link {
    color: var(--accent);
    text-decoration: none;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-link-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #e94b4b;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(233, 75, 75, 0.18);
}

.nav-link-badge--soft {
    background: rgba(79, 143, 232, 0.12);
    color: var(--accent-dark);
    border: 1px solid rgba(79, 143, 232, 0.22);
    box-shadow: none;
}

.chat-room-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(79, 143, 232, 0.15);
    color: var(--accent-dark);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
}

.divider {
    color: #8a9cb7;
}

.primary-button {
    width: 100%;
    max-width: 320px;
    padding: 14px 18px;
    border: none;
    border-radius: 14px;
    background: var(--accent);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}

.primary-button:hover {
    background: #3e78d6;
    transform: translateY(-1px);
}

.action-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
}

.save-message {
    color: #2f5d32;
    font-size: 0.95rem;
    min-height: 1.3em;
}

.login-prompt {
    margin: 0;
    color: #546b82;
    font-size: 0.95rem;
}

.saved-section {
    margin-top: 24px;
    padding: 18px;
    background: #f8fbff;
    border: 1px solid var(--border);
    border-radius: 18px;
}

.saved-section h2 {
    margin: 0 0 14px;
    font-size: 1.1rem;
}

.saved-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.saved-item {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    align-items: center;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
}

.saved-item img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 14px;
}

.saved-meta {
    margin-top: 6px;
    font-size: 0.85rem;
    color: #6b7a8e;
}

.auth-page {
    max-width: 920px;
    margin: 60px auto;
    padding: 28px 24px;
}

.auth-page.profile-page {
    max-width: 1120px;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: start;
}

.profile-main,
.profile-sidebar {
    display: grid;
    gap: 24px;
}

.profile-section,
.admin-panel {
    padding: 22px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
}

.profile-stack {
    display: grid;
    gap: 22px;
}

.profile-section h2,
.admin-panel h2,
.admin-panel h3 {
    margin-top: 0;
}

.profile-section p,
.admin-panel p {
    color: #55667d;
}

.profile-sidebar {
    display: grid;
    gap: 18px;
}

.profile-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}

.profile-section-head h2 {
    margin-bottom: 8px;
}

.profile-section-head p {
    margin: 0;
    color: #55667d;
}

.profile-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.profile-summary-card {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #f8fbff;
}

.profile-summary-card span {
    color: var(--accent);
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.profile-summary-card strong {
    font-size: 1rem;
    line-height: 1.6;
}

.profile-note {
    padding: 14px 16px;
    border: 1px dashed var(--border);
    border-radius: 16px;
    background: linear-gradient(180deg, #fbfdff 0%, #f4f8ff 100%);
    color: #55667d;
    line-height: 1.8;
}

.profile-action-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.profile-action-row .primary-button,
.profile-action-row .secondary-button {
    width: auto;
    max-width: none;
    min-width: 180px;
}

.points-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 999px;
    background: rgba(79, 143, 232, 0.12);
    color: var(--accent);
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
}

.saved-select {
    display: grid;
    gap: 12px;
}

.active-avatar-preview {
    display: grid;
    gap: 12px;
    margin: 18px 0 16px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(180deg, #f9fbff 0%, #eef5ff 100%);
}

.active-avatar-preview--empty {
    background: linear-gradient(180deg, #fcfdff 0%, #f3f7fd 100%);
}

.active-avatar-frame {
    position: relative;
    aspect-ratio: 1 / 1;
    width: min(260px, 100%);
    margin: 0 auto;
    border-radius: 18px;
    border: 1px solid rgba(209, 221, 233, 0.95);
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.65), transparent 42%),
        linear-gradient(180deg, #f8fbff 0%, #eef4fc 100%);
}

.active-avatar-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.active-avatar-layer--background { z-index: 0; }
.active-avatar-layer--body { z-index: 2; }
.active-avatar-layer--eyes { z-index: 3; }
.active-avatar-layer--nose { z-index: 4; }
.active-avatar-layer--mouth { z-index: 5; }
.active-avatar-layer--shoes { z-index: 6; }
.active-avatar-layer--bottoms { z-index: 7; }
.active-avatar-layer--tops { z-index: 8; }
.active-avatar-layer--onepiece { z-index: 9; }
.active-avatar-layer--accessory1 { z-index: 10; }
.active-avatar-layer--accessory2 { z-index: 11; }
.active-avatar-layer--hair { z-index: 12; }

.active-avatar-copy {
    display: grid;
    gap: 4px;
    text-align: center;
}

.active-avatar-copy strong {
    font-size: 1rem;
}

.active-avatar-copy span {
    color: #5c6c82;
    line-height: 1.6;
}

.profile-avatar-choice-list {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.profile-avatar-choice {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #f8fbff;
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.profile-avatar-choice.is-selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(79, 143, 232, 0.12);
    background: #f4f8ff;
}

.profile-avatar-choice input {
    margin: 0;
}

.profile-avatar-choice-frame {
    position: relative;
    width: min(180px, 100%);
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    border-radius: 16px;
    border: 1px solid rgba(209, 221, 233, 0.95);
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.65), transparent 42%),
        linear-gradient(180deg, #f8fbff 0%, #eef4fc 100%);
}

.profile-avatar-choice-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.profile-avatar-choice-layer--background { z-index: 0; }
.profile-avatar-choice-layer--body { z-index: 2; }
.profile-avatar-choice-layer--eyes { z-index: 3; }
.profile-avatar-choice-layer--nose { z-index: 4; }
.profile-avatar-choice-layer--mouth { z-index: 5; }
.profile-avatar-choice-layer--shoes { z-index: 6; }
.profile-avatar-choice-layer--bottoms { z-index: 7; }
.profile-avatar-choice-layer--tops { z-index: 8; }
.profile-avatar-choice-layer--onepiece { z-index: 9; }
.profile-avatar-choice-layer--accessory1 { z-index: 10; }
.profile-avatar-choice-layer--accessory2 { z-index: 11; }
.profile-avatar-choice-layer--hair { z-index: 12; }

.profile-avatar-choice-copy {
    display: grid;
    gap: 4px;
}

.profile-avatar-choice-copy strong {
    font-size: 1rem;
}

.profile-avatar-choice-copy span,
.profile-avatar-choice-copy em {
    color: #5c6c82;
    line-height: 1.6;
    font-style: normal;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #f8fbff;
}

.admin-form {
    padding: 0;
    border: none;
    background: transparent;
    gap: 14px;
}

.admin-form label {
    gap: 6px;
}

@media (max-width: 960px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
}

.auth-form {
    display: grid;
    gap: 18px;
    padding: 24px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
}

.auth-form label {
    display: grid;
    gap: 8px;
    font-weight: 600;
}

.auth-form input,
.auth-form select,
.auth-form textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    color: var(--text);
}

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

.points-form {
    padding: 24px;
}

.points-form select {
    width: 100%;
}

.points-form .primary-button {
    max-width: 320px;
}

.legal-notice-page {
    max-width: 1040px;
}

.legal-notice-card {
    display: grid;
    gap: 18px;
}

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

.legal-notice-item {
    display: grid;
    gap: 8px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #f8fbff;
}

.legal-notice-item span {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.03em;
}

.legal-notice-item strong {
    font-size: 0.98rem;
    line-height: 1.7;
    font-weight: 600;
    color: var(--text);
}

.legal-notice-block {
    padding: 18px 20px;
    border: 1px dashed var(--border);
    border-radius: 18px;
    background: linear-gradient(180deg, #fbfdff 0%, #f4f8ff 100%);
}

.legal-notice-block h3 {
    margin: 0 0 10px;
    font-size: 1.05rem;
}

.legal-notice-block ul {
    margin: 0;
    padding-left: 1.2em;
    color: #55667d;
    line-height: 1.8;
}

.legal-notice-form {
    align-items: stretch;
}

.legal-notice-form .secondary-button {
    max-width: 320px;
}

.error-message {
    color: #b93a3a;
    background: #ffecec;
    border: 1px solid #f2c3c3;
    padding: 12px 14px;
    border-radius: 12px;
}

.success-message {
    color: #23663a;
    background: #eaf7ef;
    border: 1px solid #bfe2ca;
    padding: 12px 14px;
    border-radius: 12px;
}

.form-note {
    margin: 0;
    font-size: 0.95rem;
    color: #5f7186;
}

.form-note a {
    color: var(--accent);
}

.secondary-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 320px;
    padding: 12px 18px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    transition: background .2s ease, border-color .2s ease;
}

.secondary-button:hover {
    background: #f4f8ff;
    border-color: var(--accent);
}

.admin-page .secondary-button,
.admin-upload-page .secondary-button,
.admin-actions-inline .secondary-button {
    width: auto;
    max-width: none;
}

.home-links-page {
    max-width: 1320px;
}

.home-links-card {
    padding: clamp(24px, 3vw, 40px);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 18px 45px rgba(63, 94, 174, 0.08);
}

.home-links-header {
    display: grid;
    gap: 8px;
    margin-bottom: 28px;
}

.home-links-header h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.4rem);
}

.home-links-header p {
    max-width: 72ch;
    line-height: 1.8;
}

.home-links-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 24px;
    align-items: stretch;
}

.home-links-hero-copy {
    padding: 22px;
    border-radius: 22px;
    background: linear-gradient(180deg, #f9fbff 0%, #eef4ff 100%);
    border: 1px solid var(--border);
    display: grid;
    gap: 10px;
}

.home-links-hero-copy h2 {
    margin: 0;
    font-size: clamp(1.4rem, 2vw, 2rem);
}

.home-links-hero-copy p {
    line-height: 1.8;
}

.home-links-hero-actions {
    display: grid;
    gap: 12px;
    align-content: start;
}

.home-links-hero-actions .primary-button,
.home-links-hero-actions .secondary-button {
    width: 100%;
    max-width: none;
}

.chat-page {
    max-width: 1420px;
}

.chat-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.chat-summary-card {
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 12px 30px rgba(63, 94, 174, 0.06);
    display: grid;
    gap: 6px;
}

.chat-summary-card span,
.chat-room-badge {
    display: inline-flex;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(79, 143, 232, 0.12);
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.chat-summary-card strong {
    font-size: 1.35rem;
}

.chat-summary-card p {
    line-height: 1.7;
}

.chat-summary-card--link {
    color: inherit;
    text-decoration: none;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.chat-summary-card--link:hover {
    transform: translateY(-3px);
    border-color: rgba(79, 143, 232, 0.58);
    box-shadow: 0 18px 34px rgba(63, 94, 174, 0.12);
}

.suspension-page {
    max-width: 960px;
}

.suspension-card,
.suspension-contact-card,
.guideline-lead-card,
.guideline-card,
.guideline-policy-card {
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--card);
    box-shadow: 0 12px 30px rgba(63, 94, 174, 0.06);
}

.suspension-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 18px;
    padding: 24px;
    margin-bottom: 18px;
    border-color: #efb2b2;
    background: linear-gradient(145deg, #fff8f8 0%, #ffffff 62%);
}

.suspension-card h2,
.suspension-contact-card h2,
.guideline-lead-card h2,
.guideline-card h2,
.guideline-policy-card h2 {
    margin: 0 0 10px;
}

.suspension-card p,
.suspension-contact-card p,
.guideline-lead-card p,
.guideline-card p,
.guideline-policy-card p {
    line-height: 1.8;
}

.suspension-warning-mark {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #d94a4a;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 800;
}

.suspension-details {
    display: grid;
    gap: 10px;
    margin: 18px 0 0;
}

.suspension-details div,
.suspension-account-email {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #f5f8fc;
}

.suspension-details dt,
.suspension-account-email span {
    color: var(--accent);
    font-size: 0.84rem;
    font-weight: 700;
}

.suspension-details dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.suspension-contact-card {
    padding: 24px;
}

.suspension-contact-form {
    margin-top: 16px;
    padding: 0;
    border: 0;
    background: transparent;
}

.suspension-contact-form textarea {
    min-height: 180px;
}

.contact-honeypot {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
}

.suspension-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
}

.suspension-actions .secondary-button {
    width: auto;
}

.chat-guidelines-page {
    max-width: 1220px;
}

.guideline-lead-card,
.guideline-policy-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 28px;
    padding: 26px;
}

.guideline-lead-card {
    margin-bottom: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #edf6ff 100%);
}

.guideline-lead-card .primary-button,
.guideline-policy-card .secondary-button {
    width: auto;
    min-width: 220px;
}

.guideline-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.guideline-card {
    position: relative;
    min-height: 230px;
    padding: 24px;
    overflow: hidden;
}

.guideline-number {
    display: block;
    margin-bottom: 30px;
    color: var(--accent);
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.guideline-card::after {
    content: '';
    position: absolute;
    top: -54px;
    right: -54px;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: rgba(79, 143, 232, 0.08);
}

.chat-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 22px;
    align-items: start;
}

.chat-panel,
.chat-sidebar-panel,
.chat-public-profile-card,
.chat-room-hero,
.chat-message-form,
.chat-message-list {
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--card);
    box-shadow: 0 12px 30px rgba(63, 94, 174, 0.06);
}

.chat-panel,
.chat-sidebar-panel {
    padding: 20px;
}

.chat-form {
    padding: 0;
    border: none;
    background: transparent;
}

.chat-form textarea {
    min-height: 110px;
}

.chat-room-grid {
    display: grid;
    gap: 14px;
}

.chat-room-card {
    display: grid;
    gap: 12px;
    padding: 16px 18px;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.chat-room-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 14px 26px rgba(63, 94, 174, 0.10);
}

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

.chat-room-card-head strong {
    font-size: 1.05rem;
}

.chat-room-card-head p {
    margin-top: 6px;
    color: #5c6c82;
    line-height: 1.65;
}

.chat-room-card-meta,
.chat-room-card-foot {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    color: #5c6c82;
    font-size: 0.9rem;
}

.chat-room-card-meta span,
.chat-room-card-foot span {
    padding: 6px 10px;
    border-radius: 999px;
    background: #f3f7fd;
}

.chat-room-card-excerpt {
    color: #2f4151;
    line-height: 1.7;
}

.chat-room-card-foot {
    justify-content: space-between;
}

.chat-room-hero {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 22px;
    margin-bottom: 18px;
}

.chat-room-hero h2 {
    margin: 6px 0 10px;
    font-size: clamp(1.5rem, 2vw, 2.1rem);
}

.chat-room-actions {
    display: grid;
    gap: 10px;
    align-content: start;
    min-width: min(100%, 320px);
}

.chat-inline-form {
    margin: 0;
}

.chat-room-grid-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 20px;
    align-items: start;
}

.chat-room-main {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.chat-message-form {
    display: grid;
    gap: 16px;
    padding: 18px;
    order: 1;
}

.chat-attachment-tools {
    display: grid;
    gap: 14px;
}

.chat-attachment-tools label {
    display: grid;
    gap: 8px;
    font-weight: 600;
}

.chat-message-list {
    display: grid;
    gap: 12px;
    padding: 18px;
    max-height: min(72vh, 760px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    order: 0;
}

#voice-chat {
    order: 2;
}

.chat-empty {
    padding: 18px;
    border: 1px dashed var(--border);
    border-radius: 16px;
    background: #f8fbff;
    color: #5c6c82;
}

.chat-message {
    display: grid;
    gap: 10px;
    justify-self: start;
    width: min(82%, 720px);
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.chat-message--me {
    justify-self: end;
    border-color: rgba(79, 143, 232, 0.45);
    background: #eaf3ff;
}

.chat-message-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.chat-message-author {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.chat-message-author a {
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
}

.chat-message-meta {
    color: #5c6c82;
    font-size: 0.88rem;
}

.chat-message-body {
    line-height: 1.8;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.chat-message-attachment img {
    max-width: 100%;
}

.chat-room-side {
    display: grid;
    gap: 16px;
}

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

.chat-member-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    background: #f8fbff;
}

.chat-member-item:hover {
    border-color: var(--accent);
    background: #f4f8ff;
}

.chat-public-profile {
    display: grid;
    justify-content: center;
}

.chat-public-profile-card {
    width: min(980px, 100%);
    margin: 0 auto;
    padding: 24px;
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 24px;
    align-items: center;
}

.chat-public-profile-avatar {
    position: relative;
    aspect-ratio: 1 / 1;
    width: 100%;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, #f8fbff 0%, #eef4fc 100%);
}

.chat-public-profile-layer {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.chat-public-profile-copy {
    display: grid;
    gap: 14px;
}

.chat-public-profile-copy h2 {
    margin: 0;
    font-size: clamp(1.6rem, 2.2vw, 2.2rem);
}

.chat-public-profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.chat-public-profile-item {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #f8fbff;
}

.chat-public-profile-item span {
    color: var(--accent);
    font-size: 0.86rem;
    font-weight: 700;
}

.chat-public-profile-item strong {
    line-height: 1.6;
}

.home-links-grid {
    display: grid;
    gap: 12px;
    justify-items: stretch;
}

.home-links-grid .primary-button,
.home-links-grid .secondary-button {
    display: flex;
    width: 100%;
    max-width: none;
    justify-content: center;
}

.home-page {
    max-width: 1240px;
}

.top-nav {
    flex-wrap: wrap;
    align-items: center;
}

.hero-actions,
.workspace-links,
.locked-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.hero-actions .primary-button,
.hero-actions .secondary-button,
.workspace-links .primary-button,
.workspace-links .secondary-button,
.locked-actions .primary-button,
.locked-actions .secondary-button {
    width: auto;
    max-width: none;
    min-width: 160px;
}

.landing-hero {
    align-items: stretch;
}

.landing-copy {
    display: grid;
    gap: 8px;
}

.landing-copy h2,
.section-head h2,
.preview-card h3,
.feature-item h3,
.saved-section h2 {
    line-height: 1.25;
}

.landing-copy h2 {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.landing-copy p {
    max-width: 60ch;
}

.preview-card h3 {
    margin: 16px 0 8px;
}

.preview-card p,
.feature-item p,
.section-head p,
.locked-panel p {
    line-height: 1.7;
}

.preview-frame .preview-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
}

.workspace-section {
    padding: 24px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 16px 42px rgba(98, 127, 179, 0.08);
    backdrop-filter: blur(8px);
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.section-head > div:first-child {
    display: grid;
    gap: 8px;
}

.workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
    gap: 24px;
    align-items: start;
}

.viewer {
    min-height: 640px;
}

.character-card {
    width: min(480px, 100%);
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    background:
        radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.65), transparent 40%),
        linear-gradient(180deg, #f8fbff 0%, #eef4fc 100%);
    border: 1px solid rgba(209, 221, 233, 0.9);
}

.controls {
    gap: 18px;
}

.groups-panel {
    gap: 12px;
}

.group-tab {
    font-weight: 700;
}

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

.no-items {
    padding: 16px;
    margin: 0;
    border: 1px dashed var(--border);
    border-radius: 16px;
    background: #f8fbff;
    color: #5f7186;
}

.locked-panel {
    padding: 22px;
    border: 1px dashed var(--border);
    border-radius: 20px;
    background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
}

.locked-panel h3 {
    margin: 0 0 10px;
}

.lock-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.lock-tag {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: #49617a;
    font-size: 0.88rem;
}

.saved-thumb {
    display: grid;
    gap: 6px;
}

.saved-desc {
    color: #5f7186;
    font-size: 0.95rem;
}

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

.saved-actions button {
    padding: 8px 12px;
    border: none;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.saved-actions .saved-overwrite {
    background: #64748b;
}

.saved-actions .saved-saveas {
    background: #7d6cf1;
}

.saved-actions button:hover {
    filter: brightness(0.96);
}

.saved-section .saved-item {
    align-items: start;
}

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

    .section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .workspace-links {
        justify-content: flex-start;
    }

    .viewer {
        min-height: 520px;
    }
}

@media (max-width: 720px) {
    .hero-actions .primary-button,
    .hero-actions .secondary-button,
    .workspace-links .primary-button,
    .workspace-links .secondary-button,
    .locked-actions .primary-button,
    .locked-actions .secondary-button {
        width: 100%;
        min-width: 0;
    }

    .groups-panel,
    .item-list {
        grid-template-columns: 1fr;
    }

    .saved-item {
        grid-template-columns: 1fr;
    }

    .legal-notice-grid {
        grid-template-columns: 1fr;
    }

    .chat-summary-grid,
    .home-links-hero,
    .chat-layout,
    .chat-room-grid-layout,
    .chat-public-profile-card {
        grid-template-columns: 1fr;
    }

    .chat-room-hero {
        flex-direction: column;
    }

    .chat-room-actions {
        min-width: 0;
    }

    .chat-public-profile-grid {
        grid-template-columns: 1fr;
    }
}

.dressup-page main.workspace-section {
    display: block;
}

.dressup-page .workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(360px, 0.92fr);
    gap: 28px;
    align-items: start;
}

.dressup-page .viewer {
    position: sticky;
    top: 20px;
    align-self: start;
    min-height: clamp(760px, 84vh, 1020px);
    padding: 28px;
}

.dressup-page .character-card {
    width: min(760px, 100%);
}

.dressup-page .controls {
    display: grid;
    gap: 18px;
}

.dressup-page .controls-intro {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 22px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 12px 35px rgba(63, 94, 174, 0.08);
}

.dressup-page .controls-intro h2 {
    margin: 4px 0 8px;
    font-size: clamp(1.5rem, 2vw, 1.95rem);
}

.dressup-page .controls-note {
    margin: 0;
    color: #5c6c88;
    line-height: 1.65;
}

.dressup-page .controls-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(79, 143, 232, 0.12);
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
}

.dressup-page .eyebrow--small {
    margin-bottom: 6px;
    font-size: 0.78rem;
}

.dressup-page .search-field {
    display: grid;
    gap: 8px;
    padding: 18px 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 12px 35px rgba(63, 94, 174, 0.05);
}

.dressup-page .search-field span {
    font-weight: 700;
    color: #2f4151;
}

.dressup-page .search-field input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #f9fbff;
    color: var(--text);
    font-size: 1rem;
}

.dressup-page .search-field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 143, 232, 0.12);
}

.dressup-page .groups-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.dressup-page .group-tab {
    min-height: 48px;
    padding: 13px 14px;
    border-radius: 16px;
    font-weight: 700;
}

.dressup-page .stack-note {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px dashed var(--border);
    background: #f8fbff;
    color: #5c6c88;
    line-height: 1.7;
}

.dressup-page .item-browser {
    display: grid;
    gap: 16px;
    padding: 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 16px 42px rgba(63, 94, 174, 0.08);
}

.dressup-page .browser-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dressup-page .browser-summary {
    display: grid;
    gap: 4px;
}

.dressup-page .browser-summary strong {
    font-size: 1.05rem;
}

.dressup-page .browser-summary span {
    color: #5c6c88;
    font-size: 0.92rem;
}

.dressup-page .item-scroll {
    max-height: clamp(360px, 56vh, 720px);
    overflow: auto;
    padding-right: 4px;
}

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

.dressup-page .item-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    cursor: pointer;
    align-content: start;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.dressup-page .item-card:hover,
.dressup-page .item-card:focus-visible {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 12px 22px rgba(63, 94, 174, 0.12);
}

.dressup-page .item-card.is-active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(79, 143, 232, 0.14), 0 12px 22px rgba(63, 94, 174, 0.12);
}

.dressup-page .item-card.locked {
    cursor: default;
    opacity: 0.78;
}

.dressup-page .item-thumb {
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    background-color: #f7faff;
    background-image:
        linear-gradient(45deg, rgba(176, 196, 222, 0.13) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(176, 196, 222, 0.13) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(176, 196, 222, 0.13) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(176, 196, 222, 0.13) 75%);
    background-size: 24px 24px;
    background-position: 0 0, 0 12px, 12px -12px, -12px 0;
    border: 1px solid rgba(209, 221, 233, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.dressup-page .item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.dressup-page .item-copy {
    display: grid;
    gap: 6px;
}

.dressup-page .item-copy strong {
    font-size: 0.96rem;
    line-height: 1.35;
    color: var(--text);
}

.dressup-page .item-meta {
    margin: 0;
    color: #5c6c88;
    font-size: 0.88rem;
}

.dressup-page .item-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.dressup-page .item-badge,
.dressup-page .item-select-hint {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}

.dressup-page .item-badge {
    background: rgba(79, 143, 232, 0.12);
    color: var(--accent);
}

.dressup-page .item-select-hint {
    background: #eff5ff;
    color: #33527a;
}

.dressup-page .purchase-button {
    margin: 0;
    padding: 8px 12px;
    border: none;
    border-radius: 12px;
    background: #f0ad4e;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.dressup-page .purchase-button:hover {
    background: #e69539;
}

.dressup-page .browser-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.dressup-page .browser-note {
    margin: 0;
    color: #5c6c88;
    font-size: 0.92rem;
}

.dressup-page .browser-more {
    width: auto;
    max-width: none;
    min-width: 180px;
}

.dressup-page .action-row {
    padding: 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 14px 35px rgba(63, 94, 174, 0.08);
}

.dressup-page .action-row .primary-button,
.dressup-page .action-row .secondary-button {
    width: 100%;
    max-width: none;
}

.dressup-page .saved-section {
    margin-top: 0;
}

.dressup-page .saved-gallery-section {
    padding: 20px;
}

.dressup-page .saved-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.dressup-page .saved-section-head h2 {
    margin: 0 0 6px;
    font-size: 1.35rem;
}

.dressup-page .saved-section-head p {
    margin: 0;
    color: #5c6c88;
    line-height: 1.6;
}

.dressup-page .saved-section-badge {
    flex: 0 0 auto;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(79, 143, 232, 0.12);
    color: var(--accent);
    font-weight: 700;
}

.dressup-page .saved-gallery {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.dressup-page .saved-gallery .saved-item {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 12px 26px rgba(63, 94, 174, 0.08);
}

.dressup-page .saved-gallery .saved-item.is-active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(79, 143, 232, 0.14), 0 12px 26px rgba(63, 94, 174, 0.10);
}

.dressup-page .saved-preview-card {
    width: 100%;
    display: grid;
    gap: 10px;
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.dressup-page .saved-preview-card:focus-visible {
    outline: 3px solid rgba(79, 143, 232, 0.22);
    outline-offset: 3px;
    border-radius: 18px;
}

.dressup-page .saved-preview-frame {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 18px;
    border: 1px solid rgba(209, 221, 233, 0.95);
    background:
        radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.62), transparent 42%),
        linear-gradient(180deg, #f8fbff 0%, #eef4fc 100%);
    overflow: hidden;
}

.dressup-page .saved-preview-frame img {
    width: 100%;
    height: 100%;
    border-radius: 0;
    object-fit: contain;
}

.dressup-page .saved-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.dressup-page .saved-layer--background { z-index: 0; }
.dressup-page .saved-layer--body { z-index: 2; }
.dressup-page .saved-layer--eyes { z-index: 3; }
.dressup-page .saved-layer--nose { z-index: 4; }
.dressup-page .saved-layer--mouth { z-index: 5; }
.dressup-page .saved-layer--shoes { z-index: 6; }
.dressup-page .saved-layer--bottoms { z-index: 7; }
.dressup-page .saved-layer--tops { z-index: 8; }
.dressup-page .saved-layer--onepiece { z-index: 9; }
.dressup-page .saved-layer--accessory1 { z-index: 10; }
.dressup-page .saved-layer--accessory2 { z-index: 11; }
.dressup-page .saved-layer--hair { z-index: 12; }

.dressup-page .saved-preview-caption {
    display: grid;
    gap: 4px;
}

.dressup-page .saved-preview-caption strong {
    font-size: 1rem;
    line-height: 1.35;
}

.dressup-page .saved-preview-caption span {
    color: #5c6c88;
    font-size: 0.9rem;
}

.dressup-page .saved-active-pill {
    display: inline-flex;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(79, 143, 232, 0.12);
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 700;
}

.dressup-page .saved-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dressup-page .saved-actions button {
    flex: 1 1 0;
    min-width: 72px;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.dressup-page .saved-actions button:hover {
    transform: translateY(-1px);
    border-color: var(--accent);
    background: #f4f8ff;
}

.dressup-page .saved-actions .saved-overwrite {
    background: rgba(79, 143, 232, 0.08);
}

.dressup-page .saved-actions .saved-saveas {
    background: #eef5ff;
}

.dressup-page .saved-actions .saved-delete {
    border-color: #f0b5b5;
    background: #fff3f3;
    color: #b13a3a;
}

.dressup-page .saved-actions .saved-delete:hover {
    border-color: #e47777;
    background: #ffe6e6;
}

.dressup-page .saved-empty {
    margin: 0;
    padding: 18px;
    border: 1px dashed var(--border);
    border-radius: 18px;
    color: #5c6c88;
    background: #f8fbff;
}

@media (max-width: 1100px) {
    .dressup-page .workspace-grid {
        grid-template-columns: 1fr;
    }

    .dressup-page .viewer {
        position: static;
        min-height: 620px;
    }
}

@media (max-width: 720px) {
    .dressup-page .workspace-section {
        padding: 18px;
    }

    .dressup-page .controls-intro {
        flex-direction: column;
    }

    .dressup-page .groups-panel {
        grid-template-columns: 1fr;
    }

    .dressup-page .browser-head,
    .dressup-page .browser-foot {
        flex-direction: column;
        align-items: stretch;
    }

    .dressup-page .browser-more {
        width: 100%;
    }

    .dressup-page .item-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dressup-page .viewer {
        min-height: 520px;
        padding: 18px;
    }

    .dressup-page .character-card {
        width: min(100%, 100%);
    }

    .dressup-page .saved-gallery {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 430px) {
    .dressup-page .item-list {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Community portal, friends and live voice chat */
.site-home {
    background:
        radial-gradient(circle at 12% 12%, rgba(73, 151, 225, .18), transparent 28rem),
        radial-gradient(circle at 90% 80%, rgba(50, 183, 151, .12), transparent 32rem),
        linear-gradient(145deg, #edf5fb 0%, #f9fbfc 48%, #eef7f4 100%);
}

.home-links-page {
    width: min(100%, 1480px);
    min-height: 100vh;
    padding: clamp(18px, 3vw, 46px);
}

.home-links-card {
    min-height: calc(100vh - clamp(36px, 6vw, 92px));
    padding: clamp(22px, 4vw, 58px);
    border-radius: 34px;
    box-shadow: var(--shadow);
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(18px);
}

.home-site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 0 0 clamp(42px, 6vw, 86px);
    text-align: left;
}

.home-brand {
    color: var(--text);
    font-weight: 900;
    letter-spacing: .28em;
    text-decoration: none;
}

.home-site-header .top-nav {
    justify-content: flex-end;
    margin: 0;
}

.home-portal-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr);
    gap: clamp(34px, 6vw, 90px);
    align-items: center;
    min-height: 450px;
}

.home-portal-copy {
    max-width: 720px;
}

.home-portal-copy h1 {
    margin: 0 0 24px;
    color: #182b3d;
    font-size: clamp(3rem, 6.2vw, 6rem);
    line-height: 1.04;
    letter-spacing: -.055em;
}

.home-portal-copy > p {
    max-width: 42rem;
    color: var(--ink-soft);
    font-size: clamp(1rem, 1.6vw, 1.25rem);
    line-height: 1.9;
}

.home-portal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.home-portal-actions .primary-button,
.home-portal-actions .secondary-button {
    width: auto;
    min-width: 180px;
    max-width: none;
}

.home-portal-visual {
    position: relative;
    min-height: 420px;
    border-radius: 32px;
    overflow: hidden;
    background:
        linear-gradient(140deg, rgba(29, 86, 139, .96), rgba(31, 120, 130, .86)),
        #205786;
    box-shadow: 0 30px 70px rgba(31, 88, 130, .26);
}

.portal-orbit {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 50%;
}

.portal-orbit--large { width: 440px; height: 440px; top: -140px; right: -70px; }
.portal-orbit--small { width: 260px; height: 260px; bottom: -100px; left: -60px; }

.portal-preview {
    position: absolute;
    display: grid;
    gap: 8px;
    min-width: 250px;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 22px;
    color: #fff;
    background: rgba(255, 255, 255, .12);
    box-shadow: 0 18px 40px rgba(8, 39, 66, .2);
    backdrop-filter: blur(18px);
}

.portal-preview span { font-size: .76rem; font-weight: 800; letter-spacing: .2em; opacity: .76; }
.portal-preview strong { font-size: 1.3rem; }
.portal-preview p { color: rgba(255,255,255,.78); }
.portal-preview--chat { top: 72px; left: 44px; }
.portal-preview--friends { right: 38px; bottom: 64px; }

.portal-signal {
    position: absolute;
    right: 45px;
    top: 42px;
    display: flex;
    gap: 5px;
    align-items: end;
    height: 38px;
}

.portal-signal i { display: block; width: 7px; border-radius: 5px; background: #a6f1d4; animation: signal-wave 1.15s ease-in-out infinite alternate; }
.portal-signal i:nth-child(1) { height: 12px; }
.portal-signal i:nth-child(2) { height: 24px; animation-delay: -.45s; }
.portal-signal i:nth-child(3) { height: 36px; animation-delay: -.2s; }
.portal-signal i:nth-child(4) { height: 20px; animation-delay: -.65s; }

@keyframes signal-wave { to { transform: scaleY(.48); opacity: .58; } }

.home-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: clamp(48px, 6vw, 84px);
}

.home-feature-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 16px;
    align-items: start;
    padding: 22px;
    color: inherit;
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: #fff;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.home-feature-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 18px 38px rgba(42, 90, 137, .11); }
.home-feature-number { color: var(--accent); font-weight: 900; font-size: .8rem; letter-spacing: .14em; }
.home-feature-card strong { display: block; margin-bottom: 8px; font-size: 1.05rem; }
.home-feature-card p { line-height: 1.65; }
.home-feature-card em { color: var(--accent); font-style: normal; font-weight: 800; }

.home-site-footer {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
    color: #6a7c8e;
    font-size: .88rem;
}

.home-site-footer a { color: var(--accent-dark); }

.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 320px;
    padding: 13px 18px;
    border: 1px solid #efb4b4;
    border-radius: 14px;
    background: #fff4f4;
    color: #af3434;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.voice-chat-panel {
    padding: 20px;
    border: 1px solid #bdd8e7;
    border-radius: 22px;
    background: linear-gradient(145deg, #f7fcff 0%, #edf8f7 100%);
    box-shadow: 0 14px 34px rgba(32, 100, 122, .08);
}

.voice-chat-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
}

.voice-chat-head h2 { margin: 0 0 8px; }
.voice-chat-head p { line-height: 1.65; }
.voice-live-indicator { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 999px; background: #fff; color: #758797; font-size: .76rem; font-weight: 900; letter-spacing: .12em; }
.voice-live-indicator i { width: 8px; height: 8px; border-radius: 50%; background: #9aa9b5; }
.voice-chat-panel[data-state="connected"] .voice-live-indicator { color: #087657; }
.voice-chat-panel[data-state="connected"] .voice-live-indicator i { background: #12b886; box-shadow: 0 0 0 5px rgba(18,184,134,.12); }

.voice-chat-controls,
.public-profile-actions,
.profile-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.voice-chat-controls .primary-button,
.voice-chat-controls .secondary-button,
.voice-chat-controls .danger-button,
.public-profile-actions .primary-button,
.public-profile-actions .secondary-button { width: auto; min-width: 130px; }

.voice-chat-status {
    margin-top: 14px;
    padding: 11px 13px;
    border-radius: 13px;
    background: rgba(255,255,255,.72);
    color: #486374;
}

.voice-chat-panel[data-state="error"] .voice-chat-status { color: #a33a3a; background: #fff0f0; }
.voice-participant-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.voice-participant-list li { padding: 7px 11px; border-radius: 999px; background: #fff; border: 1px solid var(--border); font-size: .88rem; }
.voice-participant-list li.is-self { border-color: #8acdb9; color: #087657; }

.friend-invite-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #f8fbff;
}

.friend-invite-list legend { padding: 0 6px; font-weight: 700; }
.friend-invite-list label { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 10px; background: #fff; cursor: pointer; }
.friend-invite-list input { width: auto; margin: 0; }

.friends-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .42fr); gap: 20px; align-items: start; }
.friends-main { display: grid; gap: 20px; }
.friend-search-form { display: grid; gap: 9px; }
.friend-search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.friend-search-row input { min-width: 0; padding: 13px 15px; border: 1px solid var(--border); border-radius: 13px; font: inherit; }
.friend-search-row .primary-button { width: auto; }
.friend-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 18px; }
.friend-card { display: grid; grid-template-columns: 116px minmax(0,1fr); gap: 15px; padding: 14px; border: 1px solid var(--border); border-radius: 18px; background: #f9fbfe; }
.avatar-stack { position: relative; aspect-ratio: 1/1; overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: #eff5fb; }
.avatar-stack-layer { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.friend-card-copy { min-width: 0; }
.friend-card-copy h3 { margin: 10px 0 5px; overflow-wrap: anywhere; }
.friend-card-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.friend-card-actions form { margin: 0; }
.friend-card-actions .primary-button,
.friend-card-actions .secondary-button,
.friend-card-actions .danger-button { width: auto; min-width: 0; padding: 9px 12px; font-size: .88rem; }
.friend-list { display: grid; gap: 10px; }
.friend-list-item,
.friend-request-item { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 13px 14px; border: 1px solid var(--border); border-radius: 14px; background: #f8fbff; }
.friend-list-item span { color: #65778a; font-size: .88rem; }
.friend-list-person { display: flex; align-items: center; gap: 12px; min-width: 0; color: inherit; text-decoration: none; }
.friend-list-person > div:not(.friend-list-avatar) { display: grid; gap: 4px; min-width: 0; }
.friend-list-avatar { flex: 0 0 64px; width: 64px; border-radius: 13px; }

.chat-public-profile-layer--background,
.avatar-stack-layer--background { z-index: 0; }
.chat-public-profile-layer--body,
.avatar-stack-layer--body { z-index: 2; }
.chat-public-profile-layer--eyes,
.avatar-stack-layer--eyes { z-index: 3; }
.chat-public-profile-layer--nose,
.avatar-stack-layer--nose { z-index: 4; }
.chat-public-profile-layer--mouth,
.avatar-stack-layer--mouth { z-index: 5; }
.chat-public-profile-layer--shoes,
.avatar-stack-layer--shoes { z-index: 6; }
.chat-public-profile-layer--bottoms,
.avatar-stack-layer--bottoms { z-index: 7; }
.chat-public-profile-layer--tops,
.avatar-stack-layer--tops { z-index: 8; }
.chat-public-profile-layer--onepiece,
.avatar-stack-layer--onepiece { z-index: 9; }
.chat-public-profile-layer--accessory1,
.avatar-stack-layer--accessory1 { z-index: 10; }
.chat-public-profile-layer--accessory2,
.avatar-stack-layer--accessory2 { z-index: 11; }
.chat-public-profile-layer--hair,
.avatar-stack-layer--hair { z-index: 12; }

.relationship-badge { display: inline-flex; width: fit-content; align-items: center; padding: 6px 10px; border-radius: 999px; background: #e8f7f2; color: #087657; font-size: .82rem; font-weight: 800; }
.privacy-note { padding: 13px 15px; border-left: 3px solid #8ba8c1; background: #f5f8fb; line-height: 1.7; }
.chat-public-profile-item strong { overflow-wrap: anywhere; }
.chat-message-attachment img { display: block; width: min(100%, 520px); max-height: 520px; object-fit: contain; border-radius: 14px; }

@media (max-width: 1100px) {
    .home-portal-hero { grid-template-columns: 1fr 400px; gap: 38px; }
    .home-feature-grid { grid-template-columns: 1fr; }
    .friends-layout { grid-template-columns: 1fr; }
    .chat-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .guideline-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 840px) {
    .home-site-header { align-items: flex-start; flex-direction: column; margin-bottom: 38px; }
    .home-site-header .top-nav { justify-content: flex-start; }
    .home-portal-hero { grid-template-columns: 1fr; }
    .home-portal-visual { min-height: 340px; }
    .portal-preview--chat { top: 42px; left: 24px; }
    .portal-preview--friends { right: 24px; bottom: 38px; }
}

@media (max-width: 720px) {
    .app-container { padding: 18px 12px; }
    .auth-page { margin: 12px auto; padding: 18px 12px; }
    header { margin-bottom: 20px; }
    .top-nav { justify-content: center; gap: 8px; }
    .top-nav .divider { display: none; }
    .top-nav .text-link { padding: 7px 9px; border-radius: 999px; background: rgba(79,143,232,.08); }
    .home-links-page { padding: 10px; }
    .home-links-card { min-height: calc(100vh - 20px); padding: 22px 16px; border-radius: 24px; }
    .home-portal-copy h1 { font-size: clamp(2.55rem, 14vw, 4.2rem); }
    .home-portal-actions .primary-button,
    .home-portal-actions .secondary-button { width: 100%; }
    .home-portal-visual { min-height: 330px; }
    .portal-preview { min-width: 0; width: calc(100% - 48px); }
    .portal-preview--friends { left: 24px; right: auto; }
    .home-feature-card { grid-template-columns: auto minmax(0, 1fr); }
    .home-feature-card em { grid-column: 2; }
    .home-site-footer { flex-direction: column; }
    .chat-summary-grid { grid-template-columns: 1fr; }
    .guideline-grid { grid-template-columns: 1fr; }
    .guideline-lead-card,
    .guideline-policy-card { align-items: stretch; flex-direction: column; padding: 18px; }
    .guideline-lead-card .primary-button,
    .guideline-policy-card .secondary-button { width: 100%; min-width: 0; }
    .suspension-card { grid-template-columns: 1fr; padding: 18px; }
    .suspension-contact-card { padding: 18px; }
    .suspension-actions { align-items: stretch; flex-direction: column; }
    .suspension-actions .secondary-button { width: 100%; }
    .chat-message { width: 92%; }
    .chat-message-head { align-items: flex-start; flex-direction: column; gap: 4px; }
    .chat-panel,
    .chat-sidebar-panel,
    .chat-public-profile-card,
    .chat-room-hero,
    .chat-message-form,
    .chat-message-list,
    .voice-chat-panel { padding: 16px; border-radius: 18px; }
    .voice-chat-head { flex-direction: column; }
    .voice-chat-controls .primary-button,
    .voice-chat-controls .secondary-button,
    .voice-chat-controls .danger-button,
    .public-profile-actions .primary-button,
    .public-profile-actions .secondary-button { width: 100%; }
    .friend-search-row { grid-template-columns: 1fr; }
    .friend-search-row .primary-button { width: 100%; }
    .friend-card { grid-template-columns: 92px minmax(0, 1fr); }
    .friend-list-item,
    .friend-request-item { align-items: stretch; flex-direction: column; }
    .profile-summary-grid { grid-template-columns: 1fr; }
    .profile-section,
    .admin-panel { padding: 17px; }
    .profile-section-head { flex-direction: column; }
    .profile-action-row .primary-button,
    .profile-action-row .secondary-button { width: 100%; min-width: 0; }
    .profile-avatar-choice { grid-template-columns: auto minmax(0, 1fr); padding: 10px; }
    .profile-avatar-choice-frame { width: min(132px, 100%); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
