:root {
    color-scheme: light;
    --ink: #17202a;
    --muted: #627084;
    --line: #d9e1ea;
    --paper: #f7f9fb;
    --panel: #ffffff;
    --green: #26734d;
    --blue: #1c5d99;
    --red: #b03a2e;
    --amber: #936a00;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: system-ui, -apple-system, Segoe UI, sans-serif;
}

a {
    color: var(--blue);
    text-decoration: none;
}

.topbar {
    align-items: center;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    padding: 14px clamp(16px, 4vw, 40px);
    position: sticky;
    top: 0;
    z-index: 2;
}

.topbar span {
    color: var(--muted);
    margin-left: 8px;
}

main {
    margin: 0 auto;
    max-width: 1180px;
    padding: 24px clamp(14px, 4vw, 34px) 60px;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1;
    max-width: 760px;
}

h2 {
    font-size: 1.35rem;
}

button,
input,
select {
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
}

button {
    background: var(--blue);
    color: white;
    cursor: pointer;
    font-weight: 700;
    min-height: 42px;
    padding: 9px 14px;
}

button:disabled {
    cursor: default;
    opacity: .9;
}

button.secondary {
    background: #fff;
    color: var(--ink);
}

input,
select {
    background: #fff;
    min-height: 42px;
    padding: 9px 10px;
    width: 100%;
}

label {
    color: var(--muted);
    display: block;
    font-size: .9rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.hero,
.group-head {
    align-items: start;
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1fr) 360px;
}

.panel,
.trade-card,
.empty,
.alert {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}

.panel form + form {
    border-top: 1px solid var(--line);
    margin-top: 18px;
    padding-top: 18px;
}

.links-panel {
    margin: 16px 0 24px;
}

.link-list {
    display: grid;
    gap: 10px;
}

.link-list label {
    display: grid;
    gap: 6px;
}

.link-list span {
    color: var(--ink);
}

.panel button,
.inline-form button {
    margin-top: 10px;
    width: 100%;
}

.alert {
    border-color: #efb7ae;
    color: var(--red);
    margin-bottom: 18px;
}

.inline-form {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
}

.children {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0;
}

.children a {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink);
    font-weight: 700;
    padding: 9px 14px;
}

.children a.active {
    background: var(--ink);
    color: #fff;
}

.stats {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 18px 0 26px;
}

.stats div {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
}

.stats strong {
    display: block;
    font-size: 1.8rem;
}

.stats span,
.section-title p,
.trade-card span,
.trade-card small,
.missing-card span,
.owner-offer span {
    color: var(--muted);
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 24px;
}

.quick-actions a {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    font-weight: 800;
    padding: 10px 14px;
}

.notifications {
    background: #fff8df;
    border: 1px solid #e1be52;
    border-radius: 8px;
    display: grid;
    gap: 8px;
    margin: 0 0 24px;
    padding: 14px;
}

.notifications h2 {
    font-size: 1.05rem;
    margin: 0;
}

.notifications a {
    color: var(--ink);
    font-weight: 800;
}

.notifications span {
    color: var(--muted);
    font-weight: 700;
}

.section-title {
    align-items: end;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin-top: 30px;
}

.section-title p {
    max-width: 560px;
}

.album-section {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 10px 0;
    padding: 10px;
}

.album-section summary {
    cursor: pointer;
    font-weight: 800;
    padding: 8px;
}

.grid {
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    padding-top: 8px;
}

.sticker button {
    aspect-ratio: 1;
    border-radius: 8px;
    color: var(--ink);
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto auto;
    min-height: auto;
    padding: 4px;
    place-items: center;
    width: 100%;
}

.sticker img {
    border-radius: 6px;
    height: 100%;
    max-height: 54px;
    max-width: 100%;
    object-fit: cover;
    width: 100%;
}

.sticker span {
    font-size: 1rem;
    font-weight: 800;
}

.sticker small {
    color: var(--muted);
    display: -webkit-box;
    font-size: .62rem;
    font-weight: 700;
    line-height: 1.05;
    max-width: 100%;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.sticker em {
    font-size: .72rem;
    font-style: normal;
    font-weight: 700;
}

.sticker .missing {
    background: #f0f3f7;
}

.sticker .owned {
    background: #dff3e8;
    border-color: #9ed5b7;
}

.sticker .double {
    background: #d9ecff;
    border-color: #8bbce8;
}

.trade-list {
    display: grid;
    gap: 12px;
}

.missing-list {
    display: grid;
    gap: 14px;
}

.missing-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 12px;
    padding: 16px;
}

.missing-card-head strong,
.missing-card-head span {
    display: block;
}

.owner-list {
    display: grid;
    gap: 10px;
}

.owner-offer {
    align-items: end;
    background: #f7f9fb;
    border-radius: 8px;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(150px, 1fr) minmax(180px, 1.2fr) auto;
    padding: 12px;
}

.owner-offer strong,
.owner-offer span {
    display: block;
}

.trade-card {
    display: grid;
    gap: 12px;
}

.trade-card > div:first-child {
    display: grid;
    gap: 2px;
}

.trade-card.pending {
    border-color: #d8bd65;
}

.trade-card.accepted {
    border-color: #75b58d;
}

.trade-status {
    color: var(--muted);
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.swap {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.swap div {
    background: #f7f9fb;
    border-radius: 8px;
    padding: 12px;
}

.swap strong,
.swap span,
.swap small {
    display: block;
}

.warning {
    background: #fff4d2;
    border: 1px solid #e1be52;
    border-radius: 8px;
    color: var(--amber);
    font-weight: 700;
    margin: 0;
    padding: 10px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chat {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 10px;
    padding-top: 12px;
}

.chat > p {
    color: var(--muted);
    margin: 0;
}

.chat-messages {
    display: grid;
    gap: 8px;
}

.chat-message {
    background: #f7f9fb;
    border-radius: 8px;
    max-width: 760px;
    padding: 10px;
}

.chat-message.mine {
    background: #e9f4ff;
}

.chat-message span {
    color: var(--muted);
    display: block;
    font-size: .82rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.chat-message p {
    margin: 0;
}

.chat-form {
    align-items: end;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
}

@media (max-width: 760px) {
    .hero,
    .group-head,
    .section-title {
        display: block;
    }

    .panel,
    .inline-form {
        margin-top: 18px;
    }

    .stats,
    .swap,
    .owner-offer,
    .chat-form {
        grid-template-columns: 1fr;
    }

    .grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .topbar {
        position: static;
    }
}
