:root {
  color-scheme: dark;
  --bg: #111827;
  --bg-deep: #1d2540;
  --surface: rgba(26, 35, 58, 0.78);
  --surface-solid: #172136;
  --surface-soft: #22304c;
  --surface-strong: #2a3a5b;
  --ink: #f8fbff;
  --muted: #b8c5d8;
  --line: rgba(196, 224, 255, 0.18);
  --line-strong: rgba(196, 224, 255, 0.3);
  --cyan: #04a7c4;
  --cyan-deep: #02728c;
  --cyan-soft: #d8f7fb;
  --lime: #8bcf5a;
  --lime-deep: #4f8c22;
  --lime-soft: #ecf9dd;
  --green: #23c483;
  --green-deep: #0c7a55;
  --green-soft: #dffbed;
  --amber: #f5a524;
  --amber-deep: #9d6500;
  --amber-soft: #fff1ce;
  --danger: #ffb4a9;
  --shadow: 0 28px 68px rgba(0, 7, 23, 0.46);
  --inner-light: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 12% 8%, rgba(35, 196, 131, 0.22), transparent 26%),
    radial-gradient(circle at 82% 4%, rgba(4, 167, 196, 0.28), transparent 28%),
    radial-gradient(circle at 72% 52%, rgba(139, 207, 90, 0.18), transparent 30%),
    radial-gradient(circle at 16% 78%, rgba(245, 165, 36, 0.12), transparent 28%),
    linear-gradient(135deg, rgba(4, 167, 196, 0.18), transparent 42%),
    linear-gradient(225deg, rgba(35, 196, 131, 0.16), transparent 40%),
    linear-gradient(180deg, var(--bg), var(--bg-deep));
  color: var(--ink);
  font-family: Inter, Segoe UI, Arial, Helvetica, sans-serif;
}

button {
  border: 0;
  cursor: pointer;
  font: inherit;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease;
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 46px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.eyebrow {
  display: inline-flex;
  margin: 0 0 9px;
  border: 1px solid rgba(4, 167, 196, 0.24);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(4, 167, 196, 0.26) 45%, rgba(35, 196, 131, 0.24));
  color: #b9f7ff;
  padding: 6px 10px;
  box-shadow:
    var(--inner-light),
    inset 0 -8px 18px rgba(4, 167, 196, 0.12),
    0 12px 26px rgba(4, 167, 196, 0.18);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 780px;
  color: var(--ink);
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.02;
  text-shadow: 0 2px 22px rgba(4, 167, 196, 0.22);
}

h2 {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.25;
}

