:root {
    --tydal-xref-navy: #062c49;
    --tydal-xref-blue: #1287b1;
    --tydal-xref-pale: #edf6f9;
    --tydal-xref-line: #cbdbe4;
    --tydal-xref-muted: #5a7182;
    --tydal-xref-green: #087f68;
    --tydal-xref-red: #aa3028;
}

.tydal-crossref-admin,
.tydal-crossref-summary,
.tydal-bulk-shell {
    box-sizing: border-box;
}

.tydal-crossref-admin *,
.tydal-crossref-summary *,
.tydal-bulk-shell * {
    box-sizing: border-box;
}

.tydal-crossref-toolbar {
    align-items: center;
    background: #fff;
    border: 1px solid var(--tydal-xref-line);
    border-radius: 12px;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin: 16px 0;
    padding: 12px;
}

.tydal-crossref-toolbar form {
    display: grid;
    flex: 1;
    gap: 8px;
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 1.4fr) auto;
    margin: 0;
}

.tydal-crossref-toolbar input,
.tydal-crossref-toolbar select,
.tydal-crossref-form input:not([type="checkbox"]):not([type="file"]),
.tydal-crossref-form select {
    margin: 0;
    min-height: 40px;
    width: 100%;
}

.tydal-crossref-layout {
    align-items: start;
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
}

.tydal-crossref-form {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 20px 24px 24px;
}

.tydal-crossref-form label {
    color: #243c4e;
    display: grid;
    font-weight: 650;
    gap: 6px;
}

.tydal-crossref-form label:nth-of-type(4),
.tydal-crossref-form > div {
    grid-column: 1 / -1;
}

.tydal-crossref-form .tydal-check {
    align-items: center;
    display: flex;
    flex-direction: row;
    font-weight: 500;
}

.tydal-crossref-table {
    background: #fff;
    border: 1px solid var(--tydal-xref-line);
    border-radius: 12px;
    margin-top: 16px;
    overflow: auto;
}

.tydal-crossref-table table {
    border: 0;
    min-width: 960px;
}

.tydal-crossref-table th,
.tydal-crossref-table td {
    padding: 11px 12px;
    vertical-align: middle;
}

.tydal-crossref-table tr.is-error td {
    background: #fff1f0;
}

.tydal-crossref-table tr.is-new td,
.tydal-crossref-table tr.is-update td {
    background: #f1faf7;
}

.tydal-crossref-table small {
    display: block;
    margin-top: 4px;
}

.tydal-crossref-preview-actions,
.tydal-crossref-summary__body,
.tydal-crossref-summary__actions,
.tydal-customer-hub__header-actions {
    align-items: center;
    display: flex;
    gap: 10px;
}

.tydal-customer-hub__header-actions .button {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    min-height: 34px;
}

.tydal-crossref-preview-actions {
    justify-content: flex-end;
    margin: 16px 0;
}

.tydal-crossref-preview-actions form {
    margin: 0;
}

.tydal-crossref-summary__body {
    justify-content: space-between;
    padding: 16px 24px;
}

.tydal-crossref-summary__body > div:first-child {
    align-items: baseline;
    display: flex;
    gap: 9px;
}

.tydal-crossref-summary__body strong {
    color: var(--tydal-xref-navy);
    font-size: 24px;
}

.tydal-crossref-summary__body span,
.tydal-crossref-mini p {
    color: var(--tydal-xref-muted);
}

.tydal-crossref-account-request {
    align-items: center;
    background: #f4fafc;
    border-top: 1px solid var(--tydal-xref-line);
    display: flex;
    gap: 10px;
    padding: 12px 24px;
}

.tydal-crossref-account-request span { color: var(--tydal-xref-muted); }
.tydal-crossref-account-request .button { margin-left: auto; }

.tydal-crossref-mini {
    border-top: 1px solid var(--tydal-xref-line);
    overflow: auto;
    padding: 0 24px 18px;
}

.tydal-crossref-mini table {
    border-collapse: collapse;
    width: 100%;
}

.tydal-crossref-mini th,
.tydal-crossref-mini td {
    border-bottom: 1px solid #e4edf2;
    padding: 10px 8px;
    text-align: left;
}

.tydal-bulk-shell {
    color: #102b3d;
    margin: 28px auto 64px;
    max-width: 1180px;
    padding: 0 20px;
}

