:root {
  --bg: #f3f5f4;
  --panel: #ffffff;
  --panel-soft: #f9faf9;
  --text: #151b18;
  --muted: #68736d;
  --line: #dfe5e1;
  --green: #247052;
  --green-soft: #e7f3ee;
  --amber: #926315;
  --red: #a64242;
  --shadow: 0 10px 24px rgba(28, 39, 34, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html {
  scroll-behavior: smooth;
}

.shell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 28px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.title-block {
  min-width: 0;
  max-width: 760px;
}

.eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.05;
}

h2 {
  font-size: 19px;
  line-height: 1.2;
}

p,
span {
  color: var(--muted);
}

.header-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--panel-soft);
  color: var(--green);
  font-weight: 800;
}

.scan-button {
  min-width: 92px;
  height: 42px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.scan-button:disabled {
  cursor: progress;
  opacity: 0.72;
}

.profile-menu {
  position: relative;
}

.profile-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 12px 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  list-style: none;
  cursor: pointer;
}

.profile-menu summary::-webkit-details-marker {
  display: none;
}

.profile-avatar {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.profile-name {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: grid;
  min-width: 210px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.profile-dropdown a {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
}

.profile-dropdown a strong {
  color: inherit;
  font-size: 14px;
}

.profile-dropdown a small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.profile-dropdown a:hover {
  background: var(--panel-soft);
}

.profile-dropdown .logout-link {
  color: var(--red);
}

.header-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-soft);
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
}

.header-link.danger {
  color: var(--red);
}

.account-body {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(36, 112, 82, 0.08), transparent 34%),
    var(--bg);
}

.auth-shell {
  display: grid;
  gap: 22px;
  width: min(480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 64px 0;
}

.account-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 900;
  text-decoration: none;
}

.account-logo {
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  object-fit: cover;
  box-shadow: 0 1px 10px rgba(28, 39, 34, 0.12);
}

.account-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  width: min(1120px, calc(100% - 56px));
  margin: 26px auto 56px;
}

.subscription-layout {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}

.account-panel {
  display: grid;
  align-content: start;
  gap: 20px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-panel {
  gap: 18px;
}

.account-panel h1 {
  font-size: 34px;
}

.account-panel p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.success-note {
  padding: 10px 12px;
  border: 1px solid #cde3da;
  border-radius: 8px;
  color: var(--green) !important;
  background: var(--green-soft);
  font-weight: 850;
}

.error-note {
  padding: 10px 12px;
  border: 1px solid #f1c7bc;
  border-radius: 8px;
  color: #9b2c1f !important;
  background: #fff2ef;
  font-weight: 850;
}

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

.account-form label {
  display: grid;
  gap: 7px;
  color: #39443e;
  font-size: 13px;
  font-weight: 850;
}

.account-form input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-soft);
  font: inherit;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font-size: 15px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.disabled-action {
  color: var(--green);
  background: var(--green-soft);
  cursor: default;
}

.inline-action {
  justify-self: start;
}

