.centered-title {
    justify-content: center;
    text-align: center;
}

.ebay-category-admin,
.ebay-messages-page,
.ebay-offers-page,
.staff-admin-page {
    display: grid;
    gap: 14px;
}

.ebay-category-summary {
    padding: 14px;
}

.ebay-category-metrics,
.ebay-message-metrics,
.ebay-offer-summary {
    display: grid;
    grid-template-columns: repeat(6, minmax(110px, 1fr));
    gap: 8px;
}

.ebay-category-metrics article,
.ebay-message-metrics article,
.ebay-offer-summary article {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #d8dee7;
    background: #fff;
}

.ebay-category-metrics span,
.ebay-message-metrics span,
.ebay-offer-summary span {
    display: block;
    color: #647184;
    font-size: 12px;
}

.ebay-category-metrics strong,
.ebay-message-metrics strong,
.ebay-offer-summary strong {
    display: block;
    margin-top: 3px;
    color: #182337;
    font-size: 17px;
}

.ebay-category-metrics .is-added {
    border-left: 4px solid #22965b;
}

.ebay-category-metrics .is-removed {
    border-left: 4px solid #cf3f45;
}

.ebay-category-metrics .is-changed,
.ebay-category-metrics .is-warning {
    border-left: 4px solid #d99b20;
}

.ebay-category-layout {
    display: grid;
    grid-template-columns: minmax(220px, 290px) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.ebay-category-owner,
.ebay-category-tree {
    padding: 14px;
}

.ebay-category-owner {
    position: sticky;
    top: 54px;
    display: grid;
    gap: 14px;
}

.ebay-category-owner label,
.ebay-category-add label,
.ebay-category-filter,
.staff-dialog label {
    display: grid;
    gap: 5px;
}

.ebay-category-owner label > span,
.ebay-category-add label > span,
.staff-dialog label > span {
    color: #4f5d70;
    font-size: 12px;
    font-weight: 700;
}

.ebay-category-owner select,
.ebay-category-owner input,
.ebay-category-filter input,
.ebay-category-add input,
.staff-dialog input,
.staff-dialog select,
.ebay-offer-dialog input,
.ebay-offer-dialog textarea {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    border: 1px solid #c8d1dd;
    border-radius: 5px;
    background: #fff;
    color: #182337;
    padding: 7px 9px;
}

.ebay-category-owner-status {
    border-left: 3px solid #3974ad;
    background: #eef5fb;
    color: #34455a;
    padding: 9px 10px;
    font-size: 12px;
    line-height: 1.45;
}

.ebay-category-owner-status.is-error {
    border-left-color: #c9474d;
    background: #fff1f1;
}

.ebay-category-add {
    display: grid;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid #dfe5ec;
}

.ebay-category-add h3 {
    margin: 0;
    color: #25344a;
    font-size: 14px;
}

.ebay-category-tree > header {
    align-items: center;
}

.ebay-category-tree > header div {
    min-width: 0;
}

.ebay-category-tree > header span {
    display: block;
    margin-top: 2px;
    color: #697689;
    font-size: 12px;
}

.ebay-category-filter {
    grid-template-columns: minmax(180px, 1fr) auto;
    align-items: center;
    margin: 10px 0;
}

.toggle-line.compact {
    display: inline-flex;
    white-space: nowrap;
}

.ebay-category-list {
    height: min(62vh, 720px);
    overflow: auto;
    scrollbar-width: thin;
    border-top: 1px solid #dce3eb;
    border-bottom: 1px solid #dce3eb;
    background: #fff;
}

.ebay-category-node {
    min-width: 0;
}

.ebay-category-row {
    --indent: min(calc(var(--category-level, 0) * 4px), 24px);
    --level-accent: #2f6fa3;
    --level-background: #f3f7fb;
    --level-open-background: #dfeefa;
    position: relative;
    display: grid;
    grid-template-columns: 22px 20px minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
    min-height: 42px;
    padding: 5px 8px 5px calc(12px + var(--indent));
    border-left: 4px solid var(--level-accent);
    border-bottom: 1px solid #edf0f4;
    background: var(--level-background);
}

.ebay-category-row[aria-level="2"] {
    --level-accent: #2f8065;
    --level-background: #f0f8f4;
    --level-open-background: #dcefe6;
}

.ebay-category-row[aria-level="3"] {
    --level-accent: #a36b0d;
    --level-background: #fff8e8;
    --level-open-background: #f7e8bd;
}

.ebay-category-row[aria-level="4"] {
    --level-accent: #7553a4;
    --level-background: #f7f3fb;
    --level-open-background: #e9dff4;
}

.ebay-category-row[aria-level="5"] {
    --level-accent: #aa4c61;
    --level-background: #fcf2f4;
    --level-open-background: #f4dde3;
}

.ebay-category-row[aria-level="6"] {
    --level-accent: #5f6f85;
    --level-background: #f3f6f9;
    --level-open-background: #e3e9ef;
}

.ebay-category-row:hover {
    background: var(--level-open-background);
}

.ebay-category-row.is-selected {
    background: #edf8f1;
    box-shadow: inset 3px 0 #268a54;
}

.ebay-category-row.is-branch {
    background: var(--level-background);
    cursor: pointer;
}

.ebay-category-row.is-branch.is-open {
    background: var(--level-open-background);
    box-shadow: inset 4px 0 var(--level-accent);
}

.ebay-category-toggle,
.ebay-category-toggle-spacer,
.ebay-category-selection-spacer {
    width: 20px;
    height: 20px;
}

.ebay-category-toggle {
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--level-accent);
    border-radius: 2px;
    background: #fff;
    color: var(--level-accent);
    font: 700 14px/1 Arial, sans-serif;
    cursor: pointer;
}

