:root {
    --page-bg: #ffffff;
    --panel-bg: #ececec;
    --sidebar-bg: #d8d8d8;
    --sidebar-surface: #d3d3d3;
    --selected-pill: #ececec;
    --ink: #111111;
    --muted: #ababab;
    --parameter-input:#545454;
    --muted-soft: #c9c9c9;
    --accent: #2f6792;
    --accent-strong: #008e9a;
    --divider: #b7b7b7;
    --radius-shell: 2.25rem;
    --radius-pill: 999px;
    --panel-height: calc(100vh - 14rem);
    --sidebar-width: 24%;
    --sidebar-overlap: 2.35rem;
    --sidebar-safe-pad: 1.2rem;
    --sidebar-right-safe-pad: 4.3rem;
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    background: var(--page-bg);
    color: var(--ink);
    font-family: "Teko", sans-serif;
    font-weight: 400;
    letter-spacing: 0.02em;
}

button,
input,
select,
textarea {
    font: inherit;
    font-weight: 400;
}

button {
    border: 0;
    background: transparent;
}

.app-shell {
    min-height: 100vh;
}

.app-header {
    padding-top: 0.0rem;
    padding-bottom: 0.0rem;
}

.header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
}

.title-lockup {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
}

.app-title {
    color: var(--accent);
    font-size: clamp(3.25rem, 4.4vw, 5.4rem);
    line-height: 1.7;
}

.title-note {
    color: var(--page-bg);
    font-size: 1rem;
    line-height: 1;
    padding-top: 0.95rem;
}

.brand-logo-link {
    margin-left: auto;
    display: inline-flex;
    padding-bottom: 1.5rem;
}

.brand-logo-link img {
    width: clamp(124px, 11vw, 150px);
    height: auto;
    display: block;
}

.workspace-shell {
    display: flex;
    align-items: stretch;
    height: var(--panel-height);
}

.job-sidebar {
    width: 0;
    min-width: 0;
    height: 100%;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateX(2rem);
    transition: width 0.7s cubic-bezier(.22, 1, .36, 1), opacity 0.35s ease, transform 0.7s cubic-bezier(.22, 1, .36, 1);
    position: relative;
    z-index: 1;
}

.workspace-shell.is-workspace .job-sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.job-sidebar-inner {
    background: var(--sidebar-surface);
    border-radius: var(--radius-shell) 0 0 var(--radius-shell);
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.main-panel {
    flex: 1;
    min-width: 0;
    height: 100%;
    position: relative;
    z-index: 2;
}

.main-panel-surface {
    background: var(--panel-bg);
    border-radius: var(--radius-shell);
    height: 100%;
    overflow: hidden;
    position: relative;
    margin-left: 0;
    transition: margin-left 0.7s cubic-bezier(.22, 1, .36, 1), border-top-left-radius 0.7s cubic-bezier(.22, 1, .36, 1), border-bottom-left-radius 0.7s cubic-bezier(.22, 1, .36, 1), width 0.7s cubic-bezier(.22, 1, .36, 1);
}

.main-panel-surface::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 0;
    background: var(--panel-bg);
    border-top-left-radius: var(--radius-shell);
    border-bottom-left-radius: var(--radius-shell);
    pointer-events: none;
    transition: width 0.7s cubic-bezier(.22, 1, .36, 1);
}

.workspace-shell.is-workspace .main-panel-surface {
    margin-left: calc(var(--sidebar-overlap) * -1);
    border-top-left-radius: var(--radius-shell);
    border-bottom-left-radius: var(--radius-shell);
}

.workspace-shell.is-workspace .main-panel-surface::before {
    left: calc(var(--sidebar-overlap) * -1);
    width: var(--sidebar-overlap);
}

.job-top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.2rem;
    padding: 0.8rem var(--sidebar-right-safe-pad) 0.35rem calc(0.7rem + var(--sidebar-safe-pad));
    background: transparent;
}

.job-top-link {
    flex: 1 1 0;
    color: var(--accent);
    font-size: clamp(1.55rem, 1.45vw, 2rem);
    line-height: 1;
    text-transform: uppercase;
    border-radius: var(--radius-pill);
    padding: 0.42rem 0.85rem 0.34rem;
    text-align: center;
    transition: background-color 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}

.job-top-link.is-active {
    background: var(--selected-pill);
    color: var(--accent);
}

.job-top-link.is-dimmed {
    opacity: 0.35;
}

.sidebar-view {
    display: none;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: var(--sidebar-surface);
    border-radius: 0 0 0 var(--radius-shell);
}

.sidebar-view.is-active {
    display: flex;
}

