/* "Paste and check your JSON" box for learn pages (js/learn-fixbox.js).
   Light colours first, then body.dark-mode. Every rule is scoped to .learn-fixbox so nothing else on the page changes.
   The container reserves its built height (min-height) so the page does not jump when the script fills it. */
.learn-fixbox {
    box-sizing: border-box;
    margin: 14px 0 18px;
    padding: 14px;
    min-height: 272px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    color: #0f172a;
}
.learn-fixbox *,
.learn-fixbox *::before,
.learn-fixbox *::after {
    box-sizing: border-box;
}
.learn-fixbox .learn-fixbox__label {
    display: block;
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    color: #0f172a;
}
.learn-fixbox textarea.learn-fixbox__text {
    display: block;
    width: 100%;
    height: 118px;
    min-height: 96px;
    margin: 0;
    padding: 10px 12px;
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #64748b;
    border-radius: 8px;
    font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    white-space: pre;
    overflow: auto;
    resize: vertical;
}
.learn-fixbox textarea.learn-fixbox__text::placeholder {
    color: #526071;
    opacity: 1;
}
.learn-fixbox textarea.learn-fixbox__text:focus-visible {
    outline: 3px solid #1d4ed8;
    outline-offset: 2px;
    border-color: #1d4ed8;
    box-shadow: none;
}
.learn-fixbox .learn-fixbox__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0 0;
}
.learn-fixbox button.learn-fixbox__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    height: auto;
    min-width: 44px;
    padding: 8px 18px;
    margin: 0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    cursor: pointer;
    box-shadow: none;
    transform: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.learn-fixbox button.learn-fixbox__btn--primary {
    background: #1d4ed8;
    color: #ffffff;
    border: 2px solid #1d4ed8;
}
.learn-fixbox button.learn-fixbox__btn--primary:hover {
    background: #1e40af;
    border-color: #1e40af;
    transform: none;
    box-shadow: none;
}
.learn-fixbox button.learn-fixbox__btn--secondary {
    background: #ffffff;
    color: #1d4ed8;
    border: 2px solid #1d4ed8;
}
.learn-fixbox button.learn-fixbox__btn--secondary:hover {
    background: #eff6ff;
    transform: none;
    box-shadow: none;
}
.learn-fixbox button.learn-fixbox__btn:focus-visible {
    outline: 3px solid #0f172a;
    outline-offset: 2px;
}
.learn-fixbox .learn-fixbox__feedback {
    margin: 12px 0 0;
    padding: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #0f172a;
}
.learn-fixbox .learn-fixbox__feedback:empty {
    display: none;
}
.learn-fixbox .learn-fixbox__feedback--valid,
.learn-fixbox .learn-fixbox__feedback--invalid {
    padding: 10px 12px;
    border-radius: 8px;
    border-left: 4px solid;
}
.learn-fixbox .learn-fixbox__feedback--valid {
    background: #f0fdf4;
    border-left-color: #16a34a;
    color: #14532d;
}
.learn-fixbox .learn-fixbox__feedback--invalid {
    background: #fef2f2;
    border-left-color: #dc2626;
    color: #7f1d1d;
}
.learn-fixbox .learn-fixbox__result {
    font-weight: 700;
}
.learn-fixbox .learn-fixbox__hint {
    display: block;
    margin-top: 6px;
    font-weight: 600;
}
.learn-fixbox pre.learn-fixbox__snippet {
    margin: 8px 0 0;
    padding: 8px 10px;
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #fecaca;
    border-radius: 6px;
    font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    white-space: pre;
    overflow-x: auto;
}
.learn-fixbox a.learn-fixbox__link {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}
.learn-fixbox a.learn-fixbox__link:focus-visible {
    outline: 3px solid #0f172a;
    outline-offset: 2px;
}
.learn-fixbox p.learn-fixbox__privacy {
    margin: 10px 0 0;
    max-width: none;
    font-size: 13px;
    line-height: 1.4;
    color: #475569;
}

