/* history.css — вынесен из auth-history.css */
.auth-screen .subtitle,
.history-screen .subtitle {
  text-align: center;
  margin: 0;
}

.auth-form,
.auth-actions,
.history-actions,
.daily-result-actions,
.result-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* full-width auth/history/daily: morph + силуэтный ореол (btn-shell-stretch), не прямоугольный halo */
.auth-actions .btn-shell-stretch,
.history-actions .btn-shell-stretch,
.daily-result-actions .btn-shell-stretch,
.result-actions .btn-shell-stretch {
  display: flex;
  width: 100%;
  overflow: visible;
}
.history-toolbar {
  display: flex;
  justify-content: stretch;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 0.75rem;
  width: 100%;
  overflow: visible;
}

.history-toolbar .history-clear-btn,
.history-toolbar > .btn-shell:has(.history-clear-btn) {
  flex: 1 1 100%;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  align-self: stretch;
  box-sizing: border-box;
}

.history-toolbar > .btn-shell:has(.history-clear-btn) {
  display: flex;
}

.history-toolbar .history-clear-btn {
  width: 100%;
  max-width: 100%;
  justify-content: center;
}

.history-mode-filter-dropdown {
  flex: 1 1 100%;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
}

.history-mode-filter-dropdown > .btn-shell,
.history-mode-filter-dropdown > .btn-shell-stretch {
  display: flex;
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

.history-mode-filter-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  /* morph clip-path съедает края — запас как у intro debug dropdown */
  padding: 10px max(28px, 10%) 10px max(18px, 6%);
  box-sizing: border-box;
  overflow: visible;
}

.history-mode-filter-trigger .app-dropdown-trigger-label {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 6px;
}

.history-mode-filter-trigger .app-dropdown-trigger-caret {
  position: absolute;
  z-index: 2;
  /* % от ширины — иначе на wide morph caret уезжает за clip-path */
  right: max(22px, 8%);
  top: 50%;
  flex: 0 0 auto;
}

.history-mode-filter-options {
  left: 0;
  right: auto;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.history-list.is-loading {
  opacity: 0.72;
  pointer-events: none;
}

.history-pager {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.history-pager-btn {
  min-height: 40px;
}

.history-pager > .btn-shell:first-child,
.history-pager > .history-pager-btn:first-child {
  justify-self: start;
}

.history-pager > .btn-shell:last-child,
.history-pager > .history-pager-btn:last-child {
  justify-self: end;
}

.history-pager-label {
  text-align: center;
  font-size: 0.88rem;
  opacity: 0.82;
  white-space: nowrap;
}

.history-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: stretch;
}

.history-item-row--solo {
  grid-template-columns: minmax(0, 1fr);
}

.history-item {
  text-align: left;
  display: grid;
  gap: 0.25rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--cyan) 28%, transparent);
  background: color-mix(in srgb, var(--bg-soft) 72%, transparent);
  color: inherit;
  cursor: pointer;
  width: 100%;
  min-width: 0;
}

.history-item-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 0 0.65rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--cyan) 28%, transparent);
  background: color-mix(in srgb, var(--bg-soft) 72%, transparent);
  color: inherit;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.78;
}

.history-item-delete:hover,
.history-item-delete:focus-visible {
  opacity: 1;
}

.history-item-mode {
  font-weight: 650;
  font-size: clamp(1.05rem, 2.8vw, 1.2rem);
}

.history-item-meta {
  font-size: clamp(0.92rem, 2.4vw, 1.02rem);
  opacity: 0.7;
}

.history-item-preview {
  font-size: clamp(1.12rem, 3.2vw, 1.35rem);
  opacity: 0.92;
  line-height: 1.35;
  font-family: var(--font-display);
  letter-spacing: 0.01em;
}

/* Деталка истории = те же блоки, что result/daily после гадания */
.history-screen--detail {
  width: min(960px, 100%);
}

.history-screen--detail .result-screen {
  width: 100%;
  margin-top: 0;
}

.history-screen--detail .history-detail-meta {
  opacity: 0.78;
  font-size: 0.9rem;
}

.history-screen--detail .history-daily-result .daily-result {
  /* в истории без entrance-анимации выбора */
  opacity: 1;
  transform: none;
  transition: none;
}

.app-shell[data-stage="auth-login"] .top-bar,
.app-shell[data-stage="auth-register"] .top-bar,
.app-shell[data-stage="history"] .top-bar,
.app-shell[data-stage="profile"] .top-bar {
  margin-bottom: 0;
}

