:root {
  color-scheme: light;
  --ink: #1c2925;
  --muted: #66716b;
  --soft: #9aa19b;
  --paper: #f4f1ea;
  --card: #dfddd7;
  --line: #e7e4dc;
  --green: #245c46;
  --green-dark: #174333;
  --mint: #e6f0e9;
  --orange: #c37543;
  --red: #a34537;
  font-family: "Open Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
}

button,
input,
textarea {
  font: inherit;
  border: 0;
}

button {
  cursor: pointer;
}

.page-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 0 52px;
}

.topbar {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  flex-direction: row;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  width: 180px;
  height: 68px;
  text-decoration: none;
}

.wordmark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 0 0;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
}

.setting-picker {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.setting-picker select {
  min-height: 37px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #eae8e1;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  border: none;
}

.save-status {
  margin-right: 7px;
  color: var(--muted);
  font-size: 14px;
}

.save-status.error {
  color: var(--red);
}

.button {
  min-height: 37px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 650;
  transition:
    background 0.15s ease,
    transform 0.15s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-quiet {
  background: #eae8e1;
  color: var(--ink);
}

.button-quiet:hover {
  background: #deddd5;
}

.button-outline {
  background: #e7efe8;
  color: black;
}

.button-muted {
  background: var(--mint);
  color: black;
}

.button-muted:hover {
  background: #d9e9de;
}

main {
  padding: 22px 0 36px;
}

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

.eyebrow {
  margin: 0 0 9px;
  color: black;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0.16em;
}

h2,
h3,
p {
  margin-top: 0;
}

.point-total {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.point-total strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.point-divider {
  margin: 0 2px;
  color: var(--soft);
  font-size: 14px;
  font-weight: 400;
}

.point-caption {
  color: var(--muted);
  font-size: 14px;
}

.point-caption.warning {
  color: var(--red);
}

.card {
  border-radius: 13px;
  background: var(--card);
}

.identity {
  padding: 23px 26px 25px;
}

.section-heading {
  margin-bottom: 19px;
}

.section-heading .eyebrow {
  margin-bottom: 5px;
}

h2 {
  margin-bottom: 0;
  font-size: 25px;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.identity-top {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 17px;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
}

.field > span,
.field-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.field input,
.field textarea,
.skill-name,
.skill-points {
  width: 100%;
  border-radius: 7px;
  outline: none;
  background: #fafaf9;
  color: var(--ink);
  transition: background 0.15s ease;
}

.field input {
  height: 40px;
  padding: 0 11px;
}

.field input:focus,
.field textarea:focus,
.skill-name:focus,
.skill-points:focus {
  background: #fff;
  outline: 2px solid rgb(36 92 70 / 30%);
  outline-offset: 1px;
}

.name-field input {
  height: 46px;
  font-size: 14px;
}

.field-hint {
  min-height: 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 450;
}

.field-hint.warning {
  color: var(--red);
  font-weight: 650;
}

.identity-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px 17px;
  margin-top: 14px;
}

.attributes-section {
  margin-top: 31px;
}

.attributes-section .section-heading {
  margin-bottom: 10px;
}

.attribute-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
}

.attribute-card {
  min-width: 0;
  padding: 18px 16px 15px;
}
.attribute-card[data-category="action"] {
  background-color: #becdc3;
}
.attribute-card[data-category="knowledge"] {
  background-color: #bec3cd;
}
.attribute-card[data-category="social"] {
  background-color: #cdc3be;
}

.attribute-heading {
  display: flex;
  min-height: 67px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 14px;
}

.attribute-heading h3 {
  margin: 0 0 3px;
  font-size: 22px;
  font-weight: 500;
}

.attribute-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.attribute-value {
  display: grid;
  justify-items: end;
  color: black;
}

.attribute-value strong {
  font-size: 38px;
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.attribute-value span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.resource-strip {
  display: flex;
  min-height: 39px;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border-radius: 7px;
  background: #fafaf9;
  color: var(--muted);
  font-size: 14px;
}

.resource-strip strong,
.insight {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.insight {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
  white-space: nowrap;
}

.insight svg {
  width: 18px;
  height: 18px;
  fill: black;
  stroke: black;
  stroke-linejoin: round;
  stroke-width: 1.2;
}

.skill-list {
  display: grid;
  gap: 8px;
  padding: 14px 0 12px;
}

.empty-skills {
  padding: 8px 3px;
  color: var(--soft);
  font-size: 14px;
  line-height: 1.45;
}

.skill-row {
  display: grid;
  grid-template-columns: 27px minmax(70px, 1fr) 62px 32px;
  align-items: center;
  gap: 5px;
  padding: 3px 0;
}

.skill-name {
  height: 31px;
  padding: 0 7px;
  background: #fafaf9;
  font-size: 14px;
}

.skill-name::placeholder {
  color: #9ba29b;
}

.random-skill {
  display: grid;
  width: 25px;
  height: 27px;
  place-items: center;
  padding: 0;
  border-radius: 6px;
  background: #ebebeb;
  color: black;
}

.random-skill:hover {
  background: #dfdfdf;
}

.random-skill:focus-visible {
  outline: 2px solid #80a88d;
  outline-offset: 2px;
}

.random-skill svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.skill-points-label {
  position: relative;
}

.skill-points {
  height: 31px;
  padding: 0 5px 0 5px;
  text-align: right;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  width: 50px;
}

/* Chrome, Safari, Edge, Opera */
.skill-points::-webkit-outer-spin-button,
.skill-points::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.input-suffix {
  position: absolute;
  top: 9px;
  right: 5px;
  color: var(--soft);
  font-size: 8px;
  pointer-events: none;
}

.skill-score {
  color: black;
  font-size: 16px;
  font-weight: 750;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.skill-row-empty .skill-points-label,
.skill-row-empty .skill-score {
  visibility: hidden;
}

.validation-message {
  min-height: 17px;
  margin: 10px 0 0;
  color: var(--red);
  font-size: 14px;
  line-height: 1.5;
}

.validation-message:empty {
  display: none;
}

.extra-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 30px;
  padding: 21px 24px;
}

.field textarea {
  min-height: 112px;
  padding: 10px 11px;
  resize: vertical;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  clip-path: inset(50%) !important;
}

@media (max-width: 1050px) {
  .page-shell {
    padding: 0 28px;
  }

  .attribute-card {
    padding: 19px;
  }

  .attribute-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .page-shell {
    padding: 0 17px;
  }

  .topbar {
    min-height: 68px;
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
    padding: 7px 0 10px;
  }

  .wordmark {
    width: 130px;
    height: 57px;
    flex: 0 0 auto;
  }

  .toolbar {
    width: auto;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .save-status {
    display: none;
  }

  .button-quiet {
    padding-right: 9px;
    padding-left: 9px;
    font-size: 14px;
  }

  main {
    padding-top: 17px;
  }

  .identity {
    padding: 19px 16px;
  }

  .identity-top {
    grid-template-columns: minmax(0, 1fr) 100px;
    gap: 12px;
  }

  .name-field {
    grid-column: 1 / -1;
  }

  .identity-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .attribute-card {
    padding: 16px 12px;
  }

  .skill-row {
    grid-template-columns: 25px minmax(70px, 1fr) 58px 27px;
    gap: 4px;
    padding: 4px;
  }

  .extra-fields {
    grid-template-columns: 1fr;
    gap: 19px;
    padding: 18px 16px;
  }
}

@media print {
  body {
    background: white;
  }

  .page-shell {
    width: 100%;
    padding: 0;
  }

  .topbar {
    display: none !important;
  }

  main {
    padding: 0;
  }

  .attribute-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .skill-row {
    break-inside: avoid;
  }
}
