:root {
    --paper: #f4f8ff;
    --surface: rgba(255, 255, 255, 0.92);
    --ink: #0d1b2f;
    --muted: #607086;
    --line: #dbe7f5;
    --blue: #1d6fe8;
    --blue-deep: #0f4fb8;
    --blue-soft: #eaf3ff;
    --blue-faint: #f6faff;
    --success: #2676d9;
    --danger: #c73737;
    --shadow: 0 18px 55px rgba(31, 91, 160, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100%;
    margin: 0;
    color: var(--ink);
    background:
        linear-gradient(120deg, rgba(29, 111, 232, 0.1), transparent 34%),
        linear-gradient(245deg, rgba(126, 177, 244, 0.14), transparent 36%),
        var(--paper);
    font-family: Inter, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
    letter-spacing: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

.page-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

main {
    padding: clamp(18px, 3vw, 30px);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.92);
    border-radius: 8px;
    box-shadow: 0 18px 56px rgba(31, 91, 160, 0.1);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 0;
}

.brand,
.topnav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand {
    font-weight: 800;
}

.brand-mark {
    display: block;
    width: 46px;
    height: 34px;
    flex: 0 0 auto;
}

.brand-mark img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.topnav a {
    padding: 8px 12px;
    color: var(--muted);
    border-radius: 8px;
    transition: color 160ms ease, background 160ms ease;
}

.topnav a:hover {
    color: var(--blue-deep);
    background: var(--blue-soft);
}

.hero-band,
.lottery-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 28px;
    align-items: end;
    padding: clamp(34px, 7vw, 70px);
    border: 1px solid rgba(255, 255, 255, 0.82);
    background:
        linear-gradient(100deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.74)),
        repeating-linear-gradient(135deg, rgba(29, 111, 232, 0.1) 0 1px, transparent 1px 15px);
    box-shadow: var(--shadow);
    border-radius: 8px;
}

.hero-band.compact {
    min-height: 260px;
}

.lottery-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 24px 0 22px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

.hero-copy {
    position: relative;
    z-index: 1;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--blue);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

h1 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(2.2rem, 7vw, 5.6rem);
    line-height: 0.95;
}

.lottery-hero h1 {
    font-size: clamp(1.65rem, 3.4vw, 2.6rem);
    line-height: 1.12;
}

h2 {
    margin: 0;
    font-size: 1.25rem;
}

h3 {
    margin: 12px 0 8px;
    font-size: 1.08rem;
}

.hero-copy p:not(.eyebrow) {
    max-width: 720px;
    color: var(--muted);
    font-size: 1.04rem;
    line-height: 1.8;
}

.preserve-lines {
    white-space: pre-wrap;
}

.lottery-meta-line {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    color: var(--muted);
    font-size: 0.92rem;
}

.lottery-meta-line strong {
    color: var(--ink);
    font-weight: 700;
}

.markdown-body {
    color: #24364d;
    line-height: 1.68;
    overflow-wrap: anywhere;
}

.markdown-body > *:first-child {
    margin-top: 0;
}

