@import url("https://fonts.googleapis.com/css2?family=Jersey+15&display=swap");

:root {
    --window-surface: #c1c1c0;
    --window-shadow-dark: #0a0a0a;
    --window-shadow-mid: #808080;
    --window-shadow-light: #ffffff;
    --window-shadow-soft: #dfdfdf;
    --text-dark: #1f1f1f;
    --text-muted: #303030;
    --danger: #7f241d;
    --danger-soft: #e6d0cb;
    --color4: #61a1a0;
    --color2: #a9b9b8;
    --color3: #91b1b0;
    --color6: #016565;
    --color7: #064c4c;
    --raised-shadow: inset -1px -1px var(--window-shadow-dark), inset 1px 1px var(--window-shadow-light), inset -2px -2px var(--window-shadow-mid), inset 2px 2px var(--window-shadow-soft);
    --pressed-shadow: inset 1px 1px var(--window-shadow-dark), inset -1px -1px var(--window-shadow-light), inset 2px 2px var(--window-shadow-mid), inset -2px -2px var(--window-shadow-soft);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

html {
    overflow-y: auto;
    scrollbar-gutter: stable;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--color4);
    border-radius: 0 !important;
}

::-webkit-scrollbar-thumb {
    background: var(--color6);
    border-radius: 0 !important;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color6);
}

::-webkit-scrollbar-track:horizontal,
::-webkit-scrollbar-track:vertical {
    background: var(--color4);
    border-radius: 0 !important;
}

::-webkit-scrollbar-thumb:horizontal,
::-webkit-scrollbar-thumb:vertical {
    background: var(--color6);
    border-radius: 0 !important;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Jersey 15", sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: 14px;
    line-height: 1.3;
    color: var(--text-dark);
    background-color: var(--color6);
}

body.is-authenticated {
    background-color: var(--color4);
}

button,
input,
textarea,
select {
    font: inherit;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
}

.hidden {
    display: none !important;
}

.no-select {
    user-select: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.app-shell {
    width: calc(100% - 16px);
    max-width: 1400px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 8px 0;
}

body:not(.is-authenticated) .app-shell {
    width: calc(100% - 16px);
    max-width: 380px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}

.notice,
.workspace-window,
.login-window,
.list-card,
.editor-card,
.entry-card,
.secondary-link,
.nav-btn,
.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn,
.login-submit-btn {
    background-color: var(--window-surface);
    box-shadow: var(--raised-shadow);
}

.notice {
    padding: 10px 12px;
}

body.is-authenticated .notice {
    max-width: 680px;
    margin-bottom: 12px;
}

.notice.is-error {
    color: var(--danger);
}

.notice.is-success {
    color: var(--color7);
}

.workspace-window,
.login-window {
    padding-bottom: 4px;
}

.login-window {
    padding-top: 4px;
    padding-bottom: 2px;
}

.tab-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 4px 4px 2px;
    padding: 2px 3px;
    color: var(--window-shadow-light);
    background-color: var(--color6);
}

.tab-left,
.tab-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tab-left img {
    width: 20px;
    height: 20px;
}

.tab-left span {
    line-height: 1;
    padding: 0 1px;
}

.tab-content {
    width: auto;
    margin: 0 4px 2px;
    background-color: var(--color2);
    box-shadow: var(--raised-shadow);
}

.login-stage {
    width: 100%;
}

.login-window .tab-title {
    margin: 0 4px 2px;
    padding: 3px 8px 4px 6px;
}

.login-window .tab-content {
    margin-bottom: 2px;
}

.login-window .tab-left {
    gap: 8px;
}

.login-window .tab-left span {
    padding: 0 5px 0 1px;
}

.login-window__content {
    min-height: 120px;
    padding: 6px;
    display: flex;
    align-items: center;
}

.login-panel {
    width: 100%;
    padding: 8px;
    background-color: var(--window-surface);
    box-shadow: var(--pressed-shadow);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-form input,
.editor-card input,
.editor-card textarea {
    width: 100%;
    border: none;
    background-color: #ffffff;
    color: var(--text-dark);
    box-shadow: var(--pressed-shadow);
}

.login-form input {
    height: 30px;
    padding: 0 10px;
}

.login-form input::placeholder {
    color: #5b5b5b;
    text-transform: lowercase;
}

.login-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 2px;
}

