:root {
    --bg: #f4f6f8;
    --panel: #ffffff;
    --ink: #12202f;
    --muted: #64758b;
    --line: #d2dbe5;
    --accent: #0d8e71;
    --accent-ink: #0b735b;
    --danger: #b54343;
    --danger-ink: #993333;
    --radius: 14px;
    --shadow: 0 10px 24px rgba(18, 32, 47, 0.12);
    font-family: "Avenir Next", "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    font-family: "Avenir Next", "Segoe UI", sans-serif;
    color: var(--ink);
    background: #fff;
    -webkit-text-size-adjust: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

.projects-dashboard {
    min-height: 100vh;
    overscroll-behavior-y: none;
    background:
        radial-gradient(1320px 680px at 50% 700px, rgba(154, 183, 221, 0.38) 0%, rgba(154, 183, 221, 0.08) 64%, rgba(154, 183, 221, 0) 86%),
        linear-gradient(180deg, #ffffff 0%, #ffffff 360px, #f2f7fe 540px, #e4edf9 100%);
}

html.dashboard-prompter-scroll {
    overflow: hidden !important;
}

body.projects-dashboard {
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
}

body.projects-dashboard.dashboard-prompter-active {
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: none;
}

body.projects-dashboard.dashboard-prompter-active .layout {
    min-height: calc(100dvh - 27px);
    overflow: visible;
}

.layout {
    width: min(1200px, 94vw);
    margin: 14px auto 60px;
}

.projects-dashboard .layout {
    margin-top: 27px;
    margin-bottom: 0;
    min-height: calc(100dvh - 27px);
    display: flex;
    flex-direction: column;
}

.project-header-sticky {
    position: sticky;
    top: 0;
    z-index: 70;
    background: #fff;
    padding-top: 5px;
    padding-bottom: 5px;
    border-bottom: 0;
    isolation: isolate;
}

.project-header-sticky::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    width: 100vw;
    height: 100%;
    transform: translateX(-50%);
    background: #fff;
    z-index: -1;
}

.project-header-sticky::after {
    content: "";
    position: absolute;
    left: 50%;
    top: -40px;
    width: 100vw;
    height: 40px;
    transform: translateX(-50%);
    background: #fff;
    z-index: -1;
}

body.projects-dashboard.dashboard-prompter-active .project-header-sticky,
body.projects-dashboard.dashboard-prompter-active .project-header-sticky::before,
body.projects-dashboard.dashboard-prompter-active .project-header-sticky::after {
    background: #fff;
}

.topbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.topbar-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

.dashboard-brand-title-row {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 0 1 auto;
}

.brand-logo {
    display: block;
    max-width: 105px;
    height: auto;
    object-fit: contain;
}

.dashboard-brand-title-row .brand-logo {
    flex: 0 0 auto;
}

.dashboard-title-divider {
    width: 1px;
    height: 32px;
    background: #6f869d;
    flex: 0 0 auto;
}

.dashboard-title-label {
    color: #2f4760;
    font-size: clamp(0.932rem, 1.701vw, 1.175rem);
    font-weight: 400;
}

.ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line);
}

.soft-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    border-radius: 10px;
    font: inherit;
    text-decoration: none;
    line-height: 1.2;
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line);
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}

.soft-btn:hover {
    background: #edf4fb;
    color: var(--ink);
    border-color: #c6d6e8;
}

.soft-btn:focus,
a.soft-btn:focus,
.soft-btn:focus-visible,
a.soft-btn:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

.dashboard-close-prompter-btn {
    font-weight: 400;
}

.dashboard-prompter-shell {
    --dashboard-prompter-accent-bg: #eaf3fd;
    --dashboard-prompter-accent-border: #c6d6e8;
    --dashboard-prompter-accent-ink: #1f3f5c;
    width: 100%;
    max-width: 100%;
    margin: 26px auto 48px;
    display: grid;
    gap: 14px;
}