/* Inline call to action in the article (a plain link that looks like the button) */
.learn-fixbox-cta {
    margin: 22px 0;
    padding: 16px 18px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
}
.learn-fixbox-cta p {
    margin: 0 0 12px;
    max-width: none;
    font-size: 15px;
    line-height: 1.5;
    color: #0f172a;
}
.learn-fixbox-cta a.learn-fixbox-cta__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 20px;
    background: #1d4ed8;
    color: #ffffff;
    border: 2px solid #1d4ed8;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
}
.learn-fixbox-cta a.learn-fixbox-cta__btn:hover {
    background: #1e40af;
    border-color: #1e40af;
    color: #ffffff;
}
.learn-fixbox-cta a.learn-fixbox-cta__btn:focus-visible {
    outline: 3px solid #0f172a;
    outline-offset: 2px;
}

@media (max-width: 480px) {
    .learn-fixbox { padding: 12px; min-height: 288px; }
    .learn-fixbox .learn-fixbox__actions { gap: 8px; }
    .learn-fixbox button.learn-fixbox__btn { flex: 1 1 100%; }
}

/* ---- dark theme ---- */
body.dark-mode .learn-fixbox {
    background: #1e2433;
    border-color: #404040;
    color: #f1f5f9;
}
body.dark-mode .learn-fixbox .learn-fixbox__label {
    color: #f1f5f9;
}
body.dark-mode .learn-fixbox textarea.learn-fixbox__text {
    background: #111827;
    color: #e5e7eb;
    border-color: #94a3b8;
}
body.dark-mode .learn-fixbox textarea.learn-fixbox__text::placeholder {
    color: #aab4c3;
}
body.dark-mode .learn-fixbox textarea.learn-fixbox__text:focus-visible {
    outline-color: #93c5fd;
    border-color: #93c5fd;
}
body.dark-mode .learn-fixbox button.learn-fixbox__btn--primary {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}
body.dark-mode .learn-fixbox button.learn-fixbox__btn--primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}
body.dark-mode .learn-fixbox button.learn-fixbox__btn--secondary {
    background: transparent;
    color: #93c5fd;
    border-color: #93c5fd;
}
body.dark-mode .learn-fixbox button.learn-fixbox__btn--secondary:hover {
    background: #26324a;
}
body.dark-mode .learn-fixbox button.learn-fixbox__btn:focus-visible,
body.dark-mode .learn-fixbox a.learn-fixbox__link:focus-visible {
    outline-color: #f1f5f9;
}
body.dark-mode .learn-fixbox .learn-fixbox__feedback {
    color: #f1f5f9;
}
body.dark-mode .learn-fixbox .learn-fixbox__feedback--valid {
    background: #0f2a1a;
    border-left-color: #22c55e;
    color: #bbf7d0;
}
body.dark-mode .learn-fixbox .learn-fixbox__feedback--invalid {
    background: #3b1414;
    border-left-color: #f87171;
    color: #fecaca;
}
body.dark-mode .learn-fixbox pre.learn-fixbox__snippet {
    background: #111827;
    color: #e5e7eb;
    border-color: #7f1d1d;
}
body.dark-mode .learn-fixbox p.learn-fixbox__privacy {
    color: #cbd5e1;
}
body.dark-mode .learn-fixbox-cta {
    background: #1e2433;
    border-color: #404040;
}
body.dark-mode .learn-fixbox-cta p {
    color: #f1f5f9;
}
body.dark-mode .learn-fixbox-cta a.learn-fixbox-cta__btn {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}
body.dark-mode .learn-fixbox-cta a.learn-fixbox-cta__btn:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}
body.dark-mode .learn-fixbox-cta a.learn-fixbox-cta__btn:focus-visible {
    outline-color: #f1f5f9;
}

@media (prefers-reduced-motion: reduce) {
    .learn-fixbox button.learn-fixbox__btn { transition: none; }
}
