/*
 * AI Song workspace polish
 * Load this file after the existing /studio/aisong styles.
 */

body.as-active {
    --as-accent: #d58a6a;
    --as-accent-hover: #df9878;
    --as-accent-soft: rgba(213, 138, 106, 0.085);
    --as-accent-text: #d39a82;
    --as-accent-border: rgba(211, 154, 130, 0.24);
    --as-accent-progress: rgba(211, 154, 130, 0.34);
    --as-shadow: 0 22px 58px rgba(0, 0, 0, 0.38);
}

/* Typography: no weight above 700, with 500-650 used for most hierarchy. */
.as-shell strong,
.as-brand strong,
.as-page-title strong,
.as-choice strong,
.as-resume-copy strong,
.as-readonly-summary strong,
.as-readonly-block strong,
.as-dialog-message strong,
.as-billing-row strong {
    font-weight: 600;
}

.as-hero-title {
    font-size: clamp(30px, 3.4vw, 38px);
    line-height: 1.06;
    letter-spacing: -0.035em;
    font-weight: 650;
}

.as-wizard-heading {
    font-size: clamp(24px, 2.5vw, 30px);
    line-height: 1.15;
    letter-spacing: -0.02em;
    font-weight: 600;
}

.as-button,
.as-kicker,
.as-history-head,
.as-history-group-title,
.as-editor-context-label,
.as-label,
.as-title-input,
.as-dialog-history > summary,
.as-side-title,
.as-advanced-style > summary,
.as-readonly-variant > summary,
.as-tab {
    font-weight: 600;
}

.as-history-title {
    font-weight: 550;
}

.as-hero-copy {
    margin-top: 18px;
    font-size: 15px;
    line-height: 1.6;
}

.as-hero-actions {
    margin-top: 24px;
}

.as-kicker {
    margin-bottom: 13px;
    color: var(--as-accent-text);
    letter-spacing: 0.055em;
}

/* Step-by-step wizard: quieter hierarchy and denser rhythm. */
.as-page-title strong {
    font-weight: 550;
}

.as-workspace-head {
    margin-bottom: 18px;
}

.as-progress-line {
    height: 3px;
    background: rgba(255, 255, 255, 0.055);
}

.as-progress-line span {
    background: var(--as-accent-progress);
}

.as-wizard-copy {
    margin-top: 9px;
    font-size: 13px;
    line-height: 1.55;
}

.as-context {
    margin-top: 14px;
    gap: 6px;
}

.as-context-chip {
    padding: 5px 8px;
    background: rgba(255, 255, 255, 0.025);
    font-size: 10px;
}

.as-choice-grid {
    margin-top: 20px;
    gap: 8px;
}

.as-choice {
    min-height: 62px;
    padding: 12px;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 10px;
    border-radius: 11px;
}

.as-choice-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(213, 138, 106, 0.07);
}

.as-choice strong {
    font-weight: 550;
}

.as-compose {
    margin-top: 22px;
    padding: 14px;
    border-color: rgba(255, 255, 255, 0.08);
    background: #111318;
}

