/* Tennis production tokens and geometry: app/globals.css, tailwind.config.js,
   components/ui/{card,table,button,input}, app/components/navbar.tsx. */
:root {
  font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  font-feature-settings: "rlig" 1, "calt" 1;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  color-scheme: light;
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --primary: 222.2 47.4% 11.2%;
  --primary-foreground: 210 40% 98%;
  --muted: 210 40% 96.1%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --border: 214.3 31.8% 91.4%;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --background: 222.2 84% 4.9%;
  --foreground: 210 40% 98%;
  --primary: 210 40% 98%;
  --primary-foreground: 222.2 47.4% 11.2%;
  --muted: 217.2 32.6% 17.5%;
  --muted-foreground: 215 20.2% 65.1%;
  --border: 217.2 32.6% 17.5%;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    color-scheme: dark;
    --background: 222.2 84% 4.9%;
    --foreground: 210 40% 98%;
    --primary: 210 40% 98%;
    --primary-foreground: 222.2 47.4% 11.2%;
    --muted: 217.2 32.6% 17.5%;
    --muted-foreground: 215 20.2% 65.1%;
    --border: 217.2 32.6% 17.5%;
  }
}
* { box-sizing: border-box; border-color: hsl(var(--border)); }
body { margin: 0; background: hsl(var(--background)); color: hsl(var(--foreground)); font-size: 16px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
button, select { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 8px 16px; border: 1px solid hsl(var(--border)); border-radius: 6px; background: hsl(var(--background)); font-size: 14px; font-weight: 500; white-space: nowrap; }
button:hover:not(:disabled) { background: hsl(var(--muted)); }
button.primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border-color: transparent; }
button.primary:hover { opacity: .9; }
input { height: 36px; width: 100%; min-width: 0; padding: 4px 12px; border: 1px solid hsl(var(--border)); border-radius: 6px; background: transparent; font-size: 14px; box-shadow: 0 1px 2px #0000000d; }
input::placeholder { color: hsl(var(--muted-foreground)); }
:focus-visible { outline: 3px solid hsl(var(--foreground) / .4); outline-offset: 2px; }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#app { display: flex; flex-direction: column; min-height: 100vh; }
.container { width: 100%; margin-inline: auto; padding-inline: 32px; }
@media (min-width: 1400px) { .container { max-width: 1400px; } }
.site-header { position: sticky; top: 0; z-index: 50; width: 100%; border-bottom: 1px solid hsl(var(--border)); background: hsl(var(--background) / .95); backdrop-filter: blur(8px); }
@supports (backdrop-filter: blur(8px)) { .site-header { background: hsl(var(--background) / .6); } }
.header-content { display: flex; align-items: center; height: 56px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; white-space: nowrap; margin-right: 16px; }
.brand:hover { text-decoration: none; }
.brand-icon { display: block; width: 28px; height: 28px; flex-shrink: 0; background: url("./tennis-edge-icon.png") center / contain no-repeat; }
.desktop-nav { display: flex; flex: 1; align-items: center; gap: 16px; font-size: 14px; font-weight: 500; }
.desktop-nav a { color: hsl(var(--foreground) / .6); }
.desktop-nav a:hover { color: hsl(var(--foreground) / .8); text-decoration: none; }
.desktop-nav a[aria-current="page"] { color: hsl(var(--foreground)); font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-button { width: 36px; height: 36px; padding: 0; }
.auth-link { padding: 0; border: 0; background: transparent; text-decoration: underline; font-size: 14px; font-weight: 400; }
.auth-link:hover:not(:disabled) { background: transparent; }
.ghost { background: transparent; border-color: transparent; }
.menu-anchor { position: relative; }
.dropdown { position: absolute; top: calc(100% + 4px); right: 0; min-width: 128px; padding: 4px; border: 1px solid hsl(var(--border)); border-radius: 6px; background: hsl(var(--background)); box-shadow: 0 4px 6px #0000001a; z-index: 60; }
.dropdown button, .dropdown a { display: flex; width: 100%; justify-content: flex-start; padding: 6px 8px; border: none; border-radius: 2px; font-size: 14px; }
.dropdown a:hover { background: hsl(var(--muted)); text-decoration: none; }
.mobile-menu { display: none; }
.moon { display: none; }
:root[data-theme="dark"] .moon { display: block; }
:root[data-theme="dark"] .sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) .moon { display: block; }
  :root:not([data-theme="light"]):not([data-theme="dark"]) .sun { display: none; }
}
main.container { flex: 1; padding-block: 24px; }
main > * + * { margin-top: 24px; }
h1, h2, p { margin: 0; }
h1 { font-size: 24px; font-weight: 600; line-height: 1.2; }
h2 { font-size: 16px; font-weight: 600; }
.card { display: flex; flex-direction: column; gap: 24px; padding-block: 24px; border: 1px solid hsl(var(--border)); border-radius: 12px; background: hsl(var(--background)); box-shadow: 0 1px 3px #0000001a, 0 1px 2px #0000001a; }
.card-header { display: grid; gap: 6px; padding-inline: 24px; }
.card-title { font-size: 16px; font-weight: 600; line-height: 1; }
.detail-title { font-size: 24px; line-height: 32px; }
.card-description, .muted { color: hsl(var(--muted-foreground)); }
.card-description { font-size: 14px; line-height: 20px; }
.card-content { padding-inline: 24px; min-width: 0; }
.detail-content > * + * { margin-top: 16px; }
.toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
label { display: grid; gap: 6px; font-size: 14px; }
.search-field { position: relative; width: 100%; max-width: 384px; }
.search-field input { padding-left: 32px; }
.search-field svg { position: absolute; top: 10px; left: 10px; color: hsl(var(--muted-foreground)); }
.table-wrap { overflow-x: auto; border: 1px solid hsl(var(--border)); border-radius: 6px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; }
tr { border-bottom: 1px solid hsl(var(--border)); transition: background-color .15s; }
tbody tr:last-child { border: 0; }
tbody tr:hover { background: hsl(var(--muted) / .5); }
th { height: 40px; padding: 0 8px; font-weight: 500; white-space: nowrap; }
td { padding: 8px; vertical-align: middle; white-space: nowrap; }
td small { display: block; font-size: 12px; line-height: 16px; }
td:first-child a { font-weight: 500; }
.numeric { text-align: right; }
.badge { display: inline-block; border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 500; background: hsl(var(--muted)); }
.stale { background: #fef3c7; color: #92400e; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; }
.pagination span { font-size: 14px; color: hsl(var(--muted-foreground)); }
.grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap: 16px; }
dl { margin: 0; font-size: 14px; }
dt { color: hsl(var(--muted-foreground)); margin-top: 12px; }
dt:first-child { margin-top: 0; }
dd { margin: 0; overflow-wrap: anywhere; }
.provider-details { font-size: 14px; }
summary { cursor: pointer; }
.back-link { display: inline-flex; align-items: center; font-size: 14px; padding: 8px 16px; border-radius: 6px; }
.back-link:hover { background: hsl(var(--muted)); text-decoration: none; }
.error { border: 1px solid #ef4444; padding: 16px; border-radius: 6px; font-size: 14px; }
.error p { margin-bottom: 12px; }
.site-footer { border-top: 1px solid hsl(var(--border)); padding-block: 16px; color: hsl(var(--muted-foreground)); font-size: 14px; }
.site-footer .container { display: flex; justify-content: space-between; }
.site-footer a { text-decoration: underline; }
#startup { padding: 32px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (min-width:1280px) { .desktop-nav { gap: 24px; } }
@media (max-width:1023px) { .desktop-nav { display: none; } .mobile-menu { display: block; } }

.card-action { grid-column: 2; grid-row: 1 / span 2; align-self: start; justify-self: end; }
.card-header:has(.card-action) { grid-template-columns: 1fr auto; }
.button-link { display: inline-flex; align-items: center; justify-content: center; height: 36px; padding: 8px 16px; border: 1px solid hsl(var(--border)); border-radius: 6px; font-size: 14px; font-weight: 500; }
.button-link:hover { background: hsl(var(--muted)); text-decoration: none; }
.empty { text-align: center; height: 64px; }
@media (max-width: 639px) { .card-action { grid-column: 1; grid-row: auto; justify-self: start; } .card-header:has(.card-action) { grid-template-columns: 1fr; } }

/* Today preserves the production cards, responsive projection rows and density. */
.today-page, .today-content { display: grid; gap: 24px; min-width: 0; }
.today-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.today-stat { border: 1px solid hsl(var(--border)); border-radius: 8px; padding: 16px; min-width: 0; font-size: 14px; }
.stat-value { font-size: 24px; font-weight: 600; overflow-wrap: anywhere; }
.stat-detail { font-size: 12px; margin-top: 4px; overflow-wrap: anywhere; }
.today-freshness { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: hsl(var(--muted-foreground)); }
.today-pipeline { display: grid; gap: 16px; font-size: 14px; }
.today-table td { white-space: normal; min-width: 90px; }
.today-table small, .projection-card small { display: block; font-size: 12px; }
.today-table td:has(strong) { min-width: 170px; }
.today-table strong { font-weight: 500; }
.underlined { text-decoration: underline; }
.notice { border: 1px solid hsl(var(--border)); padding: 12px; border-radius: 6px; font-size: 14px; }
.outcome-won { color: #15803d; } .outcome-lost { color: #dc2626; }
.run-id { overflow-wrap: anywhere; max-width: 100%; }
.projections-mobile { display: none; }
@media(max-width:767px) {
  .today-stats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .today-stat { padding: 12px; } .stat-value { font-size: 20px; }
  .projections-desktop { display: none; }
  .projections-mobile { display: grid; gap: 12px; }
  .projection-card { border: 1px solid hsl(var(--border)); border-radius: 8px; padding: 16px; display: grid; gap: 12px; font-size: 14px; }
  .projection-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .projection-card dt { margin: 0; } .projection-card dd { text-align: right; }
}