body.projects-dashboard.dashboard-prompter-active .dashboard-prompter-shell {
    flex: 1 1 auto;
    min-height: 0;
    overflow: visible;
    margin: 24px auto 0;
    padding-bottom: 32px;
}

.dashboard-prompter-wrap {
    position: relative;
}

.dashboard-prompter-viewport {
    border: 1px solid rgba(13, 94, 130, 0.25);
    border-radius: 20px;
    background: #0f1218;
    color: #f3f7ff;
    height: min(58vh, 620px);
    min-height: 300px;
    max-height: 82vh;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 18px 36px rgba(10, 14, 22, 0.18);
    scrollbar-color: rgba(126, 161, 216, 0.78) rgba(255, 255, 255, 0.14);
    scrollbar-width: thin;
}

.dashboard-prompter-content {
    --dash-prompter-font-size: 56px;
    --dash-prompter-line-height: 1.4;
    font-family: "Avenir Next", "Segoe UI", sans-serif;
    font-size: var(--dash-prompter-font-size);
    line-height: var(--dash-prompter-line-height);
    font-weight: 550;
    letter-spacing: 0;
    white-space: pre-wrap;
    padding: 22vh 6vw;
    transform: none;
    user-select: text;
    cursor: text;
}

.dashboard-prompter-content.is-uppercase {
    text-transform: uppercase;
}

.dashboard-prompter-viewport:fullscreen .dashboard-prompter-content,
.dashboard-prompter-viewport:-webkit-full-screen .dashboard-prompter-content {
    width: min(100%, var(--dash-prompter-fullscreen-lock-width, 1100px));
    margin-left: auto;
    margin-right: auto;
}

.dashboard-prompter-fullscreen-tools {
    display: none;
}

.dashboard-prompter-viewport:fullscreen .dashboard-prompter-fullscreen-tools,
.dashboard-prompter-viewport:-webkit-full-screen .dashboard-prompter-fullscreen-tools {
    position: fixed;
    left: 50%;
    bottom: 14px;
    z-index: 20;
    display: flex;
    gap: 8px;
    align-items: center;
    transform: translateX(-50%);
    opacity: 0.58;
    transition: opacity 0.15s ease;
}

.dashboard-prompter-viewport:fullscreen .dashboard-prompter-fullscreen-tools:hover,
.dashboard-prompter-viewport:-webkit-full-screen .dashboard-prompter-fullscreen-tools:hover,
.dashboard-prompter-viewport:fullscreen .dashboard-prompter-fullscreen-tools:focus-within,
.dashboard-prompter-viewport:-webkit-full-screen .dashboard-prompter-fullscreen-tools:focus-within {
    opacity: 0.94;
}

.dashboard-prompter-fullscreen-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 28px;
    padding: 5px 8px;
    border: 1px solid rgba(170, 223, 255, 0.4);
    border-radius: 999px;
    background: rgba(8, 14, 23, 0.62);
    color: rgba(243, 247, 255, 0.9);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(8px);
    font-size: 12px;
    font-weight: 550;
}

.dashboard-prompter-fullscreen-pill input[type="range"] {
    appearance: none;
    width: 92px;
    height: 4px;
    border: 0;
    border-radius: 999px;
    background: rgba(201, 206, 213, 0.55);
    accent-color: #9fbce0;
}

.dashboard-prompter-fullscreen-pill input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 999px;
    background: rgba(201, 206, 213, 0.55);
}

.dashboard-prompter-fullscreen-pill input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    margin-top: -4px;
    border: 0;
    border-radius: 50%;
    background: #9fbce0;
}

.dashboard-prompter-fullscreen-pill input[type="range"]::-moz-range-track {
    height: 4px;
    border-radius: 999px;
    background: rgba(201, 206, 213, 0.55);
}

.dashboard-prompter-fullscreen-pill input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: 50%;
    background: #9fbce0;
}

.dashboard-prompter-content:focus {
    outline: 2px solid rgba(116, 196, 255, 0.5);
    outline-offset: -2px;
}

