.devig-guide {
    --devig-canvas: var(--code-bg);
    --devig-panel: var(--code-surface);
    --devig-panel-soft: var(--surface);
    --devig-line: var(--glass-border-muted);
    --devig-line-soft: var(--glass-border);
    --devig-control-line: color-mix(in srgb, var(--muted) 56%, transparent);
    --devig-accent-soft: var(--accent-soft);
    position: relative;
    background: var(--devig-canvas);
}

.devig-guide .feed-hero {
    padding: 42px 0 34px;
    border-bottom: 1px solid var(--devig-line-soft);
    background: var(--devig-canvas);
}

.devig-guide .feed-hero-grid-copy-only,
.devig-guide .feed-article-layout {
    width: min(960px, calc(100vw - 48px));
}

.devig-guide .feed-hero-grid-copy-only {
    grid-template-columns: 1fr;
}

.devig-guide .feed-hero-copy {
    display: block;
    max-width: none;
}

.devig-guide .feed-breadcrumb {
    margin-bottom: 22px;
    font-size: 0.78rem;
}

.devig-guide .feed-hero h1 {
    max-width: 760px;
    font-family: var(--font-heading);
    font-size: clamp(2.1rem, 4vw, 3.1rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.04em;
    text-wrap: balance;
}

.devig-guide .feed-byline {
    margin: 17px 0 18px;
    font-size: 0.78rem;
    line-height: 1.6;
}

.devig-guide .feed-intro {
    max-width: 720px;
    font-size: 1.08rem;
    line-height: 1.68;
}

.devig-guide .feed-article-section {
    padding: 0 0 88px;
    background: var(--devig-canvas);
}

.devig-guide .feed-article-layout {
    grid-template-columns: 1fr;
    gap: 0;
}

.devig-guide .feed-toc {
    position: static;
    display: block;
    max-height: none;
    padding: 8px 0;
    overflow: visible;
    border: 0;
    border-bottom: 1px solid var(--devig-line);
    border-radius: 0;
    background: transparent;
}

.devig-guide .feed-toc > strong {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.devig-guide .feed-toc nav {
    display: flex;
    flex-wrap: wrap;
    column-gap: 28px;
}

.devig-guide .feed-toc a {
    min-height: 44px;
    padding: 0;
    border-radius: 0;
    color: var(--muted);
    font-size: 0.76rem;
}

.devig-guide .feed-toc a:hover,
.devig-guide .feed-toc a:focus-visible {
    background: transparent;
    color: var(--text);
}

.devig-guide .feed-prose {
    max-width: none;
    font-size: 0.95rem;
    line-height: 1.8;
}

.devig-guide .feed-prose > section {
    max-width: 720px;
    padding-top: 62px;
}

.devig-guide .feed-prose > #calculator,
.devig-guide .feed-prose > #methods,
.devig-guide .feed-prose > #examples,
.devig-guide .feed-prose > #python,
.devig-guide .feed-prose > #model,
.devig-guide .feed-prose > .feed-cta {
    max-width: none;
}

.devig-guide .feed-prose p {
    max-width: 74ch;
    margin-bottom: 18px;
    line-height: 1.8;
}

.devig-guide .feed-prose .feed-opening {
    max-width: 720px;
    margin-bottom: 28px;
    color: var(--muted);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.7;
}

.devig-guide .feed-prose h2 {
    margin: 0 0 18px;
    font-family: var(--font-heading);
    font-size: 1.72rem;
    font-weight: 700;
    line-height: 1.24;
    letter-spacing: -0.025em;
}

.devig-guide .feed-prose h3 {
    margin: 34px 0 12px;
    color: var(--text);
    font-family: var(--font-heading);
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.4;
}

.devig-calculator {
    display: grid;
    grid-template-columns: minmax(300px, 0.86fr) minmax(0, 1.14fr);
    margin: 28px 0 8px;
    overflow: hidden;
    border: 1px solid var(--devig-line);
    border-top: 3px solid var(--accent);
    border-radius: 6px;
    background: var(--devig-panel);
}

.devig-form,
.devig-output {
    min-width: 0;
    padding: 26px;
}

.devig-form {
    border-right: 1px solid var(--devig-line);
}

.devig-field {
    display: grid;
    gap: 7px;
}

.devig-field label {
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 700;
}

.devig-field label span,
.devig-field p,
.devig-help {
    color: var(--muted);
    font-size: 0.8rem;
}

.devig-field p,
.devig-help {
    margin: 0;
    line-height: 1.55;
}

.devig-field input,
.devig-field select {
    width: 100%;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid var(--devig-control-line);
    border-radius: 6px;
    background: var(--devig-canvas);
    color: var(--text);
    font: inherit;
    font-size: 1rem;
}

.devig-field input:hover,
.devig-field select:hover {
    border-color: var(--muted);
}

.devig-field input:focus-visible,
.devig-field select:focus-visible {
    border-color: var(--accent);
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.devig-field input[aria-invalid="true"] {
    border-color: var(--danger-text);
}

.devig-format-field {
    max-width: none;
}

.devig-input-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 20px;
}

.devig-help {
    margin-top: 13px;
}

.devig-actions {
    display: grid;
    gap: 10px;
    margin-top: 22px;
}

.devig-actions .button {
    min-height: 44px;
    justify-content: center;
    width: 100%;
    border-radius: 6px;
}

.devig-error {
    margin: 16px 0 0;
    padding: 12px 14px;
    border: 1px solid var(--danger-text);
    border-radius: 4px;
    background: var(--danger-bg);
    color: var(--danger-text);
}

.devig-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--devig-line);
    border-radius: 4px;
}