.markdown-body > *:last-child {
    margin-bottom: 0;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body blockquote,
.markdown-body pre {
    margin: 0 0 10px;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    margin: 16px 0 8px;
    line-height: 1.25;
}

.markdown-body h1 {
    font-size: 1.35rem;
}

.markdown-body h2 {
    font-size: 1.18rem;
}

.markdown-body h3 {
    font-size: 1.05rem;
}

.markdown-body ul,
.markdown-body ol {
    padding-left: 1.25rem;
}

.markdown-body li + li {
    margin-top: 4px;
}

.markdown-body a {
    color: var(--blue);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.markdown-body code {
    padding: 2px 5px;
    background: var(--blue-faint);
    border-radius: 5px;
    font-size: 0.92em;
}

.markdown-body pre {
    padding: 10px 12px;
    overflow-x: auto;
    background: var(--blue-faint);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.markdown-body pre code {
    padding: 0;
    background: transparent;
}

.markdown-body blockquote {
    padding: 2px 0 2px 12px;
    color: var(--muted);
    border-left: 3px solid var(--line);
}

.lottery-description {
    position: relative;
    z-index: 1;
    max-width: 820px;
    font-size: 0.98rem;
}

.primary-action,
.secondary-action,
.card-actions a,
.empty-state a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-action {
    color: white;
    background: var(--blue);
    box-shadow: 0 12px 24px rgba(29, 111, 232, 0.2);
}

.secondary-action,
.card-actions a,
.empty-state a {
    color: var(--blue-deep);
    background: white;
    border-color: var(--line);
}

.primary-action:hover,
.secondary-action:hover,
.card-actions a:hover,
.empty-state a:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(29, 111, 232, 0.14);
}

.primary-action:disabled,
.secondary-action:disabled {
    cursor: wait;
    opacity: 0.72;
    transform: none;
}

.primary-action.is-loading::after {
    content: "";
    width: 14px;
    height: 14px;
    margin-left: 9px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: white;
    border-radius: 999px;
    animation: spin 760ms linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.content-band {
    margin: 28px 0;
}

.content-band.narrow {
    max-width: 820px;
    margin-inline: auto;
}

.two-column {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(230px, 0.34fr);
    gap: 28px;
    align-items: start;
}

.surface,
.empty-state,
.lottery-card,
.entry-item,
.winner-card {
    border: 1px solid rgba(255, 255, 255, 0.8);
    background: var(--surface);
    box-shadow: 0 12px 36px rgba(31, 91, 160, 0.08);
    backdrop-filter: blur(16px);
    border-radius: 8px;
}

.surface {
    padding: 24px;
}

.compact-panel {
    padding: 0 0 18px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: none;
    backdrop-filter: none;
    border-radius: 0;
}

.section-heading,
.result-header,
.card-topline,
.card-actions,
.mini-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.section-heading {
    margin-bottom: 18px;
}

.section-heading > span,
.card-topline > span:last-child,
.mini-stats {
    color: var(--muted);
    font-size: 0.92rem;
}

.lottery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 18px;
}

.lottery-card {
    padding: 20px;
    transition: transform 180ms ease, border-color 180ms ease;
}

.lottery-card[data-card-href] {
    cursor: pointer;
}

.lottery-card:hover {
    transform: translateY(-3px);
    border-color: rgba(29, 111, 232, 0.32);
}

.lottery-card:focus-visible {
    outline: 3px solid rgba(29, 111, 232, 0.22);
    outline-offset: 3px;
}

.lottery-card p {
    min-height: 54px;
    margin: 0 0 16px;
    color: var(--muted);
    line-height: 1.7;
}

.lottery-card .card-actions {
    justify-content: flex-start;
    margin-top: 22px;
}

.lottery-card .card-actions a {
    min-height: 30px;
    padding: 5px 11px;
    color: var(--blue-deep);
    background: var(--blue-soft);
    border-color: #cfe1f8;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    box-shadow: none;
}

.lottery-card .card-actions a:hover {
    background: #ddebff;
    box-shadow: none;
}

.admin-dashboard-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}

.admin-dashboard-head h1,
.content-band.narrow .section-heading h1 {
    font-size: clamp(2rem, 5vw, 3.6rem);
    line-height: 1.02;
}

.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.admin-stat-grid div {
    min-width: 0;
    padding: 14px;
    background: #f8fbff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.admin-stat-grid span,
.admin-context-line,
.admin-table small,
.admin-entry-title small {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 600;
}

.admin-stat-grid strong {
    display: block;
    margin-top: 5px;
    color: var(--ink);
    font-size: 1.45rem;
}

.admin-panel {
    background: white;
    backdrop-filter: none;
}

.admin-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.admin-table {
    width: 100%;
    min-width: 820px;
    border-collapse: collapse;
    font-size: 0.94rem;
}

.admin-table th,
.admin-table td {
    padding: 13px 14px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
}

.admin-table th {
    color: var(--muted);
    background: #f8fbff;
    font-size: 0.82rem;
    font-weight: 800;
}

.admin-table tbody tr:last-child td {
    border-bottom: 0;
}

.admin-table td:first-child {
    min-width: 220px;
}

.admin-table strong,
.admin-table small,
.admin-entry-title strong,
.admin-entry-title small {
    display: block;
}

.admin-action-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.admin-action-row form {
    margin: 0;
}

.danger-action {
    color: #a53333;
    background: #fff5f5;
    border-color: #f2c7c7;
}

.danger-action:hover {
    color: #8d2525;
    background: #ffecec;
}

.admin-context-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin: -4px 0 16px;
}

.admin-two-column {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.34fr);
}

