@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700;800&display=swap");

:root {
  --vh: 1vh;
  --vw: 1vw;
  --bg: #f4f6ea;
  --surface: #fffdf6;
  --text: #1b1f22;
  --muted: #59626b;
  --line: #d2dacd;
  --accent: #0d8a73;
  --accent-2: #d8682a;
  --danger: #b50034;
}

* {
  box-sizing: border-box;
  min-width: 0;
}

html,
body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-height: calc(var(--vh) * 100);
  font-family: "Manrope", "Trebuchet MS", sans-serif;
  color: var(--text);
  overflow-x: hidden;
  background: radial-gradient(circle at 20% 10%, #d8f1d8 0%, transparent 45%),
    radial-gradient(circle at 80% 0%, #ffe4cd 0%, transparent 40%), var(--bg);
}

.bg-shape {
  position: fixed;
  z-index: 0;
  opacity: 0.5;
  pointer-events: none;
}

.bg-shape-a {
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  background: #c5ead8;
  top: -10rem;
  right: -8rem;
}

.bg-shape-b {
  width: 18rem;
  height: 18rem;
  border-radius: 50%;
  background: #ffd8c0;
  bottom: -6rem;
  left: -6rem;
}

.layout {
  position: relative;
  z-index: 1;
  width: calc(var(--vw) * 100);
  max-width: 1080px;
  min-height: calc(var(--vh) * 100);
  margin: 0 auto;
  display: grid;
  gap: 0.9rem;
  align-content: start;
  padding-top: max(0.75rem, env(safe-area-inset-top));
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
  padding-left: max(0.75rem, env(safe-area-inset-left));
  padding-right: max(0.75rem, env(safe-area-inset-right));
  overflow-x: clip;
}

.hero h1 {
  margin: 0.3rem 0;
  font-size: clamp(1.8rem, 3.8vw, 3rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.eyebrow {
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 0;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.card {
  width: 100%;
  max-width: 100%;
  background: color-mix(in srgb, var(--surface), #ffffff 55%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 12px 24px rgba(43, 53, 56, 0.08);
}

.reveal {
  animation: rise 0.45s ease both;
  animation-delay: var(--delay, 0s);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h2 {
  margin: 0 0 0.8rem;
  font-size: 1.12rem;
}

.toolbar {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  width: 100%;
}

input,
select,
button {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font: inherit;
  padding: 0.52rem 0.72rem;
}

input,
select {
  min-width: 12rem;
  max-width: 100%;
}

button {
  background: linear-gradient(160deg, var(--accent), #0a7359);
  border: none;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.07);
}

.status {
  margin-top: 0.55rem;
  color: var(--muted);
  min-height: 1.2rem;
}

.status.error {
  color: var(--danger);
}

.meta {
  margin-top: 0.4rem;
  color: var(--muted);
}

.list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.list-item {
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: #fbfff9;
  border: 1px solid var(--line);
  display: grid;
  gap: 0.15rem;
}

.ticker {
  font-weight: 800;
  color: var(--accent-2);
}

.contract {
  color: var(--text);
}

#candles-canvas {
  margin-top: 0.7rem;
  width: 100%;
  max-width: 100%;
  height: 320px;
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.filters {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
}

label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.table-wrap {
  margin-top: 0.7rem;
  overflow: auto;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  background: #fff;
  table-layout: fixed;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 0.52rem;
  font-size: 0.9rem;
}

th {
  background: #f3f8ef;
}

@media (max-width: 768px) {
  .layout {
    width: calc(var(--vw) * 100);
    max-width: 100%;
    gap: 0.7rem;
    min-height: calc(var(--vh) * 100);
    padding-top: max(0.5rem, env(safe-area-inset-top));
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
    padding-left: max(0.5rem, env(safe-area-inset-left));
    padding-right: max(0.5rem, env(safe-area-inset-right));
  }

  .card {
    padding: 0.8rem;
    border-radius: 12px;
  }

  input,
  select {
    min-width: 0;
    width: 100%;
  }

  .toolbar {
    flex-direction: column;
  }

  .toolbar button {
    width: 100%;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  #candles-canvas {
    height: 240px;
  }

  th,
  td {
    white-space: normal;
    word-break: break-word;
    font-size: 0.84rem;
    padding: 0.45rem;
  }

  th:nth-child(6),
  td:nth-child(6),
  th:nth-child(7),
  td:nth-child(7) {
    display: none;
  }
}
