body {
    margin: 0;
    font-family: system-ui, Arial, sans-serif;
    color: #222;
    background: #fff;
}

.wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.db-wrap {
    max-width: 1720px;
}

a {
    color: #0645ad;
}

.topbar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}

.search,
.endpoint-box,
.endpoint-panel,
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 14px 0;
}

input,
select,
button,
.button {
    padding: 8px 10px;
    border: 1px solid #bbb;
    border-radius: 4px;
    background: #fff;
    font: inherit;
}

.button,
button {
    cursor: pointer;
    text-decoration: none;
}

.table-wrap {
    overflow-x: auto;
}

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

th,
td {
    padding: 8px;
    border: 1px solid #ddd;
    text-align: left;
    vertical-align: top;
}

th {
    background: #f3f3f3;
}

.group-row td {
    background: #e8eef7;
    font-weight: 700;
    color: #1f2933;
}

.endpoint-cell {
    min-width: 320px;
    word-break: break-all;
}

.sticky-action {
    position: sticky;
    right: 0;
    background: #fff;
    z-index: 2;
    min-width: 170px;
}

th.sticky-action {
    background: #f3f3f3;
    z-index: 3;
}

.sticky-action .button,
.sticky-action button {
    display: block;
    width: 100%;
    margin: 0 0 6px;
    text-align: center;
}

.modal {
    width: min(1100px, calc(100% - 32px));
    border: 1px solid #bbb;
    border-radius: 6px;
    padding: 16px;
}

.modal::backdrop {
    background: rgba(0, 0, 0, .35);
}

.modal-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.modal-head h2 {
    margin: 0;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.tabs a {
    padding: 8px 10px;
    border: 1px solid #bbb;
    border-radius: 4px;
    text-decoration: none;
}

.tabs a.active {
    background: #222;
    color: #fff;
}

.child-tabs {
    margin-top: -4px;
    padding-left: 16px;
}

.child-tabs a {
    border-style: dashed;
}

.child-tabs a.active {
    border-style: solid;
}

.endpoint-box input {
    min-width: min(680px, 100%);
}

.endpoint-panel {
    align-items: flex-end;
}

.endpoint-panel > div {
    flex: 1 1 520px;
}

.endpoint-panel strong {
    display: block;
    margin-bottom: 6px;
}

.endpoint-panel input {
    width: 100%;
    box-sizing: border-box;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.card {
    border: 1px solid #ddd;
    padding: 10px;
}

.card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #eee;
}

.product-detail {
    display: grid;
    grid-template-columns: minmax(220px, 360px) 1fr;
    gap: 16px;
    align-items: start;
}

.detail-image {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    border: 1px solid #ddd;
}

.error {
    padding: 12px;
    border: 1px solid #c00;
    color: #900;
    background: #fff5f5;
}

.auth-wrap {
    max-width: 420px;
    padding-top: 80px;
}

.auth-card {
    display: grid;
    gap: 14px;
    border: 1px solid #ddd;
    padding: 18px;
}

.auth-card label {
    display: grid;
    gap: 6px;
}

.switch {
    display: inline-flex;
    align-items: center;
    margin-right: 6px;
}

.switch input {
    display: none;
}

.switch span {
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #bbb;
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.switch span::after {
    content: "";
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: left .15s ease;
}

.switch input:checked + span {
    background: #16a34a;
}

.switch input:checked + span::after {
    left: 21px;
}

@media (max-width: 640px) {
    .wrap {
        padding: 12px;
    }

    .product-detail {
        grid-template-columns: 1fr;
    }
}