.admin-filter {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 16px;
}

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

.admin-entry-item {
    display: grid;
    gap: 10px;
    padding: 14px;
    background: #f8fbff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.admin-entry-form {
    display: grid;
    gap: 12px;
}

.admin-entry-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 14px;
}

.compact-fields {
    gap: 10px;
}

.compact-fields input,
.admin-entry-form textarea {
    padding: 10px 11px;
}

.admin-hash-details {
    color: var(--muted);
    font-size: 0.84rem;
}

.admin-hash-details summary {
    width: fit-content;
    cursor: pointer;
    color: var(--blue-deep);
    font-weight: 700;
}

.admin-hash-details dl {
    display: grid;
    gap: 6px;
    margin: 10px 0 0;
}

.admin-hash-details div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.admin-hash-details dt {
    font-weight: 800;
}

.admin-hash-details dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.admin-hash-details code {
    padding: 2px 5px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.admin-entry-delete {
    justify-self: start;
    margin: 0;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}

.status-pill.open {
    color: var(--blue-deep);
    background: var(--blue-soft);
}

.status-pill.closed {
    color: #49627f;
    background: #edf3fb;
}

.form-grid,
.entry-form {
    display: grid;
    gap: 18px;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 500;
}

.tag-action {
    min-height: 30px;
    padding: 5px 11px;
    color: var(--blue-deep);
    background: var(--blue-soft);
    border-color: #cfe1f8;
    border-radius: 999px;
    box-shadow: none;
    font-size: 0.82rem;
    font-weight: 700;
}

.tag-action:hover {
    background: #ddebff;
    box-shadow: none;
}

.tag-action.is-loading::after {
    content: "";
    width: 12px;
    height: 12px;
    margin-left: 7px;
    border: 2px solid rgba(29, 111, 232, 0.22);
    border-top-color: var(--blue);
    border-radius: 999px;
    animation: spin 760ms linear infinite;
}

label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    color: var(--ink);
    background: rgba(255, 255, 255, 0.82);
    border-radius: 8px;
    padding: 12px 13px;
    font-size: 16px;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

textarea {
    resize: vertical;
    line-height: 1.7;
}

select {
    appearance: none;
    padding-right: 38px;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--blue-deep) 50%),
        linear-gradient(135deg, var(--blue-deep) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 50%,
        calc(100% - 12px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(45, 108, 223, 0.7);
    background: white;
    box-shadow: 0 0 0 4px rgba(45, 108, 223, 0.1);
}

.split-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

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

.switch-row {
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    min-height: 72px;
    padding: 13px;
    color: var(--ink);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.65);
    border-radius: 8px;
}

.switch-row input {
    width: 18px;
    height: 18px;
}

.switch-row small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-weight: 500;
    line-height: 1.4;
}

.field-error,
.validation-summary {
    color: var(--danger);
    font-size: 0.88rem;
    font-weight: 600;
}

.notice {
    margin: 0 0 16px;
    padding: 12px 14px;
    color: var(--blue-deep);
    background: var(--blue-soft);
    border: 1px solid rgba(29, 111, 232, 0.2);
    border-radius: 8px;
}

.validation-summary.validation-summary-valid {
    display: none;
}

.validation-summary.validation-summary-errors {
    margin: 0 0 16px;
    padding: 13px 14px;
    color: #9d2626;
    background: rgba(199, 55, 55, 0.08);
    border: 1px solid rgba(199, 55, 55, 0.2);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(199, 55, 55, 0.08);
}

