:root{
  --bg:#0f1724; /* deep slate */
  --card:#0b1220;
  --muted:#9aa4b2;
  --accent1:#ef476f; /* ruim/péssimo */
  --accent2:#ffd166; /* regular */
  --accent3:#06d6a0; /* ótimo/bom */
  --glass: rgba(255,255,255,0.03);
}
html,body{
  height:100%;
  margin:0;
  font-family:Inter,system-ui,Arial; 
  background: #071126;
  background-image: linear-gradient(180deg,#071126 0%, #071f2f 60%);
  background-attachment: fixed;
  color:#e6eef6
}
.wrap{
  max-width:1100px;
  margin:32px auto;
  padding:24px;
  background: rgba(255,255,255,0.01);
  background-image: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  background-attachment: local;
  border-radius:14px;
  box-shadow:0 8px 30px rgba(2,6,23,0.6);
  overflow:hidden
}
header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px
}
h1{
  margin:0;
  font-size:20px;
  font-weight:700
}
p.lead{
  margin:4px 0 0;
  color:var(--muted);
  font-size:13px
}
.controls{
  display:flex;
  gap:8px;
  align-items:center
}
button, .toggle{
  background:var(--glass);
  border:1px solid rgba(255,255,255,0.04);
  color:inherit;
  padding:8px 12px;
  border-radius:10px;
  cursor:pointer;
  font-weight:600;
  transition: all 0.2s ease;
}

button:focus, .toggle:focus {
  outline: 2px solid var(--accent3);
  outline-offset: 2px;
}

button:hover, .toggle:hover {
  background: rgba(255,255,255,0.06);
  transform: translateY(-2px);
}

.focus-visible {
  outline: 2px solid var(--accent3);
  outline-offset: 2px;
}
.toolbar{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap: wrap;
}

.toolbar-button{
  background:var(--glass);
  border:1px solid rgba(255,255,255,0.04);
  color:inherit;
  padding:8px 12px;
  border-radius:10px;
  cursor:pointer;
  font-weight:600;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  box-sizing: border-box;
}

.toolbar-button:focus {
  outline: 2px solid var(--accent3);
  outline-offset: 2px;
}

.toolbar-button:hover {
  background: rgba(255,255,255,0.06);
  transform: translateY(-2px);
}
.social{
  display:flex;
  gap:8px
}
.social-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:36px;
  height:36px;
  border-radius:50%;
  background:var(--glass);
  border:1px solid rgba(255,255,255,0.06);
  color:#e6eef6;
  text-decoration:none;
  transition:background .15s ease, transform .15s ease, box-shadow .15s ease;
  box-shadow:0 2px 8px rgba(0,0,0,0.2)
}
.social-icon:hover{
  background:rgba(255,255,255,0.06);
  transform:translateY(-1px);
  box-shadow:0 6px 20px rgba(0,0,0,0.35)
}

/* Export dropdown */
.export-dropdown{position:relative;display:inline-block}
.export-menu{
  display:none;
  position:absolute;
  top:100%;
  right:0;
  background:var(--card);
  border:1px solid rgba(255,255,255,0.1);
  border-radius:8px;
  box-shadow:0 4px 12px rgba(0,0,0,0.2);
  z-index:1000;
  min-width:200px;
  margin-top:5px;
  animation:fadeIn .2s ease
}
.export-option{
  display:block;
  width:100%;
  text-align:left;
  padding:12px 16px;
  background:none;
  border:none;
  color:inherit;
  cursor:pointer
}
.export-option:hover{background:rgba(255,255,255,0.05)}
@keyframes fadeIn{from{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}
.content{
  display:grid;
  grid-template-columns:1fr 280px;
  gap:20px;
  margin-top:18px
}
.card{
  background: rgba(255,255,255,0.005);
  background-image: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.00));
  background-attachment: local;
  padding:18px;
  border-radius:12px
}
canvas{
  width:100% !important;
  height:420px !important
}
.legend-item{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:12px;
  cursor:pointer;
  user-select:none;
  transition: all 0.2s ease;
  border-radius: 6px;
  padding: 4px;
}

.legend-item:focus {
  outline: 2px solid var(--accent3);
  outline-offset: 2px;
}

.legend-item:hover {
  background: rgba(255,255,255,0.05);
}

/* make legend entries keyboard-accessible buttons but visually match the design
   override the global button styles for these small inline controls */
.legend-item[role="button"], .legend-item.button-reset{
  background:transparent;
  border:none;
  padding:4px;
  text-align:left;
  width: 100%;
}

.legend-item.disabled{
  opacity:0.45
}
.swatch{
  width:14px;
  height:14px;
  border-radius:4px
}
.muted{
  color:var(--muted);
  font-size:13px
}
footer{
  margin-top:18px;
  color:var(--muted);
  font-size:13px
}

/* Data table */
.data-table th{background:rgba(255,255,255,0.05)}
.data-table tr:hover td{background:rgba(255,255,255,0.03)}
@media (max-width:768px){
  .data-table{font-size:14px}
  .data-table th,.data-table td{padding:8px 6px}
}

/* Theme toggle */
.theme-toggle{
  background:var(--glass);
  border:1px solid rgba(255,255,255,0.04);
  color:inherit;
  padding:8px;
  border-radius:10px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:all .3s ease
}
.toolbar .theme-toggle{margin-left:8px}
.theme-toggle{height:36px;width:36px;box-sizing:border-box}
.theme-toggle:hover{background:rgba(255,255,255,0.06);transform:translateY(-2px)}
.theme-toggle:focus{outline:2px solid var(--accent3);outline-offset:2px}

/* Loading spinner */
@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}
@media(max-width:900px){
  .content{
    grid-template-columns:1fr;
  }
  .wrap{
    margin:12px
  }
}