h3 {
  color: var(--ink);
  font-size: 15px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(4, 167, 196, 0.28);
  border-radius: 8px;
  background: linear-gradient(145deg, #293a5c, #1d8ca3 48%, #32d3ef);
  color: #e8fdff;
  box-shadow:
    var(--inner-light),
    inset 0 -10px 18px rgba(2, 30, 55, 0.3),
    0 18px 34px rgba(4, 167, 196, 0.22);
  font-size: 22px;
  line-height: 1;
}

.icon-button:hover,
.with-action button:hover,
.logout-button:hover,
.login-form button:hover {
  transform: translateY(-2px);
  filter: saturate(1.08);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.refresh-status {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(4, 167, 196, 0.2);
  border-radius: 999px;
  background: rgba(8, 20, 36, 0.42);
  color: #c8f8ff;
  padding: 0 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 12px 24px rgba(0, 10, 24, 0.22);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.refresh-status[data-state="loading"] {
  color: var(--amber-soft);
  border-color: rgba(245, 165, 36, 0.32);
}

.refresh-status[data-state="new"] {
  color: var(--green-soft);
  border-color: rgba(35, 196, 131, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 0 22px rgba(35, 196, 131, 0.2);
}

.refresh-status[data-state="error"] {
  color: var(--danger);
  border-color: rgba(255, 180, 169, 0.42);
}

.logout-button {
  min-height: 46px;
  border: 1px solid rgba(35, 196, 131, 0.24);
  border-radius: 8px;
  background: linear-gradient(145deg, #213351, #126b75 50%, #23c483);
  color: #eafff7;
  padding: 0 15px;
  box-shadow:
    var(--inner-light),
    inset 0 -10px 18px rgba(2, 30, 55, 0.28),
    0 18px 34px rgba(35, 196, 131, 0.2);
  font-weight: 850;
}

.summary-grid,
.workspace,
.generator-grid,
.portfolio-grid,
.lab-status-grid,
.strategy-grid,
.insight-grid,
.portfolio-summary {
  display: grid;
  gap: 14px;
}

.summary-grid {
  grid-template-columns: minmax(180px, 260px) 1fr;
  margin-bottom: 14px;
}

.workspace {
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  margin-bottom: 14px;
}

.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow:
    var(--inner-light),
    inset 0 -18px 38px rgba(4, 167, 196, 0.08),
    var(--shadow);
  backdrop-filter: blur(14px);
}

.metric:nth-child(1) {
  background: linear-gradient(145deg, rgba(35, 50, 80, 0.9), rgba(14, 83, 98, 0.74));
}

.metric:nth-child(2) {
  background: linear-gradient(145deg, rgba(35, 50, 80, 0.9), rgba(18, 88, 81, 0.72));
}

.metric {
  padding: 18px;
}

.metric span,
.panel-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 780;
}

.metric strong {
  display: block;
  margin-top: 8px;
  color: var(--cyan-deep);
  font-size: 44px;
  line-height: 1;
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.22),
    0 20px 34px rgba(4, 167, 196, 0.36);
}

.latest-draw {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 11px;
}

.latest-draw .ball,
.frequency .ball {
  color: #001018;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7),
    0 0 2px rgba(0, 10, 16, 0.86);
}

.latest-draw .ball.b,
.frequency .ball.b {
  color: #241400;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.72),
    0 0 2px rgba(36, 20, 0, 0.86);
}

.latest-meta {
  min-width: 132px;
  color: var(--muted);
  font-size: 14px;
  text-align: right;
}

.latest-meta strong {
  color: var(--green);
  font-size: 20px;
}

.latest-placeholder {
  color: var(--muted);
  margin-top: 10px;
}

.panel {
  padding: 18px;
}

.panel + .panel {
  margin-top: 14px;
}

.numbers-section,
.recent-panel {
  margin-top: 14px;
}

.panel-heading {
  margin-bottom: 16px;
}

.with-action,
.stacked {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.with-action button {
  min-height: 40px;
  border: 1px solid rgba(2, 114, 140, 0.28);
  border-radius: 8px;
  background: linear-gradient(135deg, #28c7de, #0fb981 54%, #8bcf5a);
  color: #ffffff;
  padding: 0 15px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -12px 22px rgba(23, 25, 70, 0.18),
    0 18px 34px rgba(35, 196, 131, 0.26),
    0 8px 18px rgba(4, 167, 196, 0.22);
  font-weight: 850;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 34px;
  border: 1px solid rgba(4, 167, 196, 0.24);
  border-radius: 999px;
  background:
    radial-gradient(circle at 34% 22%, #ffffff 0 14%, transparent 15%),
    linear-gradient(145deg, #ffffff, var(--cyan-soft) 46%, #94e8f3);
  color: var(--cyan-deep);
  box-shadow:
    var(--inner-light),
    inset 0 -8px 14px rgba(2, 114, 140, 0.12),
    0 13px 26px rgba(4, 167, 196, 0.2);
  font-size: 15px;
}

.daily-controls {
  display: flex;
  align-items: center;
  gap: 9px;
}

.period-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(4, 167, 196, 0.28);
  border-radius: 8px;
  background: linear-gradient(145deg, #26395b, #0e7488 52%, #23c483);
  color: #ecfffb;
  box-shadow:
    var(--inner-light),
    inset 0 -9px 16px rgba(2, 30, 55, 0.28),
    0 14px 26px rgba(4, 167, 196, 0.2);
  font-size: 18px;
  font-weight: 900;
}

.period-button:hover {
  transform: translateY(-2px);
  filter: saturate(1.1);
}

.period-button:disabled {
  cursor: default;
  opacity: 0.34;
  transform: none;
  filter: grayscale(0.2);
}

.daily-period {
  min-width: 168px;
  border: 1px solid rgba(4, 167, 196, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(4, 167, 196, 0.16) 48%, rgba(35, 196, 131, 0.14)),
    rgba(8, 18, 32, 0.32);
  padding: 8px 12px;
  box-shadow:
    var(--inner-light),
    inset 0 -10px 18px rgba(4, 167, 196, 0.08);
  text-align: center;
}

.daily-period strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.15;
}

.daily-period span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.daily-period b {
  color: var(--green);
}

.number-row,
.number-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.number-grid.compact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
}

.b-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(86px, 1fr));
}

.ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(2, 114, 140, 0.22);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 22%, #ffffff 0 12%, rgba(255, 255, 255, 0.5) 13%, transparent 20%),
    radial-gradient(circle at 70% 78%, rgba(0, 75, 105, 0.22), transparent 36%),
    linear-gradient(145deg, #f2ffff, #70e4ee 42%, #12a7d8 70%, #047fa6);
  color: #001d26;
  font-size: 14px;
  font-weight: 900;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55),
    0 0 1px rgba(0, 18, 24, 0.6);
  box-shadow:
    inset 0 3px 4px rgba(255, 255, 255, 0.78),
    inset 0 -7px 12px rgba(2, 114, 140, 0.24),
    0 4px 0 rgba(2, 114, 140, 0.22),
    0 12px 18px rgba(4, 167, 196, 0.3);
}

.ball.b {
  border-color: rgba(157, 101, 0, 0.2);
  background:
    radial-gradient(circle at 32% 22%, #ffffff 0 12%, rgba(255, 255, 255, 0.52) 13%, transparent 20%),
    radial-gradient(circle at 70% 78%, rgba(110, 68, 0, 0.24), transparent 36%),
    linear-gradient(145deg, #fffdf0, #ffdd7d 44%, #f5a524 72%, #d98200);
  color: #2d1b00;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.58),
    0 0 1px rgba(45, 27, 0, 0.68);
  box-shadow:
    inset 0 3px 4px rgba(255, 255, 255, 0.8),
    inset 0 -7px 12px rgba(157, 101, 0, 0.24),
    0 4px 0 rgba(157, 101, 0, 0.22),
    0 12px 18px rgba(245, 165, 36, 0.3);
}

.ball.hit {
  border-color: rgba(35, 196, 131, 0.58);
  background:
    radial-gradient(circle at 32% 22%, #ffffff 0 12%, rgba(255, 255, 255, 0.52) 13%, transparent 20%),
    radial-gradient(circle at 70% 78%, rgba(0, 85, 53, 0.28), transparent 36%),
    linear-gradient(145deg, #edfff7, #74ebb8 42%, #23c483 72%, #0c7a55);
  color: #031c14;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5),
    0 0 1px rgba(3, 28, 20, 0.72);
  box-shadow:
    inset 0 3px 4px rgba(255, 255, 255, 0.78),
    inset 0 -7px 12px rgba(12, 122, 85, 0.26),
    0 4px 0 rgba(12, 122, 85, 0.24),
    0 12px 20px rgba(35, 196, 131, 0.34);
}

.ball.miss {
  opacity: 0.48;
  filter: saturate(0.72);
}

.ball.b.hit {
  border-color: rgba(35, 196, 131, 0.58);
}

.ball.b.miss {
  opacity: 0.56;
}

.frequency {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: linear-gradient(145deg, #2c4165, var(--surface-soft) 52%, #173e5b);
  box-shadow:
    var(--inner-light),
    inset 0 -12px 20px rgba(4, 167, 196, 0.07),
    0 10px 18px rgba(0, 7, 23, 0.18);
}

.frequency strong {
  display: block;
  margin-top: 8px;
  color: #dcfff1;
  font-size: 24px;
  text-shadow:
    0 0 12px rgba(35, 196, 131, 0.42),
    0 1px 0 rgba(0, 30, 22, 0.74);
}

.frequency span {
  color: var(--muted);
  font-size: 13px;
}

.generator-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.portfolio-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.portfolio-summary {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  margin-bottom: 14px;
}

.generator-context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 4px 0 14px;
  border: 1px solid rgba(4, 167, 196, 0.18);
  border-radius: 8px;
  background: rgba(8, 20, 36, 0.32);
  color: var(--muted);
  padding: 10px 12px;
  font-size: 13px;
}

.generator-context span {
  color: var(--green-soft);
  font-weight: 850;
}

.generator-context strong {
  color: var(--ink);
}

.generator-context small {
  color: var(--muted);
  font-size: 12px;
}

.strategy-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.lab-status-grid {
  grid-template-columns: 1.35fr repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
}

.insight-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 14px;
}

.generator-card {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: linear-gradient(145deg, rgba(42, 58, 91, 0.96), rgba(24, 72, 91, 0.9) 58%, rgba(4, 167, 196, 0.22));
  box-shadow:
    var(--inner-light),
    inset 0 -16px 28px rgba(4, 167, 196, 0.08),
    0 14px 26px rgba(0, 7, 23, 0.22);
}

.generator-card:nth-child(2) {
  background: linear-gradient(145deg, rgba(42, 58, 91, 0.96), rgba(52, 78, 54, 0.88) 55%, rgba(139, 207, 90, 0.24));
}

.generator-card:nth-child(3) {
  background: linear-gradient(145deg, rgba(42, 58, 91, 0.96), rgba(20, 84, 77, 0.9) 55%, rgba(35, 196, 131, 0.2));
}

.portfolio-card,
.portfolio-stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(40, 57, 82, 0.95), rgba(71, 76, 55, 0.76));
  box-shadow:
    var(--inner-light),
    inset 0 -12px 24px rgba(240, 205, 112, 0.07),
    0 12px 22px rgba(0, 7, 23, 0.18);
  padding: 12px;
}

.portfolio-action {
  border: 1px solid rgba(240, 205, 112, 0.35);
  border-radius: 8px;
  background: rgba(240, 205, 112, 0.12);
  color: #fff2c7;
  cursor: pointer;
  font-weight: 850;
  padding: 9px 12px;
}

.portfolio-action:disabled {
  cursor: wait;
  opacity: 0.55;
}

.portfolio-note {
  grid-column: 1 / -1;
  border: 1px dashed rgba(240, 205, 112, 0.24);
  border-radius: 8px;
  color: var(--muted);
  padding: 12px;
}

.portfolio-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.portfolio-card-head span,
.portfolio-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.portfolio-stat strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.portfolio-stat.featured {
  background: linear-gradient(145deg, rgba(43, 69, 82, 0.96), rgba(96, 90, 42, 0.78));
}

.generator-card h3 {
  margin-bottom: 10px;
}

.generator-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-bottom: 0;
}

.confidence-pill {
  display: inline-flex;
  width: fit-content;
  margin: 12px 0 0;
  border: 1px solid rgba(35, 196, 131, 0.28);
  border-radius: 999px;
  background: rgba(35, 196, 131, 0.12);
  color: #dcfff1;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 850;
}

.lab-card,
.strategy-card,
.insight-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(42, 58, 91, 0.95), rgba(18, 86, 79, 0.62));
  box-shadow:
    var(--inner-light),
    inset 0 -14px 24px rgba(4, 167, 196, 0.07),
    0 12px 22px rgba(0, 7, 23, 0.2);
  padding: 13px;
}

