.portal {
  --ink: #172e36;
  --teal: #07594e;
  --muted: #546a70;
  --rule: #d9e3e0;
  --wash: #edf4f1;
  --navy: var(--teal);
  --border: var(--rule);
  min-height: 100vh;
  color: var(--ink);
  background: #f4f6f4;
  font-family: "Inter","Microsoft YaHei UI","Microsoft YaHei","PingFang SC",system-ui,sans-serif;
  font-variant-numeric: tabular-nums;
}
.portal-width { width: min(1192px,calc(100% - 64px)); margin-inline: auto; }
.skip-link { position: absolute; top: -60px; left: 12px; z-index: 4; padding: 10px; color:white; background:var(--teal); }
.skip-link:focus { top: 8px; }
.portal-header { position:sticky; top:0; z-index:5; background: #fff; border-bottom: 1px solid var(--rule); }
:root:has(.portal) { scroll-padding-top:80px; }
.portal-header-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.portal-brand { display: inline-flex; align-items: center; flex-shrink: 0; gap: 10px; }
.portal-brand strong { font-size: 21px; letter-spacing: .015em; font-weight: 800; }
.brand-symbol { display: grid; grid-template: repeat(2,12px)/repeat(2,12px); gap: 2px; transform: rotate(-11deg); }
.brand-symbol i { background: #0a5b50; border-radius: 50% 50% 50% 3px; }
.brand-symbol i:nth-child(2) { transform: rotate(90deg); background: #ca7946; }
.brand-symbol i:nth-child(3) { transform: rotate(-90deg); }
.brand-symbol i:nth-child(4) { transform: rotate(180deg); }
.portal-nav { display: flex; align-self: stretch; align-items: stretch; gap: clamp(10px,2.2vw,32px); }
.portal-nav a { display: flex; align-items: center; position: relative; white-space: nowrap; font-size: 14px; font-weight: 650; color: #485d61; }
.portal-nav a[aria-current], .portal-nav a:hover { color: var(--teal); }
.portal-nav a[aria-current]::after { content:""; position:absolute; bottom:0; left:16%; right:16%; height:3px; background:var(--teal); border-radius:2px 2px 0 0; }
.header-clock { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.header-clock time { font-weight: 700; color: var(--ink); }
.clock-face { width: 14px; height: 14px; border: 1.5px solid #69847c; border-radius: 50%; position:relative; }
.clock-face::after { content:""; position:absolute; left:5px; top:2px; width:3px; height:4px; border:solid #69847c; border-width:0 0 1px 1px; }
.masthead {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: center; min-height: 154px; margin: 22px 0 18px;
  padding: 20px clamp(22px,3vw,39px); border-radius: 14px; color: white; background-color:#092e2a;
  background-image: linear-gradient(90deg,rgba(4,34,29,.6),rgba(4,34,29,.2) 53%,transparent 72%),url("/draw-studio.webp");
  background-size: cover; background-position: center 58%;
}
.masthead-copy { position: relative; max-width: 66%; }
.masthead-copy time { display: flex; align-items: center; gap: 9px; font-size: 12px; color:#c1d6cf; letter-spacing:.05em; }
.masthead-copy time::before { content:""; width:22px; height:2px; background:#d6a172; }
.masthead h1 { margin:8px 0 6px; font-size:clamp(30px,3.2vw,46px); font-weight:730; letter-spacing:.035em; }
.masthead p { margin:0; font-size:14px; color:#d9e6e0; }
.portal:not([data-page="home"]) .masthead {
  background:none; color:var(--ink); min-height:0; margin:23px 0 17px; padding:0; border-radius:0;
}
.portal:not([data-page="home"]) .masthead-copy { max-width:100%; }
.portal:not([data-page="home"]) .masthead-copy time { display:none; }
.portal:not([data-page="home"]) .masthead h1 { font-size:clamp(24px,2.6vw,31px); margin:0 0 4px; }
.portal:not([data-page="home"]) .masthead p { color: var(--muted); }
.portal #home { display:grid; grid-template-columns:minmax(0,1fr); gap:18px; align-items:start; }
.result-board, .schedule-board {
  min-width:0; border:1px solid var(--rule); border-radius:14px; background:white; overflow:hidden;
  box-shadow:0 2px 5px #1b382c05;
}
.board-title { display:flex; gap:8px; justify-content:space-between; align-items:center; padding:18px 20px 14px; }
.board-title h2 { margin:0; font-size:19px; font-weight:750; line-height:1.3; }
.board-title>span { font-size:12px; color:#5a716c; }
.board-title #active-channel { background:#e9f3ee; color:#225e4e; border-radius:5px; padding:3px 8px; }
.history-filter {
  display:grid; grid-template-columns:116px minmax(0,1fr) auto auto; align-items:end; gap:9px; padding:0 20px 15px; border-bottom:1px solid #e4ebe7;
}
.history-filter label { font-size:12px; font-weight:600; color:#435f5c; min-width:0; gap:4px; margin:0; }
.history-filter label { grid-template-columns:minmax(0,1fr); }
.history-filter input { display:block; box-sizing:border-box; min-inline-size:0; inline-size:100%; max-inline-size:100%; border:1px solid #cad8d2; height:36px; padding:5px 9px; font-size:13px; }
.history-filter button { margin:0; height:36px; padding:0 13px; white-space:nowrap; font-size:13px; }
.history-calendar { position:relative; display:flex; align-items:center; justify-content:center; width:min(100%,116px); height:36px; padding-inline:6px; border:1px solid #cad8d2; border-radius:8px; background:#fff; color:#28463e; font-size:13px; }
.history-calendar:focus-within { outline:2px solid #368572; outline-offset:2px; }
.history-calendar input { position:absolute; inset:0; opacity:0; cursor:pointer; }
.history-calendar input::-webkit-calendar-picker-indicator { position:absolute; inset:0; width:auto; height:auto; margin:0; padding:0; cursor:pointer; }
#clear-day { background:white; border:1px solid #cad8d2; color:#46605a; }
.result-feed { padding:0 20px; }
@media(min-width:1100px) {
  .result-feed:not(:has(>.schedule-empty)) { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:18px; }
  .result-feed article:only-child { grid-column:1/-1; }
}
.result-feed .panel { margin:0; padding:17px 0; border:0; border-bottom:1px solid #e5ece8; border-radius:0; background:transparent; }
.result-feed .panel:last-child { border-bottom:0; }
.result-feed .panel h3 { font-size:18px; }
.result-feed .card-head+.muted { font-size:12px; margin:4px 0 8px; }
.result-feed .panel .draw-balls { max-width:405px; margin:12px 0 9px; }
.result-feed .draw-balls .ball { max-width:48px; }
.result-feed .panel .muted { margin:5px 0; overflow-wrap:anywhere; }
.result-feed .panel .quiet { margin-top:7px; padding:4px 0; border:0; font-size:12px; color:var(--teal); }
.result-board .page-controls { margin:0; padding:6px 12px 10px; gap:10px; font-size:12px; color:var(--muted); }
.result-board .page-controls button { padding:4px 10px; font-size:12px; border-color:#d6e1db; background:#f7faf8; color:#345b50; }
.schedule-empty { display:grid; place-items:center; align-content:center; gap:7px; min-height:177px; padding:22px 4px; text-align:center; }
.schedule-empty h3 { font-size:17px; }
.schedule-empty p { margin:0; font-size:13px; color:var(--muted); }
.calendar-symbol {
  width:40px; height:37px; position:relative; border:1.5px solid #79a396; border-radius:7px;
  margin:3px 0 7px; background:linear-gradient(#d8e9df 9px,transparent 9px),radial-gradient(circle,#8cae9c 1.5px,transparent 2px) 6px 11px/8px 8px,#f2f8f4;
  box-shadow:5px 4px 0 -1px #e7efe9; transform:rotate(-5deg);
}
.calendar-symbol::before,.calendar-symbol::after { content:""; position:absolute; top:-4px; height:8px; width:3px; border-radius:4px; background:#427d68; }
.calendar-symbol::before { left:8px; } .calendar-symbol::after { right:8px; }
.board-legend { display:flex; gap:13px; align-items:center; border-top:1px solid #e4ebe7; background:#fbfcfb; padding:10px 20px; color:#596d67; font-size:11px; }
.board-legend span { display:inline-flex; align-items:center; gap:4px; }
.board-legend i { border-radius:50%; width:7px; height:7px; }
.red-dot { background:#d14a40; }.blue-dot { background:#347dc2; }.green-dot { background:#2d9961; }
.schedule-board .board-title { padding-bottom:12px; }
.channel-shortcuts { display:flex; gap:7px; margin:0 17px 10px; }
.channel-shortcut { flex:1; border:1px solid #cadbd4; border-radius:7px; background:#fff; color:#395b52; padding:6px; font-size:12px; }
.schedule-list { padding:0 14px 13px; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:9px; }
.schedule-item {
  display:flex; align-items:center; justify-content:space-between; gap:5px; min-width:0; min-height:34px;
  padding:6px 7px; border:none; border-top:1px solid #e6ece8; border-radius:0; color:#28463e; background:white;
}
.schedule-item strong { font-size:13px; font-weight:670; }
.schedule-item time { font-size:12px; color:#587067; }
.schedule-item:hover,.channel-shortcut:hover { background:var(--wash); }
.channel-shortcut[aria-pressed=true],.schedule-item[aria-pressed=true] { background:var(--teal); color:white; border-radius:6px; }
.schedule-item[aria-pressed=true] time { color:#e0eee8; }
.choice-field { display:block; min-width:0; border:0; border-radius:0; margin:0; padding:7px 0; }
.choice-field legend { float:left; width:68px; padding:6px 4px 4px 0; font-size:12px; color:var(--muted); }
.choice-buttons { display:flex; flex-wrap:wrap; gap:5px; margin-left:70px; }
.choice-buttons button { padding:5px 9px; min-height:30px; font-size:12px; font-weight:600; color:#39534b; background:#f3f6f4; border:1px solid transparent; border-radius:6px; }
.choice-buttons button:hover { background:#e3ece7; }
.choice-buttons button[aria-pressed=true] { background:var(--teal); color:#fff; }
.portal-footer { display:flex; justify-content:space-between; align-items:center; gap:12px; border-top:1px solid var(--rule); margin-top:22px; padding:14px 0 18px; color:#60736c; font-size:12px; }
.portal-footer nav { display:flex; align-items:center; gap:12px; }
.portal a:focus-visible,.portal button:focus-visible,.portal input:focus-visible { outline:3px solid #368572; outline-offset:2px; }
.portal-footer a:hover,.source-line a:hover { color:var(--teal); text-decoration:underline; }
@media(max-width:985px) {
  .portal-width { width:calc(100% - 36px); }
  .portal-header-inner { gap:12px; min-height:58px; }
  .header-clock { display:none; }
  .portal #home { gap:12px; }
  .masthead { min-height:134px; margin:14px 0; }
  .board-title { padding:15px 14px 12px; }
  .history-filter { padding:0 14px 13px; gap:6px; }
  .history-filter button { padding:0 9px; }
  .result-feed { padding:0 14px; }
  .channel-shortcuts { margin-inline:10px; }
  .schedule-list { padding-inline:8px; column-gap:4px; }
}
@media(max-width:720px) {
  .portal-width { width:calc(100% - 24px); }
  .portal-header-inner { display:grid; grid-template-columns:1fr auto; gap:0; padding-top:10px; }
  .portal-brand { gap:8px; }
  .portal-brand strong { font-size:18px; }
  .brand-symbol { grid-template:repeat(2,10px)/repeat(2,10px); }
  .header-clock { display:flex; grid-column:2; grid-row:1; }
  .portal-nav { grid-column:1/-1; display:grid; grid-template-columns:repeat(5,1fr); gap:0; margin-top:3px; }
  .portal-nav a { font-size:12px; justify-content:center; min-height:42px; padding:9px 0; }
  .masthead { min-height:105px; margin:10px 0; padding:13px 16px; border-radius:10px; background-position:center 55%; }
  .masthead-copy { max-width:74%; }
  .masthead h1 { font-size:27px; margin:5px 0 0; }
  .masthead-copy time { font-size:11px; }
  .portal[data-page=home] .masthead p { display:none; }
  .portal #home { grid-template-columns:minmax(0,1fr); gap:10px; }
  .board-title { padding:12px 12px 8px; }
  .board-title h2 { font-size:17px; }
  .history-filter { gap:8px; padding:0 12px 10px; }
  .history-filter input { height:36px; padding:3px 7px; font-size:16px; }
  .schedule-empty { min-height:112px; padding:10px 0; gap:3px; }
  .calendar-symbol { width:27px; height:23px; margin-bottom:5px; }
  .schedule-empty h3 { font-size:15px; }.schedule-empty p { font-size:12px; }
  .board-legend { padding:7px 12px; }
  .channel-shortcuts { margin:0 10px 7px; }
  .schedule-list { padding-inline:10px; }
  .portal-footer { margin-top:14px; }
}
.schedule-board .schedule-list { gap:12px; }
.schedule-board .schedule-item {
  flex-direction:column; align-items:center; justify-content:center;
  gap:4px; min-height:62px; padding:8px; border:1px solid #c9dbd3; border-radius:8px;
}
.schedule-board .schedule-item strong { font-size:15px; }
.schedule-board .schedule-item time { font-size:14px; font-variant-numeric:tabular-nums; }
@media(max-width:420px) {
  .portal-nav a span { display:none; }
  .portal-nav a { font-size:13px; }
  .choice-field legend { width:48px; }
  .choice-buttons { margin-left:50px; }
}

.board-title #next-draw {
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  align-items:center;
  gap:4px 10px;
  text-align:right;
  color:#134c41;
}
.next-draw-schedule { font-size:clamp(14px,2.1vw,17px); font-weight:750; }
.next-draw-countdown {
  font-size:clamp(20px,3vw,28px);
  font-weight:800;
  line-height:1.15;
  color:#07564b;
  font-variant-numeric:tabular-nums;
}
#today-results { min-width:0; }
@media (max-width:460px) {
  .board-title:has(#next-draw) { flex-wrap:wrap; }
  .board-title #next-draw { width:100%; justify-content:space-between; text-align:left; }
}
#history-board { scroll-margin-top:150px; }
#history-board .result-feed .panel { padding:9px 0; }
#history-board .result-feed .panel h3 { font-size:15px; }
#history-board .result-feed .panel .draw-balls { max-width:246px; margin:4px 0 2px; gap:4px; padding-inline:0; }
#history-board .draw-balls .ball { max-width:30px; }
#history-board .draw-balls .ball-face { font-size:13px; }
#history-board .draw-balls small { font-size:11px; line-height:14px; }
#history-board .draw-balls .plus { font-size:17px; }
.history-order { display:flex; gap:7px; padding:8px 12px 0; }
.history-order button { background:#f4f8f6; color:#345b50; border-color:#d4e4dc; min-height:36px; }
.history-order button[aria-pressed="true"] { background:#0c5e51; color:white; border-color:#0c5e51; }
@media (max-width:479px) {
  .history-filter { grid-template-columns:116px minmax(0,1fr); }
  .history-filter button { grid-row:2; height:36px; }
  .history-filter #clear-day { justify-self:start; }
}
.live-ball-strip .waiting-ball {
  display:grid;
  width:100%;
  max-width:48px;
  aspect-ratio:1;
  place-items:center;
  color:#547468;
}
