:root {
    --bg-main: #f0f2f5;
    --bg-surface: rgba(255, 255, 255, 0.7);
    --primary: #E5007F; /* 櫻坂ピンク */
    --primary-strong: #B90067;
    --primary-rgb: 229, 0, 127;
    --primary-soft: #fdf2f8;
    --primary-gradient: linear-gradient(135deg, #E5007F 0%, #C21876 100%);
    --secondary: #6c757d;
    --text-main: #1c1e21;
    --text-muted: #65676b;
    --border-color: rgba(224, 224, 224, 0.5);
    --radius-lg: 16px;
    --radius-md: 12px;
    --shadow-subtle: 0 4px 12px rgba(0,0,0,0.05);
    --shadow-bold: 0 10px 30px rgba(var(--primary-rgb), 0.1);
    --font-family: 'Noto Sans JP', 'Poppins', sans-serif;
}

body.theme-nogizaka {
    --primary: #7B3FA0;
    --primary-strong: #663399;
    --primary-rgb: 123, 63, 160;
    --primary-soft: #f6effa;
    --primary-gradient: linear-gradient(135deg, #74409A 0%, #8F54B8 100%);
}

body.theme-hinatazaka {
    --primary: #177DA6;
    --primary-strong: #0F6D94;
    --primary-rgb: 23, 125, 166;
    --primary-soft: #edf8fc;
    --primary-gradient: linear-gradient(135deg, #177DA6 0%, #267EA5 100%);
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 0% 0%, rgba(var(--primary-rgb), 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(var(--primary-rgb), 0.05) 0px, transparent 50%);
    color: var(--text-main);
    letter-spacing: 0;
    min-height: 100vh;
    --bs-primary: var(--primary);
    --bs-primary-rgb: var(--primary-rgb);
    --bs-link-color: var(--primary);
    --bs-link-hover-color: var(--primary-strong);
}

.text-primary {
    color: var(--primary) !important;
}

.bg-primary {
    background-color: var(--primary) !important;
}

.bg-soft-primary {
    background-color: rgba(var(--primary-rgb), 0.1) !important;
}

.bg-primary-subtle {
    background-color: rgba(var(--primary-rgb), 0.12) !important;
}

.border-primary {
    --bs-border-opacity: 1;
    border-color: rgba(var(--primary-rgb), var(--bs-border-opacity)) !important;
}

.border-primary-subtle {
    border-color: rgba(var(--primary-rgb), 0.24) !important;
}

.btn-primary {
    --bs-btn-bg: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: var(--primary-strong);
    --bs-btn-hover-border-color: var(--primary-strong);
    --bs-btn-active-bg: var(--primary-strong);
    --bs-btn-active-border-color: var(--primary-strong);
    --bs-btn-disabled-bg: var(--primary);
    --bs-btn-disabled-border-color: var(--primary);
}

.btn-outline-primary {
    --bs-btn-color: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: var(--primary);
    --bs-btn-hover-border-color: var(--primary);
    --bs-btn-active-bg: var(--primary);
    --bs-btn-active-border-color: var(--primary);
    --bs-btn-disabled-color: var(--primary);
    --bs-btn-disabled-border-color: var(--primary);
}

.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* Glassmorphism */
.glass {
    background: var(--bg-surface);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-lg);
}

/* Layout Refinement */
.app-container {
    max-width: 900px;
    margin: 0 auto !important; /* Force center */
    padding: 0 1.5rem;
    min-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    align-items: center; /* Center children horizontally */
    width: 100%;
}

.content-body {
    flex: 1;
    width: 100%;
    max-width: 900px; /* Match container for consistency */
    margin: 0 auto !important;
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Page Section Headers */
.section-header {
    margin-bottom: 2.5rem;
    text-align: center;
}

.section-header h1 {
    font-size: 2.5rem;
    letter-spacing: 0;
    margin-bottom: 0.5rem;
    font-weight: 800;
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.nav-tab-container {
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-tabs-modern {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    padding: 0.5rem;
    border-radius: 50px;
    box-shadow: var(--shadow-subtle);
    gap: 0.5rem;
}

.nav-tabs-modern .nav-link {
    border-radius: 50px;
    padding: 0.6rem 1.2rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-tabs-modern .nav-link:hover {
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
}

.nav-tabs-modern .nav-link.active {
    background: var(--primary);
    color: white !important;
    box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.3);
}

/* Buttons */
.btn-modern {
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.btn-modern:active {
    transform: translateY(0);
}

.btn-modern-primary {
    background: var(--primary-gradient);
    color: white !important;
}

.btn-modern-primary:hover {
    box-shadow: 0 8px 25px rgba(var(--primary-rgb), 0.3);
}

.group-radio-input:checked + .group-radio-label {
    background: var(--primary-gradient) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.24);
}

.group-radio-input:focus-visible + .group-radio-label {
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.18);
}

.btn-modern-quiet {
    background: #ffffff;
    color: var(--text-main) !important;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.btn-modern-quiet:hover {
    color: var(--primary) !important;
    border-color: rgba(var(--primary-rgb), 0.2);
}

/* Home */
.home-page {
    max-width: 960px;
}

.home-hero,
.home-guest {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 1.5rem;
    align-items: stretch;
    padding: 2rem;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(var(--primary-rgb), 0.08)),
        linear-gradient(90deg, rgba(31, 157, 117, 0.08), rgba(245, 179, 1, 0.08));
    box-shadow: var(--shadow-bold);
}

.home-hero-authenticated {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 0.72fr) minmax(190px, 0.54fr);
}

.home-hero::before,
.home-guest::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: repeating-linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.34) 0,
        rgba(255, 255, 255, 0.34) 1px,
        transparent 1px,
        transparent 18px
    );
}

