:root {
  color-scheme: light;
  --bg: #f7fbff;
  --bg-alt: #edf6ff;
  --surface: #ffffff;
  --surface-muted: #f2f8ff;
  --surface-strong: #ffffff;
  --ink: #09223a;
  --muted: #527089;
  --muted-strong: #25465f;
  --accent: #0aa7f5;
  --accent-strong: #0172ff;
  --success: #098b5d;
  --danger: #c1374a;
  --border: #d8e7f3;
  --border-strong: #b8d2e8;
  --shadow: 0 26px 70px rgba(0, 54, 112, 0.18);
  --shadow-soft: 0 16px 44px rgba(0, 54, 112, 0.1);
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 999px;
  --font-body: "Avenir Next", Avenir, "Trebuchet MS", sans-serif;
}

html {
  background: #fff;
}

body {
  background:
    radial-gradient(circle at 12% 0%, rgba(0, 197, 255, 0.14), transparent 34rem),
    linear-gradient(180deg, #ffffff 0%, #f3f9ff 58%, #ffffff 100%);
  color: var(--ink);
  letter-spacing: -0.01em;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(9, 34, 58, 0.025) 1px, transparent 1px),
    linear-gradient(180deg, rgba(9, 34, 58, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 72%, transparent 100%);
}

.app-shell {
  width: 100%;
  margin: 0;
  padding: 0 0 76px;
  display: block;
}

.app-topbar {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 4;
  width: min(1240px, calc(100% - 40px));
  min-height: 76px;
  padding: 18px 0;
  transform: translateX(-50%);
  border: 0;
  color: #fff;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-size: 1.04rem;
  font-weight: 950;
  letter-spacing: -0.05em;
  text-decoration: none;
  box-shadow: none;
  backdrop-filter: none;
}

.app-brand::before {
  content: "";
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--brand-mark-fg, #ffffff);
  background: var(--brand-mark-bg, #18202f);
  border: 1px solid var(--brand-mark-border, transparent);
  border-radius: 11px;
  box-shadow: var(--brand-mark-shadow, none);
  font-size: 1rem;
  font-weight: 950;
  letter-spacing: -0.06em;
}

.app-topnav {
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

.app-topnav a {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.app-topnav a:hover,
.app-topnav a:focus-visible {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.app-hero {
  position: relative;
  overflow: hidden;
  min-height: 690px;
  padding: 150px max(20px, calc((100vw - 1240px) / 2)) 160px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 430px);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  background:
    radial-gradient(circle at 83% 22%, rgba(255, 255, 255, 0.34), transparent 15rem),
    radial-gradient(circle at 12% 18%, rgba(90, 231, 255, 0.5), transparent 20rem),
    linear-gradient(128deg, #04194f 0%, #006eff 47%, #00c7ff 100%);
  color: #fff;
}

.app-hero::before {
  content: "";
  position: absolute;
  inset: 88px 4% auto auto;
  width: min(38vw, 480px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 47% 53% 38% 62% / 45% 36% 64% 55%;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(42deg, rgba(255, 255, 255, 0.2) 0 1px, transparent 1px 18px);
  filter: blur(0.1px);
  transform: rotate(-10deg);
}

.app-hero::after {
  content: "";
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: -1px;
  height: 118px;
  background: #fff;
  clip-path: polygon(0 44%, 12% 57%, 27% 39%, 44% 62%, 63% 34%, 82% 54%, 100% 30%, 100% 100%, 0 100%);
}

.hero-copy,
.hero-panel,
.card,
.modal-card {
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  padding: 0;
  color: #fff;
  background: transparent;
  display: grid;
  gap: 24px;
}

.hero-copy h1 {
  max-width: 12ch;
  color: #fff;
  font-size: clamp(4.1rem, 10vw, 9.2rem);
  font-weight: 950;
  line-height: 0.78;
  letter-spacing: -0.105em;
  text-wrap: balance;
}

.lead {
  max-width: 52rem;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1.04rem, 1.7vw, 1.28rem);
  line-height: 1.65;
}

.hero-example-board {
  width: min(620px, 100%);
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(20px);
}

.hero-example-board strong {
  color: rgba(255, 255, 255, 0.72);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.hero-example-board p {
  color: #fff;
  font-size: 1.05rem;
  line-height: 1.5;
}

.hero-panel {
  position: relative;
  z-index: 1;
  padding: 28px;
  border-radius: 34px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 251, 255, 0.96)),
    #fff;
  box-shadow: 0 30px 90px rgba(0, 33, 94, 0.28);
}

.hero-panel .muted,
.hero-panel .link {
  color: var(--muted);
}

.auth-intro,
.guidance-example,
.panel,
.list,
.compose-card,
.hint,
.app-disclosure,
.mini-item,
.empty-panel,
.modal,
.events-list .item,
.event-card,
.source-entry {
  gap: 14px;
}

.auth-intro h2,
.hero-guidance h2,
.settings-block h3,
.clarification-panel h3,
.empty-panel h3,
.panel-header h2,
.compose-card h2 {
  color: var(--ink);
  font-weight: 900;
  letter-spacing: -0.045em;
}

.hero-guidance,
.settings-block,
.pattern-card,
.feedback,
.pack-section,
.clarification-panel,
.event-card-reason {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(180deg, #f7fbff, #eef7ff);
}

.status-pill,
.quick-link,
.ghost-chip,
.watch-summary,
.badge,
.watch-filter-summary,
.toggle,
.prompt-formula span {
  border-color: var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
}

.status-pill {
  min-height: 42px;
  padding: 0 14px;
  box-shadow: 0 10px 24px rgba(0, 93, 176, 0.07);
}

.status-pill.active {
  color: #046b4c;
  border-color: rgba(9, 139, 93, 0.22);
  background: #eafaf3;
}

.status-dot {
  background: #00b7ff;
}

.workspace-grid {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 38px 0 0;
  display: grid;
  grid-template-columns: minmax(330px, 410px) minmax(0, 1fr);
  gap: 1px;
  align-items: start;
  border: 1px solid #dbeaf5;
  border-radius: 38px;
  overflow: hidden;
  background: #dbeaf5;
  box-shadow: 0 36px 90px rgba(1, 49, 96, 0.12);
}

.composer-column,
.workspace-main,
.insights-grid {
  gap: 1px;
  background: #dbeaf5;
}

.composer-column,
.workspace-main {
  align-self: stretch;
}

.card,
.panel,
.compact-panel,
.account-card {
  padding: clamp(22px, 3vw, 34px);
  background: #fff;
}

.workspace-main {
  display: grid;
  grid-template-columns: 1fr;
}

.insights-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel-header {
  margin-bottom: 4px;
}

.panel-header p,
.hint span,
.hint strong,
.muted,
.mini-meta,
.meta-text,
.selected-watch-indicator,
.event-card-summary,
.event-card-meta,
.mini-item p,
.events-list p,
.pack-meta {
  color: var(--muted);
  line-height: 1.55;
}

label {
  color: var(--muted-strong);
}

input[type="email"],
input[type="search"],
textarea,
select {
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background: #fbfdff;
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

input[type="email"]:focus-visible,
input[type="search"]:focus-visible,
textarea:focus-visible,
select:focus-visible {
  border-color: #00a9ff;
  outline: 4px solid rgba(0, 169, 255, 0.18);
  outline-offset: 1px;
}

button,
.link.secondary,
.modal-link {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #0072ff, #00c7ff);
  color: #fff;
  box-shadow: 0 14px 28px rgba(0, 114, 255, 0.22);
  font-weight: 850;
  letter-spacing: -0.02em;
}

button.secondary,
.link.secondary,
.modal-link.secondary,
.hero-panel .secondary,
.event-card-link,
.quick-link,
.template-btn,
.clarification-option,
.ghost-chip,
.kebab {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  box-shadow: none;
}

button:hover:not(:disabled),
.link.secondary:hover,
.modal-link:hover {
  background: linear-gradient(135deg, #005fe0, #00afe3);
  color: #fff;
}

button.secondary:hover:not(:disabled),
.quick-link:hover,
.template-btn:hover,
.clarification-option:hover,
.menu button:hover,
.watch-item:hover,
.events-list .item:hover,
.mini-item.clickable:hover,
.event-card-link:hover,
.ghost-chip:hover {
  border-color: #8ecfff;
  background: #eff9ff;
  color: var(--ink);
}

button:focus-visible,
.quick-link:focus-visible,
.template-btn:focus-visible,
.clarification-option:focus-visible,
.modal-link:focus-visible {
  outline: 4px solid rgba(0, 169, 255, 0.2);
  outline-offset: 2px;
}

.template-grid,
.pattern-grid,
.clarification-options {
  gap: 10px;
}

.template-btn,
.clarification-option {
  min-height: 64px;
  padding: 14px 16px;
  border-radius: 22px;
  text-align: left;
  line-height: 1.25;
}

.pack-section {
  padding: 18px;
}

.pack-btn {
  min-height: 104px;
  align-content: start;
  border-radius: 24px;
}

.prompt-formula span {
  min-height: 34px;
  color: var(--muted-strong);
}

.item,
.mini-item,
.empty-panel,
.watch-item,
.events-list .item,
.event-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: #fbfdff;
}

.watch-item.active {
  border-color: #31b9ff;
  background: linear-gradient(180deg, #eff9ff, #ffffff);
  box-shadow: inset 5px 0 0 #00a9ff;
}

.watch-list,
.events-list {
  padding-right: 0;
  scrollbar-color: #9ad8ff transparent;
}

.events-list {
  gap: 12px;
}

.event-card {
  box-shadow: 0 14px 36px rgba(0, 58, 116, 0.07);
}

.event-card-kicker,
.event-card-reason span {
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.event-card-link,
.modal-link {
  border-radius: 999px;
}

.menu {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 20px 48px rgba(0, 45, 88, 0.14);
}

.menu button {
  border-radius: 14px;
  box-shadow: none;
}

.app-disclosure summary::after {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f2f9ff;
  color: var(--accent-strong);
}

.modal-backdrop {
  background: rgba(1, 20, 43, 0.58);
  backdrop-filter: blur(8px);
}

.modal-card {
  padding: 28px;
  border-radius: 34px;
  box-shadow: 0 36px 90px rgba(0, 20, 43, 0.28);
}

.auth-divider::before {
  border-top-color: var(--border);
}

.auth-divider span {
  background: #fff;
  color: var(--muted);
}

@media (max-width: 1160px) {
  .app-topbar {
    position: relative;
    left: auto;
    width: 100%;
    padding: 18px 20px;
    transform: none;
    background: #031b52;
  }

  .app-hero {
    min-height: 0;
    padding: 58px 20px 130px;
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    max-width: 9ch;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
    margin-top: 0;
  }

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

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

  .app-topnav {
    justify-content: flex-start;
  }

  .app-topnav a {
    padding: 0 10px;
  }

  .app-hero {
    padding-top: 46px;
  }

  .hero-copy h1 {
    font-size: clamp(3.4rem, 18vw, 5.4rem);
  }

  .hero-panel {
    padding: 22px;
    border-radius: 28px;
  }

  .workspace-grid {
    width: calc(100% - 24px);
    border-radius: 28px;
  }

  .card,
  .panel,
  .compact-panel,
  .account-card {
    padding: 20px;
  }

  .modal-card {
    width: calc(100vw - 24px);
    margin-top: 18px;
    padding: 22px;
    border-radius: 28px;
  }
}