.subscription-card {
  display: grid;
  grid-template-columns: minmax(150px, 0.4fr) minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.subscription-card span,
.subscription-card strong {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}

.subscription-card span:nth-last-child(-n + 2),
.subscription-card strong:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.subscription-card span {
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 13px;
  font-weight: 850;
}

.subscription-card strong {
  color: var(--text);
  font-size: 14px;
}

.flow-list,
.provider-list {
  display: grid;
  gap: 12px;
}

.flow-list div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.flow-list strong {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
  font-size: 13px;
}

.flow-list span,
.provider-list span {
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.45;
}

.provider-panel {
  grid-column: 1 / -1;
}

.provider-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.provider-list span {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.dashboard {
  padding: 22px 28px 48px;
}

.kpi-strip {
  display: grid;
  grid-template-columns: 1.25fr repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.section-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
  padding: 10px;
  overflow-x: auto;
  background: rgba(243, 245, 244, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

.section-nav-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 116px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel);
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.section-nav-button.active {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.dashboard-section {
  scroll-margin-top: 72px;
}

.faq-section {
  margin-top: 18px;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.faq-card {
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.faq-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.faq-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.faq-note {
  margin: 0 18px 18px;
  padding: 14px 16px;
  border: 1px solid #d7e6de;
  border-radius: 8px;
  color: #214c3b;
  background: #eef7f2;
  line-height: 1.45;
}

.filter-bar strong {
  display: block;
  font-size: 18px;
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.day-switch {
  grid-template-columns: repeat(2, 1fr);
}

.filter-button {
  min-width: 102px;
  height: 36px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.filter-button.active {
  color: #fff;
  background: var(--green);
}

.kpi {
  min-height: 92px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.kpi span {
  display: block;
  margin-bottom: 9px;
  font-size: 13px;
}

.kpi strong {
  display: block;
  color: var(--text);
  font-size: 28px;
  line-height: 1.1;
}

.primary-kpi {
  background: var(--green);
  border-color: var(--green);
}

.primary-kpi span,
.primary-kpi strong {
  color: #fff;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.workspace {
  display: grid;
  gap: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-head.compact {
  padding: 16px 18px;
}

.signal-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 12px;
  padding: 16px;
}

.slip-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  padding: 16px;
  align-items: start;
}

.slip-section {
  display: grid;
  gap: 12px;
  min-width: 0;
  align-self: start;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line);
}

.slip-group {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.slip-group-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 4px;
}

.slip-group-head h3 {
  margin: 0;
  font-size: 22px;
}

.slip-group-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.slip-section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.slip-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.slip-section-head h3 {
  margin: 0;
  font-size: 18px;
}

.slip-section-head span {
  font-size: 12px;
  font-weight: 800;
}

.slip-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.slip-card {
  display: grid;
  gap: 10px;
  padding: 13px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.slip-head h3 {
  margin: 0;
  font-size: 15px;
}

.probability-badge {
  flex: 0 0 auto;
  padding: 6px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.slip-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.slip-legs {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 18px;
}

.slip-legs li {
  padding-left: 2px;
}

.slip-legs strong,
.slip-legs span,
.slip-legs small {
  display: block;
}

.slip-legs strong {
  font-size: 13px;
}

.slip-legs span {
  color: var(--muted);
  font-size: 12px;
}

.slip-legs small {
  color: #52625a;
  font-size: 11px;
  line-height: 1.35;
  white-space: pre-line;
}

.slip-legal {
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.compact-empty {
  padding: 14px;
}

.market-groups {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 16px;
}

.market-group {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.market-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--line);
}

.market-group h3 {
  margin: 0;
  font-size: 20px;
}

.market-group-meta {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.block-filter {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 10px 14px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.block-filter-button {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--panel-soft);
  font-weight: 800;
  cursor: pointer;
}

.block-filter-button.active {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.market-table-wrap {
  overflow-x: auto;
}

.market-table {
  min-width: 900px;
}

.market-table th,
.market-table td {
  padding: 12px 14px;
}

.pending-box {
  padding: 18px 14px;
  color: var(--amber);
  background: #fff;
}

.signal-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.signal-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.signal-card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.signal-card .match {
  color: var(--muted);
  font-size: 13px;
}

.edge-badge {
  flex: 0 0 auto;
  padding: 7px 9px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 13px;
  font-weight: 900;
}

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

.signal-grid div,
.coverage-list div,
.note-list div {
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.signal-grid span,
.coverage-list span,
.note-list span {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
}

.signal-grid strong,
.coverage-list strong,
.note-list strong {
  display: block;
  font-size: 14px;
  line-height: 1.25;
}

.context-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.context-list span {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.coverage-list,
.note-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.coverage-list strong,
.note-list strong {
  overflow-wrap: anywhere;
}


.secondary-button {
  height: 38px;
  border: 1px solid var(--green);
  border-radius: 8px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.secondary-button:disabled {
  cursor: progress;
  opacity: 0.7;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
}

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

th {
  color: #3c4741;
  background: var(--panel-soft);
  font-size: 13px;
}

.stacked-head {
  display: inline-grid;
  gap: 1px;
  line-height: 1.05;
}

td {
  font-size: 14px;
}

.team-trend-table {
  min-width: 1220px;
  table-layout: fixed;
}

.team-trend-table th,
.team-trend-table td {
  padding-inline: 10px;
}

.team-trend-table th:nth-child(1),
.team-trend-table td:nth-child(1) {
  width: 14%;
}

.team-trend-table th:nth-child(2),
.team-trend-table td:nth-child(2) {
  width: 6%;
}

.team-trend-table th:nth-child(3),
.team-trend-table td:nth-child(3),
.team-trend-table th:nth-child(4),
.team-trend-table td:nth-child(4) {
  width: 10%;
}

.team-trend-table th:nth-child(5),
.team-trend-table td:nth-child(5) {
  width: 12%;
}

.team-trend-table th:nth-child(6),
.team-trend-table td:nth-child(6),
.team-trend-table th:nth-child(7),
.team-trend-table td:nth-child(7) {
  width: 6%;
}

.team-trend-table th:nth-child(8),
.team-trend-table td:nth-child(8),
.team-trend-table th:nth-child(9),
.team-trend-table td:nth-child(9) {
  width: 7%;
}

.team-trend-table th:nth-child(10),
.team-trend-table td:nth-child(10) {
  width: 11%;
}

.team-trend-table th:nth-child(11),
.team-trend-table td:nth-child(11) {
  width: 11%;
}

.trend-cell-stack,
.signal-cell-stack {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.trend-cell-stack div {
  display: grid;
  gap: 2px;
}

.trend-cell-stack span,
.metric-block span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.trend-cell-stack strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.32;
}

.metric-block {
  display: grid;
  gap: 2px;
}

.metric-block strong {
  color: #174f3b;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.18;
}

.edge {
  color: var(--green);
  font-weight: 900;
}

.lean-cell {
  color: #174f3b;
  background: #eef7f3;
  border-left: 1px solid #cfe5dc;
  border-right: 1px solid #cfe5dc;
  font-weight: 900;
  line-height: 1.25;
}

.lineup-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #f3f5f4;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.lineup-starter_confirmed {
  background: #e6f4ee;
  color: var(--green);
}

.lineup-lineup_pending {
  background: #fff7e8;
  color: var(--amber);
}

.lineup-bench,
.lineup-not_in_squad,
.lineup-started {
  background: #f9e9e7;
  color: #9b2f22;
}

.status-primary,
.status-review {
  font-size: 12px;
  font-weight: 900;
}

.status-primary {
  color: var(--green);
}

.status-review {
  color: var(--amber);
}

.empty {
  padding: 26px;
  color: var(--amber);
}

.muted {
  color: var(--muted);
}

.dashboard-section[hidden] {
  display: none;
}

.yesterday-result-table {
  min-width: 980px;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.result-badge.won {
  background: #e6f5ed;
  color: #1d6b49;
}

.result-badge.lost {
  background: #f8e7e7;
  color: #9a2c2c;
}

.result-badge.pending {
  background: #f5eddb;
  color: #8a641b;
}

.result-badge.manual,
.result-badge.void {
  background: #eef0f2;
  color: #5c6570;
}

@media (max-width: 1120px) {
  .main-grid {
    grid-template-columns: 1fr;
  }

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

}

@media (max-width: 820px) {
  .shell-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .scan-button {
    flex: 1;
  }

  .profile-menu {
    margin-left: auto;
  }

  .header-link {
    flex: 1;
  }

  .filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .segmented {
    width: 100%;
  }

  .filter-button {
    min-width: 0;
  }

  .dashboard {
    padding: 16px;
  }

  .kpi-strip,
  .signal-cards,
  .slip-grid,
  .market-groups,
  .faq-grid,
  .account-layout,
  .subscription-layout {
    grid-template-columns: 1fr;
  }

  .slip-list {
    grid-template-columns: 1fr;
  }

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

  .provider-list {
    grid-template-columns: 1fr;
  }
}