.home-hero > *,
.home-guest > * {
    position: relative;
    z-index: 1;
}

.home-hero-copy,
.home-guest-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.home-eyebrow {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 800;
}

.home-title {
    margin: 0.8rem 0 0.75rem;
    font-size: 2.4rem;
    line-height: 1.18;
    font-weight: 800;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.home-lead {
    max-width: 34rem;
    margin: 0 0 1.35rem;
    color: var(--text-muted);
    font-size: 1.02rem;
    line-height: 1.8;
}

.home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.home-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    align-content: center;
}

.home-stat {
    min-width: 0;
    min-height: 8rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
    padding: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.06);
}

.home-stat span,
.home-stat small {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.home-stat strong {
    color: var(--text-main);
    font-size: 2rem;
    line-height: 1;
}

.home-photo-stack,
.home-preview-shelf {
    min-height: 18rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-photo-card,
.home-preview-photo {
    width: min(78%, 14rem);
    aspect-ratio: 3 / 4;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.35rem;
    padding: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.96)),
        linear-gradient(135deg, rgba(var(--primary-rgb), 0.22), rgba(31, 157, 117, 0.14));
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.12);
}

.home-photo-card span,
.home-preview-photo span {
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.home-photo-card strong,
.home-preview-photo strong {
    color: var(--text-main);
    font-size: 1.28rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.home-photo-card small,
.home-preview-photo small {
    color: var(--text-muted);
    font-weight: 700;
}

.home-photo-card-back {
    position: absolute;
    transform: rotate(-8deg) translate(-2.6rem, -0.4rem);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.92)),
        linear-gradient(135deg, rgba(245, 179, 1, 0.34), rgba(var(--primary-rgb), 0.1));
}

.home-photo-card-front {
    position: absolute;
    transform: rotate(5deg) translate(2.1rem, 1rem);
}

.home-preview-shelf {
    gap: 0.75rem;
}

.home-preview-photo {
    position: absolute;
    width: 9rem;
}

.home-preview-photo.is-owned {
    transform: rotate(-7deg) translate(-5.2rem, 0.35rem);
}

.home-preview-photo.is-wish {
    transform: rotate(3deg) translate(0.6rem, -0.55rem);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.94)),
        linear-gradient(135deg, rgba(245, 179, 1, 0.34), rgba(var(--primary-rgb), 0.12));
}

.home-preview-photo.is-oshi {
    transform: rotate(9deg) translate(5.5rem, 0.65rem);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.94)),
        linear-gradient(135deg, rgba(31, 157, 117, 0.28), rgba(var(--primary-rgb), 0.14));
}

.home-workspace-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.home-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow-subtle);
}

.home-panel-heading {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.home-panel-heading h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}

.home-panel-heading p {
    margin: 0.15rem 0 0;
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.home-panel-icon {
    width: 2.6rem;
    height: 2.6rem;
    flex: 0 0 2.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
}

.home-featured-photo {
    display: grid;
    grid-template-columns: 4.25rem minmax(0, 1fr);
    gap: 0.9rem;
    align-items: center;
    min-width: 0;
}

.home-featured-shot {
    width: 4.25rem;
    height: 5.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.96)),
        linear-gradient(135deg, rgba(var(--primary-rgb), 0.24), rgba(245, 179, 1, 0.2));
    color: var(--primary);
    font-weight: 900;
}

