/* public/app.css */

:root {
  --footer-text-color: #b2b5be;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  /* allow header to grow on small viewports so nav buttons stay visually inside */
  /* padding-block: clamp(6px, 2.5vh, 22px); */
  border-bottom: 1px solid #eee;
  box-shadow:0 2px 10px rgba(0,0,0,.06);
  gap: 0px;
}

/* Header: stack logo + nav vertically without touching global app.css */
.site-header-inner{display:flex;flex-direction:column;align-items:center;gap:0px;}
.site-subnav{display:flex;gap:16px;align-items:center;justify-content:center;flex-wrap:wrap}
.site-subnav a{
  display:inline-block;padding:8px 14px;border:1px solid #e6e6e6;border-radius:999px;
  text-decoration:none;font-weight:600;font-size:14px;line-height:1;color:#0d6efd;background:#fafafa
}
.site-subnav a:hover{background:#f0f6ff;border-color:#d7e3ff;text-decoration:none}

.footer {
  top: 0;
  z-index: 1000;
  background: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 2%;
  padding-bottom: 2%;
  padding-right: 3%;
  padding-left: 3%;
  border-top: 1px solid #eee;
  box-shadow:0 2px 10px rgba(0,0,0,.06);
  margin-top: 3%;
  margin-bottom: 2%;
  color: var(--footer-text-color);
}

.footer small {
  color: var(--footer-text-color);
}

/* faster load times */
.shimmer{ position:relative; background:#eee; border-radius:4px; }
.shimmer::after{
  content:""; position:absolute; inset:0;
  background:linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent);
  transform:translateX(-100%); animation:sh 1.2s infinite;
}

/* Logo scales with viewport */
.logo {
  display: block;
  height: auto;
  max-height: clamp(56px, 12vw, 150px);
  max-width: min(70vw, 620px);
  width: auto;
  object-fit: contain;
  cursor: pointer;
}

.header-spacer{margin-top:8px;width:100%;height:4px}

/* Typography + layout */
body {
  font-family: system-ui, "Plus Jakarta Sans", sans-serif;
  margin: 0px;
  padding-top: 0;
  /* padding-left: 10%;
  padding-right: 10%; */
  /* Make the page fill the viewport so footer stays at the bottom */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-page {
  padding: 20px;
  display: block;
  min-height: auto;
  font-family: system-ui, "Plus Jakarta Sans", sans-serif;
}

.admin-main {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.admin-token-label {
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.token-input {
  width: clamp(240px, 40vw, 380px);
  padding: 8px 10px;
  border: 1px solid #dfe3ea;
  border-radius: 6px;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
}

.admin-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-stats {
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.admin-table th,
.admin-table td {
  padding: 8px;
  border-bottom: 1px solid #f0f0f0;
  text-align: left;
  font-size: 0.92rem;
}

.admin-table th {
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #4b5563;
}

.admin-table td:last-child {
  white-space: nowrap;
}

/* Ensure main grows to fill available space between header and footer */
main { flex: 1 1 auto; }

/* Visual indicator bar locked to header bottom */
.vix-bar-status {
  align-self: stretch;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 9px;
  /* margin-top: clamp(8px, 2vh, 18px); */
  /* padding: 6px 18px; */
  background: rgba(248, 158, 138, 0.78);
  border-radius: 0 0 0px 3px;
  /* border-top: 1px solid rgba(0, 0, 0, 0.04); */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* ---- Status cards layout ---- */
.critical-container{
  display:flex;
  flex-wrap:wrap;
  gap:24px;
  align-items:stretch;
  justify-content:center;
  max-width: min(1400px, 94vw);
  margin: clamp(16px, 4vw, 48px) auto;
  padding-inline: clamp(16px, 4vw, 32px);
}
.critical-card{
  border:1px solid #eee;
  border-radius:12px;
  padding:20px;
  background:#fff;
  box-shadow:0 10px 28px rgba(15,23,42,0.08);
  flex: 1 1 220px;
  max-width:280px;
}

/* Critical cards share the same responsive sizing now that the ticker card is gone */
.critical-container .critical-card{
  min-width:210px;
}

.critical-card--mini{
  flex:0 1 180px;
  max-width:200px;
  text-align:center;
  display:flex;
  flex-direction:column;
  gap:8px;
  justify-content:center;
}

.critical-card--mini .group{
  margin-bottom:4px;
}

.critical-card--mini .ts{
  margin-top:auto;
}

.vix-price{
  font-size:2.1rem;
  font-weight:700;
  line-height:1.2;
}

.vix-change{
  font-size:1rem;
  font-weight:600;
}

.text-up{color:#0a8f2d;}
.text-down{color:#d6333c;}

.card-gap {
  width: 100%;
  height: 12px;
}

.market-table-wrap {
  width: 100%;
  margin: 0 auto 60px;
}

.market-table-card {
  border: 1px solid #eee;
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  background: #fff;
  padding: clamp(16px, 4vw, 32px);
}

.sector-graph-card {
  margin-top: clamp(20px, 3vw, 32px);
  border: 1px solid #f0f0f0;
  border-radius: 16px;
  padding: clamp(18px, 3vw, 28px);
  background: radial-gradient(circle at top, #f8fbff 0%, #ffffff 55%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 18px 32px rgba(15, 23, 42, 0.08);
  position: relative;
}

#sectorPerfChart {
  width: 100%;
  display: block;
  min-height: 220px;
  height: clamp(220px, 32vw, 360px);
  max-height: 360px;
  border-radius: 12px;
  background: #fff;
}

.sector-graph-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.sector-graph-title strong {
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0f172a;
}

.sector-graph-title p {
  margin: 4px 0 0;
  color: #6b7280;
  font-size: 0.9rem;
}

.sector-graph-meta {
  text-align: right;
  color: #64748b;
  font-size: 0.9rem;
}

.sector-range-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 12px;
  margin-bottom: 6px;
  text-align: left;
}

.sector-range-field {
  display: flex;
  flex-direction: column;
  font-size: 0.78rem;
  color: #475569;
}

.sector-range-field span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}

.sector-range-field input[type="date"] {
  border: 1px solid #cbd5f5;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.85rem;
  color: #0f172a;
  min-width: 140px;
  background: #fff;
}

.sector-range-field input[type="date"]:focus {
  outline: 2px solid rgba(79, 70, 229, 0.3);
  border-color: #7c3aed;
}

.sector-range-actions {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.sector-range-btn {
  border: 1px solid #0ea5e9;
  background: #0ea5e9;
  color: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.sector-range-btn:hover:not(:disabled) {
  background: #0284c7;
  border-color: #0284c7;
}

.sector-range-btn.ghost {
  background: transparent;
  color: #0ea5e9;
}

.sector-range-btn.ghost:hover:not(:disabled) {
  background: rgba(14, 165, 233, 0.12);
}

.sector-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 16px;
  font-size: 0.86rem;
  color: #334155;
}

.sector-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.sector-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex-shrink: 0;
}

.sector-legend-item:hover {
  background: #e2e8f0;
}

.sector-legend-item:focus-visible {
  outline: 2px solid rgba(14, 165, 233, 0.6);
  outline-offset: 2px;
}

.sector-legend-item.is-hidden {
  opacity: 0.35;
  background: #e2e8f0;
}

.table-header {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.table-ts {
  color: #6b7280;
  font-size: 0.9rem;
}

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

.market-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.market-table th,
.market-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
}

.market-table th {
  text-align: left;
  font-size: 0.92rem;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.market-table th:nth-child(2) {
  text-align: center;
}

.market-table th:nth-child(3),
.market-table th:nth-child(4) {
  text-align: right;
}

.market-table td {
  text-align: right;
}

.market-table td:first-child,
.market-table th:first-child {
  text-align: left;
}

.market-table td:nth-child(2),
.market-table th:nth-child(2) {
  text-align: center;
}

.market-table td:last-child,
.market-table th:last-child {
  text-align: right;
}

.market-table .up { color: #0a8f2d; }
.market-table .down { color: #d6333c; }

.leaders-section {
  width: 100%;
  margin: 0 auto 80px;
}

.leaders-card {
  border-radius: 20px;
  padding: clamp(18px, 4vw, 136px);
  background: #fff;
  border: 1px solid #eee;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.12);
  color: #0f172a;
}

.leaders-columns {
  display: flex;
  flex-wrap: nowrap;
  gap: clamp(12px, 2vw, 20px);
  align-items: stretch;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.leaders-columns::-webkit-scrollbar {
  height: 6px;
}

.leaders-columns::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.6);
  border-radius: 999px;
}

.leaders-columns::-webkit-scrollbar-track {
  background: transparent;
}

.leaders-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.leaders-header strong {
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #111827;
  text-align: center;
  justify-self: center;
}

.leaders-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.leaders-ts {
  color: #6b7280;
  font-size: 0.9rem;
  text-align: right;
}

.leaders-status {
  font-size: 0.82rem;
  color: #94a3b8;
}

.leaders-refresh-btn {
  border: 1px solid #d0d5dd;
  background: #ffffff;
  color: #0f172a;
  font-weight: 600;
  border-radius: 999px;
  padding: 6px 18px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.leaders-refresh-btn:hover:not(:disabled) {
  background: #0d6efd;
  color: #fff;
  border-color: #0d6efd;
}

.leaders-refresh-btn:disabled {
  opacity: 0.65;
  cursor: progress;
}

.leaders-column {
  /* flex: 0 0 calc(50% - clamp(12px, 2vw, 20px) / 2); */
  flex: 0 0 calc(45% - clamp(12px, 2vw, 20px) / 2);
  min-width: 300px;
  border-radius: 16px;
  padding: clamp(14px, 2vw, 24px);
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  scroll-snap-align: start;
}

.leaders-column-title {
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  /* text-transform: uppercase; */
  color: #475467;
  margin-bottom: 10px;
}

.leaders-list {
  font-family: system-ui, "Plus Jakarta Sans", sans-serif;
  font-size: 0.92rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.leaders-item {
  display: grid;
  grid-template-columns: 36px auto minmax(68px, auto) minmax(70px, auto);
  align-items: center;
  column-gap: 4px;
  row-gap: 4px;
  padding: 8px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.leaders-rank {
  color: #94a3b8;
  /* text-align: right; */
}

.leaders-symbol {
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #0f172a;
}

.leaders-price {
  color: #475467;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.leaders-change {
  text-align: center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.leaders-change.up { color: #16a34a; }
.leaders-change.down { color: #f87171; }

.leaders-placeholder {
  text-align: center;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed #d0d5dd;
  color: #667085;
  background: #f8fafc;
}

@media (max-width: 720px) {
  .leaders-item { grid-template-columns: 32px 1fr auto; }
  .leaders-price { display: none; }
}

.normal-container{
  border:1px solid #eee;
  border-radius:12px;
  padding:16px;
  margin-top: 2%;
  margin-bottom: 3%;
  box-shadow:0 2px 10px rgba(0,0,0,.06);
}

.std-button {
  padding:6px 10px; width: 100px; border-radius: 5px;
}

/* ensure pseudo-element spinner positions correctly */
.std-button { position: relative; }

/* small visual for the latch button */
.std-button.on { background: #0a8f2d; color: #fff; border-color: #0a8f2d; }

.latch-toast-container { position: fixed; top: 16px; right: 16px; z-index: 99999 !important; display:flex; flex-direction:column; gap:8px; align-items:flex-end; pointer-events: none; }
.latch-toast { min-width: 160px; max-width:320px; padding:10px 12px; border-radius:8px; color:#fff; background:rgba(0,0,0,0.92) !important; transform:translateY(-8px); opacity:0; transition:opacity .25s ease, transform .25s ease; box-shadow:0 12px 30px rgba(0,0,0,0.28) !important; font-size:14px; pointer-events: auto; }
.latch-toast.visible{ transform:translateY(0); opacity:1; }
.latch-toast.success{ background:#198754 !important; }
.latch-toast.error{ background:#d6333c !important; }

/* small spinner on button when loading */
.std-button.loading{ opacity:0.9; cursor:progress; }
.std-button.loading::after{
  content: '';
  box-sizing: border-box;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: rgba(255,255,255,0.95);
  border-radius: 50%;
  animation: latch-spin .8s linear infinite;
}
@keyframes latch-spin{ to { transform: translateY(-50%) rotate(360deg); } }

.dropdown {
  padding:6px 10px; width: 100px; border-radius: 5px;
}

.row { display:flex; gap:12px; align-items:center; margin:8px 0; }
.dot { width:14px; height:14px; border-radius:80%; background:#bbb; }
.on { background:#090; box-shadow:0 0 10px rgba(0,160,0,.7); }
.on-red { background:#d00; box-shadow:0 0 10px rgba(220,0,0,.7); }
.ts { color:hsl(225, 8%, 72%); font-size:14px; }

.event-log-label{font-size:0.85rem;margin-top:6px;color:#666;}
.event-log-list{list-style:none;padding-left:8px;margin:6px 0 0 0;max-height:120px;overflow:auto;font-size:0.8rem;color:#333;padding-right:4px;}
.event-log-item{display:flex;align-items:flex-start;gap:10px;padding:2px 0;}
.event-log-item:last-child{border-bottom:none;}
.event-log-msg{flex:1;line-height:1.3;}
.event-log-ts{color:#666;font-size:0.72rem;white-space:nowrap;font-variant-numeric:tabular-nums;}
.event-log-empty{color:#888;font-style:italic;padding:2px 0;}

.group { margin-top:0px; }

.blue-text,
.brand,
.reserved {
  color: var(--footer-text-color) !important;
  text-decoration: none !important;
}

.copyright {
  font-size: 13px !important;
  margin-top: 7px;
  margin-bottom: 1%;
  line-height: 3px !important;
  text-align: center !important;
  vertical-align: middle !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif !important;
  cursor: pointer;
  color: var(--footer-text-color);
}

/* Header Logo */
.logo-link { display: inline-flex; align-items: center; }
.logo-link:focus { outline: 2px solid #4c9ffe; outline-offset: 4px; }

/* TradingView Widget */
.tradingview-widget-container {
  width: 100%;
  max-width: 1200px;
  margin: 40px auto 0 auto;
}
.tradingview-widget-container__widget {
  width: 100%;
  height: 600px;
}

/* Chart.js */
#dual { width:100%; height:360px; border:1px solid lab(88.47% 0 -0.01 / 0.14); background:#fff; position:relative; }
#chart { width:100%; height:100%; display:block; }
.xhover { margin:6px 0 0 0; color:#444; text-align:center; }
#symForm { display:flex; flex-wrap:wrap; margin-bottom: 2%; gap:8px; align-items:center; }
#symForm label { display:flex; align-items:center; gap:6px; }
#symForm input { padding: 4px 6px; }
/* #applyBtn { padding:6px 10px; } */
#xLabel { display: block; width: 100%; text-align: center; margin-top: 1%; }
.err { color:hsl(349, 98%, 49%); font:14px/1.4 system-ui, sans-serif; padding:8px; white-space:pre-wrap; }

/* zChart.js */
.wrap { max-width: 980px; margin-inline: auto; }
.controls {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  margin: 12px 0 8px;
  align-items: end;
}
.controls label { font-size: 12px; color: #444; display:block; margin-bottom: 4px; }
input[type="text"], input[type="number"], select, textarea {
   padding: 8px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px;
}
textarea { height: 140px; resize: vertical;}

.empty-field{
  /* width: 20%; */
  border:1px solid hwb(0 93% 7% / 0.863);
  border-radius:3px;
  margin-top: 2%;
  margin-bottom: 3%;
  box-shadow:0 2px 10px #00000005;

}

button { padding: 9px 14px; border: 1px solid #ccc; border-radius: 6px; background:#f6f6f6; cursor:pointer; }
button:disabled { opacity:.6; cursor:not-allowed; }
#sub { color:#666; margin: 6px 0 14px 0; }
canvas { background:#fff; border-radius: 8px; display:block; width:100%; height:440px; }
:root { --gold:#d19a00; --grid:#d9d9d9; }

/* Password visibility toggle styling (small eye button) */
.pwd-toggle {
  padding: 6px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: 8px;
  cursor: pointer;
  color: #334155; /* svg stroke color */
}
.pwd-toggle svg { display:block; width:18px; height:18px; }
.pwd-toggle:hover { background:#f8fafc; border-color:#c7defa; }
.pwd-toggle:focus { outline:2px solid rgba(79, 70, 229, 0.18); outline-offset:2px; }
.pwd-toggle[aria-pressed="true"] { background:#eef2ff; border-color:#c7defa; }

/* Center the login box and give it a subtle card look so it's visually centered on the page */
#loginBox {
  max-width: 560px;
  /* responsive vertical spacing: smaller min so heading sits closer to card, still scales with viewport */
  margin-block: clamp(16px, 8vh, 120px);
  margin-inline: auto;
  padding: 18px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  border: 1px solid #f0f0f0;
}

/* Centered, polished login form inside the login card */
#loginBox .login-form{
  display:flex;
  flex-direction:column;
  gap:12px;
  align-items:center; /* center the whole form block inside the card */
  max-width:420px; /* control form width so it looks neat inside the card */
  margin: 0 auto; /* horizontally center */
  padding: 6px 0;
}

#loginBox .login-form .form-row{ display:flex; flex-direction:column; width:100%; gap:6px; }

#loginBox .login-form label{ font-weight:600; color:#344054; font-size:14px; }

/* inputs inside the centered form get a cleaner look */
#loginBox .login-form input[type="text"],
#loginBox .login-form input[type="password"]{
  width:100%;
  padding: 10px 12px;
  border: 1px solid #e6edf3;
  border-radius: 8px;
  background: #fbfdff;
  box-shadow: 0 1px 2px rgba(16,24,40,0.03);
  transition: box-shadow .12s ease, border-color .12s ease;
}
#loginBox .login-form input:focus{ outline: none; border-color: #9ec5ff; box-shadow: 0 6px 18px rgba(13,110,253,0.08); }

/* ensure username input uses full width inside the centered form */
#loginBox .login-form input#username{ width:100%; max-width:100%; }

#loginBox .login-form .form-actions{ display:flex; gap:10px; width:100%; align-items:center; }

/* primary button style */
.btn-primary{ padding:8px 14px; background:#0d6efd; color:#fff; border:none; border-radius:8px; box-shadow:0 8px 20px rgba(13,110,253,0.12); cursor:pointer; font-weight:700; }
.btn-primary:hover{ background:#0b5ed7; }

/* if there are secondary actions they should be subtle */
.btn-ghost{ padding:8px 12px; background:transparent; border:1px solid #e6eefb; color:#334155; border-radius:8px; }

/* center the primary action if desired */
#loginBox .login-form .form-actions.center{ justify-content:center; }

/* Center the page-level heading above the login card on the /me page */
main > h1 { text-align: center; margin-top: 0.25rem; margin-bottom: 0.25rem; }

/* Make inputs full-width inside the login card for a cleaner layout */
#loginBox input[type="text"],
#loginBox input[type="password"] {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #dfe3ea;
  border-radius: 6px;
}

/* Make the username input narrower to match the visual width of the password field */
#loginBox input#username {
  width: 190px;
  max-width: 100%;
  display: inline-block;
}

@media (max-width: 520px) {
  #loginBox input#username { width: 100%; }
}

/* Reuse the same card styling for account and positions boxes so layout is consistent */
#accountBox, #positionsBox {
  max-width: 900px;
  /* use the same responsive vertical spacing as #loginBox so cards align visually */
  margin-block: clamp(16px, 8vh, 120px);
  margin-inline: auto;
  padding: 18px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  border: 1px solid #f0f0f0;
}

/* When account/positions are visible, align their inner elements */
#accountBox pre#accountJson {
  background: #f6f8fa;
  border: 1px solid #e6e9ee;
  padding: 12px;
  border-radius: 8px;
  overflow: auto;
}

#positionsBox table {
  width: 100%;
  border-collapse: collapse;
}

#positionsBox th, #positionsBox td {
  padding: 8px;
  vertical-align: middle;
  border-bottom: 1px solid #f0f0f0;
}

/* Card header layout: title on the left, actions (buttons) aligned right */
.card-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.card-header h2{margin:0;font-size:20px}
.card-actions{display:flex;gap:8px;align-items:center}
.card-actions .std-button{padding:6px 10px;border-radius:6px}

/* Responsive tweaks */
@media (max-width: 480px) {
  /* keep some header padding on small screens so wrapped nav sits inside header */
  .site-header { padding-block: clamp(8px, 4vh, 16px); }
  .critical-card { padding: 14px; }
}
@media (max-width:480px){.site-subnav{gap:10px}.site-subnav a{padding:7px 12px;font-size:13px}}
@media (min-width: 1280px) {
  .site-header { padding-block: 0px; }
  .critical-card { max-width: 1280px; }
}
@media (max-width: 520px) {
  .chartwrap { gap: 12px; }
}

/* Faster load times */
@keyframes sh{ 100% { transform:translateX(100%); } }
.news-grid{ display:grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap:12px; }
.news-item{ border:1px solid #eee; border-radius:10px; padding:10px; box-shadow:0 2px 10px rgba(0,0,0,.04); }
.sym-head{ font-weight:700; margin-bottom:6px; }

/* Comparison summary price/pct styles (reused by charts.js summaries) */
.rt-price{ font-variant-numeric: tabular-nums; font-weight:600; }
.rt-prev{ color:#6b7280; font-size:0.85rem; margin-left:8px; }
.rt-pct-pill{ display:inline-block; min-width:56px; padding:4px 8px; border-radius:7px; font-size:13px; font-weight:500; text-align:center; box-shadow: inset 0 -1px 0 rgba(255,255,255,0.02); }
.pct-up { color: #0a8f2d; background: rgba(10,143,45,0.06); border:1px solid rgba(10,143,45,0.12); }
.pct-down { color: #d6333c; background: rgba(214,51,60,0.06); border:1px solid rgba(214,51,60,0.10); }
.rt-updated{ animation: rt-pulse 760ms cubic-bezier(.2,.9,.3,1); }
.pct-up.rt-updated{ box-shadow: 0 10px 24px rgba(10,143,45,0.10); }
.pct-down.rt-updated{ box-shadow: 0 10px 24px rgba(214,51,60,0.10); }
@keyframes rt-pulse{
  0% { transform: translateY(0) scale(1); }
  25% { transform: translateY(-3px) scale(1.04); }
  60% { transform: translateY(0) scale(1.01); }
 100% { transform: translateY(0) scale(1); }
}

/* Positions table numeric columns */
#positionsTable th, #positionsTable td {
  padding: 8px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}
#positionsTable th { font-weight:700; }
.col-numeric { text-align: right; font-variant-numeric: tabular-nums; }
.col-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, 'Roboto Mono', 'Courier New', monospace; }

/* Comparison summary fallback message */
.empty-summary{ color:#666; padding:8px 12px; border-radius:8px; background:transparent; font-weight:600 }

/* ------------------------------------------------------------------
   UI visibility tweaks: hide controls/panels while preserving DOM
   - Keep elements in the DOM (so JS still reads/writes values) but
     visually remove them from the layout. This preserves functionality
     while making the UI cleaner per user request.
------------------------------------------------------------------ */
/* legacy realtime controls removed */