:root {
  --deepGreen0: #0b120c;
  --deepGreen1: #0e1c0f;
  --text-primary: #ffffff;
  --text-secondary: #8c8c8c;
  --accent-color: #81ff11;
  --up-color: #58cc02;
  --down-color: #ea4335;
  --font-family: "Google Sans", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

@media (hover: hover) and (pointer: fine) {
  * {
    cursor: none !important;
  }
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: var(--deepGreen1);
  color: var(--text-primary);
  font-family: var(--font-family);
}

.custom-cursor {
  width: 44px;
  height: 44px;
  background-color: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(50, 50, 50, 0.05);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  position: fixed;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: transform 0.05s ease-out, opacity 0.12s ease-out;
}

.custom-cursor.visible {
  opacity: 1;
}

.custom-cursor.clicking {
  transform: translate(-50%, -50%) scale(0.85);
}

.container {
  width: 402px;
  height: 872px;
  max-width: 100%;
  max-height: calc(100vh - 4rem);
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  overflow: hidden;
  padding: 0 1rem;
  background: var(--deepGreen0);
  border-radius: 24px;
  outline: 1px solid #ffffff;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.18);
}

.top-banner {
  height: 54px;
  margin: 0 -1rem;
}

.sticky-header {
  position: relative;
  display: grid;
  grid-template-rows: 54px 76px;
  align-items: stretch;
  margin: 0 -1rem 0;
  padding: 0 1rem;
  background: inherit;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
}

.app-title {
  display: none;
}

main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  padding-bottom: 2rem;
  scrollbar-width: none;
}

main.drag-scrolling {
  user-select: none;
}

main::-webkit-scrollbar {
  display: none;
}

.search-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 76px;
  margin-top: 0;
  padding: 16px 0;
}

.input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  z-index: 1;
  color: #888888;
  transform: translateY(-50%);
  pointer-events: none;
}

input[type="text"] {
  width: 100%;
  height: 44px;
  padding: 0.8rem 1rem 0.8rem 44px;
  border: 0;
  border-radius: 4px;
  background: #222222;
  color: #ffffff;
  font-family: var(--font-family);
  font-size: 14px;
}

input[type="text"]:focus {
  outline: 1px solid #777777;
}

.back-btn {
  width: 0;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-right: -0.5rem;
  border: 0 solid #555555;
  border-radius: 4px;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-20px);
  transition: width 0.25s cubic-bezier(0.32, 0, 0, 1), margin-right 0.25s cubic-bezier(0.32, 0, 0, 1), border-width 0.25s cubic-bezier(0.32, 0, 0, 1), opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

.back-btn.visible {
  width: 44px;
  margin-right: 0;
  border-width: 1px;
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.back-btn:hover,
.ticker-pill:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

#landingView {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding-bottom: 1rem;
}

.market-summary-card,
.result-card {
  display: flex;
  flex-direction: column;
  overflow: visible;
  padding: 1rem 1rem 1.15rem;
  border: 1px solid #555555;
  border-radius: 4px;
  background: transparent;
}

.market-summary-card {
  gap: 0.75rem;
  padding-top: 1.2rem;
}

#resultCard,
#earningsCard {
  border: 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

#resultCard {
  gap: 2rem;
}

#earningsCard {
  margin-top: 1rem;
}

.detail-quote-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.indices-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  min-height: 1.5rem;
  padding-top: 0.15rem;
  overflow: visible;
}

.index-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
}

.index-item .val {
  color: var(--text-secondary);
  font-weight: 500;
}

.index-item .index-skeleton {
  width: 44px;
  height: 14px;
  display: inline-block;
  color: transparent;
}

.index-item.positive .val {
  color: var(--accent-color);
}

.index-item.negative .val {
  color: #ff4444;
}

