:root {
    --bg: #1e1f22;
    --surface: #2b2d31;
    --surface-hover: #35373c;
    --text: #dbdee1;
    --muted: #949ba4;
    --accent: #5865f2;
    --border: #3f4147;
    --embed-bg: #2b2d31;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem;
}

.container--wide {
    max-width: 1280px;
}

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    gap: 1rem;
}

.notify-toggle {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 4px;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
}

.notify-toggle:hover {
    color: var(--text);
    border-color: var(--accent);
}

.notify-toggle.active {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
}

.live-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.1rem 0.45rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #3ba55d;
    background: rgba(59, 165, 93, 0.15);
    border-radius: 4px;
}

.count-bump {
    animation: countBump 0.4s ease;
}

@keyframes countBump {
    0% { transform: scale(1); color: var(--accent); }
    50% { transform: scale(1.15); color: #fff; }
    100% { transform: scale(1); color: var(--accent); }
}

.message-card-live {
    animation: messageSlideIn 0.35s ease both;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.brand {
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
}

h1 {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
}

.subtitle {
    color: var(--muted);
    margin: 0 0 1.5rem;
}

.webhook-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.webhook-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.webhook-card:hover {
    background: var(--surface-hover);
}

.webhook-card h2 {
    margin: 0 0 0.25rem;
    font-size: 1.1rem;
}

.webhook-id {
    color: var(--muted);
    font-size: 0.85rem;
    margin: 0 0 0.75rem;
    word-break: break-all;
}

.webhook-stats {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.9rem;
}

.stat strong {
    color: var(--accent);
}

.endpoint-help {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
}

.durability-banner {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    padding: 0.6rem 0.85rem;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #f0c674;
    background: rgba(240, 198, 116, 0.08);
    border: 1px solid rgba(240, 198, 116, 0.25);
}

.durability-banner--error {
    color: #f88;
    background: rgba(248, 136, 136, 0.08);
    border-color: rgba(248, 136, 136, 0.25);
}

.endpoint-help code {
    display: block;
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: 4px;
    font-size: 0.85rem;
    word-break: break-all;
}

.page-header {
    margin-bottom: 1.5rem;
}

.back-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
}

.empty-state {
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    color: var(--muted);
}

.message-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message-list--compact {
    gap: 0.35rem;
}

.message-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    position: relative;
}

.message-card--compact {
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    content-visibility: auto;
    contain-intrinsic-size: auto 64px;
}

.message-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
    line-height: 1.3;
}

.message-row time {
    color: var(--muted);
    white-space: nowrap;
}

.message-user {
    color: var(--text);
    font-weight: 600;
}

.message-row .expired-badge {
    position: static;
    margin-left: auto;
    padding: 0.05rem 0.35rem;
    font-size: 0.65rem;
}

.message-content--compact {
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
    white-space: pre-wrap;
}

.embed-compact {
    margin-top: 0.15rem;
}

.embed-compact-title {
    font-weight: 700;
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
}

.embed-compact-title a {
    color: var(--accent);
    text-decoration: none;
}

.embed-compact-desc {
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 0.25rem;
    white-space: pre-wrap;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.2rem 0.6rem;
}

.field-cell {
    min-width: 0;
    font-size: 0.72rem;
    line-height: 1.25;
}

.field-cell .field-name {
    display: block;
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.05rem;
}

.field-cell .field-value {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.field-cell .field-value:hover {
    white-space: normal;
    overflow: visible;
    word-break: break-word;
}

.message-card--expired {
    background: #2a2224;
    border-color: #5c3a3a;
    opacity: 0.85;
}

.message-card--expired .discord-embed {
    opacity: 0.75;
}

.expired-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.15rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #f88;
    background: rgba(248, 136, 136, 0.12);
    border: 1px solid #5c3a3a;
    border-radius: 4px;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.message-header .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.message-header time {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
}

.message-content {
    white-space: pre-wrap;
    margin-bottom: 0.5rem;
}

.discord-embed {
    position: relative;
    background: var(--embed-bg);
    border-left: 4px solid var(--accent);
    border-radius: 4px;
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
    max-width: 520px;
}

.embed-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.embed-author img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.embed-author a {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}

.embed-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.embed-title a {
    color: var(--accent);
    text-decoration: none;
}

.embed-description {
    white-space: pre-wrap;
    font-size: 0.95rem;
}

.embed-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.embed-field {
    flex: 1 1 100%;
}

.embed-field.inline {
    flex: 1 1 calc(33% - 0.75rem);
    min-width: 120px;
}

.field-name {
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.field-value {
    white-space: pre-wrap;
    font-size: 0.9rem;
}

.field-value a,
.embed-description a,
.message-content a {
    color: #00a8fc;
    text-decoration: none;
}

.field-value a:hover,
.embed-description a:hover,
.message-content a:hover {
    text-decoration: underline;
}

.discord-timestamp {
    display: inline-block;
    background: #1e1f22;
    border-radius: 4px;
    padding: 0 0.2rem;
    font-size: 0.85em;
    color: #dbdee1;
}

.discord-spoiler {
    display: inline-block;
    background: #1e1f22;
    color: transparent;
    border-radius: 3px;
    padding: 0 0.15rem;
    cursor: pointer;
    user-select: none;
}

.discord-spoiler:hover,
.discord-spoiler:focus {
    color: #dbdee1;
    background: #2b2d31;
}

.embed-thumbnail {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    max-width: 80px;
    max-height: 80px;
    border-radius: 4px;
}

.embed-image {
    display: block;
    max-width: 100%;
    margin-top: 0.75rem;
    border-radius: 4px;
}

.embed-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: var(--muted);
}

.embed-footer img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.pagination {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-top: 1rem;
    font-size: 0.85rem;
}

.pagination-status {
    color: var(--muted);
}

.pagination a {
    color: var(--accent);
    text-decoration: none;
}

.login-card {
    max-width: 360px;
    margin: 3rem auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
}

.login-card label {
    display: block;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.login-card input {
    display: block;
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text);
}

.login-card button {
    width: 100%;
    padding: 0.6rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
}

.error {
    background: #3d2020;
    color: #f88;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
