/* PROXIMA // Sheet and Character Editor: compact layout in line with the newer screens. */

/* ---------------------------------------------------------------- editor */
.ed-root {
  display: grid;
  gap: 12px;
}
.ed-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 18px;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid #ffffff1c;
  background: linear-gradient(120deg, color-mix(in srgb, var(--blue) 10%, #0c0f14), #0c0f14 60%);
}
.ed-who small {
  color: var(--blue);
  font: 700 10px var(--head);
  letter-spacing: 0.16em;
}
.ed-who h2 {
  margin: 1px 0 2px;
  font: 700 24px/1.05 var(--head);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
}
.ed-who p {
  margin: 0;
  color: var(--sub);
  font-size: 12px;
}
.ed-stats {
  display: flex;
  gap: 6px;
}
.ed-stat {
  min-width: 62px;
  padding: 5px 9px;
  border: 1px solid #ffffff1c;
  background: #0b0e13;
  text-align: center;
}
.ed-stat small,
.ed-kv small {
  display: block;
  color: var(--dim);
  font: 700 9px var(--head);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.ed-stat b {
  font: 700 19px var(--head);
  color: #fff;
  white-space: nowrap;
}
.ed-open {
  padding: 7px 12px;
  border: 1px solid;
  font: 700 11px var(--head);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.ed-open.warn {
  color: var(--amber);
  border-color: color-mix(in srgb, var(--amber) 50%, transparent);
  background: color-mix(in srgb, var(--amber) 8%, transparent);
}
.ed-open.good {
  color: var(--green);
  border-color: color-mix(in srgb, var(--green) 40%, transparent);
}
.ed-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 4px;
}
.ed-tab {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #ffffff1c;
  background: #0c0f14;
  color: #c9ccd3;
  text-align: left;
  cursor: pointer;
}
.ed-tab:hover {
  border-color: #ffffff40;
}
.ed-tab.active {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 14%, #0c0f14);
  color: #fff;
  box-shadow: inset 0 -2px 0 var(--blue);
}
.ed-num {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid currentColor;
  font: 700 12px var(--head);
  opacity: 0.8;
}
.ed-tab-text b {
  display: block;
  font: 700 12px var(--head);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.ed-tab-text small {
  display: block;
  overflow: hidden;
  color: var(--dim);
  font-size: 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ed-tab.active .ed-tab-text small {
  color: var(--sub);
}
.ed-badge {
  min-width: 20px;
  padding: 1px 6px;
  background: var(--amber);
  color: #111;
  font: 800 11px var(--head);
  text-align: center;
}
.ed-ok {
  color: var(--green);
  font-size: 12px;
  opacity: 0.7;
}
.ed-body {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.ed-body > *,
.ed-grid > * {
  margin: 0 !important;
  min-width: 0;
}
.ed-body .card {
  padding: 14px 16px;
}
.ed-body .card-title {
  margin-bottom: 10px;
  font-size: 14px;
}
.ed-body .section-title {
  margin: 0;
}
.ed-grid {
  display: grid;
  gap: 12px;
  align-items: start;
}
.ed-grid.two {
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
}
.ed-grid.skills {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
}
.ed-grid.side {
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
}
.ed-kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}
.ed-kv > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid #ffffff14;
  background: #0b0e13;
}
.ed-kv b {
  color: #fff;
  font: 700 16px var(--head);
}
/* denser form controls */
.ed-body .fields {
  gap: 10px 12px;
}
.ed-body select,
.ed-body input:not([type='checkbox']):not([type='radio']):not([type='file']) {
  min-height: 34px;
  padding-top: 6px;
  padding-bottom: 6px;
  font-size: 13px;
}
.ed-body .check-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 18px;
}
.ed-body .check-line {
  min-height: 0;
  padding: 5px 2px;
  font-size: 13px;
}
.ed-body .check-line em {
  color: var(--dim);
  font: 700 9px var(--head);
  font-style: normal;
  letter-spacing: 0.12em;
}
/* ability scores: three cards per row instead of six stretched lines */
.ed-scores .px-score-rows {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.ed-scores .px-score-line {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: 'name nums' 'ctrl ctrl' 'bonus bonus';
  gap: 6px 8px;
  padding: 10px 12px;
}
.ed-scores .px-score-name {
  grid-area: name;
}
.ed-scores .px-score-control {
  grid-area: ctrl;
}
.ed-scores .px-score-numbers {
  grid-area: nums;
  text-align: right;
}
.ed-scores .px-score-numbers strong {
  font: 700 26px/1 var(--head);
}
.ed-scores .px-score-bonus {
  grid-area: bonus;
  font-size: 10px;
}
.ed-scores .px-score-method {
  min-height: 0;
  padding: 8px 10px;
}
.ed-body textarea#character-notes {
  min-height: 180px;
}
/* dossier: keep the portrait column narrow and the fields tight */
.ed-body .px-dz {
  gap: 16px;
  padding: 14px 16px;
}
.ed-body .px-dz-grid {
  gap: 8px 12px;
}
@media (max-width: 1180px) {
  .ed-tabs {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .ed-tabs.n4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ed-tab-text small {
    display: none;
  }
}
@media (max-width: 1000px) {
  .ed-head {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .ed-grid.two,
  .ed-grid.skills,
  .ed-grid.side {
    grid-template-columns: 1fr;
  }
  .ed-scores .px-score-rows {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .ed-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ed-tab {
    gap: 6px;
    padding: 7px 8px;
  }
  .ed-tab-text b {
    font-size: 11px;
    letter-spacing: 0.04em;
    overflow-wrap: anywhere;
  }
  .ed-stats {
    flex-wrap: wrap;
  }
  .ed-stat {
    flex: 1 1 60px;
  }
  .ed-stat b {
    font-size: 16px;
  }
  .ed-head .ed-cta {
    justify-self: start;
  }
  .ed-body .check-grid,
  .ed-scores .px-score-rows {
    grid-template-columns: 1fr;
  }
}

/* shared screen pieces (js/screen-kit.js) */
.ed-cta {
  align-self: center;
  white-space: nowrap;
}
.ed-lede {
  margin: 0 0 12px;
  color: var(--sub);
  font-size: 13px;
}
.ed-rules {
  border: 1px solid #ffffff1c;
  background: #0b0e13;
  padding: 8px 12px;
}
.ed-rules summary {
  cursor: pointer;
  color: var(--blue);
  font: 700 12px var(--head);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ed-rules ul {
  margin: 8px 0 2px;
  padding-left: 18px;
  color: var(--sub);
  font-size: 13px;
  line-height: 1.5;
}
.ed-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.ed-pick {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid #ffffff1c;
  background: #0c0f14;
  color: #c9ccd3;
  text-align: left;
  cursor: pointer;
}
.ed-pick:hover {
  border-color: #ffffff40;
}
.ed-pick b {
  color: #fff;
  font: 700 17px var(--head);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ed-pick small {
  color: var(--dim);
  font-size: 11px;
}
.ed-pick span {
  color: var(--green);
  font: 700 10px var(--head);
  letter-spacing: 0.14em;
}
.ed-pick.on {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 14%, #0c0f14);
  box-shadow: inset 0 -2px 0 var(--blue);
}
/* powers and level up inside the kit */
.ed-root .pw2-body {
  display: grid;
  gap: 12px;
}
.ed-root .pw2-energy {
  margin: 0;
}
.ed-root .px-lu {
  margin: 0;
}

/* ---------------------------------------------------------------- sheet */
.px-sheet2 {
  grid-template-columns: minmax(290px, 340px) minmax(0, 1fr);
  gap: 12px;
}
.px-sheet2 .prox-left,
.px-sheet2 .prox-right {
  gap: 12px;
}
.px-sheet2 .prox-panel {
  padding: 12px 14px;
}
.px-sheet2 .prox-panelhead {
  margin-bottom: 8px;
}
.prox-legend {
  float: right;
  color: var(--dim);
  font: 600 10px var(--font);
  letter-spacing: 0.02em;
  text-transform: none;
}
/* conditions sit in the wide column: four boxes side by side, readable text */
.px-sheet2 .pxd-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
}
.px-sheet2 .pxd-panel :is(select, button, input) {
  font-family: var(--font);
}
/* damage / heal: amount and type on one line, the three buttons below */
.px-sheet2 .prox-quick {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 6px;
}
.px-sheet2 .prox-quick > input,
.px-sheet2 .prox-quick > select {
  max-width: none !important;
  min-width: 0;
  width: 100%;
}
.px-sheet2 .prox-quick > .btn {
  margin: 0;
}
.px-sheet2 .prox-quick > .btn:nth-of-type(1) {
  grid-column: 1 / -1;
}
.px-sheet2 .pxd-turn .btn-row .btn {
  flex: 1 1 auto;
}
.px-sheet2 .pxd-panel {
  padding: 9px 10px;
  gap: 7px;
  font: 12px/1.35 var(--font);
}
.px-sheet2 .pxd-head {
  font: 700 11px var(--head);
  letter-spacing: 0.12em;
}
.px-sheet2 .pxd-panel :is(p, small, .tiny, .muted) {
  font-family: var(--font);
}
.px-sheet2 .prox-mini {
  padding: 5px 0;
}
.px-sheet2 .prox-resource {
  gap: 10px;
}
@media (max-width: 1100px) {
  .px-sheet2 .pxd-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 1250px) {
  .px-sheet2 {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .px-sheet2 .pxd-grid {
    grid-template-columns: 1fr;
  }
  .prox-legend {
    float: none;
    display: block;
    margin-top: 2px;
  }
}
.px-sheet2 .prox-skill {
  min-height: 0;
  padding-top: 3px;
  padding-bottom: 3px;
}
.px-sheet2 .prox-roll-btn {
  padding-top: 3px;
  padding-bottom: 3px;
}
.px-sheet2 .prox-stat {
  padding-top: 8px;
  padding-bottom: 8px;
}
.px-lu-link {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: #ffffff40;
  text-underline-offset: 3px;
  cursor: pointer;
}
.px-lu-link:hover {
  color: #fff;
  text-decoration-color: currentColor;
}
