
/* ==========================================================================
   Character Builder & Studio - Scoped Cyber-Obsidian Design System
   ========================================================================== */
body.page-template-default, body {
    background-color: #070A13 !important;
    color: #F1F5F9;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden !important;
}

.ph-builder-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 30px 20px 80px;
    box-sizing: border-box;
}

/* Hero Section */
.ph-builder-hero {
    text-align: center;
    padding: 50px 20px 30px;
    max-width: 900px;
    margin: 0 auto;
}
.ph-glow-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(124, 92, 255, 0.12);
    border: 1px solid rgba(124, 92, 255, 0.35);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #A78BFA;
    margin-bottom: 20px;
    box-shadow: 0 0 20px rgba(124, 92, 255, 0.2);
}
.ph-glow-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #00F5FF;
    box-shadow: 0 0 8px #00F5FF;
}
.ph-builder-hero h1 {
    font-size: clamp(32px, 5vw, 54px);
    font-weight: 800;
    line-height: 1.15;
    color: #FFFFFF;
    margin: 0 0 18px;
    font-family: 'Manrope', -apple-system, sans-serif;
    letter-spacing: -0.02em;
}
.ph-builder-hero h1 span.gradient-text {
    background: linear-gradient(135deg, #FFFFFF 30%, #A78BFA 70%, #00F5FF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.ph-builder-hero p {
    font-size: clamp(15px, 2vw, 18px);
    color: #94A3B8;
    line-height: 1.6;
    margin: 0 auto 30px;
    max-width: 760px;
}

/* Remix Section */
.ph-remix-section {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(124, 92, 255, 0.25);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 40px;
}
.ph-remix-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.ph-remix-heading h2 {
    font-size: 20px;
    color: #FFFFFF;
    margin: 0;
    font-family: 'Manrope', sans-serif;
}
.ph-remix-heading p {
    font-size: 13px;
    color: #94A3B8;
    margin: 4px 0 0;
}
.ph-remix-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.ph-remix-card {
    background: rgba(11, 16, 29, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px;
    display: grid;
    grid-template-columns: 95px 1fr;
    gap: 18px;
    align-items: flex-start;
}
.ph-remix-portrait {
    width: 95px;
    height: 110px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.ph-remix-info {
    display: flex;
    flex-direction: column;
}
.ph-remix-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.ph-remix-name {
    font-size: 18px;
    color: #FFFFFF;
    margin: 0;
}
.ph-remix-badge {
    font-size: 10px;
    color: #00F5FF;
    font-family: monospace;
    background: rgba(0, 245, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}
.ph-remix-desc {
    font-size: 12px;
    color: #94A3B8;
    line-height: 1.5;
    margin: 0 0 12px;
}
.ph-remix-btn {
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.25), rgba(0, 245, 255, 0.1));
    border: 1px solid #7C5CFF;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    align-self: flex-start;
}
.ph-remix-btn:hover {
    background: #7C5CFF;
    box-shadow: 0 0 12px rgba(124, 92, 255, 0.4);
}
.ph-remix-audio-wrap {
    grid-column: 1 / -1;
    margin-top: 4px;
}
.ph-remix-audio {
    width: 100%;
    height: 36px;
}
.ph-remix-voice-note {
    display: block;
    color: #64748B;
    font-size: 11px;
    margin-top: 6px;
}

/* Studio Workbench Layout */
.ph-builder-app {
    background: radial-gradient(circle at 50% 0%, rgba(124, 92, 255, 0.08) 0%, transparent 60%), rgba(11, 16, 29, 0.9);
    border: 1px solid rgba(124, 92, 255, 0.3);
    border-radius: 24px;
    padding: clamp(24px, 4vw, 40px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    margin-bottom: 50px;
}
.ph-builder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 20px;
    margin-bottom: 26px;
    flex-wrap: wrap;
    gap: 16px;
}
.ph-origin-tag {
    color: #00F5FF;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 4px;
}
.ph-builder-title {
    font-size: 24px;
    color: #FFFFFF;
    margin: 0;
    font-family: 'Manrope', sans-serif;
}

/* Wizard Steps Navigation */
.ph-steps-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 30px;
}
.ph-step-btn {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94A3B8;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}
.ph-step-btn:hover {
    border-color: rgba(124, 92, 255, 0.4);
    color: #FFFFFF;
}
.ph-step-btn[aria-current="step"] {
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.25), rgba(0, 245, 255, 0.08));
    border-color: #7C5CFF;
    color: #FFFFFF;
    box-shadow: 0 0 15px rgba(124, 92, 255, 0.3);
}

