.l2m-history-page {
  width: min(calc(100% - 40px), 1120px);
}

.l2m-history-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 28px;
  margin-bottom: 34px;
}

.l2m-history-heading h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2.15rem, 5vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.l2m-history-lead {
  max-width: 720px;
  margin: 16px 0 0;
  color: var(--l2m-ink-soft);
  font-size: 1rem;
  line-height: 1.6;
}

.l2m-history-new-button {
  flex: 0 0 auto;
  border-color: var(--l2m-primary);
  background: var(--l2m-primary);
  box-shadow: 0 9px 18px rgba(20, 107, 91, 0.2);
  color: #fff;
}

.l2m-history-new-button:hover {
  background: var(--l2m-primary-deep);
  transform: translateY(-2px);
}

.l2m-history-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 13px;
  padding: 0 4px;
  color: var(--l2m-ink-soft);
  font-size: 0.86rem;
}

.l2m-history-overview p {
  margin: 0;
}

.l2m-history-overview p:first-child {
  color: var(--l2m-ink);
  font-weight: 800;
}

.l2m-history-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.l2m-history-card {
  display: grid;
  min-height: 132px;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 21px 22px;
  border: 1px solid rgba(125, 128, 119, 0.28);
  border-radius: 21px;
  background: rgba(255, 253, 248, 0.97);
  box-shadow: var(--l2m-shadow-small);
  color: var(--l2m-ink);
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.l2m-history-card:hover {
  border-color: rgba(20, 107, 91, 0.52);
  box-shadow: 0 15px 34px rgba(29, 41, 37, 0.12);
  transform: translateY(-2px);
}

.l2m-history-card-icon,
.l2m-history-empty-icon {
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: var(--l2m-primary-soft);
  color: var(--l2m-primary-deep);
}

.l2m-history-card-icon {
  width: 52px;
  height: 52px;
}

.l2m-history-card-content {
  min-width: 0;
}

.l2m-history-title-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.l2m-history-title-row h2 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 1.1rem;
  font-weight: 850;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.l2m-history-category,
.l2m-history-role {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 850;
}

.l2m-history-category {
  padding: 5px 9px;
  background: var(--l2m-sun-soft);
  color: #6c4a00;
}

.l2m-history-preview {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 8px;
  margin: 9px 0 10px;
  color: var(--l2m-ink-soft);
  line-height: 1.45;
}

.l2m-history-preview > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.l2m-history-preview.is-placeholder {
  font-style: italic;
}

.l2m-history-role {
  padding: 2px 7px;
  background: var(--l2m-surface-soft);
  color: var(--l2m-primary-deep);
}

.l2m-history-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 15px;
  color: var(--l2m-ink-soft);
  font-size: 0.78rem;
}

.l2m-history-meta time {
  font: inherit;
}

.l2m-history-resume {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  border-radius: 13px;
  background: var(--l2m-primary-soft);
  color: var(--l2m-primary-deep);
  font-size: 0.83rem;
  font-weight: 850;
}

.l2m-history-empty {
  display: flex;
  min-height: 390px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 42px 24px;
  border: 1px dashed rgba(20, 107, 91, 0.42);
  border-radius: 24px;
  background: rgba(255, 253, 248, 0.78);
  text-align: center;
}

.l2m-history-empty-icon {
  width: 68px;
  height: 68px;
  margin-bottom: 20px;
}

.l2m-history-empty h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2rem);
  letter-spacing: -0.035em;
}

.l2m-history-empty p {
  max-width: 520px;
  margin: 11px 0 23px;
  color: var(--l2m-ink-soft);
  line-height: 1.6;
}

@media (max-width: 820px) {
  .l2m-history-page {
    width: min(calc(100% - 24px), 680px);
  }

  .l2m-history-heading {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 20px;
  }

  .l2m-history-heading .l2m-history-new-button {
    justify-self: start;
  }
}

@media (max-width: 620px) {
  .l2m-history-heading h1 {
    font-size: clamp(2.15rem, 11vw, 3.4rem);
  }

  .l2m-history-overview {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .l2m-history-card {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 14px;
    padding: 18px;
  }

  .l2m-history-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .l2m-history-resume {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 430px) {
  .l2m-history-heading .l2m-history-new-button,
  .l2m-history-empty .l2m-history-new-button {
    width: 100%;
  }

  .l2m-history-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .l2m-history-title-row h2,
  .l2m-history-preview > span:last-child {
    white-space: normal;
  }

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

  .l2m-history-card-icon,
  .l2m-history-resume {
    grid-column: 1;
  }
}

@media (prefers-contrast: more) {
  .l2m-history-card,
  .l2m-history-empty {
    border-width: 2px;
    border-color: currentColor;
  }
}
