/* Trim the generated strip's letterboxing at display time; never add ad headings. */
img[src*="/site-editorial/main/strip.png"] {
    width: 100%; height: auto !important; aspect-ratio: 7.1 / 1; object-fit: cover;
}
img[src*="/site-editorial/purple-gold/strip.png"] {
    width: 100%; height: auto !important; aspect-ratio: 6.8 / 1; object-fit: cover;
}

/* Imported material tables also use th as body cells. Long number lists must
   wrap inside their own columns instead of squeezing the issue column. */
.page-builder-visual-table__content table {
    width: 100% !important;
    max-width: 100%;
    table-layout: fixed;
}
.page-builder-visual-table__content th,
.page-builder-visual-table__content td {
    box-sizing: border-box;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    vertical-align: middle;
}
@media (max-width: 600px) {
    .page-builder-visual-table__content th,
    .page-builder-visual-table__content td {
        padding: 8px 4px;
    }
    .page-builder-visual-table__content tr > :first-child[colspan="30"]:not(:last-child) {
        white-space: nowrap;
        font-size: clamp(12px, 3.4vw, 15px);
    }
}
.page-builder-visual-table__content .material-number-list {
    overflow-wrap: normal;
    word-break: normal;
}

/* Each site's editorial edition uses the same verified draw source. */
.material-history-window {
    margin: 10px 0; padding: 10px 12px; border: 1px solid #cbd5e1;
    background: #f1f5f9; color: #334155; font-size: 13px; line-height: 1.6;
    text-align: left; white-space: normal;
}
.material-edition { --edition-ink:#145c93; --edition-tint:#edf6fc; color:#27343d; }
.material-edition--purple-gold { --edition-ink:#69459a; --edition-tint:#f6f0fc; }
.material-edition--jade { --edition-ink:#225f4e; --edition-tint:#eff6ef; }
.material-edition-heading { padding:16px 12px; border-bottom:2px solid var(--edition-ink); text-align:left; background:var(--edition-tint); }
.material-edition-heading > span { font-size:11px; color:#65717b; }
.material-edition-heading h3 { margin:6px 0 8px; color:var(--edition-ink); font-size:21px; line-height:1.35; }
.material-edition-heading p,.material-edition-note,.material-edition-meta,.material-edition-insight { margin:8px 0; font-size:13px; line-height:1.7; overflow-wrap:anywhere; }
.material-edition-meta,.material-edition-note,.material-edition-insight { padding:0 10px; }
.material-edition-note { color:#728078; font-size:11px; }
.material-edition .material-edition-table th,.material-edition .material-edition-table td { padding:8px 5px; font-size:13px; text-align:center; border:1px solid #e0e5e9; line-height:1.65; }
.material-edition .material-edition-table th { background:var(--edition-tint); color:var(--edition-ink); }
.material-edition--main .material-edition-table th:first-child { width:28%; }
.material-edition--main .material-edition-table th:nth-child(2) { width:48%; }
.material-edition-numbers { display:inline-flex; flex-wrap:wrap; gap:3px; justify-content:center; vertical-align:middle; }
.material-edition-number { display:inline-block; min-width:22px; padding:1px 2px; border-radius:4px; line-height:24px; font-size:13px; color:#fff; }
.material-edition-number--red { background:#b83140; }
.material-edition-number--blue { background:#2765a0; }
.material-edition-number--green { background:#23744f; }
.material-edition-table td > small { display:block; font-size:11px; }
.material-edition-archive { margin-top:14px; border-top:1px solid #d9e1e7; }
.material-edition-archive-title { margin:0; padding:12px; color:var(--edition-ink); background:var(--edition-tint); font-size:13px; }
.material-edition-index { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; padding:10px; }
.material-edition-group { border:1px solid #d9e6dc; background:#fcfdfb; min-width:0; }
.material-edition-group h4 { margin:0; padding:8px; color:var(--edition-ink); font-size:17px; border-bottom:1px solid #d9e6dc; }
.material-edition-group h4 small { float:right; font-size:11px; line-height:22px; font-weight:normal; }
.material-edition-group ul { margin:0; padding:6px 8px; list-style:none; }
.material-edition-group li { display:flex; align-items:center; flex-wrap:wrap; gap:5px; padding:6px 0; font-size:12px; border-bottom:1px dotted #d9e6dc; }
.material-edition-group li:last-child { border-bottom:0; }
.material-edition-group li > small { color:#687b71; }
@media(max-width:480px) {
 .material-edition-index { grid-template-columns:1fr; padding:6px; }
 .material-edition-heading { padding:12px 8px; }
 .material-edition-heading h3 { font-size:19px; }
 .material-edition .material-edition-table th,.material-edition .material-edition-table td { font-size:12px; padding:7px 3px; }
}

/* Keep compact results in two explicit rows; flex must not flatten the balls. */
body[data-frontend-theme] .compact-result-panel {
    grid-template-columns: 70px minmax(0, 1fr);
    align-items: center;
}
body[data-frontend-theme] .compact-number-list {
    grid-template-columns: repeat(6, minmax(0, 1fr)) 26px minmax(0, 1fr);
    gap: 2px;
    align-items: center;
}
body[data-frontend-theme] .compact-number {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    height: auto;
    min-height: 48px;
    padding: 2px 0;
    text-shadow: none;
}
body[data-frontend-theme] .compact-number b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    min-height: 26px;
    padding: 0;
    margin: 0;
    font-size: 15px;
    line-height: 26px;
    font-variant-numeric: tabular-nums;
}
body[data-frontend-theme] .compact-number small {
    display: block;
    flex: 0 0 14px;
    height: 14px;
    padding: 0;
    margin: 0;
    font-size: 10px;
    line-height: 14px;
    text-align: center;
}
body[data-frontend-theme] .compact-number-list .refresh-cell {
    display: block;
    align-self: center;
    width: 26px;
    min-height: 42px;
    padding: 6px 0;
    border-radius: 3px;
    font-size: 10px;
    line-height: 14px;
    text-align: center;
}
body[data-frontend-theme] .compact-issue { gap: 3px; text-shadow: none; }
body[data-frontend-theme] .compact-issue b { line-height: 18px; white-space: nowrap; }
body[data-frontend-theme] .compact-issue small { line-height: 14px; white-space: nowrap; }
@media(max-width:600px) {
    body[data-frontend-theme] .compact-result-panel { grid-template-columns:48px minmax(0,1fr); }
}
@media(max-width:360px) {
    body[data-frontend-theme] .compact-number-list { gap:1px; grid-template-columns:repeat(6,minmax(0,1fr)) 24px minmax(0,1fr); }
    body[data-frontend-theme] .compact-number b { width:22px; height:22px; min-height:22px; flex-basis:22px; line-height:22px; font-size:13px; }
    body[data-frontend-theme] .compact-number-list .refresh-cell { width:24px; }
}

/* Taiwan draw reveal: keep existing ball geometry and site colors. */
.is-reveal-pending { background: #ddd !important; color: #222 !important; }
.is-reveal-pending [data-latest-number-value] { color: #222 !important; animation: taiwan-stir .7s ease-in-out infinite alternate; }
.taiwan-reveal-demo { position:fixed;bottom:18px;left:18px;z-index:10000;padding:10px 16px;border:0;border-radius:8px;background:#175f8d;color:white;cursor:pointer; }
@keyframes taiwan-stir { from { opacity:.45;transform:translateY(-1px); } to { opacity:1;transform:translateY(1px); } }
@media (prefers-reduced-motion:reduce) { .is-reveal-pending [data-latest-number-value] { animation:none; } }