.sidebar-stack,
.compare-sidebar-stack {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
    min-height: 0;
    padding: 0.85rem var(--sidebar-right-safe-pad) 1rem calc(1rem + var(--sidebar-safe-pad));
}

.compare-sidebar-stack {
    gap: 0;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.sidebar-section-fill {
    flex: 1;
}

.sidebar-line {
    height: 1px;
    background: var(--divider);
    margin: 0;
    flex: 0 0 auto;
}

.sidebar-title {
    color: var(--ink);
    font-size: clamp(2.1rem, 1.8vw, 2.2rem);
    line-height: 1.5;
    text-transform: uppercase;
    text-align: center;
    margin: 0 0 -0.5rem;
    padding-top: 0.5rem;
    padding-bottom: 0.35rem;
}

.sidebar-line + .sidebar-section .sidebar-title {
    margin-top: 0.55rem;
}

.sidebar-helper {
    color: var(--ink);
    font-size: 1rem;
    line-height: 1;
    text-align: center;
    margin: -0.05rem 0 -0.80rem;
}

.sidebar-test-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    gap: 0.0rem;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.2rem;
}

.sidebar-test-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 1.15rem 0.9rem;
    align-content: center;
    justify-items: center;
    margin: auto 0;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.2rem;
}

.test-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 2.4rem;
    width: 100%;
    text-align: center;
    color: var(--parameter-input);
    cursor: pointer;
    user-select: none;
    text-transform: none;
    font-size: 1.45rem;
    line-height: 1;
}

.sidebar-test-list .test-toggle {
    font-size: 1.5rem;
}

.test-toggle.is-selected {
    color: var(--ink);
}

.test-toggle.is-disabled {
    color: var(--muted-soft);
    cursor: default;
}

.parameter-list {
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    gap: 0.0rem;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.2rem;
    padding-bottom: 0.55rem;
}

.parameter-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    color: var(--parameter-input);
    font-size: 1.45rem;
    text-transform: none;
}

.parameter-row .form-control,
.parameter-row .form-select {
    width: 6.5rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--parameter-input);
    box-shadow: none;
    padding: 0;
    text-align: right;
    font-size: 1.45rem;
    line-height: 1;
}

.parameter-row .form-select {
    width: 7.4rem;
    text-align-last: right;
    background-image: none;
    padding-right: 0;
}

.sidebar-run-wrap {
    margin-top: auto;
    padding-top: 0.65rem;
    padding-bottom: 0.5rem;
}

.run-link {
    width: 100%;
    color: var(--accent);
    font-size: 1.8rem;
    line-height: 1;
    text-transform: uppercase;
    text-align: center;
}

.progress-shell {
    width: 100%;
    margin-top: 0.55rem;
}

.progress-shell-upload {
    margin-top: 1.4rem;
}

.progress {
    height: 0.42rem;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.8);
}

.progress-bar {
    background: var(--accent);
}

.progress-text {
    color: #8096af;
    font-size: 1.05rem;
    line-height: 1;
    text-align: center;
    margin-top: 0.3rem;
}

.utility-nav-shell,
.job-top-nav-shell {
    position: relative;
}

.utility-nav {
    position: absolute;
    top: 1rem;
    right: 1.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.45rem;
    padding: 0.45rem 0.95rem;
    background: #ffffff;
    border-radius: 1.1rem;
    z-index: 5;
}

.job-top-nav {
    position: relative;
    z-index: 2;
}

.toolbar-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: clamp(1.55rem, 1.45vw, 1.95rem);
    line-height: 1;
    text-transform: uppercase;
    min-height: 1.4rem;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.toolbar-link.is-active {
    color: var(--ink);
}

.toolbar-link.is-disabled {
    color: var(--muted-soft);
}

#save-all-link.is-disabled {
    color: var(--accent);
}

.inline-feedback {
    position: absolute;
    top: 0;
    left: 0;
    right: auto;
    transform: translateX(0);
    color: var(--accent-strong);
    font-size: 1.2rem;
    line-height: 1;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 6;
}

.inline-feedback.is-visible {
    opacity: 1;
}

.main-view {
    display: none;
    height: 100%;
}

.main-view.is-active {
    display: block;
}

