:root {
    --blue-900: #184977;
    --blue-800: #245b8f;
    --blue-700: #3f74a6;
    --blue-100: #eef3f8;
    --gold-600: #c39a49;
    --text: #20364f;
    --muted: #60748e;
    --line: rgba(25, 64, 104, 0.12);
    --surface: rgba(255, 255, 255, 0.96);
    --surface-alt: #f8fbfe;
    --success: #1f7a5c;
    --danger: #bb4b4b;
    --shadow-lg: 0 26px 60px rgba(24, 73, 119, 0.18);
    --shadow-sm: 0 10px 20px rgba(24, 73, 119, 0.08);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: "Segoe UI Variable Text", "Segoe UI", Tahoma, sans-serif;
    color: var(--text);
    background:
        linear-gradient(180deg, #245b8f 0%, #6e8fb0 30%, #edf2f7 30%, #f8fafc 100%);
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

.appeals-shell {
    width: min(1040px, calc(100% - 24px));
    margin: 0 auto;
    padding: 20px 0 40px;
}

.panel {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(14px);
}

.appeals-header,
.lookup-panel,
.result-panel,
.appeals-footer {
    opacity: 0;
    animation: fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.appeals-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    color: #ffffff;
}

.appeals-header__copy {
    min-width: 0;
    text-align: right;
}

.appeals-header__eyebrow,
.lookup-panel__eyebrow,
.section-eyebrow,
.summary-item__label {
    margin: 0 0 10px;
    color: var(--blue-800);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.appeals-header__eyebrow {
    color: rgba(255, 255, 255, 0.82);
}

.appeals-header__title {
    margin: 0;
    font-family: "Bahnschrift SemiCondensed", "Bahnschrift", "Segoe UI", sans-serif;
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.05;
}

.appeals-header__subtitle {
    margin: 8px 0 0;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 700;
    line-height: 1.7;
}

.appeals-header__logo {
    width: 116px;
    height: 116px;
    padding: 2px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.96);
    object-fit: contain;
    box-shadow: 0 10px 22px rgba(12, 33, 58, 0.28);
}

.portal-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    margin: 18px auto 0;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.16);
    box-shadow: 0 14px 30px rgba(12, 33, 58, 0.16);
    backdrop-filter: blur(12px);
}

.portal-nav__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 13px;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 900;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.portal-nav__link:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.portal-nav__link--active {
    background: #ffffff;
    color: var(--blue-900);
    box-shadow: 0 10px 20px rgba(12, 33, 58, 0.14);
}

.lookup-panel {
    margin-top: 22px;
    padding: clamp(22px, 3vw, 34px);
    animation-delay: 0.08s;
}

.lookup-panel__intro {
    text-align: center;
}

.lookup-panel__title,
.panel-title {
    margin: 0;
    color: var(--blue-900);
    font-family: "Bahnschrift SemiCondensed", "Bahnschrift", "Segoe UI", sans-serif;
    font-size: clamp(1.85rem, 3.5vw, 2.8rem);
    line-height: 1.1;
}

.appeal-form {
    max-width: 760px;
    margin: 26px auto 0;
}

.form-label {
    display: block;
    margin-bottom: 10px;
    color: var(--text);
    font-weight: 800;
}

.form-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 230px);
    gap: 12px;
}

.form-input,
.form-button {
    min-height: 60px;
    border-radius: 16px;
    font-size: 1rem;
}

.form-input {
    width: 100%;
    padding: 0 18px;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--text);
}

.form-input:focus {
    outline: none;
    border-color: rgba(36, 91, 143, 0.38);
    box-shadow: 0 0 0 4px rgba(63, 116, 166, 0.14);
}

