:root {
    --red: rgb(239 68 68);
    --yellow-lightest: rgb(254 249 195);
    --green: rgb(21 128 61);
    --green-darker: rgb(134 239 172);
    --green-lightest: rgb(220 252 231);
    --gray: rgb(17 24 39);
    --gray-light: rgb(107 114 128);
    --gray-lighter: rgb(229 231 235);
    --gray-lightest: rgb(243 244 246);

    --body-text-color: var(--gray);
    --body-bg: var(--gray-lightest);
    --section-bg: white;
    --text-muted: var(--gray-light);
    --exception-message-color: var(--red);
    --exception-header-bg: var(--gray-light);
    --exception-header-bg-hover: var(--gray-lighter);
    --solution-text-color: var(--green);
    --solution-border-color: var(--green-darker);
    --solution-bg-color: var(--green-lightest);
    --snippet-bg: white;
    --snippet-border-color: var(--gray-lightest);
    --snippet-footer-color: var(--gray-light);
    --snippet-line-highlight: var(--yellow-lightest);
    --snippet-line-number: var(--gray-light);
    --frames-line-hover: var(--gray-lighter);
    --frames-line-current: white;
    --frame-dot-color: var(--gray-light);
    --frame-dot-red-color: var(--red);
    --data-list-border-color: var(--gray-lighter);
    --data-list-bg-hover: var(--gray-lightest);
    --data-list-title-color: var(--gray-light);
    --locals-value-color: var(--gray-lightest);
    --theme-toggle-color: var(--gray);
}

html,
body {
    font-size: 14px;
    line-height: 1.6;
    background: #fff;
    padding: 0;
    margin: 0;
    min-height: 100%;
    height: 100%;
    color: var(--body-text-color);
    background: var(--body-bg);
    font-family: Inter var, ui-sans-serif, system-ui,
    -apple-system, BlinkMacSystemFont, Segoe UI, Roboto,
    Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji,
    Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
}

main > *:not(:first-child) {
    margin-bottom: 48px;
}

.text-muted {
    color: var(--text-muted);
}

pre {
    font-family: consolas, monospace;
    margin: 0;
}

.header {
    padding: 48px 48px 0 48px;
    color: var(--gray-light);
}

.section-header {
    padding: 8px 48px;
    color: var(--exception-header-bg);
}

.section-header:hover {
    cursor: pointer;
    background: var(--exception-header-bg-hover);
}

.exception-class {
    color: var(--exception-message-color);
}

.exception {
    font-size: 1.5rem;
    margin-top: 0.25rem;
    color: var(--exception-message-color);
    font-family: monospace;
}

.solution {
    margin-top: 3rem;
    color: var(--solution-text-color);
    font-size: 1.25rem;
    padding: 1rem;
    border-radius: .25rem;
    border: 1px solid var(--solution-border-color);
    background-color: var(--solution-bg-color);
}

section {
    padding: 24px 48px;
}

section.trace {
    padding-top: 48px;
    padding-bottom: 48px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.snippet-wrapper {
    display: none;
}

.snippet-wrapper.current {
    display: block;
}

.snippet {
    background-color: var(--snippet-bg);
    padding: 0 16px;
}

.snippet header {
    padding: 16px 0;
    border-bottom: 1px solid var(--snippet-border-color);
}

.snippet header a {
    text-decoration: none;
    color: inherit;
}

.snippet header a:hover {
    text-decoration: underline;
}

.snippet footer {
    padding: 16px 0;
    border-top: 1px solid var(--snippet-border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--snippet-footer-color);
}

.snippet pre {
    margin: 2px 0;
    white-space: pre-wrap;
    overflow-x: auto;
    overflow-wrap: anywhere;
}

.snippet .line {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    overflow-wrap: normal;
}

.snippet .line.highlight {
    background-color: var(--snippet-line-highlight);
}

.snippet .line-number {
    text-align: right;
    width: 48px;
    margin-right: 24px;
    color: var(--snippet-line-number);
    flex-shrink: 0;
}

.snippet .code {
    flex: auto;
    white-space: pre
}

.frames .frame {
    display: flex;
    align-items: center;
    background-color: transparent;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    gap: 12px;
    margin-bottom: 4px;
}

.frames .frame:hover {
    background-color: var(--frames-line-hover);
}

.frames .frame.current {
    background-color: var(--frames-line-current);
}

.dot {
    height: 10px;
    width: 10px;
    border-radius: 100%;
    background-color: var(--frame-dot-color);
}

.dot-red {
    background-color: var(--frame-dot-red-color);
}

.request-information {
    background-color: var(--section-bg);
}

details {
    margin-bottom: 16px;
}

summary {
    cursor: pointer;
    padding: 4px;
}

dl {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: start;
    margin: 0;
    padding: 4px;
    border-top: 1px solid var(--data-list-border-color);
}

dl:first-of-type {
    margin-top: 16px;
}

dl:hover {
    background-color: var(--data-list-bg-hover);
}

dt {
    color: var(--data-list-title-color);
    text-overflow: ellipsis;
    grid-column: span 2 / span 2;
}

dd {
    flex: auto;
    grid-column: span 10 / span 10;
    overflow-x: auto;
}

.locals {
    padding: 2px;
}

.locals:hover {
    background-color: transparent;
}

.locals dt {
    padding: 2px;
}

.locals dd {
    flex: auto;
    overflow-x: auto;
    padding: 2px 8px;
    background-color: var(--locals-value-color);
}

.open-uri {
    font-weight: bold;
    color: var(--gray);
    text-decoration: none;
}

@media (max-width: 1200px) {
    section {
        padding: 12px 16px;
    }

    section.trace {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    dl {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    dd {
        margin-inline-start: 0px;
    }

    .package-dir {
        display: none;
    }
}

.hidden {
    display: none !important;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.collapsed {
    display: none;
}

.flex-center {
    display: flex;
    align-items: center;
    gap: 4px;
}

[data-theme-toggle] {
    background-color: transparent;
    border-radius: 8px;
    border: 0;
    appearance: none;
    cursor: pointer;
    padding: 4px 6px;
    color: var(--theme-toggle-color);
}

[data-theme-toggle]:hover {
    background-color: var(--gray-lighter);
}

[data-theme-toggle] svg {
    width: 32px;
    height: 32px;
}

:root.auto [data-force-theme="dark"],
:root.auto [data-force-theme="light"] {
    display: none;
}

:root.dark:not(.auto) [data-force-theme="auto"],
:root.dark:not(.auto) [data-force-theme="light"] {
    display: none;
}

:root.light:not(.auto) [data-force-theme="auto"],
:root.light:not(.auto) [data-force-theme="dark"] {
    display: none;
}

.search-links {
    margin-right: 64px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-links a {
    color: var(--theme-toggle-color);
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.search-links a svg {
    width: 20px;
    height: 20px;
}

.search-links a:hover {
    text-decoration: underline;
}

.text-error {
    color: var(--red);
}

.solution ul {
    margin: 0;
    padding: 0;
}

.solution ul li {
    margin: 0 0 0 20px;
    padding: 0;
}