.home-featured-photo strong,
.home-featured-photo span,
.home-featured-photo small {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
}

.home-featured-photo strong {
    font-size: 1.18rem;
}

.home-featured-photo span,
.home-featured-photo small,
.home-empty-state {
    color: var(--text-muted);
}

.home-empty-state {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 5.6rem;
    padding: 0.8rem;
    border-radius: 8px;
    background: #f8f9fa;
    font-size: 0.9rem;
    font-weight: 700;
}

.home-empty-state i {
    color: var(--primary);
    font-size: 1.8rem;
}

.home-panel-link,
.home-section-action {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    color: var(--primary);
    font-weight: 800;
    text-decoration: none;
}

.home-panel-link {
    margin-top: auto;
    padding-top: 0.25rem;
}

.home-panel-link:hover,
.home-section-action:hover {
    color: var(--primary-strong);
}

.home-progress-track {
    width: 100%;
    height: 0.7rem;
    overflow: hidden;
    border-radius: 999px;
    background: #edf0f3;
}

.home-progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), #1f9d75);
}

.home-progress-copy {
    color: var(--text-muted);
    font-weight: 700;
}

.home-progress-copy strong {
    color: var(--text-main);
    font-size: 2rem;
}

.oshi-shelf-section {
    margin-bottom: 2rem;
}

.home-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.home-section-title h2 {
    margin: 0.5rem 0 0;
    font-size: 1.5rem;
    font-weight: 800;
}

.home-section-action {
    width: 2.8rem;
    height: 2.8rem;
    flex: 0 0 2.8rem;
    justify-content: center;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: var(--shadow-subtle);
}

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

.oshi-shelf-card,
.oshi-shelf-empty {
    min-width: 0;
    padding: 1.15rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow-subtle);
}

.oshi-shelf-card {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
}

.oshi-card-header {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.oshi-card-header span {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.oshi-card-header strong {
    font-size: 1.25rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.oshi-level-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.35rem;
}

.oshi-level-row span {
    height: 0.45rem;
    border-radius: 999px;
    background: #e9ecef;
}

.oshi-level-row span.active {
    background: linear-gradient(90deg, var(--primary), #f5b301);
}

.oshi-level-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.65rem;
    min-width: 0;
}

.oshi-level-label span {
    color: var(--primary);
    font-weight: 900;
}

.oshi-level-label small {
    color: var(--text-muted);
    font-weight: 700;
    text-align: right;
}

.oshi-card-progress {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.oshi-card-numbers {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 800;
}

.oshi-shelf-empty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.oshi-shelf-empty i {
    color: var(--primary);
    font-size: 2rem;
}

.oshi-shelf-empty strong {
    flex: 1 1 16rem;
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 768px) {
    .home-hero,
    .home-guest,
    .home-hero-authenticated {
        grid-template-columns: 1fr;
    }
}

/* Cards */
.card-modern {
    background: white;
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-subtle);
    transition: all 0.3s ease;
}

.card-modern:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-bold);
}

/* Forms */
.form-control-modern {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    width: 100%;
}

.form-control-modern:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
    outline: none;
}

/* Accordion */
.accordion-item {
    border: none !important;
    background: white !important;
    border-radius: var(--radius-lg) !important;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-subtle);
    overflow: hidden;
}

.accordion-button {
    background-color: white !important;
    color: var(--text-main) !important;
    font-weight: 600 !important;
    padding: 1.25rem 1.5rem !important;
    border: none !important;
    box-shadow: none !important;
}

.accordion-button:not(.collapsed) {
    color: var(--primary) !important;
    background-color: rgba(var(--primary-rgb), 0.02) !important;
}

.accordion-button::after {
    transition: transform 0.3s ease;
}

/* Badges */
.count-badge {
    background: rgba(var(--primary-rgb), 0.08) !important;
    color: var(--primary) !important;
    font-weight: 700;
    padding: 0.4rem 0.8rem !important;
    border-radius: 50px !important;
}

/* Progress */
.progress {
    background-color: #f0f2f5;
    overflow: visible;
}

.progress-bar {
    transition: width 1s ease-in-out;
}

