.auth-pending body {
  visibility: hidden;
}

.history-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 88% 8%, rgba(35, 108, 82, 0.08), transparent 30rem),
    #edf1ed;
}

.history-shell {
  min-height: 100vh;
}

.history-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
}

.history-new-button {
  border-color: var(--green-700);
  background: var(--green-700);
  color: white;
}

.history-new-button:hover {
  background: var(--green-800);
  color: white;
}

.history-main {
  width: min(1460px, calc(100% - 64px));
  margin: 0 auto;
  padding: 58px 0 78px;
}

.history-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 36px;
}

.history-heading h1 {
  margin: 10px 0 8px;
  color: var(--green-900);
  font-family: var(--serif);
  font-size: clamp(46px, 5.4vw, 72px);
  font-weight: 500;
  letter-spacing: -0.052em;
  line-height: 1;
}

.history-heading p {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.history-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  min-width: 310px;
  overflow: hidden;
  border: 1px solid #d1d9d3;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 26px rgba(13, 47, 38, 0.05);
}

.history-summary div {
  padding: 17px 20px;
}

.history-summary div + div {
  border-left: 1px solid #dce2de;
}

.history-summary strong,
.history-summary span {
  display: block;
}

.history-summary strong {
  color: var(--green-900);
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
}

.history-summary span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.history-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-top: 44px;
  padding: 14px 16px 14px 20px;
  border: 1px solid #d5ddd7;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.66);
}

.history-controls label {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
}

.history-search-wrap {
  position: relative;
  width: min(100%, 390px);
}

.history-search-wrap svg {
  position: absolute;
  top: 50%;
  left: 13px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #718078;
  stroke-linecap: round;
  stroke-width: 1.7;
  transform: translateY(-50%);
}

.history-search-wrap input {
  width: 100%;
  min-height: 42px;
  padding: 0 14px 0 39px;
  border: 1px solid #ccd6cf;
  border-radius: 8px;
  outline: none;
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}

.history-search-wrap input:focus {
  border-color: var(--green-700);
  box-shadow: 0 0 0 4px rgba(35, 108, 82, 0.09);
}

.history-workspace {
  display: grid;
  grid-template-columns: minmax(320px, 0.37fr) minmax(0, 0.63fr);
  min-height: 690px;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid #d1dad3;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 20px 55px rgba(13, 47, 38, 0.08);
}

.history-list-panel {
  min-width: 0;
  border-right: 1px solid #dbe2dc;
  background: rgba(247, 249, 247, 0.94);
}

.history-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 23px 22px 15px;
}