.tydal-bulk-hero {
    background:
        radial-gradient(circle at 88% 18%, rgba(43, 168, 204, .35), transparent 30%),
        linear-gradient(125deg, #052a47 0%, #073c5f 62%, #075372 100%);
    border-radius: 22px;
    color: #fff;
    margin-bottom: 18px;
    overflow: hidden;
    padding: clamp(28px, 5vw, 52px);
    position: relative;
}

.tydal-bulk-hero::after {
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 50%;
    content: "";
    height: 220px;
    position: absolute;
    right: -55px;
    top: -90px;
    width: 220px;
}

.tydal-bulk-hero span,
.tydal-bulk-results header span {
    color: #48bde2;
    font-size: 12px;
    font-weight: 750;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.tydal-bulk-hero h1 {
    color: #fff;
    font-size: clamp(30px, 5vw, 48px);
    line-height: 1.02;
    margin: 10px 0 12px;
}

.tydal-bulk-hero p {
    font-size: 16px;
    line-height: 1.55;
    margin: 0;
    max-width: 720px;
    opacity: .9;
}

.tydal-bulk-input,
.tydal-bulk-results,
.tydal-bulk-message {
    background: #fff;
    border: 1px solid var(--tydal-xref-line);
    border-radius: 18px;
    box-shadow: 0 12px 34px rgba(6, 44, 73, .07);
    padding: clamp(20px, 3vw, 30px);
}

.tydal-bulk-input {
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(240px, .65fr) minmax(0, 1.35fr);
}

.tydal-bulk-input h2,
.tydal-bulk-results h2,
.tydal-bulk-message h2 {
    color: var(--tydal-xref-navy);
    margin: 0 0 8px;
}

.tydal-bulk-input p,
.tydal-bulk-results header p,
.tydal-bulk-message p {
    color: var(--tydal-xref-muted);
    line-height: 1.5;
    margin: 0;
}

.tydal-bulk-input form,
.tydal-bulk-input label {
    display: grid;
    gap: 9px;
}

.tydal-bulk-input textarea {
    border: 1px solid #9fb6c5;
    border-radius: 10px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 14px;
    line-height: 1.55;
    min-height: 220px;
    padding: 14px;
    resize: vertical;
    width: 100%;
}

.tydal-bulk-input textarea:focus,
.tydal-bulk-results input[type="number"]:focus {
    border-color: var(--tydal-xref-blue);
    box-shadow: 0 0 0 3px rgba(18, 135, 177, .13);
    outline: none;
}

.tydal-bulk-upload {
    align-items: center;
    background: var(--tydal-xref-pale);
    border-radius: 10px;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 12px 14px;
}

.tydal-bulk-upload label {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    font-weight: 700;
}

.tydal-bulk-upload a {
    color: #086b92;
    font-weight: 700;
    white-space: nowrap;
}

.tydal-primary-button,
.tydal-bulk-catalog-link a {
    background: var(--tydal-xref-blue) !important;
    border: 0 !important;
    border-radius: 9px !important;
    color: #fff !important;
    display: inline-flex !important;
    font-weight: 750 !important;
    justify-content: center;
    min-height: 44px;
    padding: 11px 20px !important;
    text-decoration: none !important;
}

.tydal-bulk-results {
    margin-top: 18px;
}

.tydal-bulk-results > header {
    align-items: end;
    display: flex;
    justify-content: space-between;
    margin-bottom: 18px;
}

.tydal-bulk-warning {
    background: #fff8dc;
    border-left: 3px solid #d69d00;
    border-radius: 5px;
    color: #725400;
    margin: 8px 0;
    padding: 10px 12px;
}

.tydal-bulk-table-wrap {
    border: 1px solid var(--tydal-xref-line);
    border-radius: 12px;
    margin: 12px 0 18px;
    overflow: auto;
}

.tydal-bulk-results table {
    border-collapse: collapse;
    margin: 0;
    min-width: 900px;
    width: 100%;
}

.tydal-bulk-results th {
    background: var(--tydal-xref-navy);
    color: #fff;
    font-size: 12px;
    letter-spacing: .04em;
    padding: 12px;
    text-align: left;
    text-transform: uppercase;
}

.tydal-bulk-results td {
    border-bottom: 1px solid #dbe7ed;
    padding: 12px;
    vertical-align: middle;
}

.tydal-bulk-results tbody tr:last-child td {
    border-bottom: 0;
}

.tydal-bulk-results tr.is-found {
    background: #fff;
}

.tydal-bulk-results tr.is-error,
.tydal-bulk-results tr.is-missing,
.tydal-bulk-results tr.is-inactive {
    background: #fff4f3;
    color: #6f3531;
}

.tydal-bulk-results td small {
    color: var(--tydal-xref-muted);
    display: block;
    font-size: 12px;
    margin-top: 3px;
}

.tydal-bulk-results input[type="number"] {
    border: 1px solid #9fb6c5;
    border-radius: 7px;
    max-width: 100px;
    min-height: 38px;
    padding: 6px 9px;
}

.tydal-bulk-results td > span {
    margin-left: 5px;
}

.tydal-bulk-catalog-link {
    align-items: center;
    background: linear-gradient(105deg, #eaf5f8, #f7fbfc);
    border: 1px solid #c8dce6;
    border-radius: 13px;
    display: flex;
    grid-column: 1 / -1;
    justify-content: space-between;
    margin: 0 0 20px;
    padding: 14px 16px;
    width: 100%;
}

.tydal-bulk-catalog-link strong,
.tydal-bulk-catalog-link span {
    display: block;
}

.tydal-bulk-catalog-link strong {
    color: var(--tydal-xref-navy);
}

.tydal-bulk-catalog-link span {
    color: var(--tydal-xref-muted);
    font-size: 13px;
    margin-top: 2px;
}

.tydal-bulk-catalog-link a {
    min-height: 38px;
    padding: 8px 14px !important;
}

.tydal-customer-code {
    background: var(--tydal-xref-pale);
    border-left: 3px solid var(--tydal-xref-blue);
    border-radius: 4px 8px 8px 4px;
    margin: 10px 0;
    padding: 9px 11px;
}

.tydal-customer-code span,
.tydal-customer-code strong,
.tydal-customer-code small {
    display: block;
}

.tydal-customer-code span {
    color: #547081;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.tydal-customer-code strong {
    color: var(--tydal-xref-navy);
    font-size: 15px;
    margin-top: 2px;
}

.tydal-customer-code small {
    color: var(--tydal-xref-muted);
    margin-top: 2px;
}

.tydal-customer-code--loop {
    margin: 7px 0 5px;
    padding: 7px 9px;
}

.tydal-customer-sku-inline {
    color: #087da5;
    font-weight: 750;
    white-space: nowrap;
}

.tydal-home-crossref {
    align-items: stretch;
    background:
        radial-gradient(circle at 88% 12%, rgba(52, 175, 213, .24), transparent 32%),
        linear-gradient(125deg, #052a47 0%, #073a5b 62%, #064a68 100%);
    border-radius: 0;
    color: #fff;
    display: grid;
    gap: clamp(24px, 5vw, 64px);
    grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr);
    margin-top: 0;
    overflow: hidden;
    padding: clamp(28px, 5vw, 58px) !important;
    position: relative;
}

.tydal-home-crossref::after {
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 50%;
    content: "";
    height: 290px;
    left: -125px;
    position: absolute;
    top: -170px;
    width: 290px;
}

.tydal-home-crossref__copy,
.tydal-home-crossref__panel {
    min-width: 0;
    position: relative;
    z-index: 1;
}

.tydal-home-crossref__copy > span,
.tydal-home-crossref__status {
    color: #56c6e6;
    display: block;
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .11em;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.tydal-home-crossref__copy h2 {
    color: #fff;
    font-size: clamp(30px, 4.2vw, 46px);
    letter-spacing: -.035em;
    line-height: 1.04;
    margin: 0 0 16px;
}

.tydal-home-crossref__copy p {
    color: rgba(255, 255, 255, .78);
    line-height: 1.65;
    margin: 0;
    max-width: 650px;
}

.tydal-home-crossref__copy ul {
    display: grid;
    gap: 9px;
    list-style: none;
    margin: 24px 0 0;
    padding: 0;
}

.tydal-home-crossref__copy li {
    align-items: center;
    display: flex;
    font-weight: 700;
    gap: 9px;
}

.tydal-home-crossref__copy li::before {
    align-items: center;
    background: #36a9cf;
    border-radius: 50%;
    content: "✓";
    display: inline-flex;
    font-size: 11px;
    height: 20px;
    justify-content: center;
    width: 20px;
}

.tydal-home-crossref__panel {
    align-self: center;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 18px;
    box-shadow: 0 24px 52px rgba(0, 22, 38, .22);
    color: #17364b;
    padding: clamp(22px, 3vw, 32px);
}

.tydal-home-crossref__panel h3 {
    color: var(--tydal-xref-navy);
    font-size: clamp(22px, 2.6vw, 29px);
    letter-spacing: -.02em;
    line-height: 1.12;
    margin: 0 0 10px;
}

.tydal-home-crossref__panel > p {
    color: var(--tydal-xref-muted);
    line-height: 1.55;
    margin: 0 0 20px;
}

.tydal-home-crossref__status.is-ready { color: var(--tydal-xref-green); }
.tydal-home-crossref__status.is-pending { color: #a86410; }

.tydal-home-crossref__form {
    display: grid;
    gap: 14px;
}

.tydal-home-crossref__form label,
.tydal-home-crossref__form label > span {
    display: grid;
    gap: 4px;
}

.tydal-home-crossref__form label > span {
    color: var(--tydal-xref-navy);
    font-size: 14px;
    font-weight: 750;
}

.tydal-home-crossref__form label small {
    color: var(--tydal-xref-muted);
    font-weight: 500;
}

.tydal-home-crossref__form input[type="file"] {
    background: #f6fafc;
    border: 1px dashed #9cb8c7;
    border-radius: 10px;
    color: #38586c;
    padding: 12px;
    width: 100%;
}

.tydal-home-crossref__panel .tydal-home-button {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    text-align: center;
}

.tydal-home-crossref__notice {
    background: #eef8f5;
    border-left: 3px solid var(--tydal-xref-green);
    border-radius: 7px;
    color: #166551;
    margin-bottom: 16px;
    padding: 11px 13px;
}

.tydal-home-crossref__notice.is-error {
    background: #fff2f1;
    border-left-color: var(--tydal-xref-red);
    color: #85352f;
}

.tydal-crossref-requests {
    background: #fff;
    border: 1px solid var(--tydal-xref-line);
    border-radius: 12px;
    margin: 16px 0;
    padding: 16px;
}

.tydal-crossref-requests > header {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.tydal-crossref-requests > header span {
    color: var(--tydal-xref-blue);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.tydal-crossref-requests > header h2 { margin: 3px 0 0; }
.tydal-crossref-requests > header b { background: var(--tydal-xref-pale); border-radius: 99px; color: var(--tydal-xref-navy); padding: 7px 11px; }
.tydal-crossref-requests .tydal-crossref-table { margin-bottom: 0; }
.tydal-crossref-requests form { margin: 0; }

@media (max-width: 900px) {
    .tydal-crossref-layout,
    .tydal-bulk-input,
    .tydal-home-crossref {
        grid-template-columns: 1fr;
    }

    .tydal-crossref-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .tydal-crossref-toolbar form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .tydal-bulk-shell {
        margin-top: 14px;
        padding: 0 12px;
    }

    .tydal-bulk-hero,
    .tydal-bulk-input,
    .tydal-bulk-results,
    .tydal-bulk-message {
        border-radius: 14px;
    }

    .tydal-bulk-upload,
    .tydal-bulk-results > header,
    .tydal-bulk-catalog-link,
    .tydal-crossref-summary__body {
        align-items: stretch;
        flex-direction: column;
    }

    .tydal-crossref-form {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .tydal-crossref-form label,
    .tydal-crossref-form > div {
        grid-column: 1;
    }

    .tydal-crossref-summary__actions {
        align-items: stretch;
        flex-direction: column;
    }

    .tydal-crossref-account-request {
        align-items: stretch;
        flex-direction: column;
    }

    .tydal-crossref-account-request .button { margin-left: 0; }

    .tydal-customer-hub__header-actions {
        justify-content: center;
    }

    .tydal-home-crossref {
        border-radius: 18px;
        margin-left: 12px;
        margin-right: 12px;
        padding: 26px 18px !important;
    }

    .tydal-home-crossref__copy h2 { font-size: 30px; }

    .tydal-home-crossref__panel { padding: 20px; }

    .tydal-home-crossref__panel .tydal-home-button { width: 100%; }
}