/* Workbench Grid (Form + Preview) */
.ph-workbench-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 30px;
    align-items: flex-start;
}

/* Form Styles */
.ph-form-panel {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 24px;
    box-sizing: border-box;
}
fieldset.ph-fieldset {
    border: none;
    margin: 0;
    padding: 0;
}
fieldset.ph-fieldset legend {
    font-size: 18px;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 20px;
    font-family: 'Manrope', sans-serif;
}
.ph-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.ph-fields-grid .field-full {
    grid-column: 1 / -1;
}
label.ph-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #CBD5E1;
}
label.ph-field input,
label.ph-field select,
label.ph-field textarea {
    background: #0B101D;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 10px 14px;
    color: #FFFFFF;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    width: 100%;
}
label.ph-field input:focus,
label.ph-field select:focus,
label.ph-field textarea:focus {
    border-color: #7C5CFF;
    box-shadow: 0 0 10px rgba(124, 92, 255, 0.35);
}
label.ph-field small {
    color: #64748B;
    font-size: 11px;
    font-weight: 400;
}

/* Form Action Buttons */
.ph-step-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.ph-draft-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
}
.ph-btn-subtle {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94A3B8;
    padding: 6px 12px;
    font-size: 11px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.ph-btn-subtle:hover {
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.3);
}

/* Preview Aside */
.ph-preview-aside {
    background: rgba(7, 10, 19, 0.85);
    border: 1px solid rgba(124, 92, 255, 0.25);
    border-radius: 18px;
    padding: 24px;
    position: sticky;
    top: 90px;
    box-sizing: border-box;
}
.ph-preview-badge {
    color: #00F5FF;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 6px;
}
.ph-preview-name {
    font-size: 26px;
    color: #FFFFFF;
    margin: 0 0 4px;
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
}
.ph-preview-meta {
    font-size: 13px;
    color: #A78BFA;
    font-weight: 600;
    margin: 0 0 18px;
}
.ph-preview-block-title {
    font-size: 12px;
    color: #94A3B8;
    font-weight: 700;
    text-transform: uppercase;
    margin: 0 0 6px;
    letter-spacing: 0.05em;
}
.ph-preview-box {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.5;
    color: #CBD5E1;
    margin: 0 0 16px;
    white-space: pre-wrap;
    max-height: 160px;
    overflow-y: auto;
}
.ph-preview-accordion {
    margin-bottom: 20px;
}
.ph-preview-accordion summary {
    font-size: 12px;
    color: #A78BFA;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 8px;
}

/* Primary Export Buttons */
.ph-export-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ph-btn-download-json {
    background: linear-gradient(135deg, #7C5CFF 0%, #6366F1 100%);
    border: 1px solid #9061FF;
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 700;
    padding: 12px 18px;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    transition: all 0.25s;
    box-shadow: 0 4px 15px rgba(124, 92, 255, 0.35);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}
.ph-btn-download-json:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 92, 255, 0.5);
}
.ph-export-sub-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.ph-btn-export-sub {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #E2E8F0;
    font-size: 12px;
    font-weight: 600;
    padding: 9px 12px;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}
.ph-btn-export-sub:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.25);
}

/* Cloud Bridges */
.ph-builder-bridge {
    margin-top: 40px;
    padding: 24px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(0, 245, 255, 0.2);
    border-radius: 18px;
}
.ph-bridge-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 18px;
}

/* Toast Notification */
#ph-builder-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999999;
    background: rgba(11, 16, 29, 0.95);
    border: 1px solid #00F5FF;
    box-shadow: 0 10px 30px rgba(0, 245, 255, 0.25);
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 10px;
    display: none;
    backdrop-filter: blur(12px);
}
#ph-builder-toast.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Responsive */
@media (max-width: 960px) {
    .ph-remix-grid { grid-template-columns: 1fr; }
    .ph-workbench-grid { grid-template-columns: 1fr; }
    .ph-preview-aside { position: static; margin-top: 24px; }
    .ph-bridge-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .ph-steps-nav { grid-template-columns: 1fr 1fr; }
    .ph-fields-grid { grid-template-columns: 1fr; }
    .ph-step-actions { flex-direction: column; }
    .ph-step-actions button { width: 100%; justify-content: center; }
}