.form-button {
    padding: 0 22px;
    border: 0;
    background: linear-gradient(135deg, #1f67c2, #235b8f);
    color: #ffffff;
    font-family: "Bahnschrift", "Segoe UI", sans-serif;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 18px 30px rgba(31, 103, 194, 0.22);
}

.form-button:disabled {
    opacity: 0.78;
    cursor: wait;
}

.captcha-box {
    display: grid;
    gap: 10px;
    margin-top: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(248, 251, 254, 0.9);
}

.captcha-box[hidden],
.captcha-math[hidden],
.turnstile-box[hidden] {
    display: none;
}

.captcha-math {
    display: grid;
    gap: 10px;
}

.turnstile-box {
    display: flex;
    justify-content: center;
}

.turnstile-widget {
    width: 100%;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.turnstile-widget > div {
    margin-inline: auto;
}

.captcha-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.captcha-question {
    margin: 0;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px dashed rgba(36, 91, 143, 0.32);
    border-radius: 12px;
    background: #ffffff;
    color: var(--blue-900);
    direction: ltr;
    text-align: left;
    font-family: Consolas, "Courier New", monospace;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.5;
}

.captcha-refresh {
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid rgba(36, 91, 143, 0.26);
    border-radius: 12px;
    background: #ffffff;
    color: var(--blue-800);
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
}

.captcha-refresh:disabled {
    opacity: 0.66;
    cursor: not-allowed;
}

.form-label--compact {
    margin: 0 0 8px;
    font-size: 0.9rem;
}

.captcha-input {
    min-height: 56px;
    font-family: Consolas, "Courier New", monospace;
}

.status-message {
    display: none;
    max-width: 620px;
    margin: 18px auto 0;
    padding: 14px 16px;
    border-radius: 16px;
    font-weight: 800;
    text-align: right;
}

.status-message.is-visible {
    display: block;
    animation: fadeUp 0.35s ease;
}

.status-message.is-error {
    background: rgba(187, 75, 75, 0.08);
    border: 1px solid rgba(187, 75, 75, 0.16);
    color: var(--danger);
}

.status-message.is-success {
    background: rgba(31, 122, 92, 0.08);
    border: 1px solid rgba(31, 122, 92, 0.16);
    color: var(--success);
}

.result-panel {
    margin-top: 18px;
    padding: clamp(22px, 3vw, 30px);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.96));
}

.result-panel[hidden] {
    display: none;
}

.result-panel.is-visible {
    animation: revealPanel 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.result-panel__head,
.appeals-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
}

.result-panel__head {
    margin-bottom: 22px;
}

.result-badge,
.appeals-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(36, 91, 143, 0.08);
    border: 1px solid rgba(36, 91, 143, 0.14);
    color: var(--blue-800);
    font-size: 0.9rem;
    font-weight: 800;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.summary-item {
    position: relative;
    overflow: hidden;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 255, 0.96));
    box-shadow: var(--shadow-sm);
}

.summary-item::before {
    content: "";
    position: absolute;
    inset-inline: 18px;
    inset-block-start: 0;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--gold-600), var(--blue-700));
}

.summary-item__label {
    display: block;
    color: var(--muted);
}

.summary-item__value {
    margin: 0;
    color: var(--blue-900);
    font-size: 1.02rem;
    font-weight: 800;
    line-height: 1.8;
    word-break: break-word;
}

.summary-item__value--mono {
    direction: ltr;
    text-align: left;
    font-family: Consolas, "Courier New", monospace;
}

.positive-appeal-notice {
    display: grid;
    gap: 6px;
    margin: 0 0 22px;
    padding: 16px 18px;
    border: 1px solid rgba(31, 122, 92, 0.22);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(31, 122, 92, 0.1), rgba(31, 122, 92, 0.06));
    color: var(--success);
    font-weight: 800;
    line-height: 1.8;
}

.positive-appeal-notice[hidden] {
    display: none;
}

.positive-appeal-notice strong {
    color: #185f48;
    font-size: 1.08rem;
}

.appeals-card {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface-alt);
}

.appeals-card__title {
    margin: 0;
    color: var(--blue-900);
    font-size: 1.22rem;
}

.appeals-table-wrap {
    margin-top: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #ffffff;
}

.appeals-table {
    width: 100%;
    border-collapse: collapse;
}

.appeals-table th,
.appeals-table td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
    text-align: right;
}

.appeals-table thead th {
    background: rgba(36, 91, 143, 0.06);
    color: var(--blue-900);
    font-weight: 800;
}

.appeals-table tbody tr {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeUp 0.45s ease forwards;
}

.appeals-table tbody tr:last-child td {
    border-bottom: 0;
}

.appeals-table__subject {
    color: var(--blue-900);
    font-weight: 800;
    word-break: break-word;
}

.appeal-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 104px;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-weight: 900;
}