.market-summary-text {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.92rem;
  line-height: 1.55;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.popular-section h2,
.portfolio-section h2,
.discover-section h2,
.top-movers-section h2,
.recent-section h2 {
  display: flex;
  align-items: center;
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.top-movers-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.top-movers-heading h2 {
  margin-bottom: 0;
}

.section-header h2 {
  margin-bottom: 0;
}

.discover-section {
  margin-bottom: 100px;
}

.ticker-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.top-movers-empty {
  width: 100%;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.45;
}

.top-movers-empty .sheet-link {
  color: #ffffff;
}

.ticker-pill {
  min-width: 0;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 1rem;
  border: 1px solid #ffffff;
  border-radius: 4px;
  background: transparent;
  color: #ffffff;
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

.pill-change {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.9rem;
  font-weight: 500;
}

.pill-change.positive {
  color: var(--accent-color);
}

.pill-change.negative {
  color: #ff4444;
}

.ticker-pill.loading {
  border-color: #333333;
  background: linear-gradient(90deg, #222222 25%, #333333 50%, #222222 75%);
  background-size: 200% 100%;
  color: transparent;
  animation: shimmer-bg 0.75s infinite;
}

.clear-btn,
.info-btn,
.tune-btn,
.refresh-btn {
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-family);
}

.clear-btn {
  padding: 0;
  text-decoration: underline;
  font-size: 14px;
  font-weight: 500;
}

.info-btn {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 3px;
  color: #ffffff;
  transform: translateY(1px);
}

.info-btn .material-symbols-outlined {
  font-size: 16px;
  line-height: 1;
}

.tune-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.tune-btn:hover {
  color: var(--accent-color);
}

.tune-btn .material-symbols-rounded {
  font-size: 22px;
}

.refresh-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: 50%;
}

.section-refresh-btn.hidden {
  display: none;
}

.refresh-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.result-card:not(.hidden) {
  animation: fade-in 0.3s ease-out;
}

.detail-loading-section {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
}

.detail-loading-title {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.4;
}

.detail-loading-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.25rem;
}

.detail-skeleton-short,
.detail-skeleton-mid,
.detail-skeleton-long {
  height: 16px;
}

.detail-skeleton-short {
  width: 180px;
}

.detail-skeleton-mid {
  width: 48%;
}

.detail-skeleton-long {
  width: 100%;
}

.ticker-label {
  color: var(--text-secondary);
  font-size: 18px;
  font-weight: 500;
}

.price-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0;
}

.price-section h2 {
  color: var(--text-secondary);
  font-size: 18px;
  font-weight: 500;
}

.detail-section-meta {
  margin-top: 0;
}

.detail-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.detail-summary-section {
}

.detail-section-body {
  margin-top: 0.5rem;
}

.ai-badge {
  width: 44px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: linear-gradient(135deg, #c8b6ff 0%, #8b5cf6 55%, #6d28d9 100%);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
}

.ai-badge::before {
  content: "✦";
  margin-right: 3px;
  font-size: 0.72rem;
}

.detail-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0;
}

.detail-section-title {
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

.detail-section-title.detail-loading-title {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.4;
}

.movement-pill {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.45rem 0.75rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
}

.badge-up {
  background: rgba(88, 204, 2, 0.1);
  color: var(--up-color);
}

.badge-down {
  background: rgba(234, 67, 53, 0.1);
  color: var(--down-color);
}

.badge-flat {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.reason-text {
  margin-top: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  line-height: 1.6;
}

.summary-header {
  margin-bottom: 0.75rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

.bullet-list,
.earnings-list {
  list-style: none;
  padding-left: 0;
}

.bullet-list li,
.earnings-list li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  line-height: 1.6;
}

.bullet-list li::before,
.earnings-list li::before {
  content: "✦";
  position: absolute;
  left: 0;
  top: 0.05rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  line-height: 1.6;
}

.earnings-skeleton-row {
  height: 16px;
  margin-bottom: 0;
}

.card-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
  min-height: 1rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.35;
  font-weight: 500;
}

.earnings-card {
  margin-top: 0;
}

.earnings-card.detail-loading-section {
  margin-top: 1rem;
}

.earnings-title {
  color: #ffffff;
}

.earnings-section h4 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: inherit;
  font-weight: 500;
}

