:root {
    --app-ink: #101828;
    --app-blue: #1769aa;
    --app-blue-soft: #e8f2fb;
    --app-border: #dde3ea;
    --app-muted: #667085;
}

body {
    background: #f4f6f8;
    color: var(--app-ink);
}

a {
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.page-width {
    max-width: 1600px;
    margin-inline: auto;
}

/* Navigation ------------------------------------------------------------ */

.app-navbar {
    background: var(--app-ink);
    padding-block: .55rem;
}

.app-navbar .navbar-brand {
    font-weight: 600;
    letter-spacing: -.01em;
    color: #fff;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: .55rem;
    background: linear-gradient(135deg, #3b82f6, #22c55e);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.app-tabs {
    gap: .15rem;
    margin-left: 1rem;
}

.app-tabs .nav-link {
    color: #c3ccd8;
    border-radius: .45rem;
    padding: .4rem .8rem;
    font-weight: 500;
}

.app-tabs .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, .08);
    text-decoration: none;
}

.app-tabs .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, .14);
}

.status-badge {
    font-weight: 500;
    letter-spacing: .01em;
}

.app-footer {
    padding: 1rem 0 1.5rem;
    color: var(--app-muted);
    font-size: .82rem;
}

.app-footer a {
    color: var(--app-muted);
}

/* Cards ---------------------------------------------------------------- */

.card {
    border-color: var(--app-border);
}

.card-header {
    background: #fff;
    border-bottom-color: var(--app-border);
}

.card-header .h6,
.card-header .h5 {
    letter-spacing: -.01em;
}

.empty-state {
    border-style: dashed;
}

/* Transcript list ------------------------------------------------------ */

.transcript-sidebar {
    overflow: hidden;
}

.transcript-list {
    max-height: min(70vh, 900px);
    overflow-y: auto;
}

.transcript-item {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    width: 100%;
    padding: .7rem .8rem;
    border: 0;
    border-bottom: 1px solid var(--app-border);
    background: #fff;
    text-align: left;
    color: inherit;
    font: inherit;
}

.transcript-item:hover,
.transcript-item:focus-visible {
    background: #f7fafc;
    outline: none;
}

.transcript-item.active {
    background: var(--app-blue-soft);
    box-shadow: inset 3px 0 0 var(--app-blue);
}

.transcript-title {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 550;
}

.transcript-item:last-child {
    border-bottom: 0;
}

/* Item editors --------------------------------------------------------- */

.item-card {
    border: 1px solid var(--app-border);
    border-radius: .6rem;
    padding: .9rem;
    background: #fbfcfd;
}

.item-card .form-label {
    color: var(--app-muted);
}

.attempt-row {
    border-top: 1px solid #e5e7eb;
    padding: .65rem 0;
}

.attempt-row:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.attempt-row summary {
    display: flex;
    gap: .75rem;
    justify-content: space-between;
    cursor: pointer;
}

.attempt-row summary > :last-child {
    max-width: 55%;
    text-align: right;
}

.notification-row {
    border-top: 1px solid #e5e7eb;
    padding: .65rem 0;
}

.notification-row:first-child {
    border-top: 0;
    padding-top: 0;
}

.notification-row:last-child {
    padding-bottom: 0;
}

.tag-row,
.suggestion-row,
.mistake-row {
    border: 1px solid var(--app-border);
    border-radius: .55rem;
    padding: .65rem .75rem;
    background: #fff;
}

/* Settings ------------------------------------------------------------- */

.settings-layout {
    /* Stretch the sidebar column so the sticky navigation can follow the page. */
    align-items: stretch;
}

.settings-nav {
    border-radius: .6rem;
    overflow: hidden;
    border: 1px solid var(--app-border);
    /* Keep the navigation below the sticky app navbar. */
    z-index: 1000;
}

.settings-sections > [id] {
    scroll-margin-top: 5.2rem;
}

.settings-nav .list-group-item {
    border-left: 0;
    border-right: 0;
    font-size: .92rem;
    padding: .6rem .85rem;
}

.settings-nav .list-group-item:first-child {
    border-top: 0;
}

.settings-nav .list-group-item:last-child {
    border-bottom: 0;
}

@media (min-width: 992px) {
    .settings-nav {
        top: 5.2rem;
        max-height: calc(100vh - 6.4rem);
        overflow-y: auto;
    }
}

/* Raw output and logs -------------------------------------------------- */

pre {
    white-space: pre-wrap;
    overflow: auto;
    background: #101828;
    color: #e5e7eb;
    padding: .8rem;
    border-radius: .45rem;
    max-height: 26rem;
    margin-bottom: 0;
    font-size: .8rem;
}

.log-view {
    min-height: 18rem;
    max-height: 60vh;
}

/* Small screens -------------------------------------------------------- */

@media (max-width: 991.98px) {
    .app-tabs {
        margin-left: 0;
        padding-top: .5rem;
    }
}

@media (max-width: 575.98px) {
    .attempt-row summary {
        display: block;
    }

    .attempt-row summary > :last-child {
        display: block;
        max-width: none;
        margin-top: .3rem;
        text-align: left;
    }

    .transcript-list {
        max-height: 50vh;
    }
}