.ebay-category-toggle:hover,
.ebay-category-toggle:focus-visible {
    border-color: #3974ad;
    background: #eaf2f9;
    outline: none;
}

.ebay-category-toggle:disabled {
    cursor: wait;
    opacity: 0.72;
}

.ebay-category-row.is-open > .ebay-category-toggle {
    background: var(--level-accent);
    color: #fff;
}

.ebay-category-toggle-spacer,
.ebay-category-selection-spacer {
    display: block;
}

.ebay-category-row > input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #268a54;
}

.ebay-category-label {
    min-width: 0;
}

.ebay-category-label strong,
.ebay-category-label small {
    display: block;
    overflow-wrap: anywhere;
}

.ebay-category-label strong {
    color: #202d41;
    font-size: 13px;
}

.ebay-category-label small {
    margin-top: 2px;
    color: #697588;
    font-size: 11px;
}

.ebay-category-row em {
    color: var(--level-accent);
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
}

.ebay-category-children {
    margin-left: 30px;
    border-left: 3px solid #b8c7d6;
    background: #fbfcfd;
}

.ebay-category-children > .ebay-category-node > .ebay-category-row::before {
    content: "";
    position: absolute;
    top: 50%;
    left: -3px;
    width: 13px;
    border-top: 2px solid #b8c7d6;
    transform: translateY(-1px);
}

.ebay-category-children[hidden] {
    display: none;
}

.ebay-category-branch-loading {
    padding: 9px 12px 9px 46px;
    border-bottom: 1px solid #edf0f4;
    color: #647184;
    font-size: 12px;
}

.ebay-category-branch-loading.is-error {
    color: #b33b43;
}

.ebay-category-empty {
    padding: 28px 14px;
    color: #687588;
    text-align: center;
}

.ebay-category-changes {
    padding: 14px;
}

.ebay-category-changes > div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 8px;
}

.ebay-category-change {
    display: grid;
    gap: 3px;
    padding: 9px 10px;
    border-left: 4px solid #8b98a8;
    background: #f8fafc;
}

.ebay-category-change.is-aggiunta {
    border-left-color: #23925a;
}

.ebay-category-change.is-rimossa {
    border-left-color: #cb3f46;
}

.ebay-category-change.is-modificata {
    border-left-color: #d99a20;
}

.ebay-category-change.affects-selection {
    box-shadow: inset 0 0 0 1px #d99a20;
}

.ebay-category-change strong {
    text-transform: capitalize;
}

