:root{
  --bg:#0f172a; --panel:#111827; --panel2:#1f2937; --text:#e5e7eb; --muted:#9ca3af;
  --border:#334155; --card:#0b1220;
}
*{box-sizing:border-box;}
body{margin:0; padding:8px; font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
    color:var(--text); background:var(--bg);}
h1{margin:0 0 4px; font-size:20px; letter-spacing:.2px; text-align:center;}

.hidden {
    display: none !important;
}

.update-banner {
    background-color: #0d6efd;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    max-width: 360px;
    margin: 0 auto 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.update-btn {
    background: #fff;
    color: #0d6efd;
    border: none;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
}

.error-banner {
    background-color: #842029;
    color: #f8d7da;
    border: 1px solid #f5c2c7;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    max-width: 360px;
    margin: 0 auto 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.error-close-btn {
    background: none;
    border: none;
    color: inherit;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    padding: 0 0 0 10px;
    line-height: 1;
}

.card-container{
    background:var(--panel2); border:1px solid var(--border);
    border-radius:12px; padding:8px; box-shadow:0 4px 10px rgba(0,0,0,.25);
    max-width:360px; margin:8px auto 0;
}
.card-container:first-of-type {
    margin-top: 0;
}

.label{color:var(--muted); font-size:9px; text-transform:uppercase;}
.time{font-variant-numeric:tabular-nums; font-size:12px; margin-top:2px;}
.clocks{display:grid; grid-template-columns:repeat(2, 1fr); gap:4px; width: 60%; margin: auto;}
.clock{background:var(--card); border:1px solid var(--border); border-radius:6px; padding:4px; text-align:center;}
.links a{display:inline-block; padding:4px 6px; border-radius:6px;
         border:1px solid var(--border); background:#0d1526; color:var(--text); font-size:12px; text-decoration:none; margin:1px;}
.links a:hover{border-color:#60a5fa;}

.refresh-container { text-align: center; margin-bottom: 8px; }
.refresh-btn {
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #0d1526;
    color: var(--text);
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
}
.refresh-btn:hover {
    border-color: #60a5fa;
}

table.watchlist-table{width:100%; border-collapse:collapse; font-size:12px;}
th, td{padding:6px 4px; text-align:left; border-bottom:1px solid var(--border);}
thead th{font-weight:700; font-size:12px; color:var(--text);}
.th-link{font-size:9px; font-weight:400; text-decoration:none; color:var(--muted);}
.th-link:hover{color:#60a5fa;}
td.num, th.num{text-align:right;}

.price {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
.chg{
    font-variant-numeric:tabular-nums;
    min-width:50px;
    font-size: 11px;
}
.pos{color:#22c55e;}
.neg{color:#ef4444;}
.zero{color:var(--muted);}
.timestamp{font-size:9px; color:var(--muted); margin-top:2px;}
.note{color:var(--muted); font-size:10px; margin-top:4px; text-align:center;}

.watchlist-table th:first-child { width: 1%; white-space: nowrap; }
.watchlist-table th:nth-child(2) { width: 120px; }
.watchlist-table th:nth-child(3),
.watchlist-table td:nth-child(3) { text-align: right; }

#installInstructions {
  position: relative;
  background-color: #ffffe0;
  color: #333;
  padding-top: 30px;
}

#installInstructions ul {
  margin: 0;
  padding-left: 20px;
  font-size: 11px;
}

#installInstructions li {
  margin-bottom: 6px;
}
#installInstructions li:last-child {
  margin-bottom: 0;
}

.hide-btn {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 8px;
  font-size: 10px;
  border-radius: 6px;
  border: 1px solid #c0c0c0;
  background: #f0f0f0;
  color: #333;
  cursor: pointer;
}
.hide-btn:hover {
  background: #e0e0e0;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: var(--panel2);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  text-align: center;
  max-width: 320px;
  width: 90%;
}

.modal-content p {
  margin: 0 0 12px;
  font-size: 14px;
}

.api-key-input {
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background-color: #e5e7eb;
  color: #111827;
  font-size: 14px;
  margin-bottom: 12px;
}