.dashboard-prompter-resize-handle {
    position: absolute;
    left: 50%;
    bottom: 8px;
    width: 130px;
    height: 14px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(153, 220, 255, 0.42), rgba(109, 175, 238, 0.64));
    border: 1px solid rgba(170, 223, 255, 0.65);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
    cursor: ns-resize;
    z-index: 5;
}

.dashboard-prompter-resize-handle::before {
    content: "";
    position: absolute;
    inset: 4px 14px;
    border-radius: 999px;
    background: rgba(5, 18, 33, 0.38);
}

.dashboard-prompter-panel {
    border: 1px solid #d6e0eb;
    border-radius: 18px;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.84);
    display: grid;
    gap: 14px;
}

.dashboard-prompter-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
}

.dashboard-prompter-head h2 {
    margin: 0;
    font-size: 1.45rem;
}

.dashboard-prompter-head p,
.dashboard-prompter-field p,
.dashboard-prompter-status,
.dashboard-prompter-hints {
    margin: 0;
    color: #66798f;
}

.dashboard-prompter-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.dashboard-prompter-actions .soft-btn {
    font-weight: 400;
}

.dashboard-prompter-play-btn {
    background: var(--dashboard-prompter-accent-bg) !important;
    border-color: var(--dashboard-prompter-accent-border) !important;
    color: var(--dashboard-prompter-accent-ink) !important;
}

.dashboard-prompter-play-btn.is-playing,
.dashboard-prompter-actions .is-recording,
.dashboard-prompter-stop-recording-btn:not(:disabled) {
    background: #e1edf9 !important;
    border-color: var(--dashboard-prompter-accent-border) !important;
    color: var(--dashboard-prompter-accent-ink) !important;
}

.dashboard-prompter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.dashboard-prompter-field {
    border: 1px solid #d6e0eb;
    border-radius: 14px;
    padding: 9px 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 12px;
    background: rgba(255, 255, 255, 0.72);
}

.dashboard-prompter-field > span,
.dashboard-prompter-field > output,
.dashboard-prompter-field-head > span:first-child {
    font-weight: 650;
}

.dashboard-prompter-field-head,
.dashboard-prompter-field p,
.dashboard-prompter-status,
.dashboard-prompter-import-row {
    grid-column: 1 / -1;
}

.dashboard-prompter-field input[type="range"] {
    appearance: none;
    grid-column: 1 / -1;
    width: 100%;
    height: 8px;
    border: 0;
    border-radius: 999px;
    background: #c9ced5;
    accent-color: #9fbce0;
    cursor: pointer;
}

#dashboard-prompter-speed-value,
#dashboard-prompter-font-value,
#dashboard-prompter-line-height-value,
#dashboard-prompter-background-value {
    display: none;
}

.dashboard-prompter-field input[type="range"]::-webkit-slider-runnable-track {
    height: 8px;
    border: 0;
    border-radius: 999px;
    background: #c9ced5;
}

.dashboard-prompter-field input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    margin-top: -5px;
    border: 0;
    border-radius: 50%;
    background: #9fbce0;
}

.dashboard-prompter-field input[type="range"]::-moz-range-track {
    height: 8px;
    border: 0;
    border-radius: 999px;
    background: #c9ced5;
}

.dashboard-prompter-field input[type="range"]::-moz-range-progress {
    height: 8px;
    border-radius: 999px;
    background: #c9ced5;
}

.dashboard-prompter-field input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: 0;
    border-radius: 50%;
    background: #9fbce0;
}

.dashboard-prompter-field > output {
    justify-self: end;
    color: var(--ink);
    line-height: 1.2;
}

.dashboard-prompter-field select,
.dashboard-prompter-field input[type="file"] {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100%;
    border: 1px solid #d6e0eb;
    border-radius: 10px;
    padding: 10px;
    font: inherit;
    background: #fff;
    color: var(--ink);
}