.main-view-body {
    height: 100%;
    min-height: 0;
    padding: 4.35rem 1.5rem 1.25rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.upload-view-body {
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-center {
    width: min(100%, 54rem);
    text-align: center;
}

.upload-prompt {
    color: var(--accent);
    font-size: clamp(2.8rem, 3.1vw, 4rem);
    line-height: 1;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.upload-action {
    display: block;
    margin: 0 auto 1rem;
    color: #666666;
    font-size: clamp(2.35rem, 2.5vw, 3.2rem);
    line-height: 1;
    text-transform: uppercase;
}

.upload-button {
    padding: 0;
}

.selected-file-name {
    min-height: 1.2rem;
    color: var(--muted);
    font-size: 1.15rem;
    line-height: 1;
}

.big-panel-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--panel-bg);
    color: var(--accent-strong);
    font-size: clamp(2.15rem, 2vw, 3rem);
    line-height: 1;
    text-transform: uppercase;
    padding: 0 0 0.65rem;
    margin-bottom: 0.2rem;
}

.output-scroll {
    flex: 1;
    min-height: 0;
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.35rem;
}

.dual-output {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
    gap: 1.2rem;
    height: 100%;
    min-height: 0;
}

.dual-output-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    min-height: 0;
}

.dual-divider {
    background: var(--divider);
    width: 1px;
    height: 100%;
}

.output-block {
    margin-bottom: 1.15rem;
}

.output-title {
    color: var(--ink);
    font-size: 1.8rem;
    line-height: 1;
    text-transform: uppercase;
    margin-bottom: 0.45rem;
}

.result-image,
.interactive-frame {
    width: 100%;
    max-width: 100%;
    display: block;
    background: #ffffff;
    border: 0;
}

.interactive-frame {
    min-height: 35rem;
}

.interactive-link {
    color: var(--accent);
    font-size: 1.1rem;
    text-decoration: none;
}

.compare-section {
    min-height: 0;
}

.compare-available-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.2rem;
}

.compare-group {
    margin-bottom: 1rem;
}

.compare-group-title {
    color: var(--ink);
    font-size: 1.4rem;
    line-height: 1;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

.compare-test-btn {
    width: 100%;
    padding: 0.12rem 0;
    text-align: center;
    color: var(--parameter-input);
    font-size: 1.35rem;
    line-height: 1.05;
}

.compare-test-btn.is-ran {
    color: #4c4c4c;
}

.compare-test-btn.is-active {
    color: var(--ink);
}

.tutorial-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    justify-content: space-evenly;
    align-items: center;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.2rem;
}

.tutorial-link {
    color: var(--muted);
    font-size: 2rem;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
    width: 100%;
}

.tutorial-link.is-active {
    color: var(--ink);
}

.tutorial-output {
    color: #676767;
    font-size: 1.5rem;
    line-height: 1.15;
}

.tutorial-output h1,
.tutorial-output h2,
.tutorial-output h3,
.tutorial-output h4 {
    color: var(--ink);
    text-transform: uppercase;
}

.tutorial-output p,
.tutorial-output li {
    font-family: "Teko", sans-serif;
    font-weight: 400;
}

.tutorial-output code {
    color: var(--accent);
    background: rgba(255, 255, 255, 0.5);
    padding: 0 0.2rem;
    border-radius: 0.25rem;
}

.tutorial-output pre {
    background: rgba(255, 255, 255, 0.95);
    color: #355f8d;
    font-size: 0.6em;
    padding: 0.9rem 1rem;
    border-radius: 0.8rem;
    overflow-x: auto;
    margin: 0 0 1rem;
}

.tutorial-output pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
}

.tutorial-output a {
    color: var(--accent);
}

.tutorial-output img {
    max-width: 100%;
    height: auto;
}

.is-hidden {
    display: none !important;
}

@media (max-width: 1199px) {
    :root {
        --panel-height: auto;
    }

    .workspace-shell,
    .workspace-shell.is-workspace {
        flex-direction: column;
        gap: 0.85rem;
        height: auto;
    }

    .job-sidebar,
    .workspace-shell.is-workspace .job-sidebar {
        width: 100%;
        min-width: 0;
        opacity: 1;
        transform: none;
    }

    .workspace-shell.is-upload-mode .job-sidebar {
        display: none;
    }

    .job-sidebar-inner,
    .sidebar-view,
    .main-panel-surface {
        border-radius: var(--radius-shell);
    }

    .workspace-shell.is-workspace .main-panel-surface {
        margin-left: 0;
    }

    .main-view,
    .main-panel,
    .main-panel-surface {
        min-height: 42rem;
    }

    .dual-output {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .dual-divider {
        display: none;
    }
}

@media (max-width: 767px) {
    .header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .brand-logo-link {
        align-self: flex-end;
    }

    .utility-nav {
        position: static;
        justify-content: flex-end;
        flex-wrap: wrap;
        padding: 1rem 1.15rem 0;
    }

    .main-view-body {
        padding-top: 1rem;
    }

    .job-top-nav {
        justify-content: center;
    }

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

    .parameter-row {
        font-size: 1.45rem;
    }
}
