:root {
  color-scheme: dark;
  --bg: #080c10;
  --panel: #111820;
  --panel-soft: #0d1319;
  --border: #22313c;
  --border-hot: #2b6f7a;
  --text: #edf7f8;
  --muted: #93a7ad;
  --quiet: #657982;
  --blue: #5fb8ff;
  --teal: #48d6c7;
  --gold: #c7a65a;
  --danger: #ff6b73;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 0%, rgba(72, 214, 199, 0.08), transparent 34rem),
    linear-gradient(145deg, #071017 0%, #0b1015 43%, #07090c 100%);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

button,
input,
a.text-button {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1040px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2.2rem, 8vw, 5.4rem);
  line-height: 0.9;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.2rem;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  letter-spacing: 0;
}

.card-actions,
.section-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.text-button,
.tab-button {
  min-height: 36px;
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(14, 21, 28, 0.86);
}

.text-button:hover,
.tab-button:hover {
  border-color: var(--border-hot);
  background: rgba(24, 39, 48, 0.94);
}

.control-panel {
  display: grid;
  grid-template-columns: minmax(240px, 520px);
  gap: 14px;
  margin-bottom: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

input {
  width: 100%;
}

input {
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: rgba(7, 12, 16, 0.78);
  outline: none;
}

input {
  height: 42px;
  padding: 0 12px;
}

input:focus,
button:focus-visible {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(72, 214, 199, 0.12);
}

.section-tabs {
  flex-wrap: wrap;
  margin: 8px 0 16px;
}

.tab-button {
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted);
}

.tab-button[aria-pressed="true"] {
  border-color: rgba(72, 214, 199, 0.74);
  color: var(--text);
  background: rgba(72, 214, 199, 0.12);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.card {
  display: grid;
  min-height: 176px;
  padding: 16px;
  border: 1px solid rgba(34, 49, 60, 0.9);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(17, 24, 32, 0.96), rgba(12, 18, 24, 0.96));
  box-shadow: var(--shadow);
}

.card:hover {
  border-color: rgba(72, 214, 199, 0.44);
}

.card-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

.brand-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid rgba(72, 214, 199, 0.18);
  border-radius: 8px;
  color: rgba(237, 247, 248, 0.82);
  background: rgba(72, 214, 199, 0.08);
}

.brand-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.section-pill,
.local-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
}

.section-pill {
  color: var(--teal);
  background: rgba(72, 214, 199, 0.09);
}

.local-pill {
  color: var(--gold);
  background: rgba(199, 166, 90, 0.12);
}

.card p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.card-url {
  overflow: hidden;
  margin-top: auto;
  color: var(--quiet);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-actions {
  justify-content: flex-start;
  margin-top: 14px;
}

.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 750;
  text-decoration: none;
}

.text-button.primary {
  border-color: rgba(72, 214, 199, 0.55);
  color: #061012;
  background: linear-gradient(135deg, var(--teal), var(--blue));
}

.text-button.subtle {
  color: var(--muted);
}

.empty-state {
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid rgba(72, 214, 199, 0.35);
  border-radius: 8px;
  color: var(--text);
  background: rgba(11, 19, 24, 0.96);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 720px) {
  .shell {
    width: min(100vw - 22px, 1180px);
    padding-top: 18px;
  }

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

  .control-panel {
    grid-template-columns: 1fr;
  }

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

@media (min-width: 721px) and (max-width: 980px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