.login-submit-btn,
.window-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-width: 56px;
    height: 18px;
    padding: 12px 8px;
    border: none;
    cursor: pointer;
    line-height: 1.2;
    color: var(--window-shadow-light);
    background-color: var(--color6);
}

.sidebar-action-btn {
    display: inline-flex;
    align-items: center;
    width: 100%;
    justify-content: center;
    text-decoration: none;
}

.secondary-link,
.nav-btn,
.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn {
    border: none;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-dark);
}

.secondary-btn {
    line-height: 1;
}

.secondary-link:active,
.nav-btn:active,
.primary-btn:active,
.secondary-btn:active,
.ghost-btn:active,
.danger-btn:active,
.login-submit-btn:active,
.window-action-btn:active {
    box-shadow: var(--pressed-shadow);
}

.workspace {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.workspace-window__body,
.content-panel__body,
.sidebar-card {
    padding: 10px;
}

.workspace-layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.workspace-window--hero .tab-left {
    gap: 6px;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 10px 12px;
    background-color: var(--window-surface);
    box-shadow: var(--pressed-shadow);
}

.app-header h1,
.panel-heading h2,
.editor-card__header h3,
.list-card__header h3 {
    margin: 0;
    font-size: 16px;
    line-height: 1.2;
    font-weight: 400;
}

.eyebrow {
    margin: 0 0 4px;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color7);
}

.app-subtitle,
.sidebar-note,
.entry-card__meta span,
.entry-card__meta small {
    color: var(--text-muted);
}

.app-subtitle {
    margin: 6px 0 0;
    max-width: 760px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.secondary-link,
.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn,
.nav-btn {
    min-height: 24px;
    padding: 4px 10px;
    line-height: 1;
}

.primary-btn {
    color: var(--window-shadow-light);
    background-color: var(--color6);
}

.danger-btn {
    color: var(--danger);
    background-color: var(--danger-soft);
}

.sidebar-window {
    position: sticky;
    top: 8px;
    align-self: start;
}

.sidebar-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-card .nav-btn {
    text-align: left;
}

.sidebar-card .nav-btn.is-active {
    color: var(--window-shadow-light);
    background-color: var(--color6);
}

.sidebar-note {
    margin: 8px 2px 0;
    font-size: 12px;
    line-height: 1.4;
}

.sidebar-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
}

.panel-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.content-panel {
    display: none;
}

.content-panel.is-active {
    display: block;
}

.panel-titlebar .secondary-btn {
    min-height: 18px;
    padding: 2px 8px;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
    padding: 6px 8px;
    background-color: var(--window-surface);
    box-shadow: var(--raised-shadow);
}

.list-card,
.editor-card {
    padding: 6px;
    background-color: var(--window-surface);
    box-shadow: var(--pressed-shadow);
}

.list-card__header,
.editor-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 6px;
    background-color: var(--color6);
    color: var(--window-shadow-light);
    box-shadow: var(--raised-shadow);
}

.editor-card__header {
    min-height: 32px;
    justify-content: flex-start;
}

.list-card__header h3,
.editor-card__header h3 {
    color: var(--window-shadow-light);
    font-size: 16px;
}

.editor-card__header h3 {
    line-height: 1;
}

.editor-card__header .danger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    min-height: 24px;
    line-height: 1;
    white-space: nowrap;
}

.editor-card__header .danger-btn.hidden {
    display: inline-flex !important;
    visibility: hidden;
    pointer-events: none;
}

.list-card__header span {
    min-width: 28px;
    padding: 2px 6px;
    text-align: center;
    color: var(--text-dark);
    background-color: var(--color2);
    box-shadow: var(--pressed-shadow);
}

.split-layout {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 14px;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}

.home-card,
.music-workflow-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.home-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.home-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px;
    text-align: center;
    background-color: #ffffff;
    box-shadow: var(--pressed-shadow);
}

.home-stat span,
.music-workflow-meta,
.home-message-item__meta,
.home-message-item__tag {
    color: var(--text-muted);
}

.home-card-status.is-live {
    color: var(--danger);
    background-color: var(--danger-soft);
}

.home-stat span {
    font-size: 12px;
    text-transform: lowercase;
}

.home-stat strong {
    font-size: 28px;
    line-height: 1;
    font-weight: 400;
}

