:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --line: #dfe7f1;
  --text: #17233d;
  --muted: #6c7b91;
  --gold: #d9961d;
  --green: #1e73e8;
  --primary: #1e73e8;
  --primary-deep: #164aa8;
  --primary-soft: #eaf3ff;
  --success: #1da86f;
  --shadow: 0 14px 38px rgba(28, 55, 95, .09);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(64, 145, 255, .12), transparent 34rem),
    radial-gradient(circle at 94% 20%, rgba(30, 115, 232, .08), transparent 29rem),
    var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}
main { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 30px 0 36px; }
.hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 28px 30px;
  color: #fff;
  border-radius: 22px;
  background: linear-gradient(130deg, #17499f 0%, #1e73e8 56%, #52a3ff 100%);
  box-shadow: 0 20px 46px rgba(22, 74, 168, .2);
}
.hero-actions { display: grid; justify-items: end; gap: 12px; }
.view-mode-switch {
  display: flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .13);
}
.view-mode-switch button { padding: 7px 11px; color: rgba(255,255,255,.8); border-color: transparent; background: transparent; font-size: 12px; }
.view-mode-switch button.active {
  color: var(--primary-deep);
  background: #fff;
  border-color: #fff;
}
.language-label { min-width: 150px; }
.language-label span { font-size: 12px; }
.eyebrow { color: #d9ebff; font-size: 12px; letter-spacing: .22em; margin: 0 0 8px; }
h1 { font-family: "STSong", "SimSun", serif; font-size: clamp(44px, 8vw, 88px); font-weight: 500; line-height: 1; margin: 0; }
.sub, .muted, .section-title > p, footer { color: var(--muted); }
.hero .sub, .hero .status, .hero label { color: rgba(255,255,255,.8); }
.sub { margin: 14px 0 0; letter-spacing: .12em; }
.status { display: flex; gap: 9px; align-items: center; padding-bottom: 8px; color: var(--muted); }
.status span { width: 9px; height: 9px; background: #62e5ad; border-radius: 50%; box-shadow: 0 0 16px rgba(98,229,173,.8); }
.card { border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); }
.schedule { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 18px; overflow: hidden; }
.schedule div { padding: 18px 22px; border-right: 1px solid var(--line); }
.schedule div:last-child { border-right: 0; }
.schedule span, .label { display: block; color: var(--muted); font-size: 13px; margin: 0 0 8px; }
.schedule strong { font-size: 22px; font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 18px; }
.grid .card { min-height: 175px; padding: 25px; }
h2 { font-size: 26px; margin: 0 0 12px; font-weight: 550; }
.muted { font-size: 14px; line-height: 1.7; margin: 0; }
.section-title { display: flex; justify-content: space-between; align-items: end; padding: 28px 28px 18px; }
.section-title > p { font-size: 13px; margin: 0 0 12px; }
.tiers { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--line); }
.tiers div { padding: 20px 14px; min-height: 132px; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.tiers div:last-child { border-right: 0; }
.tiers b { font-size: 15px; }
.tiers span { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 10px 0 auto; }
.tiers em { color: var(--gold); font-size: 20px; font-style: normal; }
footer { text-align: center; font-size: 12px; padding-top: 28px; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button {
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #3c91f5);
  font-weight: 700;
  cursor: pointer;
}
button:disabled { cursor: wait; opacity: .55; }
button.ghost {
  color: var(--primary-deep);
  background: #fff;
  border: 1px solid var(--line);
}
button.danger { color: #fff; background: #a43f3f; }
input, select {
  width: 100%;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 13px;
  outline: none;
}
input:focus, select:focus { border-color: rgba(30, 115, 232, .7); box-shadow: 0 0 0 3px rgba(30, 115, 232, .1); }
.hero select { color: var(--primary-deep); background: #fff; border-color: rgba(255,255,255,.7); }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; }
.login-layout { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.login-layout.portal-single { grid-template-columns: minmax(320px, 520px); justify-content: center; }
.login-layout.member-entry { grid-template-columns: minmax(360px, .9fr) minmax(420px, 1.1fr); }
.login-card, .rules-summary { padding: 28px; }
.login-card form { display: grid; gap: 15px; margin-top: 24px; }
.auth-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 24px;
  padding: 4px;
  border: 1px solid #cfe2fb;
  border-radius: 12px;
  background: var(--primary-soft);
}
.auth-mode-tab { color: var(--primary-deep); background: transparent; box-shadow: none; }
.auth-mode-tab.active { color: #fff; background: linear-gradient(135deg, var(--primary), #3c91f5); }
.rules-summary { display: flex; flex-direction: column; justify-content: center; }
.mini-tiers { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.mini-tiers span, .badge {
  color: var(--primary-deep);
  background: var(--primary-soft);
  border: 1px solid #cfe2fb;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
}
.form-message { min-height: 20px; margin: 0; color: var(--gold); font-size: 13px; }
.account-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  margin-bottom: 18px;
}
.account-bar strong { margin-right: 10px; }
.member-summary { grid-template-columns: repeat(3, 1fr); }
.deposit-network { font-size: 18px; }
.address-value {
  color: var(--gold);
  overflow-wrap: anywhere;
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 12px;
  line-height: 1.6;
}
.bet-card, .management-card, .table-card { margin-bottom: 18px; }
.draw-card { margin-bottom: 18px; overflow: hidden; }
.test-label { color: var(--gold) !important; }
.draw-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 34px;
  align-items: stretch;
  min-height: 230px;
  padding: 30px 28px 34px;
  border-top: 1px solid var(--line);
  background:
    radial-gradient(circle at 18% 35%, rgba(78, 157, 255, .14), transparent 20rem),
    linear-gradient(135deg, #f7fbff, #eef5fd);
}
.draw-machine { display: grid; justify-items: center; }
.machine-drum {
  position: relative;
  width: 190px;
  height: 190px;
  overflow: hidden;
  border: 9px solid #78b5fa;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 35%, #ffffff, #ddebfb 68%, #c1daf6);
  box-shadow: inset 0 0 28px rgba(255,255,255,.85), 0 12px 30px rgba(27,91,173,.16);
}
.machine-drum::before, .machine-drum::after {
  content: "";
  position: absolute;
  inset: 18%;
  border: 1px dashed rgba(30,115,232,.23);
  border-radius: 50%;
}
.machine-drum::after { inset: 34%; }
.machine-balls {
  position: absolute;
  inset: 25px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 18% 70%, #f26f72 0 7px, transparent 8px),
    radial-gradient(circle at 30% 55%, #42ba7a 0 7px, transparent 8px),
    radial-gradient(circle at 47% 75%, #d85b5b 0 7px, transparent 8px),
    radial-gradient(circle at 61% 52%, #6d9fe9 0 7px, transparent 8px),
    radial-gradient(circle at 77% 68%, #4d9af2 0 7px, transparent 8px),
    radial-gradient(circle at 50% 38%, #42ba7a 0 7px, transparent 8px);
}
.draw-stage.playing .machine-balls { animation: tumble .55s linear infinite; }
.machine-base {
  width: 145px;
  margin-top: -4px;
  padding: 13px 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-deep), #4b9cf7);
  text-align: center;
  font-weight: 900;
  letter-spacing: .25em;
  clip-path: polygon(12% 0, 88% 0, 100% 100%, 0 100%);
}
.draw-display { min-width: 0; }
.latest-draw-display { display: flex; flex-direction: column; justify-content: center; }
.latest-draw-caption { margin: 0 0 6px; color: var(--primary); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.latest-draw-display h3 { margin: 0; color: var(--primary-deep); font-size: 18px; }
.draw-ball-track { display: flex; flex-wrap: wrap; gap: 18px; min-height: 88px; margin: 22px 0 24px; }
.draw-ball {
  display: grid;
  place-items: center;
  position: relative;
  width: 54px;
  height: 54px;
  --ball: #4b98ef;
  --ball-light: #9bcafd;
  --ball-dark: #1f62b0;
  border: 1px solid var(--ball-dark);
  border-radius: 50%;
  color: #17212f;
  background:
    radial-gradient(ellipse at 31% 17%, rgba(255,255,255,.96) 0 5%, rgba(255,255,255,.55) 6%, transparent 14%),
    radial-gradient(circle at 50% 51%, #fff 0 38%, #f6f7f8 39% 42%, #d7dce2 43%, transparent 45%),
    radial-gradient(circle at 35% 28%, var(--ball-light) 0%, var(--ball) 53%, var(--ball-dark) 100%);
  box-shadow: inset 2px 2px 4px rgba(255,255,255,.45), inset -2px -3px 5px rgba(16,39,65,.22), 0 2px 5px rgba(29,55,89,.22);
  font-size: 17px;
  font-weight: 900;
  text-shadow: none;
  transform: translateY(-12px) scale(.6);
  opacity: 0;
}
.draw-ball.revealed { animation: revealBall .5s ease-out forwards; }
.draw-ball span { line-height: 1; }
.draw-ball small { position: absolute; top: 59px; left: 50%; display: block; width: 54px; color: var(--ball-dark); font-size: 13px; font-weight: 800; line-height: 1; text-align: center; transform: translateX(-50%); }
.draw-ball.red { --ball: #ef4d57; --ball-light: #ff9b9c; --ball-dark: #be2631; }
.draw-ball.blue { --ball: #3a86d8; --ball-light: #8bc2fb; --ball-dark: #2164ad; }
.draw-ball.green { --ball: #2da96a; --ball-light: #7edba9; --ball-dark: #167747; }
.draw-ball.special { outline: 3px solid #e5b54e; outline-offset: 2px; box-shadow: inset 2px 2px 4px rgba(255,255,255,.45), inset -2px -3px 5px rgba(16,39,65,.22), 0 0 0 5px #fff0c6, 0 3px 7px rgba(29,55,89,.22); }
.draw-ball.special::before { content: "+"; position: absolute; top: 15px; left: -20px; color: #7b8796; font-size: 18px; font-weight: 500; }
.draw-countdown-panel {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 24px;
  border: 1px solid #d8e5f4;
  border-radius: 16px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 10px 26px rgba(30, 88, 165, .08);
  text-align: center;
}
.draw-countdown-panel p { margin: 0; color: var(--primary-deep); font-size: 13px; font-weight: 800; }
.draw-countdown {
  padding: 10px 14px;
  color: #16243c;
  border: 1px solid #cfdae8;
  border-radius: 10px;
  background: #fff;
  box-shadow: inset 0 -2px 0 rgba(18, 47, 86, .06);
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 31px;
  line-height: 1;
  letter-spacing: .1em;
  white-space: nowrap;
}
.draw-countdown-panel small { color: var(--muted); font-size: 11px; }
.draw-countdown-panel button { min-width: 126px; padding: 9px 16px; }
.draw-history-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 28px 12px; border-top: 1px solid var(--line); }
.draw-history-heading h3 { margin: 0; font-size: 16px; }
.draw-history-heading span { color: var(--muted); font-size: 12px; }
.draw-history-table th:nth-child(3) { min-width: 420px; }
.draw-history-table tbody tr { height: 88px; }
.draw-history-issue { color: #d43232; font-size: 14px; }
.draw-history-time { color: #53657d; font-size: 12px; white-space: nowrap; }
.history-draw-numbers { display: flex; align-items: center; gap: 9px; min-height: 56px; }
.history-draw-ball {
  --ball: #4b98ef;
  --ball-light: #9bcafd;
  --ball-dark: #1f62b0;
  position: relative;
  display: grid;
  flex: 0 0 42px;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #17212f;
  border: 1px solid var(--ball-dark);
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 31% 17%, rgba(255,255,255,.96) 0 5%, rgba(255,255,255,.55) 6%, transparent 14%),
    radial-gradient(circle at 50% 51%, #fff 0 38%, #f6f7f8 39% 42%, #d7dce2 43%, transparent 45%),
    radial-gradient(circle at 35% 28%, var(--ball-light) 0%, var(--ball) 53%, var(--ball-dark) 100%);
  box-shadow: inset 2px 2px 4px rgba(255,255,255,.45), inset -2px -3px 5px rgba(16,39,65,.22), 0 2px 5px rgba(29,55,89,.2);
}
.history-draw-ball strong { font-size: 14px; line-height: 1; }
.history-draw-ball small { position: absolute; top: 45px; left: 50%; width: 42px; color: var(--ball-dark); font-size: 11px; font-weight: 800; line-height: 1; text-align: center; transform: translateX(-50%); }
.history-draw-ball.red { --ball: #ef4d57; --ball-light: #ff9b9c; --ball-dark: #be2631; }
.history-draw-ball.blue { --ball: #3a86d8; --ball-light: #8bc2fb; --ball-dark: #2164ad; }
.history-draw-ball.green { --ball: #2da96a; --ball-light: #7edba9; --ball-dark: #167747; }
.history-draw-ball.special { outline: 2px solid #e5b54e; outline-offset: 2px; box-shadow: inset 2px 2px 4px rgba(255,255,255,.45), inset -2px -3px 5px rgba(16,39,65,.22), 0 0 0 4px #fff0c6; }
.history-draw-plus { margin: 0 -2px 0 1px; color: #d43232; font-size: 20px; }
.ticket-number-balls { min-width: 370px; min-height: 64px; padding: 4px 0 12px; }
.ticket-legacy-special { color: var(--muted); font-size: 12px; white-space: nowrap; }
.draw-replay-row { min-width: 84px; padding: 8px 12px; background: linear-gradient(135deg, #bd3131, #e34a43); font-size: 12px; }
.draw-control-form {
  grid-template-columns: minmax(170px, .8fr) minmax(560px, 3fr) auto auto;
  align-items: center;
}
.draw-control-form > select,
.draw-control-form > button,
.draw-number-field input { height: 50px; }
.draw-number-sequence {
  display: grid;
  grid-template-columns: repeat(7, minmax(58px, 1fr));
  gap: 8px;
  transform: translateY(-9px);
}
.draw-number-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.draw-number-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
.draw-number-field input {
  width: 100%;
  min-width: 0;
  padding: 11px 5px;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
}
.draw-number-field.special input {
  border-color: rgba(217, 150, 29, .65);
  box-shadow: 0 0 0 3px rgba(217, 150, 29, .1);
}
.draw-auto-help {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--gold);
  font-size: 12px;
}
.draw-preset-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.draw-preset-heading h3, .draw-preset-heading p { margin: 0; }
.draw-preset-heading p { margin-top: 4px; }
.draw-preset-table { margin-top: 10px; }
.draw-preset-numbers { white-space: nowrap; font-weight: 800; color: var(--primary-deep); }
.draw-preset-state { white-space: nowrap; }
.draw-preset-edit { min-width: 74px; padding: 8px 12px; font-size: 12px; }
@keyframes tumble { to { transform: rotate(360deg); } }
@keyframes revealBall { to { transform: translateY(0) scale(1); opacity: 1; } }
.number-grid {
  display: grid;
  grid-template-columns: repeat(14, 38px);
  column-gap: 10px;
  row-gap: 27px;
  align-items: center;
  padding: 4px 28px 28px;
}
.pick-section + .pick-section { border-top: 1px solid var(--line); }
.prize-rules {
  margin: 0 28px 18px;
  border: 1px solid #d7e4f3;
  border-radius: 12px;
  background: #f7fbff;
}
.prize-rules summary { padding: 12px 14px; color: var(--primary-deep); cursor: pointer; font-size: 13px; font-weight: 800; }
.prize-rule-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0 14px 14px; }
.prize-rule-list span { padding: 8px 10px; color: #49617f; border: 1px solid #dce8f5; border-radius: 8px; background: #fff; font-size: 11px; line-height: 1.45; }
.pick-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 28px 14px;
}
.pick-heading h3 { margin: 0; font-size: 15px; font-weight: 600; }
.pick-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.selection-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px 20px;
}
.selected-sequence { display: grid; grid-template-columns: repeat(6, 56px) 68px; gap: 8px; }
.selection-slot {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 0;
  padding: 7px 5px;
  color: var(--ball-dark, var(--muted));
  border: 1px solid #d5e2f0;
  border-radius: 9px;
  background: #f7fbff;
}
.selection-slot small { font-size: 9px; font-weight: 700; white-space: nowrap; }
.selection-slot strong { color: #17212f; font-size: 15px; line-height: 1; }
.selection-slot.empty { color: #9aa8ba; border-style: dashed; background: #f8fafc; }
.selection-slot.special { margin-left: 8px; border-color: #e5b54e; background: #fff9e8; }
.selection-slot.special::before { content: "+"; position: absolute; left: -14px; top: 50%; color: #7b8796; font-size: 15px; transform: translateY(-50%); }
.selection-slot.red { --ball: #ef4d57; --ball-light: #ff9b9c; --ball-dark: #be2631; }
.selection-slot.blue { --ball: #3a86d8; --ball-light: #8bc2fb; --ball-dark: #2164ad; }
.selection-slot.green { --ball: #2da96a; --ball-light: #7edba9; --ball-dark: #167747; }
.selection-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; white-space: nowrap; }
.selection-actions .ghost { padding: 9px 14px; }
.delete-last-number {
  padding: 9px 18px;
  color: #a43f3f;
  border: 1px solid #e8baba;
  background: #fff;
  white-space: nowrap;
}
.delete-last-number:hover:not(:disabled) { color: #fff; background: #a43f3f; }
.number-grid button {
  --ball: #4b98ef;
  --ball-light: #9bcafd;
  --ball-dark: #1f62b0;
  width: 38px;
  height: 38px;
  aspect-ratio: auto;
  position: relative;
  justify-self: center;
  padding: 0;
  border-radius: 50%;
  color: #17212f;
  background:
    radial-gradient(ellipse at 31% 17%, rgba(255,255,255,.98) 0 5%, rgba(255,255,255,.58) 6%, transparent 14%),
    radial-gradient(circle at 50% 51%, #fff 0 38%, #f6f7f8 39% 42%, #d7dce2 43%, transparent 45%),
    radial-gradient(circle at 35% 28%, var(--ball-light) 0%, var(--ball) 53%, var(--ball-dark) 100%);
  border: 1px solid var(--ball-dark);
  box-shadow: inset 2px 2px 4px rgba(255,255,255,.46), inset -2px -3px 5px rgba(16,39,65,.22), 0 2px 5px rgba(29,55,89,.22);
  font-size: 13px;
  font-weight: 900;
  text-shadow: none;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.number-grid .number-value { display: block; line-height: 1; }
.number-grid .number-zodiac {
  position: absolute;
  top: 41px;
  left: 50%;
  display: block;
  width: 40px;
  color: var(--ball-dark);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  text-shadow: none;
  transform: translateX(-50%);
  pointer-events: none;
}
.number-grid button::before {
  content: none;
}
.number-grid button.red { --ball: #ef4d57; --ball-light: #ff9b9c; --ball-dark: #be2631; }
.number-grid button.blue { --ball: #3a86d8; --ball-light: #8bc2fb; --ball-dark: #2164ad; }
.number-grid button.green { --ball: #2da96a; --ball-light: #7edba9; --ball-dark: #167747; }
.number-grid button:hover { transform: translateY(-2px); filter: brightness(1.02); }
.number-grid button.selected {
  color: #17212f;
  border-color: var(--ball);
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: inset 2px 2px 4px rgba(255,255,255,.46), inset -2px -3px 5px rgba(16,39,65,.22), 0 0 0 4px rgba(30,115,232,.11), 0 3px 7px rgba(29,55,89,.22);
  transform: translateY(-2px);
}
.number-grid button.selected::after {
  content: none;
}
.number-grid button.special-selected {
  color: #17212f;
  border-color: var(--ball);
  outline: 3px solid #e5b54e;
  outline-offset: 2px;
  box-shadow: inset 2px 2px 4px rgba(255,255,255,.46), inset -2px -3px 5px rgba(16,39,65,.22), 0 0 0 5px #fff0c6, 0 3px 7px rgba(29,55,89,.22);
}
.number-grid button[data-order]::after {
  content: attr(data-order);
  position: absolute;
  top: -8px;
  right: -7px;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--primary);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}
.number-grid button.special-selected[data-order]::after { background: #d9961d; }
.number-grid button:disabled {
  cursor: not-allowed;
  opacity: .2;
}
.ticket-controls {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 16px;
  align-items: end;
  padding: 22px 28px;
  border-top: 1px solid var(--line);
}
.ticket-controls > div { display: grid; gap: 5px; }
.ticket-controls > div span { color: var(--muted); font-size: 12px; }
.ticket-controls .form-message { grid-column: 1 / -1; }
.report-refresh-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.report-refresh-meta p { margin: 0; color: var(--muted); font-size: 12px; }
.report-refresh-meta button { padding: 8px 11px; font-size: 12px; white-space: nowrap; }
.path-label { margin: -8px 28px 18px; color: var(--muted); font-size: 13px; }
.node-list { border-top: 1px solid var(--line); }
.node-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 15px 28px;
  border-bottom: 1px solid var(--line);
}
.node-item > div { display: flex; align-items: center; gap: 12px; }
.node-item span { color: var(--muted); font-size: 12px; }
.node-item em { color: var(--gold); font-style: normal; }
.node-item button { padding: 8px 11px; font-size: 12px; }
.inline-form {
  display: grid;
  grid-template-columns: repeat(5, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 24px 28px 28px;
}
.inline-form h3, .inline-form .form-message { grid-column: 1 / -1; }
.inline-form h3 { margin: 0 0 4px; font-size: 15px; font-weight: 500; }
.compact-form { border-top: 1px solid var(--line); grid-template-columns: auto 1fr; justify-content: start; }
.address-import-form { grid-template-columns: minmax(360px, 1fr) auto; }
.address-import-form textarea { min-height: 120px; resize: vertical; font-family: ui-monospace, "Cascadia Mono", monospace; }
.referral-item { align-items: flex-start; }
.referral-item > div:first-child { min-width: 0; flex: 1; align-items: flex-start; flex-direction: column; }
.referral-url {
  max-width: 100%;
  color: var(--gold);
  overflow-wrap: anywhere;
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 12px;
}
.transfer-form { grid-template-columns: 3fr 2fr auto; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 13px 18px; border-top: 1px solid var(--line); text-align: left; font-size: 13px; }
th { color: #49617f; background: #f4f8fd; font-weight: 600; }
tbody tr:hover { background: #f8fbff; }
td.numbers { color: var(--primary-deep); font-family: ui-monospace, monospace; font-weight: 700; }
.empty { color: var(--muted); text-align: center; padding: 26px; }
.commission-rate-input { width: 110px; min-width: 90px; }
.form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 28px 28px;
  border-top: 1px solid var(--line);
}
.commission-summary-grid {
  grid-template-columns: repeat(4, 1fr);
  padding: 0 28px 22px;
  margin-bottom: 0;
}
.report-filter {
  display: grid;
  grid-template-columns: minmax(130px, 180px) minmax(150px, 190px) minmax(170px, 1fr) auto minmax(180px, auto);
  gap: 10px;
  align-items: center;
  padding: 0 28px 20px;
}
.report-filter .path-label { margin: 0; }
.ledger-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0 28px 20px;
  margin-bottom: 0;
}
.ledger-summary-grid .metric-panel { min-height: 92px; }
.compact-ledger { margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.compact-ledger table { min-width: 560px; }
.metric-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, #ffffff, #f5f9fe);
}
.metric-panel p { margin: 0 0 8px; }
.metric-panel h3 { margin: 0; color: var(--primary-deep); font-size: 18px; }

@media (max-width: 760px) {
  body:not(.view-desktop) main { padding-top: 32px; }
  body:not(.view-desktop) .hero { align-items: start; }
  body:not(.view-desktop) .hero-actions { min-width: 132px; }
  body:not(.view-desktop) .language-label { min-width: 132px; }
  body:not(.view-desktop) .status { padding-top: 7px; }
  body:not(.view-desktop) .sub { letter-spacing: .04em; }
  body:not(.view-desktop) .schedule { grid-template-columns: repeat(2, 1fr); }
  body:not(.view-desktop) .schedule div:nth-child(2) { border-right: 0; }
  body:not(.view-desktop) .schedule div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  body:not(.view-desktop) .grid { grid-template-columns: 1fr; }
  body:not(.view-desktop) .commission-summary-grid { grid-template-columns: 1fr; }
  body:not(.view-desktop) .report-filter { grid-template-columns: 1fr; padding: 0 16px 18px; }
  body:not(.view-desktop) .ledger-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 16px 18px; }
  body:not(.view-desktop) .draw-stage { grid-template-columns: 1fr; text-align: center; padding: 22px 16px; }
  body:not(.view-desktop) .draw-ball-track { justify-content: center; }
  body:not(.view-desktop) .draw-stage { gap: 18px; }
  body:not(.view-desktop) .latest-draw-display { align-items: center; }
  body:not(.view-desktop) .draw-ball-track { gap: 12px; min-height: 68px; }
  body:not(.view-desktop) .draw-ball { width: 40px; height: 40px; font-size: 13px; }
  body:not(.view-desktop) .draw-ball small { top: 44px; width: 42px; font-size: 11px; font-weight: 800; }
  body:not(.view-desktop) .draw-ball.special::before { top: 10px; left: -14px; font-size: 15px; }
  body:not(.view-desktop) .draw-countdown-panel { width: 100%; padding: 18px; }
  body:not(.view-desktop) .draw-countdown { font-size: 26px; }
  body:not(.view-desktop) .draw-history-heading { align-items: flex-start; flex-direction: column; gap: 4px; padding: 16px; }
  body:not(.view-desktop) .draw-history-table table,
  body:not(.view-desktop) .draw-history-table tbody { display: block; width: 100%; }
  body:not(.view-desktop) .draw-history-table table { min-width: 0; }
  body:not(.view-desktop) .draw-history-table thead { display: none; }
  body:not(.view-desktop) .draw-history-table tr { display: grid; grid-template-columns: 1fr; gap: 8px; height: auto; padding: 14px 16px 18px; border-top: 1px solid var(--line); }
  body:not(.view-desktop) .draw-history-table td { display: block; width: 100%; min-width: 0; padding: 0; border: 0; }
  body:not(.view-desktop) .draw-history-table td:nth-child(3),
  body:not(.view-desktop) .draw-history-table td:nth-child(4) { grid-column: 1 / -1; }
  body:not(.view-desktop) .draw-history-table td:nth-child(4) { justify-self: end; }
  body:not(.view-desktop) .history-draw-numbers { justify-content: center; gap: 5px; padding: 5px 0 7px; }
  body:not(.view-desktop) .history-draw-ball { flex-basis: 36px; width: 36px; height: 36px; }
  body:not(.view-desktop) .history-draw-ball strong { font-size: 12px; }
  body:not(.view-desktop) .history-draw-ball small { top: 39px; width: 38px; font-size: 10px; font-weight: 800; }
  body:not(.view-desktop) .draw-control-form { grid-template-columns: 1fr; }
  body:not(.view-desktop) .draw-number-sequence { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body:not(.view-desktop) .tiers { grid-template-columns: repeat(2, 1fr); }
  body:not(.view-desktop) .tiers div { border-bottom: 1px solid var(--line); }
  body:not(.view-desktop) .section-title > p { display: none; }
  body:not(.view-desktop) .report-refresh-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
  body:not(.view-desktop) .report-refresh-meta p { display: block; }
  body:not(.view-desktop) .login-layout { grid-template-columns: 1fr; }
  body:not(.view-desktop) .number-grid { grid-template-columns: repeat(7, 1fr); padding: 4px 16px 36px; column-gap: 7px; row-gap: 26px; }
  body:not(.view-desktop) .pick-heading { align-items: start; padding: 18px 16px 12px; }
  body:not(.view-desktop) .selection-strip { align-items: stretch; flex-wrap: wrap; padding: 0 16px 16px; }
  body:not(.view-desktop) .selected-sequence { width: 100%; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
  body:not(.view-desktop) .selection-slot { padding: 6px 2px; }
  body:not(.view-desktop) .selection-slot small { font-size: 8px; }
  body:not(.view-desktop) .selection-slot.special { margin-left: 3px; }
  body:not(.view-desktop) .selection-slot.special::before { left: -7px; font-size: 12px; }
  body:not(.view-desktop) .delete-last-number { margin-left: auto; }
  body:not(.view-desktop) .prize-rules { margin: 0 16px 16px; }
  body:not(.view-desktop) .prize-rule-list { grid-template-columns: 1fr; }
  body:not(.view-desktop) .ticket-controls { grid-template-columns: 1fr 1fr; padding: 18px 16px; }
  body:not(.view-desktop) .ticket-controls button { grid-column: 1 / -1; }
  body:not(.view-desktop) .inline-form { grid-template-columns: 1fr; padding: 20px 16px; }
  body:not(.view-desktop) .inline-form h3,
  body:not(.view-desktop) .inline-form .form-message { grid-column: auto; }
  body:not(.view-desktop) .node-item { padding: 14px 16px; align-items: start; }
  body:not(.view-desktop) .node-item > div { align-items: start; flex-direction: column; }
}

body.view-desktop { min-width: 1120px; }
body.view-mobile main { width: min(430px, calc(100% - 24px)); padding-top: 32px; }
body.view-mobile .hero { align-items: start; }
body.view-mobile .hero-actions { min-width: 132px; }
body.view-mobile .language-label { min-width: 132px; }
body.view-mobile .status { padding-top: 7px; }
body.view-mobile .sub { letter-spacing: .04em; }
body.view-mobile .schedule { grid-template-columns: repeat(2, 1fr); }
body.view-mobile .schedule div:nth-child(2) { border-right: 0; }
body.view-mobile .schedule div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
body.view-mobile .grid { grid-template-columns: 1fr; }
body.view-mobile .report-filter { grid-template-columns: 1fr; padding: 0 16px 18px; }
body.view-mobile .report-filter .path-label { margin: 0; }
body.view-mobile .draw-stage { grid-template-columns: 1fr; text-align: center; padding: 22px 16px; }
body.view-mobile .draw-ball-track { justify-content: center; }
body.view-mobile .draw-stage { gap: 18px; }
body.view-mobile .latest-draw-display { align-items: center; }
body.view-mobile .draw-ball-track { gap: 12px; min-height: 68px; }
body.view-mobile .draw-ball { width: 40px; height: 40px; font-size: 13px; }
body.view-mobile .draw-ball small { top: 44px; width: 42px; font-size: 11px; font-weight: 800; }
body.view-mobile .draw-ball.special::before { top: 10px; left: -14px; font-size: 15px; }
body.view-mobile .draw-countdown-panel { width: 100%; padding: 18px; }
body.view-mobile .draw-countdown { font-size: 26px; }
body.view-mobile .draw-history-heading { align-items: flex-start; flex-direction: column; gap: 4px; padding: 16px; }
body.view-mobile .draw-history-table table,
body.view-mobile .draw-history-table tbody { display: block; width: 100%; }
body.view-mobile .draw-history-table table { min-width: 0; }
body.view-mobile .draw-history-table thead { display: none; }
body.view-mobile .draw-history-table tr { display: grid; grid-template-columns: 1fr; gap: 8px; height: auto; padding: 14px 16px 18px; border-top: 1px solid var(--line); }
body.view-mobile .draw-history-table td { display: block; width: 100%; min-width: 0; padding: 0; border: 0; }
body.view-mobile .draw-history-table td:nth-child(3),
body.view-mobile .draw-history-table td:nth-child(4) { grid-column: 1 / -1; }
body.view-mobile .draw-history-table td:nth-child(4) { justify-self: end; }
body.view-mobile .history-draw-numbers { justify-content: center; gap: 5px; padding: 5px 0 7px; }
body.view-mobile .history-draw-ball { flex-basis: 36px; width: 36px; height: 36px; }
body.view-mobile .history-draw-ball strong { font-size: 12px; }
body.view-mobile .history-draw-ball small { top: 39px; width: 38px; font-size: 10px; font-weight: 800; }
body.view-mobile .draw-control-form { grid-template-columns: 1fr; }
body.view-mobile .draw-number-sequence { grid-template-columns: repeat(4, minmax(0, 1fr)); }
body.view-mobile .tiers { grid-template-columns: repeat(2, 1fr); }
body.view-mobile .tiers div { border-bottom: 1px solid var(--line); }
body.view-mobile .section-title > p { display: none; }
body.view-mobile .report-refresh-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
body.view-mobile .report-refresh-meta p { display: block; }
body.view-mobile .login-layout { grid-template-columns: 1fr; }
body.view-mobile .number-grid { grid-template-columns: repeat(7, 1fr); padding: 4px 16px 36px; column-gap: 7px; row-gap: 26px; }
body.view-mobile .pick-heading { align-items: start; padding: 18px 16px 12px; }
body.view-mobile .selection-strip { align-items: stretch; flex-wrap: wrap; padding: 0 16px 16px; }
body.view-mobile .selected-sequence { width: 100%; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
body.view-mobile .selection-slot { padding: 6px 2px; }
body.view-mobile .selection-slot small { font-size: 8px; }
body.view-mobile .selection-slot.special { margin-left: 3px; }
body.view-mobile .selection-slot.special::before { left: -7px; font-size: 12px; }
body.view-mobile .delete-last-number { margin-left: auto; }
body.view-mobile .prize-rules { margin: 0 16px 16px; }
body.view-mobile .prize-rule-list { grid-template-columns: 1fr; }
body.view-mobile .ticket-controls { grid-template-columns: 1fr 1fr; padding: 18px 16px; }
body.view-mobile .ticket-controls button { grid-column: 1 / -1; }
body.view-mobile .inline-form { grid-template-columns: 1fr; padding: 20px 16px; }
body.view-mobile .inline-form h3,
body.view-mobile .inline-form .form-message { grid-column: auto; }
body.view-mobile .node-item { padding: 14px 16px; align-items: start; }
body.view-mobile .node-item > div { align-items: start; flex-direction: column; }

body[data-portal="group"] main { width: min(1320px, calc(100% - 32px)); }
.workspace-nav {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  padding: 7px;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 12px 30px rgba(28, 55, 95, .1);
}
.workspace-tab {
  min-width: 112px;
  flex: 1 0 auto;
  padding: 11px 15px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  white-space: nowrap;
}
.workspace-tab:hover { color: var(--text); border-color: var(--line); }
.workspace-tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary-deep), var(--primary));
  border-color: var(--primary);
  box-shadow: 0 8px 22px rgba(30, 115, 232, .22);
}
.overview-card { margin-bottom: 18px; overflow: hidden; }
.overview-heading { align-items: center; }
.overview-period {
  display: grid;
  justify-items: end;
  gap: 5px;
  min-width: 230px;
}
.overview-period strong { font-size: 22px; letter-spacing: .04em; }
.overview-period small, .metric-panel small, .trend-heading span {
  color: var(--muted);
  font-size: 12px;
}
.status-chip {
  padding: 5px 9px;
  color: var(--success);
  background: rgba(29, 168, 111, .08);
  border: 1px solid rgba(29, 168, 111, .22);
  border-radius: 999px;
  font-size: 12px;
}
.overview-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 0 28px 22px;
}
.overview-metrics .metric-panel {
  min-height: 126px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.overview-metrics .metric-panel.featured {
  grid-column: span 2;
  background: linear-gradient(135deg, #eaf3ff, #f7fbff);
  border-color: #c5dcf8;
}
.overview-metrics .metric-panel h3 { margin-bottom: 8px; font-size: 20px; }
.overview-metrics .metric-panel.featured h3 { font-size: 28px; }
.trend-panel { padding: 22px 28px 28px; border-top: 1px solid var(--line); }
.trend-heading { display: flex; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.sales-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(56px, 1fr));
  gap: 12px;
  align-items: end;
  min-height: 190px;
}
.sales-bar-item { display: grid; grid-template-rows: 1fr auto auto; gap: 8px; min-width: 0; text-align: center; }
.sales-bar-track {
  height: 130px;
  display: flex;
  align-items: end;
  padding: 5px;
  border-radius: 10px;
  background: #eef4fb;
}
.sales-bar {
  width: 100%;
  min-height: 3px;
  border-radius: 7px;
  background: linear-gradient(180deg, #69b2ff, var(--primary-deep));
  box-shadow: 0 0 20px rgba(30, 115, 232, .15);
}
.sales-bar-item strong { overflow: hidden; color: var(--text); font-size: 11px; text-overflow: ellipsis; }
.sales-bar-item span { color: var(--muted); font-size: 11px; }
.transfer-reference {
  max-width: 300px;
  overflow: hidden;
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Mono", monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: max-content;
}
.compact-action { padding: 7px 10px; font-size: 12px; }
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
}
.checkbox-label input { width: 18px; height: 18px; margin: 0; }
.announcement-form textarea {
  grid-column: 1 / -1;
  min-height: 110px;
  resize: vertical;
}
.announcement-list {
  display: grid;
  gap: 12px;
  padding: 0 28px 26px;
}
.announcement-item {
  display: grid;
  gap: 9px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
}
.announcement-item > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.announcement-item p { margin: 0; color: var(--muted); white-space: pre-wrap; }
.announcement-item small { color: var(--muted); }
.announcement-item button { justify-self: start; }
.risk-alert-list { display: grid; gap: 9px; padding: 0 28px 20px; }
.risk-alert {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 14px;
  color: #ffd8a5;
  border: 1px solid rgba(232, 200, 106, .28);
  border-radius: 10px;
  background: rgba(232, 200, 106, .07);
}
.risk-alert.critical { color: #ffb3b3; border-color: rgba(255, 105, 105, .35); background: rgba(164, 63, 63, .12); }
.risk-alert.ok { color: var(--success); border-color: rgba(29, 168, 111, .22); background: rgba(29, 168, 111, .06); }
.device-cell, .audit-change, .address-value, .mono {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mono { font-family: ui-monospace, "Cascadia Mono", monospace; }

@media (max-width: 900px) {
  body:not(.view-desktop)[data-portal="group"] main { width: min(100% - 24px, 720px); }
  body:not(.view-desktop) .workspace-nav { top: 6px; }
  body:not(.view-desktop) .overview-heading { align-items: start; }
  body:not(.view-desktop) .overview-period { min-width: 0; }
  body:not(.view-desktop) .overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 16px 18px; }
  body:not(.view-desktop) .trend-panel { padding: 20px 16px; overflow-x: auto; }
  body:not(.view-desktop) .sales-chart { min-width: 620px; }
  body:not(.view-desktop) .announcement-list,
  body:not(.view-desktop) .risk-alert-list { padding-inline: 16px; }
}

body.view-mobile[data-portal="group"] main { width: min(430px, calc(100% - 24px)); }
body.view-mobile .workspace-nav { top: 6px; }
body.view-mobile .overview-heading { align-items: start; }
body.view-mobile .overview-period { min-width: 0; }
body.view-mobile .overview-metrics { grid-template-columns: 1fr; padding: 0 16px 18px; }
body.view-mobile .overview-metrics .metric-panel.featured { grid-column: auto; }
body.view-mobile .trend-panel { padding: 20px 16px; overflow-x: auto; }
body.view-mobile .sales-chart { min-width: 620px; }

/* 2026-08 responsive workspace refresh */
:root {
  --bg: #edf3fa;
  --panel: #ffffff;
  --line: #d8e3f0;
  --text: #10213d;
  --muted: #64758e;
  --primary: #1d73e8;
  --primary-deep: #124aa7;
  --primary-soft: #eaf3ff;
  --shadow: 0 12px 34px rgba(25, 55, 96, .09);
  --shadow-strong: 0 20px 50px rgba(18, 74, 167, .16);
}

body { line-height: 1.45; }
.site-shell { width: min(1200px, calc(100% - 32px)); padding: 22px 0 44px; }
body[data-portal="group"] .site-shell { width: min(1380px, calc(100% - 32px)); }

.hero {
  position: relative;
  isolation: isolate;
  min-height: 132px;
  align-items: center;
  margin-bottom: 14px;
  padding: 24px 30px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 22px;
  background: linear-gradient(128deg, #123f91 0%, #1d73e8 58%, #54a7ff 100%);
  box-shadow: var(--shadow-strong);
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
}
.hero::before { width: 260px; height: 260px; right: 18%; top: -190px; }
.hero::after { width: 180px; height: 180px; right: -54px; bottom: -120px; }
.brand-lockup { min-width: 0; }
.brand-lockup .eyebrow { margin-bottom: 7px; color: rgba(255,255,255,.72); }
.hero h1 { font-size: clamp(38px, 5vw, 58px); font-weight: 700; letter-spacing: -.04em; }
.hero-actions { gap: 10px; }
.hero .status { padding: 0; }
.hero .language-label { gap: 5px; }
.app-ready .hero { min-height: 96px; padding-block: 18px; }
.app-ready .hero h1 { font-size: 36px; }

.card {
  border-color: rgba(200, 215, 233, .9);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.schedule { margin-bottom: 16px; border-radius: 18px; }
.schedule div { padding: 16px 20px; background: linear-gradient(180deg, #fff, #fbfdff); }
.schedule span { margin-bottom: 6px; }
.schedule strong { color: #123c82; }

.login-layout { max-width: 1080px; margin: 0 auto; align-items: start; }
.login-layout.member-entry { grid-template-columns: minmax(380px, .9fr) minmax(460px, 1.1fr); }
.login-layout.portal-single { grid-template-columns: minmax(360px, 520px); }
.login-card, .rules-summary { padding: 30px; }
.login-card { border-top: 4px solid var(--primary); }
.rules-summary { border-top: 4px solid #72aef3; }
.auth-mode-tabs { margin-bottom: 22px; }
.auth-mode-tab { min-height: 44px; }
.rules-summary .mini-tiers { gap: 9px; }
.rules-summary .mini-tiers span { padding: 7px 11px; background: #f1f7ff; }

.workspace-account {
  position: relative;
  margin-bottom: 12px;
  padding: 15px 20px;
  overflow: hidden;
  border-left: 5px solid var(--primary);
}
.workspace-account::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  right: -76px;
  top: -96px;
  border-radius: 50%;
  background: var(--primary-soft);
}
.workspace-account > * { position: relative; z-index: 1; }
.workspace-account .label { margin-bottom: 4px; }
.workspace-account strong { font-size: 17px; }

.workspace-nav {
  top: 8px;
  gap: 5px;
  margin-bottom: 16px;
  padding: 6px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(14px);
}
.workspace-tab { min-width: 108px; min-height: 44px; border-radius: 11px; }
.workspace-tab.active { box-shadow: 0 7px 18px rgba(29, 115, 232, .2); }

.grid { gap: 14px; margin-bottom: 16px; }
.grid .card { min-height: 150px; padding: 22px; }
.member-summary .card,
#management-summary .card { position: relative; overflow: hidden; }
.member-summary .card::before,
#management-summary .card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary), #74b6ff);
}

.bet-card, .management-card, .table-card, .overview-card, .draw-card { margin-bottom: 16px; }
.section-title {
  min-height: 92px;
  padding: 24px 26px 18px;
  border-bottom: 1px solid #e7eef7;
  background: linear-gradient(180deg, #fff, #fbfdff);
}
.section-title h2 { margin-bottom: 5px; }
.section-title .eyebrow { color: #8ab7eb; }
.section-title .muted { max-width: 760px; }
.table-card, .management-card, .overview-card, .draw-card, .bet-card { overflow: hidden; }
.table-scroll { scrollbar-color: #b8cce5 transparent; }
.table-scroll table { min-width: 760px; }
.table-scroll th { position: sticky; top: 0; z-index: 2; background: #f3f7fc; }
tbody tr:hover { background: #f7fbff; }

.metric-panel { border-color: #dce7f3; background: linear-gradient(145deg, #fff, #f5f9fe); }
.overview-metrics { gap: 10px; }
.overview-metrics .metric-panel { min-height: 116px; }
.overview-metrics .metric-panel.featured { background: linear-gradient(135deg, #e5f1ff, #f7fbff); }
.report-filter { padding-top: 18px; background: #fbfdff; }
.ledger-summary-grid { padding-top: 2px; }
.inline-form { background: #fbfdff; }
.form-actions { background: #fbfdff; }

body.view-desktop .site-shell { min-width: 1120px; }
body.view-desktop[data-portal="group"] .workspace-tab { min-width: 116px; }
body.view-desktop .workspace-nav { justify-content: flex-start; }
body.view-desktop #member-workspace-nav .workspace-tab,
body.view-desktop #agent-workspace-nav .workspace-tab { max-width: 220px; }

body.view-mobile { min-width: 0; }
body.view-mobile .site-shell,
body.view-mobile[data-portal="group"] .site-shell {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 10px 10px 96px;
}
body.view-mobile .hero {
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 20px;
  border-radius: 18px;
}
body.view-mobile .hero h1,
body.view-mobile.app-ready .hero h1 { font-size: 34px; }
body.view-mobile .hero-actions {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}
body.view-mobile .view-mode-switch { grid-column: 1 / -1; width: 100%; }
body.view-mobile .view-mode-switch button { flex: 1; min-height: 38px; }
body.view-mobile .language-label { width: 100%; min-width: 0; }
body.view-mobile .status { justify-self: end; align-self: center; white-space: nowrap; }

body.view-mobile .schedule { grid-template-columns: repeat(2, minmax(0, 1fr)); border-radius: 16px; }
body.view-mobile .schedule div { min-width: 0; padding: 14px; }
body.view-mobile .schedule span { font-size: 12px; }
body.view-mobile .schedule strong { font-size: 18px; overflow-wrap: anywhere; }

body.view-mobile .login-layout,
body.view-mobile .login-layout.member-entry,
body.view-mobile .login-layout.portal-single { grid-template-columns: minmax(0, 1fr); gap: 14px; }
body.view-mobile .login-card,
body.view-mobile .rules-summary { padding: 20px; border-radius: 16px; }
body.view-mobile .rules-summary h2 { font-size: 21px; line-height: 1.45; }
body.view-mobile .auth-mode-tabs { position: sticky; top: 0; z-index: 2; }

body.view-mobile .workspace-account { padding: 14px 16px; border-radius: 16px; }
body.view-mobile .workspace-account > div { min-width: 0; }
body.view-mobile .workspace-account strong { display: block; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.view-mobile .workspace-account button { min-height: 42px; padding: 9px 13px; }

body.view-mobile[data-portal="member"] #app-panel,
body.view-mobile[data-portal="agent"] #app-panel { padding-bottom: 12px; }
body.view-mobile[data-portal="member"] .workspace-nav,
body.view-mobile[data-portal="agent"] .workspace-nav {
  position: fixed;
  left: 10px;
  right: 10px;
  top: auto;
  bottom: 8px;
  z-index: 60;
  width: auto;
  max-width: 500px;
  margin: 0 auto;
  padding: 5px;
  overflow: visible;
  border-radius: 16px;
  box-shadow: 0 14px 40px rgba(16, 33, 61, .24);
}
body.view-mobile[data-portal="member"] .workspace-tab,
body.view-mobile[data-portal="agent"] .workspace-tab {
  min-width: 0;
  min-height: 48px;
  flex: 1 1 25%;
  padding: 7px 4px;
  font-size: 11px;
  line-height: 1.25;
}
body.view-mobile[data-portal="group"] .workspace-nav {
  position: sticky;
  top: 6px;
  bottom: auto;
  gap: 4px;
  overflow-x: auto;
}
body.view-mobile[data-portal="group"] .workspace-tab { min-width: 104px; min-height: 42px; padding: 8px 10px; font-size: 12px; }

body.view-mobile .grid { grid-template-columns: 1fr; gap: 10px; }
body.view-mobile .grid .card { min-height: 0; padding: 18px; }
body.view-mobile .section-title {
  min-height: 0;
  align-items: flex-start;
  flex-direction: column;
  gap: 10px;
  padding: 19px 18px 15px;
}
body.view-mobile .section-title h2 { font-size: 21px; }
body.view-mobile .section-title > p { display: block; margin: 0; }
body.view-mobile .overview-period { width: 100%; justify-items: start; }
body.view-mobile .overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 14px 16px; }
body.view-mobile .overview-metrics .metric-panel.featured { grid-column: 1 / -1; }
body.view-mobile .overview-metrics .metric-panel { min-height: 104px; padding: 13px; }
body.view-mobile .overview-metrics .metric-panel h3 { font-size: 16px; overflow-wrap: anywhere; }
body.view-mobile .overview-metrics .metric-panel.featured h3 { font-size: 22px; }

body.view-mobile .report-filter { gap: 8px; padding: 14px; }
body.view-mobile .ledger-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 14px 14px; }
body.view-mobile .ledger-summary-grid .metric-panel { min-width: 0; min-height: 84px; padding: 12px; }
body.view-mobile .ledger-summary-grid h3 { font-size: 15px; overflow-wrap: anywhere; }
body.view-mobile .table-scroll { width: 100%; border-top: 1px solid #e8eef6; }
body.view-mobile .table-scroll table { min-width: 720px; }
body.view-mobile .compact-ledger table { min-width: 560px; }
body.view-mobile .inline-form { gap: 10px; padding: 16px 14px 18px; }
body.view-mobile .form-actions { flex-wrap: wrap; padding: 16px; }
body.view-mobile button,
body.view-mobile input,
body.view-mobile select { min-height: 44px; }
body.view-mobile .draw-control-form .draw-number-sequence { transform: none; margin-top: 6px; }
body.view-mobile .draw-number-sequence { gap: 7px; }
body.view-mobile .draw-number-field input { height: 46px; }
body.view-mobile .trend-panel { padding: 16px 14px 20px; }
body.view-mobile .announcement-list,
body.view-mobile .risk-alert-list { padding-inline: 14px; }

@media (max-width: 380px) {
  body.view-mobile .site-shell { padding-inline: 7px; }
  body.view-mobile .hero { padding: 17px; }
  body.view-mobile .hero h1,
  body.view-mobile.app-ready .hero h1 { font-size: 30px; }
  body.view-mobile .overview-metrics { grid-template-columns: 1fr; }
  body.view-mobile .overview-metrics .metric-panel.featured { grid-column: auto; }
  body.view-mobile .ledger-summary-grid { grid-template-columns: 1fr; }
  body.view-mobile .number-grid { column-gap: 4px; padding-inline: 10px; }
}

/* Final member-phone layout overrides. Keep these after the shared table rules. */
body.view-mobile[data-portal="member"] #app-panel {
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}
body.view-mobile[data-portal="member"] .workspace-nav {
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  gap: 2px;
  padding: 4px;
}
body.view-mobile[data-portal="member"] .workspace-tab {
  flex: 1 1 20%;
  min-width: 0;
  padding-inline: 2px;
  font-size: 10.5px;
}

body.view-mobile .draw-history-table {
  overflow-x: hidden;
}
body.view-mobile .draw-history-table table,
body.view-mobile .draw-history-table tbody {
  display: block;
  width: 100%;
  min-width: 0;
}
body.view-mobile .draw-history-table tr {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 12px;
  width: 100%;
  padding: 16px;
}
body.view-mobile .draw-history-table td {
  display: block;
  width: auto;
  min-width: 0;
  padding: 0;
}
body.view-mobile .draw-history-table td:nth-child(2) {
  justify-self: end;
  align-self: center;
}
body.view-mobile .draw-history-table td:nth-child(3),
body.view-mobile .draw-history-table td:nth-child(4) {
  grid-column: 1 / -1;
}
body.view-mobile .draw-history-table td:nth-child(4) {
  justify-self: start;
}
body.view-mobile .history-draw-numbers,
body.view-mobile .ticket-number-balls {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  justify-content: center;
  gap: 4px;
  overflow: visible;
}
body.view-mobile .history-draw-ball {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
}
body.view-mobile .history-draw-ball strong { font-size: 11px; }
body.view-mobile .history-draw-ball small {
  top: 37px;
  width: 34px;
  font-size: 9px;
}
body.view-mobile .history-draw-plus {
  flex: 0 0 auto;
  margin-inline: 0;
  font-size: 16px;
}

body.view-mobile .mobile-card-scroll {
  overflow: visible;
  border-top: 1px solid #e8eef6;
}
body.view-mobile .mobile-card-scroll .mobile-card-table,
body.view-mobile .mobile-card-scroll .mobile-card-table tbody {
  display: block;
  width: 100%;
  min-width: 0;
}
body.view-mobile .mobile-card-table thead { display: none; }
body.view-mobile .mobile-card-table tr {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  padding: 14px;
  border-bottom: 1px solid #e5edf6;
}
body.view-mobile .mobile-card-table td {
  display: block;
  min-width: 0;
  padding: 9px 10px;
  overflow-wrap: anywhere;
  border: 1px solid #e7eef7;
  border-radius: 10px;
  background: #fbfdff;
  font-size: 13px;
}
body.view-mobile .mobile-card-table td::before {
  content: attr(data-mobile-label);
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}
body.view-mobile .mobile-card-table td.empty {
  grid-column: 1 / -1;
  text-align: center;
}
body.view-mobile .mobile-card-table td.empty::before { display: none; }
body.view-mobile .member-ticket-detail-table td:nth-child(3) {
  grid-column: 1 / -1;
  padding: 10px 4px 16px;
  overflow: visible;
}
body.view-mobile #member-transfer-rows td:last-child {
  grid-column: 1 / -1;
}

@media (max-width: 380px) {
  body.view-mobile .history-draw-numbers,
  body.view-mobile .ticket-number-balls { gap: 2px; }
  body.view-mobile .history-draw-ball {
    flex-basis: 31px;
    width: 31px;
    height: 31px;
  }
  body.view-mobile .history-draw-ball strong { font-size: 10px; }
  body.view-mobile .history-draw-ball small { top: 34px; width: 31px; font-size: 8px; }
}

body.view-mobile .number-grid {
  align-items: start;
  row-gap: 32px;
  padding-bottom: 42px;
}
body.view-mobile .number-grid button {
  --mobile-number-ball-size: clamp(34px, 10vw, 38px);
  box-sizing: border-box;
  width: var(--mobile-number-ball-size);
  min-width: var(--mobile-number-ball-size);
  max-width: var(--mobile-number-ball-size);
  height: var(--mobile-number-ball-size);
  min-height: var(--mobile-number-ball-size);
  max-height: var(--mobile-number-ball-size);
  aspect-ratio: 1 / 1;
  overflow: visible;
}
body.view-mobile .number-grid .number-zodiac {
  top: calc(var(--mobile-number-ball-size) + 4px);
  z-index: 2;
  width: 40px;
  font-size: 12px;
  line-height: 1.1;
  white-space: nowrap;
}