.devig-summary div {
    display: grid;
    gap: 5px;
    padding: 17px;
    border-right: 1px solid var(--devig-line);
    border-bottom: 1px solid var(--devig-line);
}

.devig-summary div:nth-child(2n) {
    border-right: 0;
}

.devig-summary div:nth-last-child(-n + 2) {
    border-bottom: 0;
}

.devig-summary dt {
    color: var(--muted);
    font-size: 0.76rem;
}

.devig-summary dd {
    margin: 0;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 1.03rem;
    font-weight: 700;
}

.devig-summary div:nth-child(2) dd,
.devig-summary div:nth-child(3) dd {
    color: var(--sandbox-accent);
}

.devig-results-wrap {
    margin: 22px 0 14px;
}

.devig-results {
    min-width: 0;
    table-layout: fixed;
}

.devig-results tbody td:not(:first-child) {
    font-family: var(--font-mono);
    font-size: 0.86rem;
}

.devig-results .devig-method-unavailable td {
    color: var(--muted);
}

.devig-output-note {
    margin: 0;
    color: var(--muted);
    font-size: 0.84rem;
}

.devig-guide .feed-table-wrap {
    margin: 28px 0 36px;
    border-color: var(--devig-line);
    border-radius: 3px;
    background: transparent;
}

.devig-guide .feed-table thead th {
    background: var(--devig-accent-soft);
    color: var(--text);
}

.devig-guide .feed-table th,
.devig-guide .feed-table td {
    padding: 16px 17px;
    border-bottom-color: var(--devig-line);
}

.devig-guide .feed-table td {
    color: var(--muted);
}

.devig-guide .devig-results tbody td:not(:first-child) {
    color: var(--plan-value-accent);
    white-space: nowrap;
}

.devig-guide .devig-results .devig-method-unavailable td {
    color: var(--muted);
}

.devig-method-table {
    min-width: 760px;
}

.devig-example-table {
    min-width: 560px;
}

.devig-equations {
    margin: 27px 0 30px;
    overflow: hidden;
    border: 1px solid var(--devig-line);
    border-radius: 4px;
    background: var(--devig-panel);
}

.devig-equations p {
    max-width: none;
    margin: 0;
    padding: 13px 16px;
    border-bottom: 1px solid var(--devig-line);
}

.devig-equations p:last-child {
    border-bottom: 0;
}

.devig-equations code {
    color: var(--plan-value-accent);
    overflow-wrap: anywhere;
}

.devig-guide .feed-note,
.devig-guide .feed-caveat {
    margin: 30px 0 8px;
    padding: 20px 22px;
    border: 0;
    border-left: 3px solid var(--accent);
    border-radius: 0;
    background: var(--devig-panel);
}

.devig-guide .feed-caveat {
    border-left-color: var(--sandbox-accent);
}

.devig-guide .feed-step-list.devig-check-list {
    display: block;
    margin: 30px 0 32px;
    border-top: 1px solid var(--devig-line);
}

.devig-guide .devig-check-list li {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 18px;
    padding: 18px 0;
    border: 0;
    border-bottom: 1px solid var(--devig-line);
    border-radius: 0;
    background: transparent;
}