.lab-card {
  display: grid;
  gap: 8px;
  background: linear-gradient(145deg, rgba(35, 50, 80, 0.94), rgba(17, 93, 99, 0.7));
}

.lab-card.featured {
  background: linear-gradient(145deg, rgba(31, 66, 91, 0.96), rgba(18, 111, 97, 0.78) 58%, rgba(139, 207, 90, 0.2));
}

.strategy-card.baseline {
  border-color: rgba(240, 205, 112, 0.35);
  background: linear-gradient(145deg, rgba(54, 55, 70, 0.95), rgba(94, 78, 39, 0.55));
}

.lab-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.lab-card strong {
  color: #dcfff1;
  font-size: 22px;
  line-height: 1.05;
  text-shadow: 0 0 14px rgba(35, 196, 131, 0.34);
}

.lab-card.featured strong {
  font-size: 34px;
}

.lab-card small {
  color: var(--muted);
  font-size: 12px;
}

.strategy-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.strategy-head strong,
.insight-card strong {
  color: #dcfff1;
  font-size: 26px;
  line-height: 1;
  text-shadow: 0 0 14px rgba(35, 196, 131, 0.38);
}

.strategy-bars {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 10px;
}

.strategy-bars span {
  border: 1px solid rgba(4, 167, 196, 0.18);
  border-radius: 999px;
  background: rgba(8, 18, 32, 0.3);
  color: var(--muted);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
}

