/* Degraded-mode stylesheet.
 *
 * All rules are scoped under `html.tw-failed`, a class added by an onerror
 * handler on the Tailwind CDN <script> when the CDN is unreachable. In normal
 * operation (Tailwind loaded) these rules are inert, so there is ZERO impact on
 * the real design. When the CDN is down they give a plain but usable interface
 * (readable text, working forms, visible buttons/links) instead of an unstyled
 * white page.
 */

html.tw-failed,
html.tw-failed body {
    background: #0f172a;
    color: #e2e8f0;
}

html.tw-failed body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
}

html.tw-failed a { color: #36b7e3; }
html.tw-failed a:hover { color: #7cd0ee; }

html.tw-failed main {
    display: block;
    max-width: 80rem;
    margin: 0 auto;
    padding: 1.5rem;
}

html.tw-failed nav,
html.tw-failed footer {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #334155;
}
html.tw-failed footer {
    border-top: 1px solid #334155;
    border-bottom: 0;
    text-align: center;
    color: #94a3b8;
}

html.tw-failed h1 { font-size: 1.6rem; margin: 0.6rem 0; }
html.tw-failed h2 { font-size: 1.3rem; margin: 0.6rem 0; }
html.tw-failed h3 { font-size: 1.1rem; margin: 0.5rem 0; }

html.tw-failed img { max-width: 100%; height: auto; }

html.tw-failed input,
html.tw-failed select,
html.tw-failed textarea,
html.tw-failed button {
    font: inherit;
    color: #f8fafc;
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    margin: 0.15rem 0;
    max-width: 100%;
}

html.tw-failed button,
html.tw-failed input[type="submit"],
html.tw-failed a[href] {
    cursor: pointer;
}

html.tw-failed button,
html.tw-failed input[type="submit"] {
    background: #007ba8;
    border-color: #007ba8;
    color: #fff;
    font-weight: 600;
}
html.tw-failed button:hover { background: #0097d2; }

html.tw-failed table { border-collapse: collapse; width: 100%; margin: 0.5rem 0; }
html.tw-failed th,
html.tw-failed td {
    border: 1px solid #334155;
    padding: 0.5rem 0.6rem;
    text-align: left;
}
html.tw-failed th { background: #1e293b; }

/* Degraded-mode notice (the element is display:none inline until activated). */
html.tw-failed #cdn-fallback-note {
    display: block !important;
    background: #b45309;
    color: #fff;
    text-align: center;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}