.dashboard-prompter-field input[type="file"].sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.dashboard-prompter-field select {
    appearance: none;
    padding-right: 30px;
    background-image: linear-gradient(45deg, transparent 50%, #12202f 50%), linear-gradient(135deg, #12202f 50%, transparent 50%);
    background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.dashboard-prompter-load-btn,
.dashboard-prompter-field input[type="file"]::file-selector-button {
    border: 1px solid #d6e0eb;
    border-radius: 999px;
    padding: 9px 14px;
    font: inherit;
    font-weight: 650;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
}

.dashboard-prompter-load-btn {
    min-height: 42px;
    text-decoration: none;
}

.dashboard-prompter-field-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}

.dashboard-prompter-toggle-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    color: #66798f;
}

.dashboard-prompter-format-list {
    color: #66798f;
    font-size: 0.84rem;
    font-weight: 650;
    white-space: nowrap;
}

.dashboard-prompter-import-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.dashboard-prompter-import-row button {
    white-space: nowrap;
}

.dashboard-prompter-status.is-error {
    color: #b54343;
}

.dashboard-prompter-hints {
    text-align: center;
    font-size: 0.9rem;
}

.dashboard-prompter-record-modal {
    position: fixed;
    inset: 0;
    z-index: 180;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(15, 18, 24, 0.38);
    backdrop-filter: blur(4px);
}

.dashboard-prompter-record-modal[hidden] {
    display: none !important;
}

.dashboard-prompter-record-panel {
    width: min(560px, 100%);
    border: 1px solid #d6e0eb;
    border-radius: 18px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 22px 60px rgba(10, 14, 22, 0.22);
    display: grid;
    gap: 14px;
}

.dashboard-prompter-record-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
}

.dashboard-prompter-record-head h2 {
    margin: 0;
    font-size: 1.25rem;
}

.dashboard-prompter-record-head p {
    margin: 4px 0 0;
    color: #66798f;
}

.dashboard-prompter-record-head p.is-error {
    color: #b54343;
}

.dashboard-prompter-record-field {
    background: rgba(255, 255, 255, 0.82);
}

.dashboard-prompter-record-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.dashboard-prompter-start-recording-btn {
    background: var(--dashboard-prompter-accent-bg) !important;
    border-color: var(--dashboard-prompter-accent-border) !important;
    color: var(--dashboard-prompter-accent-ink) !important;
}

.dashboard-prompter-stop-recording-btn:not(:disabled) {
    background: #e1edf9 !important;
    border-color: var(--dashboard-prompter-accent-border) !important;
    color: var(--dashboard-prompter-accent-ink) !important;
}

.dashboard-prompter-recording-hud {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 190;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(198, 214, 232, 0.95);
    border-radius: 999px;
    padding: 8px 10px 8px 12px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 10px 28px rgba(10, 14, 22, 0.16);
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 650;
}

.dashboard-prompter-recording-hud[hidden] {
    display: none !important;
}

.dashboard-prompter-recording-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #9fbce0;
    box-shadow: 0 0 0 0 rgba(159, 188, 224, 0.55);
    animation: dashboardPrompterRecordingPulse 1.4s ease-in-out infinite;
}

.dashboard-prompter-recording-hud button {
    padding: 7px 12px;
    background: #e1edf9 !important;
    border-color: #c6d6e8 !important;
    color: #1f3f5c !important;
}

@keyframes dashboardPrompterRecordingPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(159, 188, 224, 0.55);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(159, 188, 224, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(159, 188, 224, 0);
    }
}

body.dashboard-prompter-resizing,
body.dashboard-prompter-resizing * {
    cursor: ns-resize !important;
    user-select: none !important;
}

@media (max-width: 860px) {
    .dashboard-prompter-shell {
        width: min(100%, calc(100vw - 24px));
    }

    .dashboard-prompter-head,
    .dashboard-prompter-field-head {
        flex-direction: column;
    }

    .dashboard-prompter-grid,
    .dashboard-prompter-import-row {
        grid-template-columns: 1fr;
    }

    .dashboard-prompter-toggle-row {
        justify-content: flex-start;
    }

    .dashboard-prompter-content {
        --dash-prompter-font-size: 44px;
        padding: 18vh 8vw;
    }
}