.appeal-chip--positive {
    background: rgba(31, 122, 92, 0.1);
    border-color: rgba(31, 122, 92, 0.22);
    color: var(--success);
}

.appeal-chip--negative {
    background: rgba(187, 75, 75, 0.08);
    border-color: rgba(187, 75, 75, 0.2);
    color: var(--danger);
}

.appeal-chip--neutral {
    background: rgba(36, 91, 143, 0.08);
    border-color: rgba(36, 91, 143, 0.14);
    color: var(--blue-800);
}

.appeals-footer {
    margin-top: 18px;
    text-align: center;
    color: var(--muted);
    font-weight: 700;
    animation-delay: 0.2s;
}

.appeals-footer p {
    margin: 0;
}

.appeals-footer p + p {
    margin-top: 8px;
}

.appeals-footer__credit {
    position: relative;
    display: inline-grid;
    gap: 6px;
    justify-items: center;
    min-width: min(100%, 560px);
    margin-top: 18px !important;
    padding: 18px 28px 16px;
    border: 1px solid rgba(36, 91, 143, 0.12);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 252, 0.96));
    box-shadow: 0 18px 40px rgba(24, 73, 119, 0.12);
    overflow: hidden;
}

.appeals-footer__credit::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 132px;
    height: 3px;
    border-radius: 999px;
    transform: translateX(-50%);
    background: linear-gradient(90deg, rgba(195, 154, 73, 0.1), rgba(195, 154, 73, 0.95), rgba(195, 154, 73, 0.1));
}

.appeals-footer__credit-label {
    color: var(--gold-600);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.appeals-footer__credit-name {
    color: var(--blue-900);
    font-family: "Bahnschrift SemiCondensed", "Bahnschrift", "Segoe UI", sans-serif;
    font-size: 1.22rem;
    font-weight: 900;
    letter-spacing: 0.015em;
}

.appeals-footer__credit-role {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.65;
}

.noscript-banner {
    width: min(1040px, calc(100% - 32px));
    margin: 16px auto 0;
    padding: 16px 18px;
    border: 1px solid rgba(187, 75, 75, 0.18);
    border-radius: 18px;
    background: rgba(255, 239, 239, 0.96);
    color: var(--danger);
    font-weight: 700;
    text-align: center;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes revealPanel {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.99);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 720px) {
    .appeals-shell,
    .noscript-banner {
        width: min(100% - 16px, 1040px);
    }

    .appeals-header {
        align-items: center;
        flex-direction: column;
        text-align: center;
    }

    .appeals-header__logo {
        width: 82px;
        height: 82px;
    }

    .appeals-header__copy {
        text-align: center;
    }

    .lookup-panel,
    .result-panel,
    .appeals-card {
        padding: 18px 16px;
        border-radius: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-button {
        width: 100%;
    }

    .captcha-row {
        grid-template-columns: 1fr;
    }

    .captcha-refresh {
        width: 100%;
    }

    .result-panel__head,
    .appeals-card__head {
        align-items: stretch;
        flex-direction: column;
    }

    .result-badge,
    .appeals-count {
        width: 100%;
    }
}

@media (max-width: 420px) {
    .portal-nav {
        width: 100%;
    }

    .portal-nav__link {
        flex: 1 1 0;
        min-width: 0;
    }
}

@media (max-width: 560px) {
    .appeals-table-wrap {
        overflow: visible;
        border: 0;
        background: transparent;
    }

    .appeals-table,
    .appeals-table tbody,
    .appeals-table tr,
    .appeals-table td {
        display: block;
        width: 100%;
    }

    .appeals-table thead {
        display: none;
    }

    .appeals-table tbody {
        display: grid;
        gap: 12px;
    }

    .appeals-table tbody tr {
        padding: 16px;
        border: 1px solid var(--line);
        border-radius: 18px;
        background: #ffffff;
        box-shadow: var(--shadow-sm);
    }

    .appeals-table td {
        padding: 0;
        border: 0;
    }

    .appeals-table td + td {
        margin-top: 12px;
    }

    .appeals-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 6px;
        color: var(--muted);
        font-size: 0.76rem;
        font-weight: 800;
    }

    .appeal-chip {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

    .appeals-header,
    .lookup-panel,
    .result-panel,
    .appeals-footer,
    .appeals-table tbody tr {
        opacity: 1;
        transform: none;
    }
}