.ebay-category-change small,
.ebay-category-change em {
    color: #657286;
    font-size: 11px;
    font-style: normal;
}

.ebay-message-metrics,
.ebay-offer-summary {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.ebay-message-layout {
    display: grid;
    grid-template-columns: minmax(260px, 34%) minmax(0, 1fr);
    min-height: 600px;
    padding: 0;
    overflow: hidden;
}

.ebay-message-layout > aside {
    display: grid;
    grid-template-columns: 1fr 130px;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px;
    min-width: 0;
    padding: 12px;
    border-right: 1px solid #dce2ea;
}

.ebay-message-layout label {
    display: grid;
    gap: 4px;
}

.ebay-message-layout label span {
    color: #59677a;
    font-size: 11px;
    font-weight: 700;
}

.ebay-message-layout input,
.ebay-message-layout select {
    width: 100%;
    min-width: 0;
    min-height: 34px;
    border: 1px solid #c9d2de;
    border-radius: 4px;
    padding: 6px 8px;
}

.ebay-message-list {
    grid-column: 1 / -1;
    min-height: 0;
    overflow: auto;
}

.ebay-message-row {
    display: grid;
    width: 100%;
    gap: 3px;
    padding: 9px 8px;
    border: 0;
    border-bottom: 1px solid #e4e8ee;
    background: #fff;
    color: #26344a;
    text-align: left;
}

.ebay-message-row:hover,
.ebay-message-row.active {
    background: #eef5fb;
}

.ebay-message-row.is-unread {
    box-shadow: inset 3px 0 #2c72ac;
}

.ebay-message-row span,
.ebay-message-row small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ebay-message-row small {
    color: #718094;
}

.ebay-message-row .ebay-message-preview {
    color: #657286;
    font-size: 11px;
}

.ebay-message-detail {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-width: 0;
    padding: 18px;
    overflow: hidden;
}

.ebay-message-detail > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.ebay-message-detail h2 {
    margin: 0;
    font-size: 18px;
}

.ebay-message-identities {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 18px 0;
}

.ebay-message-identities span {
    padding: 8px;
    background: #f5f7fa;
    overflow-wrap: anywhere;
}

.ebay-message-identities strong {
    display: block;
    margin-bottom: 2px;
    color: #69768a;
    font-size: 11px;
}

.ebay-message-body {
    min-height: 180px;
    padding: 16px;
    border: 1px solid #dce2ea;
    background: #fff;
    color: #202c3f;
    line-height: 1.55;
    white-space: pre-wrap;
}

.ebay-message-detail footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    color: #657286;
    font-size: 12px;
}

.ebay-chat-header {
    padding-bottom: 14px;
    border-bottom: 1px solid #dce2ea;
}

.ebay-chat-header div {
    min-width: 0;
}

.ebay-chat-header span,
.ebay-chat-header small {
    display: block;
    margin-top: 3px;
    color: #657286;
}

