t:root{
  --bg: #f5f5f7;
  --card: #ffffff;
  --text: #111111;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #111111;
  --pos: #0f766e;
  --neg: #b91c1c;
  --neu: #92400e;
}

@media (prefers-color-scheme: dark){
  :root{
    --bg:#0b0b0c;
    --card:#151516;
    --text:#f3f4f6;
    --muted:#9ca3af;
    --border:#222326;
    --accent:#e5e7eb;
  }
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, system-ui, sans-serif;
  line-height:1.45;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

.site-header{
  padding:24px 16px 8px;
  text-align:center;
}
h1{
  margin:0;
  font-size:clamp(22px, 4.5vw, 32px);
  font-weight:700;
  letter-spacing:-0.02em;
}
.subtitle{
  margin:8px 0 0;
  color:var(--muted);
  font-size:14px;
}

.container{
  max-width:820px;
  margin:0 auto;
  padding:16px;
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  padding:16px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.02), 0 10px 30px rgba(0,0,0,0.04);
  margin-bottom:16px;
}

.card-title{
  margin:4px 0 16px;
  font-size:18px;
}

.grid{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}

.field{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.field span{
  font-size:14px;
  color:var(--muted);
}
.field input{
  appearance:textfield;
  padding:14px 16px;
  border:1px solid var(--border);
  background:transparent;
  border-radius:12px;
  font-size:18px;
  color:var(--text);
  outline:none;
}
.field input:focus{
  border-color:#9ca3af;
  box-shadow:0 0 0 4px rgba(156,163,175,0.2);
}

.actions{
  display:flex;
  gap:10px;
  margin-top:4px;
  flex-wrap:wrap;
}
.btn{
  padding:12px 14px;
  border-radius:12px;
  border:1px solid var(--accent);
  background:var(--accent);
  color:var(--bg);
  font-weight:600;
  font-size:14px;
  cursor:pointer;
}
.btn:hover{opacity:.9}
.btn.ghost{
  background:transparent;
  color:var(--text);
  border-color:var(--border);
}
.btn.outline{
  background:transparent;
  color:var(--text);
  border-color:var(--accent);
}

.results .totales{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
  margin-bottom:8px;
}
.kpi{
  background:rgba(0,0,0,0.02);
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px;
}
.kpi-label{
  display:block;
  color:var(--muted);
  font-size:12px;
  margin-bottom:6px;
}
.kpi strong{
  font-size:24px;
}

.badge{
  display:inline-block;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
}
.badge.pos{ background: rgba(15,118,110,0.15); color: var(--pos); border-color: rgba(15,118,110,0.4);}
.badge.neg{ background: rgba(185,28,28,0.15); color: var(--neg); border-color: rgba(185,28,28,0.4);}
.badge.neu{ background: rgba(146,64,14,0.15); color: var(--neu); border-color: rgba(146,64,14,0.4);}

.table{
  border-top:1px dashed var(--border);
  margin-top:10px;
}
.row{
  display:flex;
  justify-content:space-between;
  padding:10px 0;
  border-bottom:1px dashed var(--border);
}
.row.total strong{ font-size:18px; }
.row.diff strong{ font-weight:700; }

.hint{
  color:var(--muted);
  font-size:12px;
  margin-top:6px;
}
.toast{
  position:fixed;
  left:50%;
  bottom:24px;
  transform:translateX(-50%);
  background:var(--text);
  color:var(--bg);
  padding:10px 14px;
  border-radius:999px;
  font-size:13px;
  box-shadow:0 10px 30px rgba(0,0,0,0.2);
}

.site-footer{
  padding:18px 16px 28px;
  text-align:center;
  color:var(--muted);
  font-size:12px;
}

/* Desktop tweaks */
@media (min-width: 720px){
  .grid{ grid-template-columns: repeat(2, 1fr); }
  .results .totales{ grid-template-columns: repeat(3, 1fr); }
}

.follow-me {
  text-align: center;
  margin: 40px 0 60px;
}

.follow-me h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 18px;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.social-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 999px;
  transition: all 0.25s ease;
  font-size: 15px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
}

.social-links svg {
  width: 22px;
  height: 22px;
}

.social-links a.yt:hover {
  background: #ff0000;
  color: #fff;
  border-color: #ff0000;
}

.social-links a.ig:hover {
  background: linear-gradient(45deg,#f58529,#dd2a7b,#8134af);
  color: #fff;
  border-color: transparent;
}

.social-inline {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.social-inline {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  text-align: center;
  flex-wrap: wrap;
}

.social-inline a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  transition: all 0.25s ease;
  min-width: 130px;
  text-align: center;
}

.social-inline svg {
  width: 20px;
  height: 20px;
}

.social-inline a.yt:hover {
  background: #ff0000;
  color: #fff;
  border-color: #ff0000;
  transform: translateY(-1px);
}

.social-inline a.ig:hover {
  background: linear-gradient(45deg, #f58529, #dd2a7b, #8134af);
  color: #fff;
  border-color: transparent;
  transform: translateY(-1px);
}

.byline-header {
  display: inline-block;
  margin-top: 4px;
  font-size: 14px;
  color: var(--muted);
}

.byline-header a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.byline-header a:hover {
  color: var(--accent);
  text-decoration: underline;
}