.strategy-card p,
.insight-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.insight-card {
  display: grid;
  gap: 7px;
}

.insight-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.insight-card.wide {
  grid-column: span 2;
}

.block-list {
  display: grid;
  gap: 6px;
}

.block-list div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(196, 224, 255, 0.1);
  padding-bottom: 6px;
}

.block-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.block-list b {
  color: var(--ink);
  font-size: 12px;
}

.block-list em {
  color: var(--green);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.tips-cell {
  min-width: 280px;
}

.tip-stack {
  display: grid;
  gap: 8px;
}

.tip-card {
  border: 1px solid rgba(196, 224, 255, 0.14);
  border-radius: 8px;
  background: rgba(10, 22, 38, 0.38);
  padding: 9px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.tip-card.best-tip {
  border-color: rgba(245, 165, 36, 0.34);
  background:
    linear-gradient(145deg, rgba(245, 165, 36, 0.12), rgba(35, 196, 131, 0.08)),
    rgba(10, 22, 38, 0.48);
}

.tip-card summary {
  cursor: pointer;
  list-style: none;
}

.tip-card summary::-webkit-details-marker {
  display: none;
}

.tip-card summary::after {
  content: "+";
  color: var(--green);
  font-weight: 900;
}

.tip-card[open] summary::after {
  content: "-";
}

.tip-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.tip-card .tip-row {
  margin-top: 7px;
}

.tip-meta strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 12px;
}

.tip-meta em {
  border-radius: 999px;
  background: rgba(245, 165, 36, 0.16);
  color: #fff3d4;
  padding: 2px 6px;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.tip-meta span,
.tip-empty {
  color: var(--muted);
  font-size: 12px;
}

.tip-row .ball {
  width: 28px;
  height: 28px;
  font-size: 12px;
}

.daily-panel {
  border-color: rgba(4, 167, 196, 0.28);
  background: linear-gradient(145deg, rgba(22, 53, 70, 0.9), rgba(18, 86, 79, 0.82));
}

.daily-list {
  display: grid;
  gap: 9px;
}

.daily-draw-card {
  border: 1px solid rgba(196, 224, 255, 0.16);
  border-radius: 8px;
  background: rgba(9, 21, 36, 0.46);
  box-shadow:
    var(--inner-light),
    inset 0 -12px 22px rgba(4, 167, 196, 0.06),
    0 10px 20px rgba(0, 7, 23, 0.2);
  padding: 10px;
}

.daily-draw-main {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.daily-draw-time strong {
  display: block;
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
}

.daily-draw-time span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.daily-draw-numbers {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.daily-tip-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.best-tip-balls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  border: 1px solid rgba(245, 165, 36, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(245, 165, 36, 0.08), rgba(35, 196, 131, 0.06)),
    rgba(8, 18, 32, 0.26);
  padding: 7px 8px;
}

.best-tip-balls > span {
  flex: 0 0 auto;
  color: #fff3d4;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.best-tip-balls .number-row {
  gap: 5px;
}

.best-tip-balls .ball {
  width: 27px;
  height: 27px;
  font-size: 11px;
}

.tip-badge {
  border: 1px solid rgba(35, 196, 131, 0.2);
  border-radius: 999px;
  background: rgba(8, 18, 32, 0.34);
  color: var(--muted);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
}

.tip-badge b {
  color: #dcfff1;
}

.tip-badge.best {
  border-color: rgba(245, 165, 36, 0.4);
  background:
    linear-gradient(145deg, rgba(245, 165, 36, 0.22), rgba(35, 196, 131, 0.14)),
    rgba(8, 18, 32, 0.42);
  color: #fff3d4;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 8px 18px rgba(245, 165, 36, 0.16);
}

.tip-badge.best b {
  color: #ffffff;
  text-shadow: 0 0 10px rgba(245, 165, 36, 0.52);
}

.tip-badge.portfolio {
  border-color: rgba(240, 205, 112, 0.35);
  background: rgba(240, 205, 112, 0.12);
  color: #fff2c7;
}

.tip-badge.muted {
  border-color: rgba(196, 224, 255, 0.12);
}

.daily-details {
  margin-top: 8px;
}

.daily-details > summary {
  cursor: pointer;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  list-style: none;
}

.daily-details > summary::-webkit-details-marker {
  display: none;
}

.daily-details > summary::after {
  content: " +";
}

.daily-details[open] > summary::after {
  content: " -";
}

.daily-details .tip-stack {
  margin-top: 8px;
}

.daily-empty {
  border: 1px solid rgba(196, 224, 255, 0.14);
  border-radius: 8px;
  background: rgba(9, 21, 36, 0.38);
  color: var(--muted);
  padding: 14px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 690px;
  background: var(--surface-solid);
}

thead {
  background: linear-gradient(180deg, #314264, var(--surface-strong));
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: #d9e8ff;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

td {
  color: var(--ink);
  font-size: 14px;
}

tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.035);
}

tbody tr:hover {
  background: rgba(4, 167, 196, 0.11);
}

tr:last-child td {
  border-bottom: 0;
}

.date-cell,
.draw-number {
  color: var(--muted);
  font-weight: 750;
  white-space: nowrap;
}

.empty,
.error {
  color: var(--muted);
  padding: 16px;
}

.error {
  color: var(--danger);
}

@media (max-width: 860px) {
  .summary-grid,
  .workspace,
  .generator-grid,
  .portfolio-grid,
  .lab-status-grid,
  .strategy-grid,
  .insight-grid,
  .portfolio-summary {
    grid-template-columns: 1fr;
  }

  .latest-meta {
    text-align: left;
  }

  .insight-card.wide {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 14px, 1280px);
    padding: 12px 0 30px;
  }

  .topbar,
  .latest-draw,
  .with-action,
  .stacked {
    align-items: flex-start;
  }

  .stacked {
    flex-direction: column;
  }

  .topbar {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 14px;
  }

  .top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 46px minmax(88px, auto);
    align-items: center;
  }

  .refresh-status {
    min-width: 0;
    justify-content: flex-start;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  h1 {
    font-size: 28px;
    line-height: 1.06;
  }

  .metric,
  .panel {
    padding: 12px;
  }

  .summary-grid,
  .panel + .panel,
  .numbers-section,
  .recent-panel {
    margin-bottom: 10px;
    margin-top: 10px;
  }

  .metric strong {
    font-size: 34px;
  }

  .latest-draw {
    gap: 12px;
  }

  .latest-meta {
    min-width: 0;
    width: 100%;
    font-size: 13px;
  }

  .latest-draw,
  .with-action {
    flex-direction: column;
  }

  .with-action button {
    width: 100%;
  }

  .logout-button {
    padding: 0 10px;
    min-height: 46px;
  }

  .lab-status-grid {
    grid-template-columns: 1fr 1fr;
  }

  .lab-card.featured {
    grid-column: 1 / -1;
  }

  .lab-card strong {
    font-size: 17px;
    overflow-wrap: anywhere;
  }

  .lab-card.featured strong {
    font-size: 30px;
  }

  .strategy-grid {
    grid-template-columns: 1fr;
  }

  .strategy-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .strategy-head strong {
    font-size: 24px;
  }

  .generator-grid {
    grid-template-columns: 1fr;
  }

  .generator-card,
  .portfolio-card {
    padding: 11px;
  }

  .generator-card .number-row,
  .portfolio-card .number-row {
    gap: 5px;
  }

  .generator-card .ball,
  .portfolio-card .ball {
    width: 31px;
    height: 31px;
    font-size: 12px;
  }

  .daily-controls {
    width: 100%;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
  }

  .daily-period {
    min-width: 0;
  }

  .daily-draw-card {
    padding: 9px;
  }

  .daily-draw-main {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 8px;
  }

  .daily-draw-time strong {
    font-size: 18px;
  }

  .daily-draw-numbers {
    align-items: flex-start;
  }

  .daily-draw-numbers .number-row {
    gap: 5px;
  }

  .daily-draw-numbers .ball {
    width: 29px;
    height: 29px;
    font-size: 12px;
  }

  .daily-tip-summary {
    gap: 5px;
  }

  .best-tip-balls {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    padding: 7px;
  }

  .best-tip-balls .ball {
    width: 25px;
    height: 25px;
    font-size: 10px;
  }

  .tip-badge {
    padding: 4px 7px;
    font-size: 11px;
  }

  .number-grid.compact,
  .b-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .frequency {
    min-height: 66px;
    padding: 9px;
  }

  .table-wrap {
    border: 0;
    overflow: visible;
    box-shadow: none;
  }

  table {
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody,
  tr,
  td {
    display: block;
  }

  tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-solid);
    box-shadow:
      var(--inner-light),
      0 10px 20px rgba(0, 7, 23, 0.22);
    overflow: hidden;
  }

  tr + tr {
    margin-top: 10px;
  }

  td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    border-bottom: 1px solid var(--line);
    padding: 10px;
  }

  td:nth-child(1)::before {
    content: "Idő";
  }

  section:not(.daily-panel) td:nth-child(1)::before {
    content: "Dátum";
  }

  td:nth-child(2)::before {
    content: "Sorsolás";
  }

  td:nth-child(3)::before {
    content: "A mező";
  }

  td:nth-child(4)::before {
    content: "B";
  }

  td:nth-child(5)::before {
    content: "Tippek";
  }

  td::before {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
  }

  td.empty::before,
  td.error::before,
  section:not(.daily-panel) td.empty::before,
  section:not(.daily-panel) td.error::before {
    content: none;
  }

  td.empty,
  td.error {
    justify-content: flex-start;
  }

  td:nth-child(3) {
    align-items: flex-start;
    flex-direction: column;
  }

  td.tips-cell {
    align-items: stretch;
    flex-direction: column;
    min-width: 0;
  }

  .tips-cell {
    min-width: 0;
  }

  .tip-stack {
    width: 100%;
  }

  .tip-card {
    padding: 8px;
  }

  .tip-meta {
    margin-bottom: 0;
  }

  .tip-card[open] .tip-meta {
    margin-bottom: 7px;
  }

  .tip-row .ball {
    width: 25px;
    height: 25px;
    font-size: 11px;
  }

  .empty,
  .error {
    display: block;
  }
}