/* Primary actions: graphite surfaces with a restrained warm detail. */
.as-button {
    min-height: 42px;
    color: #f4f5f7;
    background: linear-gradient(180deg, #252932 0%, #1e2128 100%);
    border-color: rgba(255, 255, 255, 0.10);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.as-button:hover {
    color: #fff;
    background: linear-gradient(180deg, #2b303a 0%, #23272f 100%);
    border-color: var(--as-accent-border);
}

.as-button:not(.as-button-secondary):not(.as-button-quiet):not(.as-button-danger) > i {
    color: var(--as-accent-text);
}

.as-button-secondary {
    color: var(--as-text);
    border-color: var(--as-line);
    background: var(--as-panel-2);
    box-shadow: none;
}

.as-button-secondary:hover {
    border-color: var(--as-line-strong);
    background: var(--as-panel-3);
}

.as-button-quiet {
    color: var(--as-soft);
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

.as-button-quiet:hover {
    color: var(--as-text);
    background: var(--as-panel-2);
}

.as-button-danger {
    color: rgb(255, 222, 222);
    border-color: rgba(228, 95, 95, 0.24);
    background: rgba(228, 95, 95, 0.10);
    box-shadow: none;
}

/* The global Create button is softened only while this workspace is open. */
body.as-active #create-dd-btn {
    color: #f4f5f7 !important;
    background-color: #20242c !important;
    background-image: linear-gradient(180deg, #252932 0%, #1e2128 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.10) !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.035) !important;
    font-weight: 600 !important;
}

body.as-active #create-dd-btn:hover {
    background-image: linear-gradient(180deg, #2b303a 0%, #23272f 100%) !important;
    border-color: var(--as-accent-border) !important;
}

body.as-active #create-dd-btn > i:first-child {
    color: var(--as-accent-text);
}

/* History: lower contrast and thinner completion indicators. */
.as-mini-progress {
    height: 2px;
    background: rgba(255, 255, 255, 0.055);
}

.as-mini-progress span {
    background: var(--as-accent-progress);
}

.as-history-item.is-active {
    border-color: var(--as-accent-border);
    background: var(--as-accent-soft);
}

.as-history-item:hover {
    background: rgba(255, 255, 255, 0.045);
}

/* Muted accent states across the wizard. */
.as-choice:hover {
    border-color: var(--as-accent-border);
}

.as-choice-icon,
.as-readonly-icon,
.as-tab.is-active {
    color: var(--as-accent-text);
}

.as-input:focus,
.as-textarea:focus {
    border-color: rgba(211, 154, 130, 0.40);
    box-shadow: 0 0 0 3px rgba(213, 138, 106, 0.08);
}

.as-icon-btn:focus-visible,
.as-button:focus-visible,
.as-choice:focus-visible,
.as-history-item:focus-visible,
.as-tab:focus-visible,
.as-rail-link:focus-visible {
    outline: 2px solid rgba(211, 154, 130, 0.24);
}

/* Modals: restrained border, shadow, type and actions. */
.as-dialog {
    border-color: rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: #111318;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.46);
}

.as-dialog::backdrop {
    background: rgba(5, 6, 8, 0.72);
    backdrop-filter: blur(6px);
}

.as-dialog-head {
    padding: 17px 18px 11px;
}

.as-dialog-head h2 {
    font-size: 17px;
    line-height: 1.3;
    font-weight: 650;
    letter-spacing: -0.015em;
}

.as-dialog-copy {
    color: #9fa3ad;
    font-size: 13px;
    line-height: 1.55;
}

.as-dialog-actions {
    background: rgba(255, 255, 255, 0.012);
}

@media (max-width: 640px) {
    .as-hero-title {
        font-size: clamp(30px, 9vw, 36px);
    }

    .as-wizard-heading {
        font-size: clamp(24px, 7vw, 28px);
    }

    .as-hero-copy {
        margin-top: 15px;
        font-size: 14px;
    }
}

/* Public workspace: preserve the current graphite/orange UI, with a single focused column. */
.as-shell.as-guest { grid-template-columns: minmax(0, 1fr); }
.as-guest .as-main { grid-template-rows: auto minmax(0, 1fr) auto; }
.as-guest .as-stage-inner { width: 100%; }
.as-guest .as-wizard { max-width: 880px; margin-inline: auto; }
.as-first-question { margin: 20px 0 14px; font-size: clamp(19px, 2vw, 24px); line-height: 1.3; font-weight: 600; }
.as-choice[data-value="__custom__"] { border-color: var(--as-accent-border); }
.as-choice:focus-visible, .as-button:focus-visible, .as-link-button:focus-visible,
.as-icon-btn:focus-visible, .as-dialog button:focus-visible { outline: 2px solid #f2b393; outline-offset: 3px; }
.as-public-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 18px; padding: 12px 20px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--as-line); font-size: 12px; color: #a5a8b1; line-height: 1.5; }
.as-public-note a { text-decoration: underline; text-underline-offset: 3px; }
.as-public-note button { min-height: 32px; }
.as-auth-providers { display: grid; gap: 10px; margin: 20px 0; }
.as-auth-providers button { min-height: 46px; white-space: normal; }
.as-dialog { max-height: calc(100dvh - 32px); overflow-y: auto; }
.as-welcome-grant { padding: 14px 18px; border: 1px solid var(--as-accent-border); background: var(--as-accent-soft); border-radius: 12px; margin-bottom: 18px; line-height: 1.5; }
.as-pending-notice { flex-wrap: wrap; }
.as-pending-notice .as-link-button { white-space: normal; }
.as-editor-toolbar > [data-action="copy-lyrics"] { min-height: 40px; margin-right: auto; }
.as-help a { text-decoration: underline; text-underline-offset: 3px; }
.as-guest .as-advanced-style { display: none; }
@media (max-width: 640px) {
  .as-input, .as-textarea { font-size: 16px; }
  .as-button, .as-choice, .as-icon-btn { min-height: 44px; }
  .as-guest .as-topbar { padding-inline: 16px; }
  .as-public-note { gap: 4px 14px; padding: 8px 14px max(8px, env(safe-area-inset-bottom)); font-size: 11px; }
  .as-public-note > span { flex-basis: 100%; text-align: center; }
  .as-first-question { font-size: 20px; }
  .as-auth-providers .as-button { width: 100%; }
  .as-dialog { max-width: calc(100vw - 24px); }
}
@media (prefers-reduced-motion: reduce) {
  .as-dialog *, .as-shell * { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
.as-shell .sg-voice-cluster, #asEditDialog .sg-voice-cluster { flex-wrap: wrap; }
.as-voice-quota { max-width: 250px; white-space: normal; color: #a5a8b1; font-size: 11px; line-height: 1.4; }
