/* ═══════════════════════════════════════════════════════════════
   Creator Hub — /create
   Lists user's guides; entry point to wizard + editor.
   ═══════════════════════════════════════════════════════════════ */

:root,
html.dark {
    --ch-bg:           #0f1117;
    --ch-bg2:          #161b27;
    --ch-surface:      rgba(255,255,255,.04);
    --ch-surface-hov:  rgba(255,255,255,.07);
    --ch-border:       rgba(255,255,255,.1);
    --ch-text:         #f0f0f0;
    --ch-text-sub:     rgba(255,255,255,.65);
    --ch-muted:        rgba(255,255,255,.4);
    --ch-input-bg:     rgba(255,255,255,.04);
    --ch-accent:       #E05A2B;
    --ch-accent-soft:  rgba(224,90,43,.14);
    --ch-shadow:       rgba(0,0,0,.45);
    --ch-card-ph:      rgba(255,255,255,.07);
    --ch-promo-bg:     rgba(255,255,255,.04);
}
html:not(.dark) {
    --ch-bg:           #ffffff;
    --ch-bg2:          #f7f7f5;
    --ch-surface:      #fff;
    --ch-surface-hov:  #fafafa;
    --ch-border:       rgba(0,0,0,.08);
    --ch-text:         #111;
    --ch-text-sub:     #555;
    --ch-muted:        #888;
    --ch-input-bg:     #f3f4f6;
    --ch-accent:       #E05A2B;
    --ch-accent-soft:  rgba(224,90,43,.1);
    --ch-shadow:       rgba(0,0,0,.08);
    --ch-card-ph:      #e9eaed;
    --ch-promo-bg:     #fafafa;
}

.ch-page {
    background: var(--ch-bg);
    color: var(--ch-text);
    min-height: 100vh;
}

/* ── Toolbar ───────────────────────────────────────────────── */
.ch-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--ch-border);
    background: var(--ch-bg);
    position: sticky;
    top: 0;
    z-index: 20;
}
.ch-toolbar-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--ch-text);
}
.ch-toolbar-actions {
    display: flex;
    gap: 0.5rem;
}

/* ── Buttons ───────────────────────────────────────────────── */
.ch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--ch-border);
    background: transparent;
    color: var(--ch-text);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .18s, color .18s, border-color .18s, transform .15s;
}
.ch-btn-ghost:hover {
    background: var(--ch-input-bg);
}
.ch-btn-outline:hover {
    border-color: var(--ch-accent);
    color: var(--ch-accent);
}
.ch-btn-primary {
    background-image:
        linear-gradient(180deg, rgba(255,255,255,.18) 0%, rgba(255,255,255,0) 60%),
        linear-gradient(180deg, #ee774b 0%, #e05a2b 55%, #c84d23 100%);
    background-blend-mode: screen, normal;
    border: 1px solid rgba(255,255,255,.22);
    color: #fff;
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.35),
        inset 0 -1px 0 rgba(0,0,0,.08),
        0 4px 12px rgba(224,90,43,.28),
        0 1px 3px rgba(224,90,43,.15);
    text-shadow: 0 1px 1px rgba(0,0,0,.08);
}
html:not(.dark) .ch-btn-primary {
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.4),
        inset 0 -1px 0 rgba(0,0,0,.06),
        0 4px 12px rgba(224,90,43,.22),
        0 1px 3px rgba(224,90,43,.12);
}
html.dark .ch-btn-primary { color: #fff; }
.ch-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.4),
        inset 0 -1px 0 rgba(0,0,0,.1),
        0 6px 18px rgba(224,90,43,.35),
        0 2px 6px rgba(224,90,43,.18);
}

.ch-btn-dark {
    background-image:
        linear-gradient(180deg, rgba(255,255,255,.18) 0%, rgba(255,255,255,0) 60%),
        linear-gradient(180deg, #ee774b 0%, #e05a2b 55%, #c84d23 100%);
    background-blend-mode: screen, normal;
    border: 1px solid rgba(255,255,255,.22);
    color: #fff;
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.35),
        inset 0 -1px 0 rgba(0,0,0,.08),
        0 4px 12px rgba(224,90,43,.28),
        0 1px 3px rgba(224,90,43,.15);
    text-shadow: 0 1px 1px rgba(0,0,0,.08);
}
html.dark .ch-btn-dark { color: #fff; }
.ch-btn-dark:hover {
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.4),
        inset 0 -1px 0 rgba(0,0,0,.1),
        0 6px 18px rgba(224,90,43,.35),
        0 2px 6px rgba(224,90,43,.18);
}

