/* Create study guide — polished two-column layout */

#createStudyGuidePage {
    min-height: calc(100vh - 80px);
    padding: 0 1rem 2.5rem;
    box-sizing: border-box;
}

.csg-page {
    max-width: 1180px;
    margin: 0 auto;
}

/* —— Toolbar —— */
.csg-toolbar {
    display: flex;
    align-items: flex-start;
    gap: 1rem 1.25rem;
    flex-wrap: wrap;
    padding: 0.75rem 0 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 1.5rem;
}

.csg-back {
    flex-shrink: 0;
    margin-top: 0.2rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.88);
    padding: 0.5rem 0.9rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.15s, border-color 0.15s;
}

.csg-back:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.22);
}

.csg-toolbar-titlewrap {
    flex: 1;
    min-width: 0;
}

.csg-page-title {
    margin: 0;
    font-size: clamp(1.45rem, 2.5vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    color: #fff;
}

.csg-subtitle {
    margin: 0.35rem 0 0 0;
    font-size: 0.92rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.48);
    font-weight: 400;
}

/* —— Grid —— */
.csg-split {
    display: grid;
    grid-template-columns: minmax(280px, 34%) 1fr;
    gap: 1.5rem 1.75rem;
    align-items: start;
    min-height: 460px;
}

@media (max-width: 900px) {
    .csg-split {
        grid-template-columns: 1fr;
    }
}

.csg-left-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* —— Cards —— */
.csg-card {
    padding: 1.15rem 1.2rem;
    border-radius: 14px;
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.csg-card--save {
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
}

.csg-card-title {
    margin: 0 0 0.5rem 0;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(46, 204, 113, 0.85);
}

.csg-hint {
    margin: 0 0 1rem 0;
    font-size: 0.86rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.52);
}

.csg-hint--muted {
    margin-bottom: 0.75rem;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.4);
}

.csg-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.82);
    margin-bottom: 0.35rem;
    margin-top: 0.65rem;
}

.csg-label:first-of-type {
    margin-top: 0;
}

.csg-optional {
    font-weight: 400;
    color: rgba(255, 255, 255, 0.38);
}

.csg-field {
    width: 100%;
    box-sizing: border-box;
    padding: 0.62rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(0, 0, 0, 0.45);
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.94rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.csg-field:hover {
    border-color: rgba(255, 255, 255, 0.22);
}

.csg-field:focus {
    outline: none;
    border-color: rgba(46, 204, 113, 0.55);
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.12);
}

.csg-field--area {
    min-height: 132px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.45;
}

.csg-generate-row {
    margin-top: 1rem;
}

.csg-btn-generate {
    width: 100%;
    padding: 0.72rem 1rem;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    color: #0d1f14;
    background: linear-gradient(180deg, #3ddf8f 0%, #2ecc71 45%, #27ae60 100%);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2), 0 4px 16px rgba(46, 204, 113, 0.25);
    transition: transform 0.12s, filter 0.12s;
}

.csg-btn-generate:hover:not(:disabled) {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.csg-btn-generate:active:not(:disabled) {
    transform: translateY(0);
}

.csg-btn-generate:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

/* —— Loading —— */
.csg-loading {
    text-align: center;
    padding: 0.85rem 0.5rem;
}

.csg-loading.hidden {
    display: none !important;
}

.csg-loading-text {
    margin: 0.5rem 0 0 0;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.55);
}

.csg-error {
    margin-top: 0.65rem;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.35);
    color: #ffb4a8;
    font-size: 0.86rem;
}

.csg-error.hidden {
    display: none !important;
}

/* —— Right column —— */
.csg-output {
    min-width: 0;
    min-height: 420px;
}

.csg-output-inner {
    min-height: 100%;
    padding: 1rem 1.1rem 1.25rem;
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(30, 40, 35, 0.6) 0%, rgba(10, 12, 14, 0.95) 55%, rgba(8, 10, 12, 1) 100%);
    border: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

@media (min-width: 901px) {
    .csg-output-inner {
        min-height: 480px;
    }
}

.csg-placeholder-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1.5rem 2.25rem;
    min-height: 360px;
    box-sizing: border-box;
    border-radius: 12px;
    border: 1px dashed rgba(46, 204, 113, 0.2);
    background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(46, 204, 113, 0.08), transparent 55%),
        rgba(0, 0, 0, 0.2);
}

.csg-placeholder-panel.hidden {
    display: none !important;
}

.csg-placeholder-icon {
    font-size: 2.25rem;
    line-height: 1;
    margin-bottom: 0.75rem;
    filter: grayscale(0.2);
    opacity: 0.9;
}

.csg-placeholder-heading {
    margin: 0 0 0.4rem 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.88);
    letter-spacing: -0.02em;
}

.csg-placeholder-lead {
    margin: 0 0 1rem 0;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.45);
}

.csg-placeholder-list {
    margin: 0;
    padding: 0;
    list-style: none;
    max-width: 320px;
    text-align: left;
}

.csg-placeholder-list li {
    position: relative;
    padding: 0.45rem 0 0.45rem 1.35rem;
    font-size: 0.88rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.62);
}

.csg-placeholder-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.85rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(46, 204, 113, 0.65);
}

.csg-placeholder-list strong {
    color: rgba(255, 255, 255, 0.82);
    font-weight: 600;
}

.csg-workspace-mount {
    min-height: 0;
}

.csg-workspace-mount:not(:empty) {
    animation: csgWorkspaceIn 0.4s ease;
}

@keyframes csgWorkspaceIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

#csg-workspace-mount .sg-ws {
    padding-top: 0;
}

#csg-workspace-mount .sg-ws-header {
    padding-top: 0;
}
