/* Dashboard pages - Overview, Library, Voices - and the Create wizard.
   Tokens come from app-shell.css. */

/* =========================================================================
   Overview
   ========================================================================= */
.ov { max-width: 1000px; margin: 0 auto; padding: 44px 0 28px; }
.ov-hero { text-align: center; padding: 26px 16px 0; }
.ov-orb { width: 82px; height: 82px; margin: 0 auto 40px; display: block; filter: drop-shadow(0 8px 20px rgba(24, 24, 27, .14)); }
.ov-title { font-size: 40px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; margin: 0 0 16px; color: var(--ink); }
.ov-sub { font-size: 16px; color: var(--ink-2); line-height: 1.45; margin: 0 auto 22px; max-width: 460px; }
.ov-ships { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-soft); }
.ov-ships img { width: 16px; height: 16px; opacity: .7; }

.ov-composer { max-width: 820px; margin: 44px auto 0; border-radius: 16px; background: var(--fill); padding: 0 0 0; }
.ov-composer-bar {
    display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 14px;
    font-size: 13.5px; color: var(--ink-2);
}
.ov-pro {
    display: inline-flex; align-items: center; height: 20px; padding: 0 9px; border-radius: 999px;
    background: linear-gradient(90deg, #7c5cff, #a78bfa); color: #fff; font-size: 11.5px; font-weight: 500;
}
.ov-upgrade { margin-left: auto; color: var(--ink); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; font-size: 13.5px; }
.ov-card {
    background: #fff; border: 1px solid var(--line); border-radius: 14px;
    box-shadow: 0 10px 30px -14px rgba(24, 24, 27, .18), 0 1px 2px rgba(24, 24, 27, .05);
    padding: 12px 14px 14px;
}
.ov-attach {
    display: none; margin: 4px 0 10px;
}
.ov-attach.is-shown { display: block; }
.ov-attach-chip {
    display: inline-flex; flex-direction: column; gap: 8px; width: 120px; padding: 10px; border-radius: 10px;
    background: var(--accent-soft); border: 1px solid var(--accent-line); position: relative;
}
.ov-attach-name { font-size: 12px; line-height: 1.3; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ov-attach-meta { font-size: 12px; color: var(--ink-2); }
.ov-attach-remove {
    position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; border-radius: 999px; background: var(--ink); color: #fff;
    display: grid; place-items: center; border: 2px solid #fff;
}
.ov-input-row { display: flex; align-items: flex-start; gap: 10px; }
.ov-plus { width: 22px; height: 22px; flex-shrink: 0; display: grid; place-items: center; margin-top: 2px; color: var(--ink); }
.ov-plus img { width: 20px; height: 20px; }
.ov-text {
    flex: 1; min-height: 68px; max-height: 260px; resize: none; border: 0; outline: none; background: transparent;
    font: inherit; font-size: 15px; line-height: 1.45; color: var(--ink); padding: 2px 0 0;
}
.ov-text::placeholder { color: var(--ink-mute); }
.ov-controls { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.ov-controls .wz-pill { height: 34px; }
.ov-mic { margin-left: auto; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; color: var(--ink-2); }
.ov-mic:hover { background: var(--fill); }
.ov-mic.is-on { background: #fee2e2; color: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, .15); }
.ov-mic img { width: 20px; height: 20px; }
.ov-mic.is-on img { filter: invert(20%) sepia(90%) saturate(4000%) hue-rotate(350deg); }
.ov-create { height: 36px; padding: 0 16px; }
.ov-error { font-size: 12.5px; color: var(--danger); margin: 8px 0 0 32px; }

@media (max-width: 640px) {
    .ov { padding-top: 20px; }
    .ov-title { font-size: 30px; }
    .ov-controls { flex-wrap: wrap; }
    .ov-mic { margin-left: 0; }
    .ov-create { margin-left: auto; }
}

/* =========================================================================
   Library
   ========================================================================= */
.lib-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.lib-toolbar .wz-search { width: 372px; max-width: 100%; }
.lib-toolbar .wz-seg { margin-left: auto; }

.lib-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.lib-card {
    position: relative; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
    box-shadow: var(--shadow-card); display: flex; flex-direction: column; transition: box-shadow .15s, border-color .15s;
}
.lib-card:hover { border-color: #d9d9de; box-shadow: 0 8px 24px -14px rgba(24, 24, 27, .35); }
.lib-cover {
    position: relative; height: 150px; background: var(--fill); overflow: hidden; display: block;
}
.lib-cover-bg { position: absolute; inset: -20px; background-size: cover; background-position: center; filter: blur(18px) saturate(1.2); opacity: .9; }
.lib-cover-img { position: absolute; left: 50%; top: 0; height: 100%; transform: translateX(-50%); object-fit: cover; max-width: 100%; }
.lib-cover.is-placeholder { background: var(--fill); }
.lib-cover.is-placeholder::before {
    content: ''; position: absolute; inset: 0;
    background-image: linear-gradient(45deg, #ececee 25%, transparent 25%), linear-gradient(-45deg, #ececee 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ececee 75%), linear-gradient(-45deg, transparent 75%, #ececee 75%);
    background-size: 24px 24px; background-position: 0 0, 0 12px, 12px -12px, -12px 0; opacity: .8;
}
.lib-cover.is-gradient .lib-cover-bg { filter: none; inset: 0; opacity: 1; }
.lib-cover-title { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; color: #fff; font-weight: 600; font-size: 14px; line-height: 1.35; text-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.lib-status {
    position: absolute; top: 12px; left: 12px; height: 22px; padding: 0 9px; border-radius: 999px; background: rgba(255, 255, 255, .92);
    font-size: 12px; font-weight: 500; color: var(--ink); display: inline-flex; align-items: center; box-shadow: 0 1px 2px rgba(0, 0, 0, .1);
}
.lib-status.is-processing::before { content: ''; width: 6px; height: 6px; border-radius: 999px; background: #f59e0b; margin-right: 6px; animation: lib-pulse 1.6s ease-in-out infinite; }
@keyframes lib-pulse { 50% { opacity: .35; } }
.lib-duration {
    position: absolute; bottom: 12px; left: 12px; height: 22px; padding: 0 9px; border-radius: 999px;
    background: rgba(24, 24, 27, .55); color: #fff; font-size: 12px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px;
    backdrop-filter: blur(4px);
}
.lib-menu-btn {
    position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 999px; background: #fff;
    display: grid; place-items: center; opacity: 0; transition: opacity .12s; box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}
.lib-menu-btn img { width: 16px; height: 16px; }
.lib-card:hover .lib-menu-btn, .lib-menu-btn[aria-expanded="true"] { opacity: 1; }
.lib-play {
    position: absolute; left: 50%; top: 50%; width: 50px; height: 50px; margin: -25px 0 0 -25px; border-radius: 999px;
    background: #fff; display: grid; place-items: center; opacity: 0; transition: opacity .12s, transform .12s; transform: scale(.92);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
}
.lib-play svg { margin-left: 3px; }
.lib-card:hover .lib-play { opacity: 1; transform: none; }
.lib-body { padding: 12px 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.lib-title {
    font-size: 14px; font-weight: 500; line-height: 1.3; color: var(--ink); text-decoration: none;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 36px;
}
.lib-meta { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-2); min-height: 18px; }
.lib-meta > span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.lib-meta .wz-avatar { --wz-av-size: 16px; }
.lib-meta .wz-flag { width: 16px; height: 16px; border-radius: 999px; background-size: cover; }
.lib-meta.is-empty { color: var(--ink-soft); }
.lib-date { font-size: 12px; color: var(--ink-soft); }

.lib-empty { text-align: center; padding: 72px 20px; }
.lib-empty-icon { width: 56px; height: 56px; border-radius: 14px; background: var(--fill); display: grid; place-items: center; margin: 0 auto 14px; }
.lib-empty-icon img { width: 22px; height: 22px; opacity: .6; }
.lib-empty h3 { font-size: 16px; font-weight: 600; margin: 0 0 6px; }
.lib-empty p { font-size: 13.5px; color: var(--ink-soft); margin: 0 0 18px; }
.lib-skeleton { height: 262px; border-radius: 12px; background: linear-gradient(90deg, #f4f4f5 25%, #ebebee 50%, #f4f4f5 75%); background-size: 200% 100%; animation: lib-shimmer 1.4s linear infinite; }
@keyframes lib-shimmer { to { background-position: -200% 0; } }

@media (max-width: 1240px) { .lib-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .lib-toolbar .wz-seg { margin-left: 0; } }
@media (max-width: 520px) { .lib-grid { grid-template-columns: 1fr; } }

/* =========================================================================
   Voices
   ========================================================================= */
.vc-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.vc-toolbar .wz-search { flex: 1; }
.vc-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 30px; }
.vc-filters .wz-pill { height: 34px; }
.vc-filters .wz-pill img { width: 16px; height: 16px; }
.vc-filters-sep { width: 1px; height: 22px; background: var(--line); margin: 0 10px; }

.vc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 16px; }
.vc-card {
    position: relative; display: flex; align-items: flex-start; gap: 14px; padding: 14px 14px 16px;
    background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-card);
    transition: border-color .15s, box-shadow .15s;
}
.vc-card:hover { border-color: #d9d9de; box-shadow: 0 8px 24px -14px rgba(24, 24, 27, .3); }
.vc-card .wz-avatar { --wz-av-size: 44px; margin-top: 2px; }
.vc-body { min-width: 0; flex: 1; }
.vc-name { font-size: 15.5px; font-weight: 500; letter-spacing: -.01em; color: var(--ink); margin: 0 0 2px; }
.vc-meta { font-size: 13px; color: var(--ink-2); margin: 0 0 10px; }
.vc-meta span + span::before { content: '·'; margin: 0 6px; color: var(--ink-mute); }
.vc-langs { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-soft); }
.vc-langs svg { color: var(--ink-mute); }
.vc-play {
    position: absolute; top: 14px; right: 14px; width: 28px; height: 28px; border-radius: 999px;
    border: 1px solid var(--line-soft); background: #fff; display: grid; place-items: center; color: #fff;
    transition: background .12s, border-color .12s, transform .12s;
}
.vc-play svg { display: block; }
.vc-card:hover .vc-play, .vc-play.is-on { background: var(--ink); border-color: var(--ink); }
.vc-play:not(.is-on):not(:hover) svg { opacity: 0; }
.vc-card:hover .vc-play svg, .vc-play.is-on svg { opacity: 1; }
.vc-empty { padding: 60px 20px; text-align: center; font-size: 14px; color: var(--ink-soft); }

@media (max-width: 1240px) { .vc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .vc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .vc-grid { grid-template-columns: 1fr; } .vc-filters-sep { display: none; } }

/* =========================================================================
   Create wizard
   ========================================================================= */
.cm .wz-modal-body { position: relative; min-height: 300px; }
.cm-label { display: block; font-size: 14px; color: var(--ink); margin: 0 0 8px; }
.cm-drop {
    border: 1px solid var(--line); border-radius: 12px; background: #fff; min-height: 132px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer;
    text-align: center; padding: 20px; transition: border-color .12s, background .12s; outline: none;
}
.cm-drop:hover, .cm-drop:focus-visible { border-color: #c8c8cd; }
.cm-drop.is-dragging { border-color: var(--ink); background: var(--fill-2); }
.cm-drop-icon { width: 18px; height: 18px; margin-bottom: 8px; }
.cm-drop-title { font-size: 14px; font-weight: 500; margin: 0; color: var(--ink); word-break: break-word; }
.cm-drop-sub { font-size: 13px; color: var(--ink-soft); margin: 0; }
.cm-note { font-size: 12.5px; color: var(--ink-2); background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 8px; padding: 8px 10px; margin: 10px 0 0; line-height: 1.45; }
.cm-error { font-size: 12.5px; color: var(--danger); margin: 10px 0 0; }
.cm-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.cm-fields .wz-pill.is-field { font-size: 14px; }

.cm-cover-row { display: flex; gap: 16px; margin-bottom: 22px; }
.cm-cover {
    width: 120px; height: 140px; border-radius: 8px; flex-shrink: 0; overflow: hidden;
    background: linear-gradient(160deg, #cfd8ff 0%, #6d7cf6 45%, #2d3ac9 100%);
}
.cm-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cm-cover-copy { padding-top: 2px; }
.cm-cover-title { font-size: 15px; font-weight: 500; margin: 0 0 3px; }
.cm-cover-sub { font-size: 13px; color: var(--ink-soft); margin: 0 0 12px; }
.cm-cover-actions { display: flex; align-items: center; gap: 6px; }
.cm-count { font-size: 13.5px; color: var(--ink-2); margin: 0 0 8px; }
.cm-cast-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cm-cast-head .cm-count { margin: 0; }
.cm-list { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cm-row { display: flex; align-items: center; gap: 10px; min-height: 45px; padding: 0 12px 0 10px; border-top: 1px solid var(--line-soft); background: #fff; }
.cm-row:first-child { border-top: 0; }
.cm-row.is-dragging { opacity: .45; }
.cm-grip { width: 18px; height: 18px; cursor: grab; flex-shrink: 0; }
.cm-row-title {
    flex: 1; min-width: 0; text-align: left; font-size: 14px; color: var(--ink); padding: 4px 8px; margin-left: -8px; border-radius: 6px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cm-row-title:hover { background: var(--fill); }
.cm-row-editing { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; }
.cm-row-prefix { font-size: 14px; color: var(--ink); }
.cm-row-input {
    flex: 1; min-width: 0; height: 30px; padding: 0 8px; border: 1px solid var(--ink); border-radius: 6px; font-size: 14px; outline: none; background: #fff;
}
.cm-check {
    width: 18px; height: 18px; border-radius: 4px; border: 1px solid #c4c4ca; background: #fff; color: #fff;
    display: grid; place-items: center; flex-shrink: 0; transition: background .12s, border-color .12s;
}
.cm-check svg { opacity: 0; }
.cm-check.is-on { background: var(--ink); border-color: var(--ink); }
.cm-check.is-on svg { opacity: 1; }
.cm-cast-row { padding: 8px 12px 8px 12px; }
.cm-cast-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cm-cast-name { font-size: 13.5px; font-weight: 500; color: var(--ink); }
.cm-cast-meta { font-size: 12px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-default { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-soft); }
.cm-default-check { width: 16px; height: 16px; border-radius: 999px; background: var(--ink); color: #fff; display: grid; place-items: center; }
.cm-default-check svg { width: 10px; height: 10px; }
.cm-cast-btn { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; color: var(--ink-2); }
.cm-cast-btn:hover { background: var(--fill); }
.cm-cast-btn img { width: 16px; height: 16px; }
.cm-hint { font-size: 12.5px; color: var(--ink-soft); margin: 10px 0 0; line-height: 1.45; }
.cm-busy {
    position: absolute; inset: 0; background: rgba(250, 250, 250, .85); display: flex; align-items: center; justify-content: center; gap: 10px;
    font-size: 14px; color: var(--ink-2); z-index: 5;
}
.cm-busy[hidden] { display: none; }
body.modal-open { overflow: hidden; }

@media (max-width: 640px) {
    .cm-fields { grid-template-columns: 1fr; }
    .cm-cover-row { flex-direction: column; }
}