/* ── Auth gate ─────────────────────────────────────────────── */
.ch-auth-gate {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
}
.ch-auth-gate.hidden { display: none; }
.ch-auth-card {
    text-align: center;
    max-width: 360px;
    background: var(--ch-bg2);
    border: 1px solid var(--ch-border);
    border-radius: 14px;
    padding: 1.75rem;
    box-shadow: 0 8px 28px var(--ch-shadow);
}
.ch-auth-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}
.ch-auth-sub {
    font-size: 0.85rem;
    color: var(--ch-text-sub);
    margin-bottom: 1.1rem;
    line-height: 1.5;
}

.ch-guest-btn {
    display: inline-block;
    margin-top: 0.25rem;
    padding: 0.625rem 2rem;
    background: #E05A2B;
    color: #fff !important;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 9999px;
    text-decoration: none;
    transition: background 0.15s, transform 0.12s;
    border: none;
}
.ch-guest-btn:hover {
    background: #c44d22;
    transform: translateY(-1px);
}

/* ── Loading spinner ───────────────────────────────────────── */
.ch-loading {
    display: flex;
    justify-content: center;
    padding: 4rem 1rem;
}
.ch-loading.hidden { display: none; }
.ch-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--ch-border);
    border-top-color: var(--ch-accent);
    border-radius: 50%;
    animation: ch-spin .75s linear infinite;
}
@keyframes ch-spin { to { transform: rotate(360deg); } }

/* ── Shell layout ──────────────────────────────────────────── */
.ch-shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}
.ch-content { display: block; }
.ch-content.hidden { display: none; }

.ch-content {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 2rem;
    align-items: start;
}
.ch-main { min-width: 0; }

/* ── Profile header ────────────────────────────────────────── */
.ch-profile {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.ch-avatar,
.ch-avatar-ph {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}
.ch-avatar-ph {
    background: #65a373;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
}
.ch-profile-info {
    flex: 1;
    min-width: 0;
}
.ch-display-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--ch-text);
    letter-spacing: -0.02em;
    margin: 0 0 0.25rem;
    line-height: 1.2;
}
.ch-created-since {
    font-size: 0.82rem;
    color: var(--ch-muted);
    margin-bottom: 0.6rem;
}
.ch-view-profile {
    padding: 0.4rem 0.95rem;
    font-size: 0.78rem;
}

/* ── Tabs ──────────────────────────────────────────────────── */
.ch-tabs {
    display: flex;
    gap: 1.2rem;
    border-bottom: 1px solid var(--ch-border);
    margin-bottom: 1.25rem;
}
.ch-tab {
    background: none;
    border: none;
    color: var(--ch-muted);
    font-size: 0.88rem;
    font-weight: 500;
    padding: 0.6rem 0.1rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
}
.ch-tab:hover { color: var(--ch-text); }
.ch-tab.active {
    color: var(--ch-text);
    font-weight: 700;
    border-bottom-color: var(--ch-text);
}

/* ── Filter row ────────────────────────────────────────────── */
.ch-filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.ch-filter-row.hidden { display: none; }

.ch-search-bar {
    position: relative;
    width: 280px;
    max-width: 100%;
}
.ch-search-input {
    width: 100%;
    padding: 0.5rem 2rem 0.5rem 0.95rem;
    border-radius: 999px;
    border: 1px solid var(--ch-border);
    background: var(--ch-input-bg);
    color: var(--ch-text);
    font-size: 0.85rem;
}
.ch-search-input:focus {
    outline: none;
    border-color: var(--ch-accent);
    box-shadow: 0 0 0 3px var(--ch-accent-soft);
}
.ch-search-input::placeholder { color: var(--ch-muted); }
.ch-search-icon {
    position: absolute;
    right: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ch-muted);
    pointer-events: none;
}

.ch-status-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.ch-status-label {
    font-size: 0.82rem;
    color: var(--ch-muted);
}
.ch-status-select {
    background: transparent;
    border: none;
    color: var(--ch-text);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.2rem 0.4rem;
    cursor: pointer;
}

/* ── Grid ──────────────────────────────────────────────────── */
.ch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.ch-card {
    border-radius: 12px;
    overflow: hidden;
    background: var(--ch-surface);
    border: 1px solid var(--ch-border);
    cursor: pointer;
    transition: transform .25s cubic-bezier(.22,1,.36,1), box-shadow .25s;
}
.ch-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px var(--ch-shadow);
}

.ch-card-img-wrap {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: var(--ch-card-ph);
}
.ch-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ch-card-img-ph { background: var(--ch-card-ph); }