.validation-summary ul {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.validation-summary li {
    position: relative;
    padding-left: 17px;
}

.validation-summary li::before {
    content: "";
    position: absolute;
    top: 0.68em;
    left: 2px;
    width: 7px;
    height: 7px;
    background: var(--danger);
    border-radius: 999px;
    transform: translateY(-50%);
}

.field-error:not(:empty),
.field-validation-error {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 6px 9px;
    color: #9d2626;
    background: rgba(199, 55, 55, 0.08);
    border: 1px solid rgba(199, 55, 55, 0.18);
    border-radius: 8px;
}

label.has-error input,
label.has-error textarea,
input.is-invalid,
textarea.is-invalid {
    border-color: rgba(199, 55, 55, 0.72);
    box-shadow: 0 0 0 4px rgba(199, 55, 55, 0.1);
}

.muted {
    color: var(--muted);
    line-height: 1.75;
}

.hero-metrics {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.hero-metrics div {
    min-height: 92px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(255, 255, 255, 0.92);
    border-radius: 8px;
}

.hero-metrics span,
.facts-panel dt,
.verify-grid dt {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.hero-metrics strong {
    display: block;
    margin-top: 8px;
    font-size: clamp(1.3rem, 4vw, 2.25rem);
}

.hero-actions,
.result-actions {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.signal-strip {
    position: absolute;
    inset: auto 0 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: 5px;
}

.signal-strip span {
    animation: signalPulse 2.8s ease-in-out infinite;
}

.signal-strip span:nth-child(1) {
    background: #9ec9ff;
}

.signal-strip span:nth-child(2) {
    background: var(--blue);
    animation-delay: 120ms;
}

.signal-strip span:nth-child(3) {
    background: #5fa8ff;
    animation-delay: 240ms;
}

.signal-strip span:nth-child(4) {
    background: var(--blue-deep);
    animation-delay: 360ms;
}

@keyframes signalPulse {
    0%,
    100% {
        opacity: 0.45;
        transform: scaleY(1);
    }

    45% {
        opacity: 1;
        transform: scaleY(1.8);
    }
}

.facts-panel dl,
.verify-grid {
    display: grid;
    gap: 10px;
    margin: 0;
}

.facts-panel dl div,
.verify-grid div {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.facts-panel dd,
.verify-grid dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.entry-list {
    display: grid;
    gap: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--line);
}

.entry-item {
    display: block;
    padding: 12px 0 13px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    border-radius: 0;
    animation: riseIn 360ms ease both;
}

.entry-item:target {
    padding-left: 14px;
    background: linear-gradient(90deg, rgba(29, 111, 232, 0.46) 0 3px, rgba(29, 111, 232, 0.055) 3px);
    box-shadow: none;
}

.floor-badge,
.winner-floor {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 10px;
    color: white;
    background: var(--blue);
    border-radius: 8px;
    font-weight: 800;
}

.entry-item p,
.winner-card p {
    margin: 0;
    line-height: 1.7;
}

.entry-item p {
    color: var(--ink);
    font-size: 1rem;
}

.entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.82rem;
}

.entry-item time,
.winner-card time {
    color: var(--muted);
    font-size: 0.86rem;
}

@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-header {
    margin-bottom: 18px;
}

.winner-band {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.winner-card {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 16px;
    background: #f8fbff;
    border-color: #dce9f8;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 20px rgba(31, 91, 160, 0.05);
    backdrop-filter: none;
    animation: riseIn 420ms ease both;
}

.winner-card::before {
    content: none;
}

.winner-card-head {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.winner-ticket-icon {
    position: relative;
    display: grid;
    flex: 0 0 auto;
    width: 42px;
    height: 30px;
    place-items: center;
    background: white;
    border: 1px solid #c9def8;
    border-radius: 7px;
    box-shadow: 0 8px 16px rgba(31, 91, 160, 0.08);
    transform: rotate(-4deg);
    transition: transform 180ms ease;
}

.winner-ticket-icon::before,
.winner-ticket-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 9px;
    height: 9px;
    background: #f8fbff;
    border: 1px solid #c9def8;
    border-radius: 999px;
    transform: translateY(-50%);
}

.winner-ticket-icon::before {
    left: -6px;
}

.winner-ticket-icon::after {
    right: -6px;
}

.winner-ticket-icon span {
    position: relative;
    width: 18px;
    height: 14px;
    border-top: 2px solid rgba(29, 111, 232, 0.68);
    border-bottom: 2px solid rgba(29, 111, 232, 0.68);
}

.winner-ticket-icon span::before {
    content: "";
    position: absolute;
    top: -4px;
    bottom: -4px;
    left: 50%;
    border-left: 1px dashed #9bc5f6;
    transform: translateX(-50%);
}

.winner-card:hover .winner-ticket-icon {
    transform: rotate(-1deg) translateY(-1px);
}

.winner-card .winner-floor {
    min-height: 28px;
    margin: 0;
    padding: 5px 10px;
    color: var(--blue-deep);
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid #cfe1f8;
    border-radius: 999px;
    box-shadow: none;
    font-size: 0.84rem;
}

.winner-card p,
.winner-card time {
    position: relative;
    z-index: 1;
}

.verification-panel code {
    display: inline-block;
    max-width: 100%;
    padding: 3px 5px;
    overflow-wrap: anywhere;
    background: var(--blue-faint);
    border-radius: 6px;
}

.interaction-layer {
    position: fixed;
    inset: 0;
    z-index: 50;
    pointer-events: none;
}

.toast-stack {
    position: absolute;
    top: 18px;
    right: max(16px, calc((100vw - 1120px) / 2));
    display: grid;
    width: min(380px, calc(100vw - 32px));
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) 30px;
    gap: 12px;
    align-items: center;
    min-height: 56px;
    padding: 12px 12px 12px 14px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(31, 91, 160, 0.18);
    backdrop-filter: blur(18px);
    opacity: 0;
    pointer-events: auto;
    transform: translateY(-8px) scale(0.98);
    transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast-mark {
    width: 10px;
    height: 34px;
    border-radius: 999px;
    background: var(--blue);
}

.toast-success .toast-mark {
    background: var(--success);
}

.toast-error .toast-mark {
    background: var(--danger);
}

.toast-info .toast-mark {
    background: var(--blue);
}

.toast-message {
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.toast-close,
.dialog-close {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    color: var(--muted);
    background: var(--blue-faint);
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: color 160ms ease, background 160ms ease;
}

.toast-close:hover,
.dialog-close:hover {
    color: var(--ink);
    background: var(--blue-soft);
}

.dialog-backdrop {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(13, 37, 74, 0.2);
    opacity: 0;
    pointer-events: auto;
    transition: opacity 180ms ease;
}

.dialog-backdrop[hidden] {
    display: none;
}

.dialog-backdrop.is-open {
    opacity: 1;
}

.dialog-panel {
    position: relative;
    width: min(440px, 100%);
    padding: 24px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 28px 70px rgba(31, 91, 160, 0.22);
    transform: translateY(10px) scale(0.98);
    transition: transform 180ms ease;
}

.dialog-backdrop.is-open .dialog-panel {
    transform: translateY(0) scale(1);
}

.dialog-close {
    position: absolute;
    top: 14px;
    right: 14px;
}

.dialog-panel p:not(.eyebrow) {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.admin-unlock-form {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.dialog-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

.clipboard-fallback {
    position: fixed;
    top: -999px;
    left: -999px;
}

.empty-state,
.result-pending {
    padding: 28px;
}

.empty-state p,
.result-pending p {
    margin: 0 0 14px;
    color: var(--muted);
}

@media (max-width: 780px) {
    .page-shell {
        width: min(100% - 14px, 1120px);
    }

    main {
        padding: 16px;
    }

    .topbar {
        padding: 14px 0;
    }

    .topnav a {
        padding: 7px 9px;
    }

    .hero-band,
    .lottery-hero,
    .two-column,
    .split-fields {
        grid-template-columns: 1fr;
    }

    .hero-band,
    .lottery-hero {
        padding: 28px;
    }

    .hero-band.compact {
        min-height: auto;
    }

    .lottery-hero {
        padding: 12px 0 18px;
    }

    .lottery-hero h1 {
        font-size: clamp(1.45rem, 8vw, 2rem);
    }

    .lottery-meta-line,
    .entry-meta {
        gap: 5px 10px;
    }

    .content-band {
        margin: 20px 0;
    }

    .compact-panel {
        padding-bottom: 16px;
    }

    .hero-metrics,
    .entry-item {
        grid-template-columns: 1fr;
    }

    .toast-stack {
        top: 10px;
        right: 10px;
        width: calc(100vw - 20px);
    }

    .result-header,
    .section-heading,
    .admin-dashboard-head {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .admin-filter {
        grid-template-columns: 1fr;
    }

    .entry-item {
        align-items: start;
    }
}