.home-empty-note,
.music-workflow-meta {
    margin: 0;
}

.home-message-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 100%;
}

.home-message-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    background-color: #ffffff;
    box-shadow: var(--pressed-shadow);
}

.home-message-item__header,
.home-message-item__title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.home-message-item__header {
    justify-content: space-between;
}

.home-message-item__title {
    min-width: 0;
}

.home-message-item__text {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.music-workflow-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.music-workflow-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.music-workflow-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 0 0 220px;
    width: 220px;
}

.music-workflow-field > span {
    font-size: 12px;
    text-transform: lowercase;
}

.music-workflow-field input {
    height: 24px;
    min-height: 24px;
    padding: 4px 10px;
    border: none;
    background-color: #ffffff;
    color: var(--text-dark);
    box-shadow: var(--pressed-shadow);
    box-sizing: border-box;
}

.music-workflow-field input:focus {
    outline: 2px solid var(--color6);
    outline-offset: -2px;
}

.music-workflow-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: end;
    flex: 1 1 0;
}

.music-workflow-log {
    margin: 0;
    min-height: 120px;
    max-height: 260px;
    overflow: auto;
    padding: 8px;
    color: #39ff14;
    background-color: #071108;
    box-shadow: var(--pressed-shadow);
    font-family: "Courier New", Courier, monospace;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.music-workflow-log:empty::before {
    content: attr(data-placeholder);
    color: rgba(57, 255, 20, 0.65);
}

.music-workflow-log::selection {
    color: #071108;
    background-color: #39ff14;
}

.editor-pane {
    display: flex;
    min-width: 0;
    min-height: 360px;
}

.editor-pane > .editor-card {
    width: 100%;
}

.entry-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    max-height: calc(100vh - 260px);
    overflow: auto;
    padding-right: 2px;
}

.entry-card {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    width: 100%;
    padding: 8px;
    border: none;
    text-align: left;
}

.entry-card--text-only {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
}

.entry-card.is-active {
    background-color: var(--color3);
}

.entry-card__thumb,
.single-preview img,
.preview-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background-color: var(--color3);
    box-shadow: var(--pressed-shadow);
}

.entry-card__meta {
    min-width: 0;
}

.entry-card__meta strong,
.entry-card__meta span,
.entry-card__meta small {
    display: block;
}

.entry-card__meta strong {
    font-size: 18px;
    line-height: 1;
}

.entry-card__meta span,
.entry-card__meta small {
    font-size: 15px;
    line-height: 1.05;
}

.entry-card__meta strong {
    margin-bottom: 2px;
}