.devig-guide .devig-check-list li > span {
    display: block;
    width: auto;
    height: auto;
    border-radius: 0;
    background: transparent;
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

.devig-check-list li > div {
    display: grid;
    grid-template-columns: minmax(190px, 0.42fr) minmax(0, 1fr);
    gap: 24px;
}

.devig-check-list strong {
    color: var(--text);
}

.devig-guide .devig-check-list p {
    margin: 0;
}

.devig-guide .feed-code {
    margin: 30px 0;
    padding: 20px;
    border-color: var(--devig-line);
    border-radius: 4px;
    background: var(--devig-panel);
    color: var(--text);
}

.devig-code-block {
    margin: 30px 0;
    overflow: hidden;
    border: 1px solid var(--devig-line);
    border-radius: 4px;
    background: var(--devig-panel);
}

.devig-code-head {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 14px;
    border-bottom: 1px solid var(--devig-line);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.76rem;
}

.devig-code-head span:last-child {
    color: var(--text);
}

.devig-guide .devig-code-block .feed-code {
    margin: 0;
    border: 0;
    border-radius: 0;
}

.devig-flow {
    margin: 30px 0;
    border-top: 1px solid var(--devig-line);
    border-bottom: 1px solid var(--devig-line);
}

.devig-flow ol {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
}

.devig-flow li {
    display: grid;
    gap: 8px;
    padding: 20px 18px;
    border-right: 1px solid var(--devig-line);
}

.devig-flow li:last-child {
    border-right: 0;
}

.devig-flow strong {
    color: var(--text);
    font-family: var(--font-heading);
    font-size: 0.9rem;
}

.devig-flow span {
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.55;
}

.devig-faq {
    border-top: 1px solid var(--devig-line);
}

.devig-faq details {
    border-bottom: 1px solid var(--devig-line);
}

.devig-faq summary {
    min-height: 60px;
    padding: 18px 38px 18px 0;
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
}

.devig-faq summary:hover {
    color: var(--accent);
}

.devig-faq summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.devig-faq details p {
    max-width: 68ch;
    margin-bottom: 22px;
}

.devig-guide .feed-cta {
    grid-template-columns: minmax(0, 1fr) auto;
    margin-top: 68px;
    padding: 30px 0;
    border: 0;
    border-top: 1px solid var(--devig-line);
    border-bottom: 1px solid var(--devig-line);
    border-radius: 0;
    background: transparent;
}

.devig-guide .feed-cta h2 {
    margin-bottom: 9px;
}

.devig-guide .feed-cta .button {
    border-radius: 6px;
}

.devig-sources {
    padding-bottom: 0;
}

.devig-sources h2 {
    font-size: 1.28rem;
}

.devig-sources p,
.devig-sources li {
    font-size: 0.88rem;
}

.devig-sources ul {
    display: grid;
    gap: 8px;
    padding-left: 20px;
}

.devig-sources a {
    color: var(--plan-value-accent);
    text-decoration: underline;
    text-underline-offset: 4px;
}

@media (max-width: 960px) {
    .devig-guide .feed-hero-grid-copy-only,
    .devig-guide .feed-article-layout {
        width: min(960px, calc(100vw - 32px));
    }

    .devig-calculator {
        grid-template-columns: 1fr;
    }

    .devig-form {
        border-right: 0;
        border-bottom: 1px solid var(--devig-line);
    }

    .devig-flow ol {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .devig-flow li {
        border-bottom: 1px solid var(--devig-line);
    }

    .devig-flow li:nth-child(2n) {
        border-right: 0;
    }

    .devig-flow li:last-child {
        grid-column: 1 / -1;
        border-bottom: 0;
    }
}

@media (max-width: 720px) {
    .devig-guide .feed-hero {
        padding: 34px 0 28px;
    }

    .devig-guide .feed-breadcrumb {
        margin-bottom: 18px;
    }

    .devig-guide .feed-hero h1 {
        font-size: clamp(2rem, 10vw, 2.65rem);
    }

    .devig-guide .feed-byline {
        margin-bottom: 14px;
    }

    .devig-guide .feed-toc nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 18px;
    }

    .devig-guide .feed-prose > section {
        padding-top: 50px;
    }

    .devig-form,
    .devig-output {
        padding: 22px;
    }

    .devig-check-list li > div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .devig-guide .feed-cta {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .devig-guide .feed-cta-actions {
        justify-items: stretch;
    }
}

@media (max-width: 480px) {
    .devig-guide .feed-hero-grid-copy-only,
    .devig-guide .feed-article-layout {
        width: min(960px, calc(100vw - 28px));
    }

    .devig-guide .feed-hero h1 {
        font-size: 2.08rem;
    }

    .devig-guide .feed-intro {
        font-size: 1rem;
    }

    .devig-guide .feed-toc nav {
        grid-template-columns: 1fr 1fr;
    }

    .devig-guide .feed-toc a {
        font-size: 0.72rem;
    }

    .devig-form,
    .devig-output {
        padding: 18px;
    }

    .devig-summary {
        grid-template-columns: 1fr;
    }

    .devig-summary div,
    .devig-summary div:nth-child(2n),
    .devig-summary div:nth-last-child(-n + 2) {
        border-right: 0;
        border-bottom: 1px solid var(--devig-line);
    }

    .devig-summary div:last-child {
        border-bottom: 0;
    }

    .devig-guide .devig-results tbody td:not(:first-child) {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .devig-flow ol {
        grid-template-columns: 1fr;
    }

    .devig-flow li,
    .devig-flow li:nth-child(2n),
    .devig-flow li:last-child {
        grid-column: 1;
        border-right: 0;
        border-bottom: 1px solid var(--devig-line);
    }

    .devig-flow li:last-child {
        border-bottom: 0;
    }
}
