/* ── CSS Variables ── */
:root {
    --text-primary: #1a1a1a;
    --text-secondary: #555;
    --text-muted: #8e8e93;
    --text-light: #aeaeb2;
    --bg-primary: #f2f2f7;
    --bg-card: #f2f2f7;
    --bg-white: #fff;
    --border-color: #d1d1d6;
    --border-light: #e5e5ea;
    --radius: 10px;
    --radius-sm: 8px;
    --radius-lg: 14px;
    --shadow-card: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-elevated: 0 4px 12px rgba(0,0,0,0.12);
    --color-accent: #007AFF;
    --color-green: #34c759;
    --color-orange: #ff9500;
    --color-red: #ff3b30;
    --color-gold: #8b6914;
    --font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', sans-serif;
    --font-serif: Georgia, 'Hiragino Mincho ProN', serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-family);
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header ── */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(250, 250, 250, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
}
.header-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 15px;
    flex-shrink: 0;
}
.header-logo img { border-radius: 7px; }
.header-nav {
    display: flex;
    gap: 4px;
    flex: 1;
}
.nav-link {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: rgba(0,0,0,0.04); color: var(--text-primary); }
.nav-link.active { background: var(--text-primary); color: #fff; }
.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.header-profile-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.82);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    font-family: var(--font-family);
}
.header-profile-trigger:hover {
    background: #fff;
    border-color: var(--border-color);
    color: var(--text-primary);
}
.header-user-name {
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.header-profile-edit {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}
.header-logout {
    font-size: 12px;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    font-family: var(--font-family);
}
.header-logout:hover { color: var(--text-primary); }

/* ── Main ── */
main {
    flex: 1;
    max-width: 960px;
    margin: 0 auto;
    padding: 24px;
    width: 100%;
}
.screen { animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ── Footer ── */
footer {
    padding: 32px 24px;
    text-align: center;
    font-size: 12px;
    color: var(--text-light);
    border-top: 1px solid var(--border-light);
    margin-top: auto;
}
footer nav { margin-bottom: 8px; }
footer a {
    color: var(--text-muted);
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.15s;
}
footer a:hover { color: var(--text-primary); }

/* ── LP Screen ── */
.lp-hero {
    padding: 48px 0 32px;
    text-align: center;
}
.lp-hero-icon {
    width: 56px; height: 56px;
    border-radius: 13px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}
.lp-label {
    font-size: 12px;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 16px;
}
.lp-hero h1 {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.6;
    margin-bottom: 10px;
}
.lp-hero-desc {
    font-size: 14px;
    color: #888;
    line-height: 1.8;
}
.lp-section {
    max-width: 480px;
    margin: 0 auto;
    padding-bottom: 48px;
}
.lp-section h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
}
.lp-flow-step {
    display: flex;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
}
.lp-flow-step:last-child { border-bottom: none; }
.lp-step-num {
    width: 26px; height: 26px;
    background: var(--text-primary);
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.lp-step-content { font-size: 14px; line-height: 1.7; color: #444; }
.lp-step-content strong { color: var(--text-primary); }
.lp-step-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── Auth Section ── */
.auth-section { text-align: center; max-width: 400px; margin: 0 auto; padding: 32px 0; }
.auth-note { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 280px;
    margin: 0 auto 8px;
    padding: 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.15s;
    font-family: var(--font-family);
}
.auth-btn:hover { opacity: 0.85; }
.auth-btn.google { background: #fff; border: 1px solid #dadce0; color: #3c4043; }
.auth-btn.google:hover { background: #f8f9fa; opacity: 1; }
.auth-btn.apple { background: var(--text-primary); border: 1px solid var(--text-primary); color: #fff; }
.auth-btn.email { background: #2563eb; border: 1px solid #2563eb; color: #fff; max-width: 100%; margin-bottom: 0; }
.auth-divider {
    max-width: 280px;
    margin: 10px auto 12px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}
.auth-form {
    max-width: 280px;
    margin: 0 auto;
    text-align: left;
}
.auth-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font-family);
    outline: none;
    margin-bottom: 8px;
    background: var(--bg-white);
}
.auth-input:focus { border-color: #999; }
.auth-help {
    max-width: 280px;
    margin: 8px auto 0;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ── Profile Name Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(18, 18, 20, 0.32);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.modal-card {
    width: min(100%, 420px);
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--border-light);
    border-radius: 18px;
    box-shadow: var(--shadow-elevated);
    padding: 22px;
}
.modal-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}
.modal-note {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 14px;
}
.modal-input {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 13px 14px;
    font-size: 15px;
    font-family: var(--font-family);
    outline: none;
    background: #fff;
}
.modal-input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}
.modal-help {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}
.modal-btn {
    border: none;
    border-radius: 12px;
    padding: 11px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-family);
}
.modal-btn.secondary {
    background: #f3f4f7;
    color: var(--text-secondary);
}
.modal-btn.primary {
    background: var(--color-accent);
    color: #fff;
}
.modal-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

/* ── Error Banner ── */
.error-banner {
    background: #fef2f2;
    color: var(--color-red);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
}

/* ── Dashboard Screen ── */
.dash-section { margin-bottom: 28px; }
.dash-section-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
}
.dashboard-mode-switch {
    display: inline-flex;
    gap: 6px;
    padding: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 999px;
    margin-bottom: 16px;
}
.mode-switch-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-family);
}
.mode-switch-btn.active {
    background: var(--text-primary);
    color: #fff;
}
.dash-secondary-actions {
    display: flex;
    justify-content: flex-end;
    margin: -8px 0 20px;
}
.admin-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: linear-gradient(135deg, #111827 0%, #374151 100%);
    color: #fff;
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 18px;
}
.admin-banner-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}
.admin-banner-desc {
    font-size: 13px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.78);
}
.admin-banner-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}
.admin-search-panel {
    display: flex;
    align-items: center;
    gap: 10px;
}
.admin-search-input {
    flex: 1;
    margin-bottom: 0;
}
.admin-search-actions {
    display: flex;
    gap: 8px;
}
.admin-search-status {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}
.admin-search-status.error {
    color: var(--color-red);
}
.admin-search-results {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}
.admin-candidate-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 220px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-family: var(--font-family);
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
}
.admin-candidate-btn:hover {
    border-color: var(--color-accent);
    transform: translateY(-1px);
}
.admin-candidate-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.admin-candidate-meta {
    font-size: 12px;
    color: var(--text-muted);
}
.admin-target-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 18px;
    margin-bottom: 18px;
}
.admin-target-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.admin-target-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}
.admin-target-subtitle {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}
.admin-rights-card {
    margin-top: 10px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    box-shadow: var(--shadow-card);
}
.stat-value {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 2px;
    color: var(--text-primary);
}
.stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