.login-page {
  min-height: 100vh;
}

.login-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  width: min(100% - 28px, 520px);
  margin: 0 auto;
  padding: 28px 0;
}

.login-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(42, 58, 91, 0.92), rgba(16, 86, 91, 0.84) 58%, rgba(35, 196, 131, 0.18)),
    var(--surface);
  box-shadow:
    var(--inner-light),
    inset 0 -22px 42px rgba(4, 167, 196, 0.1),
    var(--shadow);
  padding: 26px;
  backdrop-filter: blur(14px);
}

.login-card h1 {
  font-size: clamp(34px, 8vw, 54px);
}

.login-copy {
  margin: 12px 0 24px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.login-form input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(8, 18, 32, 0.64);
  color: var(--ink);
  padding: 0 13px;
  font: inherit;
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -10px 18px rgba(4, 167, 196, 0.04);
}

.login-form input:focus {
  border-color: rgba(35, 196, 131, 0.6);
  box-shadow:
    0 0 0 3px rgba(35, 196, 131, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.login-form button {
  min-height: 48px;
  border-radius: 8px;
  background: linear-gradient(135deg, #28c7de, #0fb981 54%, #8bcf5a);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -12px 22px rgba(23, 25, 70, 0.18),
    0 18px 34px rgba(35, 196, 131, 0.26);
  font-weight: 900;
}

.login-error {
  min-height: 20px;
  color: var(--danger);
  font-size: 13px;
}