.ebay-chat-header small {
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ebay-chat-thread {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    padding: 16px 4px 16px 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.ebay-chat-bubble {
    width: fit-content;
    max-width: min(78%, 720px);
    padding: 10px 12px;
    border: 1px solid #d5dde7;
    border-radius: 7px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(30, 45, 67, 0.05);
}

.ebay-chat-bubble.is-outgoing {
    align-self: flex-end;
    border-color: #a9ceb9;
    background: #eef8f2;
}

.ebay-chat-bubble header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 5px;
    color: #617084;
    font-size: 11px;
}

.ebay-chat-bubble p {
    margin: 0;
    color: #202c3f;
    line-height: 1.48;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.ebay-chat-composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #dce2ea;
}

.ebay-chat-composer textarea {
    min-height: 58px;
    max-height: 150px;
    resize: vertical;
    border: 1px solid #bdc8d6;
    border-radius: 5px;
    padding: 9px 10px;
    font: inherit;
}

.ebay-chat-composer button {
    align-self: end;
    min-height: 36px;
}

.ebay-chat-composer small {
    grid-column: 1 / -1;
    color: #68778a;
}

.ebay-chat-composer small.is-error,
.ebay-chat-error {
    color: #a72f38;
}

.ebay-chat-disabled {
    margin: 0;
    padding: 10px;
    border-top: 1px solid #dce2ea;
    background: #f6f8fa;
    color: #657286;
    font-size: 12px;
}

.ebay-buyers-page {
    display: grid;
    grid-template-columns: minmax(260px, 31%) minmax(0, 1fr);
    min-height: 680px;
    padding: 0;
    overflow: hidden;
}

.ebay-buyers-directory {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 8px;
    min-width: 0;
    padding: 13px;
    border-right: 1px solid #dce2ea;
}

.ebay-buyers-directory label {
    display: grid;
    gap: 4px;
}

.ebay-buyers-directory label span,
.ebay-buyers-count {
    color: #59677a;
    font-size: 11px;
    font-weight: 700;
}

.ebay-buyers-directory input {
    min-height: 36px;
    border: 1px solid #c9d2de;
    border-radius: 4px;
    padding: 7px 9px;
}

.ebay-buyers-count {
    margin: 0;
}

.ebay-buyers-list {
    min-height: 0;
    overflow-y: auto;
}

.ebay-buyer-row {
    display: grid;
    width: 100%;
    gap: 3px;
    padding: 10px 8px;
    border: 0;
    border-bottom: 1px solid #e4e8ee;
    background: #ffffff;
    color: #26344a;
    text-align: left;
    cursor: pointer;
}

.ebay-buyer-row:hover,
.ebay-buyer-row.active {
    background: #eef5fb;
    box-shadow: inset 3px 0 #2c72ac;
}

.ebay-buyer-row span,
.ebay-buyer-row small {
    overflow: hidden;
    color: #657286;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ebay-buyer-detail {
    min-width: 0;
    padding: 18px;
    overflow-y: auto;
}

.ebay-buyer-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 13px;
    border-bottom: 1px solid #dce2ea;
}

.ebay-buyer-heading h2,
.ebay-buyer-section h3 {
    margin: 0;
}

.ebay-buyer-heading span {
    display: block;
    margin-top: 3px;
    color: #657286;
}

.ebay-buyer-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 14px 0;
}

.ebay-buyer-summary article {
    min-width: 0;
    padding: 9px;
    border: 1px solid #e0e5eb;
    background: #f7f9fb;
}

.ebay-buyer-summary span,
.ebay-buyer-summary strong {
    display: block;
}

.ebay-buyer-summary span {
    margin-bottom: 3px;
    color: #657286;
    font-size: 11px;
}

.ebay-buyer-summary strong {
    overflow-wrap: anywhere;
    font-size: 13px;
}

.ebay-buyer-section {
    margin-top: 18px;
}

.ebay-buyer-section h3 {
    margin-bottom: 8px;
    color: #26344a;
    font-size: 14px;
}

.ebay-buyer-address {
    padding: 10px;
    border-left: 3px solid #2c72ac;
    background: #f5f8fb;
    white-space: pre-wrap;
}

.ebay-buyer-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    margin: 0;
    background: #dfe5ec;
}

.ebay-buyer-fields div {
    min-width: 0;
    padding: 8px;
    background: #ffffff;
}