.history-list-heading h2 {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.history-list-heading span {
  color: var(--muted);
  font-size: 11px;
}

.history-list {
  display: grid;
  gap: 8px;
  padding: 0 12px 18px;
}

.history-card {
  width: 100%;
  padding: 17px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  text-align: left;
  box-shadow: none;
}

.history-card:hover {
  border-color: #d5ddd7;
  background: white;
}

.history-card.active {
  border-color: #afc6b8;
  background: #f2f8f4;
  box-shadow: 0 7px 18px rgba(18, 61, 49, 0.07);
}

.history-card-top,
.history-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.history-card strong {
  overflow: hidden;
  color: var(--green-900);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-status {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  background: #e7ede9;
  color: #647169;
  font-size: 8.5px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.history-status.ready {
  background: #dcecdf;
  color: #245f45;
}

.history-card > p {
  min-height: 19px;
  margin: 7px 0 12px;
  overflow: hidden;
  color: #67736c;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-card-meta {
  color: #87928c;
  font-size: 9.5px;
}

.history-loading,
.history-empty-list,
.history-error {
  padding: 42px 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.history-detail-panel {
  min-width: 0;
  padding: 28px;
  overflow: auto;
  background:
    radial-gradient(circle at 82% 10%, rgba(35, 108, 82, 0.06), transparent 24rem),
    #e9eeea;
}

.history-detail-empty {
  display: grid;
  min-height: 620px;
  place-items: center;
  align-content: center;
  color: var(--muted);
  text-align: center;
}

.history-detail-empty h2 {
  margin: 18px 0 6px;
  color: var(--green-900);
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
}

.history-detail-empty p {
  margin: 0;
  font-size: 12px;
}

.history-document-icon {
  width: 54px;
  height: 68px;
  border: 1px solid #aebfb4;
  border-radius: 4px;
  background:
    linear-gradient(#b8c7be, #b8c7be) 12px 19px / 28px 2px no-repeat,
    linear-gradient(#cbd5cf, #cbd5cf) 12px 28px / 24px 2px no-repeat,
    linear-gradient(#cbd5cf, #cbd5cf) 12px 37px / 26px 2px no-repeat,
    rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 20px rgba(18, 61, 49, 0.08);
}

.history-detail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(100%, 760px);
  margin: 0 auto 14px;
}

.history-save-meta {
  color: var(--muted);
  font-size: 10px;
}

.history-detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.history-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.history-continue-button {
  border: 1px solid var(--green-700);
  background: var(--green-700);
  color: white;
  box-shadow: 0 7px 18px rgba(18, 61, 49, 0.14);
}

.history-continue-button:hover {
  background: var(--green-800);
}

.history-share-button {
  border: 1px solid #adc2b5;
  background: rgba(255, 255, 255, 0.86);
  color: var(--green-800);
}

.history-share-button:hover {
  border-color: var(--green-700);
  background: white;
}

.history-delete-button {
  padding-inline: 11px;
  border: 1px solid transparent;
  background: transparent;
  color: #9d4b47;
}

.history-delete-button:hover {
  border-color: #e3c2bf;
  background: #fff7f6;
  color: #873a37;
}

.history-action-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.history-delete-backdrop {
  z-index: 140;
}

.history-delete-modal {
  width: min(100%, 470px);
  padding: 36px;
  text-align: left;
}

.history-delete-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 24px;
  border: 1px solid #efcfcc;
  border-radius: 50%;
  background: #fff4f2;
  color: #9d4b47;
}

.history-delete-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.history-delete-modal h2 {
  margin: 8px 0 0;
  color: var(--green-950);
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.history-delete-modal p {
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.history-delete-modal p strong {
  color: var(--ink-soft);
}

.history-delete-actions {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 10px;
  margin-top: 28px;
}

.history-delete-actions button {
  min-height: 46px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 800;
}

.history-cancel-delete {
  border: 1px solid #c8d2cc;
  background: white;
  color: var(--ink-soft);
}

.history-confirm-delete {
  border: 1px solid #963f3b;
  background: #963f3b;
  color: white;
}

.history-confirm-delete:hover {
  background: #7f332f;
}

.history-delete-actions button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.history-resume-paper {
  position: relative;
  width: min(100%, 760px);
  min-height: 900px;
  margin: 0 auto;
  padding: 60px 66px;
  overflow: hidden;
  background: white;
  color: #1d2421;
  box-shadow: 0 12px 38px rgba(13, 47, 38, 0.12);
}

.history-resume-paper::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 9px;
  background: var(--green-700);
  content: "";
}

.history-resume-paper header {
  padding-bottom: 22px;
  border-bottom: 1px solid #b9c6bf;
}

.history-resume-paper h2 {
  margin: 0;
  color: var(--green-900);
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1;
}

.history-resume-headline {
  margin: 9px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.history-resume-contact {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 9.5px;
}

.history-resume-section {
  margin-top: 25px;
}

.history-resume-section > h3 {
  margin: 0 0 11px;
  color: var(--green-800);
  font-size: 9.5px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.history-resume-section > p,
.history-resume-section li {
  color: #37423d;
  font-size: 10.8px;
  line-height: 1.55;
}

.history-experience + .history-experience,
.history-education + .history-education {
  margin-top: 18px;
  padding-top: 17px;
  border-top: 1px solid #e2e7e3;
}

.history-experience-heading,
.history-education-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.history-experience-heading h4,
.history-education-heading h4 {
  margin: 0;
  font-size: 12px;
}

.history-experience-heading span,
.history-education-heading span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 9.5px;
}

.history-experience > p,
.history-education > p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 9.8px;
}

.history-experience ul {
  margin: 10px 0 0;
  padding-left: 17px;
}

.history-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.history-skills span {
  padding: 5px 8px;
  border: 1px solid #d1d9d4;
  border-radius: 4px;
  background: #f6f8f6;
  color: #35453e;
  font-size: 9px;
  font-weight: 700;
}

@media (max-width: 900px) {
  .history-main {
    width: min(100% - 28px, 760px);
    padding-top: 34px;
  }

  .history-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .history-summary {
    width: 100%;
  }

  .history-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .history-search-wrap {
    width: 100%;
  }

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

  .history-list-panel {
    border-right: 0;
    border-bottom: 1px solid #dbe2dc;
  }

  .history-detail-panel {
    padding: 18px 12px;
  }

  .history-resume-paper {
    min-height: 0;
    padding: 44px 32px;
  }
}

@media (max-width: 640px) {
  .history-topbar .topbar-center {
    display: none;
  }

  .history-topbar {
    padding-inline: 14px;
  }

  .history-topbar .avatar-label {
    display: none;
  }

  .history-heading h1 {
    font-size: 48px;
  }

  .history-detail-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .history-detail-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .history-continue-button {
    grid-column: 1 / -1;
  }

  .history-action-button {
    min-height: 46px;
  }

  .history-delete-modal {
    padding: 30px 24px;
  }

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

  .history-resume-paper {
    padding: 40px 24px;
  }

  .history-resume-paper h2 {
    font-size: 31px;
  }
}
