:root {
  --bg: #f6f1e9;
  --bg-soft: #fdf8f0;
  --ink: #201a14;
  --muted: #6d6154;
  --accent: #256b60;
  --accent-strong: #1e5149;
  --accent-warm: #d68336;
  --accent-cool: #3c7fa6;
  --card: #ffffff;
  --border: #e7dccb;
  --shadow: 0 18px 40px rgba(24, 18, 12, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Trebuchet MS", sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

.ambient {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, #fff6e8 0, transparent 45%),
    radial-gradient(circle at 80% 10%, #e6f1ec 0, transparent 40%),
    radial-gradient(circle at 70% 80%, #f3e5d4 0, transparent 45%);
  z-index: -2;
  animation: drift 18s ease-in-out infinite;
}

@keyframes drift {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

.screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.screen.app-screen {
  display: block;
  padding: 32px 24px 64px;
}

.screen.hidden {
  display: none;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.login-card {
  max-width: 420px;
  width: 100%;
  display: grid;
  gap: 24px;
}

.login-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: linear-gradient(130deg, var(--accent), var(--accent-warm));
  color: #fff;
  font-weight: 700;
  display: grid;
  place-items: center;
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
}

h1,
h2,
h3 {
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  margin: 0;
}

p {
  margin: 8px 0 0;
  color: var(--muted);
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 1rem;
  outline: none;
  font-family: inherit;
}

select {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 107, 96, 0.12);
}

select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 107, 96, 0.12);
  outline: none;
}

button {
  border: none;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

button.primary {
  background: var(--accent);
  color: #fff;
}

button.primary:hover {
  background: var(--accent-strong);
}

button.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink);
}

button.ghost:hover {
  border-color: var(--accent);
}

button.ghost.danger {
  color: #a23a2a;
}

.form-error {
  color: #a23a2a;
  font-size: 0.85rem;
  min-height: 20px;
}

.topbar {
  width: min(1200px, 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  gap: 16px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border);
  border-radius: 18px;
  margin-bottom: 24px;
  backdrop-filter: blur(6px);
}

main,
.topbar {
  margin-left: auto;
  margin-right: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-dot {
  width: 16px;
  height: 16px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(37, 107, 96, 0.18);
}

.subtitle {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.status-line {
  font-size: 0.9rem;
  color: var(--muted);
}

main {
  width: min(1200px, 100%);
  display: grid;
  gap: 24px;
}

.hero {
  display: grid;
  gap: 20px;
  background: linear-gradient(135deg, #fffaf3, #fdf3e8);
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.stat {
  padding: 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--border);
}

.stat-label {
  color: var(--muted);
  font-size: 0.85rem;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 6px;
}

.watchlist-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  align-items: end;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(37, 107, 96, 0.12);
  color: var(--accent);
}

.badge.amber {
  background: rgba(214, 131, 54, 0.16);
  color: var(--accent-warm);
}

.badge.cool {
  background: rgba(60, 127, 166, 0.16);
  color: var(--accent-cool);
}

.list {
  display: grid;
  gap: 12px;
  min-height: 120px;
}

.list.scroll {
  max-height: 520px;
  overflow-y: auto;
  padding-right: 6px;
}

.list-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-soft);
}

.item-main {
  display: grid;
  gap: 6px;
}

.item-title {
  font-weight: 600;
  font-size: 1rem;
}

.item-meta {
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.item-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(32, 26, 20, 0.08);
}

.tag.good {
  background: rgba(37, 107, 96, 0.18);
  color: var(--accent-strong);
}

.tag.warn {
  background: rgba(214, 131, 54, 0.18);
  color: #8b4a14;
}

.empty {
  color: var(--muted);
  font-size: 0.9rem;
}

.list-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
  align-items: end;
}

.list-toolbar input,
.list-toolbar select {
  width: 100%;
}

.list-toolbar button {
  justify-self: end;
  min-width: 110px;
}

.toolbar-field {
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.list-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-count {
  font-weight: 600;
  color: var(--ink);
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: rise 0.7s ease forwards;
  animation-delay: var(--delay, 0ms);
}

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

@media (max-width: 900px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .list-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .item-actions {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
  }

  .list.scroll {
    max-height: 380px;
  }
}