/* Rights Badges */
.rights-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.rights-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    background: var(--bg-white);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}
.rights-renewal {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
}

/* Alert Banner */
.alert-banner {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 13px;
    color: #c2410c;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}
.alert-banner a {
    color: #c2410c;
    font-weight: 600;
    text-decoration: underline;
}

/* Create Button */
.dash-create-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: var(--text-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-family);
    transition: background 0.15s;
    margin-bottom: 20px;
}
.dash-create-btn:hover { background: #333; }
.dash-create-btn:disabled { opacity: 0.5; cursor: default; }
.dash-create-btn svg { width: 18px; height: 18px; }

/* Stripe Portal Link */
.portal-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    background: none;
    border: none;
    font-family: var(--font-family);
    padding: 0;
}
.portal-link:hover { text-decoration: underline; }

/* Promo Cards */
.promo-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-card);
    margin-bottom: 10px;
}
.promo-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.promo-grid {
    display: grid;
    gap: 12px;
}
.promo-grid-admin {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}
.promo-list .promo-card,
.promo-grid .promo-card {
    margin-bottom: 0;
}
.promo-card.highlighted {
    border: 1px solid rgba(59, 130, 246, 0.35);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.08), var(--shadow-card);
}
.promo-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}
.status-badge.pending { background: #fff3e0; color: #e65100; }
.status-badge.approved { background: #e8f5e9; color: #2e7d32; }
.status-badge.rejected { background: #ffeef0; color: #c62828; }
.status-badge.expired { background: #f5f5f5; color: #757575; }
.remaining-days {
    font-size: 11px;
    color: var(--color-orange);
    font-weight: 500;
    background: #fff7ed;
    padding: 2px 8px;
    border-radius: 10px;
}
.promo-card-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}
.promo-card--admin {
    padding: 14px;
}
.promo-card-layout--admin {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: start;
}
.promo-card-info,
.promo-card-visual {
    min-width: 0;
}
.promo-date-range {
    display: inline-block;
    font-size: 12px;
    color: var(--text-muted);
}
.promo-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}
.promo-detail-item {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    min-width: 0;
}
.promo-detail-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.promo-detail-value {
    display: block;
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 600;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.promo-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.promo-card-meta .plan-label {
    font-weight: 500;
}
.admin-promo-owner {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 12px;
    color: var(--text-muted);
}
.admin-promo-owner-name {
    font-weight: 600;
    color: var(--text-primary);
}
.admin-promo-owner-uid {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.admin-promo-preview {
    margin-bottom: 12px;
}
.admin-promo-preview-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.admin-inline-preview {
    padding: 0;
    width: min(100%, 300px);
    margin: 0 auto;
}
.admin-inline-preview .preview-card-shell {
    box-shadow: none;
    border-radius: 10px;
}
.admin-inline-preview .preview-card {
    padding: 0;
    max-width: 300px;
}
.admin-inline-preview .preview-card-body {
    padding: 14px;
}
.admin-inline-preview .preview-text {
    font-size: 16px;
    min-height: 0;
}
.admin-inline-preview .preview-pr-label,
.admin-inline-preview .preview-advertiser {
    font-size: 12px;
}
.admin-inline-preview .preview-advertiser span {
    font-size: 12px;
}
.admin-inline-preview .preview-desc {
    font-size: 10px;
}
.admin-inline-preview .preview-action {
    font-size: 11px;
}
.admin-inline-preview .preview-action svg {
    width: 14px;
    height: 14px;
}
.admin-target-payment-grid {
    margin-bottom: 12px;
}
.premium-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    background: var(--color-gold);
    color: #fff;
    padding: 1px 6px;
    border-radius: 3px;
}
.promo-card-stats {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
    margin-bottom: 10px;
}
.promo-card-stats span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.promo-card-stats svg { width: 14px; height: 14px; }
.promo-card-actions {
    display: flex;
    gap: 8px;
}
.btn-sm {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-family);
    transition: opacity 0.15s;
    border: 1px solid var(--border-color);
    background: var(--bg-white);
    color: var(--text-primary);
}
.btn-sm:hover { opacity: 0.8; }
.btn-sm.primary { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.btn-sm.danger { color: var(--color-red); border-color: #fca5a5; }
.btn-sm.danger:hover { background: #fef2f2; }
.rejection-reason {
    background: #fef2f2;
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 12px;
    color: var(--color-red);
    margin-bottom: 10px;
}
.section-divider {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 24px 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

/* ── Post & Edit Screen ── */
.post-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}
.form-section {
    max-width: 520px;
}
.form-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}
.form-group {
    margin-bottom: 20px;
}
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.form-label .optional {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 11px;
    margin-left: 4px;
}
.form-label .badge-required {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    background: #FF3B30;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}
.form-label .badge-optional {
    display: inline-block;
    font-size: 10px;
    font-weight: 500;
    color: #8e8e93;
    background: #e5e5ea;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}
.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font-family);
    outline: none;
    background: var(--bg-white);
    transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--color-accent); }
.form-input.error { border-color: var(--color-red); }
textarea.form-input {
    min-height: 100px;
    resize: vertical;
    line-height: 1.6;
}
.char-counter {
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}
.char-counter.over { color: var(--color-red); font-weight: 600; }
.form-error {
    font-size: 12px;
    color: var(--color-red);
    margin-top: 4px;
}
.form-help {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-top: 8px;
}

/* Segment Control */
.segment-control {
    display: flex;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 3px;
}
.segment-btn {
    flex: 1;
    padding: 10px 8px;
    border: none;
    border-radius: 6px;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-family);
    color: var(--text-secondary);
    transition: background 0.15s, color 0.15s;
    text-align: center;
}
.segment-btn.active {
    background: var(--bg-white);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.segment-btn:disabled {
    opacity: 0.4;
    cursor: default;
}
.segment-count {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Image Upload */
.image-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    position: relative;
}
.image-upload-area:hover {
    border-color: var(--color-accent);
    background: rgba(47, 128, 237, 0.02);
}
.image-upload-area.has-images {
    border-style: solid;
    padding: 12px;
}
.image-upload-icon {
    font-size: 32px;
    margin-bottom: 8px;
    color: var(--text-muted);
}
.image-upload-text {
    font-size: 13px;
    color: var(--text-muted);
}
.image-upload-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.image-thumbnails {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0;
}
.image-thumbnails::-webkit-scrollbar { display: none; }
.image-thumb-wrap {
    position: relative;
    flex: 0 0 80px;
    width: 80px;
    height: 80px;
    scroll-snap-align: start;
}
.image-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
}
.image-thumb-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-red);
    color: #fff;
    border: 2px solid var(--bg-white);
    font-size: 11px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.image-progress {
    height: 3px;
    background: var(--border-light);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}
.image-progress-bar {
    height: 100%;
    background: var(--color-accent);
    border-radius: 2px;
    transition: width 0.2s ease;
    width: 0%;
}

/* Preview Card */
.preview-section {
    position: sticky;
    top: 80px;
}
.preview-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-align: center;
}
.preview-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.preview-mode-switch {
    display: inline-flex;
    align-self: center;
    gap: 6px;
    padding: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 999px;
}
.preview-mode-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-family);
}
.preview-mode-btn.active {
    background: var(--text-primary);
    color: #fff;
}
.preview-pane { display: none; }
.preview-pane.active { display: block; }
.preview-note {
    font-size: 12px;
    color: var(--text-muted);
    margin: -4px 0 10px;
    text-align: center;
    line-height: 1.5;
}
.preview-card {
    padding: 8px 16px;
    max-width: 390px;
    margin: 0 auto;
}
.preview-card-shell {
    background: var(--bg-card);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    overflow: hidden;
}
.preview-card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
}
.preview-pr-label {
    font-family: var(--font-serif);
    font-size: 15px;
    color: var(--text-muted);
}
.preview-text {
    font-size: 20px;
    font-weight: 500;
    line-height: 1.45;
    text-align: center;
    color: #131316;
    min-height: 29px;
    white-space: pre-wrap;
    line-break: strict;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.preview-text.placeholder { color: var(--text-light); font-size: 16px; }
.preview-gallery { position: relative; }
.preview-images {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.preview-images::-webkit-scrollbar { display: none; }
.preview-images img {
    flex: 0 0 100%;
    width: 100%;
    /* 現行 iOS 実装に合わせて正方形で表示 */
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    scroll-snap-align: start;
}
.preview-dots {
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 0;
}
.preview-dots .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    transition: background 0.2s;
}
.preview-dots .dot.active { background: rgba(255,255,255,0.95); }
.preview-desc {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}
.preview-advertiser {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    color: var(--text-muted);
    font-family: var(--font-serif);
    font-size: 15px;
    padding-right: 4px;
}
.preview-advertiser svg { width: 14px; height: 14px; }
.preview-divider {
    height: 1px;
    margin: 0 16px;
    background: rgba(0,0,0,0.09);
}
.preview-actions {
    display: flex;
    align-items: center;
}
.preview-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: #7c7c84;
    font-size: 14px;
    padding: 12px 0;
}
.preview-actions svg { width: 15px; height: 15px; }
.preview-actions .divider {
    width: 1px;
    height: 20px;
    background: rgba(0,0,0,0.1);
    flex: 0 0 1px;
}
.asset-check-card {
    max-width: 390px;
    margin: 0 auto;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 14px;
}
.asset-check-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    padding: 18px 0;
}
.asset-check-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.asset-check-grid.single {
    grid-template-columns: minmax(0, 1fr);
}
.asset-check-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.asset-check-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    background: #f8f8f8;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    overflow: hidden;
    padding: 8px;
}
.asset-check-frame img {
    width: 100%;
    height: 100%;
    max-height: 220px;
    object-fit: contain;
    border-radius: 6px;
}
.asset-check-index {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 14px;
    background: var(--text-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-family);
    transition: background 0.15s;
}
.submit-btn:hover { background: #333; }
.submit-btn:disabled { background: #ccc; cursor: default; }
.submit-note {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 8px;
    text-align: center;
}

/* Edit Info */
.edit-info {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* Image Edit Mode */
.image-edit-modes {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.image-edit-mode-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    font-size: 12px;
    cursor: pointer;
    font-family: var(--font-family);
    color: var(--text-secondary);
    transition: all 0.15s;
}
.image-edit-mode-btn.active {
    border-color: var(--color-accent);
    background: rgba(47, 128, 237, 0.06);
    color: var(--color-accent);
    font-weight: 500;
}

/* ── Buy Screen ── */
.buy-section {
    max-width: 860px;
    margin: 0 auto;
}
.buy-header {
    text-align: center;
    margin-bottom: 24px;
}
.buy-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 4px;
}
.buy-note {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}
.buy-pricing-note {
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.6;
    margin-top: 6px;
}
.plan-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 24px;
    align-items: stretch;
}
.plan-card {
    background: var(--bg-white);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius);
    padding: 18px 14px;
    cursor: pointer;
    transition: border-color 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.plan-card:hover { border-color: var(--border-color); }
.plan-card.selected { border-color: var(--text-primary); box-shadow: 0 0 0 0.5px var(--text-primary); }
.plan-usecase {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.3;
}
.plan-recommend-badge {
    font-size: 9px;
    font-weight: 700;
    background: #e8e8e8;
    color: #333;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}
.plan-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}
.plan-pricing { margin-bottom: 2px; }
.plan-sale {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}
.plan-orig-note {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 2px;
}
.plan-orig-note s {
    text-decoration-color: var(--text-light);
}
.plan-per-day {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}
.plan-info {
    width: 100%;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
    font-size: 11px;
}
.plan-info-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    color: var(--text-secondary);
    white-space: nowrap;
    font-size: 10px;
}
.plan-info-row span:last-child { font-weight: 500; }
.buy-bottom {
    max-width: 480px;
    margin: 0 auto;
}
.features-box {
    margin-top: 28px;
    padding: 20px;
    background: var(--bg-white);
    border-radius: var(--radius);
}
.features-box h3 { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.features-box ul { list-style: none; padding: 0; }
.features-box li {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 4px 0;
    line-height: 1.6;
}
.features-box li::before { content: "\2014"; margin-right: 8px; color: #ccc; }

/* Coupon */
.coupon-section { margin-top: 28px; }
.coupon-section label {
    font-size: 13px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 8px;
}
.coupon-row { display: flex; gap: 8px; }
.coupon-row input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    background: var(--bg-white);
    font-family: var(--font-family);
}
.coupon-row input:focus { border-color: #999; }
.coupon-row button {
    padding: 10px 16px;
    background: var(--text-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-family);
}
.coupon-row button:hover { background: #333; }
.coupon-msg { font-size: 13px; margin-top: 6px; min-height: 20px; }
.coupon-msg.success { color: var(--color-green); }
.coupon-msg.error { color: var(--color-red); }
.coupon-msg.info { color: var(--text-muted); }

/* Checkout */
.checkout-btn {
    width: 100%;
    padding: 14px;
    background: var(--text-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-family);
    transition: background 0.15s;
    margin-top: 24px;
}
.checkout-btn:hover { background: #333; }
.checkout-btn:disabled { background: #ccc; cursor: default; }
.checkout-note { font-size: 12px; color: var(--text-light); margin-top: 8px; text-align: center; }

/* ── Toast ── */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    background: var(--text-primary);
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-elevated);
    pointer-events: auto;
    animation: toastIn 0.3s ease;
    max-width: calc(100vw - 48px);
    text-align: center;
}
.toast.success { background: var(--color-green); }
.toast.error { background: var(--color-red); }
.toast.fade-out { animation: toastOut 0.3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(12px); } }

/* ── Loading ── */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(250, 250, 250, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}
.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
.spinner-inline {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Inline loading */
.loading-placeholder {
    text-align: center;
    padding: 48px 0;
    color: var(--text-muted);
    font-size: 14px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 48px 0;
    color: var(--text-muted);
}
.empty-state p { font-size: 14px; margin-bottom: 16px; }

/* ── Responsive ── */
@media (min-width: 768px) {
    .post-layout {
        grid-template-columns: 1fr 340px;
    }
    .stats-grid { gap: 14px; }
}

@media (max-width: 767px) {
    .header-nav { display: none !important; }
    .header-inner { padding: 0 12px; }
    .header-profile-trigger {
        padding: 5px 8px;
        gap: 6px;
    }
    .header-profile-edit {
        display: none;
    }
    .header-user-name {
        max-width: 84px;
        font-size: 12px;
    }
    .admin-search-panel,
    .admin-target-header {
        flex-direction: column;
        align-items: stretch;
    }
    .admin-search-actions {
        width: 100%;
    }
    .admin-search-actions .btn-sm {
        flex: 1;
    }
    .admin-banner-actions {
        width: 100%;
        justify-content: stretch;
    }
    .admin-banner-actions .btn-sm {
        flex: 1;
    }
    .preview-mode-switch {
        display: flex;
        width: 100%;
    }
    .preview-mode-btn {
        flex: 1;
        text-align: center;
    }
    .asset-check-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .promo-grid-admin,
    .promo-detail-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 767px) {
    .plan-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .plan-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .plan-card { padding: 14px 10px; }
    .plan-sale { font-size: 18px; }
    .plan-name { font-size: 13px; margin-bottom: 8px; }
    .plan-info { font-size: 10px; }
}
@media (max-width: 480px) {
    main { padding: 16px; }
    .stats-grid { grid-template-columns: 1fr; gap: 8px; }
    .promo-card-actions { flex-direction: column; }
    .btn-sm { width: 100%; text-align: center; }
    .image-edit-modes { flex-direction: column; }
    .dashboard-mode-switch {
        display: flex;
        width: 100%;
    }
    .mode-switch-btn {
        flex: 1;
        text-align: center;
    }
    .admin-candidate-btn {
        width: 100%;
        min-width: 0;
    }
    .dash-secondary-actions {
        margin-top: -4px;
        justify-content: stretch;
    }
    .dash-secondary-actions .btn-sm {
        width: 100%;
    }
}

/* Mobile bottom nav (shown <768px when logged in) */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99;
    background: rgba(250, 250, 250, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-light);
    padding: 6px 0 env(safe-area-inset-bottom, 6px);
}
.mobile-nav-inner {
    display: flex;
    justify-content: space-around;
    max-width: 400px;
    margin: 0 auto;
}
.mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 10px;
    font-family: var(--font-family);
    cursor: pointer;
}
.mobile-nav-btn svg { width: 22px; height: 22px; }
.mobile-nav-btn.active { color: var(--color-accent); }

@media (max-width: 767px) {
    .mobile-nav.visible { display: block; }
    main { padding-bottom: 80px; }
}