.ch-card-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}
.ch-card-days,
.ch-card-status {
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 1.4;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.ch-card-days {
    background: rgba(255,255,255,.9);
    color: #111;
}
.ch-status-draft {
    background: #111;
    color: #fff;
}
.ch-status-pub {
    background: #16a34a;
    color: #fff;
}

.ch-card-menu-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,.9);
    color: #111;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .18s;
}
.ch-card-menu-btn:hover { background: #fff; }

.ch-card-body {
    padding: 0.7rem 0.85rem 0.85rem;
}
.ch-card-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--ch-text);
    line-height: 1.3;
    letter-spacing: -0.005em;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.25rem;
}
.ch-card-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    color: var(--ch-muted);
    margin-top: 2px;
}
.ch-card-meta svg { flex-shrink: 0; opacity: .65; }
.ch-card-meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ch-card-places {
    color: var(--ch-text-sub);
    font-weight: 500;
}

.ch-no-match {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: var(--ch-muted);
    font-size: 0.85rem;
}

/* ── Empty / commissions ───────────────────────────────────── */
.ch-empty,
.ch-commissions {
    text-align: center;
    padding: 3rem 1.5rem;
    border: 1px dashed var(--ch-border);
    border-radius: 14px;
    background: var(--ch-surface);
}
.ch-empty.hidden,
.ch-commissions.hidden { display: none; }
.ch-empty-emoji {
    font-size: 2rem;
    margin-bottom: 0.7rem;
}
.ch-empty-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ch-text);
    margin-bottom: 0.4rem;
}
.ch-empty-sub {
    font-size: 0.85rem;
    color: var(--ch-text-sub);
    margin-bottom: 1.25rem;
    line-height: 1.5;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}
.ch-empty-cta { padding: 0.6rem 1.4rem; }

/* ── Bottom CTA ─────────────────────────────────────────────── */
.ch-bottom-cta {
    margin-top: 2.5rem;
    text-align: center;
}
.ch-bottom-cta.hidden { display: none; }
.ch-cta-large {
    padding: 0.7rem 2rem;
    font-size: 0.88rem;
}

/* ── Right promo card ──────────────────────────────────────── */
.ch-promo {
    background: var(--ch-promo-bg);
    border: 1px solid var(--ch-border);
    border-radius: 14px;
    padding: 1.25rem;
    position: sticky;
    top: 84px;
}
.ch-promo-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    letter-spacing: -0.01em;
}
.ch-promo-sub-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--ch-text);
    margin-bottom: 0.75rem;
}
.ch-promo-text {
    font-size: 0.82rem;
    color: var(--ch-text-sub);
    line-height: 1.5;
    margin: 0 0 0.6rem;
}
.ch-promo .ch-btn-dark {
    width: auto;
    margin-top: 0.4rem;
}

/* ── Card menu ─────────────────────────────────────────────── */
.ch-card-menu {
    position: absolute;
    background: var(--ch-bg2);
    border: 1px solid var(--ch-border);
    border-radius: 10px;
    padding: 0.3rem;
    box-shadow: 0 8px 24px var(--ch-shadow);
    z-index: 50;
    min-width: 140px;
}
.ch-card-menu.hidden { display: none; }
.ch-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 0.45rem 0.7rem;
    border: none;
    background: transparent;
    color: var(--ch-text);
    font-size: 0.82rem;
    cursor: pointer;
    text-align: left;
    border-radius: 6px;
    transition: background .15s, color .15s;
}
.ch-menu-item:hover { background: var(--ch-input-bg); }
.ch-menu-danger { color: #e11d48; }
.ch-menu-danger:hover { background: rgba(225,29,72,.08); }

/* ── Toast ─────────────────────────────────────────────────── */
.gp-toast-container {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 70;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}
.gp-toast {
    background: var(--ch-bg2);
    border: 1px solid var(--ch-border);
    color: var(--ch-text);
    border-radius: 10px;
    padding: 0.6rem 1rem;
    font-size: 0.82rem;
    box-shadow: 0 4px 20px var(--ch-shadow);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .3s, transform .3s;
    pointer-events: all;
}
.gp-toast.visible { opacity: 1; transform: translateY(0); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
    .ch-content {
        grid-template-columns: 1fr;
    }
    .ch-promo { position: static; }
}
@media (max-width: 600px) {
    .ch-toolbar { padding: 0.6rem 0.9rem; }
    .ch-shell { padding: 1.25rem 1rem 3rem; }
    .ch-display-name { font-size: 1.15rem; }
    .ch-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.75rem; }
    .ch-card-img-wrap { height: 140px; }
    .ch-filter-row { gap: 0.6rem; }
    .ch-search-bar { width: 100%; flex: 1; }
}