.entry-card__meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.entry-card__meta-subject {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entry-card__meta-id {
    flex-shrink: 0;
    text-align: right;
}

.editor-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.editor-empty-state {
    align-items: center;
    justify-content: flex-start;
    padding: 20% 24px 24px;
    text-align: center;
}

.editor-empty-state__inner {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 320px;
}

.editor-empty-state__title,
.editor-empty-state__text {
    margin: 0;
}

.editor-empty-state__title {
    font-size: 22px;
    line-height: 1;
}

.editor-empty-state__text {
    color: var(--text-muted);
    line-height: 1.35;
}

.editor-card label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.editor-card label > span {
    font-size: 12px;
    text-transform: lowercase;
}

.editor-help {
    margin: -4px 0 0;
    font-size: 12px;
    line-height: 1.35;
    color: var(--text-muted);
}

.document-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.document-editor-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.document-editor-card {
    gap: 8px;
}

.document-save-btn {
    min-height: 18px;
    padding: 2px 8px;
}

.document-editor-title {
    margin: 0;
    font-size: 13px;
    line-height: 1;
}

.document-json-textarea {
    min-height: 220px;
    resize: vertical;
    font-family: "Courier New", Courier, monospace;
    line-height: 1.4;
}

.document-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.document-form--raw {
    gap: 8px;
}

.document-form--flush-collection > .document-collection:first-child {
    margin-top: -6px;
}

.document-inline-note {
    margin: 0;
    font-size: 12px;
    line-height: 1.35;
    color: var(--text-muted);
}

.document-subsection,
.document-collection {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    margin-left: -6px;
    margin-right: -6px;
    margin-bottom: -6px;
    background-color: var(--color7);
    box-shadow: var(--pressed-shadow);
}

.document-collection {
    background-color: #233131 !important;
}

.document-subsection__title,
.document-collection__title,
.document-list-item__title {
    margin: 0;
    font-size: 18px;
    line-height: 1;
    color: var(--text-dark);
}

.document-collection__title {
    color: var(--window-shadow-light);
}

.document-collection__header,
.document-list-item__header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.document-action-btn,
.document-remove-btn {
    margin-left: auto;
}

.document-collection__empty {
    margin: 0;
    font-size: 12px;
    line-height: 1.35;
    color: var(--text-muted);
}

.document-collection__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.document-collection__list--two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.document-collection__list--two-column .document-list-item {
    min-width: 0;
}

.document-list-item {
    gap: 10px;
}

.document-list-item--nested {
    background-color: var(--color3);
}

.document-variant-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.document-variant-group--full-width .document-field {
    width: 100%;
}

.document-variant-group--stacked {
    gap: 10px;
}

.document-inline-highlights {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.document-inline-highlights__label {
    margin: 0;
    font-size: 12px;
    line-height: 1;
    color: var(--text-muted);
    text-transform: lowercase;
}

.document-inline-highlights__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.document-inline-highlight-add-btn {
    margin-left: auto;
}

.document-inline-highlight-add-btn + .document-remove-btn {
    margin-left: 0;
}

.document-checkbox-field > span {
    font-size: 12px;
    text-transform: lowercase;
}

.editor-card input,
.editor-card textarea,
.editor-card select {
    padding: 8px 10px;
}

.login-form input:focus,
.editor-card input:focus,
.editor-card textarea:focus,
.editor-card select:focus {
    outline: 2px solid var(--color6);
    outline-offset: -2px;
}

.editor-card select {
    background-color: var(--window-surface);
    color: var(--text-dark);
    box-shadow: var(--pressed-shadow);
    border: none;
}

.editor-card input[type="color"] {
    height: 34px;
    padding: 4px;
}

.editor-card input[type="file"] {
    padding: 6px;
    background-color: var(--window-surface);
}

.editor-card textarea {
    resize: vertical;
    min-height: 34px;
}

.editor-card .document-field--compact textarea {
    min-height: 34px;
    height: 34px;
    line-height: 1.25;
}

.field-grid {
    display: grid;
    gap: 12px;
}

.field-grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-grid--four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.checkbox-row {
    flex-direction: row !important;
    align-items: center;
    gap: 8px !important;
}

.checkbox-row input {
    width: auto;
    box-shadow: none;
}

.preview-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
    gap: 8px;
}

.preview-thumb {
    position: relative;
    overflow: hidden;
}

.preview-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-thumb span {
    position: absolute;
    left: 6px;
    bottom: 6px;
    padding: 2px 6px;
    font-size: 10px;
    color: var(--window-shadow-light);
    background-color: rgba(10, 51, 51, 0.92);
}

@media (max-width: 1100px) {
    .workspace-layout,
    .split-layout,
    .home-grid {
        grid-template-columns: 1fr;
    }

    .sidebar-window {
        position: static;
    }
}

@media (max-width: 720px) {
    .app-shell {
        width: calc(100% - 16px);
        padding: 8px 0;
    }

    body:not(.is-authenticated) .app-shell {
        width: calc(100% - 16px);
    }

    .app-header,
    .panel-heading,
    .header-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .panel-titlebar,
    .list-card__header,
    .editor-card__header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
    }

    .panel-titlebar {
        gap: 8px;
    }

    .panel-titlebar .tab-left,
    .list-card__header h3,
    .editor-card__header h3 {
        min-width: 0;
    }

    .panel-titlebar .tab-right {
        width: auto;
        justify-content: flex-end;
        margin-left: auto;
    }

    .list-card__header {
        gap: 6px;
    }

    .list-card__header span {
        margin-left: auto;
    }

    .editor-card__header {
        gap: 6px;
    }

    .editor-card__header .danger-btn {
        margin-left: auto;
    }

    .document-collection__header,
    .document-list-item__header {
        flex-wrap: wrap;
    }

    .field-grid--two,
    .field-grid--three,
    .field-grid--four {
        grid-template-columns: 1fr;
    }

    .document-collection__list--two-column {
        grid-template-columns: 1fr;
    }
}