.ebay-buyer-fields dt {
    color: #657286;
    font-size: 10px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.ebay-buyer-fields dd {
    margin: 3px 0 0;
    color: #26344a;
    overflow-wrap: anywhere;
}

.ebay-buyer-orders,
.ebay-buyer-messages {
    display: grid;
    gap: 6px;
    max-height: 330px;
    overflow-y: auto;
}

.ebay-buyer-orders article,
.ebay-buyer-messages article {
    padding: 9px;
    border: 1px solid #dce2ea;
    background: #ffffff;
}

.ebay-buyer-orders header,
.ebay-buyer-messages header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.ebay-buyer-orders p,
.ebay-buyer-messages p {
    margin: 5px 0 0;
    line-height: 1.4;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.ebay-buyer-orders span,
.ebay-buyer-orders small,
.ebay-buyer-messages span {
    color: #657286;
    font-size: 11px;
}

.ebay-offer-list {
    display: grid;
    gap: 8px;
    max-height: 66vh;
    overflow: auto;
    padding-right: 3px;
}

.ebay-offer-card {
    padding: 12px;
    border: 1px solid #d7dee8;
    background: #fff;
}

.ebay-offer-card.is-new {
    border-left: 5px solid #2c9b61;
}

.ebay-offer-card > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.ebay-offer-card h3 {
    margin: 0;
    color: #1e2d43;
    font-size: 15px;
}

.ebay-offer-card header span {
    display: block;
    margin-top: 3px;
    color: #66758a;
    font-size: 12px;
}

.ebay-offer-card header > strong {
    color: #1d6e46;
    white-space: nowrap;
}

.ebay-offer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin: 10px 0;
    color: #59677a;
    font-size: 12px;
}

.ebay-offer-card blockquote {
    margin: 8px 0;
    padding: 9px 11px;
    border-left: 3px solid #7e8da1;
    background: #f5f7f9;
}

.ebay-offer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.offer-action-state {
    display: inline-block;
    padding: 5px 8px;
    background: #eef2f6;
    color: #42536a;
    font-size: 11px;
}

.offer-action-state.is-errore {
    background: #fff0f0;
    color: #a32831;
}

.ebay-offer-dialog,
.staff-dialog {
    width: min(520px, calc(100vw - 28px));
    border: 1px solid #bcc7d5;
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(25, 37, 53, 0.28);
    padding: 18px;
}

.ebay-offer-dialog::backdrop,
.staff-dialog::backdrop {
    background: rgba(36, 45, 58, 0.58);
}

.ebay-offer-dialog form,
.staff-dialog form {
    display: grid;
    gap: 12px;
}

.ebay-offer-dialog textarea {
    min-height: 100px;
    resize: vertical;
}

.offer-confirm-warning {
    margin: 0;
    padding: 9px;
    border-left: 3px solid #c58d22;
    background: #fff8e8;
    color: #5f4b23;
    font-size: 12px;
}

.staff-form-footer {
    display: flex;
    align-items: center;
    gap: 10px;
}

.staff-form-footer span {
    color: #56657a;
    font-size: 12px;
}

.price-group-row.is-read-only {
    background: #f5f7fa;
    border-color: #c9d2de;
}

.price-group-row.is-read-only::before {
    content: "Anteprima sola lettura";
    display: block;
    padding: 4px 8px;
    background: #e9eef4;
    color: #526176;
    font-size: 11px;
    font-weight: 700;
}

.price-group-row.is-read-only input:disabled,
.price-group-row.is-read-only button:disabled {
    color: #536177;
    opacity: 0.78;
}

@media (max-width: 1000px) {
    .ebay-category-metrics {
        grid-template-columns: repeat(3, minmax(100px, 1fr));
    }

    .ebay-category-layout,
    .ebay-message-layout,
    .ebay-buyers-page {
        grid-template-columns: 1fr;
    }

    .ebay-category-owner {
        position: static;
    }

    .ebay-message-layout > aside {
        min-height: 420px;
        border-right: 0;
        border-bottom: 1px solid #dce2ea;
    }

    .ebay-buyers-directory {
        min-height: 390px;
        border-right: 0;
        border-bottom: 1px solid #dce2ea;
    }
}

@media (max-width: 650px) {
    .ebay-category-metrics,
    .ebay-message-metrics,
    .ebay-offer-summary {
        grid-template-columns: repeat(2, minmax(100px, 1fr));
    }

    .ebay-category-filter,
    .ebay-message-layout > aside {
        grid-template-columns: 1fr;
    }

    .ebay-category-children {
        margin-left: 22px;
    }

    .ebay-category-row {
        --indent: min(calc(var(--category-level, 0) * 2px), 12px);
        padding-left: calc(8px + var(--indent));
    }

    .ebay-message-list {
        grid-column: 1;
    }

    .ebay-message-identities {
        grid-template-columns: 1fr;
    }

    .ebay-buyer-summary,
    .ebay-buyer-fields {
        grid-template-columns: 1fr;
    }

    .ebay-chat-bubble {
        max-width: 92%;
    }

    .ebay-message-detail > header,
    .ebay-message-detail footer,
    .ebay-offer-card > header {
        display: grid;
    }
}