.earnings-section + .earnings-section {
  margin-top: 1rem;
}

.earnings-error {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  line-height: 1.6;
}

.legal-text {
  max-width: 500px;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.5;
  opacity: 0.72;
}

.legal-text a {
  color: var(--text-primary);
}

.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  background: #1a1a1a;
  color: transparent;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  animation: shimmer 0.75s infinite;
}

.bottom-sheet {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  visibility: visible;
  pointer-events: auto;
  transition: visibility 0s linear 0s;
}

.bottom-sheet.hidden {
  visibility: hidden;
  pointer-events: none;
}

.bottom-sheet-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 250ms cubic-bezier(0.32, 0, 0, 1);
}

.bottom-sheet .bottom-sheet-overlay {
  opacity: 1;
}

.bottom-sheet.hidden .bottom-sheet-overlay {
  opacity: 0;
}

.bottom-sheet-content {
  position: relative;
  max-height: 50vh;
  overflow-y: auto;
  padding: 1.5rem 1.5rem 54px;
  background: #1a1a1a;
  border-radius: 0;
  border-top: 0;
  transform: translateY(100%);
  transition: transform 250ms cubic-bezier(0.32, 0, 0, 1);
}

.bottom-sheet .bottom-sheet-content {
  transform: translateY(0);
}

.bottom-sheet.hidden .bottom-sheet-content {
  transform: translateY(100%);
}

.bottom-sheet:not(.hidden) .bottom-sheet-content {
  animation: slide-up 250ms cubic-bezier(0.32, 0, 0, 1) forwards;
}

.bottom-sheet.closing .bottom-sheet-overlay {
  opacity: 0;
}

.bottom-sheet.closing .bottom-sheet-content {
  animation: slide-down 250ms cubic-bezier(0.32, 0, 0, 1) forwards;
}

.bottom-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.bottom-sheet-header h3 {
  margin: 0;
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-family);
}

.bottom-sheet-body {
  color: #ffffff;
  font-size: 1rem;
  line-height: 1.6;
  font-family: var(--font-family);
}

.bottom-sheet-body p {
  margin-bottom: 1rem;
}

.sheet-link {
  border: 0;
  background: transparent;
  color: #ffffff;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.sheet-link:hover {
  color: var(--accent-color);
}

.threshold-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 1.5rem;
}

.threshold-option {
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 4px;
  background: transparent;
  color: #ffffff;
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.threshold-option:hover,
.threshold-option.selected {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.threshold-custom {
  width: 100%;
  height: 42px;
  margin-top: 1rem;
  padding: 0 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  background: transparent;
  color: #ffffff;
  font-family: var(--font-family);
  font-size: 16px;
}

.threshold-custom:focus {
  outline: 1px solid var(--accent-color);
  border-color: var(--accent-color);
}

.dismiss-btn {
  width: 100%;
  margin-top: 1.5rem;
  padding: 0.8rem 1rem;
  border: 1px solid #ffffff;
  border-radius: 4px;
  background: transparent;
  color: #ffffff;
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.dismiss-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.hidden {
  display: none !important;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

@keyframes shimmer-bg {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

@keyframes slide-up {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

@keyframes slide-down {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(100%);
  }
}

@media (max-width: 440px), (max-height: 956px) {
  body {
    min-height: 100dvh;
    padding: 0;
    background: var(--deepGreen0);
  }

  .container {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-width: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
    outline: 0;
    box-shadow: none;
  }

  .sticky-header {
    position: relative;
    top: auto;
    z-index: auto;
    margin-top: 0;
    padding: 0 1rem;
    grid-template-rows: 76px;
    border-radius: 0;
  }

  .top-banner {
    display: none;
  }

  .app-title {
    display: none;
  }

  .search-container {
    height: 76px;
    margin-top: 0;
    margin-bottom: 0;
    padding: 16px 0;
  }

  main {
    padding-top: 0;
  }

}