/* Search Bar Customization */
#photoSearch:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1) !important;
}

/* Nav Pills (Dashboard Tabs) */
.nav-pills .nav-link {
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    color: var(--text-muted);
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.nav-pills .nav-link:hover {
    background: rgba(0, 0, 0, 0.02);
}

.nav-pills .nav-link.active {
    background: var(--primary-gradient) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.2);
}

/* Dropdown Menu */
.dropdown-menu.glass {
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.dropdown-item {
    border-radius: 8px;
    padding: 0.6rem 1rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(var(--primary-rgb), 0.05);
    color: var(--primary);
}

/* Tables in Glass Containers */
.glass table {
    background: transparent !important;
}

.glass thead th {
    background: rgba(0, 0, 0, 0.03) !important;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.glass tbody tr {
    border-bottom: 1px solid var(--border-color);
}

.glass tbody tr:last-child {
    border-bottom: none;
}

/* Exchange QR */
.exchange-qr-card {
    overflow: hidden;
}

.exchange-qr-frame {
    width: min(100%, 320px);
    margin-inline: auto;
    padding: 0.75rem;
    background: #fff;
    border-radius: var(--radius-lg);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.exchange-qr-image {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    border-radius: calc(var(--radius-lg) - 0.5rem);
}

/* Search Section */
.search-icon {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    z-index: 10;
}

/* Animations and Transitions */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
}

/* Adaptive Scaling for Small Screens */
@media (max-width: 576px) {
    :root {
        --radius-lg: 12px;
        --radius-md: 8px;
    }

    body {
        font-size: 0.85rem;
        padding-bottom: 75px;
    }

    .app-container {
        padding: 0 0.75rem;
    }

    .home-hero,
    .home-guest {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
        margin-bottom: 0.9rem;
    }

    .home-title {
        font-size: 1.75rem;
        line-height: 1.25;
    }

    .home-lead {
        font-size: 0.9rem;
        line-height: 1.7;
    }

    .home-actions .btn-modern {
        flex: 1 1 9rem;
    }

    .home-stat-grid,
    .home-workspace-grid,
    .oshi-shelf-grid {
        grid-template-columns: 1fr;
    }

    .home-stat {
        min-height: 5.4rem;
        padding: 0.85rem;
    }

    .home-stat strong,
    .home-progress-copy strong {
        font-size: 1.55rem;
    }

    .home-photo-stack,
    .home-preview-shelf {
        min-height: 13.5rem;
    }

    .home-photo-card,
    .home-preview-photo {
        width: min(66%, 10.5rem);
        padding: 0.8rem;
    }

    .home-preview-photo {
        width: 7rem;
    }

    .home-preview-photo.is-owned {
        transform: rotate(-7deg) translate(-3.7rem, 0.35rem);
    }

    .home-preview-photo.is-wish {
        transform: rotate(3deg) translate(0.2rem, -0.45rem);
    }

    .home-preview-photo.is-oshi {
        transform: rotate(9deg) translate(3.8rem, 0.55rem);
    }

    .home-panel,
    .oshi-shelf-card,
    .oshi-shelf-empty {
        padding: 1rem;
    }

    .home-featured-photo {
        grid-template-columns: 3.8rem minmax(0, 1fr);
    }

    .home-featured-shot {
        width: 3.8rem;
        height: 5rem;
    }

    .home-section-title h2 {
        font-size: 1.25rem;
    }

    .oshi-level-label,
    .oshi-card-numbers {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.25rem;
    }

    .oshi-level-label small {
        text-align: left;
    }

    .section-header {
        margin-bottom: 1.5rem;
    }

    .section-header h1 {
        font-size: 1.6rem;
    }

    .section-header p {
        font-size: 0.85rem;
    }

    .glass {
        padding: 1rem !important;
    }

    .card-modern {
        padding: 1rem !important;
    }

    .btn-modern {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .accordion-button {
        padding: 0.75rem 1rem !important;
        font-size: 0.85rem;
    }

    .nav-tabs-modern {
        width: 100%;
        justify-content: space-around;
        border-radius: 0;
        padding: 0.2rem;
    }

    .nav-tabs-modern .nav-link {
        padding: 0.4rem;
        flex-direction: column;
        font-size: 0.6rem;
        gap: 0.1rem;
    }

    .nav-tabs-modern .nav-link i {
        font-size: 1.1rem;
    }

    .nav-tab-container {
        padding: 0;
        bottom: 0;
        top: auto;
    }

    .form-control-modern {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    .count-badge {
        padding: 0.2rem 0.5rem !important;
        font-size: 0.7rem;
    }

    .exchange-qr-frame {
        padding: 0.5rem;
    }

    /* Improved Listability for Tables & Lists */
    .table td, .table th {
        padding: 0.5rem 0.4rem !important;
        font-size: 0.75rem;
    }

    .accordion-body p-3 {
        padding: 0.5rem !important;
    }

    .d-flex.align-items-center.p-3 {
        padding: 0.5rem !important;
    }

    .display-3 { font-size: 2.5rem !important; }
    .display-5 { font-size: 1.8rem !important; }
    .lead { font-size: 1rem !important; }
}

/* --- 確実な選択状態のロジック (CSS-ONLY) --- */
.member-checkbox:checked + .member-label,
.member-radio:checked + .member-label,
.member-checkbox.active + .member-label,
.member-label.active {
    background: var(--primary-gradient) !important;
    color: white !important;
    border-color: transparent !important;
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.3) !important;
    transform: scale(1.05);
}

.member-label {
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.member-label:hover {
    border-color: var(--primary) !important;
    background-color: rgba(var(--primary-rgb), 0.05) !important;
}

.theme-picker {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.theme-picker-item {
    position: relative;
}

.theme-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.theme-card {
    min-height: 104px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-md);
    background: white;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.theme-card:hover {
    border-color: var(--theme-preview-primary);
    box-shadow: 0 8px 22px rgba(var(--theme-preview-rgb), 0.14);
}

.theme-radio:focus-visible + .theme-card {
    outline: 3px solid rgba(var(--theme-preview-rgb), 0.22);
    outline-offset: 2px;
}

.theme-radio:checked + .theme-card {
    border-color: var(--theme-preview-primary);
    box-shadow: 0 0 0 3px rgba(var(--theme-preview-rgb), 0.14);
}

.theme-swatch {
    width: 100%;
    height: 34px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--theme-preview-primary), var(--theme-preview-strong));
}

.theme-name {
    font-weight: 700;
}

.theme-check {
    align-self: flex-end;
    color: var(--theme-preview-primary);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.theme-radio:checked + .theme-card .theme-check {
    opacity: 1;
}

.theme-card-sakurazaka {
    --theme-preview-primary: #E5007F;
    --theme-preview-strong: #C21876;
    --theme-preview-rgb: 229, 0, 127;
}

.theme-card-nogizaka {
    --theme-preview-primary: #74409A;
    --theme-preview-strong: #8F54B8;
    --theme-preview-rgb: 123, 63, 160;
}

.theme-card-hinatazaka {
    --theme-preview-primary: #177DA6;
    --theme-preview-strong: #267EA5;
    --theme-preview-rgb: 23, 125, 166;
}

/* Public launch landing page */
.landing-preview {
    width: min(100%, 390px);
    margin-inline: auto;
    padding: 1.25rem;
    border: 1px solid rgba(92, 65, 83, 0.12);
    border-radius: 1.5rem;
    background: linear-gradient(145deg, #fff, #fff7fb);
    box-shadow: 0 24px 60px rgba(90, 34, 68, 0.13);
}
.landing-preview-heading, .landing-preview-stats, .landing-preview-card { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.landing-preview-heading span, .landing-preview-card small, .landing-preview p { color: #756b73; font-size: .78rem; }
.landing-preview-heading strong { color: #a32a70; font-size: .85rem; }
.landing-preview-stats { margin: 1rem 0; padding: .85rem 1rem; border-radius: 1rem; background: #fff; }
.landing-preview-stats div { display: grid; gap: .1rem; }
.landing-preview-stats small { color: #766b74; }
.landing-preview-stats strong { color: #28212a; font-size: 1.4rem; }
.landing-preview-stats strong span { margin-left: .2rem; font-size: .8rem; }
.landing-preview-card { justify-content: flex-start; padding: .8rem; border: 1px solid #f0e6ed; border-radius: 1rem; background: #fff; }
.landing-photo-placeholder { display: grid; width: 58px; height: 74px; place-items: center; border-radius: .65rem; background: linear-gradient(145deg, #f8d9eb, #ece2f3); color: #70566a; font-size: .65rem; text-align: center; }
.landing-preview-card div { display: grid; gap: .25rem; }
.landing-preview-card b { margin-left: auto; padding: .3rem .55rem; border-radius: 999px; background: #fce8f3; color: #a32a70; font-size: .75rem; }
.landing-preview p { margin: .75rem 0 0; text-align: right; }
.landing-section { max-width: 1080px; margin: 4rem auto; padding: 0 1rem; }
.landing-section h2, .landing-final-cta h2 { margin: .3rem 0 1.2rem; font-size: clamp(1.45rem, 3vw, 2rem); font-weight: 700; }
.landing-feature-grid, .landing-trust-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.landing-feature, .landing-trust-grid article { padding: 1.35rem; border: 1px solid rgba(92, 65, 83, .1); border-radius: 1.2rem; background: rgba(255,255,255,.82); box-shadow: 0 10px 32px rgba(55, 33, 48, .05); }
.landing-feature h3, .landing-trust-grid h3 { margin: .8rem 0 .55rem; font-size: 1.05rem; font-weight: 700; }
.landing-feature p, .landing-trust-grid p, .landing-exchange li span, .landing-note, .privacy-section p { color: #625a62; line-height: 1.85; }
.landing-feature-icon { display: inline-grid; width: 2.7rem; height: 2.7rem; place-items: center; border-radius: .9rem; background: #fce8f3; color: #a32a70; font-size: 1.25rem; }
.landing-exchange { padding: 1.5rem; border-radius: 1.5rem; background: linear-gradient(135deg, #fff6fb, #f8f4fb); }
.landing-exchange ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; padding: 0; list-style: none; counter-reset: exchange-step; }
.landing-exchange li { display: grid; gap: .4rem; padding: 1rem; border-radius: 1rem; background: rgba(255,255,255,.85); counter-increment: exchange-step; }
.landing-exchange li strong::before { content: counter(exchange-step) ". "; color: #a32a70; }
.landing-note { margin: 1rem 0 0; font-size: .9rem; }
.landing-unofficial { margin: 1.2rem 0 .5rem; padding: 1rem 1.2rem; border-left: 4px solid #b54885; border-radius: .5rem; background: #fbf4f8; line-height: 1.8; }
.landing-contact { margin-top: 1rem; padding: 1rem 1.2rem; border: 1px solid #eee3ea; border-radius: 1rem; background: #fff; }
.landing-contact p { margin: .35rem 0 0; color: #625a62; line-height: 1.75; }
.landing-contact a { color: #8d2867; font-weight: 700; }
.landing-privacy-link { color: #8d2867; font-weight: 700; }
.landing-faq details { padding: 1rem .2rem; border-bottom: 1px solid #e8e0e6; }
.landing-faq summary { cursor: pointer; font-weight: 700; }
.landing-faq details p { margin: .8rem 0 0; color: #625a62; line-height: 1.8; }
.landing-final-cta { display: grid; justify-items: center; gap: .6rem; margin: 4rem auto 2rem; padding: 2.2rem 1.2rem; border-radius: 1.5rem; background: #fbf1f7; text-align: center; }
.landing-final-cta h2 { margin-bottom: 0; }
.landing-final-cta p { color: #625a62; }
.landing-login-link { margin-top: .4rem; color: #713653; }
.landing-secondary-groups { max-width: 1080px; margin: 0 auto 2rem; padding: 0 1rem; color: #756b73; text-align: center; }
.privacy-page { max-width: 860px; margin-inline: auto; padding: 1rem; }
.privacy-header { margin: 1rem 0 2rem; }
.privacy-header h1 { margin: .5rem 0; font-size: clamp(1.7rem, 4vw, 2.4rem); }
.privacy-header p { color: #625a62; }
.privacy-section { padding: 1.15rem 0; border-top: 1px solid #e8e0e6; }
.privacy-section h2 { font-size: 1.15rem; font-weight: 700; }
.privacy-section p { margin-bottom: .5rem; }
.privacy-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.5rem 0 2rem; }
.site-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1rem; padding: 1.2rem; color: #756b73; font-size: .8rem; text-align: center; }
.site-footer a { color: #713653; }
@media (max-width: 720px) {
    .landing-feature-grid, .landing-trust-grid, .landing-exchange ol { grid-template-columns: 1fr; }
    .landing-section { margin-block: 2.8rem; }
    .landing-final-cta { margin-top: 2.8rem; }
}

@media (max-width: 576px) {
    .theme-picker {
        grid-template-columns: 1fr;
    }

    .theme-card {
        min-height: 78px;
    }
}
