.memory-hero {
  margin-bottom: 1rem;
}

.memory-signal {
  padding: 0.75rem;
  display: flex;
}

.memory-scan {
  position: relative;
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    radial-gradient(700px 340px at 0% 0%, rgba(148, 199, 195, 0.1), transparent 60%),
    rgba(2, 7, 14, 0.74);
  padding: 1rem 1rem 0.95rem;
  overflow: hidden;
}

.memory-scan::after {
  content: "";
  position: absolute;
  inset: -40% -70%;
  background: linear-gradient(110deg, rgba(255, 255, 255, 0), rgba(148, 199, 195, 0.12), rgba(255, 255, 255, 0));
  transform: translateX(-55%) rotate(8deg);
  animation: memory-scan-pass 4.6s linear infinite;
  pointer-events: none;
}

.memory-signal-kicker {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-3);
  font-weight: 700;
}

.memory-signal-title {
  margin: 0.5rem 0 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.54rem;
  display: inline-flex;
  align-items: center;
  gap: 0.46rem;
}

.memory-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f16666;
  box-shadow: 0 0 0 0 rgba(241, 102, 102, 0.8);
  animation: memory-dot-pulse 2s infinite;
}

.memory-stats {
  margin: 0.7rem 0 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.38rem;
}

.memory-stats li {
  color: #d4ddd7;
}

.memory-stats i {
  width: 1rem;
  color: var(--accent-3);
  margin-right: 0.34rem;
}

.history-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-soft);
  padding: 0.95rem;
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-bottom: 0.72rem;
}

.history-mode {
  margin: 0;
  font-size: 0.73rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-3);
  font-weight: 700;
}

.history-tz {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.history-controls {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(150px, 190px) auto auto;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.72rem;
}

.history-field {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.24);
  height: 39px;
  padding: 0 0.58rem;
}

.history-field i {
  color: var(--accent-3);
}

.history-field input {
  min-width: 0;
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: #eef1ea;
  font-size: 0.9rem;
}

.history-field input::-webkit-calendar-picker-indicator {
  filter: invert(100%) brightness(0.75);
}

.history-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.34rem;
  border-color: rgba(255, 255, 255, 0.28);
  text-align: center;
  line-height: 1.2;
  white-space: normal;
}

.history-btn.is-active {
  border-color: rgba(242, 184, 79, 0.72);
  background: rgba(242, 184, 79, 0.15);
  color: #fff4d6;
}

.history-table-wrap {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  overflow: auto;
  background: rgba(0, 0, 0, 0.26);
}

.history-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
}

.history-table th,
.history-table td {
  padding: 0.58rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: top;
}

.history-table thead th {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #d9e0d4;
  background: rgba(255, 255, 255, 0.03);
}

.history-table tbody tr:last-child td {
  border-bottom: none;
}

.hist-date,
.hist-time {
  white-space: nowrap;
  font-family: "JetBrains Mono", "SFMono-Regular", Menlo, monospace;
  color: #e6eccc;
  font-size: 0.82rem;
}

.hist-title {
  margin: 0;
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.hist-meta {
  margin: 0.12rem 0 0;
  color: #aeb9d6;
  font-size: 0.81rem;
  line-height: 1.24;
  overflow-wrap: anywhere;
}

.history-empty {
  color: #bdc5b8;
  font-size: 0.9rem;
}

@media (max-width: 991.98px) {
  .history-controls {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 575.98px) {
  .memory-signal-title {
    font-size: 1.36rem;
  }

  .memory-stats {
    font-size: 0.9rem;
  }

  .history-shell {
    padding: 0.78rem;
  }

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

  .history-btn {
    width: 100%;
  }

  .history-table {
    min-width: 0;
    table-layout: fixed;
    width: 100%;
  }

  .history-table th,
  .history-table td {
    padding: 0.5rem 0.45rem;
    font-size: 0.82rem;
  }

  .history-table th:nth-child(1),
  .history-table td:nth-child(1) {
    width: 84px;
  }

  .history-table th:nth-child(2),
  .history-table td:nth-child(2) {
    width: 66px;
  }

  .hist-title {
    font-size: 0.84rem;
    line-height: 1.22;
  }

  .hist-meta {
    font-size: 0.74rem;
  }
}

@media (max-width: 430px) {
  .memory-scan {
    padding: 0.88rem 0.86rem 0.84rem;
  }

  .memory-signal-kicker {
    font-size: 0.68rem;
  }

  .memory-signal-title {
    font-size: 1.24rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .memory-scan::after,
  .memory-dot {
    animation: none !important;
  }
}

@keyframes memory-dot-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(241, 102, 102, 0.8);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(241, 102, 102, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(241, 102, 102, 0);
  }
}

@keyframes memory-scan-pass {
  0% {
    transform: translateX(-55%) rotate(8deg);
  }
  100% {
    transform: translateX(55%) rotate(8deg);
  }
}
